@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.
- package/dist/{chunk-SAPJG4NO.js → chunk-6JCWMKSY.js} +7 -4
- package/dist/{chunk-SAPJG4NO.js.map → chunk-6JCWMKSY.js.map} +1 -1
- package/dist/cli.js +749 -866
- package/dist/cli.js.map +1 -1
- package/dist/drizzle-config-EDKOEZ6G.js +7 -0
- package/package.json +1 -1
- package/templates/ui/accordion.tsx +73 -42
- package/templates/ui/alert-dialog.tsx +155 -90
- package/templates/ui/alert.tsx +46 -26
- package/templates/ui/aspect-ratio.tsx +4 -2
- package/templates/ui/avatar.tsx +92 -43
- package/templates/ui/badge.tsx +27 -12
- package/templates/ui/breadcrumb.tsx +63 -60
- package/templates/ui/button-group.tsx +8 -8
- package/templates/ui/button.tsx +44 -26
- package/templates/ui/calendar.tsx +43 -34
- package/templates/ui/card.tsx +71 -34
- package/templates/ui/carousel.tsx +111 -115
- package/templates/ui/chart.tsx +197 -207
- package/templates/ui/checkbox.tsx +21 -20
- package/templates/ui/collapsible.tsx +14 -4
- package/templates/ui/combobox.tsx +272 -0
- package/templates/ui/command.tsx +139 -101
- package/templates/ui/context-menu.tsx +214 -156
- package/templates/ui/dialog.tsx +118 -77
- package/templates/ui/direction.tsx +20 -0
- package/templates/ui/drawer.tsx +89 -69
- package/templates/ui/dropdown-menu.tsx +228 -164
- package/templates/ui/empty.tsx +8 -5
- package/templates/ui/field.tsx +25 -32
- package/templates/ui/hover-card.tsx +29 -20
- package/templates/ui/input-group.tsx +20 -37
- package/templates/ui/input-otp.tsx +57 -42
- package/templates/ui/input.tsx +14 -17
- package/templates/ui/item.tsx +27 -17
- package/templates/ui/kbd.tsx +1 -3
- package/templates/ui/label.tsx +14 -14
- package/templates/ui/markdown-editor.tsx +1 -1
- package/templates/ui/menubar.tsx +220 -188
- package/templates/ui/native-select.tsx +42 -0
- package/templates/ui/navigation-menu.tsx +130 -90
- package/templates/ui/pagination.tsx +88 -73
- package/templates/ui/popover.tsx +67 -26
- package/templates/ui/progress.tsx +24 -18
- package/templates/ui/radio-group.tsx +26 -20
- package/templates/ui/resizable.tsx +29 -29
- package/templates/ui/scroll-area.tsx +47 -38
- package/templates/ui/select.tsx +158 -125
- package/templates/ui/separator.tsx +21 -19
- package/templates/ui/sheet.tsx +104 -95
- package/templates/ui/sidebar.tsx +77 -183
- package/templates/ui/skeleton.tsx +8 -2
- package/templates/ui/slider.tsx +46 -17
- package/templates/ui/sonner.tsx +19 -9
- package/templates/ui/spinner.tsx +2 -2
- package/templates/ui/switch.tsx +24 -20
- package/templates/ui/table.tsx +68 -73
- package/templates/ui/tabs.tsx +71 -46
- package/templates/ui/textarea.tsx +13 -16
- package/templates/ui/toggle-group.tsx +57 -28
- package/templates/ui/toggle.tsx +21 -20
- package/templates/ui/tooltip.tsx +44 -23
- package/dist/drizzle-config-KISB26BA.js +0 -7
- package/templates/ui/use-mobile.tsx +0 -19
- /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
|
|
4
|
+
import { NavigationMenu as NavigationMenuPrimitive } from 'radix-ui'
|
|
5
|
+
import type * as React from 'react'
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
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
|
-
'
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
-
|
|
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
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
<NavigationMenuPrimitive.
|
|
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
|
-
|
|
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
|
-
|
|
89
|
-
|
|
90
|
-
NavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName
|
|
128
|
+
)
|
|
129
|
+
}
|
|
91
130
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
<ul
|
|
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
|
-
|
|
23
|
-
|
|
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<
|
|
34
|
+
} & Pick<React.ComponentProps<typeof Button>, 'size'> &
|
|
30
35
|
React.ComponentProps<'a'>
|
|
31
36
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
50
|
+
function PaginationPrevious({
|
|
48
51
|
className,
|
|
52
|
+
text = 'Previous',
|
|
49
53
|
...props
|
|
50
|
-
}: React.ComponentProps<typeof PaginationLink>)
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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
|
-
|
|
106
|
+
PaginationEllipsis,
|
|
92
107
|
PaginationItem,
|
|
93
|
-
|
|
108
|
+
PaginationLink,
|
|
94
109
|
PaginationNext,
|
|
95
|
-
|
|
110
|
+
PaginationPrevious
|
|
96
111
|
}
|
package/templates/ui/popover.tsx
CHANGED
|
@@ -1,32 +1,73 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
3
|
import { cn } from '@cms/utils/cn'
|
|
4
|
-
import
|
|
5
|
-
import * as React from 'react'
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
PopoverContent.displayName = PopoverPrimitive.Content.displayName
|
|
62
|
+
)
|
|
63
|
+
}
|
|
31
64
|
|
|
32
|
-
export {
|
|
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
|
|
5
|
-
import * as React from 'react'
|
|
4
|
+
import { Progress as ProgressPrimitive } from 'radix-ui'
|
|
5
|
+
import type * as React from 'react'
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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 }
|