betterstart-cli 0.0.106 → 0.0.107
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/components/layouts/admin-nav-link.tsx +10 -8
- 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 +54 -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/delete-dialog.tsx +3 -5
- 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/sort-order-dialog.tsx +3 -5
- package/dist/assets/adapters/next/templates/init/pages/dashboard-page.tsx +1 -1
- 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/math-popover-button.tsx +13 -11
- 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 +2 -2
- 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/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 +31 -29
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/link-popover/link-control-popover.tsx +15 -13
- 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 +22 -20
- 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 +21 -20
- 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 +9 -6
- 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 +19 -16
- 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 +10 -36
- 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 +117 -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 +25 -12
- 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/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 +8 -3
- 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/cli.js +90 -110
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
|
@@ -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,13 @@
|
|
|
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
|
|
|
8
|
+
// Format: { THEME_NAME: CSS_SELECTOR }
|
|
7
9
|
const THEMES = { light: '', dark: '.dark' } as const
|
|
8
10
|
|
|
9
11
|
const INITIAL_DIMENSION = { width: 320, height: 200 } as const
|
|
10
|
-
type TooltipValueType = number | string | ReadonlyArray<number | string>
|
|
11
12
|
type TooltipNameType = number | string
|
|
12
13
|
|
|
13
14
|
export type ChartConfig = Record<
|
|
@@ -82,9 +83,12 @@ const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {
|
|
|
82
83
|
return null
|
|
83
84
|
}
|
|
84
85
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
return (
|
|
87
|
+
<style
|
|
88
|
+
dangerouslySetInnerHTML={{
|
|
89
|
+
__html: Object.entries(THEMES)
|
|
90
|
+
.map(
|
|
91
|
+
([theme, prefix]) => `
|
|
88
92
|
${prefix} [data-chart=${id}] {
|
|
89
93
|
${colorConfig
|
|
90
94
|
.map(([key, itemConfig]) => {
|
|
@@ -94,10 +98,11 @@ ${colorConfig
|
|
|
94
98
|
.join('\n')}
|
|
95
99
|
}
|
|
96
100
|
`
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
+
)
|
|
102
|
+
.join('\n')
|
|
103
|
+
}}
|
|
104
|
+
/>
|
|
105
|
+
)
|
|
101
106
|
}
|
|
102
107
|
|
|
103
108
|
const ChartTooltip = RechartsPrimitive.Tooltip
|
|
@@ -162,7 +167,7 @@ function ChartTooltipContent({
|
|
|
162
167
|
return (
|
|
163
168
|
<div
|
|
164
169
|
className={cn(
|
|
165
|
-
'grid min-w-32 items-start gap-1.5 rounded-
|
|
170
|
+
'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
171
|
className
|
|
167
172
|
)}
|
|
168
173
|
>
|
|
@@ -172,15 +177,14 @@ function ChartTooltipContent({
|
|
|
172
177
|
.filter((item) => item.type !== 'none')
|
|
173
178
|
.map((item, index) => {
|
|
174
179
|
const key = `${nameKey ?? item.name ?? item.dataKey ?? 'value'}`
|
|
175
|
-
const itemKey = `${key}-${item.name ?? ''}-${item.dataKey ?? ''}-${item.value ?? ''}`
|
|
176
180
|
const itemConfig = getPayloadConfigFromPayload(config, item, key)
|
|
177
181
|
const indicatorColor = color ?? item.payload?.fill ?? item.color
|
|
178
182
|
|
|
179
183
|
return (
|
|
180
184
|
<div
|
|
181
|
-
key={
|
|
185
|
+
key={index}
|
|
182
186
|
className={cn(
|
|
183
|
-
'flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-foreground',
|
|
187
|
+
'flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground',
|
|
184
188
|
{ 'items-center': indicator === 'dot' }
|
|
185
189
|
)}
|
|
186
190
|
>
|
|
@@ -270,16 +274,15 @@ function ChartLegendContent({
|
|
|
270
274
|
>
|
|
271
275
|
{payload
|
|
272
276
|
.filter((item) => item.type !== 'none')
|
|
273
|
-
.map((item) => {
|
|
277
|
+
.map((item, index) => {
|
|
274
278
|
const key = `${nameKey ?? item.dataKey ?? 'value'}`
|
|
275
|
-
const itemKey = `${key}-${item.value ?? ''}-${item.color ?? ''}`
|
|
276
279
|
const itemConfig = getPayloadConfigFromPayload(config, item, key)
|
|
277
280
|
|
|
278
281
|
return (
|
|
279
282
|
<div
|
|
280
|
-
key={
|
|
283
|
+
key={index}
|
|
281
284
|
className={cn(
|
|
282
|
-
'flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-foreground'
|
|
285
|
+
'flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground'
|
|
283
286
|
)}
|
|
284
287
|
>
|
|
285
288
|
{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-[3px] aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary',
|
|
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>
|
|
@@ -91,19 +83,11 @@ function ComboboxContent({
|
|
|
91
83
|
align = 'start',
|
|
92
84
|
alignOffset = 0,
|
|
93
85
|
anchor,
|
|
94
|
-
collisionPadding,
|
|
95
|
-
positionMethod,
|
|
96
86
|
...props
|
|
97
87
|
}: ComboboxPrimitive.Popup.Props &
|
|
98
88
|
Pick<
|
|
99
89
|
ComboboxPrimitive.Positioner.Props,
|
|
100
|
-
| '
|
|
101
|
-
| 'align'
|
|
102
|
-
| 'sideOffset'
|
|
103
|
-
| 'alignOffset'
|
|
104
|
-
| 'anchor'
|
|
105
|
-
| 'collisionPadding'
|
|
106
|
-
| 'positionMethod'
|
|
90
|
+
'side' | 'align' | 'sideOffset' | 'alignOffset' | 'anchor'
|
|
107
91
|
>) {
|
|
108
92
|
return (
|
|
109
93
|
<ComboboxPrimitive.Portal>
|
|
@@ -113,15 +97,13 @@ function ComboboxContent({
|
|
|
113
97
|
align={align}
|
|
114
98
|
alignOffset={alignOffset}
|
|
115
99
|
anchor={anchor}
|
|
116
|
-
collisionPadding={collisionPadding}
|
|
117
|
-
positionMethod={positionMethod}
|
|
118
100
|
className="isolate z-50"
|
|
119
101
|
>
|
|
120
102
|
<ComboboxPrimitive.Popup
|
|
121
103
|
data-slot="combobox-content"
|
|
122
104
|
data-chips={!!anchor}
|
|
123
105
|
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)
|
|
106
|
+
'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
107
|
className
|
|
126
108
|
)}
|
|
127
109
|
{...props}
|
|
@@ -144,20 +126,12 @@ function ComboboxList({ className, ...props }: ComboboxPrimitive.List.Props) {
|
|
|
144
126
|
)
|
|
145
127
|
}
|
|
146
128
|
|
|
147
|
-
function ComboboxItem({
|
|
148
|
-
className,
|
|
149
|
-
children,
|
|
150
|
-
ref,
|
|
151
|
-
...props
|
|
152
|
-
}: ComboboxPrimitive.Item.Props & {
|
|
153
|
-
ref?: React.Ref<HTMLDivElement>
|
|
154
|
-
}) {
|
|
129
|
+
function ComboboxItem({ className, children, ...props }: ComboboxPrimitive.Item.Props) {
|
|
155
130
|
return (
|
|
156
131
|
<ComboboxPrimitive.Item
|
|
157
|
-
ref={ref}
|
|
158
132
|
data-slot="combobox-item"
|
|
159
133
|
className={cn(
|
|
160
|
-
"relative flex w-full cursor-default items-center gap-2.5 rounded-
|
|
134
|
+
"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
135
|
className
|
|
162
136
|
)}
|
|
163
137
|
{...props}
|
|
@@ -223,7 +197,7 @@ function ComboboxChips({
|
|
|
223
197
|
<ComboboxPrimitive.Chips
|
|
224
198
|
data-slot="combobox-chips"
|
|
225
199
|
className={cn(
|
|
226
|
-
'flex min-h-9 flex-wrap items-center gap-1.5 rounded-
|
|
200
|
+
'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 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40',
|
|
227
201
|
className
|
|
228
202
|
)}
|
|
229
203
|
{...props}
|
|
@@ -243,7 +217,7 @@ function ComboboxChip({
|
|
|
243
217
|
<ComboboxPrimitive.Chip
|
|
244
218
|
data-slot="combobox-chip"
|
|
245
219
|
className={cn(
|
|
246
|
-
'flex h-[calc(--spacing(5.5))] w-fit items-center justify-center gap-1 rounded-
|
|
220
|
+
'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
221
|
className
|
|
248
222
|
)}
|
|
249
223
|
{...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}
|