@betterstart/cli 0.1.28 → 0.1.29

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 (65) hide show
  1. package/dist/{chunk-SAPJG4NO.js → chunk-6JCWMKSY.js} +7 -4
  2. package/dist/{chunk-SAPJG4NO.js.map → chunk-6JCWMKSY.js.map} +1 -1
  3. package/dist/cli.js +742 -869
  4. package/dist/cli.js.map +1 -1
  5. package/dist/drizzle-config-EDKOEZ6G.js +7 -0
  6. package/package.json +1 -1
  7. package/templates/ui/accordion.tsx +73 -42
  8. package/templates/ui/alert-dialog.tsx +155 -90
  9. package/templates/ui/alert.tsx +46 -26
  10. package/templates/ui/aspect-ratio.tsx +4 -2
  11. package/templates/ui/avatar.tsx +92 -43
  12. package/templates/ui/badge.tsx +27 -12
  13. package/templates/ui/breadcrumb.tsx +63 -60
  14. package/templates/ui/button-group.tsx +8 -8
  15. package/templates/ui/button.tsx +44 -26
  16. package/templates/ui/calendar.tsx +43 -34
  17. package/templates/ui/card.tsx +71 -34
  18. package/templates/ui/carousel.tsx +111 -115
  19. package/templates/ui/chart.tsx +197 -207
  20. package/templates/ui/checkbox.tsx +21 -20
  21. package/templates/ui/collapsible.tsx +14 -4
  22. package/templates/ui/combobox.tsx +272 -0
  23. package/templates/ui/command.tsx +139 -101
  24. package/templates/ui/context-menu.tsx +214 -156
  25. package/templates/ui/dialog.tsx +118 -77
  26. package/templates/ui/direction.tsx +20 -0
  27. package/templates/ui/drawer.tsx +89 -69
  28. package/templates/ui/dropdown-menu.tsx +228 -164
  29. package/templates/ui/empty.tsx +8 -5
  30. package/templates/ui/field.tsx +25 -32
  31. package/templates/ui/hover-card.tsx +29 -20
  32. package/templates/ui/input-group.tsx +20 -37
  33. package/templates/ui/input-otp.tsx +57 -42
  34. package/templates/ui/input.tsx +14 -17
  35. package/templates/ui/item.tsx +27 -17
  36. package/templates/ui/kbd.tsx +1 -3
  37. package/templates/ui/label.tsx +14 -14
  38. package/templates/ui/markdown-editor.tsx +1 -1
  39. package/templates/ui/menubar.tsx +220 -188
  40. package/templates/ui/native-select.tsx +42 -0
  41. package/templates/ui/navigation-menu.tsx +130 -90
  42. package/templates/ui/pagination.tsx +88 -73
  43. package/templates/ui/popover.tsx +67 -26
  44. package/templates/ui/progress.tsx +24 -18
  45. package/templates/ui/radio-group.tsx +26 -20
  46. package/templates/ui/resizable.tsx +29 -29
  47. package/templates/ui/scroll-area.tsx +47 -38
  48. package/templates/ui/select.tsx +158 -125
  49. package/templates/ui/separator.tsx +21 -19
  50. package/templates/ui/sheet.tsx +104 -95
  51. package/templates/ui/sidebar.tsx +77 -183
  52. package/templates/ui/skeleton.tsx +8 -2
  53. package/templates/ui/slider.tsx +46 -17
  54. package/templates/ui/sonner.tsx +19 -9
  55. package/templates/ui/spinner.tsx +2 -2
  56. package/templates/ui/switch.tsx +24 -20
  57. package/templates/ui/table.tsx +68 -73
  58. package/templates/ui/tabs.tsx +71 -46
  59. package/templates/ui/textarea.tsx +13 -16
  60. package/templates/ui/toggle-group.tsx +57 -28
  61. package/templates/ui/toggle.tsx +21 -20
  62. package/templates/ui/tooltip.tsx +44 -23
  63. package/dist/drizzle-config-KISB26BA.js +0 -7
  64. package/templates/ui/use-mobile.tsx +0 -19
  65. /package/dist/{drizzle-config-KISB26BA.js.map → drizzle-config-EDKOEZ6G.js.map} +0 -0
