betterstart-cli 0.0.106 → 0.0.108
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/assets/adapters/next/templates/init/admin-globals.css +1 -61
- package/dist/assets/adapters/next/templates/init/components/layouts/admin-header.tsx +2 -19
- package/dist/assets/adapters/next/templates/init/components/layouts/admin-nav-link.tsx +10 -8
- package/dist/assets/adapters/next/templates/init/components/layouts/admin-providers.tsx +4 -7
- package/dist/assets/adapters/next/templates/init/components/layouts/admin-sidebar-nav-link-skeleton.tsx +1 -5
- package/dist/assets/adapters/next/templates/init/components/layouts/admin-sidebar-user-menu.tsx +53 -48
- package/dist/assets/adapters/next/templates/init/components/layouts/admin-sign-out.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/components/shared/data-table/data-table-pagination.tsx +3 -1
- package/dist/assets/adapters/next/templates/init/components/shared/delete-dialog.tsx +3 -5
- package/dist/assets/adapters/next/templates/init/components/shared/dev-mode/copyable-code-block.tsx +2 -5
- package/dist/assets/adapters/next/templates/init/components/shared/dev-mode/dev-mode-code-mirror.tsx +4 -5
- package/dist/assets/adapters/next/templates/init/components/shared/dev-mode/dev-mode-types.ts +0 -1
- package/dist/assets/adapters/next/templates/init/components/shared/dev-mode/lifecycle-hooks-tab.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/shared/dev-mode/snippets-tab.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/shared/dev-mode-integrate.tsx +5 -7
- package/dist/assets/adapters/next/templates/init/components/shared/entity-filters-bar.tsx +9 -10
- package/dist/assets/adapters/next/templates/init/components/shared/entity-versions/entity-version-item.tsx +2 -4
- package/dist/assets/adapters/next/templates/init/components/shared/entity-versions/entity-version-restore-dialog.tsx +2 -4
- package/dist/assets/adapters/next/templates/init/components/shared/entity-versions/entity-versions-current-row.tsx +2 -4
- package/dist/assets/adapters/next/templates/init/components/shared/entity-versions/entity-versions-drawer.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/shared/media/edit-media-dialog.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/components/shared/media/media-delete-dialog.tsx +5 -5
- package/dist/assets/adapters/next/templates/init/components/shared/media/media-delete-drawer.tsx +52 -53
- package/dist/assets/adapters/next/templates/init/components/shared/media/media-grid-pagination.tsx +3 -1
- package/dist/assets/adapters/next/templates/init/components/shared/sort-order-dialog.tsx +3 -5
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-content-editor-source-mode.tsx +2 -11
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-content-editor.ts +1 -2
- package/dist/assets/adapters/next/templates/init/pages/dashboard-page.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/forgot-password-form.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/login-form.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/pages/reset-password-form.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/pages/settings/audit-log/audit-log-detail-drawer.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/settings/forms/form-notifications-drawer.tsx +5 -5
- package/dist/assets/adapters/next/templates/init/pages/settings/webhooks/webhook-actions.tsx +20 -20
- package/dist/assets/adapters/next/templates/init/pages/users/change-password-dialog.tsx +7 -5
- package/dist/assets/adapters/next/templates/init/pages/users/columns.tsx +3 -5
- package/dist/assets/adapters/next/templates/init/pages/users/create-user-dialog.tsx +1 -3
- package/dist/assets/adapters/next/templates/init/pages/users/delete-user-dialog.tsx +11 -5
- package/dist/assets/adapters/next/templates/init/pages/users/edit-role-dialog.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/main-toolbar-content.tsx +3 -3
- package/dist/assets/shared-assets/react-admin/custom/content-editor/math-popover-button.tsx +13 -11
- package/dist/assets/shared-assets/react-admin/custom/content-editor/mobile-toolbar-content.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/selection-bubble-menu.tsx +1 -5
- package/dist/assets/shared-assets/react-admin/custom/content-editor/source-mode-dropdown-button.tsx +16 -14
- package/dist/assets/shared-assets/react-admin/custom/content-editor/source-mode.tsx +5 -17
- package/dist/assets/shared-assets/react-admin/custom/content-editor/table-bubble-menu.tsx +0 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/table-button.tsx +14 -12
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/blockquote-button/blockquote-button.tsx +2 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/code-block-button/code-block-button.tsx +2 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/color-highlight-button/color-highlight-button.tsx +2 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/color-highlight-popover/color-highlight-popover.tsx +16 -14
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/color-highlight-popover/source-color-highlight-popover.tsx +15 -13
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu-item.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu.tsx +32 -30
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/link-popover/link-control-popover.tsx +17 -14
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/list-dropdown-menu/list-dropdown-menu-item.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/list-dropdown-menu/list-dropdown-menu.tsx +23 -21
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/mark-button/mark-button.tsx +2 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/undo-redo-button/undo-redo-button.tsx +2 -1
- package/dist/assets/shared-assets/react-admin/custom/date-picker.tsx +16 -14
- package/dist/assets/shared-assets/react-admin/custom/date-range-picker.tsx +8 -6
- package/dist/assets/shared-assets/react-admin/custom/icon-picker.tsx +8 -7
- package/dist/assets/shared-assets/react-admin/custom/nested-object-list-field.tsx +2 -4
- package/dist/assets/shared-assets/react-admin/ui/accordion.tsx +11 -28
- package/dist/assets/shared-assets/react-admin/ui/alert-dialog.tsx +30 -47
- package/dist/assets/shared-assets/react-admin/ui/alert.tsx +4 -4
- package/dist/assets/shared-assets/react-admin/ui/aspect-ratio.tsx +18 -5
- package/dist/assets/shared-assets/react-admin/ui/avatar.tsx +10 -13
- package/dist/assets/shared-assets/react-admin/ui/badge.tsx +24 -21
- package/dist/assets/shared-assets/react-admin/ui/breadcrumb.tsx +20 -19
- package/dist/assets/shared-assets/react-admin/ui/button-group.tsx +25 -24
- package/dist/assets/shared-assets/react-admin/ui/button.tsx +22 -31
- package/dist/assets/shared-assets/react-admin/ui/calendar.tsx +10 -7
- package/dist/assets/shared-assets/react-admin/ui/card.tsx +6 -16
- package/dist/assets/shared-assets/react-admin/ui/carousel.tsx +20 -17
- package/dist/assets/shared-assets/react-admin/ui/chart.tsx +18 -26
- package/dist/assets/shared-assets/react-admin/ui/checkbox.tsx +3 -4
- package/dist/assets/shared-assets/react-admin/ui/collapsible.tsx +6 -10
- package/dist/assets/shared-assets/react-admin/ui/combobox.tsx +9 -25
- package/dist/assets/shared-assets/react-admin/ui/command.tsx +7 -6
- package/dist/assets/shared-assets/react-admin/ui/context-menu.tsx +77 -79
- package/dist/assets/shared-assets/react-admin/ui/dialog.tsx +29 -54
- package/dist/assets/shared-assets/react-admin/ui/direction.tsx +1 -18
- package/dist/assets/shared-assets/react-admin/ui/drawer.tsx +121 -49
- package/dist/assets/shared-assets/react-admin/ui/dropdown-menu.tsx +120 -131
- package/dist/assets/shared-assets/react-admin/ui/empty.tsx +3 -3
- package/dist/assets/shared-assets/react-admin/ui/field.tsx +20 -30
- package/dist/assets/shared-assets/react-admin/ui/form.tsx +27 -31
- package/dist/assets/shared-assets/react-admin/ui/hover-card.tsx +26 -18
- package/dist/assets/shared-assets/react-admin/ui/input-group.tsx +26 -13
- package/dist/assets/shared-assets/react-admin/ui/input-otp.tsx +3 -3
- package/dist/assets/shared-assets/react-admin/ui/input.tsx +4 -3
- package/dist/assets/shared-assets/react-admin/ui/item.tsx +26 -19
- package/dist/assets/shared-assets/react-admin/ui/kbd.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/label.tsx +18 -14
- package/dist/assets/shared-assets/react-admin/ui/menubar.tsx +80 -73
- package/dist/assets/shared-assets/react-admin/ui/native-select.tsx +3 -3
- package/dist/assets/shared-assets/react-admin/ui/navigation-menu.tsx +40 -39
- package/dist/assets/shared-assets/react-admin/ui/pagination.tsx +18 -11
- package/dist/assets/shared-assets/react-admin/ui/popover.tsx +31 -30
- package/dist/assets/shared-assets/react-admin/ui/progress.tsx +51 -16
- package/dist/assets/shared-assets/react-admin/ui/radio-group.tsx +11 -17
- package/dist/assets/shared-assets/react-admin/ui/resizable.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/scroll-area.tsx +9 -13
- package/dist/assets/shared-assets/react-admin/ui/select.tsx +66 -60
- package/dist/assets/shared-assets/react-admin/ui/separator.tsx +3 -10
- package/dist/assets/shared-assets/react-admin/ui/sheet.tsx +22 -27
- package/dist/assets/shared-assets/react-admin/ui/sidebar.tsx +144 -126
- package/dist/assets/shared-assets/react-admin/ui/skeleton.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/slider.tsx +27 -29
- package/dist/assets/shared-assets/react-admin/ui/sonner.tsx +10 -8
- package/dist/assets/shared-assets/react-admin/ui/spinner.tsx +4 -3
- package/dist/assets/shared-assets/react-admin/ui/switch.tsx +4 -5
- package/dist/assets/shared-assets/react-admin/ui/table.tsx +8 -21
- package/dist/assets/shared-assets/react-admin/ui/tabs.tsx +11 -16
- package/dist/assets/shared-assets/react-admin/ui/textarea.tsx +2 -2
- package/dist/assets/shared-assets/react-admin/ui/toggle-group.tsx +12 -11
- package/dist/assets/shared-assets/react-admin/ui/toggle.tsx +4 -5
- package/dist/assets/shared-assets/react-admin/ui/tooltip.tsx +29 -27
- package/dist/{chunk-OYU73Q2W.js → chunk-PSDUGFMD.js} +2 -2
- package/dist/{chunk-OYU73Q2W.js.map → chunk-PSDUGFMD.js.map} +1 -1
- package/dist/cli.js +122 -137
- package/dist/cli.js.map +1 -1
- package/dist/{read-namespaced-template-EIH2NPDJ.js → read-namespaced-template-TSATYQPP.js} +2 -2
- package/package.json +1 -1
- package/dist/assets/adapters/next/templates/init/hooks/use-admin-theme.tsx +0 -72
- package/dist/assets/adapters/next/templates/init/utils/theme/system.ts +0 -6
- /package/dist/{read-namespaced-template-EIH2NPDJ.js.map → read-namespaced-template-TSATYQPP.js.map} +0 -0
|
@@ -63,15 +63,19 @@ function Calendar({
|
|
|
63
63
|
'flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium',
|
|
64
64
|
defaultClassNames.dropdowns
|
|
65
65
|
),
|
|
66
|
-
dropdown_root: cn(
|
|
66
|
+
dropdown_root: cn(
|
|
67
|
+
'cn-calendar-dropdown-root relative rounded-(--cell-radius)',
|
|
68
|
+
defaultClassNames.dropdown_root
|
|
69
|
+
),
|
|
67
70
|
dropdown: cn('absolute inset-0 bg-popover opacity-0', defaultClassNames.dropdown),
|
|
68
71
|
caption_label: cn(
|
|
69
72
|
'font-medium select-none',
|
|
70
73
|
captionLayout === 'label'
|
|
71
|
-
? 'text-sm'
|
|
72
|
-
: 'flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-foreground',
|
|
74
|
+
? 'cn-calendar-caption text-sm'
|
|
75
|
+
: 'cn-calendar-caption-label flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground',
|
|
73
76
|
defaultClassNames.caption_label
|
|
74
77
|
),
|
|
78
|
+
month_grid: cn('w-full border-collapse', defaultClassNames.month_grid),
|
|
75
79
|
weekdays: cn('flex', defaultClassNames.weekdays),
|
|
76
80
|
weekday: cn(
|
|
77
81
|
'flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none',
|
|
@@ -117,11 +121,11 @@ function Calendar({
|
|
|
117
121
|
},
|
|
118
122
|
Chevron: ({ className, orientation, ...props }) => {
|
|
119
123
|
if (orientation === 'left') {
|
|
120
|
-
return <ChevronLeftIcon className={cn('size-4', className)} {...props} />
|
|
124
|
+
return <ChevronLeftIcon className={cn('cn-rtl-flip size-4', className)} {...props} />
|
|
121
125
|
}
|
|
122
126
|
|
|
123
127
|
if (orientation === 'right') {
|
|
124
|
-
return <ChevronRightIcon className={cn('size-4', className)} {...props} />
|
|
128
|
+
return <ChevronRightIcon className={cn('cn-rtl-flip size-4', className)} {...props} />
|
|
125
129
|
}
|
|
126
130
|
|
|
127
131
|
return <ChevronDownIcon className={cn('size-4', className)} {...props} />
|
|
@@ -159,7 +163,6 @@ function CalendarDayButton({
|
|
|
159
163
|
|
|
160
164
|
return (
|
|
161
165
|
<Button
|
|
162
|
-
ref={ref}
|
|
163
166
|
variant="ghost"
|
|
164
167
|
size="icon"
|
|
165
168
|
data-day={day.date.toLocaleDateString(locale?.code)}
|
|
@@ -173,7 +176,7 @@ function CalendarDayButton({
|
|
|
173
176
|
data-range-end={modifiers.range_end}
|
|
174
177
|
data-range-middle={modifiers.range_middle}
|
|
175
178
|
className={cn(
|
|
176
|
-
'relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground
|
|
179
|
+
'relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground [&>span]:text-xs [&>span]:opacity-70',
|
|
177
180
|
defaultClassNames.day,
|
|
178
181
|
className
|
|
179
182
|
)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from 'react'
|
|
2
2
|
import { cn } from '@admin/utils/shared/cn'
|
|
3
3
|
|
|
4
4
|
function Card({
|
|
@@ -11,7 +11,7 @@ function Card({
|
|
|
11
11
|
data-slot="card"
|
|
12
12
|
data-size={size}
|
|
13
13
|
className={cn(
|
|
14
|
-
'group/card flex flex-col
|
|
14
|
+
'group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-2xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(6)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl',
|
|
15
15
|
className
|
|
16
16
|
)}
|
|
17
17
|
{...props}
|
|
@@ -24,7 +24,7 @@ function CardHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
|
|
24
24
|
<div
|
|
25
25
|
data-slot="card-header"
|
|
26
26
|
className={cn(
|
|
27
|
-
'group/card-header @container/card-header
|
|
27
|
+
'group/card-header @container/card-header grid auto-rows-min items-start gap-2 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)',
|
|
28
28
|
className
|
|
29
29
|
)}
|
|
30
30
|
{...props}
|
|
@@ -36,10 +36,7 @@ function CardTitle({ className, ...props }: React.ComponentProps<'div'>) {
|
|
|
36
36
|
return (
|
|
37
37
|
<div
|
|
38
38
|
data-slot="card-title"
|
|
39
|
-
className={cn(
|
|
40
|
-
'font-heading text-xs font-medium text-muted-foreground [text-box-trim:trim-both]',
|
|
41
|
-
className
|
|
42
|
-
)}
|
|
39
|
+
className={cn('cn-font-heading text-base font-medium', className)}
|
|
43
40
|
{...props}
|
|
44
41
|
/>
|
|
45
42
|
)
|
|
@@ -67,14 +64,7 @@ function CardAction({ className, ...props }: React.ComponentProps<'div'>) {
|
|
|
67
64
|
|
|
68
65
|
function CardContent({ className, ...props }: React.ComponentProps<'div'>) {
|
|
69
66
|
return (
|
|
70
|
-
<div
|
|
71
|
-
data-slot="card-content"
|
|
72
|
-
className={cn(
|
|
73
|
-
'relative flex flex-col overflow-hidden rounded-sm border border-border bg-card p-8 shadow-input group-has-[>[data-slot=card-footer]]/card:bg-card group-has-[>[data-slot=card-header]]/card:px-5',
|
|
74
|
-
className
|
|
75
|
-
)}
|
|
76
|
-
{...props}
|
|
77
|
-
/>
|
|
67
|
+
<div data-slot="card-content" className={cn('px-(--card-spacing)', className)} {...props} />
|
|
78
68
|
)
|
|
79
69
|
}
|
|
80
70
|
|
|
@@ -83,7 +73,7 @@ function CardFooter({ className, ...props }: React.ComponentProps<'div'>) {
|
|
|
83
73
|
<div
|
|
84
74
|
data-slot="card-footer"
|
|
85
75
|
className={cn(
|
|
86
|
-
'
|
|
76
|
+
'flex items-center rounded-b-xl px-(--card-spacing) [.border-t]:pt-(--card-spacing)',
|
|
87
77
|
className
|
|
88
78
|
)}
|
|
89
79
|
{...props}
|
|
@@ -48,7 +48,7 @@ function Carousel({
|
|
|
48
48
|
className,
|
|
49
49
|
children,
|
|
50
50
|
...props
|
|
51
|
-
}: React.ComponentProps<'
|
|
51
|
+
}: React.ComponentProps<'div'> & CarouselProps) {
|
|
52
52
|
const [carouselRef, api] = useEmblaCarousel(
|
|
53
53
|
{
|
|
54
54
|
...opts,
|
|
@@ -74,7 +74,7 @@ function Carousel({
|
|
|
74
74
|
}, [api])
|
|
75
75
|
|
|
76
76
|
const handleKeyDown = React.useCallback(
|
|
77
|
-
(event: React.KeyboardEvent<
|
|
77
|
+
(event: React.KeyboardEvent<HTMLDivElement>) => {
|
|
78
78
|
if (event.key === 'ArrowLeft') {
|
|
79
79
|
event.preventDefault()
|
|
80
80
|
scrollPrev()
|
|
@@ -115,14 +115,16 @@ function Carousel({
|
|
|
115
115
|
canScrollNext
|
|
116
116
|
}}
|
|
117
117
|
>
|
|
118
|
-
<
|
|
118
|
+
<div
|
|
119
119
|
onKeyDownCapture={handleKeyDown}
|
|
120
120
|
className={cn('relative', className)}
|
|
121
|
+
role="region"
|
|
122
|
+
aria-roledescription="carousel"
|
|
121
123
|
data-slot="carousel"
|
|
122
124
|
{...props}
|
|
123
125
|
>
|
|
124
126
|
{children}
|
|
125
|
-
</
|
|
127
|
+
</div>
|
|
126
128
|
</CarouselContext.Provider>
|
|
127
129
|
)
|
|
128
130
|
}
|
|
@@ -137,7 +139,7 @@ function CarouselContent({ className, ...props }: React.ComponentProps<'div'>) {
|
|
|
137
139
|
'flex',
|
|
138
140
|
{
|
|
139
141
|
'-ml-4': orientation === 'horizontal',
|
|
140
|
-
'-mt-4 flex-col': orientation
|
|
142
|
+
'-mt-4 flex-col': orientation === 'vertical'
|
|
141
143
|
},
|
|
142
144
|
className
|
|
143
145
|
)}
|
|
@@ -147,18 +149,19 @@ function CarouselContent({ className, ...props }: React.ComponentProps<'div'>) {
|
|
|
147
149
|
)
|
|
148
150
|
}
|
|
149
151
|
|
|
150
|
-
function CarouselItem({ className, ...props }: React.ComponentProps<'
|
|
152
|
+
function CarouselItem({ className, ...props }: React.ComponentProps<'div'>) {
|
|
151
153
|
const { orientation } = useCarousel()
|
|
152
154
|
|
|
153
155
|
return (
|
|
154
|
-
<
|
|
156
|
+
<div
|
|
157
|
+
role="group"
|
|
155
158
|
aria-roledescription="slide"
|
|
156
159
|
data-slot="carousel-item"
|
|
157
160
|
className={cn(
|
|
158
|
-
'min-w-0 shrink-0 grow-0 basis-full
|
|
161
|
+
'min-w-0 shrink-0 grow-0 basis-full',
|
|
159
162
|
{
|
|
160
163
|
'pl-4': orientation === 'horizontal',
|
|
161
|
-
'pt-4': orientation
|
|
164
|
+
'pt-4': orientation === 'vertical'
|
|
162
165
|
},
|
|
163
166
|
className
|
|
164
167
|
)}
|
|
@@ -181,10 +184,10 @@ function CarouselPrevious({
|
|
|
181
184
|
variant={variant}
|
|
182
185
|
size={size}
|
|
183
186
|
className={cn(
|
|
184
|
-
'absolute touch-manipulation rounded-
|
|
187
|
+
'absolute touch-manipulation rounded-full',
|
|
185
188
|
{
|
|
186
|
-
'
|
|
187
|
-
'-top-12 left-1/2 -translate-x-1/2 rotate-90': orientation
|
|
189
|
+
'inset-y-0 -left-12 my-auto': orientation === 'horizontal',
|
|
190
|
+
'-top-12 left-1/2 -translate-x-1/2 rotate-90': orientation === 'vertical'
|
|
188
191
|
},
|
|
189
192
|
className
|
|
190
193
|
)}
|
|
@@ -192,7 +195,7 @@ function CarouselPrevious({
|
|
|
192
195
|
onClick={scrollPrev}
|
|
193
196
|
{...props}
|
|
194
197
|
>
|
|
195
|
-
<ChevronLeftIcon />
|
|
198
|
+
<ChevronLeftIcon className="cn-rtl-flip" />
|
|
196
199
|
<span className="sr-only">Previous slide</span>
|
|
197
200
|
</Button>
|
|
198
201
|
)
|
|
@@ -212,10 +215,10 @@ function CarouselNext({
|
|
|
212
215
|
variant={variant}
|
|
213
216
|
size={size}
|
|
214
217
|
className={cn(
|
|
215
|
-
'absolute touch-manipulation rounded-
|
|
218
|
+
'absolute touch-manipulation rounded-full',
|
|
216
219
|
{
|
|
217
|
-
'
|
|
218
|
-
'-bottom-12 left-1/2 -translate-x-1/2 rotate-90': orientation
|
|
220
|
+
'inset-y-0 -right-12 my-auto': orientation === 'horizontal',
|
|
221
|
+
'-bottom-12 left-1/2 -translate-x-1/2 rotate-90': orientation === 'vertical'
|
|
219
222
|
},
|
|
220
223
|
className
|
|
221
224
|
)}
|
|
@@ -223,7 +226,7 @@ function CarouselNext({
|
|
|
223
226
|
onClick={scrollNext}
|
|
224
227
|
{...props}
|
|
225
228
|
>
|
|
226
|
-
<ChevronRightIcon />
|
|
229
|
+
<ChevronRightIcon className="cn-rtl-flip" />
|
|
227
230
|
<span className="sr-only">Next slide</span>
|
|
228
231
|
</Button>
|
|
229
232
|
)
|
|
@@ -2,12 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from 'react'
|
|
4
4
|
import * as RechartsPrimitive from 'recharts'
|
|
5
|
+
import type { TooltipValueType } from 'recharts'
|
|
5
6
|
import { cn } from '@admin/utils/shared/cn'
|
|
6
7
|
|
|
7
|
-
const THEMES = { light: '', dark: '.dark' } as const
|
|
8
|
-
|
|
9
8
|
const INITIAL_DIMENSION = { width: 320, height: 200 } as const
|
|
10
|
-
type TooltipValueType = number | string | ReadonlyArray<number | string>
|
|
11
9
|
type TooltipNameType = number | string
|
|
12
10
|
|
|
13
11
|
export type ChartConfig = Record<
|
|
@@ -15,10 +13,8 @@ export type ChartConfig = Record<
|
|
|
15
13
|
{
|
|
16
14
|
label?: React.ReactNode
|
|
17
15
|
icon?: React.ComponentType
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
| { color?: never; theme: Record<keyof typeof THEMES, string> }
|
|
21
|
-
)
|
|
16
|
+
color?: string
|
|
17
|
+
}
|
|
22
18
|
>
|
|
23
19
|
|
|
24
20
|
type ChartContextProps = {
|
|
@@ -76,28 +72,26 @@ function ChartContainer({
|
|
|
76
72
|
}
|
|
77
73
|
|
|
78
74
|
const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {
|
|
79
|
-
const colorConfig = Object.entries(config).filter(([, config]) => config.
|
|
75
|
+
const colorConfig = Object.entries(config).filter(([, config]) => config.color)
|
|
80
76
|
|
|
81
77
|
if (!colorConfig.length) {
|
|
82
78
|
return null
|
|
83
79
|
}
|
|
84
80
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
81
|
+
return (
|
|
82
|
+
<style
|
|
83
|
+
dangerouslySetInnerHTML={{
|
|
84
|
+
__html: `[data-chart=${id}] {
|
|
89
85
|
${colorConfig
|
|
90
86
|
.map(([key, itemConfig]) => {
|
|
91
|
-
|
|
92
|
-
return color ? ` --color-${key}: ${color};` : null
|
|
87
|
+
return itemConfig.color ? ` --color-${key}: ${itemConfig.color};` : null
|
|
93
88
|
})
|
|
94
89
|
.join('\n')}
|
|
95
90
|
}
|
|
96
91
|
`
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
return <style>{css}</style>
|
|
92
|
+
}}
|
|
93
|
+
/>
|
|
94
|
+
)
|
|
101
95
|
}
|
|
102
96
|
|
|
103
97
|
const ChartTooltip = RechartsPrimitive.Tooltip
|
|
@@ -162,7 +156,7 @@ function ChartTooltipContent({
|
|
|
162
156
|
return (
|
|
163
157
|
<div
|
|
164
158
|
className={cn(
|
|
165
|
-
'grid min-w-32 items-start gap-1.5 rounded-
|
|
159
|
+
'grid min-w-32 items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl',
|
|
166
160
|
className
|
|
167
161
|
)}
|
|
168
162
|
>
|
|
@@ -172,15 +166,14 @@ function ChartTooltipContent({
|
|
|
172
166
|
.filter((item) => item.type !== 'none')
|
|
173
167
|
.map((item, index) => {
|
|
174
168
|
const key = `${nameKey ?? item.name ?? item.dataKey ?? 'value'}`
|
|
175
|
-
const itemKey = `${key}-${item.name ?? ''}-${item.dataKey ?? ''}-${item.value ?? ''}`
|
|
176
169
|
const itemConfig = getPayloadConfigFromPayload(config, item, key)
|
|
177
170
|
const indicatorColor = color ?? item.payload?.fill ?? item.color
|
|
178
171
|
|
|
179
172
|
return (
|
|
180
173
|
<div
|
|
181
|
-
key={
|
|
174
|
+
key={index}
|
|
182
175
|
className={cn(
|
|
183
|
-
'flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-foreground',
|
|
176
|
+
'flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground',
|
|
184
177
|
{ 'items-center': indicator === 'dot' }
|
|
185
178
|
)}
|
|
186
179
|
>
|
|
@@ -270,16 +263,15 @@ function ChartLegendContent({
|
|
|
270
263
|
>
|
|
271
264
|
{payload
|
|
272
265
|
.filter((item) => item.type !== 'none')
|
|
273
|
-
.map((item) => {
|
|
266
|
+
.map((item, index) => {
|
|
274
267
|
const key = `${nameKey ?? item.dataKey ?? 'value'}`
|
|
275
|
-
const itemKey = `${key}-${item.value ?? ''}-${item.color ?? ''}`
|
|
276
268
|
const itemConfig = getPayloadConfigFromPayload(config, item, key)
|
|
277
269
|
|
|
278
270
|
return (
|
|
279
271
|
<div
|
|
280
|
-
key={
|
|
272
|
+
key={index}
|
|
281
273
|
className={cn(
|
|
282
|
-
'flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-foreground'
|
|
274
|
+
'flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground'
|
|
283
275
|
)}
|
|
284
276
|
>
|
|
285
277
|
{itemConfig?.icon && !hideIcon ? (
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import type * as React from 'react'
|
|
4
3
|
import { cn } from '@admin/utils/shared/cn'
|
|
4
|
+
import { Checkbox as CheckboxPrimitive } from '@base-ui/react/checkbox'
|
|
5
5
|
import { CheckIcon } from 'lucide-react'
|
|
6
|
-
import { Checkbox as CheckboxPrimitive } from 'radix-ui'
|
|
7
6
|
|
|
8
|
-
function Checkbox({ className, ...props }:
|
|
7
|
+
function Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props) {
|
|
9
8
|
return (
|
|
10
9
|
<CheckboxPrimitive.Root
|
|
11
10
|
data-slot="checkbox"
|
|
12
11
|
className={cn(
|
|
13
|
-
'peer relative flex size-4
|
|
12
|
+
'peer relative flex size-4 shrink-0 items-center justify-center rounded-[6px] border border-input transition-shadow outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground',
|
|
14
13
|
className
|
|
15
14
|
)}
|
|
16
15
|
{...props}
|
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import { Collapsible as CollapsiblePrimitive } from '
|
|
3
|
+
import { Collapsible as CollapsiblePrimitive } from '@base-ui/react/collapsible'
|
|
4
4
|
|
|
5
|
-
function Collapsible({ ...props }:
|
|
5
|
+
function Collapsible({ ...props }: CollapsiblePrimitive.Root.Props) {
|
|
6
6
|
return <CollapsiblePrimitive.Root data-slot="collapsible" {...props} />
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
function CollapsibleTrigger({
|
|
10
|
-
...props
|
|
11
|
-
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {
|
|
12
|
-
return <CollapsiblePrimitive.CollapsibleTrigger data-slot="collapsible-trigger" {...props} />
|
|
9
|
+
function CollapsibleTrigger({ ...props }: CollapsiblePrimitive.Trigger.Props) {
|
|
10
|
+
return <CollapsiblePrimitive.Trigger data-slot="collapsible-trigger" {...props} />
|
|
13
11
|
}
|
|
14
12
|
|
|
15
|
-
function CollapsibleContent({
|
|
16
|
-
...props
|
|
17
|
-
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {
|
|
18
|
-
return <CollapsiblePrimitive.CollapsibleContent data-slot="collapsible-content" {...props} />
|
|
13
|
+
function CollapsibleContent({ ...props }: CollapsiblePrimitive.Panel.Props) {
|
|
14
|
+
return <CollapsiblePrimitive.Panel data-slot="collapsible-content" {...props} />
|
|
19
15
|
}
|
|
20
16
|
|
|
21
17
|
export { Collapsible, CollapsibleTrigger, CollapsibleContent }
|
|
@@ -26,7 +26,7 @@ function ComboboxTrigger({ className, children, ...props }: ComboboxPrimitive.Tr
|
|
|
26
26
|
{...props}
|
|
27
27
|
>
|
|
28
28
|
{children}
|
|
29
|
-
<ChevronDownIcon className="pointer-events-none size-4 text-foreground" />
|
|
29
|
+
<ChevronDownIcon className="pointer-events-none size-4 text-muted-foreground" />
|
|
30
30
|
</ComboboxPrimitive.Trigger>
|
|
31
31
|
)
|
|
32
32
|
}
|
|
@@ -48,34 +48,26 @@ function ComboboxInput({
|
|
|
48
48
|
className,
|
|
49
49
|
children,
|
|
50
50
|
disabled = false,
|
|
51
|
-
ref,
|
|
52
51
|
showTrigger = true,
|
|
53
52
|
showClear = false,
|
|
54
53
|
...props
|
|
55
54
|
}: ComboboxPrimitive.Input.Props & {
|
|
56
|
-
ref?: React.Ref<HTMLInputElement>
|
|
57
55
|
showTrigger?: boolean
|
|
58
56
|
showClear?: boolean
|
|
59
57
|
}) {
|
|
60
58
|
return (
|
|
61
59
|
<InputGroup className={cn('w-auto', className)}>
|
|
62
|
-
<ComboboxPrimitive.Input
|
|
63
|
-
ref={ref}
|
|
64
|
-
render={<InputGroupInput disabled={disabled} />}
|
|
65
|
-
{...props}
|
|
66
|
-
/>
|
|
60
|
+
<ComboboxPrimitive.Input render={<InputGroupInput disabled={disabled} />} {...props} />
|
|
67
61
|
<InputGroupAddon align="inline-end">
|
|
68
62
|
{showTrigger && (
|
|
69
63
|
<InputGroupButton
|
|
70
64
|
size="icon-xs"
|
|
71
65
|
variant="ghost"
|
|
72
|
-
|
|
66
|
+
render={<ComboboxTrigger />}
|
|
73
67
|
data-slot="input-group-button"
|
|
74
68
|
className="group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent"
|
|
75
69
|
disabled={disabled}
|
|
76
|
-
|
|
77
|
-
<ComboboxTrigger />
|
|
78
|
-
</InputGroupButton>
|
|
70
|
+
/>
|
|
79
71
|
)}
|
|
80
72
|
{showClear && <ComboboxClear disabled={disabled} />}
|
|
81
73
|
</InputGroupAddon>
|
|
@@ -121,7 +113,7 @@ function ComboboxContent({
|
|
|
121
113
|
data-slot="combobox-content"
|
|
122
114
|
data-chips={!!anchor}
|
|
123
115
|
className={cn(
|
|
124
|
-
'group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin)
|
|
116
|
+
'cn-menu-target cn-menu-translucent group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-2xl bg-popover text-popover-foreground shadow-2xl ring-1 ring-foreground/5 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-9 *:data-[slot=input-group]:border-none *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',
|
|
125
117
|
className
|
|
126
118
|
)}
|
|
127
119
|
{...props}
|
|
@@ -144,20 +136,12 @@ function ComboboxList({ className, ...props }: ComboboxPrimitive.List.Props) {
|
|
|
144
136
|
)
|
|
145
137
|
}
|
|
146
138
|
|
|
147
|
-
function ComboboxItem({
|
|
148
|
-
className,
|
|
149
|
-
children,
|
|
150
|
-
ref,
|
|
151
|
-
...props
|
|
152
|
-
}: ComboboxPrimitive.Item.Props & {
|
|
153
|
-
ref?: React.Ref<HTMLDivElement>
|
|
154
|
-
}) {
|
|
139
|
+
function ComboboxItem({ className, children, ...props }: ComboboxPrimitive.Item.Props) {
|
|
155
140
|
return (
|
|
156
141
|
<ComboboxPrimitive.Item
|
|
157
|
-
ref={ref}
|
|
158
142
|
data-slot="combobox-item"
|
|
159
143
|
className={cn(
|
|
160
|
-
"relative flex w-full cursor-default items-center gap-2.5 rounded-
|
|
144
|
+
"relative flex w-full cursor-default items-center gap-2.5 rounded-xl py-2 pr-8 pl-3 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
161
145
|
className
|
|
162
146
|
)}
|
|
163
147
|
{...props}
|
|
@@ -223,7 +207,7 @@ function ComboboxChips({
|
|
|
223
207
|
<ComboboxPrimitive.Chips
|
|
224
208
|
data-slot="combobox-chips"
|
|
225
209
|
className={cn(
|
|
226
|
-
'flex min-h-9 flex-wrap items-center gap-1.5 rounded-
|
|
210
|
+
'flex min-h-9 flex-wrap items-center gap-1.5 rounded-4xl border border-input bg-input/30 bg-clip-padding px-2.5 py-1.5 text-sm transition-colors focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-[3px] has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1.5',
|
|
227
211
|
className
|
|
228
212
|
)}
|
|
229
213
|
{...props}
|
|
@@ -243,7 +227,7 @@ function ComboboxChip({
|
|
|
243
227
|
<ComboboxPrimitive.Chip
|
|
244
228
|
data-slot="combobox-chip"
|
|
245
229
|
className={cn(
|
|
246
|
-
'flex h-[calc(--spacing(5.5))] w-fit items-center justify-center gap-1 rounded-
|
|
230
|
+
'flex h-[calc(--spacing(5.5))] w-fit items-center justify-center gap-1 rounded-4xl bg-muted-foreground/10 px-2 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0',
|
|
247
231
|
className
|
|
248
232
|
)}
|
|
249
233
|
{...props}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import * as React from 'react'
|
|
4
4
|
import {
|
|
5
5
|
Dialog,
|
|
6
6
|
DialogContent,
|
|
@@ -18,7 +18,7 @@ function Command({ className, ...props }: React.ComponentProps<typeof CommandPri
|
|
|
18
18
|
<CommandPrimitive
|
|
19
19
|
data-slot="command"
|
|
20
20
|
className={cn(
|
|
21
|
-
'flex size-full flex-col overflow-hidden rounded-
|
|
21
|
+
'flex size-full flex-col overflow-hidden rounded-4xl bg-popover p-1 text-popover-foreground',
|
|
22
22
|
className
|
|
23
23
|
)}
|
|
24
24
|
{...props}
|
|
@@ -33,11 +33,12 @@ function CommandDialog({
|
|
|
33
33
|
className,
|
|
34
34
|
showCloseButton = false,
|
|
35
35
|
...props
|
|
36
|
-
}: React.ComponentProps<typeof Dialog> & {
|
|
36
|
+
}: Omit<React.ComponentProps<typeof Dialog>, 'children'> & {
|
|
37
37
|
title?: string
|
|
38
38
|
description?: string
|
|
39
39
|
className?: string
|
|
40
40
|
showCloseButton?: boolean
|
|
41
|
+
children: React.ReactNode
|
|
41
42
|
}) {
|
|
42
43
|
return (
|
|
43
44
|
<Dialog {...props}>
|
|
@@ -46,7 +47,7 @@ function CommandDialog({
|
|
|
46
47
|
<DialogDescription>{description}</DialogDescription>
|
|
47
48
|
</DialogHeader>
|
|
48
49
|
<DialogContent
|
|
49
|
-
className={cn('top-1/3 translate-y-0 overflow-hidden rounded-
|
|
50
|
+
className={cn('top-1/3 translate-y-0 overflow-hidden rounded-4xl! p-0', className)}
|
|
50
51
|
showCloseButton={showCloseButton}
|
|
51
52
|
>
|
|
52
53
|
{children}
|
|
@@ -142,7 +143,7 @@ function CommandItem({
|
|
|
142
143
|
<CommandPrimitive.Item
|
|
143
144
|
data-slot="command-item"
|
|
144
145
|
className={cn(
|
|
145
|
-
"group/command-item relative flex cursor-default items-center gap-2 rounded-
|
|
146
|
+
"group/command-item relative flex cursor-default items-center gap-2 rounded-lg px-3 py-2 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-2xl data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground",
|
|
146
147
|
className
|
|
147
148
|
)}
|
|
148
149
|
{...props}
|
|
@@ -158,7 +159,7 @@ function CommandShortcut({ className, ...props }: React.ComponentProps<'span'>)
|
|
|
158
159
|
<span
|
|
159
160
|
data-slot="command-shortcut"
|
|
160
161
|
className={cn(
|
|
161
|
-
'ml-auto text-xs tracking-widest text-muted-foreground group-data-
|
|
162
|
+
'ml-auto text-xs tracking-widest text-muted-foreground group-data-selected/command-item:text-foreground',
|
|
162
163
|
className
|
|
163
164
|
)}
|
|
164
165
|
{...props}
|