@betterstart/cli 0.1.28 → 0.1.30

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 +749 -866
  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,113 +1,152 @@
1
1
  import { cn } from '@cms/utils/cn'
2
- import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu'
3
2
  import { cva } from 'class-variance-authority'
4
3
  import { ChevronDown } from 'lucide-react'
5
- import * as React from 'react'
4
+ import { NavigationMenu as NavigationMenuPrimitive } from 'radix-ui'
5
+ import type * as React from 'react'
6
6
 
7
- const NavigationMenu = React.forwardRef<
8
- React.ElementRef<typeof NavigationMenuPrimitive.Root>,
9
- React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>
10
- >(({ className, children, ...props }, ref) => (
11
- <NavigationMenuPrimitive.Root
12
- ref={ref}
13
- className={cn('relative z-10 flex max-w-max flex-1 items-center justify-center', className)}
14
- {...props}
15
- >
16
- {children}
17
- <NavigationMenuViewport />
18
- </NavigationMenuPrimitive.Root>
19
- ))
20
- NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName
7
+ function NavigationMenu({
8
+ className,
9
+ children,
10
+ viewport = true,
11
+ ...props
12
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Root> & {
13
+ viewport?: boolean
14
+ }) {
15
+ return (
16
+ <NavigationMenuPrimitive.Root
17
+ data-slot="navigation-menu"
18
+ data-viewport={viewport}
19
+ className={cn(
20
+ 'group/navigation-menu relative flex max-w-max flex-1 items-center justify-center',
21
+ className
22
+ )}
23
+ {...props}
24
+ >
25
+ {children}
26
+ {viewport && <NavigationMenuViewport />}
27
+ </NavigationMenuPrimitive.Root>
28
+ )
29
+ }
21
30
 
22
- const NavigationMenuList = React.forwardRef<
23
- React.ElementRef<typeof NavigationMenuPrimitive.List>,
24
- React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>
25
- >(({ className, ...props }, ref) => (
26
- <NavigationMenuPrimitive.List
27
- ref={ref}
28
- className={cn('group flex flex-1 list-none items-center justify-center space-x-1', className)}
29
- {...props}
30
- />
31
- ))
32
- NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName
31
+ function NavigationMenuList({
32
+ className,
33
+ ...props
34
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.List>) {
35
+ return (
36
+ <NavigationMenuPrimitive.List
37
+ data-slot="navigation-menu-list"
38
+ className={cn('group flex flex-1 list-none items-center justify-center gap-0', className)}
39
+ {...props}
40
+ />
41
+ )
42
+ }
33
43
 
34
- const NavigationMenuItem = NavigationMenuPrimitive.Item
44
+ function NavigationMenuItem({
45
+ className,
46
+ ...props
47
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Item>) {
48
+ return (
49
+ <NavigationMenuPrimitive.Item
50
+ data-slot="navigation-menu-item"
51
+ className={cn('relative', className)}
52
+ {...props}
53
+ />
54
+ )
55
+ }
35
56
 
36
57
  const navigationMenuTriggerStyle = cva(
37
- 'group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:text-accent-foreground data-[state=open]:bg-accent/50 data-[state=open]:hover:bg-accent data-[state=open]:focus:bg-accent'
58
+ 'bg-background hover:bg-muted focus:bg-muted data-open:hover:bg-muted data-open:focus:bg-muted data-open:bg-muted/50 focus-visible:ring-ring/50 data-popup-open:bg-muted/50 data-popup-open:hover:bg-muted rounded-lg px-2.5 py-1.5 text-sm font-medium transition-all focus-visible:ring-3 focus-visible:outline-1 disabled:opacity-50 group/navigation-menu-trigger inline-flex h-9 w-max items-center justify-center disabled:pointer-events-none outline-none'
38
59
  )
39
60
 
40
- const NavigationMenuTrigger = React.forwardRef<
41
- React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,
42
- React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>
43
- >(({ className, children, ...props }, ref) => (
44
- <NavigationMenuPrimitive.Trigger
45
- ref={ref}
46
- className={cn(navigationMenuTriggerStyle(), 'group', className)}
47
- {...props}
48
- >
49
- {children}{' '}
50
- <ChevronDown
51
- className="relative top-[1px] ml-1 h-3 w-3 transition duration-300 group-data-[state=open]:rotate-180"
52
- aria-hidden="true"
53
- />
54
- </NavigationMenuPrimitive.Trigger>
55
- ))
56
- NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName
61
+ function NavigationMenuTrigger({
62
+ className,
63
+ children,
64
+ ...props
65
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>) {
66
+ return (
67
+ <NavigationMenuPrimitive.Trigger
68
+ data-slot="navigation-menu-trigger"
69
+ className={cn(navigationMenuTriggerStyle(), 'group', className)}
70
+ {...props}
71
+ >
72
+ {children}{' '}
73
+ <ChevronDown
74
+ className="relative top-px ml-1 size-3 transition duration-300 group-data-open/navigation-menu-trigger:rotate-180 group-data-popup-open/navigation-menu-trigger:rotate-180"
75
+ aria-hidden="true"
76
+ />
77
+ </NavigationMenuPrimitive.Trigger>
78
+ )
79
+ }
57
80
 
58
- const NavigationMenuContent = React.forwardRef<
59
- React.ElementRef<typeof NavigationMenuPrimitive.Content>,
60
- React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>
61
- >(({ className, ...props }, ref) => (
62
- <NavigationMenuPrimitive.Content
63
- ref={ref}
64
- className={cn(
65
- 'left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ',
66
- className
67
- )}
68
- {...props}
69
- />
70
- ))
71
- NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName
81
+ function NavigationMenuContent({
82
+ className,
83
+ ...props
84
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Content>) {
85
+ return (
86
+ <NavigationMenuPrimitive.Content
87
+ data-slot="navigation-menu-content"
88
+ className={cn(
89
+ 'data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-open:animate-in group-data-[viewport=false]/navigation-menu:data-closed:animate-out group-data-[viewport=false]/navigation-menu:data-closed:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-open:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-open:fade-in-0 group-data-[viewport=false]/navigation-menu:data-closed:fade-out-0 group-data-[viewport=false]/navigation-menu:ring-foreground/10 top-0 left-0 w-full p-1 ease-[cubic-bezier(0.22,1,0.36,1)] group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-lg group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:ring-1 group-data-[viewport=false]/navigation-menu:duration-300 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none md:absolute md:w-auto',
90
+ className
91
+ )}
92
+ {...props}
93
+ />
94
+ )
95
+ }
72
96
 
73
- const NavigationMenuLink = NavigationMenuPrimitive.Link
97
+ function NavigationMenuViewport({
98
+ className,
99
+ ...props
100
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport>) {
101
+ return (
102
+ <div className={cn('absolute top-full left-0 isolate z-50 flex justify-center')}>
103
+ <NavigationMenuPrimitive.Viewport
104
+ data-slot="navigation-menu-viewport"
105
+ className={cn(
106
+ 'bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:zoom-out-95 data-open:zoom-in-90 ring-foreground/10 origin-top-center relative mt-1.5 h-(--radix-navigation-menu-viewport-height) w-full overflow-hidden rounded-lg shadow ring-1 duration-100 md:w-(--radix-navigation-menu-viewport-width)',
107
+ className
108
+ )}
109
+ {...props}
110
+ />
111
+ </div>
112
+ )
113
+ }
74
114
 
75
- const NavigationMenuViewport = React.forwardRef<
76
- React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,
77
- React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>
78
- >(({ className, ...props }, ref) => (
79
- <div className={cn('absolute left-0 top-full flex justify-center')}>
80
- <NavigationMenuPrimitive.Viewport
115
+ function NavigationMenuLink({
116
+ className,
117
+ ...props
118
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Link>) {
119
+ return (
120
+ <NavigationMenuPrimitive.Link
121
+ data-slot="navigation-menu-link"
81
122
  className={cn(
82
- 'origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]',
123
+ "data-active:focus:bg-muted data-active:hover:bg-muted data-active:bg-muted/50 focus-visible:ring-ring/50 hover:bg-muted focus:bg-muted flex items-center gap-2 rounded-lg p-2 text-sm transition-all outline-none focus-visible:ring-3 focus-visible:outline-1 in-data-[slot=navigation-menu-content]:rounded-md [&_svg:not([class*='size-'])]:size-4",
83
124
  className
84
125
  )}
85
- ref={ref}
86
126
  {...props}
87
127
  />
88
- </div>
89
- ))
90
- NavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName
128
+ )
129
+ }
91
130
 
92
- const NavigationMenuIndicator = React.forwardRef<
93
- React.ElementRef<typeof NavigationMenuPrimitive.Indicator>,
94
- React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>
95
- >(({ className, ...props }, ref) => (
96
- <NavigationMenuPrimitive.Indicator
97
- ref={ref}
98
- className={cn(
99
- 'top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in',
100
- className
101
- )}
102
- {...props}
103
- >
104
- <div className="relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" />
105
- </NavigationMenuPrimitive.Indicator>
106
- ))
107
- NavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName
131
+ function NavigationMenuIndicator({
132
+ className,
133
+ ...props
134
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>) {
135
+ return (
136
+ <NavigationMenuPrimitive.Indicator
137
+ data-slot="navigation-menu-indicator"
138
+ className={cn(
139
+ 'data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-1 flex h-1.5 items-end justify-center overflow-hidden',
140
+ className
141
+ )}
142
+ {...props}
143
+ >
144
+ <div className="bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md" />
145
+ </NavigationMenuPrimitive.Indicator>
146
+ )
147
+ }
108
148
 
109
149
  export {
110
- navigationMenuTriggerStyle,
111
150
  NavigationMenu,
112
151
  NavigationMenuList,
113
152
  NavigationMenuItem,
@@ -115,5 +154,6 @@ export {
115
154
  NavigationMenuTrigger,
116
155
  NavigationMenuLink,
117
156
  NavigationMenuIndicator,
118
- NavigationMenuViewport
157
+ NavigationMenuViewport,
158
+ navigationMenuTriggerStyle
119
159
  }
@@ -1,96 +1,111 @@
1
+ import { Button } from '@cms/components/ui/button'
2
+
1
3
  import { cn } from '@cms/utils/cn'
2
4
  import { ChevronLeft, ChevronRight, MoreHorizontal } from 'lucide-react'
3
- import * as React from 'react'
4
- import { type ButtonProps, buttonVariants } from './button'
5
+ import type * as React from 'react'
5
6
 
6
- const Pagination = ({ className, ...props }: React.ComponentProps<'nav'>) => (
7
- <nav
8
- aria-label="pagination"
9
- className={cn('mx-auto flex w-full justify-center', className)}
10
- {...props}
11
- />
12
- )
13
- Pagination.displayName = 'Pagination'
7
+ function Pagination({ className, ...props }: React.ComponentProps<'nav'>) {
8
+ return (
9
+ <nav
10
+ aria-label="pagination"
11
+ data-slot="pagination"
12
+ className={cn('mx-auto flex w-full justify-center', className)}
13
+ {...props}
14
+ />
15
+ )
16
+ }
14
17
 
15
- const PaginationContent = React.forwardRef<HTMLUListElement, React.ComponentProps<'ul'>>(
16
- ({ className, ...props }, ref) => (
17
- <ul ref={ref} className={cn('flex flex-row items-center gap-1', className)} {...props} />
18
+ function PaginationContent({ className, ...props }: React.ComponentProps<'ul'>) {
19
+ return (
20
+ <ul
21
+ data-slot="pagination-content"
22
+ className={cn('flex items-center gap-0.5', className)}
23
+ {...props}
24
+ />
18
25
  )
19
- )
20
- PaginationContent.displayName = 'PaginationContent'
26
+ }
21
27
 
22
- const PaginationItem = React.forwardRef<HTMLLIElement, React.ComponentProps<'li'>>(
23
- ({ className, ...props }, ref) => <li ref={ref} className={cn('', className)} {...props} />
24
- )
25
- PaginationItem.displayName = 'PaginationItem'
28
+ function PaginationItem({ ...props }: React.ComponentProps<'li'>) {
29
+ return <li data-slot="pagination-item" {...props} />
30
+ }
26
31
 
27
32
  type PaginationLinkProps = {
28
33
  isActive?: boolean
29
- } & Pick<ButtonProps, 'size'> &
34
+ } & Pick<React.ComponentProps<typeof Button>, 'size'> &
30
35
  React.ComponentProps<'a'>
31
36
 
32
- const PaginationLink = ({ className, isActive, size = 'icon', ...props }: PaginationLinkProps) => (
33
- <a
34
- aria-current={isActive ? 'page' : undefined}
35
- className={cn(
36
- buttonVariants({
37
- variant: isActive ? 'outline' : 'ghost',
38
- size
39
- }),
40
- className
41
- )}
42
- {...props}
43
- />
44
- )
45
- PaginationLink.displayName = 'PaginationLink'
37
+ function PaginationLink({ className, isActive, size = 'icon', ...props }: PaginationLinkProps) {
38
+ return (
39
+ <Button asChild variant={isActive ? 'outline' : 'ghost'} size={size} className={cn(className)}>
40
+ <a
41
+ aria-current={isActive ? 'page' : undefined}
42
+ data-slot="pagination-link"
43
+ data-active={isActive}
44
+ {...props}
45
+ />
46
+ </Button>
47
+ )
48
+ }
46
49
 
47
- const PaginationPrevious = ({
50
+ function PaginationPrevious({
48
51
  className,
52
+ text = 'Previous',
49
53
  ...props
50
- }: React.ComponentProps<typeof PaginationLink>) => (
51
- <PaginationLink
52
- aria-label="Go to previous page"
53
- size="default"
54
- className={cn('gap-1 pl-2.5', className)}
55
- {...props}
56
- >
57
- <ChevronLeft className="size-4" />
58
- <span>Previous</span>
59
- </PaginationLink>
60
- )
61
- PaginationPrevious.displayName = 'PaginationPrevious'
54
+ }: React.ComponentProps<typeof PaginationLink> & { text?: string }) {
55
+ return (
56
+ <PaginationLink
57
+ aria-label="Go to previous page"
58
+ size="default"
59
+ className={cn('pl-1.5!', className)}
60
+ {...props}
61
+ >
62
+ <ChevronLeft data-icon="inline-start" />
63
+ <span className="hidden sm:block">{text}</span>
64
+ </PaginationLink>
65
+ )
66
+ }
62
67
 
63
- const PaginationNext = ({ className, ...props }: React.ComponentProps<typeof PaginationLink>) => (
64
- <PaginationLink
65
- aria-label="Go to next page"
66
- size="default"
67
- className={cn('gap-1 pr-2.5', className)}
68
- {...props}
69
- >
70
- <span>Next</span>
71
- <ChevronRight className="size-4" />
72
- </PaginationLink>
73
- )
74
- PaginationNext.displayName = 'PaginationNext'
68
+ function PaginationNext({
69
+ className,
70
+ text = 'Next',
71
+ ...props
72
+ }: React.ComponentProps<typeof PaginationLink> & { text?: string }) {
73
+ return (
74
+ <PaginationLink
75
+ aria-label="Go to next page"
76
+ size="default"
77
+ className={cn('pr-1.5!', className)}
78
+ {...props}
79
+ >
80
+ <span className="hidden sm:block">{text}</span>
81
+ <ChevronRight data-icon="inline-end" />
82
+ </PaginationLink>
83
+ )
84
+ }
75
85
 
76
- const PaginationEllipsis = ({ className, ...props }: React.ComponentProps<'span'>) => (
77
- <span
78
- aria-hidden
79
- className={cn('flex h-9 w-9 items-center justify-center', className)}
80
- {...props}
81
- >
82
- <MoreHorizontal className="size-4" />
83
- <span className="sr-only">More pages</span>
84
- </span>
85
- )
86
- PaginationEllipsis.displayName = 'PaginationEllipsis'
86
+ function PaginationEllipsis({ className, ...props }: React.ComponentProps<'span'>) {
87
+ return (
88
+ <span
89
+ aria-hidden
90
+ data-slot="pagination-ellipsis"
91
+ className={cn(
92
+ "flex size-8 items-center justify-center [&_svg:not([class*='size-'])]:size-4",
93
+ className
94
+ )}
95
+ {...props}
96
+ >
97
+ <MoreHorizontal />
98
+ <span className="sr-only">More pages</span>
99
+ </span>
100
+ )
101
+ }
87
102
 
88
103
  export {
89
104
  Pagination,
90
105
  PaginationContent,
91
- PaginationLink,
106
+ PaginationEllipsis,
92
107
  PaginationItem,
93
- PaginationPrevious,
108
+ PaginationLink,
94
109
  PaginationNext,
95
- PaginationEllipsis
110
+ PaginationPrevious
96
111
  }
@@ -1,32 +1,73 @@
1
1
  'use client'
2
2
 
3
3
  import { cn } from '@cms/utils/cn'
4
- import * as PopoverPrimitive from '@radix-ui/react-popover'
5
- import * as React from 'react'
6
-
7
- const Popover = PopoverPrimitive.Root
8
-
9
- const PopoverTrigger = PopoverPrimitive.Trigger
10
-
11
- const PopoverAnchor = PopoverPrimitive.Anchor
12
-
13
- const PopoverContent = React.forwardRef<
14
- React.ElementRef<typeof PopoverPrimitive.Content>,
15
- React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
16
- >(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (
17
- <PopoverPrimitive.Portal>
18
- <PopoverPrimitive.Content
19
- ref={ref}
20
- align={align}
21
- sideOffset={sideOffset}
22
- className={cn(
23
- 'z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 origin-[--radix-popover-content-transform-origin]',
24
- className
25
- )}
4
+ import { Popover as PopoverPrimitive } from 'radix-ui'
5
+ import type * as React from 'react'
6
+
7
+ function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>) {
8
+ return <PopoverPrimitive.Root data-slot="popover" {...props} />
9
+ }
10
+
11
+ function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
12
+ return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
13
+ }
14
+
15
+ function PopoverContent({
16
+ className,
17
+ align = 'center',
18
+ sideOffset = 4,
19
+ ...props
20
+ }: React.ComponentProps<typeof PopoverPrimitive.Content>) {
21
+ return (
22
+ <PopoverPrimitive.Portal>
23
+ <PopoverPrimitive.Content
24
+ data-slot="popover-content"
25
+ align={align}
26
+ sideOffset={sideOffset}
27
+ className={cn(
28
+ '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 z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-2.5 rounded-lg p-2.5 text-sm shadow-md ring-1 outline-hidden duration-100',
29
+ className
30
+ )}
31
+ {...props}
32
+ />
33
+ </PopoverPrimitive.Portal>
34
+ )
35
+ }
36
+
37
+ function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
38
+ return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />
39
+ }
40
+
41
+ function PopoverHeader({ className, ...props }: React.ComponentProps<'div'>) {
42
+ return (
43
+ <div
44
+ data-slot="popover-header"
45
+ className={cn('flex flex-col gap-0.5 text-sm', className)}
46
+ {...props}
47
+ />
48
+ )
49
+ }
50
+
51
+ function PopoverTitle({ className, ...props }: React.ComponentProps<'h2'>) {
52
+ return <div data-slot="popover-title" className={cn('font-medium', className)} {...props} />
53
+ }
54
+
55
+ function PopoverDescription({ className, ...props }: React.ComponentProps<'p'>) {
56
+ return (
57
+ <p
58
+ data-slot="popover-description"
59
+ className={cn('text-muted-foreground', className)}
26
60
  {...props}
27
61
  />
28
- </PopoverPrimitive.Portal>
29
- ))
30
- PopoverContent.displayName = PopoverPrimitive.Content.displayName
62
+ )
63
+ }
31
64
 
32
- export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor }
65
+ export {
66
+ Popover,
67
+ PopoverAnchor,
68
+ PopoverContent,
69
+ PopoverDescription,
70
+ PopoverHeader,
71
+ PopoverTitle,
72
+ PopoverTrigger
73
+ }
@@ -1,24 +1,30 @@
1
1
  'use client'
2
2
 
3
3
  import { cn } from '@cms/utils/cn'
4
- import * as ProgressPrimitive from '@radix-ui/react-progress'
5
- import * as React from 'react'
4
+ import { Progress as ProgressPrimitive } from 'radix-ui'
5
+ import type * as React from 'react'
6
6
 
7
- const Progress = React.forwardRef<
8
- React.ElementRef<typeof ProgressPrimitive.Root>,
9
- React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
10
- >(({ className, value, ...props }, ref) => (
11
- <ProgressPrimitive.Root
12
- ref={ref}
13
- className={cn('relative h-2 w-full overflow-hidden rounded-full bg-primary/20', className)}
14
- {...props}
15
- >
16
- <ProgressPrimitive.Indicator
17
- className="h-full w-full flex-1 bg-primary transition-all"
18
- style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
19
- />
20
- </ProgressPrimitive.Root>
21
- ))
22
- Progress.displayName = ProgressPrimitive.Root.displayName
7
+ function Progress({
8
+ className,
9
+ value,
10
+ ...props
11
+ }: React.ComponentProps<typeof ProgressPrimitive.Root>) {
12
+ return (
13
+ <ProgressPrimitive.Root
14
+ data-slot="progress"
15
+ className={cn(
16
+ 'bg-muted relative flex h-1 w-full items-center overflow-x-hidden rounded-full',
17
+ className
18
+ )}
19
+ {...props}
20
+ >
21
+ <ProgressPrimitive.Indicator
22
+ data-slot="progress-indicator"
23
+ className="bg-primary size-full flex-1 transition-all"
24
+ style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
25
+ />
26
+ </ProgressPrimitive.Root>
27
+ )
28
+ }
23
29
 
24
30
  export { Progress }