@@ -1,28 +1,32 @@
1
1
  'use client'
2
2
 
3
3
  import { cn } from '@cms/utils/cn'
4
- import * as SwitchPrimitives from '@radix-ui/react-switch'
5
- import * as React from 'react'
4
+ import { Switch as SwitchPrimitive } from 'radix-ui'
5
+ import type * as React from 'react'
6
6
 
7
- const Switch = React.forwardRef<
8
- React.ElementRef<typeof SwitchPrimitives.Root>,
9
- React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>
10
- >(({ className, ...props }, ref) => (
11
- <SwitchPrimitives.Root
12
- className={cn(
13
- 'peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input',
14
- className
15
- )}
16
- {...props}
17
- ref={ref}
18
- >
19
- <SwitchPrimitives.Thumb
7
+ function Switch({
8
+ className,
9
+ size = 'default',
10
+ ...props
11
+ }: React.ComponentProps<typeof SwitchPrimitive.Root> & {
12
+ size?: 'sm' | 'default'
13
+ }) {
14
+ return (
15
+ <SwitchPrimitive.Root
16
+ data-slot="switch"
17
+ data-size={size}
20
18
  className={cn(
21
- 'pointer-events-none block size-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0'
19
+ 'data-checked:bg-primary data-unchecked:bg-input 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 dark:data-unchecked:bg-input/80 peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 aria-invalid:ring-3 data-disabled:cursor-not-allowed data-disabled:opacity-50 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px]',
20
+ className
22
21
  )}
23
- />
24
- </SwitchPrimitives.Root>
25
- ))
26
- Switch.displayName = SwitchPrimitives.Root.displayName
22
+ {...props}
23
+ >
24
+ <SwitchPrimitive.Thumb
25
+ data-slot="switch-thumb"
26
+ className="bg-background dark:data-unchecked:bg-foreground dark:data-checked:bg-primary-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0"
27
+ />
28
+ </SwitchPrimitive.Root>
29
+ )
30
+ }
27
31
 
28
32
  export { Switch }
@@ -1,93 +1,88 @@
1
+ 'use client'
2
+
1
3
  import { cn } from '@cms/utils/cn'
2
- import * as React from 'react'
4
+ import type * as React from 'react'
3
5
 
