diff --git a/packages/ui/src/components/accordion.tsx b/packages/ui/src/components/accordion.tsx index adfde37c4..8ef9e71bd 100644 --- a/packages/ui/src/components/accordion.tsx +++ b/packages/ui/src/components/accordion.tsx @@ -14,6 +14,7 @@ import { } from 'react'; import { cn } from '@/utils/cn'; import { useCopyButton } from '@/utils/use-copy-button'; +import { buttonVariants } from '@/theme/shared'; export const Accordions = forwardRef< HTMLDivElement, @@ -106,7 +107,13 @@ function CopyButton({ id }: { id: string }): JSX.Element { ) : null} diff --git a/packages/ui/src/tailwind-plugin.ts b/packages/ui/src/tailwind-plugin.ts index 7519c0eb7..4c81b0e21 100644 --- a/packages/ui/src/tailwind-plugin.ts +++ b/packages/ui/src/tailwind-plugin.ts @@ -240,7 +240,7 @@ export const docsUi = plugin.withOptions( export function createPreset(options: DocsUIOptions = {}): PresetsConfig { return { - plugins: [...docsUiPlugins, docsUi(options)], + plugins: [typography, docsUi(options)], }; } diff --git a/packages/ui/src/theme/animations.ts b/packages/ui/src/theme/animations.ts index 56da8988d..c663e7052 100644 --- a/packages/ui/src/theme/animations.ts +++ b/packages/ui/src/theme/animations.ts @@ -47,7 +47,6 @@ export const animations = { to: { opacity: '1' }, }, 'fade-out': { - from: { opacity: '1' }, to: { opacity: '0' }, }, }, diff --git a/packages/ui/src/theme/shared.ts b/packages/ui/src/theme/shared.ts new file mode 100644 index 000000000..af66c17db --- /dev/null +++ b/packages/ui/src/theme/shared.ts @@ -0,0 +1,20 @@ +import { cva } from 'class-variance-authority'; + +export const buttonVariants = cva( + 'inline-flex items-center justify-center rounded-md p-2 text-sm font-medium transition-colors duration-100', + { + variants: { + color: { + outline: 'border hover:bg-accent hover:text-accent-foreground', + ghost: 'hover:bg-accent hover:text-accent-foreground', + secondary: + 'border bg-secondary text-secondary-foreground hover:bg-accent hover:text-accent-foreground', + muted: + 'bg-muted text-secondary-foreground hover:bg-accent hover:text-accent-foreground', + }, + size: { + icon: 'p-1.5 [&_svg]:h-5 [&_svg]:w-5', + }, + }, + }, +);