@trycompai/design-system 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/package.json +2 -2
  2. package/src/components/atoms/index.ts +19 -0
  3. package/src/components/atoms/kbd.tsx +21 -0
  4. package/src/components/{ui → atoms}/slider.tsx +4 -4
  5. package/src/components/{ui → atoms}/textarea.tsx +8 -2
  6. package/src/components/{ui → atoms}/toggle.tsx +2 -5
  7. package/src/components/{ui → molecules}/breadcrumb.tsx +1 -1
  8. package/src/components/molecules/empty.tsx +82 -0
  9. package/src/components/{ui → molecules}/field.tsx +16 -37
  10. package/src/components/{ui → molecules}/hover-card.tsx +2 -8
  11. package/src/components/molecules/index.ts +26 -0
  12. package/src/components/{ui → molecules}/input-group.tsx +1 -1
  13. package/src/components/molecules/input-otp.tsx +70 -0
  14. package/src/components/{ui → molecules}/item.tsx +18 -36
  15. package/src/components/{ui → molecules}/page-header.tsx +2 -2
  16. package/src/components/{ui → molecules}/pagination.tsx +10 -19
  17. package/src/components/{ui → molecules}/radio-group.tsx +4 -8
  18. package/src/components/{ui → molecules}/scroll-area.tsx +8 -11
  19. package/src/components/{ui → molecules}/section.tsx +2 -2
  20. package/src/components/{ui → molecules}/select.tsx +17 -5
  21. package/src/components/{ui → molecules}/table.tsx +11 -2
  22. package/src/components/{ui → molecules}/toggle-group.tsx +1 -1
  23. package/src/components/organisms/alert-dialog.tsx +135 -0
  24. package/src/components/{ui → organisms}/calendar.tsx +2 -3
  25. package/src/components/{ui → organisms}/carousel.tsx +6 -8
  26. package/src/components/{ui → organisms}/chart.tsx +9 -24
  27. package/src/components/{ui → organisms}/combobox.tsx +2 -2
  28. package/src/components/{ui → organisms}/context-menu.tsx +19 -49
  29. package/src/components/{ui → organisms}/dialog.tsx +1 -1
  30. package/src/components/organisms/index.ts +16 -0
  31. package/src/components/organisms/navigation-menu.tsx +137 -0
  32. package/src/components/{ui → organisms}/sheet.tsx +6 -6
  33. package/src/components/{ui → organisms}/sidebar.tsx +42 -83
  34. package/src/components/{ui → organisms}/sonner.tsx +7 -9
  35. package/src/components/ui/index.ts +3 -61
  36. package/src/styles/globals.css +12 -0
  37. package/src/components/ui/alert-dialog.tsx +0 -161
  38. package/src/components/ui/empty.tsx +0 -94
  39. package/src/components/ui/input-otp.tsx +0 -84
  40. package/src/components/ui/kbd.tsx +0 -26
  41. package/src/components/ui/navigation-menu.tsx +0 -147
  42. /package/src/components/{ui → atoms}/aspect-ratio.tsx +0 -0
  43. /package/src/components/{ui → atoms}/avatar.tsx +0 -0
  44. /package/src/components/{ui → atoms}/badge.tsx +0 -0
  45. /package/src/components/{ui → atoms}/button.tsx +0 -0
  46. /package/src/components/{ui → atoms}/checkbox.tsx +0 -0
  47. /package/src/components/{ui → atoms}/container.tsx +0 -0
  48. /package/src/components/{ui → atoms}/heading.tsx +0 -0
  49. /package/src/components/{ui → atoms}/input.tsx +0 -0
  50. /package/src/components/{ui → atoms}/label.tsx +0 -0
  51. /package/src/components/{ui → atoms}/progress.tsx +0 -0
  52. /package/src/components/{ui → atoms}/separator.tsx +0 -0
  53. /package/src/components/{ui → atoms}/skeleton.tsx +0 -0
  54. /package/src/components/{ui → atoms}/spinner.tsx +0 -0
  55. /package/src/components/{ui → atoms}/switch.tsx +0 -0
  56. /package/src/components/{ui → atoms}/text.tsx +0 -0
  57. /package/src/components/{ui → molecules}/accordion.tsx +0 -0
  58. /package/src/components/{ui → molecules}/alert.tsx +0 -0
  59. /package/src/components/{ui → molecules}/button-group.tsx +0 -0
  60. /package/src/components/{ui → molecules}/card.tsx +0 -0
  61. /package/src/components/{ui → molecules}/collapsible.tsx +0 -0
  62. /package/src/components/{ui → molecules}/grid.tsx +0 -0
  63. /package/src/components/{ui → molecules}/popover.tsx +0 -0
  64. /package/src/components/{ui → molecules}/resizable.tsx +0 -0
  65. /package/src/components/{ui → molecules}/stack.tsx +0 -0
  66. /package/src/components/{ui → molecules}/tabs.tsx +0 -0
  67. /package/src/components/{ui → molecules}/tooltip.tsx +0 -0
  68. /package/src/components/{ui → organisms}/command.tsx +0 -0
  69. /package/src/components/{ui → organisms}/drawer.tsx +0 -0
  70. /package/src/components/{ui → organisms}/dropdown-menu.tsx +0 -0
  71. /package/src/components/{ui → organisms}/menubar.tsx +0 -0
  72. /package/src/components/{ui → organisms}/page-layout.tsx +0 -0