4
- const Table = React.forwardRef<HTMLTableElement, React.HTMLAttributes<HTMLTableElement>>(
5
- ({ className, ...props }, ref) => (
6
- <div className="relative w-full overflow-auto">
7
- <table ref={ref} className={cn('w-full caption-bottom text-sm', className)} {...props} />
6
+ function Table({ className, ...props }: React.ComponentProps<'table'>) {
7
+ return (
8
+ <div data-slot="table-container" className="relative w-full overflow-x-auto">
9
+ <table
10
+ data-slot="table"
11
+ className={cn('w-full caption-bottom text-sm', className)}
12
+ {...props}
13
+ />
8
14
  </div>
9
15
  )
10
- )
11
- Table.displayName = 'Table'
16
+ }
12
17
 
13
- const TableHeader = React.forwardRef<
14
- HTMLTableSectionElement,
15
- React.HTMLAttributes<HTMLTableSectionElement>
16
- >(({ className, ...props }, ref) => (
17
- <thead ref={ref} className={cn('[&_tr]:border-b', className)} {...props} />
18
- ))
19
- TableHeader.displayName = 'TableHeader'
18
+ function TableHeader({ className, ...props }: React.ComponentProps<'thead'>) {
19
+ return <thead data-slot="table-header" className={cn('[&_tr]:border-b', className)} {...props} />
20
+ }
20
21
 
21
- const TableBody = React.forwardRef<
22
- HTMLTableSectionElement,
23
- React.HTMLAttributes<HTMLTableSectionElement>
24
- >(({ className, ...props }, ref) => (
25
- <tbody ref={ref} className={cn('[&_tr:last-child]:border-0', className)} {...props} />
26
- ))
27
- TableBody.displayName = 'TableBody'
22
+ function TableBody({ className, ...props }: React.ComponentProps<'tbody'>) {
23
+ return (
24
+ <tbody
25
+ data-slot="table-body"
26
+ className={cn('[&_tr:last-child]:border-0', className)}
27
+ {...props}
28
+ />
29
+ )
30
+ }
28
31
 
29
- const TableFooter = React.forwardRef<
30
- HTMLTableSectionElement,
31
- React.HTMLAttributes<HTMLTableSectionElement>
32
- >(({ className, ...props }, ref) => (
33
- <tfoot
34
- ref={ref}
35
- className={cn('border-t bg-muted/50 font-medium [&>tr]:last:border-b-0', className)}
36
- {...props}
37
- />
38
- ))
39
- TableFooter.displayName = 'TableFooter'
32
+ function TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>) {
33
+ return (
34
+ <tfoot
35
+ data-slot="table-footer"
36
+ className={cn('bg-muted/50 border-t font-medium [&>tr]:last:border-b-0', className)}
37
+ {...props}
38
+ />
39
+ )
40
+ }
40
41
 
41
- const TableRow = React.forwardRef<HTMLTableRowElement, React.HTMLAttributes<HTMLTableRowElement>>(
42
- ({ className, ...props }, ref) => (
42
+ function TableRow({ className, ...props }: React.ComponentProps<'tr'>) {
43
+ return (
43
44
  <tr
44
- ref={ref}
45
+ data-slot="table-row"
45
46
  className={cn(
46
- 'border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted',
47
+ 'hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors',
47
48
  className
48
49
  )}
49
50
  {...props}
50
51
  />
51
52
  )
52
- )
53
- TableRow.displayName = 'TableRow'
53
+ }
54
54
 
55
- const TableHead = React.forwardRef<
56
- HTMLTableCellElement,
57
- React.ThHTMLAttributes<HTMLTableCellElement>
58
- >(({ className, ...props }, ref) => (
59
- <th
60
- ref={ref}
61
- className={cn(
62
- 'h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',
63
- className
64
- )}
65
- {...props}
66
- />
67
- ))
68
- TableHead.displayName = 'TableHead'
55
+ function TableHead({ className, ...props }: React.ComponentProps<'th'>) {
56
+ return (
57
+ <th
58
+ data-slot="table-head"
59
+ className={cn(
60
+ 'text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0',
61
+ className
62
+ )}
63
+ {...props}
64
+ />
65
+ )
66
+ }
69
67
 
70
- const TableCell = React.forwardRef<
71
- HTMLTableCellElement,
72
- React.TdHTMLAttributes<HTMLTableCellElement>
73
- >(({ className, ...props }, ref) => (
74
- <td
75
- ref={ref}
76
- className={cn(
77
- 'p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',
78
- className
79
- )}
80
- {...props}
81
- />
82
- ))
83
- TableCell.displayName = 'TableCell'
68
+ function TableCell({ className, ...props }: React.ComponentProps<'td'>) {
69
+ return (
70
+ <td
71
+ data-slot="table-cell"
72
+ className={cn('p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0', className)}
73
+ {...props}
74
+ />
75
+ )
76
+ }
84
77
 
85
- const TableCaption = React.forwardRef<
86
- HTMLTableCaptionElement,
87
- React.HTMLAttributes<HTMLTableCaptionElement>
88
- >(({ className, ...props }, ref) => (
89
- <caption ref={ref} className={cn('mt-4 text-sm text-muted-foreground', className)} {...props} />
90
- ))
91
- TableCaption.displayName = 'TableCaption'
78
+ function TableCaption({ className, ...props }: React.ComponentProps<'caption'>) {
79
+ return (
80
+ <caption
81
+ data-slot="table-caption"
82
+ className={cn('text-muted-foreground mt-4 text-sm', className)}
83
+ {...props}
84
+ />
85
+ )
86
+ }
92
87
 
93
88
  export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption }
@@ -1,54 +1,79 @@
1
1
  'use client'
2
2
 
3
3
  import { cn } from '@cms/utils/cn'
4
- import * as TabsPrimitive from '@radix-ui/react-tabs'
5
- import * as React from 'react'
4
+ import { cva, type VariantProps } from 'class-variance-authority'
5
+ import { Tabs as TabsPrimitive } from 'radix-ui'
6
+ import type * as React from 'react'
6
7
 
7
- const Tabs = TabsPrimitive.Root
8
+ function Tabs({
9
+ className,
10
+ orientation = 'horizontal',
11
+ ...props
12
+ }: React.ComponentProps<typeof TabsPrimitive.Root>) {
13
+ return (
14
+ <TabsPrimitive.Root
15
+ data-slot="tabs"
16
+ data-orientation={orientation}
17
+ className={cn('group/tabs flex gap-2 data-horizontal:flex-col', className)}
18
+ {...props}
19
+ />
20
+ )
21
+ }
8
22
 
9
- const TabsList = React.forwardRef<
10
- React.ElementRef<typeof TabsPrimitive.List>,
11
- React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>
12
- >(({ className, ...props }, ref) => (
13
- <TabsPrimitive.List
14
- ref={ref}
15
- className={cn(
16
- 'inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground',
17
- className
18
- )}
19
- {...props}
20
- />
21
- ))
22
- TabsList.displayName = TabsPrimitive.List.displayName
23
+ const tabsListVariants = cva(
24
+ 'rounded-lg p-[3px] group-data-horizontal/tabs:h-8 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col',
25
+ {
26
+ variants: {
27
+ variant: {
28
+ default: 'bg-muted',
29
+ line: 'gap-1 bg-transparent'
30
+ }
31
+ },
32
+ defaultVariants: {
33
+ variant: 'default'
34
+ }
35
+ }
36
+ )
23
37
 
24
- const TabsTrigger = React.forwardRef<
25
- React.ElementRef<typeof TabsPrimitive.Trigger>,
26
- React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>
27
- >(({ className, ...props }, ref) => (
28
- <TabsPrimitive.Trigger
29
- ref={ref}
30
- className={cn(
31
- 'inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow',
32
- className
33
- )}
34
- {...props}
35
- />
36
- ))
37
- TabsTrigger.displayName = TabsPrimitive.Trigger.displayName
38
+ function TabsList({
39
+ className,
40
+ variant = 'default',
41
+ ...props
42
+ }: React.ComponentProps<typeof TabsPrimitive.List> & VariantProps<typeof tabsListVariants>) {
43
+ return (
44
+ <TabsPrimitive.List
45
+ data-slot="tabs-list"
46
+ data-variant={variant}
47
+ className={cn(tabsListVariants({ variant }), className)}
48
+ {...props}
49
+ />
50
+ )
51
+ }
38
52
 
39
- const TabsContent = React.forwardRef<
40
- React.ElementRef<typeof TabsPrimitive.Content>,
41
- React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>
42
- >(({ className, ...props }, ref) => (
43
- <TabsPrimitive.Content
44
- ref={ref}
45
- className={cn(
46
- 'mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',
47
- className
48
- )}
49
- {...props}
50
- />
51
- ))
52
- TabsContent.displayName = TabsPrimitive.Content.displayName
53
+ function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>) {
54
+ return (
55
+ <TabsPrimitive.Trigger
56
+ data-slot="tabs-trigger"
57
+ className={cn(
58
+ "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
59
+ 'group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent',
60
+ 'data-active:bg-background dark:data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 data-active:text-foreground',
61
+ 'after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100',
62
+ className
63
+ )}
64
+ {...props}
65
+ />
66
+ )
67
+ }
53
68
 
