@contember/create 2.1.0-alpha.9 → 2.1.0-beta.2
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/development/run.cjs +6 -4
- package/dist/development/run.cjs.map +1 -1
- package/dist/development/run.js +6 -4
- package/dist/development/run.js.map +1 -1
- package/dist/development/src/commands/WorkspaceCreateCommand.cjs +3 -2
- package/dist/development/src/commands/WorkspaceCreateCommand.cjs.map +1 -1
- package/dist/development/src/commands/WorkspaceCreateCommand.js +3 -2
- package/dist/development/src/commands/WorkspaceCreateCommand.js.map +1 -1
- package/dist/development/src/lib/FileSystem.cjs +1 -0
- package/dist/development/src/lib/FileSystem.cjs.map +1 -1
- package/dist/development/src/lib/FileSystem.js +1 -0
- package/dist/development/src/lib/FileSystem.js.map +1 -1
- package/dist/development/src/lib/TemplateInstaller.cjs +26 -8
- package/dist/development/src/lib/TemplateInstaller.cjs.map +1 -1
- package/dist/development/src/lib/TemplateInstaller.js +26 -8
- package/dist/development/src/lib/TemplateInstaller.js.map +1 -1
- package/dist/development/src/lib/packageManagerDetector.cjs.map +1 -1
- package/dist/development/src/lib/packageManagerDetector.js.map +1 -1
- package/dist/development/src/lib/version.cjs.map +1 -1
- package/dist/development/src/lib/version.js.map +1 -1
- package/dist/development/src/paths.cjs.map +1 -1
- package/dist/development/src/paths.js.map +1 -1
- package/dist/production/run.cjs +6 -4
- package/dist/production/run.cjs.map +1 -1
- package/dist/production/run.js +6 -4
- package/dist/production/run.js.map +1 -1
- package/dist/production/src/commands/WorkspaceCreateCommand.cjs +3 -2
- package/dist/production/src/commands/WorkspaceCreateCommand.cjs.map +1 -1
- package/dist/production/src/commands/WorkspaceCreateCommand.js +3 -2
- package/dist/production/src/commands/WorkspaceCreateCommand.js.map +1 -1
- package/dist/production/src/lib/FileSystem.cjs +1 -0
- package/dist/production/src/lib/FileSystem.cjs.map +1 -1
- package/dist/production/src/lib/FileSystem.js +1 -0
- package/dist/production/src/lib/FileSystem.js.map +1 -1
- package/dist/production/src/lib/TemplateInstaller.cjs +26 -8
- package/dist/production/src/lib/TemplateInstaller.cjs.map +1 -1
- package/dist/production/src/lib/TemplateInstaller.js +26 -8
- package/dist/production/src/lib/TemplateInstaller.js.map +1 -1
- package/dist/production/src/lib/packageManagerDetector.cjs.map +1 -1
- package/dist/production/src/lib/packageManagerDetector.js.map +1 -1
- package/dist/production/src/lib/version.cjs.map +1 -1
- package/dist/production/src/lib/version.js.map +1 -1
- package/dist/production/src/paths.cjs.map +1 -1
- package/dist/production/src/paths.js.map +1 -1
- package/dist/types/lib/FileSystem.d.ts +1 -0
- package/dist/types/lib/FileSystem.d.ts.map +1 -1
- package/dist/types/lib/TemplateInstaller.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -5
- package/resources/templates/default/.github/workflows/deploy.yaml +1 -1
- package/resources/templates/default/admin/app/pages/tenant.tsx +2 -2
- package/resources/templates/default/admin/lib/binding/binding.tsx +0 -2
- package/resources/templates/default/admin/lib/binding/hooks.tsx +14 -8
- package/resources/templates/default/admin/lib/binding/identity.tsx +31 -30
- package/resources/templates/default/admin/lib/binding/navigation-guard-dialog.tsx +12 -8
- package/resources/templates/default/admin/lib/binding/persist.tsx +7 -5
- package/resources/templates/default/admin/lib/block-repeater/block-repeater.tsx +10 -12
- package/resources/templates/default/admin/lib/board/board.tsx +59 -45
- package/resources/templates/default/admin/lib/buttons/back-button.tsx +1 -1
- package/resources/templates/default/admin/lib/datagrid/cells.tsx +49 -35
- package/resources/templates/default/admin/lib/datagrid/column-header.tsx +47 -38
- package/resources/templates/default/admin/lib/datagrid/columns.tsx +128 -105
- package/resources/templates/default/admin/lib/datagrid/elements.tsx +8 -4
- package/resources/templates/default/admin/lib/datagrid/filters/boolean.tsx +1 -4
- package/resources/templates/default/admin/lib/datagrid/filters/common.tsx +14 -14
- package/resources/templates/default/admin/lib/datagrid/filters/date.tsx +34 -20
- package/resources/templates/default/admin/lib/datagrid/filters/defined.tsx +0 -1
- package/resources/templates/default/admin/lib/datagrid/filters/enum.tsx +24 -30
- package/resources/templates/default/admin/lib/datagrid/filters/mobile.tsx +2 -3
- package/resources/templates/default/admin/lib/datagrid/filters/number.tsx +0 -3
- package/resources/templates/default/admin/lib/datagrid/filters/relation.tsx +35 -29
- package/resources/templates/default/admin/lib/datagrid/index.ts +21 -21
- package/resources/templates/default/admin/lib/datagrid/labels.tsx +0 -1
- package/resources/templates/default/admin/lib/datagrid/loader.tsx +2 -7
- package/resources/templates/default/admin/lib/datagrid/pagination.tsx +32 -37
- package/resources/templates/default/admin/lib/datagrid/table.tsx +7 -5
- package/resources/templates/default/admin/lib/datagrid/tiles.tsx +10 -5
- package/resources/templates/default/admin/lib/datagrid/toolbar.tsx +10 -7
- package/resources/templates/default/admin/lib/datagrid/ui.tsx +10 -13
- package/resources/templates/default/admin/lib/dev/login-panel.tsx +23 -16
- package/resources/templates/default/admin/lib/dict.ts +17 -5
- package/resources/templates/default/admin/lib/dimensions/dimensions.tsx +84 -60
- package/resources/templates/default/admin/lib/editor/block-editor.tsx +22 -10
- package/resources/templates/default/admin/lib/editor/common/baseEditorPlugins.tsx +0 -2
- package/resources/templates/default/admin/lib/editor/common/buttons.tsx +155 -33
- package/resources/templates/default/admin/lib/editor/common/editor-block-toolbar.tsx +3 -1
- package/resources/templates/default/admin/lib/editor/common/editor-canvas.tsx +5 -3
- package/resources/templates/default/admin/lib/editor/common/editor-editable-canvas.tsx +0 -1
- package/resources/templates/default/admin/lib/editor/common/editor-inline-toolbar.tsx +4 -1
- package/resources/templates/default/admin/lib/editor/common/elements/AnchorRenderer.tsx +18 -16
- package/resources/templates/default/admin/lib/editor/common/elements/BlockElement.tsx +46 -34
- package/resources/templates/default/admin/lib/editor/common/elements/HeadingRenderer.tsx +1 -1
- package/resources/templates/default/admin/lib/editor/common/elements/TableElementRenderer.tsx +2 -7
- package/resources/templates/default/admin/lib/editor/common/elements/TableRowElementRenderer.tsx +1 -5
- package/resources/templates/default/admin/lib/editor/editor-block.tsx +16 -9
- package/resources/templates/default/admin/lib/editor/rich-text-view.tsx +11 -6
- package/resources/templates/default/admin/lib/editor/rich-text.tsx +6 -7
- package/resources/templates/default/admin/lib/editor/sortable-block.tsx +31 -25
- package/resources/templates/default/admin/lib/form/container.tsx +51 -38
- package/resources/templates/default/admin/lib/form/inputs.tsx +14 -12
- package/resources/templates/default/admin/lib/form/select.tsx +93 -51
- package/resources/templates/default/admin/lib/form/ui.tsx +1 -1
- package/resources/templates/default/admin/lib/form/upload-repeaters.tsx +105 -72
- package/resources/templates/default/admin/lib/form/upload.tsx +61 -62
- package/resources/templates/default/admin/lib/labels/enum-labels.ts +6 -3
- package/resources/templates/default/admin/lib/labels/field-labels.ts +4 -2
- package/resources/templates/default/admin/lib/layout/layout-boxed.tsx +36 -26
- package/resources/templates/default/admin/lib/layout/slots.tsx +1 -4
- package/resources/templates/default/admin/lib/outdated-application-dialog/outdated-application-dialog.tsx +10 -4
- package/resources/templates/default/admin/lib/repeater/repeater.tsx +21 -12
- package/resources/templates/default/admin/lib/select/create-new.tsx +0 -3
- package/resources/templates/default/admin/lib/select/filter.tsx +0 -1
- package/resources/templates/default/admin/lib/select/list.tsx +33 -28
- package/resources/templates/default/admin/lib/select/multi-select.tsx +66 -70
- package/resources/templates/default/admin/lib/select/select.tsx +77 -72
- package/resources/templates/default/admin/lib/select/sortable-select.tsx +84 -82
- package/resources/templates/default/admin/lib/select/ui.tsx +8 -6
- package/resources/templates/default/admin/lib/tenant/forms/change-my-password.tsx +21 -8
- package/resources/templates/default/admin/lib/tenant/forms/common.tsx +21 -12
- package/resources/templates/default/admin/lib/tenant/forms/create-api-key.tsx +9 -5
- package/resources/templates/default/admin/lib/tenant/forms/invite.tsx +12 -7
- package/resources/templates/default/admin/lib/tenant/forms/login.tsx +26 -7
- package/resources/templates/default/admin/lib/tenant/forms/memberships-control.tsx +31 -19
- package/resources/templates/default/admin/lib/tenant/forms/password-reset-request.tsx +9 -5
- package/resources/templates/default/admin/lib/tenant/forms/password-reset.tsx +21 -8
- package/resources/templates/default/admin/lib/tenant/forms/passwordless-signin-init.tsx +9 -5
- package/resources/templates/default/admin/lib/tenant/forms/passwordless-signin.tsx +25 -12
- package/resources/templates/default/admin/lib/tenant/forms/update-project-member.tsx +3 -4
- package/resources/templates/default/admin/lib/tenant/hooks/useInviteUser.tsx +2 -3
- package/resources/templates/default/admin/lib/tenant/listing/api-key-list.tsx +5 -3
- package/resources/templates/default/admin/lib/tenant/listing/member-delete-dialog.tsx +13 -2
- package/resources/templates/default/admin/lib/tenant/listing/member-list.tsx +17 -11
- package/resources/templates/default/admin/lib/tenant/listing/person-list.tsx +6 -4
- package/resources/templates/default/admin/lib/tenant/otp/otp-setup.tsx +86 -59
- package/resources/templates/default/admin/lib/toast/toast.tsx +24 -22
- package/resources/templates/default/admin/lib/toast/toaster.tsx +0 -1
- package/resources/templates/default/admin/lib/ui/alert-dialog.tsx +4 -3
- package/resources/templates/default/admin/lib/ui/button.tsx +2 -1
- package/resources/templates/default/admin/lib/ui/dialog.tsx +12 -8
- package/resources/templates/default/admin/lib/ui/dimension.tsx +9 -0
- package/resources/templates/default/admin/lib/ui/dropdown.tsx +17 -14
- package/resources/templates/default/admin/lib/ui/input.tsx +18 -19
- package/resources/templates/default/admin/lib/ui/loader.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/menu.tsx +3 -11
- package/resources/templates/default/admin/lib/ui/overlay.tsx +11 -9
- package/resources/templates/default/admin/lib/ui/popover.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/property-list.tsx +2 -2
- package/resources/templates/default/admin/lib/ui/scroll-area.tsx +11 -11
- package/resources/templates/default/admin/lib/ui/select.tsx +1 -2
- package/resources/templates/default/admin/lib/ui/sheet.tsx +6 -5
- package/resources/templates/default/admin/lib/ui/sidebar.tsx +41 -30
- package/resources/templates/default/admin/lib/ui/switch.tsx +5 -3
- package/resources/templates/default/admin/lib/ui/textarea.tsx +7 -4
- package/resources/templates/default/admin/lib/ui/toggle-group.tsx +9 -5
- package/resources/templates/default/admin/lib/ui/toggle.tsx +3 -4
- package/resources/templates/default/admin/lib/ui/tooltip.tsx +2 -1
- package/resources/templates/default/admin/lib/upload/dropzone.tsx +14 -10
- package/resources/templates/default/admin/lib/upload/repeater.tsx +0 -1
- package/resources/templates/default/admin/lib/upload/ui.tsx +0 -4
- package/resources/templates/default/admin/lib/upload/upload-progress.tsx +27 -11
- package/resources/templates/default/admin/lib/upload/view.tsx +129 -67
- package/resources/templates/default/admin/lib/utils/createComponentOpenHooks.tsx +10 -6
- package/resources/templates/default/admin/lib/utils/uic.tsx +24 -14
- package/resources/templates/default/admin/lib/utils/use-mobile.ts +1 -3
- package/resources/templates/default/admin/package.json +2 -3
- package/resources/templates/default/admin/vite.config.ts +1 -1
- package/src/commands/WorkspaceCreateCommand.ts +3 -3
- package/src/lib/FileSystem.ts +1 -0
- package/src/lib/TemplateInstaller.ts +26 -8
- package/src/run.ts +8 -7
- package/resources/templates/default/admin/postcss.config.js +0 -5
- /package/resources/templates/default/admin/entrypoint/pages/{magicLintSent.tsx → magicLinkSent.tsx} +0 -0
|
@@ -14,29 +14,31 @@ export const ToastContent = ({ title, children, action, details }: {
|
|
|
14
14
|
}) => {
|
|
15
15
|
const [open, setOpen] = React.useState(false)
|
|
16
16
|
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
17
|
+
return (
|
|
18
|
+
<>
|
|
19
|
+
<div className="flex flex-col gap-1 flex-1 p-6 pr-8">
|
|
20
|
+
{title && <ToastTitle>{title}</ToastTitle>}
|
|
21
|
+
{children && <ToastDescription>{children}</ToastDescription>}
|
|
22
|
+
{details
|
|
23
|
+
? (
|
|
24
|
+
open ? <code className="p-1 bg-gray-50 border border-gray-200 rounded-sm font-mono text-xs">{details}</code> : (
|
|
25
|
+
<div>
|
|
26
|
+
<button onClick={() => setOpen(true)} className="text-sm text-gray-400 underline">{dict.toast.showDetails}</button>
|
|
27
|
+
</div>
|
|
28
|
+
)
|
|
29
|
+
)
|
|
30
|
+
: null}
|
|
31
|
+
</div>
|
|
32
|
+
{action}
|
|
33
|
+
</>
|
|
34
|
+
)
|
|
33
35
|
}
|
|
34
36
|
export const ToastAction = uic(ToastPrimitives.Action, {
|
|
35
|
-
baseClass:
|
|
37
|
+
baseClass:
|
|
38
|
+
'inline-flex h-8 shrink-0 items-center justify-center rounded-md border border-gray-200 bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive',
|
|
36
39
|
displayName: 'ToastAction',
|
|
37
40
|
})
|
|
38
41
|
|
|
39
|
-
|
|
40
42
|
export const ToastTitle = uic(ToastPrimitives.Title, {
|
|
41
43
|
baseClass: 'text-sm font-semibold',
|
|
42
44
|
displayName: 'ToastTitle',
|
|
@@ -48,7 +50,8 @@ export const ToastDescription = uic(ToastPrimitives.Description, {
|
|
|
48
50
|
})
|
|
49
51
|
|
|
50
52
|
export const Toast = uic(ToastPrimitives.Root, {
|
|
51
|
-
baseClass:
|
|
53
|
+
baseClass:
|
|
54
|
+
'group mt-2 pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-r-md border border-l-4 border-gray-200 bg-background text-foreground shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full',
|
|
52
55
|
variants: {
|
|
53
56
|
variant: {
|
|
54
57
|
info: 'border-l-blue-500',
|
|
@@ -69,18 +72,17 @@ export const Toast = uic(ToastPrimitives.Root, {
|
|
|
69
72
|
})
|
|
70
73
|
|
|
71
74
|
const ToastClose = uic(ToastPrimitives.Close, {
|
|
72
|
-
baseClass:
|
|
75
|
+
baseClass:
|
|
76
|
+
'absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-hidden focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600',
|
|
73
77
|
displayName: 'ToastClose',
|
|
74
78
|
beforeChildren: <X className="h-4 w-4" />,
|
|
75
79
|
})
|
|
76
80
|
|
|
77
|
-
|
|
78
81
|
const ToastViewport = uic(ToastPrimitives.Viewport, {
|
|
79
82
|
baseClass: 'fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]',
|
|
80
83
|
displayName: 'ToastViewport',
|
|
81
84
|
})
|
|
82
85
|
|
|
83
|
-
|
|
84
86
|
export function Toaster({ children }: {
|
|
85
87
|
children: ReactNode
|
|
86
88
|
}) {
|
|
@@ -14,12 +14,14 @@ export const AlertDialogTrigger = AlertDialogPrimitive.Trigger
|
|
|
14
14
|
export const AlertDialogPortal = AlertDialogPrimitive.Portal
|
|
15
15
|
|
|
16
16
|
export const AlertDialogOverlay = uic(AlertDialogPrimitive.Overlay, {
|
|
17
|
-
baseClass:
|
|
17
|
+
baseClass:
|
|
18
|
+
'fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
|
|
18
19
|
displayName: 'AlertDialogOverlay',
|
|
19
20
|
})
|
|
20
21
|
|
|
21
22
|
export const AlertDialogContent = uic(AlertDialogPrimitive.Content, {
|
|
22
|
-
baseClass:
|
|
23
|
+
baseClass:
|
|
24
|
+
'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg',
|
|
23
25
|
wrapOuter: props => {
|
|
24
26
|
return (
|
|
25
27
|
<AlertDialogPortal>
|
|
@@ -46,7 +48,6 @@ export const AlertDialogTitle = uic(AlertDialogPrimitive.Title, {
|
|
|
46
48
|
displayName: 'AlertDialogTitle',
|
|
47
49
|
})
|
|
48
50
|
|
|
49
|
-
|
|
50
51
|
export const AlertDialogDescription = uic(AlertDialogPrimitive.Description, {
|
|
51
52
|
baseClass: 'text-sm text-muted-foreground',
|
|
52
53
|
displayName: 'AlertDialogDescription',
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { uic, uiconfig } from '../utils'
|
|
2
2
|
|
|
3
3
|
export const buttonConfig = uiconfig({
|
|
4
|
-
baseClass:
|
|
4
|
+
baseClass:
|
|
5
|
+
'inline-flex items-center justify-center rounded-md text-sm font-medium whitespace-nowrap transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 transition-all',
|
|
5
6
|
variants: {
|
|
6
7
|
variant: {
|
|
7
8
|
default: 'bg-primary text-primary-foreground shadow-sm hover:bg-primary/90',
|
|
@@ -13,24 +13,28 @@ export const DialogPortal = DialogPrimitive.Portal
|
|
|
13
13
|
export const DialogClose = DialogPrimitive.Close
|
|
14
14
|
|
|
15
15
|
export const DialogOverlay = uic(DialogPrimitive.DialogOverlay, {
|
|
16
|
-
baseClass:
|
|
16
|
+
baseClass:
|
|
17
|
+
'fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
|
|
17
18
|
displayName: 'DialogOverlay',
|
|
18
19
|
})
|
|
19
20
|
|
|
20
21
|
export const DialogContent = uic(DialogPrimitive.Content, {
|
|
21
|
-
baseClass:
|
|
22
|
+
baseClass:
|
|
23
|
+
'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-gray-200 bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg',
|
|
22
24
|
wrapOuter: props => (
|
|
23
25
|
<DialogPortal>
|
|
24
26
|
<DialogOverlay />
|
|
25
27
|
{props.children}
|
|
26
28
|
</DialogPortal>
|
|
27
29
|
),
|
|
28
|
-
afterChildren:
|
|
29
|
-
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
afterChildren: (
|
|
31
|
+
<>
|
|
32
|
+
<DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
|
|
33
|
+
<XIcon className="h-4 w-4" />
|
|
34
|
+
<span className="sr-only">Close</span>
|
|
35
|
+
</DialogPrimitive.Close>
|
|
36
|
+
</>
|
|
37
|
+
),
|
|
34
38
|
})
|
|
35
39
|
|
|
36
40
|
export const DialogHeader = uic('div', {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { uic } from '../utils'
|
|
2
|
+
|
|
3
|
+
export const DimensionLabelWrapperUI = uic('div', {
|
|
4
|
+
baseClass: 'flex justify-between items-center',
|
|
5
|
+
})
|
|
6
|
+
|
|
7
|
+
export const DimensionLabelUI = uic('span', {
|
|
8
|
+
baseClass: 'ml-1 bg-gray-100 border border-gray-300 px-1 rounded text-xs pointer-events-none',
|
|
9
|
+
})
|
|
@@ -21,33 +21,34 @@ export const DropdownMenuSub = DropdownMenuPrimitive.Sub
|
|
|
21
21
|
|
|
22
22
|
export const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup
|
|
23
23
|
|
|
24
|
-
|
|
25
24
|
export const DropdownMenuSubTrigger = uic(DropdownMenuPrimitive.SubTrigger, {
|
|
26
25
|
baseClass: 'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent data-[state=open]:bg-accent',
|
|
27
|
-
beforeChildren:
|
|
28
|
-
<ChevronRight className="ml-auto h-4 w-4" />
|
|
29
|
-
),
|
|
26
|
+
beforeChildren: <ChevronRight className="ml-auto h-4 w-4" />,
|
|
30
27
|
displayName: 'DropdownMenuSubTrigger',
|
|
31
28
|
})
|
|
32
29
|
|
|
33
30
|
export const DropdownMenuSubContent = uic(DropdownMenuPrimitive.SubContent, {
|
|
34
|
-
baseClass:
|
|
31
|
+
baseClass:
|
|
32
|
+
'z-50 min-w-[8rem] overflow-hidden rounded-md border border-gray-200 bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
|
|
35
33
|
displayName: 'DropdownMenuSubContent',
|
|
36
34
|
})
|
|
37
35
|
|
|
38
36
|
export const DropdownMenuContent = uic(DropdownMenuPrimitive.DropdownMenuContent, {
|
|
39
37
|
wrapOuter: ({ children }) => <DropdownMenuPrimitive.Portal>{children}</DropdownMenuPrimitive.Portal>,
|
|
40
|
-
baseClass:
|
|
38
|
+
baseClass:
|
|
39
|
+
'z-50 min-w-[8rem] overflow-hidden rounded-md border border-gray-200 bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
|
|
41
40
|
displayName: 'DropdownMenuContent',
|
|
42
41
|
})
|
|
43
42
|
|
|
44
43
|
export const DropdownMenuItem = uic(DropdownMenuPrimitive.Item, {
|
|
45
|
-
baseClass:
|
|
44
|
+
baseClass:
|
|
45
|
+
'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
|
46
46
|
displayName: 'DropdownMenuItem',
|
|
47
47
|
})
|
|
48
48
|
|
|
49
49
|
export const DropdownMenuCheckboxItem = uic(DropdownMenuPrimitive.CheckboxItem, {
|
|
50
|
-
baseClass:
|
|
50
|
+
baseClass:
|
|
51
|
+
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
|
51
52
|
beforeChildren: (
|
|
52
53
|
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
53
54
|
<DropdownMenuPrimitive.ItemIndicator>
|
|
@@ -59,7 +60,8 @@ export const DropdownMenuCheckboxItem = uic(DropdownMenuPrimitive.CheckboxItem,
|
|
|
59
60
|
})
|
|
60
61
|
|
|
61
62
|
export const DropdownMenuRadioItem = uic(DropdownMenuPrimitive.RadioItem, {
|
|
62
|
-
baseClass:
|
|
63
|
+
baseClass:
|
|
64
|
+
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
|
63
65
|
beforeChildren: (
|
|
64
66
|
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
65
67
|
<DropdownMenuPrimitive.ItemIndicator>
|
|
@@ -70,7 +72,6 @@ export const DropdownMenuRadioItem = uic(DropdownMenuPrimitive.RadioItem, {
|
|
|
70
72
|
displayName: 'DropdownMenuRadioItem',
|
|
71
73
|
})
|
|
72
74
|
|
|
73
|
-
|
|
74
75
|
export const DropdownMenuLabel = uic(DropdownMenuPrimitive.Label, {
|
|
75
76
|
baseClass: 'px-2 py-1.5 text-sm font-semibold',
|
|
76
77
|
displayName: 'DropdownMenuLabel',
|
|
@@ -93,10 +94,12 @@ export const DropDownTriggerButton = uic('button', {
|
|
|
93
94
|
variant: 'ghost',
|
|
94
95
|
},
|
|
95
96
|
displayName: 'DropDownTriggerButton',
|
|
96
|
-
beforeChildren:
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
beforeChildren: (
|
|
98
|
+
<>
|
|
99
|
+
<MoreHorizontalIcon className="h-4 w-4" />
|
|
100
|
+
<span className="sr-only">Open menu</span>
|
|
101
|
+
</>
|
|
102
|
+
),
|
|
100
103
|
})
|
|
101
104
|
|
|
102
105
|
export const DefaultDropdown = ({ children }: { children: ReactNode }) => (
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { uic, uiconfig } from '../utils'
|
|
2
2
|
|
|
3
3
|
export const inputConfig = uiconfig({
|
|
4
|
-
baseClass:
|
|
5
|
-
flex w-full bg-background
|
|
6
|
-
file:border-0 file:bg-transparent file:text-sm file:font-medium
|
|
7
|
-
placeholder:text-muted-foreground
|
|
8
|
-
focus-visible:outline-
|
|
9
|
-
disabled:cursor-not-allowed disabled:opacity-50
|
|
10
|
-
read-only:bg-gray-100
|
|
11
|
-
|
|
12
|
-
data-[
|
|
13
|
-
|
|
4
|
+
baseClass: [
|
|
5
|
+
'flex w-full bg-background',
|
|
6
|
+
'file:border-0 file:bg-transparent file:text-sm file:font-medium',
|
|
7
|
+
'placeholder:text-muted-foreground',
|
|
8
|
+
'focus-visible:outline-none',
|
|
9
|
+
'disabled:cursor-not-allowed disabled:opacity-50',
|
|
10
|
+
'read-only:bg-gray-100',
|
|
11
|
+
// Uncomment this if you want to see inputs in dirty state
|
|
12
|
+
// 'data-[dirty]:border-yellow-500 focus-visible:data-[dirty]:border-input',
|
|
13
|
+
'data-[invalid]:border-destructive data-[invalid]:ring-destructive',
|
|
14
|
+
],
|
|
14
15
|
variants: {
|
|
15
16
|
inputSize: {
|
|
16
17
|
default: 'h-10 rounded-md p-2 text-sm',
|
|
@@ -34,14 +35,13 @@ export const Input = uic('input', {
|
|
|
34
35
|
})
|
|
35
36
|
|
|
36
37
|
export const InputLike = uic('div', {
|
|
37
|
-
baseClass:
|
|
38
|
-
flex items-center min-h-10 w-full rounded-md border border-input bg-background p-2 text-sm ring-offset-background
|
|
39
|
-
file:border-0 file:bg-transparent file:text-sm file:font-medium
|
|
40
|
-
placeholder:text-muted-foreground
|
|
41
|
-
focus-within:outline-
|
|
42
|
-
disabled:cursor-not-allowed
|
|
43
|
-
|
|
44
|
-
`,
|
|
38
|
+
baseClass: [
|
|
39
|
+
'flex items-center min-h-10 w-full rounded-md border border-input bg-background p-2 text-sm ring-offset-background',
|
|
40
|
+
'file:border-0 file:bg-transparent file:text-sm file:font-medium',
|
|
41
|
+
'placeholder:text-muted-foreground',
|
|
42
|
+
'focus-within:outline-none focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2',
|
|
43
|
+
'disabled:cursor-not-allowed disabled:opacity-50',
|
|
44
|
+
],
|
|
45
45
|
displayName: 'InputLike',
|
|
46
46
|
})
|
|
47
47
|
|
|
@@ -53,7 +53,6 @@ export const InputBare = uic('input', {
|
|
|
53
53
|
displayName: 'InputBare',
|
|
54
54
|
})
|
|
55
55
|
|
|
56
|
-
|
|
57
56
|
export const CheckboxInput = uic('input', {
|
|
58
57
|
baseClass: 'w-4 h-4',
|
|
59
58
|
defaultProps: {
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Link,
|
|
3
|
-
type RoleCondition,
|
|
4
|
-
type RoutingLinkTarget,
|
|
5
|
-
useCurrentRequest,
|
|
6
|
-
useProjectUserRoles,
|
|
7
|
-
} from '@contember/interface'
|
|
1
|
+
import { Link, type RoleCondition, type RoutingLinkTarget, useCurrentRequest, useProjectUserRoles } from '@contember/interface'
|
|
8
2
|
import { createContext } from '@contember/react-utils'
|
|
9
3
|
import { VariantProps } from 'class-variance-authority'
|
|
10
4
|
import { ChevronRight } from 'lucide-react'
|
|
@@ -55,7 +49,7 @@ const useHasActiveChild = (children: ReactNode) => {
|
|
|
55
49
|
const checkChild = (child: ReactNode): boolean => {
|
|
56
50
|
if (!isValidElement(child)) return false
|
|
57
51
|
|
|
58
|
-
const { to, children: grandChildren } = child.props
|
|
52
|
+
const { to, children: grandChildren } = child.props as Record<string, any>
|
|
59
53
|
|
|
60
54
|
if (to && isMatchingPage(to)) return true
|
|
61
55
|
|
|
@@ -110,9 +104,7 @@ export const MenuItem = ({ icon, label, to, children, role, expandedByDefault, .
|
|
|
110
104
|
<SidebarMenuButton isActive={isActive} tooltip={label} {...menuButtonProps}>
|
|
111
105
|
{icon}
|
|
112
106
|
<span>{label}</span>
|
|
113
|
-
{hasChildren &&
|
|
114
|
-
<ChevronRight className="ml-auto transition-transform duration-200" />
|
|
115
|
-
)}
|
|
107
|
+
{hasChildren && <ChevronRight className="ml-auto transition-transform duration-200" />}
|
|
116
108
|
</SidebarMenuButton>
|
|
117
109
|
</CollapsibleTrigger>
|
|
118
110
|
{hasChildren && (
|
|
@@ -8,7 +8,7 @@ export interface OverlayProps {
|
|
|
8
8
|
showImmediately?: boolean
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export const Overlay = ({ position = 'fixed',
|
|
11
|
+
export const Overlay = ({ position = 'fixed', className, children, showImmediately }: OverlayProps) => {
|
|
12
12
|
const [show, setShow] = React.useState(showImmediately ?? false)
|
|
13
13
|
React.useEffect(() => {
|
|
14
14
|
requestAnimationFrame(() => {
|
|
@@ -17,14 +17,16 @@ export const Overlay = ({ position = 'fixed', className, children, showImmediat
|
|
|
17
17
|
}, [])
|
|
18
18
|
|
|
19
19
|
return (
|
|
20
|
-
<div
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
<div
|
|
21
|
+
className={cn(
|
|
22
|
+
'z-50 bg-background/50 backdrop-blur-xs transition-all duration-300 delay-200',
|
|
23
|
+
show ? 'opacity-100' : 'opacity-0',
|
|
24
|
+
position === 'fixed' && 'w-full h-full fixed top-0 left-0',
|
|
25
|
+
position === 'absolute' && 'w-full h-full absolute top-0 left-0',
|
|
26
|
+
position === 'static' && '',
|
|
27
|
+
className,
|
|
28
|
+
)}
|
|
29
|
+
>
|
|
28
30
|
<div className="flex justify-center items-center h-full w-full">
|
|
29
31
|
{children}
|
|
30
32
|
</div>
|
|
@@ -23,11 +23,11 @@ export const PropertyValue = uic('div', {
|
|
|
23
23
|
/**
|
|
24
24
|
* Shortcut for creating a property list item with a label and a value.
|
|
25
25
|
*/
|
|
26
|
-
export const PropertyItem = (
|
|
26
|
+
export const PropertyItem = ({ label, children }: { label: string; children: ReactNode }) => {
|
|
27
27
|
return (
|
|
28
28
|
<PropertyRow>
|
|
29
29
|
<PropertyLabel>{label}</PropertyLabel>
|
|
30
30
|
<PropertyValue>{children}</PropertyValue>
|
|
31
31
|
</PropertyRow>
|
|
32
32
|
)
|
|
33
|
-
}
|
|
33
|
+
}
|
|
@@ -3,8 +3,8 @@ import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area'
|
|
|
3
3
|
import { cn } from '../utils'
|
|
4
4
|
|
|
5
5
|
const ScrollArea = React.forwardRef<
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
React.ElementRef<typeof ScrollAreaPrimitive.Root>,
|
|
7
|
+
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>
|
|
8
8
|
>(({ className, children, ...props }, ref) => (
|
|
9
9
|
<ScrollAreaPrimitive.Root
|
|
10
10
|
ref={ref}
|
|
@@ -14,30 +14,30 @@ const ScrollArea = React.forwardRef<
|
|
|
14
14
|
<ScrollAreaPrimitive.Viewport className={cn('h-full w-full rounded-[inherit]', className)}>
|
|
15
15
|
{children}
|
|
16
16
|
</ScrollAreaPrimitive.Viewport>
|
|
17
|
-
<ScrollBar/>
|
|
18
|
-
<ScrollAreaPrimitive.Corner/>
|
|
17
|
+
<ScrollBar />
|
|
18
|
+
<ScrollAreaPrimitive.Corner />
|
|
19
19
|
</ScrollAreaPrimitive.Root>
|
|
20
20
|
))
|
|
21
21
|
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName
|
|
22
22
|
|
|
23
23
|
const ScrollBar = React.forwardRef<
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,
|
|
25
|
+
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
26
26
|
>(({ className, orientation = 'vertical', ...props }, ref) => (
|
|
27
27
|
<ScrollAreaPrimitive.ScrollAreaScrollbar
|
|
28
28
|
ref={ref}
|
|
29
29
|
orientation={orientation}
|
|
30
30
|
className={cn(
|
|
31
31
|
'flex touch-none select-none transition-colors',
|
|
32
|
-
orientation === 'vertical'
|
|
33
|
-
|
|
34
|
-
orientation === 'horizontal'
|
|
35
|
-
|
|
32
|
+
orientation === 'vertical'
|
|
33
|
+
&& 'h-full w-2.5 border-l border-l-transparent p-[1px]',
|
|
34
|
+
orientation === 'horizontal'
|
|
35
|
+
&& 'h-2.5 flex-col border-t border-t-transparent p-[1px]',
|
|
36
36
|
className,
|
|
37
37
|
)}
|
|
38
38
|
{...props}
|
|
39
39
|
>
|
|
40
|
-
<ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border"/>
|
|
40
|
+
<ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border" />
|
|
41
41
|
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
42
42
|
))
|
|
43
43
|
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName
|
|
@@ -38,8 +38,7 @@ export const SelectContent = uic(SelectPrimitive.Content, {
|
|
|
38
38
|
displayName: SelectPrimitive.Content.displayName,
|
|
39
39
|
variants: {
|
|
40
40
|
position: {
|
|
41
|
-
popper:
|
|
42
|
-
'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
|
|
41
|
+
popper: 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
|
|
43
42
|
},
|
|
44
43
|
},
|
|
45
44
|
defaultVariants: {
|
|
@@ -13,17 +13,20 @@ export const SheetClose = SheetPrimitive.Close
|
|
|
13
13
|
export const SheetPortal = SheetPrimitive.Portal
|
|
14
14
|
|
|
15
15
|
export const SheetOverlay = uic(SheetPrimitive.Overlay, {
|
|
16
|
-
baseClass:
|
|
16
|
+
baseClass:
|
|
17
|
+
'fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
|
|
17
18
|
displayName: 'SheetOverlay',
|
|
18
19
|
})
|
|
19
20
|
|
|
20
21
|
export const SheetContent = uic(SheetPrimitive.Content, {
|
|
21
|
-
baseClass:
|
|
22
|
+
baseClass:
|
|
23
|
+
'fixed z-50 gap-4 bg-background p-6 shadow-lg overflow-auto transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500',
|
|
22
24
|
variants: {
|
|
23
25
|
side: {
|
|
24
26
|
top: 'inset-x-0 top-0 border-b border-gray-200 data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',
|
|
25
27
|
bottom: 'inset-x-0 bottom-0 border-t border-gray-200 data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',
|
|
26
|
-
left:
|
|
28
|
+
left:
|
|
29
|
+
'inset-y-0 left-0 h-full w-3/4 border-r border-gray-200 data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm',
|
|
27
30
|
right: 'inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm',
|
|
28
31
|
},
|
|
29
32
|
},
|
|
@@ -43,13 +46,11 @@ export const SheetContent = uic(SheetPrimitive.Content, {
|
|
|
43
46
|
),
|
|
44
47
|
})
|
|
45
48
|
|
|
46
|
-
|
|
47
49
|
export const SheetHeader = uic('div', {
|
|
48
50
|
baseClass: 'flex flex-col space-y-2 text-center sm:text-left',
|
|
49
51
|
displayName: 'SheetHeader',
|
|
50
52
|
})
|
|
51
53
|
|
|
52
|
-
|
|
53
54
|
export const SheetFooter = uic('div', {
|
|
54
55
|
baseClass: 'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',
|
|
55
56
|
displayName: 'SheetFooter',
|