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
|
@@ -51,31 +51,29 @@ function FieldGroup({ className, ...props }: React.ComponentProps<'div'>) {
|
|
|
51
51
|
)
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
const fieldVariants = cva(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
responsive:
|
|
63
|
-
'flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px'
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
defaultVariants: {
|
|
67
|
-
orientation: 'vertical'
|
|
54
|
+
const fieldVariants = cva('group/field flex w-full gap-3 data-[invalid=true]:text-destructive', {
|
|
55
|
+
variants: {
|
|
56
|
+
orientation: {
|
|
57
|
+
vertical: 'flex-col *:w-full [&>.sr-only]:w-auto',
|
|
58
|
+
horizontal:
|
|
59
|
+
'flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',
|
|
60
|
+
responsive:
|
|
61
|
+
'flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px'
|
|
68
62
|
}
|
|
63
|
+
},
|
|
64
|
+
defaultVariants: {
|
|
65
|
+
orientation: 'vertical'
|
|
69
66
|
}
|
|
70
|
-
)
|
|
67
|
+
})
|
|
71
68
|
|
|
72
69
|
function Field({
|
|
73
70
|
className,
|
|
74
71
|
orientation = 'vertical',
|
|
75
72
|
...props
|
|
76
|
-
}: React.ComponentProps<'
|
|
73
|
+
}: React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>) {
|
|
77
74
|
return (
|
|
78
|
-
<
|
|
75
|
+
<div
|
|
76
|
+
role="group"
|
|
79
77
|
data-slot="field"
|
|
80
78
|
data-orientation={orientation}
|
|
81
79
|
className={cn(fieldVariants({ orientation }), className)}
|
|
@@ -99,7 +97,7 @@ function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>)
|
|
|
99
97
|
<Label
|
|
100
98
|
data-slot="field-label"
|
|
101
99
|
className={cn(
|
|
102
|
-
'group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-
|
|
100
|
+
'group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-xl has-[>[data-slot=field]]:border *:data-[slot=field]:p-4',
|
|
103
101
|
'has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col',
|
|
104
102
|
className
|
|
105
103
|
)}
|
|
@@ -183,23 +181,15 @@ function FieldError({
|
|
|
183
181
|
return null
|
|
184
182
|
}
|
|
185
183
|
|
|
186
|
-
const
|
|
187
|
-
...new Set(
|
|
188
|
-
errors
|
|
189
|
-
.map((error) => error?.message)
|
|
190
|
-
.filter((message): message is string => Boolean(message))
|
|
191
|
-
)
|
|
192
|
-
]
|
|
184
|
+
const uniqueErrors = [...new Map(errors.map((error) => [error?.message, error])).values()]
|
|
193
185
|
|
|
194
|
-
if (
|
|
195
|
-
return
|
|
186
|
+
if (uniqueErrors?.length == 1) {
|
|
187
|
+
return uniqueErrors[0]?.message
|
|
196
188
|
}
|
|
197
189
|
|
|
198
190
|
return (
|
|
199
191
|
<ul className="ml-4 flex list-disc flex-col gap-1">
|
|
200
|
-
{
|
|
201
|
-
<li key={message}>{message}</li>
|
|
202
|
-
))}
|
|
192
|
+
{uniqueErrors.map((error, index) => error?.message && <li key={index}>{error.message}</li>)}
|
|
203
193
|
</ul>
|
|
204
194
|
)
|
|
205
195
|
}, [children, errors])
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import type * as LabelPrimitive from '@radix-ui/react-label'
|
|
4
3
|
import * as React from 'react'
|
|
5
4
|
import type { ControllerProps, FieldPath, FieldValues } from 'react-hook-form'
|
|
5
|
+
import { Label } from '@admin/components/ui/label'
|
|
6
6
|
import { cn } from '@admin/utils/shared/cn'
|
|
7
|
-
import { Slot } from '@radix-ui/react-slot'
|
|
8
7
|
import { Controller, FormProvider, useFormContext } from 'react-hook-form'
|
|
9
|
-
import { Label } from './label'
|
|
10
8
|
|
|
11
9
|
const Form = FormProvider
|
|
12
10
|
|
|
@@ -71,45 +69,43 @@ const FormItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivEl
|
|
|
71
69
|
|
|
72
70
|
return (
|
|
73
71
|
<FormItemContext.Provider value={{ id }}>
|
|
74
|
-
<div ref={ref} className={cn('
|
|
72
|
+
<div ref={ref} className={cn('flex flex-col gap-2', className)} {...props} />
|
|
75
73
|
</FormItemContext.Provider>
|
|
76
74
|
)
|
|
77
75
|
}
|
|
78
76
|
)
|
|
79
77
|
FormItem.displayName = 'FormItem'
|
|
80
78
|
|
|
81
|
-
const FormLabel = React.forwardRef<
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
>(({ className, ...props }, ref) => {
|
|
85
|
-
const { error, formItemId } = useFormField()
|
|
79
|
+
const FormLabel = React.forwardRef<HTMLLabelElement, React.ComponentProps<typeof Label>>(
|
|
80
|
+
({ className, ...props }, ref) => {
|
|
81
|
+
const { error, formItemId } = useFormField()
|
|
86
82
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
83
|
+
return (
|
|
84
|
+
<Label
|
|
85
|
+
ref={ref}
|
|
86
|
+
className={cn({ 'text-destructive': error }, className)}
|
|
87
|
+
htmlFor={formItemId}
|
|
88
|
+
{...props}
|
|
89
|
+
/>
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
)
|
|
96
93
|
FormLabel.displayName = 'FormLabel'
|
|
97
94
|
|
|
98
95
|
const FormControl = React.forwardRef<
|
|
99
|
-
|
|
100
|
-
React.
|
|
101
|
-
>(({ ...props }, ref) => {
|
|
96
|
+
HTMLElement,
|
|
97
|
+
React.HTMLAttributes<HTMLElement> & { children: React.ReactElement }
|
|
98
|
+
>(({ children, ...props }, ref) => {
|
|
102
99
|
const { error, formItemId, formDescriptionId, formMessageId } = useFormField()
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
)
|
|
100
|
+
const child = React.Children.only(children)
|
|
101
|
+
|
|
102
|
+
return React.cloneElement(child, {
|
|
103
|
+
...props,
|
|
104
|
+
id: formItemId,
|
|
105
|
+
'aria-describedby': !error ? formDescriptionId : `${formDescriptionId} ${formMessageId}`,
|
|
106
|
+
'aria-invalid': !!error,
|
|
107
|
+
ref
|
|
108
|
+
} as never)
|
|
113
109
|
})
|
|
114
110
|
FormControl.displayName = 'FormControl'
|
|
115
111
|
|
|
@@ -1,36 +1,44 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import type * as React from 'react'
|
|
4
3
|
import { cn } from '@admin/utils/shared/cn'
|
|
5
|
-
import {
|
|
4
|
+
import { PreviewCard as PreviewCardPrimitive } from '@base-ui/react/preview-card'
|
|
6
5
|
|
|
7
|
-
function HoverCard({ ...props }:
|
|
8
|
-
return <
|
|
6
|
+
function HoverCard({ ...props }: PreviewCardPrimitive.Root.Props) {
|
|
7
|
+
return <PreviewCardPrimitive.Root data-slot="hover-card" {...props} />
|
|
9
8
|
}
|
|
10
9
|
|
|
11
|
-
function HoverCardTrigger({ ...props }:
|
|
12
|
-
return <
|
|
10
|
+
function HoverCardTrigger({ ...props }: PreviewCardPrimitive.Trigger.Props) {
|
|
11
|
+
return <PreviewCardPrimitive.Trigger data-slot="hover-card-trigger" {...props} />
|
|
13
12
|
}
|
|
14
13
|
|
|
15
14
|
function HoverCardContent({
|
|
16
15
|
className,
|
|
17
|
-
|
|
16
|
+
side = 'bottom',
|
|
18
17
|
sideOffset = 4,
|
|
18
|
+
align = 'center',
|
|
19
|
+
alignOffset = 4,
|
|
19
20
|
...props
|
|
20
|
-
}:
|
|
21
|
+
}: PreviewCardPrimitive.Popup.Props &
|
|
22
|
+
Pick<PreviewCardPrimitive.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset'>) {
|
|
21
23
|
return (
|
|
22
|
-
<
|
|
23
|
-
<
|
|
24
|
-
data-slot="hover-card-content"
|
|
24
|
+
<PreviewCardPrimitive.Portal data-slot="hover-card-portal">
|
|
25
|
+
<PreviewCardPrimitive.Positioner
|
|
25
26
|
align={align}
|
|
27
|
+
alignOffset={alignOffset}
|
|
28
|
+
side={side}
|
|
26
29
|
sideOffset={sideOffset}
|
|
27
|
-
className=
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
className="isolate z-50"
|
|
31
|
+
>
|
|
32
|
+
<PreviewCardPrimitive.Popup
|
|
33
|
+
data-slot="hover-card-content"
|
|
34
|
+
className={cn(
|
|
35
|
+
'z-50 w-72 origin-(--transform-origin) rounded-2xl bg-popover p-4 text-sm text-popover-foreground shadow-2xl ring-1 ring-foreground/5 outline-hidden duration-100 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-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',
|
|
36
|
+
className
|
|
37
|
+
)}
|
|
38
|
+
{...props}
|
|
39
|
+
/>
|
|
40
|
+
</PreviewCardPrimitive.Positioner>
|
|
41
|
+
</PreviewCardPrimitive.Portal>
|
|
34
42
|
)
|
|
35
43
|
}
|
|
36
44
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import * as React from 'react'
|
|
4
4
|
import type { VariantProps } from 'class-variance-authority'
|
|
5
5
|
import { Button } from '@admin/components/ui/button'
|
|
6
6
|
import { Input } from '@admin/components/ui/input'
|
|
@@ -12,8 +12,9 @@ function InputGroup({ className, ...props }: React.ComponentProps<'div'>) {
|
|
|
12
12
|
return (
|
|
13
13
|
<div
|
|
14
14
|
data-slot="input-group"
|
|
15
|
+
role="group"
|
|
15
16
|
className={cn(
|
|
16
|
-
'group/input-group relative
|
|
17
|
+
'group/input-group relative flex h-9 w-full min-w-0 items-center rounded-4xl border border-input bg-input/30 transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-data-[align=block-end]:rounded-2xl has-data-[align=block-start]:rounded-2xl has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-[3px] has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[textarea]:rounded-xl has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5',
|
|
17
18
|
className
|
|
18
19
|
)}
|
|
19
20
|
{...props}
|
|
@@ -22,14 +23,16 @@ function InputGroup({ className, ...props }: React.ComponentProps<'div'>) {
|
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
const inputGroupAddonVariants = cva(
|
|
25
|
-
"flex h-auto cursor-text items-center justify-center gap-2 text-sm font-medium select-none group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-
|
|
26
|
+
"flex h-auto cursor-text items-center justify-center gap-2 py-2 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-4xl **:data-[slot=kbd]:bg-muted-foreground/10 **:data-[slot=kbd]:px-1.5 [&>svg:not([class*='size-'])]:size-4",
|
|
26
27
|
{
|
|
27
28
|
variants: {
|
|
28
29
|
align: {
|
|
29
|
-
'inline-start': 'order-first
|
|
30
|
-
'inline-end': 'order-last
|
|
31
|
-
'block-start':
|
|
32
|
-
|
|
30
|
+
'inline-start': 'order-first pl-3 has-[>button]:-ml-1 has-[>kbd]:ml-[-0.15rem]',
|
|
31
|
+
'inline-end': 'order-last pr-3 has-[>button]:-mr-1 has-[>kbd]:mr-[-0.15rem]',
|
|
32
|
+
'block-start':
|
|
33
|
+
'order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-3 [.border-b]:pb-3',
|
|
34
|
+
'block-end':
|
|
35
|
+
'order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-3 [.border-t]:pt-3'
|
|
33
36
|
}
|
|
34
37
|
},
|
|
35
38
|
defaultVariants: {
|
|
@@ -44,16 +47,24 @@ function InputGroupAddon({
|
|
|
44
47
|
...props
|
|
45
48
|
}: React.ComponentProps<'div'> & VariantProps<typeof inputGroupAddonVariants>) {
|
|
46
49
|
return (
|
|
50
|
+
// oxlint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
|
47
51
|
<div
|
|
52
|
+
role="group"
|
|
48
53
|
data-slot="input-group-addon"
|
|
49
54
|
data-align={align}
|
|
50
55
|
className={cn(inputGroupAddonVariants({ align }), className)}
|
|
56
|
+
onClick={(e) => {
|
|
57
|
+
if ((e.target as HTMLElement).closest('button')) {
|
|
58
|
+
return
|
|
59
|
+
}
|
|
60
|
+
e.currentTarget.parentElement?.querySelector('input')?.focus()
|
|
61
|
+
}}
|
|
51
62
|
{...props}
|
|
52
63
|
/>
|
|
53
64
|
)
|
|
54
65
|
}
|
|
55
66
|
|
|
56
|
-
const inputGroupButtonVariants = cva('flex items-center gap-2 rounded-
|
|
67
|
+
const inputGroupButtonVariants = cva('flex items-center gap-2 rounded-4xl text-sm shadow-none', {
|
|
57
68
|
variants: {
|
|
58
69
|
size: {
|
|
59
70
|
xs: "h-6 gap-1 px-1.5 [&>svg:not([class*='size-'])]:size-3.5",
|
|
@@ -73,8 +84,10 @@ function InputGroupButton({
|
|
|
73
84
|
variant = 'ghost',
|
|
74
85
|
size = 'xs',
|
|
75
86
|
...props
|
|
76
|
-
}: Omit<React.ComponentProps<typeof Button>, 'size'> &
|
|
77
|
-
VariantProps<typeof inputGroupButtonVariants>
|
|
87
|
+
}: Omit<React.ComponentProps<typeof Button>, 'size' | 'type'> &
|
|
88
|
+
VariantProps<typeof inputGroupButtonVariants> & {
|
|
89
|
+
type?: 'button' | 'submit' | 'reset'
|
|
90
|
+
}) {
|
|
78
91
|
return (
|
|
79
92
|
<Button
|
|
80
93
|
type={type}
|
|
@@ -90,7 +103,7 @@ function InputGroupText({ className, ...props }: React.ComponentProps<'span'>) {
|
|
|
90
103
|
return (
|
|
91
104
|
<span
|
|
92
105
|
className={cn(
|
|
93
|
-
"flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg
|
|
106
|
+
"flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
|
94
107
|
className
|
|
95
108
|
)}
|
|
96
109
|
{...props}
|
|
@@ -103,7 +116,7 @@ function InputGroupInput({ className, ...props }: React.ComponentProps<'input'>)
|
|
|
103
116
|
<Input
|
|
104
117
|
data-slot="input-group-control"
|
|
105
118
|
className={cn(
|
|
106
|
-
'
|
|
119
|
+
'flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0',
|
|
107
120
|
className
|
|
108
121
|
)}
|
|
109
122
|
{...props}
|
|
@@ -116,7 +129,7 @@ function InputGroupTextarea({ className, ...props }: React.ComponentProps<'texta
|
|
|
116
129
|
<Textarea
|
|
117
130
|
data-slot="input-group-control"
|
|
118
131
|
className={cn(
|
|
119
|
-
'flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0
|
|
132
|
+
'flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0',
|
|
120
133
|
className
|
|
121
134
|
)}
|
|
122
135
|
{...props}
|
|
@@ -31,7 +31,7 @@ function InputOTPGroup({ className, ...props }: React.ComponentProps<'div'>) {
|
|
|
31
31
|
<div
|
|
32
32
|
data-slot="input-otp-group"
|
|
33
33
|
className={cn(
|
|
34
|
-
'flex items-center rounded-
|
|
34
|
+
'flex items-center rounded-4xl has-aria-invalid:border-destructive has-aria-invalid:ring-[3px] has-aria-invalid:ring-destructive/20',
|
|
35
35
|
className
|
|
36
36
|
)}
|
|
37
37
|
{...props}
|
|
@@ -54,7 +54,7 @@ function InputOTPSlot({
|
|
|
54
54
|
data-slot="input-otp-slot"
|
|
55
55
|
data-active={isActive}
|
|
56
56
|
className={cn(
|
|
57
|
-
'relative flex size-9 items-center justify-center border-y border-r border-input bg-input/30 text-sm transition-all outline-none first:rounded-l-
|
|
57
|
+
'relative flex size-9 items-center justify-center border-y border-r border-input bg-input/30 text-sm transition-all outline-none first:rounded-l-4xl first:border-l last:rounded-r-4xl aria-invalid:border-destructive data-[active=true]:z-10 data-[active=true]:border-ring data-[active=true]:ring-[3px] data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:border-destructive data-[active=true]:aria-invalid:ring-destructive/20',
|
|
58
58
|
className
|
|
59
59
|
)}
|
|
60
60
|
{...props}
|
|
@@ -73,8 +73,8 @@ function InputOTPSeparator({ ...props }: React.ComponentProps<'div'>) {
|
|
|
73
73
|
return (
|
|
74
74
|
<div
|
|
75
75
|
data-slot="input-otp-separator"
|
|
76
|
-
aria-hidden="true"
|
|
77
76
|
className="flex items-center [&_svg:not([class*='size-'])]:size-4"
|
|
77
|
+
role="separator"
|
|
78
78
|
{...props}
|
|
79
79
|
>
|
|
80
80
|
<MinusIcon />
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from 'react'
|
|
2
2
|
import { cn } from '@admin/utils/shared/cn'
|
|
3
|
+
import { Input as InputPrimitive } from '@base-ui/react/input'
|
|
3
4
|
|
|
4
5
|
function Input({ className, type, ...props }: React.ComponentProps<'input'>) {
|
|
5
6
|
return (
|
|
6
|
-
<
|
|
7
|
+
<InputPrimitive
|
|
7
8
|
type={type}
|
|
8
9
|
data-slot="input"
|
|
9
10
|
className={cn(
|
|
10
|
-
'h-
|
|
11
|
+
'h-9 w-full min-w-0 rounded-4xl border border-input bg-input/30 px-3 py-1 text-base transition-colors outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-[3px] aria-invalid:ring-destructive/20 md:text-sm',
|
|
11
12
|
className
|
|
12
13
|
)}
|
|
13
14
|
{...props}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from 'react'
|
|
2
2
|
import type { VariantProps } from 'class-variance-authority'
|
|
3
3
|
import { Separator } from '@admin/components/ui/separator'
|
|
4
4
|
import { cn } from '@admin/utils/shared/cn'
|
|
5
|
+
import { mergeProps } from '@base-ui/react/merge-props'
|
|
6
|
+
import { useRender } from '@base-ui/react/use-render'
|
|
5
7
|
import { cva } from 'class-variance-authority'
|
|
6
|
-
import { Slot } from 'radix-ui'
|
|
7
8
|
|
|
8
|
-
function ItemGroup({ className, ...props }: React.ComponentProps<'
|
|
9
|
+
function ItemGroup({ className, ...props }: React.ComponentProps<'div'>) {
|
|
9
10
|
return (
|
|
10
|
-
<
|
|
11
|
+
<div
|
|
12
|
+
role="list"
|
|
11
13
|
data-slot="item-group"
|
|
12
14
|
className={cn(
|
|
13
|
-
'group/item-group
|
|
15
|
+
'group/item-group flex w-full flex-col gap-4 has-data-[size=sm]:gap-2.5 has-data-[size=xs]:gap-2',
|
|
14
16
|
className
|
|
15
17
|
)}
|
|
16
18
|
{...props}
|
|
@@ -30,7 +32,7 @@ function ItemSeparator({ className, ...props }: React.ComponentProps<typeof Sepa
|
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
const itemVariants = cva(
|
|
33
|
-
'group/item flex w-full flex-wrap items-center rounded-
|
|
35
|
+
'group/item flex w-full flex-wrap items-center rounded-2xl border text-sm transition-colors duration-100 outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 [a]:transition-colors [a]:hover:bg-muted',
|
|
34
36
|
{
|
|
35
37
|
variants: {
|
|
36
38
|
variant: {
|
|
@@ -55,19 +57,24 @@ function Item({
|
|
|
55
57
|
className,
|
|
56
58
|
variant = 'default',
|
|
57
59
|
size = 'default',
|
|
58
|
-
|
|
60
|
+
render,
|
|
59
61
|
...props
|
|
60
|
-
}:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
<
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
62
|
+
}: useRender.ComponentProps<'div'> & VariantProps<typeof itemVariants>) {
|
|
63
|
+
return useRender({
|
|
64
|
+
defaultTagName: 'div',
|
|
65
|
+
props: mergeProps<'div'>(
|
|
66
|
+
{
|
|
67
|
+
className: cn(itemVariants({ variant, size, className }))
|
|
68
|
+
},
|
|
69
|
+
props
|
|
70
|
+
),
|
|
71
|
+
render,
|
|
72
|
+
state: {
|
|
73
|
+
slot: 'item',
|
|
74
|
+
variant,
|
|
75
|
+
size
|
|
76
|
+
}
|
|
77
|
+
})
|
|
71
78
|
}
|
|
72
79
|
|
|
73
80
|
const itemMediaVariants = cva(
|
|
@@ -78,7 +85,7 @@ const itemMediaVariants = cva(
|
|
|
78
85
|
default: 'bg-transparent',
|
|
79
86
|
icon: "[&_svg:not([class*='size-'])]:size-4",
|
|
80
87
|
image:
|
|
81
|
-
'size-10 overflow-hidden rounded-
|
|
88
|
+
'size-10 overflow-hidden rounded-lg group-data-[size=sm]/item:size-8 group-data-[size=xs]/item:size-6 group-data-[size=xs]/item:rounded-md [&_img]:size-full [&_img]:object-cover'
|
|
82
89
|
}
|
|
83
90
|
},
|
|
84
91
|
defaultVariants: {
|
|
@@ -5,7 +5,7 @@ function Kbd({ className, ...props }: React.ComponentProps<'kbd'>) {
|
|
|
5
5
|
<kbd
|
|
6
6
|
data-slot="kbd"
|
|
7
7
|
className={cn(
|
|
8
|
-
"pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background
|
|
8
|
+
"pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background [&_svg:not([class*='size-'])]:size-3",
|
|
9
9
|
className
|
|
10
10
|
)}
|
|
11
11
|
{...props}
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import * as React from 'react'
|
|
4
4
|
import { cn } from '@admin/utils/shared/cn'
|
|
5
|
-
import { Label as LabelPrimitive } from 'radix-ui'
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
6
|
+
const Label = React.forwardRef<HTMLLabelElement, React.ComponentProps<'label'>>(
|
|
7
|
+
({ className, htmlFor, ...props }, ref) => {
|
|
8
|
+
return (
|
|
9
|
+
<label
|
|
10
|
+
ref={ref}
|
|
11
|
+
htmlFor={htmlFor}
|
|
12
|
+
data-slot="label"
|
|
13
|
+
className={cn(
|
|
14
|
+
'flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50',
|
|
15
|
+
className
|
|
16
|
+
)}
|
|
17
|
+
{...props}
|
|
18
|
+
/>
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
)
|
|
22
|
+
Label.displayName = 'Label'
|
|
19
23
|
|
|
20
24
|
export { Label }
|