@@ -1,33 +1,27 @@
1
1
  import { Button as ButtonPrimitive } from '@base-ui/react/button';
2
- import * as React from 'react';
3
2
 
4
3
  import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from 'lucide-react';
5
- import { cn } from '../../../lib/utils';
6
- import { buttonVariants } from './button';
4
+ import { buttonVariants } from '../atoms/button';
7
5
 
8
- function Pagination({ className, ...props }: React.ComponentProps<'nav'>) {
6
+ function Pagination({ ...props }: Omit<React.ComponentProps<'nav'>, 'className'>) {
9
7
  return (
10
8
  <nav
11
9
  role="navigation"
12
10
  aria-label="pagination"
13
11
  data-slot="pagination"
14
- className={cn('mx-auto flex w-full justify-center', className)}
12
+ className="mx-auto flex w-full justify-center"
15
13
  {...props}
16
14
  />
17
15
  );
18
16
  }
19
17
 
20
- function PaginationContent({ className, ...props }: React.ComponentProps<'ul'>) {
18
+ function PaginationContent({ ...props }: Omit<React.ComponentProps<'ul'>, 'className'>) {
21
19
  return (
22
- <ul
23
- data-slot="pagination-content"
24
- className={cn('gap-1 flex items-center', className)}
25
- {...props}
26
- />
20
+ <ul data-slot="pagination-content" className="gap-1 flex items-center" {...props} />
27
21
  );
28
22
  }
29
23
 
30
- function PaginationItem({ ...props }: React.ComponentProps<'li'>) {
24
+ function PaginationItem({ ...props }: Omit<React.ComponentProps<'li'>, 'className'>) {
31
25
  return <li data-slot="pagination-item" {...props} />;
32
26
  }
33
27
 
@@ -55,7 +49,7 @@ function PaginationLink({ isActive, size = 'icon', ...props }: PaginationLinkPro
55
49
  function PaginationPrevious({ ...props }: Omit<PaginationLinkProps, 'size'>) {
56
50
  return (
57
51
  <ButtonPrimitive
58
- className={cn(buttonVariants({ variant: 'ghost', size: 'default' }), 'pl-2')}
52
+ className={`${buttonVariants({ variant: 'ghost', size: 'default' })} pl-2`}
59
53
  render={<a aria-label="Go to previous page" data-slot="pagination-link" {...props} />}
60
54
  >
61
55
  <ChevronLeftIcon data-icon="inline-start" />
@@ -67,7 +61,7 @@ function PaginationPrevious({ ...props }: Omit<PaginationLinkProps, 'size'>) {
67
61
  function PaginationNext({ ...props }: Omit<PaginationLinkProps, 'size'>) {
68
62
  return (
69
63
  <ButtonPrimitive
70
- className={cn(buttonVariants({ variant: 'ghost', size: 'default' }), 'pr-2')}
64
+ className={`${buttonVariants({ variant: 'ghost', size: 'default' })} pr-2`}
71
65
  render={<a aria-label="Go to next page" data-slot="pagination-link" {...props} />}
72
66
  >
73
67
  <span className="hidden sm:block">Next</span>
@@ -76,15 +70,12 @@ function PaginationNext({ ...props }: Omit<PaginationLinkProps, 'size'>) {
76
70
  );
77
71
  }
78
72
 
79
- function PaginationEllipsis({ className, ...props }: React.ComponentProps<'span'>) {
73
+ function PaginationEllipsis({ ...props }: Omit<React.ComponentProps<'span'>, 'className'>) {
80
74
  return (
81
75
  <span
82
76
  aria-hidden
83
77
  data-slot="pagination-ellipsis"
84
- className={cn(
85
- "size-9 items-center justify-center [&_svg:not([class*='size-'])]:size-4 flex items-center justify-center",
86
- className,
87
- )}
78
+ className="size-9 items-center justify-center [&_svg:not([class*='size-'])]:size-4 flex items-center justify-center"
88
79
  {...props}
89
80
  >
90
81
  <MoreHorizontalIcon />
@@ -2,26 +2,22 @@ import { Radio as RadioPrimitive } from '@base-ui/react/radio';
2
2
  import { RadioGroup as RadioGroupPrimitive } from '@base-ui/react/radio-group';
3
3
 
4
4
  import { CircleIcon } from 'lucide-react';
5
- import { cn } from '../../../lib/utils';
6
5
 
7
- function RadioGroup({ className, ...props }: RadioGroupPrimitive.Props) {
6
+ function RadioGroup({ ...props }: Omit<RadioGroupPrimitive.Props, 'className'>) {
8
7
  return (
9
8
  <RadioGroupPrimitive
10
9
  data-slot="radio-group"
11
- className={cn('grid gap-2 w-full', className)}
10
+ className="grid gap-2 w-full"
12
11
  {...props}
13
12
  />
14
13
  );
15
14
  }
16
15
 
17
- function RadioGroupItem({ className, ...props }: RadioPrimitive.Root.Props) {
16
+ function RadioGroupItem({ ...props }: Omit<RadioPrimitive.Root.Props, 'className'>) {
18
17
  return (
19
18
  <RadioPrimitive.Root
20
19
  data-slot="radio-group-item"
21
- className={cn(
22
- 'border-input text-primary dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 flex size-4 rounded-full shadow-xs focus-visible:ring-[3px] aria-invalid:ring-[3px] group/radio-group-item peer relative aspect-square shrink-0 border outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50',
23
- className,
24
- )}
20
+ className="border-input text-primary dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 flex size-4 rounded-full shadow-xs focus-visible:ring-[3px] aria-invalid:ring-[3px] group/radio-group-item peer relative aspect-square shrink-0 border outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50"
25
21
  {...props}
26
22
  >
27
23
  <RadioPrimitive.Indicator
@@ -1,17 +1,18 @@
1
1
  import { ScrollArea as ScrollAreaPrimitive } from '@base-ui/react/scroll-area';
2
2
 
3
- import { cn } from '../../../lib/utils';
4
-
5
- function ScrollArea({ className, children, ...props }: ScrollAreaPrimitive.Root.Props) {
3
+ function ScrollArea({
4
+ children,
5
+ ...props
6
+ }: Omit<ScrollAreaPrimitive.Root.Props, 'className'>) {
6
7
  return (
7
8
  <ScrollAreaPrimitive.Root
8
9
  data-slot="scroll-area"
9
- className={cn('relative', className)}
10
+ className="relative overflow-hidden size-full"
10
11
  {...props}
11
12
  >
12
13
  <ScrollAreaPrimitive.Viewport
13
14
  data-slot="scroll-area-viewport"
14
- className="focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1"
15
+ className="focus-visible:ring-ring/50 size-full overflow-auto rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1"
15
16
  >
16
17
  {children}
17
18
  </ScrollAreaPrimitive.Viewport>
@@ -22,19 +23,15 @@ function ScrollArea({ className, children, ...props }: ScrollAreaPrimitive.Root.
22
23
  }
23
24
 
24
25
  function ScrollBar({
25
- className,
26
26
  orientation = 'vertical',
27
27
  ...props
28
- }: ScrollAreaPrimitive.Scrollbar.Props) {
28
+ }: Omit<ScrollAreaPrimitive.Scrollbar.Props, 'className'>) {
29
29
  return (
30
30
  <ScrollAreaPrimitive.Scrollbar
31
31
  data-slot="scroll-area-scrollbar"
32
32
  data-orientation={orientation}
33
33
  orientation={orientation}
34
- className={cn(
35
- 'data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent flex touch-none p-px transition-colors select-none',
36
- className,
37
- )}
34
+ className="data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent flex touch-none p-px transition-colors select-none"
38
35
  {...props}
39
36
  >
40
37
  <ScrollAreaPrimitive.Thumb
@@ -1,8 +1,8 @@
1
1
  import * as React from 'react';
2
2
 
3
- import { Heading } from './heading';
3
+ import { Heading } from '../atoms/heading';
4
+ import { Text } from '../atoms/text';
4
5
  import { Stack } from './stack';
5
- import { Text } from './text';
6
6
 
7
7
  interface SectionProps extends Omit<React.ComponentProps<'section'>, 'className'> {
8
8
  title?: string;
@@ -18,9 +18,21 @@ function SelectValue({
18
18
  placeholder?: string;
19
19
  }) {
20
20
  return (
21
- <SelectPrimitive.Value data-slot="select-value" className="flex flex-1 text-left" {...props}>
22
- {placeholder}
23
- </SelectPrimitive.Value>
21
+ <>
22
+ <SelectPrimitive.Value
23
+ data-slot="select-value"
24
+ className="flex-1 text-left data-[placeholder]:hidden"
25
+ {...props}
26
+ />
27
+ {placeholder && (
28
+ <span
29
+ data-slot="select-placeholder"
30
+ className="text-muted-foreground [[data-slot=select-value]:not([data-placeholder])~&]:hidden"
31
+ >
32
+ {placeholder}
33
+ </span>
34
+ )}
35
+ </>
24
36
  );
25
37
  }
26
38
 
@@ -35,7 +47,7 @@ function SelectTrigger({
35
47
  <SelectPrimitive.Trigger
36
48
  data-slot="select-trigger"
37
49
  data-size={size}
38
- className="border-input data-[placeholder]:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-lg border bg-transparent py-2 pr-2 pl-2.5 text-sm transition-colors select-none focus-visible:ring-[3px] aria-invalid:ring-[3px] data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:flex *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-4 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0"
50
+ className="border-input data-[placeholder]:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-lg border bg-transparent py-2 pr-2 pl-2.5 text-sm transition-colors select-none focus-visible:ring-[3px] aria-invalid:ring-[3px] data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:flex *:data-[slot=select-value]:data-[placeholder]:absolute *:data-[slot=select-value]:data-[placeholder]:w-0 *:data-[slot=select-value]:data-[placeholder]:overflow-hidden *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-4 flex w-full items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0"
39
51
  {...props}
40
52
  >
41
53
  {children}
@@ -71,7 +83,7 @@ function SelectContent({
71
83
  >
72
84
  <SelectPrimitive.Popup
73
85
  data-slot="select-content"
74
- className="bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 min-w-36 rounded-lg shadow-md ring-1 duration-100 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto"
86
+ className="bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 min-w-(--anchor-width) max-w-80 rounded-lg p-1 shadow-md ring-1 duration-100 relative isolate z-50 max-h-(--available-height) origin-(--transform-origin) overflow-x-hidden overflow-y-auto"
75
87
  {...props}
76
88
  >
77
89
  <SelectScrollUpButton />
@@ -1,8 +1,17 @@
1
1
  import * as React from 'react';
2
2
 
3
- function Table({ ...props }: Omit<React.ComponentProps<'table'>, 'className'>) {
3
+ function Table({
4
+ variant = 'default',
5
+ ...props
6
+ }: Omit<React.ComponentProps<'table'>, 'className'> & {
7
+ variant?: 'default' | 'bordered';
8
+ }) {
4
9
  return (
5
- <div data-slot="table-container" className="relative w-full overflow-x-auto">
10
+ <div
11
+ data-slot="table-container"
12
+ data-variant={variant}
13
+ className="relative w-full overflow-x-auto data-[variant=bordered]:border data-[variant=bordered]:rounded-lg"
14
+ >
6
15
  <table data-slot="table" className="w-full caption-bottom text-sm" {...props} />
7
16
  </div>
8
17
  );
@@ -6,7 +6,7 @@ import { type VariantProps } from 'class-variance-authority';
6
6
  import * as React from 'react';
7
7
 
8
8
  import { cn } from '../../../lib/utils';
9
- import { toggleVariants } from './toggle';
9
+ import { toggleVariants } from '../atoms/toggle';
10
10
 
11
11
  const ToggleGroupContext = React.createContext<
12
12
  VariantProps<typeof toggleVariants> & {
@@ -0,0 +1,135 @@
1
+ import { AlertDialog as AlertDialogPrimitive } from '@base-ui/react/alert-dialog';
2
+
3
+ import { Button } from '../atoms/button';
4
+
5
+ function AlertDialog({ ...props }: AlertDialogPrimitive.Root.Props) {
6
+ return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />;
7
+ }
8
+
9
+ function AlertDialogTrigger({ ...props }: AlertDialogPrimitive.Trigger.Props) {
10
+ return <AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />;
11
+ }
12
+
13
+ function AlertDialogPortal({ ...props }: AlertDialogPrimitive.Portal.Props) {
14
+ return <AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />;
15
+ }
16
+
17
+ function AlertDialogOverlay({ ...props }: Omit<AlertDialogPrimitive.Backdrop.Props, 'className'>) {
18
+ return (
19
+ <AlertDialogPrimitive.Backdrop
20
+ data-slot="alert-dialog-overlay"
21
+ className="data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50"
22
+ {...props}
23
+ />
24
+ );
25
+ }
26
+
27
+ function AlertDialogContent({
28
+ size = 'default',
29
+ ...props
30
+ }: Omit<AlertDialogPrimitive.Popup.Props, 'className'> & {
31
+ size?: 'default' | 'sm';
32
+ }) {
33
+ return (
34
+ <AlertDialogPortal>
35
+ <AlertDialogOverlay />
36
+ <AlertDialogPrimitive.Popup
37
+ data-slot="alert-dialog-content"
38
+ data-size={size}
39
+ className="data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 bg-background ring-foreground/10 gap-4 rounded-xl p-4 ring-1 duration-100 data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 outline-none"
40
+ {...props}
41
+ />
42
+ </AlertDialogPortal>
43
+ );
44
+ }
45
+
46
+ function AlertDialogHeader({ ...props }: Omit<React.ComponentProps<'div'>, 'className'>) {
47
+ return (
48
+ <div
49
+ data-slot="alert-dialog-header"
50
+ className="grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]"
51
+ {...props}
52
+ />
53
+ );
54
+ }
55
+
56
+ function AlertDialogFooter({ ...props }: Omit<React.ComponentProps<'div'>, 'className'>) {
57
+ return (
58
+ <div
59
+ data-slot="alert-dialog-footer"
60
+ className="bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end"
61
+ {...props}
62
+ />
63
+ );
64
+ }
65
+
66
+ function AlertDialogMedia({ ...props }: Omit<React.ComponentProps<'div'>, 'className'>) {
67
+ return (
68
+ <div
69
+ data-slot="alert-dialog-media"
70
+ className="bg-muted mb-2 inline-flex size-10 items-center justify-center rounded-md sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6"
71
+ {...props}
72
+ />
73
+ );
74
+ }
75
+
76
+ function AlertDialogTitle({
77
+ ...props
78
+ }: Omit<React.ComponentProps<typeof AlertDialogPrimitive.Title>, 'className'>) {
79
+ return (
80
+ <AlertDialogPrimitive.Title
81
+ data-slot="alert-dialog-title"
82
+ className="text-sm font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2"
83
+ {...props}
84
+ />
85
+ );
86
+ }
87
+
88
+ function AlertDialogDescription({
89
+ ...props
90
+ }: Omit<React.ComponentProps<typeof AlertDialogPrimitive.Description>, 'className'>) {
91
+ return (
92
+ <AlertDialogPrimitive.Description
93
+ data-slot="alert-dialog-description"
94
+ className="text-muted-foreground *:[a]:hover:text-foreground text-sm text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3"
95
+ {...props}
96
+ />
97
+ );
98
+ }
99
+
100
+ function AlertDialogAction({
101
+ variant = 'default',
102
+ ...props
103
+ }: Omit<React.ComponentProps<typeof Button>, 'className'>) {
104
+ return <Button data-slot="alert-dialog-action" variant={variant} {...props} />;
105
+ }
106
+
107
+ function AlertDialogCancel({
108
+ variant = 'secondary',
109
+ size = 'default',
110
+ ...props
111
+ }: Omit<AlertDialogPrimitive.Close.Props, 'className'> &
112
+ Pick<React.ComponentProps<typeof Button>, 'variant' | 'size'>) {
113
+ return (
114
+ <AlertDialogPrimitive.Close
115
+ data-slot="alert-dialog-cancel"
116
+ render={<Button variant={variant} size={size} />}
117
+ {...props}
118
+ />
119
+ );
120
+ }
121
+
122
+ export {
123
+ AlertDialog,
124
+ AlertDialogAction,
125
+ AlertDialogCancel,
126
+ AlertDialogContent,
127
+ AlertDialogDescription,
128
+ AlertDialogFooter,
129
+ AlertDialogHeader,
130
+ AlertDialogMedia,
131
+ AlertDialogOverlay,
132
+ AlertDialogPortal,
133
+ AlertDialogTitle,
134
+ AlertDialogTrigger,
135
+ };
@@ -10,7 +10,7 @@ import {
10
10
 
11
11
  import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from 'lucide-react';
12
12
  import { cn } from '../../../lib/utils';
13
- import { Button, buttonVariants } from './button';
13
+ import { Button, buttonVariants } from '../atoms/button';
14
14
 
15
15
  type CalendarButtonVariant = 'default' | 'outline' | 'secondary' | 'ghost' | 'destructive' | 'link';
16
16
 
@@ -158,9 +158,8 @@ function Calendar({
158
158
  function CalendarDayButton({
159
159
  day,
160
160
  modifiers,
161
- className: _className,
162
161
  ...props
163
- }: React.ComponentProps<typeof DayButton>) {
162
+ }: Omit<React.ComponentProps<typeof DayButton>, 'className'>) {
164
163
  const ref = React.useRef<HTMLButtonElement>(null);
165
164
  React.useEffect(() => {
166
165
  if (modifiers.focused) ref.current?.focus();
@@ -4,7 +4,7 @@ import * as React from 'react';
4
4
  import { Button as ButtonPrimitive } from '@base-ui/react/button';
5
5
  import { ChevronLeftIcon, ChevronRightIcon } from 'lucide-react';
6
6
  import { cn } from '../../../lib/utils';
7
- import { buttonVariants } from './button';
7
+ import { buttonVariants } from '../atoms/button';
8
8
 
9
9
  type CarouselApi = UseEmblaCarouselType[1];
10
10
  type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
@@ -44,10 +44,9 @@ function Carousel({
44
44
  opts,
45
45
  setApi,
46
46
  plugins,
47
- className,
48
47
  children,
49
48
  ...props
50
- }: React.ComponentProps<'div'> & CarouselProps) {
49
+ }: Omit<React.ComponentProps<'div'>, 'className'> & CarouselProps) {
51
50
  const [carouselRef, api] = useEmblaCarousel(
52
51
  {
53
52
  ...opts,
@@ -116,7 +115,7 @@ function Carousel({
116
115
  >
117
116
  <div
118
117
  onKeyDownCapture={handleKeyDown}
119
- className={cn('relative', className)}
118
+ className="relative"
120
119
  role="region"
121
120
  aria-roledescription="carousel"
122
121
  data-slot="carousel"
@@ -128,20 +127,20 @@ function Carousel({
128
127
  );
129
128
  }
130
129
 
131
- function CarouselContent({ className, ...props }: React.ComponentProps<'div'>) {
130
+ function CarouselContent({ ...props }: Omit<React.ComponentProps<'div'>, 'className'>) {
132
131
  const { carouselRef, orientation } = useCarousel();
133
132
 
134
133
  return (
135
134
  <div ref={carouselRef} className="overflow-hidden" data-slot="carousel-content">
136
135
  <div
137
- className={cn('flex', orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col', className)}
136
+ className={cn('flex', orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col')}
138
137
  {...props}
139
138
  />
140
139
  </div>
141
140
  );
142
141
  }
143
142
 
144
- function CarouselItem({ className, ...props }: React.ComponentProps<'div'>) {
143
+ function CarouselItem({ ...props }: Omit<React.ComponentProps<'div'>, 'className'>) {
145
144
  const { orientation } = useCarousel();
146
145
 
147
146
  return (
@@ -152,7 +151,6 @@ function CarouselItem({ className, ...props }: React.ComponentProps<'div'>) {
152
151
  className={cn(
153
152
  'min-w-0 shrink-0 grow-0 basis-full',
154
153
  orientation === 'horizontal' ? 'pl-4' : 'pt-4',
155
- className,
156
154
  )}
157
155
  {...props}
158
156
  />
@@ -36,11 +36,10 @@ function useChart() {
36
36
 
37
37
  function ChartContainer({
38
38
  id,
39
- className,
40
39
  children,
41
40
  config,
42
41
  ...props
43
- }: React.ComponentProps<'div'> & {
42
+ }: Omit<React.ComponentProps<'div'>, 'className'> & {
44
43
  config: ChartConfig;
45
44
  children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];
46
45
  }) {
@@ -52,10 +51,7 @@ function ChartContainer({
52
51
  <div
53
52
  data-slot="chart"
54
53
  data-chart={chartId}
55
- className={cn(
56
- "[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",
57
- className,
58
- )}
54
+ className="[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden"
59
55
  {...props}
60
56
  >
61
57
  <ChartStyle id={chartId} config={config} />
@@ -99,19 +95,17 @@ const ChartTooltip = RechartsPrimitive.Tooltip;
99
95
  function ChartTooltipContent({
100
96
  active,
101
97
  payload,
102
- className,
103
98
  indicator = 'dot',
104
99
  hideLabel = false,
105
100
  hideIndicator = false,
106
101
  label,
107
102
  labelFormatter,
108
- labelClassName,
109
103
  formatter,
110
104
  color,
111
105
  nameKey,
112
106
  labelKey,
113
- }: React.ComponentProps<typeof RechartsPrimitive.Tooltip> &
114
- React.ComponentProps<'div'> & {
107
+ }: Omit<React.ComponentProps<typeof RechartsPrimitive.Tooltip>, 'className'> &
108
+ Omit<React.ComponentProps<'div'>, 'className'> & {
115
109
  hideLabel?: boolean;
116
110
  hideIndicator?: boolean;
117
111
  indicator?: 'line' | 'dot' | 'dashed';
@@ -134,17 +128,15 @@ function ChartTooltipContent({
134
128
  : itemConfig?.label;
135
129
 
136
130
  if (labelFormatter) {
137
- return (
138
- <div className={cn('font-medium', labelClassName)}>{labelFormatter(value, payload)}</div>
139
- );
131
+ return <div className="font-medium">{labelFormatter(value, payload)}</div>;
140
132
  }
141
133
 
142
134
  if (!value) {
143
135
  return null;
144
136
  }
145
137
 
146
- return <div className={cn('font-medium', labelClassName)}>{value}</div>;
147
- }, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);
138
+ return <div className="font-medium">{value}</div>;
139
+ }, [label, labelFormatter, payload, hideLabel, config, labelKey]);
148
140
 
149
141
  if (!active || !payload?.length) {
150
142
  return null;
@@ -153,12 +145,7 @@ function ChartTooltipContent({
153
145
  const nestLabel = payload.length === 1 && indicator !== 'dot';
154
146
 
155
147
  return (
156
- <div
157
- className={cn(
158
- 'border-border/50 bg-background gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl grid min-w-[8rem] items-start',
159
- className,
160
- )}
161
- >
148
+ <div className="border-border/50 bg-background gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl grid min-w-[8rem] items-start">
162
149
  {!nestLabel ? tooltipLabel : null}
163
150
  <div className="grid gap-1.5">
164
151
  {payload
@@ -235,12 +222,11 @@ function ChartTooltipContent({
235
222
  const ChartLegend = RechartsPrimitive.Legend;
236
223
 
237
224
  function ChartLegendContent({
238
- className,
239
225
  hideIcon = false,
240
226
  payload,
241
227
  verticalAlign = 'bottom',
242
228
  nameKey,
243
- }: React.ComponentProps<'div'> &
229
+ }: Omit<React.ComponentProps<'div'>, 'className'> &
244
230
  Pick<RechartsPrimitive.LegendProps, 'payload' | 'verticalAlign'> & {
245
231
  hideIcon?: boolean;
246
232
  nameKey?: string;
@@ -256,7 +242,6 @@ function ChartLegendContent({
256
242
  className={cn(
257
243
  'flex items-center justify-center gap-4',
258
244
  verticalAlign === 'top' ? 'pb-3' : 'pt-3',
259
- className,
260
245
  )}
261
246
  >
262
247
  {payload
@@ -4,8 +4,8 @@ import { Combobox as ComboboxPrimitive } from '@base-ui/react';
4
4
  import { CheckIcon, ChevronDownIcon, XIcon } from 'lucide-react';
5
5
  import * as React from 'react';
6
6
 
7
- import { Button } from './button';
8
- import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from './input-group';
7
+ import { Button } from '../atoms/button';
8
+ import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from '../molecules/input-group';
9
9
 
10
10
  const Combobox = ComboboxPrimitive.Root;
11
11