Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/frontend-main/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<script setup lang="ts">
import ButtonCustom from './components/ui/button/button-custom/ButtonCustom.vue';

Check failure on line 2 in packages/frontend-main/src/App.vue

View workflow job for this annotation

GitHub Actions / api-main-test

'ButtonCustom' is defined but never used. Allowed unused vars must match /^_/u
import Dialog from './components/ui/dialog/Dialog.vue';

Check failure on line 3 in packages/frontend-main/src/App.vue

View workflow job for this annotation

GitHub Actions / api-main-test

'Dialog' is defined but never used. Allowed unused vars must match /^_/u
import ToggleThemeButton from './components/ui/ToggleThemeButton.vue';

import WalletConnect from '@/components/popups/WalletConnect.vue';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<script setup lang="ts">
import type { HTMLAttributes } from 'vue';

import { Primitive, type PrimitiveProps } from 'reka-ui';

import { type ButtonVariants, buttonVariants } from '.';

import { cn } from '@/lib/utils';

interface Props extends PrimitiveProps {
variant?: ButtonVariants['variant'];
size?: ButtonVariants['size'];
class?: HTMLAttributes['class'];
}

const props = withDefaults(defineProps<Props>(), {
as: 'button',
});
</script>

<template>
<Primitive
data-slot="button"
:as="as"
:as-child="asChild"
:class="cn(buttonVariants({ variant, size }), props.class)"
>
<slot />
</Primitive>
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { cva, type VariantProps } from 'class-variance-authority';

export { default as ButtonCustom } from './ButtonCustom.vue';

export const buttonVariants = cva(
'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-xs text-base leading-[normal] font-semibold transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*=\'size-\'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',
{
variants: {
variant: {
default:
'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90',
destructive:
'bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
outline:
'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50',
secondary:
'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80',
ghost:
'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',
link: 'text-primary underline-offset-4 hover:underline',
},
size: {
default: 'h-13 px-4 has-[>svg]:px-3',
sm: 'h-10 rounded-xs gap-1.5 px-3 has-[>svg]:px-2.5',
lg: 'h-15 rounded-xs px-6 has-[>svg]:px-4',
icon: 'size-10',
},
},
defaultVariants: {
variant: 'default',
size: 'default',
},
},
);

export type ButtonVariants = VariantProps<typeof buttonVariants>;
8 changes: 7 additions & 1 deletion packages/frontend-main/src/style.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import url('https://fonts.googleapis.com/css2?family=Inter&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import 'tailwindcss';
@import "tw-animate-css";

Expand Down Expand Up @@ -41,6 +41,12 @@
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
--color-sidebar-border: var(--sidebar-border);
--color-sidebar-ring: var(--sidebar-ring);
--text-2xl: 2rem;
--text-xl: 1.6875rem;
--text-lg: 1.5rem;
--text-base: 1.0625rem;
--text-sm: 0.9375rem;
--text-xs: 0.8125rem;
}

:root {
Expand Down
Loading