@mgamadeus/ddd-admin-ui 0.1.0-rc.1 → 0.1.0-rc.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/.claude/skills/ddd-admin-ui-specialist/SKILL.md +148 -18
- package/CHANGELOG.md +17 -0
- package/README.md +196 -88
- package/STANDARDS.md +385 -0
- package/dist/components.css +167 -22
- package/dist/form/DrawerFooter.d.ts +18 -0
- package/dist/form/DrawerFooter.d.ts.map +1 -0
- package/dist/form/DrawerFooter.js +47 -0
- package/dist/form/DrawerFooter.js.map +1 -0
- package/dist/form/Form.d.ts +25 -10
- package/dist/form/Form.d.ts.map +1 -1
- package/dist/form/Form.js +17 -8
- package/dist/form/Form.js.map +1 -1
- package/dist/form/FormActions.d.ts +35 -0
- package/dist/form/FormActions.d.ts.map +1 -0
- package/dist/form/FormActions.js +80 -0
- package/dist/form/FormActions.js.map +1 -0
- package/dist/form/FormDrawer.d.ts +36 -0
- package/dist/form/FormDrawer.d.ts.map +1 -0
- package/dist/form/FormDrawer.js +31 -0
- package/dist/form/FormDrawer.js.map +1 -0
- package/dist/form/FormErrors.d.ts +22 -0
- package/dist/form/FormErrors.d.ts.map +1 -0
- package/dist/form/FormErrors.js +46 -0
- package/dist/form/FormErrors.js.map +1 -0
- package/dist/form/FormField.d.ts +74 -0
- package/dist/form/FormField.d.ts.map +1 -0
- package/dist/form/FormField.js +46 -0
- package/dist/form/FormField.js.map +1 -0
- package/dist/form/FormHeader.d.ts +20 -0
- package/dist/form/FormHeader.d.ts.map +1 -0
- package/dist/form/FormHeader.js +9 -0
- package/dist/form/FormHeader.js.map +1 -0
- package/dist/form/FormJumpBar.d.ts +20 -0
- package/dist/form/FormJumpBar.d.ts.map +1 -0
- package/dist/form/FormJumpBar.js +49 -0
- package/dist/form/FormJumpBar.js.map +1 -0
- package/dist/form/FormSubmitButton.d.ts +17 -0
- package/dist/form/FormSubmitButton.d.ts.map +1 -0
- package/dist/form/FormSubmitButton.js +14 -0
- package/dist/form/FormSubmitButton.js.map +1 -0
- package/dist/form/FormWrapper.d.ts +13 -0
- package/dist/form/FormWrapper.d.ts.map +1 -0
- package/dist/form/FormWrapper.js +15 -0
- package/dist/form/FormWrapper.js.map +1 -0
- package/dist/form/drawerSlots.d.ts +10 -0
- package/dist/form/drawerSlots.d.ts.map +1 -0
- package/dist/form/drawerSlots.js +7 -0
- package/dist/form/drawerSlots.js.map +1 -0
- package/dist/form/fieldLabels.d.ts +15 -8
- package/dist/form/fieldLabels.d.ts.map +1 -1
- package/dist/form/fieldLabels.js +18 -6
- package/dist/form/fieldLabels.js.map +1 -1
- package/dist/form/formPanelClasses.d.ts +3 -0
- package/dist/form/formPanelClasses.d.ts.map +1 -0
- package/dist/form/formPanelClasses.js +3 -0
- package/dist/form/formPanelClasses.js.map +1 -0
- package/dist/form/index.d.ts +57 -2
- package/dist/form/index.d.ts.map +1 -1
- package/dist/form/index.js +33 -2
- package/dist/form/index.js.map +1 -1
- package/dist/form/useConfirmDialog.d.ts +9 -0
- package/dist/form/useConfirmDialog.d.ts.map +1 -0
- package/dist/form/useConfirmDialog.js +29 -0
- package/dist/form/useConfirmDialog.js.map +1 -0
- package/dist/glass/ActionRow.d.ts +27 -0
- package/dist/glass/ActionRow.d.ts.map +1 -0
- package/dist/glass/ActionRow.js +22 -0
- package/dist/glass/ActionRow.js.map +1 -0
- package/dist/glass/CollapsibleCard.d.ts +36 -0
- package/dist/glass/CollapsibleCard.d.ts.map +1 -0
- package/dist/glass/CollapsibleCard.js +27 -0
- package/dist/glass/CollapsibleCard.js.map +1 -0
- package/dist/glass/GlassGroup.d.ts +26 -0
- package/dist/glass/GlassGroup.d.ts.map +1 -0
- package/dist/glass/GlassGroup.js +34 -0
- package/dist/glass/GlassGroup.js.map +1 -0
- package/dist/glass/GlassPill.d.ts +23 -0
- package/dist/glass/GlassPill.d.ts.map +1 -0
- package/dist/glass/GlassPill.js +20 -0
- package/dist/glass/GlassPill.js.map +1 -0
- package/dist/glass/QuickFilterPills.d.ts +38 -0
- package/dist/glass/QuickFilterPills.d.ts.map +1 -0
- package/dist/glass/QuickFilterPills.js +30 -0
- package/dist/glass/QuickFilterPills.js.map +1 -0
- package/dist/glass/index.d.ts +10 -1
- package/dist/glass/index.d.ts.map +1 -1
- package/dist/glass/index.js +6 -1
- package/dist/glass/index.js.map +1 -1
- package/dist/i18n/Translate.d.ts +5 -4
- package/dist/i18n/Translate.d.ts.map +1 -1
- package/dist/i18n/Translate.js +3 -3
- package/dist/i18n/Translate.js.map +1 -1
- package/dist/i18n/format.d.ts +13 -0
- package/dist/i18n/format.d.ts.map +1 -0
- package/dist/i18n/format.js +15 -0
- package/dist/i18n/format.js.map +1 -0
- package/dist/i18n/hints.json +130 -0
- package/dist/i18n/index.d.ts +5 -3
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +5 -3
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/localeFormat.d.ts +10 -0
- package/dist/i18n/localeFormat.d.ts.map +1 -0
- package/dist/i18n/localeFormat.js +36 -0
- package/dist/i18n/localeFormat.js.map +1 -0
- package/dist/i18n/plural.d.ts +15 -0
- package/dist/i18n/plural.d.ts.map +1 -0
- package/dist/i18n/plural.js +95 -0
- package/dist/i18n/plural.js.map +1 -0
- package/dist/i18n/serverMessages.d.ts +26 -0
- package/dist/i18n/serverMessages.d.ts.map +1 -0
- package/dist/i18n/serverMessages.js +146 -0
- package/dist/i18n/serverMessages.js.map +1 -0
- package/dist/i18n/store.d.ts +28 -16
- package/dist/i18n/store.d.ts.map +1 -1
- package/dist/i18n/store.js +26 -20
- package/dist/i18n/store.js.map +1 -1
- package/dist/i18n/useTranslate.d.ts +15 -7
- package/dist/i18n/useTranslate.d.ts.map +1 -1
- package/dist/i18n/useTranslate.js +17 -7
- package/dist/i18n/useTranslate.js.map +1 -1
- package/dist/i18n-keys.json +1050 -13
- package/dist/list/ChipToggleGroup.d.ts +36 -0
- package/dist/list/ChipToggleGroup.d.ts.map +1 -0
- package/dist/list/ChipToggleGroup.js +34 -0
- package/dist/list/ChipToggleGroup.js.map +1 -0
- package/dist/list/Combobox.d.ts +32 -0
- package/dist/list/Combobox.d.ts.map +1 -0
- package/dist/list/Combobox.js +27 -0
- package/dist/list/Combobox.js.map +1 -0
- package/dist/list/EmptyValue.d.ts +14 -0
- package/dist/list/EmptyValue.d.ts.map +1 -0
- package/dist/list/EmptyValue.js +11 -0
- package/dist/list/EmptyValue.js.map +1 -0
- package/dist/list/EntityListBody.d.ts +27 -0
- package/dist/list/EntityListBody.d.ts.map +1 -0
- package/dist/list/EntityListBody.js +24 -0
- package/dist/list/EntityListBody.js.map +1 -0
- package/dist/list/EntityListBulkBar.d.ts +38 -0
- package/dist/list/EntityListBulkBar.d.ts.map +1 -0
- package/dist/list/EntityListBulkBar.js +19 -0
- package/dist/list/EntityListBulkBar.js.map +1 -0
- package/dist/list/EntityListCard.d.ts +22 -0
- package/dist/list/EntityListCard.d.ts.map +1 -0
- package/dist/list/EntityListCard.js +15 -0
- package/dist/list/EntityListCard.js.map +1 -0
- package/dist/list/EntityListEmpty.d.ts +13 -0
- package/dist/list/EntityListEmpty.d.ts.map +1 -0
- package/dist/list/EntityListEmpty.js +11 -0
- package/dist/list/EntityListEmpty.js.map +1 -0
- package/dist/list/EntityListGrid.d.ts +29 -0
- package/dist/list/EntityListGrid.d.ts.map +1 -0
- package/dist/list/EntityListGrid.js +21 -0
- package/dist/list/EntityListGrid.js.map +1 -0
- package/dist/list/EntityListLoadMore.d.ts +15 -0
- package/dist/list/EntityListLoadMore.d.ts.map +1 -0
- package/dist/list/EntityListLoadMore.js +27 -0
- package/dist/list/EntityListLoadMore.js.map +1 -0
- package/dist/list/EntityListStatus.d.ts +11 -0
- package/dist/list/EntityListStatus.d.ts.map +1 -0
- package/dist/list/EntityListStatus.js +22 -0
- package/dist/list/EntityListStatus.js.map +1 -0
- package/dist/list/EntityListTable.d.ts +34 -0
- package/dist/list/EntityListTable.d.ts.map +1 -0
- package/dist/list/EntityListTable.js +43 -0
- package/dist/list/EntityListTable.js.map +1 -0
- package/dist/list/EntityListToolbar.d.ts +39 -0
- package/dist/list/EntityListToolbar.d.ts.map +1 -0
- package/dist/list/EntityListToolbar.js +25 -0
- package/dist/list/EntityListToolbar.js.map +1 -0
- package/dist/list/EntityListViewToggle.d.ts +17 -0
- package/dist/list/EntityListViewToggle.d.ts.map +1 -0
- package/dist/list/EntityListViewToggle.js +38 -0
- package/dist/list/EntityListViewToggle.js.map +1 -0
- package/dist/list/MultiSelect.d.ts +33 -0
- package/dist/list/MultiSelect.d.ts.map +1 -0
- package/dist/list/MultiSelect.js +60 -0
- package/dist/list/MultiSelect.js.map +1 -0
- package/dist/list/SearchField.d.ts +24 -0
- package/dist/list/SearchField.d.ts.map +1 -0
- package/dist/list/SearchField.js +42 -0
- package/dist/list/SearchField.js.map +1 -0
- package/dist/list/StatusBadge.d.ts +34 -0
- package/dist/list/StatusBadge.d.ts.map +1 -0
- package/dist/list/StatusBadge.js +44 -0
- package/dist/list/StatusBadge.js.map +1 -0
- package/dist/list/Tag.d.ts +16 -0
- package/dist/list/Tag.d.ts.map +1 -0
- package/dist/list/Tag.js +15 -0
- package/dist/list/Tag.js.map +1 -0
- package/dist/list/cells.d.ts +53 -0
- package/dist/list/cells.d.ts.map +1 -0
- package/dist/list/cells.js +62 -0
- package/dist/list/cells.js.map +1 -0
- package/dist/list/filterClasses.d.ts +8 -0
- package/dist/list/filterClasses.d.ts.map +1 -0
- package/dist/list/filterClasses.js +8 -0
- package/dist/list/filterClasses.js.map +1 -0
- package/dist/list/filterOptions.d.ts +7 -0
- package/dist/list/filterOptions.d.ts.map +1 -0
- package/dist/list/filterOptions.js +7 -0
- package/dist/list/filterOptions.js.map +1 -0
- package/dist/list/filters.d.ts +78 -0
- package/dist/list/filters.d.ts.map +1 -0
- package/dist/list/filters.js +54 -0
- package/dist/list/filters.js.map +1 -0
- package/dist/list/index.d.ts +88 -2
- package/dist/list/index.d.ts.map +1 -1
- package/dist/list/index.js +50 -2
- package/dist/list/index.js.map +1 -1
- package/dist/list/types.d.ts +59 -0
- package/dist/list/types.d.ts.map +1 -0
- package/dist/list/types.js +3 -0
- package/dist/list/types.js.map +1 -0
- package/dist/logic/browser/prepareImageFile.d.ts +18 -0
- package/dist/logic/browser/prepareImageFile.d.ts.map +1 -0
- package/dist/logic/browser/prepareImageFile.js +26 -0
- package/dist/logic/browser/prepareImageFile.js.map +1 -0
- package/dist/logic/index.d.ts +56 -5
- package/dist/logic/index.d.ts.map +1 -1
- package/dist/logic/index.js +37 -4
- package/dist/logic/index.js.map +1 -1
- package/dist/logic/pure/conditions.d.ts +46 -0
- package/dist/logic/pure/conditions.d.ts.map +1 -0
- package/dist/logic/pure/conditions.js +39 -0
- package/dist/logic/pure/conditions.js.map +1 -0
- package/dist/logic/pure/confirm.d.ts +19 -0
- package/dist/logic/pure/confirm.d.ts.map +1 -0
- package/dist/logic/pure/confirm.js +10 -0
- package/dist/logic/pure/confirm.js.map +1 -0
- package/dist/logic/pure/displayMode.d.ts +12 -0
- package/dist/logic/pure/displayMode.d.ts.map +1 -0
- package/dist/logic/pure/displayMode.js +11 -0
- package/dist/logic/pure/displayMode.js.map +1 -0
- package/dist/logic/pure/entityDrawer.d.ts +24 -0
- package/dist/logic/pure/entityDrawer.d.ts.map +1 -0
- package/dist/logic/pure/entityDrawer.js +3 -0
- package/dist/logic/pure/entityDrawer.js.map +1 -0
- package/dist/logic/pure/fieldPath.d.ts +9 -0
- package/dist/logic/pure/fieldPath.d.ts.map +1 -0
- package/dist/logic/pure/fieldPath.js +17 -0
- package/dist/logic/pure/fieldPath.js.map +1 -0
- package/dist/logic/pure/formValues.d.ts +14 -0
- package/dist/logic/pure/formValues.d.ts.map +1 -0
- package/dist/logic/pure/formValues.js +82 -0
- package/dist/logic/pure/formValues.js.map +1 -0
- package/dist/logic/pure/format.d.ts +14 -14
- package/dist/logic/pure/format.d.ts.map +1 -1
- package/dist/logic/pure/format.js +50 -29
- package/dist/logic/pure/format.js.map +1 -1
- package/dist/logic/pure/locales.d.ts +27 -0
- package/dist/logic/pure/locales.d.ts.map +1 -0
- package/dist/logic/pure/locales.js +50 -0
- package/dist/logic/pure/locales.js.map +1 -0
- package/dist/logic/pure/notify.d.ts +28 -5
- package/dist/logic/pure/notify.d.ts.map +1 -1
- package/dist/logic/pure/notify.js +41 -22
- package/dist/logic/pure/notify.js.map +1 -1
- package/dist/logic/pure/rowActivation.d.ts +6 -0
- package/dist/logic/pure/rowActivation.d.ts.map +1 -0
- package/dist/logic/pure/rowActivation.js +7 -0
- package/dist/logic/pure/rowActivation.js.map +1 -0
- package/dist/logic/pure/runSequential.d.ts +31 -0
- package/dist/logic/pure/runSequential.d.ts.map +1 -0
- package/dist/logic/pure/runSequential.js +47 -0
- package/dist/logic/pure/runSequential.js.map +1 -0
- package/dist/logic/pure/schemas.d.ts +14 -0
- package/dist/logic/pure/schemas.d.ts.map +1 -0
- package/dist/logic/pure/schemas.js +6 -0
- package/dist/logic/pure/schemas.js.map +1 -0
- package/dist/logic/pure/serverViolations.d.ts +35 -0
- package/dist/logic/pure/serverViolations.d.ts.map +1 -0
- package/dist/logic/pure/serverViolations.js +77 -0
- package/dist/logic/pure/serverViolations.js.map +1 -0
- package/dist/logic/pure/status.d.ts +21 -0
- package/dist/logic/pure/status.d.ts.map +1 -0
- package/dist/logic/pure/status.js +3 -0
- package/dist/logic/pure/status.js.map +1 -0
- package/dist/logic/pure/submitError.d.ts +11 -0
- package/dist/logic/pure/submitError.d.ts.map +1 -0
- package/dist/logic/pure/submitError.js +9 -0
- package/dist/logic/pure/submitError.js.map +1 -0
- package/dist/logic/pure/translationState.d.ts +29 -0
- package/dist/logic/pure/translationState.d.ts.map +1 -0
- package/dist/logic/pure/translationState.js +88 -0
- package/dist/logic/pure/translationState.js.map +1 -0
- package/dist/logic/pure/urlListState.d.ts +18 -0
- package/dist/logic/pure/urlListState.d.ts.map +1 -0
- package/dist/logic/pure/urlListState.js +3 -0
- package/dist/logic/pure/urlListState.js.map +1 -0
- package/dist/logic/react/conditionHooks.d.ts +20 -0
- package/dist/logic/react/conditionHooks.d.ts.map +1 -0
- package/dist/logic/react/conditionHooks.js +51 -0
- package/dist/logic/react/conditionHooks.js.map +1 -0
- package/dist/logic/react/useCopyToClipboard.d.ts +9 -0
- package/dist/logic/react/useCopyToClipboard.d.ts.map +1 -0
- package/dist/logic/react/useCopyToClipboard.js +28 -0
- package/dist/logic/react/useCopyToClipboard.js.map +1 -0
- package/dist/logic/react/useDebouncedValue.d.ts +3 -0
- package/dist/logic/react/useDebouncedValue.d.ts.map +1 -0
- package/dist/logic/react/useDebouncedValue.js +12 -0
- package/dist/logic/react/useDebouncedValue.js.map +1 -0
- package/dist/logic/react/useEntityDrawer.d.ts +54 -0
- package/dist/logic/react/useEntityDrawer.d.ts.map +1 -0
- package/dist/logic/react/useEntityDrawer.js +81 -0
- package/dist/logic/react/useEntityDrawer.js.map +1 -0
- package/dist/logic/react/useEntityTranslations.d.ts +57 -0
- package/dist/logic/react/useEntityTranslations.d.ts.map +1 -0
- package/dist/logic/react/useEntityTranslations.js +50 -0
- package/dist/logic/react/useEntityTranslations.js.map +1 -0
- package/dist/logic/react/useFormDirty.d.ts +15 -0
- package/dist/logic/react/useFormDirty.d.ts.map +1 -0
- package/dist/logic/react/useFormDirty.js +17 -0
- package/dist/logic/react/useFormDirty.js.map +1 -0
- package/dist/logic/react/useGrowingWindowList.d.ts +50 -0
- package/dist/logic/react/useGrowingWindowList.d.ts.map +1 -0
- package/dist/logic/react/useGrowingWindowList.js +38 -0
- package/dist/logic/react/useGrowingWindowList.js.map +1 -0
- package/dist/logic/react/useHydrated.d.ts +7 -0
- package/dist/logic/react/useHydrated.d.ts.map +1 -0
- package/dist/logic/react/useHydrated.js +12 -0
- package/dist/logic/react/useHydrated.js.map +1 -0
- package/dist/logic/react/useInfiniteScrollSentinel.d.ts +6 -0
- package/dist/logic/react/useInfiniteScrollSentinel.d.ts.map +1 -0
- package/dist/logic/react/useInfiniteScrollSentinel.js +24 -0
- package/dist/logic/react/useInfiniteScrollSentinel.js.map +1 -0
- package/dist/logic/react/useLocaleName.d.ts +3 -0
- package/dist/logic/react/useLocaleName.d.ts.map +1 -0
- package/dist/logic/react/useLocaleName.js +10 -0
- package/dist/logic/react/useLocaleName.js.map +1 -0
- package/dist/logic/react/useRowActivation.d.ts +12 -0
- package/dist/logic/react/useRowActivation.d.ts.map +1 -0
- package/dist/logic/react/useRowActivation.js +35 -0
- package/dist/logic/react/useRowActivation.js.map +1 -0
- package/dist/logic/react/useRowSelection.d.ts +40 -0
- package/dist/logic/react/useRowSelection.d.ts.map +1 -0
- package/dist/logic/react/useRowSelection.js +70 -0
- package/dist/logic/react/useRowSelection.js.map +1 -0
- package/dist/logic/react/useTranslationRunner.d.ts +27 -0
- package/dist/logic/react/useTranslationRunner.d.ts.map +1 -0
- package/dist/logic/react/useTranslationRunner.js +57 -0
- package/dist/logic/react/useTranslationRunner.js.map +1 -0
- package/dist/logic/react/useUnsavedChangesGuard.d.ts +30 -0
- package/dist/logic/react/useUnsavedChangesGuard.d.ts.map +1 -0
- package/dist/logic/react/useUnsavedChangesGuard.js +66 -0
- package/dist/logic/react/useUnsavedChangesGuard.js.map +1 -0
- package/dist/logic/react/useUrlListState.d.ts +39 -0
- package/dist/logic/react/useUrlListState.d.ts.map +1 -0
- package/dist/logic/react/useUrlListState.js +96 -0
- package/dist/logic/react/useUrlListState.js.map +1 -0
- package/dist/media/FormMediaItemField.d.ts +38 -0
- package/dist/media/FormMediaItemField.d.ts.map +1 -0
- package/dist/media/FormMediaItemField.js +35 -0
- package/dist/media/FormMediaItemField.js.map +1 -0
- package/dist/media/MediaItemField.d.ts +17 -3
- package/dist/media/MediaItemField.d.ts.map +1 -1
- package/dist/media/MediaItemField.js +11 -7
- package/dist/media/MediaItemField.js.map +1 -1
- package/dist/media/MediaItemPickerDialog.d.ts +48 -0
- package/dist/media/MediaItemPickerDialog.d.ts.map +1 -0
- package/dist/media/MediaItemPickerDialog.js +36 -0
- package/dist/media/MediaItemPickerDialog.js.map +1 -0
- package/dist/media/MediaPreview.d.ts +16 -0
- package/dist/media/MediaPreview.d.ts.map +1 -0
- package/dist/media/MediaPreview.js +20 -0
- package/dist/media/MediaPreview.js.map +1 -0
- package/dist/media/index.d.ts +17 -2
- package/dist/media/index.d.ts.map +1 -1
- package/dist/media/index.js +7 -0
- package/dist/media/index.js.map +1 -1
- package/dist/media/types.d.ts +23 -6
- package/dist/media/types.d.ts.map +1 -1
- package/dist/next/index.d.ts +7 -2
- package/dist/next/index.d.ts.map +1 -1
- package/dist/next/index.js +7 -2
- package/dist/next/index.js.map +1 -1
- package/dist/next/listViewParam.d.ts +3 -0
- package/dist/next/listViewParam.d.ts.map +1 -0
- package/dist/next/listViewParam.js +3 -0
- package/dist/next/listViewParam.js.map +1 -0
- package/dist/next/searchParamsWriter.d.ts +30 -6
- package/dist/next/searchParamsWriter.d.ts.map +1 -1
- package/dist/next/searchParamsWriter.js +80 -27
- package/dist/next/searchParamsWriter.js.map +1 -1
- package/dist/next/storage.d.ts +11 -0
- package/dist/next/storage.d.ts.map +1 -0
- package/dist/next/storage.js +34 -0
- package/dist/next/storage.js.map +1 -0
- package/dist/next/useListViewParam.d.ts +12 -0
- package/dist/next/useListViewParam.d.ts.map +1 -0
- package/dist/next/useListViewParam.js +45 -0
- package/dist/next/useListViewParam.js.map +1 -0
- package/dist/next/useNextDrawerUrlAdapter.d.ts +11 -0
- package/dist/next/useNextDrawerUrlAdapter.d.ts.map +1 -0
- package/dist/next/useNextDrawerUrlAdapter.js +28 -0
- package/dist/next/useNextDrawerUrlAdapter.js.map +1 -0
- package/dist/next/useNextUrlStateAdapter.d.ts +20 -0
- package/dist/next/useNextUrlStateAdapter.d.ts.map +1 -0
- package/dist/next/useNextUrlStateAdapter.js +28 -0
- package/dist/next/useNextUrlStateAdapter.js.map +1 -0
- package/dist/notify-sonner/Toaster.d.ts +8 -0
- package/dist/notify-sonner/Toaster.d.ts.map +1 -0
- package/dist/notify-sonner/Toaster.js +24 -0
- package/dist/notify-sonner/Toaster.js.map +1 -0
- package/dist/notify-sonner/index.d.ts +1 -0
- package/dist/notify-sonner/index.d.ts.map +1 -1
- package/dist/notify-sonner/index.js +2 -0
- package/dist/notify-sonner/index.js.map +1 -1
- package/dist/notify-sonner/sonnerNotifications.d.ts +1 -1
- package/dist/notify-sonner/sonnerNotifications.d.ts.map +1 -1
- package/dist/notify-sonner/sonnerNotifications.js +23 -6
- package/dist/notify-sonner/sonnerNotifications.js.map +1 -1
- package/dist/page/DefinitionList.d.ts +24 -0
- package/dist/page/DefinitionList.d.ts.map +1 -0
- package/dist/page/DefinitionList.js +20 -0
- package/dist/page/DefinitionList.js.map +1 -0
- package/dist/page/DetailHeader.d.ts +26 -0
- package/dist/page/DetailHeader.d.ts.map +1 -0
- package/dist/page/DetailHeader.js +14 -0
- package/dist/page/DetailHeader.js.map +1 -0
- package/dist/page/EditableCard.d.ts +39 -0
- package/dist/page/EditableCard.d.ts.map +1 -0
- package/dist/page/EditableCard.js +21 -0
- package/dist/page/EditableCard.js.map +1 -0
- package/dist/page/EntityDetailShell.d.ts +48 -0
- package/dist/page/EntityDetailShell.d.ts.map +1 -0
- package/dist/page/EntityDetailShell.js +25 -0
- package/dist/page/EntityDetailShell.js.map +1 -0
- package/dist/page/EntityListPage.d.ts +30 -0
- package/dist/page/EntityListPage.d.ts.map +1 -0
- package/dist/page/EntityListPage.js +12 -0
- package/dist/page/EntityListPage.js.map +1 -0
- package/dist/page/EntityMetadata.d.ts +21 -0
- package/dist/page/EntityMetadata.d.ts.map +1 -0
- package/dist/page/EntityMetadata.js +39 -0
- package/dist/page/EntityMetadata.js.map +1 -0
- package/dist/page/EntityTabs.d.ts +38 -0
- package/dist/page/EntityTabs.d.ts.map +1 -0
- package/dist/page/EntityTabs.js +51 -0
- package/dist/page/EntityTabs.js.map +1 -0
- package/dist/page/PageFrame.d.ts +18 -2
- package/dist/page/PageFrame.d.ts.map +1 -1
- package/dist/page/PageFrame.js +8 -2
- package/dist/page/PageFrame.js.map +1 -1
- package/dist/page/PageHeader.d.ts +27 -0
- package/dist/page/PageHeader.d.ts.map +1 -0
- package/dist/page/PageHeader.js +16 -0
- package/dist/page/PageHeader.js.map +1 -0
- package/dist/page/PageLayout.d.ts +15 -0
- package/dist/page/PageLayout.d.ts.map +1 -0
- package/dist/page/PageLayout.js +10 -0
- package/dist/page/PageLayout.js.map +1 -0
- package/dist/page/PageToolbar.d.ts +73 -0
- package/dist/page/PageToolbar.d.ts.map +1 -0
- package/dist/page/PageToolbar.js +49 -0
- package/dist/page/PageToolbar.js.map +1 -0
- package/dist/page/SectionHeader.d.ts +27 -0
- package/dist/page/SectionHeader.d.ts.map +1 -0
- package/dist/page/SectionHeader.js +14 -0
- package/dist/page/SectionHeader.js.map +1 -0
- package/dist/page/StatusCallout.d.ts +28 -0
- package/dist/page/StatusCallout.d.ts.map +1 -0
- package/dist/page/StatusCallout.js +35 -0
- package/dist/page/StatusCallout.js.map +1 -0
- package/dist/page/index.d.ts +28 -1
- package/dist/page/index.d.ts.map +1 -1
- package/dist/page/index.js +18 -0
- package/dist/page/index.js.map +1 -1
- package/dist/page/links.d.ts +18 -0
- package/dist/page/links.d.ts.map +1 -0
- package/dist/page/links.js +4 -0
- package/dist/page/links.js.map +1 -0
- package/dist/primitives/alert.d.ts +17 -0
- package/dist/primitives/alert.d.ts.map +1 -0
- package/dist/primitives/alert.js +36 -0
- package/dist/primitives/alert.js.map +1 -0
- package/dist/primitives/badge.d.ts +10 -0
- package/dist/primitives/badge.d.ts.map +1 -0
- package/dist/primitives/badge.js +30 -0
- package/dist/primitives/badge.js.map +1 -0
- package/dist/primitives/breadcrumb.d.ts +12 -0
- package/dist/primitives/breadcrumb.d.ts.map +1 -0
- package/dist/primitives/breadcrumb.js +33 -0
- package/dist/primitives/breadcrumb.js.map +1 -0
- package/dist/primitives/button.d.ts +10 -8
- package/dist/primitives/button.d.ts.map +1 -1
- package/dist/primitives/button.js +41 -10
- package/dist/primitives/button.js.map +1 -1
- package/dist/primitives/card.d.ts +10 -0
- package/dist/primitives/card.d.ts.map +1 -0
- package/dist/primitives/card.js +29 -0
- package/dist/primitives/card.js.map +1 -0
- package/dist/primitives/checkbox.d.ts +5 -0
- package/dist/primitives/checkbox.d.ts.map +1 -0
- package/dist/primitives/checkbox.js +11 -0
- package/dist/primitives/checkbox.js.map +1 -0
- package/dist/primitives/cn.d.ts +1 -1
- package/dist/primitives/cn.d.ts.map +1 -1
- package/dist/primitives/cn.js +1 -1
- package/dist/primitives/cn.js.map +1 -1
- package/dist/primitives/collapsible.d.ts +6 -0
- package/dist/primitives/collapsible.d.ts.map +1 -0
- package/dist/primitives/collapsible.js +14 -0
- package/dist/primitives/collapsible.js.map +1 -0
- package/dist/primitives/command.d.ts +19 -0
- package/dist/primitives/command.d.ts.map +1 -0
- package/dist/primitives/command.js +38 -0
- package/dist/primitives/command.js.map +1 -0
- package/dist/primitives/dialog.d.ts +17 -9
- package/dist/primitives/dialog.d.ts.map +1 -1
- package/dist/primitives/dialog.js +39 -14
- package/dist/primitives/dialog.js.map +1 -1
- package/dist/primitives/dropdown-menu.d.ts +23 -0
- package/dist/primitives/dropdown-menu.d.ts.map +1 -0
- package/dist/primitives/dropdown-menu.js +48 -0
- package/dist/primitives/dropdown-menu.js.map +1 -0
- package/dist/primitives/fieldSurface.d.ts +23 -0
- package/dist/primitives/fieldSurface.d.ts.map +1 -0
- package/dist/primitives/fieldSurface.js +23 -0
- package/dist/primitives/fieldSurface.js.map +1 -0
- package/dist/primitives/index.d.ts +24 -5
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/index.js +25 -5
- package/dist/primitives/index.js.map +1 -1
- package/dist/primitives/input.d.ts +12 -0
- package/dist/primitives/input.d.ts.map +1 -0
- package/dist/primitives/input.js +20 -0
- package/dist/primitives/input.js.map +1 -0
- package/dist/primitives/label.d.ts +5 -0
- package/dist/primitives/label.d.ts.map +1 -0
- package/dist/primitives/label.js +10 -0
- package/dist/primitives/label.js.map +1 -0
- package/dist/primitives/listSurface.d.ts +8 -0
- package/dist/primitives/listSurface.d.ts.map +1 -0
- package/dist/primitives/listSurface.js +8 -0
- package/dist/primitives/listSurface.js.map +1 -0
- package/dist/primitives/popover.d.ts +11 -0
- package/dist/primitives/popover.d.ts.map +1 -0
- package/dist/primitives/popover.js +31 -0
- package/dist/primitives/popover.js.map +1 -0
- package/dist/primitives/portal.d.ts +16 -0
- package/dist/primitives/portal.d.ts.map +1 -0
- package/dist/primitives/portal.js +9 -0
- package/dist/primitives/portal.js.map +1 -0
- package/dist/primitives/select.d.ts +20 -8
- package/dist/primitives/select.d.ts.map +1 -1
- package/dist/primitives/select.js +46 -12
- package/dist/primitives/select.js.map +1 -1
- package/dist/primitives/separator.d.ts +5 -0
- package/dist/primitives/separator.d.ts.map +1 -0
- package/dist/primitives/separator.js +10 -0
- package/dist/primitives/separator.js.map +1 -0
- package/dist/primitives/sheet.d.ts +14 -8
- package/dist/primitives/sheet.d.ts.map +1 -1
- package/dist/primitives/sheet.js +42 -11
- package/dist/primitives/sheet.js.map +1 -1
- package/dist/primitives/skeleton.d.ts +3 -0
- package/dist/primitives/skeleton.d.ts.map +1 -0
- package/dist/primitives/skeleton.js +7 -0
- package/dist/primitives/skeleton.js.map +1 -0
- package/dist/primitives/switch.d.ts +7 -0
- package/dist/primitives/switch.d.ts.map +1 -0
- package/dist/primitives/switch.js +10 -0
- package/dist/primitives/switch.js.map +1 -0
- package/dist/primitives/table.d.ts +11 -0
- package/dist/primitives/table.d.ts.map +1 -0
- package/dist/primitives/table.js +30 -0
- package/dist/primitives/table.js.map +1 -0
- package/dist/primitives/textarea.d.ts +4 -0
- package/dist/primitives/textarea.d.ts.map +1 -0
- package/dist/primitives/textarea.js +11 -0
- package/dist/primitives/textarea.js.map +1 -0
- package/dist/primitives/tooltip.d.ts +8 -0
- package/dist/primitives/tooltip.d.ts.map +1 -0
- package/dist/primitives/tooltip.js +21 -0
- package/dist/primitives/tooltip.js.map +1 -0
- package/dist/provider/AdminUiProvider.d.ts +8 -6
- package/dist/provider/AdminUiProvider.d.ts.map +1 -1
- package/dist/provider/AdminUiProvider.js +37 -22
- package/dist/provider/AdminUiProvider.js.map +1 -1
- package/dist/provider/adminUiContext.d.ts +6 -0
- package/dist/provider/adminUiContext.d.ts.map +1 -0
- package/dist/provider/adminUiContext.js +9 -0
- package/dist/provider/adminUiContext.js.map +1 -0
- package/dist/provider/index.d.ts +4 -2
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/index.js +4 -1
- package/dist/provider/index.js.map +1 -1
- package/dist/provider/storageKey.d.ts +4 -0
- package/dist/provider/storageKey.d.ts.map +1 -0
- package/dist/provider/storageKey.js +3 -0
- package/dist/provider/storageKey.js.map +1 -0
- package/dist/provider/types.d.ts +38 -6
- package/dist/provider/types.d.ts.map +1 -1
- package/dist/scripts/build-i18n-manifest.mjs +138 -0
- package/dist/scripts/check-radix.mjs +131 -0
- package/dist/scripts/check-tokens.mjs +236 -0
- package/dist/theme.css +15 -11
- package/dist/tokens.json +388 -53
- package/dist/translations/FormTranslatableFields.d.ts +30 -0
- package/dist/translations/FormTranslatableFields.d.ts.map +1 -0
- package/dist/translations/FormTranslatableFields.js +58 -0
- package/dist/translations/FormTranslatableFields.js.map +1 -0
- package/dist/translations/TranslatableField.d.ts +48 -0
- package/dist/translations/TranslatableField.d.ts.map +1 -0
- package/dist/translations/TranslatableField.js +44 -0
- package/dist/translations/TranslatableField.js.map +1 -0
- package/dist/translations/TranslatableInput.d.ts +14 -0
- package/dist/translations/TranslatableInput.d.ts.map +1 -0
- package/dist/translations/TranslatableInput.js +15 -0
- package/dist/translations/TranslatableInput.js.map +1 -0
- package/dist/translations/TranslatableMarkdown.d.ts +21 -0
- package/dist/translations/TranslatableMarkdown.d.ts.map +1 -0
- package/dist/translations/TranslatableMarkdown.js +12 -0
- package/dist/translations/TranslatableMarkdown.js.map +1 -0
- package/dist/translations/TranslationControls.d.ts +22 -0
- package/dist/translations/TranslationControls.d.ts.map +1 -0
- package/dist/translations/TranslationControls.js +31 -0
- package/dist/translations/TranslationControls.js.map +1 -0
- package/dist/translations/index.d.ts +30 -1
- package/dist/translations/index.d.ts.map +1 -1
- package/dist/translations/index.js +17 -1
- package/dist/translations/index.js.map +1 -1
- package/package.json +27 -29
- package/dist/data/StatTile.d.ts +0 -8
- package/dist/data/StatTile.d.ts.map +0 -1
- package/dist/data/StatTile.js +0 -6
- package/dist/data/StatTile.js.map +0 -1
- package/dist/data/index.d.ts +0 -2
- package/dist/data/index.d.ts.map +0 -1
- package/dist/data/index.js +0 -2
- package/dist/data/index.js.map +0 -1
- package/dist/glass/GlassPanel.d.ts +0 -7
- package/dist/glass/GlassPanel.d.ts.map +0 -1
- package/dist/glass/GlassPanel.js +0 -5
- package/dist/glass/GlassPanel.js.map +0 -1
- package/dist/i18n/m.d.ts +0 -7
- package/dist/i18n/m.d.ts.map +0 -1
- package/dist/i18n/m.js +0 -7
- package/dist/i18n/m.js.map +0 -1
- package/dist/list/ClearFiltersButton.d.ts +0 -7
- package/dist/list/ClearFiltersButton.d.ts.map +0 -1
- package/dist/list/ClearFiltersButton.js +0 -10
- package/dist/list/ClearFiltersButton.js.map +0 -1
- package/dist/list/DateCell.d.ts +0 -8
- package/dist/list/DateCell.d.ts.map +0 -1
- package/dist/list/DateCell.js +0 -12
- package/dist/list/DateCell.js.map +0 -1
- package/dist/logic/pure/errors.d.ts +0 -3
- package/dist/logic/pure/errors.d.ts.map +0 -1
- package/dist/logic/pure/errors.js +0 -5
- package/dist/logic/pure/errors.js.map +0 -1
- package/dist/logic/pure/statusMap.d.ts +0 -12
- package/dist/logic/pure/statusMap.d.ts.map +0 -1
- package/dist/logic/pure/statusMap.js +0 -5
- package/dist/logic/pure/statusMap.js.map +0 -1
- package/dist/logic/react/useToggle.d.ts +0 -8
- package/dist/logic/react/useToggle.d.ts.map +0 -1
- package/dist/logic/react/useToggle.js +0 -9
- package/dist/logic/react/useToggle.js.map +0 -1
- package/dist/next/useNextSearchParam.d.ts +0 -3
- package/dist/next/useNextSearchParam.d.ts.map +0 -1
- package/dist/next/useNextSearchParam.js +0 -16
- package/dist/next/useNextSearchParam.js.map +0 -1
- package/dist/primitives/portalContainer.d.ts +0 -8
- package/dist/primitives/portalContainer.d.ts.map +0 -1
- package/dist/primitives/portalContainer.js +0 -12
- package/dist/primitives/portalContainer.js.map +0 -1
- package/dist/translations/TranslatableInputField.d.ts +0 -8
- package/dist/translations/TranslatableInputField.d.ts.map +0 -1
- package/dist/translations/TranslatableInputField.js +0 -12
- package/dist/translations/TranslatableInputField.js.map +0 -1
- package/docs/README.md +0 -11
- package/scripts/check-tokens.mjs +0 -136
- package/scripts/lib/i18n-manifest.mjs +0 -91
- package/scripts/lib/source-scan.mjs +0 -258
package/STANDARDS.md
ADDED
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
# STANDARDS — how every list and detail screen is built
|
|
2
|
+
|
|
3
|
+
One presentation everywhere: a screen keeps its data and behaviour and takes its look from the blocks. Delete the
|
|
4
|
+
local copy when you adopt a block; never keep a screen-local `FilterField`, `Muted`, `StatusBadge`, tab shell, date
|
|
5
|
+
helper or checkbox column. Request bodies and filter strings stay exactly as they are.
|
|
6
|
+
|
|
7
|
+
Where the names below come from (setup and the entry list: [`README.md`](./README.md)):
|
|
8
|
+
|
|
9
|
+
| Entry | Names used here |
|
|
10
|
+
|---|---|
|
|
11
|
+
| `@mgamadeus/ddd-admin-ui/logic` | `useUrlListState`, `useRowSelection`, `useEntityDrawer`, `drawerKey`, `defineStatusMap`, `formatDate`, `formatDateTime`, `runSequentialWithSummary` |
|
|
12
|
+
| `@mgamadeus/ddd-admin-ui/list` | `EntityListToolbar`, `EntityListBody`, `EntityListTable`, `EntityListViewToggle`, `EntityListBulkBar`, `FilterPanel`, `FilterText`, `FilterSelect`, `FilterMultiSelect`, `FilterDateRange`, `YES_NO_FILTER_OPTIONS`, `StatusBadge`, `IdCell`, `DateCell`, `BooleanCell`, `ImageCell`, `EmptyValue`, `orEmpty`, `MultiSelect`, `ChipToggleGroup`, `Combobox`, `Tag` |
|
|
13
|
+
| `@mgamadeus/ddd-admin-ui/page` | `EntityListPage`, `PageToolbar`, `ExportButton`, `AddEntityButton`, `EntityDetailShell`, `SectionHeader`, `DefinitionList`, `EditableCard`, `IconValue`, `IconValueRow`, `PageSections`, `CardGrid`, `PageFrame`, `PageHeader` |
|
|
14
|
+
| `@mgamadeus/ddd-admin-ui/form` | `FormDrawer`, `FormActions`, `FormField`, `FormSection`, `useConfirmDialog` |
|
|
15
|
+
| `@mgamadeus/ddd-admin-ui/glass` | `QuickFilterPills`, `CollapsibleCard`, `GlassGroup`, `ActionRow` |
|
|
16
|
+
| `@mgamadeus/ddd-admin-ui/primitives` | `Button`, `Card`, `CardContent` |
|
|
17
|
+
| `@mgamadeus/ddd-admin-ui/next` | `useNextUrlStateAdapter`, `useNextDrawerUrlAdapter`, `useListViewParam` |
|
|
18
|
+
|
|
19
|
+
Every screen renders below `AdminUiProvider`.
|
|
20
|
+
|
|
21
|
+
## 1. List state — `useUrlListState`
|
|
22
|
+
|
|
23
|
+
One hook for search + filters, in the URL, 350 ms debounce. Keys = URL parameter names, a module constant.
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
import { useUrlListState } from '@mgamadeus/ddd-admin-ui/logic';
|
|
27
|
+
import { useNextUrlStateAdapter } from '@mgamadeus/ddd-admin-ui/next'; // or the host's own `UrlStateAdapter`
|
|
28
|
+
|
|
29
|
+
const LIST_KEYS = ['q', 'worldId', 'status', 'createdFrom', 'createdTo'] as const;
|
|
30
|
+
|
|
31
|
+
const list = useUrlListState(LIST_KEYS, { adapter: useNextUrlStateAdapter({ listId: 'admin.campaigns' }), uncounted: ['q'] });
|
|
32
|
+
// inputs: list.values.q / list.setValue('q', value)
|
|
33
|
+
// request: build the filter string from list.debounced (never from list.values)
|
|
34
|
+
// multi: list.getList('status') / list.setList('status', next) → `?status=RUNNING,PAUSED`
|
|
35
|
+
// reset: list.clear() counts: list.activeFilterCount (panel), list.isActive (empty state)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The screen renders inside `<Suspense>`. Build filters with the `@mgamadeus/ddd-web/query` builders.
|
|
39
|
+
`listId` is the list's stable id (a module constant) under which the host adapter remembers the list: e.g. the view in
|
|
40
|
+
localStorage, the filters in this tab's sessionStorage.
|
|
41
|
+
|
|
42
|
+
## 2. Toolbar and filters
|
|
43
|
+
|
|
44
|
+
Search left, Filters toggle with count, one "Clear filters", scope pickers in `trailing`, view toggle last, bulk bar
|
|
45
|
+
below. Filters go **only** in the panel (never in `trailing`, never as an inline header row).
|
|
46
|
+
|
|
47
|
+
```tsx
|
|
48
|
+
<EntityListToolbar
|
|
49
|
+
search={{ value: list.values.q, onChange: value => list.setValue('q', value), placeholder: 'Search name or ID' }}
|
|
50
|
+
filters={
|
|
51
|
+
<FilterPanel>
|
|
52
|
+
<FilterText label="ID" inputMode="numeric" value={list.values.id} onChange={value => list.setValue('id', value)} />
|
|
53
|
+
<FilterSelect label="World" allLabel="All Worlds" options={worldOptions} value={list.values.worldId}
|
|
54
|
+
onChange={value => list.setValue('worldId', value)} />
|
|
55
|
+
<FilterMultiSelect label="Status" options={STATUS_OPTIONS} value={list.getList('status')}
|
|
56
|
+
onChange={next => list.setList('status', next)} />
|
|
57
|
+
<FilterDateRange label="Created" from={list.values.createdFrom} to={list.values.createdTo}
|
|
58
|
+
onFromChange={value => list.setValue('createdFrom', value)} onToChange={value => list.setValue('createdTo', value)} />
|
|
59
|
+
</FilterPanel>
|
|
60
|
+
}
|
|
61
|
+
activeFilterCount={list.activeFilterCount}
|
|
62
|
+
onClearFilters={list.clear}
|
|
63
|
+
viewToggle={<EntityListViewToggle displayMode={displayMode} onDisplayModeChange={setDisplayMode} />}
|
|
64
|
+
bulkBar={bulkBar}
|
|
65
|
+
/>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
- `FilterSelect`: `''` = All (`allLabel`), searchable automatically from 10 options (`searchable` to force).
|
|
69
|
+
- Yes / No filters: `options={YES_NO_FILTER_OPTIONS}` (`'1'` / `'0'`).
|
|
70
|
+
- Body: `isSearchActive={list.isActive}` and `onClearSearch={list.clear}` on `EntityListBody`.
|
|
71
|
+
- Search modes (e.g. an AI search next to the text search): the mode switch goes in `search.leading` (it replaces the
|
|
72
|
+
magnifier at the same spot, ≤ 24 px), Enter / Escape in `search.onKeyDown`. Never lay a control over the field from
|
|
73
|
+
outside.
|
|
74
|
+
|
|
75
|
+
## 3. Page toolbar (header actions)
|
|
76
|
+
|
|
77
|
+
Order: outline secondaries → `ExportButton` → `MoreActionsMenu` (rare / maintenance) → **one** primary
|
|
78
|
+
`AddEntityButton` ("Add <Entity>", singular, top right; `label` replaces the whole text when an entity name does not
|
|
79
|
+
fit, already translated). Every write control `disabled={!writesAllowed}`.
|
|
80
|
+
|
|
81
|
+
```tsx
|
|
82
|
+
<EntityListPage
|
|
83
|
+
title="Campaigns"
|
|
84
|
+
headerActions={
|
|
85
|
+
<PageToolbar
|
|
86
|
+
exportAction={<ExportButton onExport={handleExport} disabled={!writesAllowed} />}
|
|
87
|
+
moreActions={[{ id: 'recalc', label: 'Recalculate rankings', icon: <RefreshCw />, onSelect: handleRecalc,
|
|
88
|
+
disabled: !writesAllowed }]}
|
|
89
|
+
primaryAction={<AddEntityButton entity="Campaign" href="/campaigns/create" linkComponent={Link}
|
|
90
|
+
disabled={!writesAllowed} />}
|
|
91
|
+
>
|
|
92
|
+
<Button variant="outline" onClick={openImport}>Import</Button>
|
|
93
|
+
</PageToolbar>
|
|
94
|
+
}
|
|
95
|
+
toolbar={…}
|
|
96
|
+
>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
`ExportButton` label defaults to "Export to Excel"; a returned promise shows the spinner.
|
|
100
|
+
|
|
101
|
+
## 4. Selection and bulk actions
|
|
102
|
+
|
|
103
|
+
```tsx
|
|
104
|
+
const selection = useRowSelection({
|
|
105
|
+
items: list.items, // useGrowingWindowList().items
|
|
106
|
+
getKey: track => toNumericId(track.id), // a host helper
|
|
107
|
+
resetKey: filterString ?? '', // new filters → empty selection
|
|
108
|
+
disabled: busy,
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
const handleBulkDelete = async () => {
|
|
112
|
+
if (!writesAllowed || !(await confirm({ title: `Delete ${selection.count} track(s)?`, confirmVariant: 'destructive',
|
|
113
|
+
confirmLabel: 'Delete' }))) return;
|
|
114
|
+
setBusy(true);
|
|
115
|
+
await runSequentialWithSummary(selection.selectedKeys, id => deleteTrack({ trackId: id }).unwrap(),
|
|
116
|
+
{ progress: 'Deleting', done: 'Deleted', noun: 'track' });
|
|
117
|
+
setBusy(false);
|
|
118
|
+
selection.clear();
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const bulkBar = (
|
|
122
|
+
<EntityListBulkBar
|
|
123
|
+
selection={selection}
|
|
124
|
+
actions={[{ id: 'recreate', label: 'Recreate', icon: <RotateCcw />, onClick: handleBulkRecreate }]}
|
|
125
|
+
onDelete={handleBulkDelete}
|
|
126
|
+
disabled={!writesAllowed}
|
|
127
|
+
busy={busy}
|
|
128
|
+
/>
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
<EntityListBody … selection={selection} />
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Never a hand-made checkbox column, never `Promise.all` for bulk writes. A job that needs a result summary or a typed
|
|
135
|
+
confirmation uses the host's dialogs.
|
|
136
|
+
|
|
137
|
+
## 5. Columns and cells
|
|
138
|
+
|
|
139
|
+
Order: [select] → image → **ID** → name (link) → relations → type / attributes → **Status** → flags → Start / End →
|
|
140
|
+
**Created / Updated** → **Actions**. Title Case headers. Every table with a detail route sets `rowAction`.
|
|
141
|
+
|
|
142
|
+
```tsx
|
|
143
|
+
const columns: EntityListColumn<Campaign>[] = [
|
|
144
|
+
{ id: 'image', header: 'Image', cell: c => <ImageCell src={mediaSizedUrl(c.coverImage?.publicUrl, 'SMALL')} alt="" />,
|
|
145
|
+
className: 'w-16' },
|
|
146
|
+
{ id: 'id', header: 'ID', cell: c => <IdCell id={c.id} copyable />, className: 'w-20' },
|
|
147
|
+
{ id: 'name', header: 'Name', cell: c => <Link href={campaignRoute(c.id)} className="font-medium hover:underline">
|
|
148
|
+
{c.name}</Link> },
|
|
149
|
+
{ id: 'world', header: 'World', cell: c => orEmpty(c.world?.name) },
|
|
150
|
+
{ id: 'status', header: 'Status', cell: c => <StatusBadge value={c.status} map={CAMPAIGN_STATUS} /> },
|
|
151
|
+
{ id: 'landingpage', header: 'Landing Page', cell: c => <BooleanCell value={c.landingpageEnabled} /> },
|
|
152
|
+
{ id: 'start', header: 'Start', cell: c => <DateCell value={c.startDate} format="date" /> },
|
|
153
|
+
{ id: 'created', header: 'Created', cell: c => <DateCell value={c.changeHistory?.createdTime} /> },
|
|
154
|
+
{ id: 'updated', header: 'Updated', cell: c => <DateCell value={c.changeHistory?.modifiedTime} /> },
|
|
155
|
+
{ id: 'actions', header: <span className="sr-only">Actions</span>, className: 'w-24 text-right', cell: c => (
|
|
156
|
+
<div className="flex justify-end gap-1">
|
|
157
|
+
<Button variant="ghost" size="icon-sm" aria-label={`Edit ${c.name}`} …><Pencil /></Button>
|
|
158
|
+
<Button variant="ghost" size="icon-sm" aria-label={`Delete ${c.name}`} className="text-destructive"
|
|
159
|
+
disabled={!writesAllowed} …><Trash2 /></Button>
|
|
160
|
+
</div>
|
|
161
|
+
) },
|
|
162
|
+
];
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
- Empty = `<EmptyValue />` / `orEmpty(value)` → `—`. Never `-`, `N/A`, `''` or a local `Muted`.
|
|
166
|
+
- Dates: `DateCell` in tables, `formatDateTime` / `formatDate` in text. Never raw strings, never
|
|
167
|
+
`toLocaleString()`, never `new Date(value)`.
|
|
168
|
+
- Numbers and ids: the host's formatters (one per kind), never ad-hoc `toFixed` calls.
|
|
169
|
+
- Copy next to a value outside the ID column: a copy button on `useCopyToClipboard`.
|
|
170
|
+
|
|
171
|
+
## 6. Status badges
|
|
172
|
+
|
|
173
|
+
One family map per enum, defined once in the host with `defineStatusMap` (e.g. `CAMPAIGN_STATUS`, `DELIVERY_STATUS` +
|
|
174
|
+
a `deliveryStatusOf` mapper for a boolean). A new enum gets a map there.
|
|
175
|
+
|
|
176
|
+
```tsx
|
|
177
|
+
<StatusBadge value={challenge.status} map={CHALLENGE_STATUS} />
|
|
178
|
+
<StatusBadge value={deliveryStatusOf(push.sentSuccessfully)} map={DELIVERY_STATUS} />
|
|
179
|
+
<StatusBadge tone="highlight" label="Electric" icon={Zap} /> // one-off flag
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Tones: `neutral` not started / inactive · `info` finished / informational · `success` running / active / done ·
|
|
183
|
+
`warning` paused / pending / needs action · `danger` failed / cancelled · `highlight` featured flag · `brand` identity.
|
|
184
|
+
Always with an icon.
|
|
185
|
+
|
|
186
|
+
## 7. Multi-select inputs
|
|
187
|
+
|
|
188
|
+
- Filters: `FilterMultiSelect` (above).
|
|
189
|
+
- Forms (roles, worlds, languages): `MultiSelect` inside `FormField`; a short fixed set (≤ ~8, fully visible):
|
|
190
|
+
`ChipToggleGroup`.
|
|
191
|
+
|
|
192
|
+
```tsx
|
|
193
|
+
<FormField name="roles" label="Roles">
|
|
194
|
+
{({ field, control, disabled }) => (
|
|
195
|
+
<MultiSelect id={control.id} options={ROLE_OPTIONS} value={field.value} onChange={field.onChange}
|
|
196
|
+
aria-label="Roles" maxChips={Infinity} disabled={disabled} />
|
|
197
|
+
)}
|
|
198
|
+
</FormField>
|
|
199
|
+
|
|
200
|
+
<ChipToggleGroup aria-label="Supported Languages" options={localeOptions} value={value} onChange={onChange} />
|
|
201
|
+
<ChipToggleGroup mode="single" aria-label="Interval" options={INTERVALS} value={interval} onChange={setInterval} />
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Single searchable select (not a filter): `Combobox`.
|
|
205
|
+
|
|
206
|
+
## 8. Detail screens — `EntityDetailShell`
|
|
207
|
+
|
|
208
|
+
Every entity detail (World, Campaign, Challenge, Account, Partner, Track, Ticket …) uses the shell: back + centred
|
|
209
|
+
title + description + actions, `EntityMetadata` (ID, Created, Updated), centred segmented route tabs, loading and
|
|
210
|
+
error. Full width (§ 10); the header is `DetailHeader`, `nested` inside another shell.
|
|
211
|
+
|
|
212
|
+
```tsx
|
|
213
|
+
export const CampaignShell = ({ campaignId, children }: CampaignShellProps) => {
|
|
214
|
+
const pathname = usePathname();
|
|
215
|
+
const query = useCampaignQuery(campaignId);
|
|
216
|
+
const campaign = query.data?.campaign;
|
|
217
|
+
return (
|
|
218
|
+
<EntityDetailShell
|
|
219
|
+
title={campaign?.name}
|
|
220
|
+
fallbackTitle={`Campaign #${campaignId}`}
|
|
221
|
+
description={campaign?.world?.name}
|
|
222
|
+
back={{ href: '/campaigns', label: 'Back to campaigns' }}
|
|
223
|
+
linkComponent={Link}
|
|
224
|
+
metadata={{ id: campaign?.id, changeHistory: campaign?.changeHistory }}
|
|
225
|
+
tabs={CAMPAIGN_TABS.map(tab => ({ id: tab.segment, label: tab.label, href: campaignRoute(campaignId, tab.segment) }))}
|
|
226
|
+
currentPath={pathname}
|
|
227
|
+
tabsLabel="Campaign sections"
|
|
228
|
+
isLoading={query.isLoading}
|
|
229
|
+
error={!query.isLoading && !campaign ? (query.isError ? 'This campaign could not be loaded.' : 'Campaign not found.') : undefined}
|
|
230
|
+
actions={<PageToolbar moreActions={…} />}
|
|
231
|
+
>
|
|
232
|
+
{children}
|
|
233
|
+
</EntityDetailShell>
|
|
234
|
+
);
|
|
235
|
+
};
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
Inside a tab:
|
|
239
|
+
|
|
240
|
+
```tsx
|
|
241
|
+
<SectionHeader title="Rankings" description="Top riders of this challenge"
|
|
242
|
+
tabs={[{ id: 'accounts', label: 'Accounts' }, { id: 'teams', label: 'Teams' }]}
|
|
243
|
+
activeTab={tab} onTabSelect={setTab} actions={<ExportButton onExport={exportRankings} />} />
|
|
244
|
+
|
|
245
|
+
<Card><CardContent>
|
|
246
|
+
<DefinitionList columns={3} items={[
|
|
247
|
+
{ label: 'Access Code', value: world.accessCode },
|
|
248
|
+
{ label: 'Start', value: <DateCell value={world.startDate} format="date" /> },
|
|
249
|
+
{ label: 'Description', value: world.description, wide: true },
|
|
250
|
+
]} />
|
|
251
|
+
</CardContent></Card>
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
Create screens: no `metadata` id yet → the strip renders nothing. Edit screens outside a shell keep
|
|
255
|
+
`<EntityMetadata id={…} changeHistory={…} />` right under their `FormHeader`.
|
|
256
|
+
|
|
257
|
+
## 9. Host-specific shared components
|
|
258
|
+
|
|
259
|
+
Host-specific shared components (the markdown editor passed to `FormTranslatableMarkdown` as `renderEditor`, a
|
|
260
|
+
colour input, copy buttons, dialogs, number / id formatters) are documented by the host; the blocks take them as props
|
|
261
|
+
or render slots and never import them.
|
|
262
|
+
|
|
263
|
+
## 10. Clouds look — surfaces, tabs, titles, read-first cards
|
|
264
|
+
|
|
265
|
+
The look lives in the blocks; a screen never re-draws it.
|
|
266
|
+
|
|
267
|
+
- **No main panel.** Page titles and toolbars sit on the cloud background; content goes into cards. Never wrap a page
|
|
268
|
+
in a big white box, never hand-draw `rounded-xl border bg-card` — use `Card` (primitives), `FormSection`,
|
|
269
|
+
`EditableCard` or, for a custom frame (a chat column, a map), the `.surface rounded-2xl` classes.
|
|
270
|
+
- **Surfaces** are translucent (88 %) with a 12 px blur and the soft three-layer shadow, no border. Nested surfaces
|
|
271
|
+
drop the blur by themselves. Menus, popovers, dialogs and sheets stay opaque.
|
|
272
|
+
- **Widths and inset** come from the shell: every page is full width at the one page inset
|
|
273
|
+
(`PAGE_INSET_CLASS`, shared by the shell column, `PageFrame` and `EntityListPage`); only a one-column `FormWrapper`
|
|
274
|
+
(narrow) stays `max-w-2xl` — its `FormHeader` sits outside the wrapper. Never add a page-level `max-w-*`, never a
|
|
275
|
+
hand-made `data-page-frame` / `--app-gap` frame (use `PageFrame`).
|
|
276
|
+
- **Headers**: `PageHeader` (lists, dashboards, maintenance, frames) or `DetailHeader` (via `EntityDetailShell` /
|
|
277
|
+
`FormHeader`: details and form pages). Inside another entity's shell pass `nested` (an `h2`). Never a raw `h1`.
|
|
278
|
+
- **List cards**: every list — page or detail tab — is an `EntityListCard` (`label`, `toolbar`, body); never a
|
|
279
|
+
`section.surface` with a hand-made toolbar row. Header → card gap comes from `SectionHeader` (never `className="mb-0"`
|
|
280
|
+
in a `space-y-*` stack: it removes the gap).
|
|
281
|
+
- **Tabs** are the segmented pill control: `EntityDetailShell` centres them under the centred title; standalone tab
|
|
282
|
+
bars use `EntityTabs` as is; sub-tabs of a section are `SectionHeader tabs`
|
|
283
|
+
(compact). Never a hand-made underline or pill bar.
|
|
284
|
+
- **Two-tone titles**: wrap the brand part in `<em>` — `title={<>Bike <em>Types</em></>}` (pass `label="Bike Types"` to
|
|
285
|
+
`EntityListPage` then). Only where a title earns it (Home, section headers), not on every list.
|
|
286
|
+
- **Sticky glass bars**: page forms get them from `FormActions` (`sticky={false}` inside a dialog); the bulk bar from
|
|
287
|
+
`EntityListBulkBar`.
|
|
288
|
+
|
|
289
|
+
```tsx
|
|
290
|
+
<PageSections>
|
|
291
|
+
<section>
|
|
292
|
+
<SectionHeader title={<>General <em>settings</em></>} />
|
|
293
|
+
<CardGrid>
|
|
294
|
+
<EditableCard title="Access" onEdit={openAccessForm} editLabel="Edit access" editDisabled={!writesAllowed}>
|
|
295
|
+
<IconValueRow>
|
|
296
|
+
<IconValue icon={<KeyRound />}>{world.accessCode ?? <EmptyValue />}</IconValue>
|
|
297
|
+
<IconValue icon={<Calendar />}><DateCell value={world.startDate} format="date" /></IconValue>
|
|
298
|
+
</IconValueRow>
|
|
299
|
+
</EditableCard>
|
|
300
|
+
<EditableCard title="Languages" onEdit={openLanguagesForm} editLabel="Edit languages" editDisabled={!writesAllowed}>
|
|
301
|
+
<div className="flex flex-wrap gap-2">
|
|
302
|
+
{locales.map(locale => <Tag key={locale} tone={locale === defaultLocale ? 'primary' : 'default'}>{locale}</Tag>)}
|
|
303
|
+
</div>
|
|
304
|
+
</EditableCard>
|
|
305
|
+
</CardGrid>
|
|
306
|
+
</section>
|
|
307
|
+
</PageSections>
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
## 11. Glass tone — quick filters, collapsible cards, group panels
|
|
311
|
+
|
|
312
|
+
Blocks in `glass/`.
|
|
313
|
+
|
|
314
|
+
```tsx
|
|
315
|
+
// Status quick filters on the clouds: the same list key as the panel's Status field.
|
|
316
|
+
<EntityListPage
|
|
317
|
+
belowHeader={
|
|
318
|
+
<QuickFilterPills aria-label="Status quick filters" allLabel="All Statuses" options={STATUS_OPTIONS}
|
|
319
|
+
value={list.values.status} onChange={value => list.setValue('status', value)} />
|
|
320
|
+
}
|
|
321
|
+
…
|
|
322
|
+
/>
|
|
323
|
+
// multi: mode="multi" value={list.getList('status')} onChange={next => list.setList('status', next)}
|
|
324
|
+
|
|
325
|
+
// A collapsible group inside a form card (fields stay mounted unless `forceMount={false}`).
|
|
326
|
+
<CollapsibleCard density="compact" defaultOpen={false} title="Primary" description="Buttons, links…"
|
|
327
|
+
meta={<span className="size-6 rounded-md border" style={{ backgroundColor: preview }} />}>
|
|
328
|
+
…fields…
|
|
329
|
+
</CollapsibleCard>
|
|
330
|
+
|
|
331
|
+
// A grouped to-do list on the clouds: glass group (no shadow) + solid rows.
|
|
332
|
+
<GlassGroup title="Running" count={cards.length} limit={8} emptyText="No challenges">
|
|
333
|
+
{cards.map(card => (
|
|
334
|
+
<Link key={card.id} href={…}><ActionRow as="span" interactive title={card.name} description={card.context}
|
|
335
|
+
tone={CHALLENGE_STATUS[card.status].tone} toneLabel={CHALLENGE_STATUS[card.status].label} /></Link>
|
|
336
|
+
))}
|
|
337
|
+
</GlassGroup>
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
- Never invent counts for pills; pass `count` only when the screen already has it.
|
|
341
|
+
- A glass container (`GlassGroup`, glass `CollapsibleCard`) casts no shadow; its solid rows do.
|
|
342
|
+
- Status inside rows and tables stays `StatusBadge`; the `ActionRow` dot is labelled (`toneLabel`).
|
|
343
|
+
|
|
344
|
+
## 12. Side drawers — `useEntityDrawer` + `FormDrawer`
|
|
345
|
+
|
|
346
|
+
**Drawer** when all hold: no own tabs or sub-lists · ≤ ~15 fields · edited from its list · no large working surface
|
|
347
|
+
(map, conversation, preview + send). **Page** otherwise. Entities with a drawer also create in it (the list's Add
|
|
348
|
+
button).
|
|
349
|
+
|
|
350
|
+
```tsx
|
|
351
|
+
// The list screen (inside <Suspense>): drawer state in the URL next to the filters — `?edit=<id>` / `?create=1`.
|
|
352
|
+
const drawer = useEntityDrawer({ adapter: useNextDrawerUrlAdapter() }); // ./next, or the host's own adapter
|
|
353
|
+
|
|
354
|
+
<AddEntityButton entity="Sponsor" onClick={drawer.openCreate} disabled={!writesAllowed} />
|
|
355
|
+
rowAction={sponsor => () => drawer.openEdit(id)}
|
|
356
|
+
<Link href={sponsorEditRoute(id)} onClick={drawer.editLinkClick(id)}>{sponsor.name}</Link> // middle click = new tab
|
|
357
|
+
<SponsorFormDrawer drawer={drawer} />
|
|
358
|
+
|
|
359
|
+
// The module's drawer: loads the entity for the header, renders the existing form inside.
|
|
360
|
+
const shown = drawer.shown; // stays set while the close animation runs
|
|
361
|
+
const id = shown?.mode === 'edit' ? shown.id : undefined;
|
|
362
|
+
const query = useGet…Query({ …, id: id ?? '' }, { skip: id === undefined });
|
|
363
|
+
const entity = id ? (query.currentData?.sponsor ?? null) : null; // currentData: never the previous row's
|
|
364
|
+
<FormDrawer open={drawer.isOpen} onClose={drawer.close} title={entity?.name ?? `Sponsor #${id}`}
|
|
365
|
+
metadata={entity ? { id: entity.id, changeHistory: entity.changeHistory } : undefined}>
|
|
366
|
+
<SponsorForm key={drawerKey(shown)} sponsor={entity} onClose={drawer.close} />
|
|
367
|
+
</FormDrawer>
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
- **One form, no copy.** The page form takes `onClose` instead of routing: Cancel = `confirmDiscard()` then
|
|
371
|
+
`onClose()`; a save resets the form's baseline (`form.reset(values, { keepValues: true })`), toasts and calls
|
|
372
|
+
`onClose()`. `FormActions` moves into the drawer's pinned footer by itself (change status left, buttons right); the
|
|
373
|
+
✕, Esc and an overlay click ask "Discard changes?" through `useUnsavedChangesGuard`. Request bodies stay as they are.
|
|
374
|
+
- **Header**: entity title + `EntityMetadata variant="inline"` (ID · Created · Updated, one line) via `metadata`;
|
|
375
|
+
create passes a `description` instead. Entity actions that are no save (e.g. "Open as partner", "Reset password")
|
|
376
|
+
go into `headerActions` (outline `sm` buttons at the right end of the header); the save stays in the footer.
|
|
377
|
+
- **History**: opening pushes an entry (Back closes the drawer); `close()` pops it when this page opened the drawer and
|
|
378
|
+
removes the parameter otherwise (a link, a reload). A create that turns into the new entity's edit uses
|
|
379
|
+
`openEdit(newId, { replace: true })`. The writes are shallow (`history.pushState`): the list stays mounted.
|
|
380
|
+
- **Detail routes** (`/<entity>/:id`, `/create`) can stay as redirects to the list with the parameter. Route helpers
|
|
381
|
+
(`sponsorEditRoute`) live in a non-client file (a server page calls them).
|
|
382
|
+
- A list hosting two drawers passes its own `editKey` / `createKey`.
|
|
383
|
+
- **Confirm**: the drawer asks through the package dialog; a host with its own confirmation service passes
|
|
384
|
+
`confirm={hostConfirm}` (stable function, same Radix copy). The same prop exists on the translatable fields.
|
|
385
|
+
- One column inside the drawer (≤ 760 px): no `md:grid-cols-2` form grids.
|
package/dist/components.css
CHANGED
|
@@ -1,42 +1,187 @@
|
|
|
1
1
|
/*
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
Structural CSS of the blocks and primitives. Import it after `tailwindcss` (and `theme.css`). Colours come from the
|
|
3
|
+
host's Tailwind theme (`--theme(--color-…)`), alphas and shadows from plain custom properties the host sets on
|
|
4
|
+
`:root` and `.dark` (`--surface-alpha`, `--surface-shadow`, `--glass-alpha`, `--surface-glass-alpha`,
|
|
5
|
+
`--surface-glass-strong-alpha`, `--glass-shadow`, `--glass-control-shadow`).
|
|
6
|
+
*/
|
|
7
|
+
@source './';
|
|
7
8
|
|
|
8
|
-
/*
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
:where(:root) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
/* Layer scale. The blocks and primitives stack with `z-(--layer-<name>)`; these are only defaults: zero specificity
|
|
10
|
+
(`:where`) in the lowest cascade layer (`theme`), so any host declaration of a `--layer-*` variable wins, layered or
|
|
11
|
+
not. Equal overlay / popover values: a later portal paints on top. */
|
|
12
|
+
@layer theme {
|
|
13
|
+
:where(:root) {
|
|
14
|
+
--layer-raised: 10;
|
|
15
|
+
--layer-sticky: 20;
|
|
16
|
+
--layer-overlay: 50;
|
|
17
|
+
--layer-popover: 50;
|
|
18
|
+
}
|
|
17
19
|
}
|
|
18
20
|
|
|
21
|
+
/* Fluid heading scale: page title 28–36 px, section 20–24 px, card title 18–20 px. */
|
|
19
22
|
@utility text-title-page {
|
|
20
|
-
font-size: 1.
|
|
21
|
-
line-height:
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
font-size: clamp(1.75rem, 1.4rem + 0.6vw, 2.25rem);
|
|
24
|
+
line-height: 1.2;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@utility text-title-section {
|
|
28
|
+
font-size: clamp(1.25rem, 1.1rem + 0.3vw, 1.5rem);
|
|
29
|
+
line-height: 1.3;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@utility text-title-card {
|
|
33
|
+
font-size: clamp(1.125rem, 1.05rem + 0.15vw, 1.25rem);
|
|
34
|
+
line-height: 1.4;
|
|
24
35
|
}
|
|
25
36
|
|
|
37
|
+
@utility animate-shimmer {
|
|
38
|
+
animation: shimmer 2s infinite;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@keyframes shimmer {
|
|
42
|
+
0% {
|
|
43
|
+
transform: translateX(-100%);
|
|
44
|
+
}
|
|
45
|
+
100% {
|
|
46
|
+
transform: translateX(100%);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* The card surface over the page background: translucent card colour, 12 px backdrop blur, three-layer soft shadow,
|
|
51
|
+
no border. The radius comes from the element (`rounded-2xl`). A surface inside a surface (grid cards in the list
|
|
52
|
+
card, cards in a card) skips the blur: its backdrop is already frosted. In `components` so a `shadow-*` / `bg-*`
|
|
53
|
+
utility on the same element still wins. */
|
|
26
54
|
@layer components {
|
|
27
55
|
.surface {
|
|
28
56
|
background-color: color-mix(in oklab, --theme(--color-card) var(--surface-alpha), transparent);
|
|
57
|
+
-webkit-backdrop-filter: blur(12px);
|
|
58
|
+
backdrop-filter: blur(12px);
|
|
29
59
|
box-shadow: var(--surface-shadow);
|
|
30
60
|
}
|
|
31
|
-
|
|
61
|
+
.surface .surface {
|
|
62
|
+
-webkit-backdrop-filter: none;
|
|
63
|
+
backdrop-filter: none;
|
|
64
|
+
}
|
|
65
|
+
.surface:has([data-entity-grid]) [data-entity-grid] .surface {
|
|
66
|
+
-webkit-backdrop-filter: blur(12px);
|
|
67
|
+
backdrop-filter: blur(12px);
|
|
68
|
+
}
|
|
69
|
+
/* The glass tone: quick-filter pills, collapsible glass cards, group panels, header pills. A solid surface or a card
|
|
70
|
+
inside keeps its own (stronger) fill. */
|
|
32
71
|
.surface-glass {
|
|
33
72
|
background-color: color-mix(in oklab, --theme(--color-card) var(--surface-glass-alpha), transparent);
|
|
73
|
+
-webkit-backdrop-filter: blur(16px);
|
|
74
|
+
backdrop-filter: blur(16px);
|
|
34
75
|
box-shadow: var(--glass-shadow);
|
|
35
|
-
backdrop-filter: blur(12px);
|
|
36
76
|
}
|
|
37
|
-
|
|
38
|
-
|
|
77
|
+
.surface-glass-strong {
|
|
78
|
+
background-color: color-mix(in oklab, --theme(--color-card) var(--surface-glass-strong-alpha), transparent);
|
|
79
|
+
-webkit-backdrop-filter: blur(16px);
|
|
80
|
+
backdrop-filter: blur(16px);
|
|
81
|
+
box-shadow: var(--glass-shadow);
|
|
82
|
+
}
|
|
83
|
+
/* Glass inside a card (a collapsible group in a form section): no second blur, the quiet ink tint instead of
|
|
84
|
+
white-on-white, no shadow; open a step stronger. */
|
|
85
|
+
.surface .surface-glass {
|
|
86
|
+
background-color: --theme(--color-tint);
|
|
87
|
+
-webkit-backdrop-filter: none;
|
|
88
|
+
backdrop-filter: none;
|
|
89
|
+
box-shadow: none;
|
|
90
|
+
}
|
|
91
|
+
.surface .surface-glass-strong {
|
|
92
|
+
background-color: color-mix(in oklab, --theme(--color-card) 60%, --theme(--color-tint-strong));
|
|
93
|
+
-webkit-backdrop-filter: none;
|
|
94
|
+
backdrop-filter: none;
|
|
95
|
+
box-shadow: inset 0 0 0 1px --theme(--color-tint-strong);
|
|
96
|
+
}
|
|
97
|
+
/* Sticky glass bars (bulk bar, form action bar). */
|
|
98
|
+
/* Form actions at the top of the form: written last, shown first, sticky under the chrome. */
|
|
99
|
+
form:has(> [data-form-actions]) {
|
|
100
|
+
display: flex;
|
|
101
|
+
flex-direction: column;
|
|
102
|
+
}
|
|
39
103
|
form > [data-form-actions] {
|
|
40
104
|
order: -1;
|
|
41
105
|
}
|
|
106
|
+
.glass-bar {
|
|
107
|
+
background-color: color-mix(in oklab, --theme(--color-card) var(--glass-alpha), transparent);
|
|
108
|
+
-webkit-backdrop-filter: blur(12px);
|
|
109
|
+
backdrop-filter: blur(12px);
|
|
110
|
+
}
|
|
111
|
+
/* Grid view without cards (empty, no results, error): the state sits in a glass panel instead of floating bare on the
|
|
112
|
+
page background. Layered: no utility of the panel sets these properties, and a host's own look rule can win. */
|
|
113
|
+
.surface:has([data-entity-grid]) [data-entity-grid] [data-list-empty] {
|
|
114
|
+
background-color: color-mix(in oklab, --theme(--color-card) var(--surface-glass-alpha), transparent);
|
|
115
|
+
-webkit-backdrop-filter: blur(16px);
|
|
116
|
+
backdrop-filter: blur(16px);
|
|
117
|
+
/* the same shadow as every list card / table card, so grid and table views look alike */
|
|
118
|
+
box-shadow: var(--surface-shadow);
|
|
119
|
+
}
|
|
120
|
+
/* List card in table view: only the table below the toolbar is a card (radius 24 px). Layered: its element carries no
|
|
121
|
+
utility for these properties, and a host's own look rule (a flat card) can win. */
|
|
122
|
+
.surface:has(> [data-list-toolbar]):not(:has([data-entity-grid])) > [data-list-toolbar] + * {
|
|
123
|
+
overflow: hidden;
|
|
124
|
+
border-radius: 1.5rem;
|
|
125
|
+
background-color: color-mix(in oklab, --theme(--color-card) var(--surface-alpha), transparent);
|
|
126
|
+
-webkit-backdrop-filter: blur(12px);
|
|
127
|
+
backdrop-filter: blur(12px);
|
|
128
|
+
box-shadow: var(--surface-shadow);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* List cards: the toolbar and the filter panel sit straight on the page background — no card background, no rule;
|
|
133
|
+
only the table below is a card (radius 24 px). In grid view the grid cards sit on the background as well, each with
|
|
134
|
+
its own frosted surface. Unlayered: it beats the card's and the toolbar's utilities (`overflow-hidden`,
|
|
135
|
+
`rounded-3xl`, `border-b px-4 py-3`); inside `@layer components` those utilities would win. */
|
|
136
|
+
.surface:has(> [data-list-toolbar]) {
|
|
137
|
+
background-color: transparent;
|
|
138
|
+
-webkit-backdrop-filter: none;
|
|
139
|
+
backdrop-filter: none;
|
|
140
|
+
box-shadow: none;
|
|
141
|
+
overflow: visible;
|
|
142
|
+
border-radius: 0;
|
|
143
|
+
}
|
|
144
|
+
.surface:has(> [data-list-toolbar]) > [data-list-toolbar] {
|
|
145
|
+
border-bottom-width: 0;
|
|
146
|
+
padding-inline: 0;
|
|
147
|
+
padding-top: 0;
|
|
148
|
+
padding-bottom: 1rem;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* Filter controls on the page background in the glass tone: search, filter fields and the outline buttons of the
|
|
152
|
+
toolbar as frosted fields with a soft glass shadow. Shape by role: the pills — the search (`data-control="pill"`), a
|
|
153
|
+
toolbar menu (`SelectTrigger variant="pill"`) and the pill buttons (Filters, Clear filters) — drop their edge; a form
|
|
154
|
+
field in the Filters panel keeps its quiet edge over the glass. */
|
|
155
|
+
.surface:has(> [data-list-toolbar]) > [data-list-toolbar]
|
|
156
|
+
:is(
|
|
157
|
+
[data-slot="input"],
|
|
158
|
+
[data-slot="select-trigger"],
|
|
159
|
+
[data-slot="multi-select"],
|
|
160
|
+
[role="combobox"]:not([data-slot="multi-select"] *),
|
|
161
|
+
[data-slot="button"][data-variant="outline"]
|
|
162
|
+
) {
|
|
163
|
+
background-color: color-mix(in oklab, --theme(--color-card) var(--surface-glass-strong-alpha), transparent);
|
|
164
|
+
-webkit-backdrop-filter: blur(16px);
|
|
165
|
+
backdrop-filter: blur(16px);
|
|
166
|
+
/* A short glass shadow: the filter panel clips 12 px around its fields (collapse animation). */
|
|
167
|
+
box-shadow: var(--glass-control-shadow);
|
|
168
|
+
}
|
|
169
|
+
.surface:has(> [data-list-toolbar]) > [data-list-toolbar]
|
|
170
|
+
:is([data-control="pill"], [data-slot="button"][data-variant="outline"]) {
|
|
171
|
+
border-color: transparent;
|
|
172
|
+
}
|
|
173
|
+
/* Chips inside the glass multi-select: the quiet ink tint instead of the grey `secondary` block. */
|
|
174
|
+
.surface:has(> [data-list-toolbar]) > [data-list-toolbar] [data-slot="multi-select-chip"] {
|
|
175
|
+
background-color: --theme(--color-tint-strong);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/* Grid view: the cards line up flush with the toolbar bar above. The scroll container clips overflow, so it keeps
|
|
179
|
+
room for the card shadow and pulls itself out by the same amount (negative margin) — flush edges, uncut shadows.
|
|
180
|
+
Unlayered so it beats the grid's `p-4`. Room for the full `--surface-shadow` (offset 8 px + blur 24 px) on the sides
|
|
181
|
+
and below. */
|
|
182
|
+
.surface:has([data-entity-grid]) [data-entity-grid] {
|
|
183
|
+
padding-inline: 2rem;
|
|
184
|
+
margin-inline: -2rem;
|
|
185
|
+
padding-bottom: 2.5rem;
|
|
186
|
+
margin-bottom: -2.5rem;
|
|
42
187
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export interface DrawerFooterProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
/** Classes for the content once it sits in the drawer's pinned footer. */
|
|
5
|
+
className?: string;
|
|
6
|
+
/** Classes for the content where it is written, when there is no drawer footer to move into. */
|
|
7
|
+
inlineClassName?: string;
|
|
8
|
+
/** Extra attributes for the inline wrapper (a `data-*` hook for layout CSS). */
|
|
9
|
+
inlineProps?: Record<`data-${string}`, string>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Pins its content (a form's Save and Cancel) to the bottom of the `FormDrawer` it is rendered in; outside a drawer (a page, a dialog opened from the drawer) it renders where it is written.
|
|
13
|
+
*
|
|
14
|
+
* The portalled footer sits outside the `<form>` in the DOM, so every submit button in it is linked back to its form
|
|
15
|
+
* with the `form` attribute: Save, and Enter in a field, still submit the form.
|
|
16
|
+
*/
|
|
17
|
+
export declare const DrawerFooter: ({ children, className, inlineClassName, inlineProps }: DrawerFooterProps) => import("react").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=DrawerFooter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DrawerFooter.d.ts","sourceRoot":"","sources":["../../src/form/DrawerFooter.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAwD,MAAM,OAAO,CAAC;AAK7F,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,SAAS,CAAC;IACpB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gGAAgG;IAChG,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gFAAgF;IAChF,WAAW,CAAC,EAAE,MAAM,CAAC,QAAQ,MAAM,EAAE,EAAE,MAAM,CAAC,CAAC;CAChD;AAOD;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,uDAAuD,iBAAiB,gCAoDpG,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useContext, useId, useLayoutEffect, useRef, useState } from 'react';
|
|
4
|
+
import { createPortal } from 'react-dom';
|
|
5
|
+
import { DrawerFooterSlotContext } from "./drawerSlots.js";
|
|
6
|
+
/**
|
|
7
|
+
* Pins its content (a form's Save and Cancel) to the bottom of the `FormDrawer` it is rendered in; outside a drawer (a page, a dialog opened from the drawer) it renders where it is written.
|
|
8
|
+
*
|
|
9
|
+
* The portalled footer sits outside the `<form>` in the DOM, so every submit button in it is linked back to its form
|
|
10
|
+
* with the `form` attribute: Save, and Enter in a field, still submit the form.
|
|
11
|
+
*/
|
|
12
|
+
export const DrawerFooter = ({ children, className, inlineClassName, inlineProps }) => {
|
|
13
|
+
const slot = useContext(DrawerFooterSlotContext);
|
|
14
|
+
const fallbackFormId = useId();
|
|
15
|
+
const anchorRef = useRef(null);
|
|
16
|
+
const contentRef = useRef(null);
|
|
17
|
+
const [target, setTarget] = useState(null);
|
|
18
|
+
useLayoutEffect(() => {
|
|
19
|
+
const anchor = anchorRef.current;
|
|
20
|
+
// A dialog opened from inside the drawer still sees the drawer's context, but its DOM is portalled to <body>.
|
|
21
|
+
if (!slot || !anchor || !slot.bodyElement.contains(anchor)) {
|
|
22
|
+
setTarget(null);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
setTarget({ footerElement: slot.footerElement, formElement: anchor.closest('form') });
|
|
26
|
+
}, [slot]);
|
|
27
|
+
const formElement = target?.formElement ?? null;
|
|
28
|
+
useLayoutEffect(() => {
|
|
29
|
+
const content = contentRef.current;
|
|
30
|
+
if (!formElement || !content)
|
|
31
|
+
return;
|
|
32
|
+
if (!formElement.id)
|
|
33
|
+
formElement.id = fallbackFormId;
|
|
34
|
+
const linkSubmitButtons = () => {
|
|
35
|
+
for (const button of content.querySelectorAll('button')) {
|
|
36
|
+
if (button.type === 'submit' && !button.hasAttribute('form'))
|
|
37
|
+
button.setAttribute('form', formElement.id);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
linkSubmitButtons();
|
|
41
|
+
const observer = new MutationObserver(linkSubmitButtons);
|
|
42
|
+
observer.observe(content, { childList: true, subtree: true });
|
|
43
|
+
return () => observer.disconnect();
|
|
44
|
+
}, [formElement, fallbackFormId]);
|
|
45
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, hidden: true }), target ? (createPortal(_jsx("div", { ref: contentRef, className: className, children: children }), target.footerElement)) : (_jsx("div", { className: inlineClassName, ...inlineProps, children: children }))] }));
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=DrawerFooter.js.map
|