54
- export { Tabs, TabsList, TabsTrigger, TabsContent }
69
+ function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>) {
70
+ return (
71
+ <TabsPrimitive.Content
72
+ data-slot="tabs-content"
73
+ className={cn('flex-1 text-sm outline-none', className)}
74
+ {...props}
75
+ />
76
+ )
77
+ }
78
+
79
+ export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants }
@@ -1,20 +1,17 @@
1
1
  import { cn } from '@cms/utils/cn'
2
- import * as React from 'react'
2
+ import type * as React from 'react'
3
3
 
4
- const Textarea = React.forwardRef<HTMLTextAreaElement, React.ComponentProps<'textarea'>>(
5
- ({ className, ...props }, ref) => {
6
- return (
7
- <textarea
8
- className={cn(
9
- 'flex min-h-[60px] w-full rounded-md border border-input-border-border bg-input px-3 py-2 text-base placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',
10
- className
11
- )}
12
- ref={ref}
13
- {...props}
14
- />
15
- )
16
- }
17
- )
18
- Textarea.displayName = 'Textarea'
4
+ function Textarea({ className, ...props }: React.ComponentProps<'textarea'>) {
5
+ return (
6
+ <textarea
7
+ data-slot="textarea"
8
+ className={cn(
9
+ 'border-input 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 disabled:bg-input/50 dark:disabled:bg-input/80 placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full rounded-lg border bg-transparent px-2.5 py-2 text-base transition-colors outline-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3 md:text-sm',
10
+ className
11
+ )}
12
+ {...props}
13
+ />
14
+ )
15
+ }
19
16
 
20
17
  export { Textarea }
@@ -1,43 +1,74 @@
1
1
  'use client'
2
2
 
3
+ import { toggleVariants } from '@cms/components/ui/toggle'
3
4
  import { cn } from '@cms/utils/cn'
4
- import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group'
5
5
  import type { VariantProps } from 'class-variance-authority'
6
+ import { ToggleGroup as ToggleGroupPrimitive } from 'radix-ui'
6
7
  import * as React from 'react'
7
- import { toggleVariants } from './toggle'
8
8
 
