@contember/create 2.1.0-rc.3 → 2.2.0-alpha.10
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/CLAUDE.md +22 -0
- package/dist/development/run.cjs +7 -7
- package/dist/development/run.cjs.map +1 -1
- package/dist/development/run.js +8 -8
- package/dist/development/run.js.map +1 -1
- package/dist/development/src/commands/WorkspaceCreateCommand.cjs +28 -14
- package/dist/development/src/commands/WorkspaceCreateCommand.cjs.map +1 -1
- package/dist/development/src/commands/WorkspaceCreateCommand.js +28 -14
- package/dist/development/src/commands/WorkspaceCreateCommand.js.map +1 -1
- package/dist/development/src/lib/FileSystem.cjs +1 -2
- package/dist/development/src/lib/FileSystem.cjs.map +1 -1
- package/dist/development/src/lib/FileSystem.js +1 -2
- package/dist/development/src/lib/FileSystem.js.map +1 -1
- package/dist/development/src/lib/TemplateInstaller.cjs +79 -67
- package/dist/development/src/lib/TemplateInstaller.cjs.map +1 -1
- package/dist/development/src/lib/TemplateInstaller.js +72 -60
- package/dist/development/src/lib/TemplateInstaller.js.map +1 -1
- package/dist/development/src/lib/packageManagerDetector.cjs +6 -6
- package/dist/development/src/lib/packageManagerDetector.cjs.map +1 -1
- package/dist/development/src/lib/version.cjs +2 -2
- 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 +3 -3
- package/dist/development/src/paths.cjs.map +1 -1
- package/dist/production/run.cjs +7 -7
- package/dist/production/run.cjs.map +1 -1
- package/dist/production/run.js +8 -8
- package/dist/production/run.js.map +1 -1
- package/dist/production/src/commands/WorkspaceCreateCommand.cjs +28 -14
- package/dist/production/src/commands/WorkspaceCreateCommand.cjs.map +1 -1
- package/dist/production/src/commands/WorkspaceCreateCommand.js +28 -14
- package/dist/production/src/commands/WorkspaceCreateCommand.js.map +1 -1
- package/dist/production/src/lib/FileSystem.cjs +1 -2
- package/dist/production/src/lib/FileSystem.cjs.map +1 -1
- package/dist/production/src/lib/FileSystem.js +1 -2
- package/dist/production/src/lib/FileSystem.js.map +1 -1
- package/dist/production/src/lib/TemplateInstaller.cjs +79 -67
- package/dist/production/src/lib/TemplateInstaller.cjs.map +1 -1
- package/dist/production/src/lib/TemplateInstaller.js +72 -60
- package/dist/production/src/lib/TemplateInstaller.js.map +1 -1
- package/dist/production/src/lib/packageManagerDetector.cjs +6 -6
- package/dist/production/src/lib/packageManagerDetector.cjs.map +1 -1
- package/dist/production/src/lib/version.cjs +2 -2
- 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 +3 -3
- package/dist/production/src/paths.cjs.map +1 -1
- package/dist/types/commands/WorkspaceCreateCommand.d.ts +16 -4
- package/dist/types/commands/WorkspaceCreateCommand.d.ts.map +1 -1
- package/dist/types/commands/index.d.ts +1 -1
- package/dist/types/commands/index.d.ts.map +1 -1
- package/dist/types/lib/FileSystem.d.ts +3 -2
- package/dist/types/lib/FileSystem.d.ts.map +1 -1
- package/dist/types/lib/TemplateInstaller.d.ts +10 -2
- package/dist/types/lib/TemplateInstaller.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -4
- package/resources/templates/default/README.md +3 -1
- package/resources/templates/default/admin/app/components/navigation.tsx +95 -8
- package/resources/templates/default/admin/app/pages/tenant.tsx +328 -77
- package/resources/templates/default/admin/entrypoint/components/login.tsx +1 -1
- package/resources/templates/default/admin/entrypoint/pages/magicLink.tsx +1 -1
- package/resources/templates/default/admin/entrypoint/pages/magicLinkSent.tsx +1 -1
- package/resources/templates/default/admin/entrypoint/pages/passwordReset.tsx +1 -1
- package/resources/templates/default/admin/entrypoint/pages/resetRequest.tsx +1 -1
- package/resources/templates/default/admin/entrypoint/pages/resetRequestSuccess.tsx +1 -1
- package/resources/templates/default/admin/lib/binding/binding.tsx +19 -4
- package/resources/templates/default/admin/lib/binding/delete.tsx +37 -3
- package/resources/templates/default/admin/lib/binding/hooks.tsx +65 -3
- package/resources/templates/default/admin/lib/binding/identity.tsx +17 -4
- package/resources/templates/default/admin/lib/binding/index.ts +5 -5
- package/resources/templates/default/admin/lib/binding/navigation-guard-dialog.tsx +15 -3
- package/resources/templates/default/admin/lib/binding/persist.tsx +27 -5
- package/resources/templates/default/admin/lib/block-repeater/block-repeater.tsx +15 -11
- package/resources/templates/default/admin/lib/block-repeater/index.ts +1 -1
- package/resources/templates/default/admin/lib/board/board.tsx +2 -2
- package/resources/templates/default/admin/lib/board/index.ts +1 -1
- package/resources/templates/default/admin/lib/buttons/back-button.tsx +22 -2
- package/resources/templates/default/admin/lib/buttons/index.ts +2 -2
- package/resources/templates/default/admin/lib/buttons/link-back-button.tsx +11 -2
- package/resources/templates/default/admin/lib/datagrid/cells.tsx +3 -3
- package/resources/templates/default/admin/lib/datagrid/column-header.tsx +4 -4
- package/resources/templates/default/admin/lib/datagrid/columns.tsx +28 -14
- package/resources/templates/default/admin/lib/datagrid/elements.tsx +2 -2
- package/resources/templates/default/admin/lib/datagrid/empty.tsx +1 -1
- package/resources/templates/default/admin/lib/datagrid/export.tsx +2 -2
- package/resources/templates/default/admin/lib/datagrid/filters/boolean.tsx +13 -13
- package/resources/templates/default/admin/lib/datagrid/filters/common.tsx +2 -2
- package/resources/templates/default/admin/lib/datagrid/filters/date.tsx +37 -16
- package/resources/templates/default/admin/lib/datagrid/filters/defined.tsx +13 -12
- package/resources/templates/default/admin/lib/datagrid/filters/enum.tsx +56 -22
- package/resources/templates/default/admin/lib/datagrid/filters/index.ts +7 -7
- package/resources/templates/default/admin/lib/datagrid/filters/mobile.tsx +18 -0
- package/resources/templates/default/admin/lib/datagrid/filters/number.tsx +10 -13
- package/resources/templates/default/admin/lib/datagrid/filters/relation.tsx +8 -8
- package/resources/templates/default/admin/lib/datagrid/filters/text.tsx +9 -9
- package/resources/templates/default/admin/lib/datagrid/grid.tsx +31 -23
- package/resources/templates/default/admin/lib/datagrid/index.ts +12 -12
- package/resources/templates/default/admin/lib/datagrid/labels.tsx +22 -4
- package/resources/templates/default/admin/lib/datagrid/layout-switcher.tsx +10 -4
- package/resources/templates/default/admin/lib/datagrid/loader.tsx +4 -4
- package/resources/templates/default/admin/lib/datagrid/pagination.tsx +16 -6
- package/resources/templates/default/admin/lib/datagrid/table.tsx +8 -6
- package/resources/templates/default/admin/lib/datagrid/tiles.tsx +6 -5
- package/resources/templates/default/admin/lib/datagrid/toolbar.tsx +15 -19
- package/resources/templates/default/admin/lib/datagrid/ui.tsx +3 -3
- package/resources/templates/default/admin/lib/dev/index.ts +2 -2
- package/resources/templates/default/admin/lib/dev/login-panel.tsx +12 -3
- package/resources/templates/default/admin/lib/dev/todo.tsx +12 -0
- package/resources/templates/default/admin/lib/dict.ts +0 -261
- package/resources/templates/default/admin/lib/dimensions/dimensions.tsx +85 -4
- package/resources/templates/default/admin/lib/dimensions/index.ts +1 -1
- package/resources/templates/default/admin/lib/editor/block-editor.tsx +72 -3
- package/resources/templates/default/admin/lib/editor/common/baseEditorPlugins.tsx +54 -11
- package/resources/templates/default/admin/lib/editor/common/buttons.tsx +1 -1
- package/resources/templates/default/admin/lib/editor/common/editor-block-toolbar.tsx +1 -1
- package/resources/templates/default/admin/lib/editor/common/elements/HeadingRenderer.tsx +1 -1
- package/resources/templates/default/admin/lib/editor/common/elements/HorizontalRuleRenderer.tsx +1 -1
- package/resources/templates/default/admin/lib/editor/common/elements/ListItemRenderer.tsx +1 -1
- package/resources/templates/default/admin/lib/editor/common/elements/OrderedListRenderer.tsx +1 -1
- package/resources/templates/default/admin/lib/editor/common/elements/TableElementRenderer.tsx +1 -1
- package/resources/templates/default/admin/lib/editor/common/elements/UnorderedListRenderer.tsx +1 -1
- package/resources/templates/default/admin/lib/editor/common/index.ts +6 -6
- package/resources/templates/default/admin/lib/editor/editor-block.tsx +54 -3
- package/resources/templates/default/admin/lib/editor/index.ts +6 -6
- package/resources/templates/default/admin/lib/editor/plugins.tsx +46 -2
- package/resources/templates/default/admin/lib/editor/rich-text-view.tsx +44 -0
- package/resources/templates/default/admin/lib/editor/rich-text.tsx +31 -3
- package/resources/templates/default/admin/lib/editor/sortable-block.tsx +34 -2
- package/resources/templates/default/admin/lib/errors/index.ts +1 -1
- package/resources/templates/default/admin/lib/errors/use-error-formatter.ts +22 -1
- package/resources/templates/default/admin/lib/field/formatted-field.tsx +16 -1
- package/resources/templates/default/admin/lib/field/index.ts +2 -1
- package/resources/templates/default/admin/lib/field/list-field.tsx +56 -0
- package/resources/templates/default/admin/lib/form/container.tsx +33 -3
- package/resources/templates/default/admin/lib/form/index.ts +6 -5
- package/resources/templates/default/admin/lib/form/inputs.tsx +105 -6
- package/resources/templates/default/admin/lib/form/labels.tsx +1 -1
- package/resources/templates/default/admin/lib/form/select.tsx +162 -5
- package/resources/templates/default/admin/lib/form/ui.tsx +2 -2
- package/resources/templates/default/admin/lib/form/upload-repeaters.tsx +159 -5
- package/resources/templates/default/admin/lib/form/upload.tsx +116 -3
- package/resources/templates/default/admin/lib/formatting/formatting.ts +106 -1
- package/resources/templates/default/admin/lib/formatting/index.ts +1 -1
- package/resources/templates/default/admin/lib/images/formatImageResizeUrl.ts +19 -0
- package/resources/templates/default/admin/lib/images/index.ts +1 -1
- package/resources/templates/default/admin/lib/index.ts +54 -0
- package/resources/templates/default/admin/lib/labels/index.ts +2 -2
- package/resources/templates/default/admin/lib/layout/index.ts +3 -3
- package/resources/templates/default/admin/lib/layout/layout-boxed.tsx +5 -5
- package/resources/templates/default/admin/lib/layout/layout.tsx +3 -3
- package/resources/templates/default/admin/lib/outdated-application-dialog/index.ts +1 -1
- package/resources/templates/default/admin/lib/outdated-application-dialog/outdated-application-dialog.tsx +2 -2
- package/resources/templates/default/admin/lib/repeater/index.ts +1 -1
- package/resources/templates/default/admin/lib/repeater/repeater.tsx +26 -9
- package/resources/templates/default/admin/lib/select/create-new.tsx +19 -3
- package/resources/templates/default/admin/lib/select/filter.tsx +8 -2
- package/resources/templates/default/admin/lib/select/highlight.tsx +16 -0
- package/resources/templates/default/admin/lib/select/index.ts +6 -6
- package/resources/templates/default/admin/lib/select/list.tsx +30 -6
- package/resources/templates/default/admin/lib/select/multi-select.tsx +41 -4
- package/resources/templates/default/admin/lib/select/select.tsx +44 -6
- package/resources/templates/default/admin/lib/select/sortable-select.tsx +15 -6
- package/resources/templates/default/admin/lib/select/ui.tsx +100 -4
- package/resources/templates/default/admin/lib/tenant/config/auth-policy-list.tsx +86 -0
- package/resources/templates/default/admin/lib/tenant/config/common.tsx +71 -0
- package/resources/templates/default/admin/lib/tenant/config/identity-provider-list.tsx +113 -0
- package/resources/templates/default/admin/lib/tenant/config/index.ts +5 -0
- package/resources/templates/default/admin/lib/tenant/config/mail-template-list.tsx +108 -0
- package/resources/templates/default/admin/lib/tenant/config/tenant-config-view.tsx +182 -0
- package/resources/templates/default/admin/lib/tenant/dict.ts +770 -0
- package/resources/templates/default/admin/lib/tenant/errors.ts +10 -0
- package/resources/templates/default/admin/lib/tenant/forms/add-project-member.tsx +57 -0
- package/resources/templates/default/admin/lib/tenant/forms/change-my-password.tsx +4 -4
- package/resources/templates/default/admin/lib/tenant/forms/change-my-profile.tsx +40 -0
- package/resources/templates/default/admin/lib/tenant/forms/change-profile.tsx +55 -0
- package/resources/templates/default/admin/lib/tenant/forms/common.tsx +12 -5
- package/resources/templates/default/admin/lib/tenant/forms/confirm-email-change.tsx +38 -0
- package/resources/templates/default/admin/lib/tenant/forms/create-api-key.tsx +5 -5
- package/resources/templates/default/admin/lib/tenant/forms/create-global-api-key.tsx +69 -0
- package/resources/templates/default/admin/lib/tenant/forms/global-roles-control.tsx +113 -0
- package/resources/templates/default/admin/lib/tenant/forms/index.ts +23 -8
- package/resources/templates/default/admin/lib/tenant/forms/invite.tsx +46 -8
- package/resources/templates/default/admin/lib/tenant/forms/login.tsx +8 -14
- package/resources/templates/default/admin/lib/tenant/forms/memberships-control.tsx +7 -5
- package/resources/templates/default/admin/lib/tenant/forms/mfa-code-fields.tsx +81 -0
- package/resources/templates/default/admin/lib/tenant/forms/password-reset-request.tsx +4 -4
- package/resources/templates/default/admin/lib/tenant/forms/password-reset.tsx +4 -4
- package/resources/templates/default/admin/lib/tenant/forms/passwordless-signin-init.tsx +4 -4
- package/resources/templates/default/admin/lib/tenant/forms/passwordless-signin.tsx +8 -14
- package/resources/templates/default/admin/lib/tenant/forms/request-email-verification.tsx +35 -0
- package/resources/templates/default/admin/lib/tenant/forms/set-person-password.tsx +58 -0
- package/resources/templates/default/admin/lib/tenant/forms/set-project-secret.tsx +59 -0
- package/resources/templates/default/admin/lib/tenant/forms/sign-up.tsx +73 -0
- package/resources/templates/default/admin/lib/tenant/forms/update-project-member.tsx +14 -5
- package/resources/templates/default/admin/lib/tenant/forms/verify-email.tsx +38 -0
- package/resources/templates/default/admin/lib/tenant/hooks/index.ts +2 -0
- package/resources/templates/default/admin/lib/tenant/hooks/useInvite.ts +41 -0
- package/resources/templates/default/admin/lib/tenant/hooks/useInviteUser.tsx +32 -3
- package/resources/templates/default/admin/lib/tenant/idp/identity-provider-connections.tsx +124 -0
- package/resources/templates/default/admin/lib/tenant/idp/index.ts +1 -0
- package/resources/templates/default/admin/lib/tenant/index.ts +10 -3
- package/resources/templates/default/admin/lib/tenant/listing/api-key-list.tsx +161 -23
- package/resources/templates/default/admin/lib/tenant/listing/auth-log-list.tsx +179 -0
- package/resources/templates/default/admin/lib/tenant/listing/global-api-key-list.tsx +149 -0
- package/resources/templates/default/admin/lib/tenant/listing/index.ts +11 -4
- package/resources/templates/default/admin/lib/tenant/listing/member-delete-dialog.tsx +4 -4
- package/resources/templates/default/admin/lib/tenant/listing/member-list.tsx +28 -19
- package/resources/templates/default/admin/lib/tenant/listing/mfa.tsx +29 -0
- package/resources/templates/default/admin/lib/tenant/listing/person-actions.tsx +179 -0
- package/resources/templates/default/admin/lib/tenant/listing/person-detail.tsx +141 -0
- package/resources/templates/default/admin/lib/tenant/listing/person-list.tsx +17 -6
- package/resources/templates/default/admin/lib/tenant/listing/persons-list.tsx +128 -0
- package/resources/templates/default/admin/lib/tenant/listing/project-secret-list.tsx +82 -0
- package/resources/templates/default/admin/lib/tenant/otp/backup-codes.tsx +81 -0
- package/resources/templates/default/admin/lib/tenant/otp/email-otp-setup.tsx +133 -0
- package/resources/templates/default/admin/lib/tenant/otp/index.ts +3 -1
- package/resources/templates/default/admin/lib/tenant/otp/otp-setup.tsx +6 -6
- package/resources/templates/default/admin/lib/tenant/security/index.ts +2 -0
- package/resources/templates/default/admin/lib/tenant/security/passwordless-toggle.tsx +63 -0
- package/resources/templates/default/admin/lib/tenant/security/session-list.tsx +143 -0
- package/resources/templates/default/admin/lib/toast/index.ts +2 -2
- package/resources/templates/default/admin/lib/toast/toast.tsx +3 -3
- package/resources/templates/default/admin/lib/ui/alert-dialog.tsx +114 -3
- package/resources/templates/default/admin/lib/ui/avatar.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/button.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/card.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/collapsible.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/dialog.tsx +2 -2
- package/resources/templates/default/admin/lib/ui/dimension.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/divider.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/dropdown.tsx +3 -3
- package/resources/templates/default/admin/lib/ui/input.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/label.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/loader.tsx +2 -2
- package/resources/templates/default/admin/lib/ui/menu.tsx +2 -2
- package/resources/templates/default/admin/lib/ui/overlay.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/popover.tsx +2 -2
- package/resources/templates/default/admin/lib/ui/progress.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/property-list.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/scroll-area.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/select.tsx +44 -2
- package/resources/templates/default/admin/lib/ui/separator.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/sheet.tsx +2 -2
- package/resources/templates/default/admin/lib/ui/sidebar.tsx +8 -8
- package/resources/templates/default/admin/lib/ui/skeleton.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/sortable.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/switch.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/table.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/textarea.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/toggle-group.tsx +2 -2
- package/resources/templates/default/admin/lib/ui/toggle.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/tooltip.tsx +2 -2
- package/resources/templates/default/admin/lib/upload/dropzone.tsx +20 -3
- package/resources/templates/default/admin/lib/upload/index.ts +3 -3
- package/resources/templates/default/admin/lib/upload/repeater.tsx +5 -1
- package/resources/templates/default/admin/lib/upload/ui.tsx +2 -2
- package/resources/templates/default/admin/lib/upload/upload-progress.tsx +6 -6
- package/resources/templates/default/admin/lib/upload/view.tsx +4 -4
- package/resources/templates/default/admin/lib/utils/cn.ts +18 -0
- package/resources/templates/default/admin/lib/utils/createComponentOpenHooks.tsx +33 -0
- package/resources/templates/default/admin/lib/utils/index.ts +2 -2
- package/resources/templates/default/admin/lib/utils/uic.tsx +59 -0
- package/resources/templates/default/admin/lib/utils/use-mobile.ts +19 -0
- package/resources/templates/default/admin/package.json +1 -0
- package/resources/templates/default/docker/object-storage/README.md +13 -0
- package/resources/templates/default/docker/object-storage/identities.json +13 -0
- package/resources/templates/default/docker-compose.yaml +29 -7
- package/resources/templates/default/scripts/assemble-ui-lib.mjs +132 -0
- package/resources/templates/default/scripts/update-ui-lib.sh +101 -185
- package/src/commands/WorkspaceCreateCommand.ts +45 -17
- package/src/commands/index.ts +1 -1
- package/src/lib/FileSystem.ts +2 -2
- package/src/lib/TemplateInstaller.ts +87 -69
- package/src/lib/version.ts +1 -1
- package/src/run.ts +11 -10
- package/tests/cases/unit/create-process.test.ts +66 -0
- package/tests/cases/unit/template-installer-cleanup.test.ts +150 -0
- package/tests/cases/unit/workspace-create.test.ts +81 -0
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
AlertDialogDescription,
|
|
8
8
|
AlertDialogFooter,
|
|
9
9
|
AlertDialogHeader,
|
|
10
|
-
} from '
|
|
10
|
+
} from '~/lib'
|
|
11
11
|
import { useIsApplicationOutdated } from '@contember/interface'
|
|
12
12
|
import { ClockIcon, RefreshCwIcon } from 'lucide-react'
|
|
13
|
-
import { dict } from '
|
|
13
|
+
import { dict } from '~/lib'
|
|
14
14
|
|
|
15
15
|
const postponeTimeoutMs = 60_000 * 5
|
|
16
16
|
const checkIntervalMs = 30_000
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './repeater'
|
|
1
|
+
export * from './repeater.js'
|
|
@@ -17,10 +17,10 @@ import {
|
|
|
17
17
|
RepeaterSortableItemNode,
|
|
18
18
|
} from '@contember/react-repeater-dnd-kit'
|
|
19
19
|
import { GripVerticalIcon, PlusCircleIcon, Trash2Icon } from 'lucide-react'
|
|
20
|
-
import { Button } from '
|
|
21
|
-
import { uic } from '
|
|
22
|
-
import { DropIndicator } from '
|
|
23
|
-
import { dict } from '
|
|
20
|
+
import { Button } from '~/lib'
|
|
21
|
+
import { uic } from '~/lib'
|
|
22
|
+
import { DropIndicator } from '~/lib'
|
|
23
|
+
import { dict } from '~/lib'
|
|
24
24
|
import { ReactNode } from 'react'
|
|
25
25
|
|
|
26
26
|
const RepeaterWrapperUI = uic('div', {
|
|
@@ -41,6 +41,10 @@ const RepeaterEmptyUI = uic('div', {
|
|
|
41
41
|
baseClass: 'italic text-sm text-gray-600',
|
|
42
42
|
})
|
|
43
43
|
|
|
44
|
+
/**
|
|
45
|
+
* A visual indicator for sortable repeater items,
|
|
46
|
+
* showing where an item will be dropped. It adapts its placement based on the `position` prop.
|
|
47
|
+
*/
|
|
44
48
|
export const RepeaterDropIndicator = ({ position }: { position: 'before' | 'after' }) => (
|
|
45
49
|
<div className={'relative'}>
|
|
46
50
|
<RepeaterSortableDropIndicator position={position}>
|
|
@@ -49,6 +53,11 @@ export const RepeaterDropIndicator = ({ position }: { position: 'before' | 'afte
|
|
|
49
53
|
</div>
|
|
50
54
|
)
|
|
51
55
|
|
|
56
|
+
/**
|
|
57
|
+
* A button that adds a new item to a repeater at a specified index.
|
|
58
|
+
* It wraps the `RepeaterAddItemTrigger` and displays customizable content.
|
|
59
|
+
* By default, it shows a plus icon alongside a localized label.
|
|
60
|
+
*/
|
|
52
61
|
export const RepeaterAddItemButton = ({ children, index }: { children?: React.ReactNode; index?: RepeaterAddItemIndex }) => (
|
|
53
62
|
<RepeaterAddItemTrigger index={index}>
|
|
54
63
|
<div>
|
|
@@ -65,7 +74,9 @@ export const RepeaterAddItemButton = ({ children, index }: { children?: React.Re
|
|
|
65
74
|
)
|
|
66
75
|
|
|
67
76
|
/**
|
|
68
|
-
* A button that removes
|
|
77
|
+
* A button that removes an item from a repeater.
|
|
78
|
+
* It wraps the `RepeaterRemoveItemTrigger` and displays a customizable child element.
|
|
79
|
+
* By default, it shows a trash icon that turns red on hover.
|
|
69
80
|
*/
|
|
70
81
|
export const RepeaterRemoveItemButton = ({ children }: { children?: React.ReactNode }) => (
|
|
71
82
|
<RepeaterRemoveItemTrigger>
|
|
@@ -86,13 +97,22 @@ export const RepeaterItemActions = uic('div', {
|
|
|
86
97
|
baseClass: 'absolute top-1 right-2 flex gap-2',
|
|
87
98
|
})
|
|
88
99
|
|
|
100
|
+
/**
|
|
101
|
+
* Props for the {@link DefaultRepeater} component.
|
|
102
|
+
*/
|
|
89
103
|
export type DefaultRepeaterProps =
|
|
90
104
|
& {
|
|
105
|
+
/**
|
|
106
|
+
* Optional repeater title.
|
|
107
|
+
*/
|
|
91
108
|
title?: ReactNode
|
|
92
109
|
/**
|
|
93
|
-
*
|
|
110
|
+
* Optional position of the add button.
|
|
94
111
|
*/
|
|
95
112
|
addButtonPosition?: 'none' | 'after' | 'before' | 'around'
|
|
113
|
+
/**
|
|
114
|
+
* Optional label of the add button.
|
|
115
|
+
*/
|
|
96
116
|
addButtonLabel?: ReactNode
|
|
97
117
|
}
|
|
98
118
|
& RepeaterProps
|
|
@@ -100,9 +120,6 @@ export type DefaultRepeaterProps =
|
|
|
100
120
|
/**
|
|
101
121
|
* DefaultRepeater is a wrapper around Repeater that provides a default UI for a list of items.
|
|
102
122
|
*
|
|
103
|
-
* ## Props {@link DefaultRepeaterProps}
|
|
104
|
-
* - field or entities, sortableBy or orderBy, addButtonPosition, title
|
|
105
|
-
*
|
|
106
123
|
* ## Example
|
|
107
124
|
* ```tsx
|
|
108
125
|
* <DefaultRepeater entities="RepeaterItem" sortableBy="order" title="Foo items" addButtonPosition="around">
|
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { ReactElement, ReactNode } from 'react'
|
|
3
|
-
import { Button } from '
|
|
3
|
+
import { Button } from '~/lib'
|
|
4
4
|
import { SelectItemTrigger, SelectNewItem } from '@contember/react-select'
|
|
5
|
-
import { dict } from '
|
|
6
|
-
import { Dialog, DialogClose, DialogContent, DialogFooter, DialogTrigger } from '
|
|
5
|
+
import { dict } from '~/lib'
|
|
6
|
+
import { Dialog, DialogClose, DialogContent, DialogFooter, DialogTrigger } from '~/lib'
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* `CreateEntityDialog` is a modal component that facilitates the creation of a new entity.
|
|
10
|
+
* It integrates entity selection functionality with confirmation and cancellation actions.
|
|
11
|
+
*
|
|
12
|
+
* ## Example: Basic usage
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <CreateEntityDialog
|
|
15
|
+
* trigger={<Button>Create New Entity</Button>}
|
|
16
|
+
* >
|
|
17
|
+
* <EntityForm />
|
|
18
|
+
* </CreateEntityDialog>
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @group SelectInput
|
|
22
|
+
* @group MultiSelectInput
|
|
23
|
+
*/
|
|
8
24
|
export const CreateEntityDialog = ({ trigger, children }: { trigger: ReactElement; children: ReactNode }) => {
|
|
9
25
|
return (
|
|
10
26
|
<Dialog>
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
|
-
import { Input } from '
|
|
2
|
+
import { Input } from '~/lib'
|
|
3
3
|
import { DataViewHasFilterType, DataViewQueryFilterName, DataViewTextFilterInput } from '@contember/react-dataview'
|
|
4
|
-
import { dict } from '
|
|
4
|
+
import { dict } from '~/lib'
|
|
5
5
|
import { memo } from 'react'
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* `SelectDefaultFilter` is component for filtering data in a `SelectDataView`.
|
|
9
|
+
* It checks if a specific filter type exists and, if so, renders a text input for filtering.
|
|
10
|
+
*
|
|
11
|
+
* @group SelectInput
|
|
12
|
+
*/
|
|
7
13
|
export const SelectDefaultFilter = memo(() => (
|
|
8
14
|
<DataViewHasFilterType name={DataViewQueryFilterName}>
|
|
9
15
|
<DataViewTextFilterInput name={DataViewQueryFilterName}>
|
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
import { useCallback } from 'react'
|
|
2
2
|
import { DataViewHighlightEvent } from '@contember/react-dataview'
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* `useOnHighlight` is a hook that returns a callback function to handle the highlight event of a data view.
|
|
6
|
+
*
|
|
7
|
+
* ## Requirements
|
|
8
|
+
* - Must be used within an Entity context (`<EntitySubTree />` or `<EntityListSubTree />`).
|
|
9
|
+
*
|
|
10
|
+
* ## Usage
|
|
11
|
+
* ```tsx
|
|
12
|
+
* const onHighlight = useOnHighlight()
|
|
13
|
+
* ...
|
|
14
|
+
* <DataView onHighlight={onHighlight} />
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @group SelectInput
|
|
18
|
+
* @group MultiSelectInput
|
|
19
|
+
*/
|
|
4
20
|
export const useOnHighlight = () => {
|
|
5
21
|
return useCallback((event: DataViewHighlightEvent) => {
|
|
6
22
|
const scrollArea = event.element.closest('[data-radix-scroll-area-viewport]')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './filter'
|
|
2
|
-
export * from './list'
|
|
3
|
-
export * from './multi-select'
|
|
4
|
-
export * from './select'
|
|
5
|
-
export * from './sortable-select'
|
|
6
|
-
export * from './ui'
|
|
1
|
+
export * from './filter.js'
|
|
2
|
+
export * from './list.js'
|
|
3
|
+
export * from './multi-select.js'
|
|
4
|
+
export * from './select.js'
|
|
5
|
+
export * from './sortable-select.js'
|
|
6
|
+
export * from './ui.js'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { ReactNode } from 'react'
|
|
3
|
-
import { ScrollArea } from '
|
|
4
|
-
import { Loader } from '
|
|
3
|
+
import { ScrollArea } from '~/lib'
|
|
4
|
+
import { Loader } from '~/lib'
|
|
5
5
|
import {
|
|
6
6
|
DataViewHighlightRow,
|
|
7
7
|
DataViewInfiniteLoadEachRow,
|
|
@@ -13,20 +13,44 @@ import {
|
|
|
13
13
|
DataViewSortingDirections,
|
|
14
14
|
DataViewUnionFilterFields,
|
|
15
15
|
} from '@contember/react-dataview'
|
|
16
|
-
import { useOnHighlight } from './highlight'
|
|
16
|
+
import { useOnHighlight } from './highlight.js'
|
|
17
17
|
import { Component } from '@contember/interface'
|
|
18
|
-
import { Button } from '
|
|
18
|
+
import { Button } from '~/lib'
|
|
19
19
|
import { ArrowBigDownDash } from 'lucide-react'
|
|
20
|
-
import { SelectDefaultFilter } from './filter'
|
|
21
|
-
import { SelectListItemUI } from './ui'
|
|
20
|
+
import { SelectDefaultFilter } from './filter.js'
|
|
21
|
+
import { SelectListItemUI } from './ui.js'
|
|
22
22
|
import { SelectDataView, SelectItemTrigger, SelectOption } from '@contember/react-select'
|
|
23
23
|
|
|
24
|
+
/**
|
|
25
|
+
* Props for {@link DefaultSelectDataView}.
|
|
26
|
+
*/
|
|
24
27
|
export interface DefaultSelectDataViewProps {
|
|
28
|
+
/**
|
|
29
|
+
* Optional field used for querying the data view.
|
|
30
|
+
*/
|
|
25
31
|
queryField?: DataViewUnionFilterFields
|
|
32
|
+
/**
|
|
33
|
+
* Optional initial sorting direction for the data view.
|
|
34
|
+
*/
|
|
26
35
|
initialSorting?: DataViewSortingDirections
|
|
36
|
+
/**
|
|
37
|
+
* Children elements to be rendered inside the default data view renderer.
|
|
38
|
+
*/
|
|
27
39
|
children: ReactNode
|
|
28
40
|
}
|
|
29
41
|
|
|
42
|
+
/**
|
|
43
|
+
* `DefaultSelectDataView` provides a wrapper around `SelectDataView` with a default renderer. It simplifies setting up a data view selection with initial sorting and query field options.
|
|
44
|
+
*
|
|
45
|
+
* Must be used inside a context where `SelectDataView` is valid.
|
|
46
|
+
*
|
|
47
|
+
* ## Example: Basic usage
|
|
48
|
+
* ```tsx
|
|
49
|
+
* <DefaultSelectDataView queryField="status" initialSorting="asc">
|
|
50
|
+
* <ItemRenderer />
|
|
51
|
+
* </DefaultSelectDataView>
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
30
54
|
export const DefaultSelectDataView = Component<DefaultSelectDataViewProps>(({ children, initialSorting, queryField }) => {
|
|
31
55
|
return (
|
|
32
56
|
<>
|
|
@@ -5,9 +5,9 @@ import { MultiSelect, SelectEachValue, SelectItemTrigger, SelectPlaceholder } fr
|
|
|
5
5
|
import { ChevronDownIcon } from 'lucide-react'
|
|
6
6
|
import * as React from 'react'
|
|
7
7
|
import { ReactNode } from 'react'
|
|
8
|
-
import { Popover, PopoverTrigger } from '
|
|
9
|
-
import { CreateEntityDialog } from './create-new'
|
|
10
|
-
import { DefaultSelectDataView } from './list'
|
|
8
|
+
import { Popover, PopoverTrigger } from '~/lib'
|
|
9
|
+
import { CreateEntityDialog } from './create-new.js'
|
|
10
|
+
import { DefaultSelectDataView } from './list.js'
|
|
11
11
|
import {
|
|
12
12
|
MultiSelectItemContentUI,
|
|
13
13
|
MultiSelectItemRemoveButtonUI,
|
|
@@ -19,18 +19,55 @@ import {
|
|
|
19
19
|
SelectInputUI,
|
|
20
20
|
SelectInputWrapperUI,
|
|
21
21
|
SelectPopoverContent,
|
|
22
|
-
} from './ui'
|
|
22
|
+
} from './ui.js'
|
|
23
23
|
|
|
24
24
|
export type MultiSelectInputProps = {
|
|
25
|
+
/** Specifies the field to bind the selection to. */
|
|
25
26
|
field: SugaredRelativeEntityList['field']
|
|
27
|
+
/** An array of entities to populate the selection list. */
|
|
26
28
|
options?: SugaredQualifiedEntityList['entities']
|
|
29
|
+
/** React nodes for rendering the content of each selected item. */
|
|
27
30
|
children: ReactNode
|
|
31
|
+
/** Custom placeholder text when no items are selected. */
|
|
28
32
|
placeholder?: ReactNode
|
|
33
|
+
/** Content for creating a new entity. */
|
|
29
34
|
createNewForm?: ReactNode
|
|
35
|
+
/** Field used for querying and filtering options. */
|
|
30
36
|
queryField?: DataViewUnionFilterFields
|
|
37
|
+
/** Defines the initial sorting order for the options. */
|
|
31
38
|
initialSorting?: DataViewSortingDirections
|
|
32
39
|
}
|
|
33
40
|
|
|
41
|
+
/**
|
|
42
|
+
* MultiSelectInput is a component for selecting multiple values from a list of options,
|
|
43
|
+
* with support for inline entity creation, filtering, and sorting.
|
|
44
|
+
*
|
|
45
|
+
* ## Example: Basic usage with inline entity creation
|
|
46
|
+
* ```tsx
|
|
47
|
+
* <MultiSelectInput
|
|
48
|
+
* field="tags"
|
|
49
|
+
* placeholder="Select tags"
|
|
50
|
+
* createNewForm={<div>Form to create a new tag</div>}
|
|
51
|
+
* initialSorting="ASC"
|
|
52
|
+
* >
|
|
53
|
+
* <Field field="name" />
|
|
54
|
+
* </MultiSelectInput>
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* ## Sub-components
|
|
58
|
+
* - {@link SelectInputWrapperUI}
|
|
59
|
+
* - {@link SelectInputUI}
|
|
60
|
+
* - {@link SelectDefaultPlaceholderUI}
|
|
61
|
+
* - {@link MultiSelectItemWrapperUI}
|
|
62
|
+
* - {@link MultiSelectItemUI}
|
|
63
|
+
* - {@link MultiSelectItemContentUI}
|
|
64
|
+
* - {@link SelectItemTrigger}
|
|
65
|
+
* - {@link MultiSelectItemRemoveButtonUI}
|
|
66
|
+
* - {@link SelectInputActionsUI}
|
|
67
|
+
* - {@link SelectPopoverContent}
|
|
68
|
+
* - {@link Popover}
|
|
69
|
+
* - {@link PopoverTrigger}
|
|
70
|
+
*/
|
|
34
71
|
export const MultiSelectInput = Component<MultiSelectInputProps>(
|
|
35
72
|
({ field, queryField, options, children, placeholder, createNewForm, initialSorting }) => {
|
|
36
73
|
const id = useFormFieldId()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { ReactNode, useCallback } from 'react'
|
|
3
|
-
import { Popover, PopoverTrigger } from '
|
|
3
|
+
import { Popover, PopoverTrigger } from '~/lib'
|
|
4
4
|
import {
|
|
5
5
|
Component,
|
|
6
6
|
RecursionTerminatorPortal,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
useEntity,
|
|
10
10
|
useEntityBeforePersist,
|
|
11
11
|
} from '@contember/interface'
|
|
12
|
-
import { Button } from '
|
|
12
|
+
import { Button } from '~/lib'
|
|
13
13
|
import { ChevronDownIcon, XIcon } from 'lucide-react'
|
|
14
14
|
import {
|
|
15
15
|
SelectCreateNewTrigger,
|
|
@@ -18,25 +18,63 @@ import {
|
|
|
18
18
|
SelectInputUI,
|
|
19
19
|
SelectInputWrapperUI,
|
|
20
20
|
SelectPopoverContent,
|
|
21
|
-
} from './ui'
|
|
22
|
-
import { DefaultSelectDataView } from './list'
|
|
21
|
+
} from './ui.js'
|
|
22
|
+
import { DefaultSelectDataView } from './list.js'
|
|
23
23
|
import { Select, SelectEachValue, SelectItemTrigger, SelectPlaceholder } from '@contember/react-select'
|
|
24
|
-
import { CreateEntityDialog } from './create-new'
|
|
24
|
+
import { CreateEntityDialog } from './create-new.js'
|
|
25
25
|
import { DataViewSortingDirections, DataViewUnionFilterFields } from '@contember/react-dataview'
|
|
26
26
|
import { useFormFieldId } from '@contember/react-form'
|
|
27
|
-
import { dict } from '
|
|
27
|
+
import { dict } from '~/lib'
|
|
28
28
|
|
|
29
29
|
export type SelectInputProps = {
|
|
30
|
+
/** The field to bind the selection to (`SugaredRelativeSingleEntity['field']`) */
|
|
30
31
|
field: SugaredRelativeSingleEntity['field']
|
|
32
|
+
/** React nodes for rendering each value or additional content inside the selection UI. */
|
|
31
33
|
children: ReactNode
|
|
34
|
+
/** Defines the entity options to be displayed. */
|
|
32
35
|
options?: SugaredQualifiedEntityList['entities']
|
|
36
|
+
/** Custom placeholder content when no value is selected. */
|
|
33
37
|
placeholder?: ReactNode
|
|
38
|
+
/** Content for creating a new entity, displayed within a `CreateEntityDialog`. */
|
|
34
39
|
createNewForm?: ReactNode
|
|
40
|
+
/** Specifies the field to query for filtering or sorting. */
|
|
35
41
|
queryField?: DataViewUnionFilterFields
|
|
42
|
+
/** Defines the initial sorting order of the options. */
|
|
36
43
|
initialSorting?: DataViewSortingDirections
|
|
44
|
+
/** Boolean flag to enforce validation for the selection input. */
|
|
37
45
|
required?: boolean
|
|
38
46
|
}
|
|
39
47
|
|
|
48
|
+
/**
|
|
49
|
+
* `SelectInput` is a versatile component for rendering a selectable input field with advanced functionality.
|
|
50
|
+
* It supports optional entity creation, validation, and sorting within the context of Contember's interface.
|
|
51
|
+
*
|
|
52
|
+
* ## Example: Basic usage with entity creation
|
|
53
|
+
* ```tsx
|
|
54
|
+
* <SelectInput
|
|
55
|
+
* field="category"
|
|
56
|
+
* placeholder="Select a category"
|
|
57
|
+
* createNewForm={<div>Form for creating a new category</div>}
|
|
58
|
+
* required
|
|
59
|
+
* >
|
|
60
|
+
* <Field field="label" />
|
|
61
|
+
* </SelectInput>
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* ## Sub-components
|
|
65
|
+
* - {@link SelectInputWrapperUI}
|
|
66
|
+
* - {@link SelectInputUI}
|
|
67
|
+
* - {@link SelectDefaultPlaceholderUI}
|
|
68
|
+
* - {@link SelectPlaceholder}
|
|
69
|
+
* - {@link SelectInputActionsUI}
|
|
70
|
+
* - {@link SelectListItemUI}
|
|
71
|
+
* - {@link SelectEachValue}
|
|
72
|
+
* - {@link SelectItemTrigger}
|
|
73
|
+
* - {@link SelectPopoverContent}
|
|
74
|
+
* - {@link DefaultSelectDataView}
|
|
75
|
+
* - {@link Popover}
|
|
76
|
+
* - {@link PopoverTrigger}
|
|
77
|
+
*/
|
|
40
78
|
export const SelectInput = Component<SelectInputProps>(
|
|
41
79
|
({ field, queryField, options, children, placeholder, createNewForm, initialSorting, required }) => {
|
|
42
80
|
const [open, setOpen] = React.useState(false)
|
|
@@ -19,11 +19,11 @@ import {
|
|
|
19
19
|
import { SelectItemTrigger, SelectPlaceholder, SortableMultiSelect } from '@contember/react-select'
|
|
20
20
|
import { ChevronDownIcon } from 'lucide-react'
|
|
21
21
|
import { ReactNode } from 'react'
|
|
22
|
-
import { Popover, PopoverTrigger } from '
|
|
23
|
-
import { DropIndicator } from '
|
|
24
|
-
import { cn } from '
|
|
25
|
-
import { CreateEntityDialog } from './create-new'
|
|
26
|
-
import { DefaultSelectDataView } from './list'
|
|
22
|
+
import { Popover, PopoverTrigger } from '~/lib'
|
|
23
|
+
import { DropIndicator } from '~/lib'
|
|
24
|
+
import { cn } from '~/lib'
|
|
25
|
+
import { CreateEntityDialog } from './create-new.js'
|
|
26
|
+
import { DefaultSelectDataView } from './list.js'
|
|
27
27
|
import {
|
|
28
28
|
MultiSelectItemDragOverlayUI,
|
|
29
29
|
MultiSelectItemRemoveButtonUI,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
SelectInputUI,
|
|
37
37
|
SelectInputWrapperUI,
|
|
38
38
|
SelectPopoverContent,
|
|
39
|
-
} from './ui'
|
|
39
|
+
} from './ui.js'
|
|
40
40
|
|
|
41
41
|
const MultiSortableSelectDropIndicator = ({ position }: { position: 'before' | 'after' }) => (
|
|
42
42
|
<div className={cn('relative', position === 'before' ? '-translate-x-0.5' : 'translate-x-1.5')}>
|
|
@@ -48,7 +48,9 @@ const MultiSortableSelectDropIndicator = ({ position }: { position: 'before' | '
|
|
|
48
48
|
|
|
49
49
|
export type SortableMultiSelectInputProps = {
|
|
50
50
|
field: SugaredRelativeEntityList['field']
|
|
51
|
+
/** Field name used to store sort order */
|
|
51
52
|
sortableBy: SugaredRelativeSingleField['field']
|
|
53
|
+
/** Field name used to connect the selected entity */
|
|
52
54
|
connectAt: SugaredRelativeSingleEntity['field']
|
|
53
55
|
children: ReactNode
|
|
54
56
|
options?: SugaredQualifiedEntityList['entities']
|
|
@@ -58,6 +60,13 @@ export type SortableMultiSelectInputProps = {
|
|
|
58
60
|
initialSorting?: DataViewSortingDirections
|
|
59
61
|
}
|
|
60
62
|
|
|
63
|
+
/**
|
|
64
|
+
* `SortableMultiSelectInput` is the UI for the sortable multi select input.
|
|
65
|
+
*
|
|
66
|
+
* See more {@link MultiSelectInput}
|
|
67
|
+
*
|
|
68
|
+
* @group SortableMultiSelectField
|
|
69
|
+
*/
|
|
61
70
|
export const SortableMultiSelectInput = Component<SortableMultiSelectInputProps>(
|
|
62
71
|
({ field, queryField, options, children, sortableBy, connectAt, placeholder, createNewForm, initialSorting }) => {
|
|
63
72
|
const id = useFormFieldId()
|
|
@@ -1,15 +1,29 @@
|
|
|
1
|
-
import { uic } from '
|
|
2
|
-
import { Button } from '
|
|
1
|
+
import { uic } from '~/lib'
|
|
2
|
+
import { Button } from '~/lib'
|
|
3
3
|
import * as React from 'react'
|
|
4
4
|
import { forwardRef } from 'react'
|
|
5
5
|
import { CheckIcon, PlusIcon, XIcon } from 'lucide-react'
|
|
6
|
-
import { PopoverContent } from '
|
|
7
|
-
import { dict } from '
|
|
6
|
+
import { PopoverContent } from '~/lib'
|
|
7
|
+
import { dict } from '~/lib'
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* `SelectInputWrapperUI` is the UI input wrapper for the select component.
|
|
11
|
+
*
|
|
12
|
+
* See more {@link SelectInput}
|
|
13
|
+
*
|
|
14
|
+
* @group SelectInput
|
|
15
|
+
*/
|
|
9
16
|
export const SelectInputWrapperUI = uic('div', {
|
|
10
17
|
baseClass: 'w-full max-w-md relative',
|
|
11
18
|
})
|
|
12
19
|
|
|
20
|
+
/**
|
|
21
|
+
* `SelectInputUI` is the UI input wrapper for the select component.
|
|
22
|
+
*
|
|
23
|
+
* See more {@link SelectInput}
|
|
24
|
+
*
|
|
25
|
+
* @group SelectInput
|
|
26
|
+
*/
|
|
13
27
|
export const SelectInputUI = uic('button', {
|
|
14
28
|
baseClass: [
|
|
15
29
|
'flex gap-2 justify-between items-center',
|
|
@@ -25,10 +39,25 @@ export const SelectInputUI = uic('button', {
|
|
|
25
39
|
'disabled:cursor-not-allowed disabled:opacity-50',
|
|
26
40
|
],
|
|
27
41
|
})
|
|
42
|
+
/**
|
|
43
|
+
* `SelectInputActionsUI` is the UI for the select action.
|
|
44
|
+
*
|
|
45
|
+
* See more {@link SelectInput}
|
|
46
|
+
*
|
|
47
|
+
* @group SelectInput
|
|
48
|
+
* @group MultiSelectInput
|
|
49
|
+
*/
|
|
28
50
|
export const SelectInputActionsUI = uic('span', {
|
|
29
51
|
baseClass: 'flex gap-1 items-center',
|
|
30
52
|
})
|
|
31
53
|
|
|
54
|
+
/**
|
|
55
|
+
* `SelectListItemUI` is the UI for the select items list.
|
|
56
|
+
*
|
|
57
|
+
* See more {@link SelectInput}
|
|
58
|
+
*
|
|
59
|
+
* @group SelectInput
|
|
60
|
+
*/
|
|
32
61
|
export const SelectListItemUI = uic(Button, {
|
|
33
62
|
baseClass: 'w-full text-left justify-start gap-1 data-[highlighted]:bg-gray-200 data-[selected]:bg-gray-100 group relative min-h-8 h-auto',
|
|
34
63
|
defaultProps: {
|
|
@@ -38,23 +67,76 @@ export const SelectListItemUI = uic(Button, {
|
|
|
38
67
|
afterChildren: <CheckIcon className="h-3 w-3 opacity-0 group-data-[selected]:opacity-100 ml-auto" />,
|
|
39
68
|
})
|
|
40
69
|
|
|
70
|
+
/**
|
|
71
|
+
* `SelectDefaultPlaceholderUI` is the UI for the select default placeholder.
|
|
72
|
+
*
|
|
73
|
+
* See more {@link SelectInput}
|
|
74
|
+
*
|
|
75
|
+
* @group SelectInput
|
|
76
|
+
* @group MultiSelectInput
|
|
77
|
+
*/
|
|
41
78
|
export const SelectDefaultPlaceholderUI = () => <span className={'text-gray-400'}>{dict.select.placeholder}</span>
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* `MultiSelectItemWrapperUI` is the UI for the multi-select item wrapper.
|
|
82
|
+
*
|
|
83
|
+
* See more {@link MultiSelectInput}
|
|
84
|
+
*
|
|
85
|
+
* @group MultiSelectInput
|
|
86
|
+
*/
|
|
42
87
|
export const MultiSelectItemWrapperUI = uic('div', {
|
|
43
88
|
baseClass: 'flex flex-wrap gap-1 items-center justify-start',
|
|
44
89
|
})
|
|
90
|
+
/**
|
|
91
|
+
* `MultiSelectItemUI` is the UI for the multi-select item.
|
|
92
|
+
*
|
|
93
|
+
* See more {@link MultiSelectInput}
|
|
94
|
+
*
|
|
95
|
+
* @group MultiSelectInput
|
|
96
|
+
*/
|
|
45
97
|
export const MultiSelectItemUI = uic('span', {
|
|
46
98
|
baseClass: 'flex items-stretch border border-gray-200 rounded-sm hover:shadow-sm transition-all',
|
|
47
99
|
})
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* `MultiSelectItemContentUI` is the UI for the multi-select item content.
|
|
103
|
+
*
|
|
104
|
+
* See more {@link MultiSelectInput}
|
|
105
|
+
*
|
|
106
|
+
* @group MultiSelectInput
|
|
107
|
+
*/
|
|
48
108
|
export const MultiSelectItemContentUI = uic('span', {
|
|
49
109
|
baseClass: 'rounded-l px-2 py-1 bg-background ',
|
|
50
110
|
})
|
|
111
|
+
/**
|
|
112
|
+
* `MultiSelectSortableItemContentUI` is the UI for the multi-select sortable item content.
|
|
113
|
+
*
|
|
114
|
+
* See more {@link MultiSelectInput}
|
|
115
|
+
*
|
|
116
|
+
* @group MultiSelectInput
|
|
117
|
+
*/
|
|
51
118
|
export const MultiSelectSortableItemContentUI = uic('span', {
|
|
52
119
|
baseClass: 'rounded-l px-2 py-1 bg-background hover:bg-gray-50 cursor-move transition-all',
|
|
53
120
|
})
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* `MultiSelectItemDragOverlayUI` is the UI for the multi-select item drag overlay.
|
|
124
|
+
*
|
|
125
|
+
* See more {@link MultiSelectInput}
|
|
126
|
+
*
|
|
127
|
+
* @group MultiSelectInput
|
|
128
|
+
*/
|
|
54
129
|
export const MultiSelectItemDragOverlayUI = uic('span', {
|
|
55
130
|
baseClass: 'rounded-sm px-2 py-1 bg-gray-100/20 inline-flex gap-2 items-center backdrop-blur-sm text-sm border border-gray-200 shadow-sm',
|
|
56
131
|
})
|
|
57
132
|
|
|
133
|
+
/**
|
|
134
|
+
* `MultiSelectItemRemoveButtonUI` is the UI for the multi-select item remove button.
|
|
135
|
+
*
|
|
136
|
+
* See more {@link MultiSelectInput}
|
|
137
|
+
*
|
|
138
|
+
* @group MultiSelectInput
|
|
139
|
+
*/
|
|
58
140
|
export const MultiSelectItemRemoveButtonUI = uic('span', {
|
|
59
141
|
baseClass: 'bg-gray-100 border-l border-gray-200 py-1 px-2 rounded-r text-black inline-flex items-center justify-center hover:bg-gray-300',
|
|
60
142
|
afterChildren: <XIcon className={'w-3 h-3'} />,
|
|
@@ -70,6 +152,13 @@ export const MultiSelectItemRemoveButtonUI = uic('span', {
|
|
|
70
152
|
},
|
|
71
153
|
})
|
|
72
154
|
|
|
155
|
+
/**
|
|
156
|
+
* `SelectPopoverContent` is the UI for the select popover content.
|
|
157
|
+
*
|
|
158
|
+
* See more {@link SelectInput}
|
|
159
|
+
*
|
|
160
|
+
* @group SelectInput
|
|
161
|
+
*/
|
|
73
162
|
export const SelectPopoverContent = uic(PopoverContent, {
|
|
74
163
|
baseClass: 'group w-[max(16rem,var(--radix-popover-trigger-width))]',
|
|
75
164
|
defaultProps: {
|
|
@@ -77,6 +166,13 @@ export const SelectPopoverContent = uic(PopoverContent, {
|
|
|
77
166
|
},
|
|
78
167
|
})
|
|
79
168
|
|
|
169
|
+
/**
|
|
170
|
+
* `SelectCreateNewTrigger` is the UI for the select create new trigger.
|
|
171
|
+
*
|
|
172
|
+
* See more {@link SelectInput}
|
|
173
|
+
*
|
|
174
|
+
* @group SelectInput
|
|
175
|
+
*/
|
|
80
176
|
export const SelectCreateNewTrigger = forwardRef<HTMLButtonElement, {}>((props, ref) => (
|
|
81
177
|
<Button variant="outline" size="icon" ref={ref} {...props}>
|
|
82
178
|
<PlusIcon className="w-3 h-3" />
|