9
- const ToggleGroupContext = React.createContext<VariantProps<typeof toggleVariants>>({
9
+ const ToggleGroupContext = React.createContext<
10
+ VariantProps<typeof toggleVariants> & {
11
+ spacing?: number
12
+ orientation?: 'horizontal' | 'vertical'
13
+ }
14
+ >({
10
15
  size: 'default',
11
- variant: 'default'
16
+ variant: 'default',
17
+ spacing: 0,
18
+ orientation: 'horizontal'
12
19
  })
13
20
 
14
- const ToggleGroup = React.forwardRef<
15
- React.ElementRef<typeof ToggleGroupPrimitive.Root>,
16
- React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> &
17
- VariantProps<typeof toggleVariants>
18
- >(({ className, variant, size, children, ...props }, ref) => (
19
- <ToggleGroupPrimitive.Root
20
- ref={ref}
21
- className={cn('flex items-center justify-center gap-1', className)}
22
- {...props}
23
- >
24
- <ToggleGroupContext.Provider value={{ variant, size }}>{children}</ToggleGroupContext.Provider>
25
- </ToggleGroupPrimitive.Root>
26
- ))
27
-
28
- ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName
21
+ function ToggleGroup({
22
+ className,
23
+ variant,
24
+ size,
25
+ spacing = 0,
26
+ orientation = 'horizontal',
27
+ children,
28
+ ...props
29
+ }: React.ComponentProps<typeof ToggleGroupPrimitive.Root> &
30
+ VariantProps<typeof toggleVariants> & {
31
+ spacing?: number
32
+ orientation?: 'horizontal' | 'vertical'
33
+ }) {
34
+ return (
35
+ <ToggleGroupPrimitive.Root
36
+ data-slot="toggle-group"
37
+ data-variant={variant}
38
+ data-size={size}
39
+ data-spacing={spacing}
40
+ data-orientation={orientation}
41
+ style={{ '--gap': spacing } as React.CSSProperties}
42
+ className={cn(
43
+ 'group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-lg data-vertical:flex-col data-vertical:items-stretch data-[size=sm]:rounded-[min(var(--radius-md),10px)]',
44
+ className
45
+ )}
46
+ {...props}
47
+ >
48
+ <ToggleGroupContext.Provider value={{ variant, size, spacing, orientation }}>
49
+ {children}
50
+ </ToggleGroupContext.Provider>
51
+ </ToggleGroupPrimitive.Root>
52
+ )
53
+ }
29
54
 
30
- const ToggleGroupItem = React.forwardRef<
31
- React.ElementRef<typeof ToggleGroupPrimitive.Item>,
32
- React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> &
33
- VariantProps<typeof toggleVariants>
34
- >(({ className, children, variant, size, ...props }, ref) => {
55
+ function ToggleGroupItem({
56
+ className,
57
+ children,
58
+ variant = 'default',
59
+ size = 'default',
60
+ ...props
61
+ }: React.ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>) {
35
62
  const context = React.useContext(ToggleGroupContext)
36
63
 
37
64
  return (
38
65
  <ToggleGroupPrimitive.Item
39
- ref={ref}
66
+ data-slot="toggle-group-item"
67
+ data-variant={context.variant || variant}
68
+ data-size={context.size || size}
69
+ data-spacing={context.spacing}
40
70
  className={cn(
71
+ 'shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t',
41
72
  toggleVariants({
42
73
  variant: context.variant || variant,
43
74
  size: context.size || size
@@ -49,8 +80,6 @@ const ToggleGroupItem = React.forwardRef<
49
80
  {children}
50
81
  </ToggleGroupPrimitive.Item>
51
82
  )
52
- })
53
-
54
- ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName
83
+ }
55
84
 
56
85
  export { ToggleGroup, ToggleGroupItem }
@@ -1,23 +1,22 @@
1
1
  'use client'
2
2
 
3
3
  import { cn } from '@cms/utils/cn'
4
- import * as TogglePrimitive from '@radix-ui/react-toggle'
5
4
  import { cva, type VariantProps } from 'class-variance-authority'
6
- import * as React from 'react'
5
+ import { Toggle as TogglePrimitive } from 'radix-ui'
6
+ import type * as React from 'react'
7
7
 
8
8
  const toggleVariants = cva(
9
- 'inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
9
+ "hover:text-foreground aria-pressed:bg-muted focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[state=on]:bg-muted gap-1 rounded-lg text-sm font-medium transition-all [&_svg:not([class*='size-'])]:size-4 group/toggle hover:bg-muted inline-flex items-center justify-center whitespace-nowrap outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
10
10
  {
11
11
  variants: {
12
12
  variant: {
13
13
  default: 'bg-transparent',
14
- outline:
15
- 'border border-input-border bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground'
14
+ outline: 'border-input hover:bg-muted border bg-transparent'
16
15
  },
17
16
  size: {
18
- default: 'h-9 px-2 min-w-9',
19
- sm: 'h-8 px-1.5 min-w-8',
20
- lg: 'h-10 px-2.5 min-w-10'
17
+ default: 'h-8 min-w-8 px-2',
18
+ sm: 'h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-1.5 text-[0.8rem]',
19
+ lg: 'h-9 min-w-9 px-2.5'
21
20
  }
22
21
  },
23
22
  defaultVariants: {
@@ -27,17 +26,19 @@ const toggleVariants = cva(
27
26
  }
28
27
  )
29
28
 
30
- const Toggle = React.forwardRef<
31
- React.ElementRef<typeof TogglePrimitive.Root>,
32
- React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>
33
- >(({ className, variant, size, ...props }, ref) => (
34
- <TogglePrimitive.Root
35
- ref={ref}
36
- className={cn(toggleVariants({ variant, size, className }))}
37
- {...props}
38
- />
39
- ))
40
-
41
- Toggle.displayName = TogglePrimitive.Root.displayName
29
+ function Toggle({
30
+ className,
31
+ variant = 'default',
32
+ size = 'default',
33
+ ...props
34
+ }: React.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>) {
35
+ return (
36
+ <TogglePrimitive.Root
37
+ data-slot="toggle"
38
+ className={cn(toggleVariants({ variant, size, className }))}
39
+ {...props}
40
+ />
41
+ )
42
+ }
42
43
 
43
44
  export { Toggle, toggleVariants }
@@ -1,31 +1,52 @@
1
1
  'use client'
2
2
 
3
3
  import { cn } from '@cms/utils/cn'
4
- import * as TooltipPrimitive from '@radix-ui/react-tooltip'
5
- import * as React from 'react'
4
+ import { Tooltip as TooltipPrimitive } from 'radix-ui'
5
+ import type * as React from 'react'
6
6
 
7
- const TooltipProvider = TooltipPrimitive.Provider
7
+ function TooltipProvider({
8
+ delayDuration = 0,
9
+ ...props
10
+ }: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
11
+ return (
12
+ <TooltipPrimitive.Provider
13
+ data-slot="tooltip-provider"
14
+ delayDuration={delayDuration}
15
+ {...props}
16
+ />
17
+ )
18
+ }
8
19
 
9
- const Tooltip = TooltipPrimitive.Root
20
+ function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>) {
21
+ return <TooltipPrimitive.Root data-slot="tooltip" {...props} />
22
+ }
10
23
 
11
- const TooltipTrigger = TooltipPrimitive.Trigger
24
+ function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
25
+ return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />
26
+ }
12
27
 
13
- const TooltipContent = React.forwardRef<
14
- React.ElementRef<typeof TooltipPrimitive.Content>,
15
- React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
16
- >(({ className, sideOffset = 4, ...props }, ref) => (
17
- <TooltipPrimitive.Portal>
18
- <TooltipPrimitive.Content
19
- ref={ref}
20
- sideOffset={sideOffset}
21
- className={cn(
22
- 'z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 origin-[--radix-tooltip-content-transform-origin]',
23
- className
24
- )}
25
- {...props}
26
- />
27
- </TooltipPrimitive.Portal>
28
- ))
29
- TooltipContent.displayName = TooltipPrimitive.Content.displayName
28
+ function TooltipContent({
29
+ className,
30
+ sideOffset = 0,
31
+ children,
32
+ ...props
33
+ }: React.ComponentProps<typeof TooltipPrimitive.Content>) {
34
+ return (
35
+ <TooltipPrimitive.Portal>
36
+ <TooltipPrimitive.Content
37
+ data-slot="tooltip-content"
38
+ sideOffset={sideOffset}
39
+ className={cn(
40
+ 'data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-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 bg-foreground text-background z-50 w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs',
41
+ className
42
+ )}
43
+ {...props}
44
+ >
45
+ {children}
46
+ <TooltipPrimitive.Arrow className="bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" />
47
+ </TooltipPrimitive.Content>
48
+ </TooltipPrimitive.Portal>
49
+ )
50
+ }
30
51
 
31
- export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
52
+ export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger }
@@ -1,7 +0,0 @@
1
- import {
2
- drizzleConfigTemplate
3
- } from "./chunk-SAPJG4NO.js";
4
- export {
5
- drizzleConfigTemplate
6
- };
7
- //# sourceMappingURL=drizzle-config-KISB26BA.js.map