@cosmicdrift/kumiko-renderer 0.374.0 → 0.378.0
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/README.md +2 -2
- package/dist/app/action-form-support.d.ts +9 -2
- package/dist/app/action-form-support.js +24 -2
- package/dist/app/client-actions.d.ts +2 -2
- package/dist/app/column-renderers.js +1 -1
- package/dist/app/config-edit-shim.js +1 -1
- package/dist/app/content-preview.js +1 -6
- package/dist/app/custom-screens.js +1 -1
- package/dist/app/dashboard-body.d.ts +1 -1
- package/dist/app/entity-list-expanded-row.d.ts +1 -1
- package/dist/app/form-schema.d.ts +1 -1
- package/dist/app/form-schema.js +2 -2
- package/dist/app/kumiko-screen.d.ts +1 -1
- package/dist/app/kumiko-screen.js +10 -7
- package/dist/app/list-empty-content.d.ts +1 -1
- package/dist/app/list-facets.d.ts +1 -1
- package/dist/app/nav.js +2 -2
- package/dist/app/query-state-banners.d.ts +1 -1
- package/dist/app/reference-link.d.ts +1 -1
- package/dist/app/row-actions.d.ts +1 -1
- package/dist/app/secret-mint-body.d.ts +1 -1
- package/dist/app/secrets-edit-body.d.ts +1 -1
- package/dist/app/use-record-actions.d.ts +1 -1
- package/dist/app/write-failed-error.d.ts +1 -1
- package/dist/components/availability-options-select.d.ts +1 -1
- package/dist/components/embedded-list-field.d.ts +1 -1
- package/dist/components/embedded-list-field.js +1 -1
- package/dist/components/file-list-field.d.ts +1 -1
- package/dist/components/form-derivation-patch.d.ts +8 -0
- package/dist/components/form-derivation-patch.js +24 -0
- package/dist/components/form-screen-layout.d.ts +13 -0
- package/dist/components/form-screen-layout.js +13 -0
- package/dist/components/grid-cell-for-field.d.ts +1 -1
- package/dist/components/multi-select-checkboxes.d.ts +1 -1
- package/dist/components/multi-select-checkboxes.js +1 -1
- package/dist/components/query-options-select.d.ts +1 -1
- package/dist/components/related-list-section.d.ts +1 -1
- package/dist/components/render-edit-logic.d.ts +1 -1
- package/dist/components/render-edit-types.d.ts +6 -3
- package/dist/components/render-edit.d.ts +1 -1
- package/dist/components/render-edit.js +18 -3
- package/dist/components/render-field.d.ts +1 -1
- package/dist/components/render-field.js +12 -2
- package/dist/components/render-list.d.ts +1 -1
- package/dist/components/render-list.js +20 -4
- package/dist/components/write-form-section.d.ts +1 -1
- package/dist/components/write-form-section.js +1 -1
- package/dist/context/dispatcher-context.d.ts +1 -1
- package/dist/file-ids-of.d.ts +1 -0
- package/dist/file-ids-of.js +7 -0
- package/dist/flow-diagram/icons.d.ts +3 -0
- package/dist/flow-diagram/icons.js +14 -0
- package/dist/flow-diagram/index.d.ts +2 -0
- package/dist/flow-diagram/index.js +1 -0
- package/dist/flow-diagram/render.d.ts +3 -0
- package/dist/flow-diagram/render.js +234 -0
- package/dist/flow-diagram/types.d.ts +18 -0
- package/dist/flow-diagram/types.js +1 -0
- package/dist/format-when.js +1 -1
- package/dist/headless/apex/css.d.ts +3 -0
- package/dist/headless/apex/css.js +298 -0
- package/dist/headless/apex/index.d.ts +236 -0
- package/dist/headless/apex/index.js +377 -0
- package/dist/headless/apex/lightbox.d.ts +4 -0
- package/dist/headless/apex/lightbox.js +81 -0
- package/dist/headless/contracts/asset.d.ts +15 -0
- package/dist/headless/contracts/asset.js +17 -0
- package/dist/headless/contracts/index.d.ts +3 -0
- package/dist/headless/contracts/index.js +1 -0
- package/dist/headless/contracts/locale.d.ts +7 -0
- package/dist/headless/contracts/locale.js +11 -0
- package/dist/headless/contracts/primitives.d.ts +93 -0
- package/dist/headless/contracts/primitives.js +21 -0
- package/dist/headless/dispatcher/index.d.ts +2 -0
- package/dist/headless/dispatcher/index.js +1 -0
- package/dist/headless/dispatcher/types.d.ts +86 -0
- package/dist/headless/dispatcher/types.js +34 -0
- package/dist/headless/form/form-controller.d.ts +2 -0
- package/dist/headless/form/form-controller.js +409 -0
- package/dist/headless/form/index.d.ts +3 -0
- package/dist/headless/form/index.js +2 -0
- package/dist/headless/form/types.d.ts +76 -0
- package/dist/headless/form/types.js +1 -0
- package/dist/headless/form/zod-bridge.d.ts +10 -0
- package/dist/headless/form/zod-bridge.js +103 -0
- package/dist/headless/format/document-values.d.ts +12 -0
- package/dist/headless/format/document-values.js +70 -0
- package/dist/headless/format/escape.d.ts +5 -0
- package/dist/headless/format/escape.js +75 -0
- package/dist/headless/format/html-template.d.ts +9 -0
- package/dist/headless/format/html-template.js +39 -0
- package/dist/headless/format/index.d.ts +12 -0
- package/dist/headless/format/index.js +237 -0
- package/dist/headless/format/money.d.ts +3 -0
- package/dist/headless/format/money.js +39 -0
- package/dist/headless/index.d.ts +14 -0
- package/dist/headless/index.js +9 -0
- package/dist/headless/locale-routing/index.d.ts +41 -0
- package/dist/headless/locale-routing/index.js +145 -0
- package/dist/headless/nav/index.d.ts +2 -0
- package/dist/headless/nav/index.js +1 -0
- package/dist/headless/nav/resolve.d.ts +2 -0
- package/dist/headless/nav/resolve.js +71 -0
- package/dist/headless/nav/types.d.ts +26 -0
- package/dist/headless/nav/types.js +1 -0
- package/dist/headless/store/create-store.d.ts +2 -0
- package/dist/headless/store/create-store.js +43 -0
- package/dist/headless/store/equality.d.ts +1 -0
- package/dist/headless/store/equality.js +34 -0
- package/dist/headless/store/index.d.ts +3 -0
- package/dist/headless/store/index.js +2 -0
- package/dist/headless/store/types.d.ts +7 -0
- package/dist/headless/store/types.js +10 -0
- package/dist/headless/view-model/edit.d.ts +21 -0
- package/dist/headless/view-model/edit.js +512 -0
- package/dist/headless/view-model/embedded-list.d.ts +27 -0
- package/dist/headless/view-model/embedded-list.js +63 -0
- package/dist/headless/view-model/index.d.ts +7 -0
- package/dist/headless/view-model/index.js +3 -0
- package/dist/headless/view-model/list-file-display.d.ts +3 -0
- package/dist/headless/view-model/list-file-display.js +27 -0
- package/dist/headless/view-model/list.d.ts +16 -0
- package/dist/headless/view-model/list.js +229 -0
- package/dist/headless/view-model/types.d.ts +382 -0
- package/dist/headless/view-model/types.js +1 -0
- package/dist/hooks/use-ai-text.d.ts +1 -1
- package/dist/hooks/use-form.d.ts +1 -1
- package/dist/hooks/use-form.js +1 -1
- package/dist/hooks/use-mutation.d.ts +1 -1
- package/dist/hooks/use-query.d.ts +1 -1
- package/dist/hooks/use-store.d.ts +1 -1
- package/dist/hooks/use-store.js +7 -7
- package/dist/hooks/use-stream-handler.d.ts +1 -1
- package/dist/i18n-defaults.js +6 -0
- package/dist/i18n.d.ts +1 -1
- package/dist/i18n.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +5 -4
- package/dist/live/csrf.d.ts +2 -0
- package/dist/live/csrf.js +60 -0
- package/dist/live/dispatcher-live.d.ts +7 -0
- package/dist/live/dispatcher-live.js +286 -0
- package/dist/live/envelopes.d.ts +101 -0
- package/dist/live/envelopes.js +35 -0
- package/dist/live/error-mapping.d.ts +16 -0
- package/dist/live/error-mapping.js +82 -0
- package/dist/live/index.d.ts +7 -0
- package/dist/live/index.js +5 -0
- package/dist/live/locale.d.ts +2 -0
- package/dist/live/locale.js +25 -0
- package/dist/live/sse-stream.d.ts +14 -0
- package/dist/live/sse-stream.js +128 -0
- package/dist/primitives.d.ts +45 -36
- package/dist/primitives.js +1 -1
- package/dist/session/session-ended.d.ts +1 -1
- package/dist/tokens.d.ts +3 -4
- package/dist/tokens.js +4 -5
- package/dist/web/app/app-schema-boot.d.ts +19 -0
- package/dist/web/app/app-schema-boot.js +124 -0
- package/dist/web/app/browser-locale.d.ts +22 -0
- package/dist/web/app/browser-locale.js +78 -0
- package/dist/web/app/client-plugin.d.ts +106 -0
- package/dist/web/app/client-plugin.js +12 -0
- package/dist/web/app/create-app.d.ts +104 -0
- package/dist/web/app/create-app.js +498 -0
- package/dist/web/app/create-public-surface.d.ts +36 -0
- package/dist/web/app/create-public-surface.js +40 -0
- package/dist/web/app/dashboard-body.d.ts +3 -0
- package/dist/web/app/dashboard-body.js +865 -0
- package/dist/web/app/dashboard-refresh.d.ts +6 -0
- package/dist/web/app/dashboard-refresh.js +15 -0
- package/dist/web/app/document-lang-sync.d.ts +4 -0
- package/dist/web/app/document-lang-sync.js +27 -0
- package/dist/web/app/draft-storage.d.ts +11 -0
- package/dist/web/app/draft-storage.js +53 -0
- package/dist/web/app/nav-providers-context.d.ts +13 -0
- package/dist/web/app/nav-providers-context.js +18 -0
- package/dist/web/app/nav.d.ts +40 -0
- package/dist/web/app/nav.js +231 -0
- package/dist/web/app/plain-content-editor.d.ts +3 -0
- package/dist/web/app/plain-content-editor.js +30 -0
- package/dist/web/app/relative-time.d.ts +10 -0
- package/dist/web/app/relative-time.js +56 -0
- package/dist/web/app/resolvers-context.d.ts +12 -0
- package/dist/web/app/resolvers-context.js +10 -0
- package/dist/web/app/rich-content-editor.d.ts +3 -0
- package/dist/web/app/rich-content-editor.js +15 -0
- package/dist/web/app/root-error-fallback.d.ts +2 -0
- package/dist/web/app/root-error-fallback.js +21 -0
- package/dist/web/app/screen-error-fallback.d.ts +6 -0
- package/dist/web/app/screen-error-fallback.js +17 -0
- package/dist/web/app/tiptap-editor.d.ts +3 -0
- package/dist/web/app/tiptap-editor.js +120 -0
- package/dist/web/app/toast-action-notifier.d.ts +5 -0
- package/dist/web/app/toast-action-notifier.js +17 -0
- package/dist/web/components/config-cascade.d.ts +13 -0
- package/dist/web/components/config-cascade.js +155 -0
- package/dist/web/components/config-source-badge.d.ts +6 -0
- package/dist/web/components/config-source-badge.js +55 -0
- package/dist/web/default-color-scheme.d.ts +2 -0
- package/dist/web/default-color-scheme.js +3 -0
- package/dist/web/icons.d.ts +94 -0
- package/dist/web/icons.js +100 -0
- package/dist/web/index.d.ts +78 -0
- package/dist/web/index.js +53 -0
- package/dist/web/layout/app-layout.d.ts +21 -0
- package/dist/web/layout/app-layout.js +8 -0
- package/dist/web/layout/avatar.d.ts +12 -0
- package/dist/web/layout/avatar.js +63 -0
- package/dist/web/layout/default-app-shell.d.ts +41 -0
- package/dist/web/layout/default-app-shell.js +16 -0
- package/dist/web/layout/editor-panel.d.ts +10 -0
- package/dist/web/layout/editor-panel.js +29 -0
- package/dist/web/layout/fill-classes.d.ts +9 -0
- package/dist/web/layout/fill-classes.js +15 -0
- package/dist/web/layout/filter-app-schema-navs.d.ts +7 -0
- package/dist/web/layout/filter-app-schema-navs.js +68 -0
- package/dist/web/layout/header-action-group.d.ts +6 -0
- package/dist/web/layout/header-action-group.js +8 -0
- package/dist/web/layout/header-overflow-menu.d.ts +4 -0
- package/dist/web/layout/header-overflow-menu.js +8 -0
- package/dist/web/layout/language-menu-items.d.ts +8 -0
- package/dist/web/layout/language-menu-items.js +16 -0
- package/dist/web/layout/language-switcher.d.ts +25 -0
- package/dist/web/layout/language-switcher.js +46 -0
- package/dist/web/layout/nav-tree.d.ts +19 -0
- package/dist/web/layout/nav-tree.js +536 -0
- package/dist/web/layout/page-header-slot.d.ts +25 -0
- package/dist/web/layout/page-header-slot.js +50 -0
- package/dist/web/layout/profile-menu.d.ts +13 -0
- package/dist/web/layout/profile-menu.js +6 -0
- package/dist/web/layout/shell-breadcrumb.d.ts +11 -0
- package/dist/web/layout/shell-breadcrumb.js +34 -0
- package/dist/web/layout/shell-header.d.ts +12 -0
- package/dist/web/layout/shell-header.js +159 -0
- package/dist/web/layout/sidebar-brand.d.ts +15 -0
- package/dist/web/layout/sidebar-brand.js +9 -0
- package/dist/web/layout/sidebar-panel.d.ts +41 -0
- package/dist/web/layout/sidebar-panel.js +107 -0
- package/dist/web/layout/sidebar-user.d.ts +8 -0
- package/dist/web/layout/sidebar-user.js +17 -0
- package/dist/web/layout/sidebar.d.ts +17 -0
- package/dist/web/layout/sidebar.js +11 -0
- package/dist/web/layout/target-resolver-stub.d.ts +13 -0
- package/dist/web/layout/target-resolver-stub.js +61 -0
- package/dist/web/layout/target-url.d.ts +12 -0
- package/dist/web/layout/target-url.js +77 -0
- package/dist/web/layout/theme-label.d.ts +15 -0
- package/dist/web/layout/theme-label.js +35 -0
- package/dist/web/layout/theme-menu-item.d.ts +12 -0
- package/dist/web/layout/theme-menu-item.js +16 -0
- package/dist/web/layout/theme-toggle.d.ts +17 -0
- package/dist/web/layout/theme-toggle.js +22 -0
- package/dist/web/layout/topbar.d.ts +8 -0
- package/dist/web/layout/topbar.js +4 -0
- package/dist/web/layout/workspace-shell.d.ts +63 -0
- package/dist/web/layout/workspace-shell.js +220 -0
- package/dist/web/layout/workspace-switcher.d.ts +15 -0
- package/dist/web/layout/workspace-switcher.js +36 -0
- package/dist/web/lib/accept-attr.d.ts +1 -0
- package/dist/web/lib/accept-attr.js +6 -0
- package/dist/web/lib/clamp.d.ts +1 -0
- package/dist/web/lib/clamp.js +3 -0
- package/dist/web/lib/cn.d.ts +6 -0
- package/dist/web/lib/cn.js +9 -0
- package/dist/web/lib/download.d.ts +2 -0
- package/dist/web/lib/download.js +24 -0
- package/dist/web/lib/file-ref-download.d.ts +15 -0
- package/dist/web/lib/file-ref-download.js +62 -0
- package/dist/web/lib/file-upload-form-data.d.ts +7 -0
- package/dist/web/lib/file-upload-form-data.js +11 -0
- package/dist/web/lib/resize-image.d.ts +1 -0
- package/dist/web/lib/resize-image.js +66 -0
- package/dist/web/lib/upload-file-ref.d.ts +9 -0
- package/dist/web/lib/upload-file-ref.js +29 -0
- package/dist/web/primitives/action-menu.d.ts +34 -0
- package/dist/web/primitives/action-menu.js +30 -0
- package/dist/web/primitives/calendar-popover.d.ts +13 -0
- package/dist/web/primitives/calendar-popover.js +76 -0
- package/dist/web/primitives/combobox.d.ts +56 -0
- package/dist/web/primitives/combobox.js +127 -0
- package/dist/web/primitives/date-field.d.ts +18 -0
- package/dist/web/primitives/date-field.js +74 -0
- package/dist/web/primitives/date-input.d.ts +1 -0
- package/dist/web/primitives/date-input.js +5 -0
- package/dist/web/primitives/date-parse.d.ts +11 -0
- package/dist/web/primitives/date-parse.js +159 -0
- package/dist/web/primitives/dialog.d.ts +3 -0
- package/dist/web/primitives/dialog.js +42 -0
- package/dist/web/primitives/drawer.d.ts +3 -0
- package/dist/web/primitives/drawer.js +17 -0
- package/dist/web/primitives/dropdown-menu.d.ts +15 -0
- package/dist/web/primitives/dropdown-menu.js +56 -0
- package/dist/web/primitives/embedded-list-input.d.ts +9 -0
- package/dist/web/primitives/embedded-list-input.js +382 -0
- package/dist/web/primitives/file-thumbnail.d.ts +31 -0
- package/dist/web/primitives/file-thumbnail.js +90 -0
- package/dist/web/primitives/file-upload.d.ts +21 -0
- package/dist/web/primitives/file-upload.js +56 -0
- package/dist/web/primitives/file-value-list.d.ts +3 -0
- package/dist/web/primitives/file-value-list.js +22 -0
- package/dist/web/primitives/index.d.ts +34 -0
- package/dist/web/primitives/index.js +2023 -0
- package/dist/web/primitives/json-view.d.ts +7 -0
- package/dist/web/primitives/json-view.js +84 -0
- package/dist/web/primitives/layout.d.ts +27 -0
- package/dist/web/primitives/layout.js +30 -0
- package/dist/web/primitives/lightbox.d.ts +3 -0
- package/dist/web/primitives/lightbox.js +36 -0
- package/dist/web/primitives/locale-number.d.ts +2 -0
- package/dist/web/primitives/locale-number.js +54 -0
- package/dist/web/primitives/located-timestamp-input.d.ts +22 -0
- package/dist/web/primitives/located-timestamp-input.js +22 -0
- package/dist/web/primitives/metric.d.ts +5 -0
- package/dist/web/primitives/metric.js +18 -0
- package/dist/web/primitives/modal-shell.d.ts +17 -0
- package/dist/web/primitives/modal-shell.js +9 -0
- package/dist/web/primitives/modal.d.ts +3 -0
- package/dist/web/primitives/modal.js +13 -0
- package/dist/web/primitives/money-input.d.ts +18 -0
- package/dist/web/primitives/money-input.js +122 -0
- package/dist/web/primitives/narrow-pinned-footer.d.ts +12 -0
- package/dist/web/primitives/narrow-pinned-footer.js +153 -0
- package/dist/web/primitives/number-input.d.ts +18 -0
- package/dist/web/primitives/number-input.js +53 -0
- package/dist/web/primitives/option-groups.d.ts +11 -0
- package/dist/web/primitives/option-groups.js +27 -0
- package/dist/web/primitives/page-header.d.ts +3 -0
- package/dist/web/primitives/page-header.js +52 -0
- package/dist/web/primitives/promo-panel.d.ts +3 -0
- package/dist/web/primitives/promo-panel.js +11 -0
- package/dist/web/primitives/segmented-select.d.ts +21 -0
- package/dist/web/primitives/segmented-select.js +62 -0
- package/dist/web/primitives/share-actions.d.ts +4 -0
- package/dist/web/primitives/share-actions.js +56 -0
- package/dist/web/primitives/status-badge.d.ts +3 -0
- package/dist/web/primitives/status-badge.js +5 -0
- package/dist/web/primitives/sticky-action-bar.d.ts +5 -0
- package/dist/web/primitives/sticky-action-bar.js +15 -0
- package/dist/web/primitives/tabs.d.ts +3 -0
- package/dist/web/primitives/tabs.js +107 -0
- package/dist/web/primitives/timestamp-input.d.ts +27 -0
- package/dist/web/primitives/timestamp-input.js +87 -0
- package/dist/web/primitives/toast.d.ts +19 -0
- package/dist/web/primitives/toast.js +63 -0
- package/dist/web/primitives/tz-input.d.ts +11 -0
- package/dist/web/primitives/tz-input.js +8 -0
- package/dist/web/primitives/tz-options.d.ts +4 -0
- package/dist/web/primitives/tz-options.js +17 -0
- package/dist/web/primitives/use-keyboard-inset.d.ts +1 -0
- package/dist/web/primitives/use-keyboard-inset.js +28 -0
- package/dist/web/primitives/use-narrow-viewport.d.ts +4 -0
- package/dist/web/primitives/use-narrow-viewport.js +46 -0
- package/dist/web/react-css-custom-properties.d.ts +6 -0
- package/dist/web/react-css-custom-properties.js +1 -0
- package/dist/web/sse/live-events.d.ts +15 -0
- package/dist/web/sse/live-events.js +148 -0
- package/dist/web/theme-plugin.d.ts +41 -0
- package/dist/web/theme-plugin.js +123 -0
- package/dist/web/tokens.d.ts +24 -0
- package/dist/web/tokens.js +203 -0
- package/dist/web/ui/avatar.d.ts +11 -0
- package/dist/web/ui/avatar.js +25 -0
- package/dist/web/ui/badge.d.ts +9 -0
- package/dist/web/ui/badge.js +26 -0
- package/dist/web/ui/breadcrumb.d.ts +11 -0
- package/dist/web/ui/breadcrumb.js +29 -0
- package/dist/web/ui/button.d.ts +10 -0
- package/dist/web/ui/button.js +37 -0
- package/dist/web/ui/checkbox.d.ts +4 -0
- package/dist/web/ui/checkbox.js +11 -0
- package/dist/web/ui/input.d.ts +3 -0
- package/dist/web/ui/input.js +8 -0
- package/dist/web/ui/label.d.ts +4 -0
- package/dist/web/ui/label.js +10 -0
- package/dist/web/ui/resizable.d.ts +7 -0
- package/dist/web/ui/resizable.js +16 -0
- package/dist/web/ui/separator.d.ts +4 -0
- package/dist/web/ui/separator.js +10 -0
- package/dist/web/ui/sheet.d.ts +14 -0
- package/dist/web/ui/sheet.js +42 -0
- package/dist/web/ui/sidebar.d.ts +73 -0
- package/dist/web/ui/sidebar.js +211 -0
- package/dist/web/ui/skeleton.d.ts +2 -0
- package/dist/web/ui/skeleton.js +7 -0
- package/dist/web/ui/switch.d.ts +6 -0
- package/dist/web/ui/switch.js +10 -0
- package/dist/web/ui/table.d.ts +10 -0
- package/dist/web/ui/table.js +30 -0
- package/dist/web/ui/tabs.d.ts +11 -0
- package/dist/web/ui/tabs.js +31 -0
- package/dist/web/ui/textarea.d.ts +3 -0
- package/dist/web/ui/textarea.js +8 -0
- package/dist/web/ui/tooltip.d.ts +7 -0
- package/dist/web/ui/tooltip.js +19 -0
- package/dist/web/ui/use-mobile.d.ts +1 -0
- package/dist/web/ui/use-mobile.js +16 -0
- package/dist/web/version/update-checker.d.ts +9 -0
- package/dist/web/version/update-checker.js +88 -0
- package/dist/web/widgets/ai-text-field.d.ts +36 -0
- package/dist/web/widgets/ai-text-field.js +137 -0
- package/dist/web/widgets/bounded-load-cache.d.ts +1 -0
- package/dist/web/widgets/bounded-load-cache.js +25 -0
- package/dist/web/widgets/chart-window.d.ts +58 -0
- package/dist/web/widgets/chart-window.js +190 -0
- package/dist/web/widgets/charts.d.ts +208 -0
- package/dist/web/widgets/charts.js +685 -0
- package/dist/web/widgets/collapsible-section.d.ts +10 -0
- package/dist/web/widgets/collapsible-section.js +17 -0
- package/dist/web/widgets/dashboard-list.d.ts +21 -0
- package/dist/web/widgets/dashboard-list.js +45 -0
- package/dist/web/widgets/detail-list.d.ts +15 -0
- package/dist/web/widgets/detail-list.js +8 -0
- package/dist/web/widgets/drawer.d.ts +65 -0
- package/dist/web/widgets/drawer.js +177 -0
- package/dist/web/widgets/feed-list.d.ts +13 -0
- package/dist/web/widgets/feed-list.js +9 -0
- package/dist/web/widgets/floating-panel.d.ts +30 -0
- package/dist/web/widgets/floating-panel.js +242 -0
- package/dist/web/widgets/form-fields.d.ts +93 -0
- package/dist/web/widgets/form-fields.js +50 -0
- package/dist/web/widgets/index.d.ts +28 -0
- package/dist/web/widgets/index.js +31 -0
- package/dist/web/widgets/infinity-list.d.ts +46 -0
- package/dist/web/widgets/infinity-list.js +211 -0
- package/dist/web/widgets/mode-switch.d.ts +21 -0
- package/dist/web/widgets/mode-switch.js +25 -0
- package/dist/web/widgets/pdf-preview.d.ts +10 -0
- package/dist/web/widgets/pdf-preview.js +140 -0
- package/dist/web/widgets/photo-slots.d.ts +29 -0
- package/dist/web/widgets/photo-slots.js +52 -0
- package/dist/web/widgets/plan-card.d.ts +36 -0
- package/dist/web/widgets/plan-card.js +13 -0
- package/dist/web/widgets/progress-bar.d.ts +19 -0
- package/dist/web/widgets/progress-bar.js +24 -0
- package/dist/web/widgets/progress-list.d.ts +19 -0
- package/dist/web/widgets/progress-list.js +11 -0
- package/dist/web/widgets/public-shell.d.ts +22 -0
- package/dist/web/widgets/public-shell.js +15 -0
- package/dist/web/widgets/query-table.d.ts +29 -0
- package/dist/web/widgets/query-table.js +30 -0
- package/dist/web/widgets/result-panel.d.ts +69 -0
- package/dist/web/widgets/result-panel.js +30 -0
- package/dist/web/widgets/section-card.d.ts +12 -0
- package/dist/web/widgets/section-card.js +9 -0
- package/dist/web/widgets/sheet-parts.d.ts +9 -0
- package/dist/web/widgets/sheet-parts.js +11 -0
- package/dist/web/widgets/side-by-side-table.d.ts +31 -0
- package/dist/web/widgets/side-by-side-table.js +11 -0
- package/dist/web/widgets/stat.d.ts +54 -0
- package/dist/web/widgets/stat.js +65 -0
- package/dist/web/widgets/states.d.ts +23 -0
- package/dist/web/widgets/states.js +20 -0
- package/dist/web/widgets/status-badge.d.ts +15 -0
- package/dist/web/widgets/status-badge.js +24 -0
- package/dist/web/widgets/step-bar.d.ts +35 -0
- package/dist/web/widgets/step-bar.js +60 -0
- package/dist/web/widgets/upload-zone.d.ts +24 -0
- package/dist/web/widgets/upload-zone.js +108 -0
- package/dist/web/widgets/use-draft.d.ts +20 -0
- package/dist/web/widgets/use-draft.js +21 -0
- package/dist/web/widgets/use-pointer-drag.d.ts +21 -0
- package/dist/web/widgets/use-pointer-drag.js +53 -0
- package/package.json +114 -7
- package/src/changes.json +92 -0
- package/src/web/fonts/OFL.txt +93 -0
- package/src/web/fonts/ibm-plex-mono-latin-400.woff2 +0 -0
- package/src/web/fonts/ibm-plex-mono-latin-500.woff2 +0 -0
- package/src/web/fonts/ibm-plex-mono-latin-ext-400.woff2 +0 -0
- package/src/web/fonts/ibm-plex-mono-latin-ext-500.woff2 +0 -0
- package/src/web/fonts/ibm-plex-sans-latin-400.woff2 +0 -0
- package/src/web/fonts/ibm-plex-sans-latin-500.woff2 +0 -0
- package/src/web/fonts/ibm-plex-sans-latin-600.woff2 +0 -0
- package/src/web/fonts/ibm-plex-sans-latin-ext-400.woff2 +0 -0
- package/src/web/fonts/ibm-plex-sans-latin-ext-500.woff2 +0 -0
- package/src/web/fonts/ibm-plex-sans-latin-ext-600.woff2 +0 -0
- package/src/web/styles.css +405 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
// Shared date parse/format utils for the web date primitives (DateInput,
|
|
2
|
+
// TimestampInput). PlainDate semantics: pure calendar date, no timezone
|
|
3
|
+
// conversion — "2026-04-25" stays the 25th regardless of the browser's
|
|
4
|
+
// zone. TZ/wall-clock conversion for timestamp fields deliberately stays
|
|
5
|
+
// in timestamp-input.tsx (wire boundary, own test); this file is pure
|
|
6
|
+
// calendar date.
|
|
7
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
8
|
+
// Prefer the native Temporal (Chromium 144+/Firefox 139+) over the bundled
|
|
9
|
+
// polyfill so `instanceof` checks match values crossing package boundaries;
|
|
10
|
+
// falls back to the polyfill where native support is absent.
|
|
11
|
+
// Callers must not feed parseIso()/makePlainDate results into polyfill-only
|
|
12
|
+
// Statics (compare/equals/since) — mixed Temporal brands throw TypeError.
|
|
13
|
+
function activeTemporal() {
|
|
14
|
+
return globalThis.Temporal ?? Temporal;
|
|
15
|
+
}
|
|
16
|
+
export function guessLocale() {
|
|
17
|
+
if (typeof navigator !== "undefined" && navigator.language)
|
|
18
|
+
return navigator.language;
|
|
19
|
+
return "en-US";
|
|
20
|
+
}
|
|
21
|
+
// overflow:"reject" throws on overflow (Feb 31 → RangeError) instead of
|
|
22
|
+
// silently rolling it forward — typed dates should not silently shift to
|
|
23
|
+
// a different date.
|
|
24
|
+
function makePlainDate(y, m, d) {
|
|
25
|
+
try {
|
|
26
|
+
return activeTemporal().PlainDate.from({ year: y, month: m, day: d }, { overflow: "reject" });
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export function parseIso(v) {
|
|
33
|
+
if (v === "")
|
|
34
|
+
return undefined;
|
|
35
|
+
const parts = v.split("-");
|
|
36
|
+
if (parts.length !== 3)
|
|
37
|
+
return undefined;
|
|
38
|
+
const [y, m, d] = parts.map(Number);
|
|
39
|
+
if (y === undefined ||
|
|
40
|
+
m === undefined ||
|
|
41
|
+
d === undefined ||
|
|
42
|
+
Number.isNaN(y) ||
|
|
43
|
+
Number.isNaN(m) ||
|
|
44
|
+
Number.isNaN(d) ||
|
|
45
|
+
// Reject 2-digit years — matches the pre-PlainDate behavior where
|
|
46
|
+
// `new Date`'s 1900+y quirk made a round-trip check fail on them.
|
|
47
|
+
y < 100 ||
|
|
48
|
+
// Reject years outside 0000-9999 — Temporal.toString() switches to the
|
|
49
|
+
// signed extended ISO format above that range (e.g. "+010000-04-25"),
|
|
50
|
+
// breaking the "unchanged ISO string" wire contract (toIso below).
|
|
51
|
+
y > 9999) {
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
return makePlainDate(y, m, d);
|
|
55
|
+
}
|
|
56
|
+
export function toIso(d) {
|
|
57
|
+
// calendarName: "never" — a non-ISO PlainDate (e.g. from a future
|
|
58
|
+
// PlainDate.from with a `[u-ca=...]` suffix) would otherwise append the
|
|
59
|
+
// calendar annotation to the wire string.
|
|
60
|
+
return d.toString({ calendarName: "never" });
|
|
61
|
+
}
|
|
62
|
+
// Editable, re-parseable display (numeric locale format, e.g. de
|
|
63
|
+
// "25.04.2026", en-US "04/25/2026"). Deliberately NOT month:"long" — the
|
|
64
|
+
// user should be able to overwrite the displayed text directly.
|
|
65
|
+
export function formatDateForInput(d, locale) {
|
|
66
|
+
return d.toLocaleString(locale, { year: "numeric", month: "2-digit", day: "2-digit" });
|
|
67
|
+
}
|
|
68
|
+
// Shared by localeDateOrder and formatDatePlaceholder — both need the
|
|
69
|
+
// locale's numeric formatToParts breakdown of the same reference date.
|
|
70
|
+
// epoch-millis input instead of a Date object (guard-compliant); timeZone:
|
|
71
|
+
// "UTC" keeps the reference from shifting to the 1st depending on the
|
|
72
|
+
// browser's TZ.
|
|
73
|
+
function localeDateParts(locale) {
|
|
74
|
+
const refEpochMillis = activeTemporal()
|
|
75
|
+
.PlainDate.from({ year: 2026, month: 1, day: 2 })
|
|
76
|
+
.toZonedDateTime("UTC").epochMilliseconds;
|
|
77
|
+
return new Intl.DateTimeFormat(locale, {
|
|
78
|
+
timeZone: "UTC",
|
|
79
|
+
year: "numeric",
|
|
80
|
+
month: "2-digit",
|
|
81
|
+
day: "2-digit",
|
|
82
|
+
}).formatToParts(refEpochMillis);
|
|
83
|
+
}
|
|
84
|
+
// Field order of the numeric locale format. de → [d,m,y], en-US →
|
|
85
|
+
// [m,d,y], ISO-like locales → [y,m,d].
|
|
86
|
+
function localeDateOrder(locale) {
|
|
87
|
+
const order = [];
|
|
88
|
+
for (const part of localeDateParts(locale)) {
|
|
89
|
+
if (part.type === "year")
|
|
90
|
+
order.push("y");
|
|
91
|
+
else if (part.type === "month")
|
|
92
|
+
order.push("m");
|
|
93
|
+
else if (part.type === "day")
|
|
94
|
+
order.push("d");
|
|
95
|
+
}
|
|
96
|
+
return order;
|
|
97
|
+
}
|
|
98
|
+
// Locale-shaped placeholder pattern, e.g. de "TT.MM.JJJJ", en-US
|
|
99
|
+
// "MM/DD/YYYY", en-GB "DD/MM/YYYY". Slot order and separator both come
|
|
100
|
+
// from formatToParts — nothing hardcoded per locale. `letters` is one
|
|
101
|
+
// character per slot (from i18n); repeated to the slot's digit count
|
|
102
|
+
// (day/month 2, year 4).
|
|
103
|
+
// Clamps each slot letter to its first code point — `letters` normally comes
|
|
104
|
+
// from i18n and can fall back to the raw, multi-character translation key
|
|
105
|
+
// when a lookup misses, which would otherwise blow up the placeholder length.
|
|
106
|
+
function firstCodePoint(s) {
|
|
107
|
+
return [...s][0] ?? "?";
|
|
108
|
+
}
|
|
109
|
+
export function formatDatePlaceholder(locale, letters) {
|
|
110
|
+
return localeDateParts(locale)
|
|
111
|
+
.map((part) => {
|
|
112
|
+
if (part.type === "year")
|
|
113
|
+
return firstCodePoint(letters.year).repeat(4);
|
|
114
|
+
if (part.type === "month")
|
|
115
|
+
return firstCodePoint(letters.month).repeat(2);
|
|
116
|
+
if (part.type === "day")
|
|
117
|
+
return firstCodePoint(letters.day).repeat(2);
|
|
118
|
+
return part.value;
|
|
119
|
+
})
|
|
120
|
+
.join("");
|
|
121
|
+
}
|
|
122
|
+
// Typed input → PlainDate. Accepts ISO (yyyy-mm-dd) directly, plus three
|
|
123
|
+
// numeric tokens in locale order with any separator (".", "/", "-", " ").
|
|
124
|
+
// Two-digit years → 2000s. Partial/invalid input → undefined (caller
|
|
125
|
+
// keeps the raw text then, commits nothing).
|
|
126
|
+
export function parseTypedDate(input, locale) {
|
|
127
|
+
const trimmed = input.trim();
|
|
128
|
+
if (trimmed === "")
|
|
129
|
+
return undefined;
|
|
130
|
+
const iso = parseIso(trimmed);
|
|
131
|
+
if (iso !== undefined)
|
|
132
|
+
return iso;
|
|
133
|
+
const tokens = trimmed.split(/\D+/).filter((t) => t !== "");
|
|
134
|
+
if (tokens.length !== 3)
|
|
135
|
+
return undefined;
|
|
136
|
+
const nums = tokens.map(Number);
|
|
137
|
+
if (nums.some(Number.isNaN))
|
|
138
|
+
return undefined;
|
|
139
|
+
const order = localeDateOrder(locale);
|
|
140
|
+
if (order.length !== 3)
|
|
141
|
+
return undefined;
|
|
142
|
+
let y = 0;
|
|
143
|
+
let m = 0;
|
|
144
|
+
let d = 0;
|
|
145
|
+
order.forEach((slot, i) => {
|
|
146
|
+
const val = nums[i] ?? 0;
|
|
147
|
+
if (slot === "y")
|
|
148
|
+
y = val;
|
|
149
|
+
else if (slot === "m")
|
|
150
|
+
m = val;
|
|
151
|
+
else
|
|
152
|
+
d = val;
|
|
153
|
+
});
|
|
154
|
+
if (y < 100)
|
|
155
|
+
y += 2000;
|
|
156
|
+
if (y > 9999)
|
|
157
|
+
return undefined;
|
|
158
|
+
return makePlainDate(y, m, d);
|
|
159
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { DialogProps } from "../../index.ts";
|
|
3
|
+
export declare function DefaultDialog({ open, onOpenChange, title, description, confirmLabel, cancelLabel, variant, initialFocus, onConfirm, children, testId, }: DialogProps): ReactNode;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Confirm dialog built on ModalShell. Cancel is always secondary; async
|
|
3
|
+
// onConfirm shows a spinner on the confirm button until the promise settles.
|
|
4
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
5
|
+
import { Loader2 } from "lucide-react";
|
|
6
|
+
import { useRef, useState } from "react";
|
|
7
|
+
import { useTranslation } from "../../index.js";
|
|
8
|
+
import { cn } from "../lib/cn.js";
|
|
9
|
+
import { ModalShell } from "./modal-shell.js";
|
|
10
|
+
export function DefaultDialog({ open, onOpenChange, title, description, confirmLabel, cancelLabel, variant = "default", initialFocus, onConfirm, children, testId, }) {
|
|
11
|
+
const t = useTranslation();
|
|
12
|
+
const [loading, setLoading] = useState(false);
|
|
13
|
+
const confirmButtonRef = useRef(null);
|
|
14
|
+
const cancelButtonRef = useRef(null);
|
|
15
|
+
// A danger dialog defaults to the safe choice, so a reflexive Enter cannot run a destructive action.
|
|
16
|
+
const defaultFocus = variant === "danger" ? "cancel" : "confirm";
|
|
17
|
+
const focusTarget = initialFocus ?? (children === undefined ? defaultFocus : undefined);
|
|
18
|
+
const effectiveConfirmLabel = confirmLabel ?? t("kumiko.dialog.confirm");
|
|
19
|
+
const effectiveCancelLabel = cancelLabel ?? t("kumiko.dialog.cancel");
|
|
20
|
+
async function handleConfirm() {
|
|
21
|
+
setLoading(true);
|
|
22
|
+
try {
|
|
23
|
+
await onConfirm();
|
|
24
|
+
}
|
|
25
|
+
finally {
|
|
26
|
+
setLoading(false);
|
|
27
|
+
onOpenChange(false);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const isDanger = variant === "danger";
|
|
31
|
+
const confirmClass = isDanger
|
|
32
|
+
? "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90"
|
|
33
|
+
: "bg-primary text-primary-foreground shadow hover:bg-primary/90";
|
|
34
|
+
return (_jsxs(ModalShell, { open: open, onOpenChange: onOpenChange, testId: testId, closeLabel: t("kumiko.dialog.close"), noAriaDescription: description === undefined, contentClassName: cn("grid w-full max-w-lg gap-4 border bg-card p-6 shadow-lg rounded-lg"), ...(focusTarget !== undefined && {
|
|
35
|
+
// Radix's default initial focus lands on the first focusable in DOM
|
|
36
|
+
// order, which is Cancel for a bare dialog.
|
|
37
|
+
onOpenAutoFocus: (event) => {
|
|
38
|
+
event.preventDefault();
|
|
39
|
+
(focusTarget === "cancel" ? cancelButtonRef : confirmButtonRef).current?.focus();
|
|
40
|
+
},
|
|
41
|
+
}), children: [_jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx(DialogPrimitive.Title, { className: "text-lg font-semibold tracking-tight", children: title }), description !== undefined && (_jsx(DialogPrimitive.Description, { className: "text-sm text-muted-foreground", children: description }))] }), children !== undefined && _jsx("div", { children: children }), _jsxs("div", { className: "flex items-center justify-end gap-2", children: [_jsx(DialogPrimitive.Close, { asChild: true, children: _jsx("button", { ref: cancelButtonRef, type: "button", disabled: loading, "data-testid": testId !== undefined ? `${testId}-cancel` : undefined, className: "inline-flex h-9 items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium shadow-sm hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50", children: effectiveCancelLabel }) }), _jsxs("button", { ref: confirmButtonRef, type: "button", onClick: () => void handleConfirm(), disabled: loading, "data-testid": testId !== undefined ? `${testId}-confirm` : undefined, className: cn("inline-flex h-9 items-center justify-center gap-2 rounded-md px-4 py-2 text-sm font-medium", "disabled:pointer-events-none disabled:opacity-50", confirmClass), children: [loading && _jsx(Loader2, { className: "size-4 animate-spin", "aria-hidden": "true" }), effectiveConfirmLabel] })] })] }));
|
|
42
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Bare content shell for hosting self-contained widgets (own submit/cancel
|
|
3
|
+
// buttons) in a slide-in side panel — same "no footer buttons of its own"
|
|
4
|
+
// contract as DefaultModal, delegating to the richer widgets/drawer.tsx
|
|
5
|
+
// Drawer (resize/backdrop/side are widget-only concerns, not exposed
|
|
6
|
+
// through the platform-neutral CorePrimitives.Drawer contract).
|
|
7
|
+
import { XIcon } from "lucide-react";
|
|
8
|
+
import { useTranslation } from "../../index.js";
|
|
9
|
+
import { SheetTitle } from "../ui/sheet.js";
|
|
10
|
+
import { Drawer } from "../widgets/drawer.js";
|
|
11
|
+
const DRAWER_WIDTH_PX = 480;
|
|
12
|
+
const DRAWER_DIM_PERCENT = 32;
|
|
13
|
+
const PANEL_CLASS = "bg-card border-border-strong shadow-[-12px_0_32px_rgb(0_0_0/0.14)]";
|
|
14
|
+
export function DefaultDrawer({ open, onOpenChange, title, subtitle, children, testId, }) {
|
|
15
|
+
const t = useTranslation();
|
|
16
|
+
return (_jsxs(Drawer, { open: open, onOpenChange: onOpenChange, testId: testId, variant: "flush", side: "right", width: DRAWER_WIDTH_PX, backdrop: { dimPercent: DRAWER_DIM_PERCENT }, showCloseButton: false, panelClassName: PANEL_CLASS, fillBody: true, children: [_jsxs("div", { "data-testid": testId !== undefined ? `${testId}-header` : undefined, className: "flex min-h-14 shrink-0 items-center gap-3 border-b border-border py-2 pr-3 pl-6", children: [_jsxs("div", { className: "flex min-w-0 flex-1 flex-col", children: [_jsx(SheetTitle, { className: "text-base font-semibold", children: title ?? "" }), subtitle !== undefined && (_jsx("p", { "data-testid": testId !== undefined ? `${testId}-subtitle` : undefined, className: "text-sm text-muted-foreground", children: subtitle }))] }), _jsx("button", { type: "button", "aria-label": t("kumiko.dialog.close"), onClick: () => onOpenChange(false), className: "flex size-8 items-center justify-center rounded-md text-foreground-secondary hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-hidden", children: _jsx(XIcon, { className: "size-4" }) })] }), _jsx("div", { "data-testid": testId !== undefined ? `${testId}-body` : undefined, onSubmit: (e) => e.stopPropagation(), className: "flex min-h-0 flex-1 flex-col", children: children })] }));
|
|
17
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as Primitive from "@radix-ui/react-dropdown-menu";
|
|
2
|
+
import type { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
3
|
+
export declare const DropdownMenu: import("react").FC<Primitive.DropdownMenuProps>;
|
|
4
|
+
export declare const DropdownMenuTrigger: import("react").ForwardRefExoticComponent<Primitive.DropdownMenuTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
export declare const DropdownMenuPortal: import("react").FC<Primitive.DropdownMenuPortalProps>;
|
|
6
|
+
export declare function DropdownMenuContent({ className, sideOffset, portalContainer, ...props }: ComponentPropsWithoutRef<typeof Primitive.Content> & {
|
|
7
|
+
/** Mount point of the portal. Default: document.body, which sits outside every landmark. */
|
|
8
|
+
readonly portalContainer?: HTMLElement | null;
|
|
9
|
+
}): ReactNode;
|
|
10
|
+
export declare function DropdownMenuItem({ className, ...props }: ComponentPropsWithoutRef<typeof Primitive.Item>): ReactNode;
|
|
11
|
+
export declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: ComponentPropsWithoutRef<typeof Primitive.CheckboxItem>): ReactNode;
|
|
12
|
+
export declare const DropdownMenuRadioGroup: import("react").ForwardRefExoticComponent<Primitive.DropdownMenuRadioGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export declare function DropdownMenuRadioItem({ className, children, ...props }: ComponentPropsWithoutRef<typeof Primitive.RadioItem>): ReactNode;
|
|
14
|
+
export declare function DropdownMenuLabel({ className, ...props }: ComponentPropsWithoutRef<typeof Primitive.Label>): ReactNode;
|
|
15
|
+
export declare function DropdownMenuSeparator({ className, ...props }: ComponentPropsWithoutRef<typeof Primitive.Separator>): ReactNode;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// shadcn-style DropdownMenu auf Radix-Basis. Wrappers um
|
|
3
|
+
// @radix-ui/react-dropdown-menu mit den Tailwind-Token-Klassen die
|
|
4
|
+
// die anderen Primitives auch nutzen — Trigger-Button-Look kommt vom
|
|
5
|
+
// Caller (asChild-Pattern), wir liefern nur Content/Item/Label/
|
|
6
|
+
// Separator/CheckboxItem mit konsistenter Optik.
|
|
7
|
+
//
|
|
8
|
+
// Vorteile gegenüber dem self-rolled useDropdownMenu-Hook:
|
|
9
|
+
// - Click-outside, Escape, Focus-Trap, Roving-Tabindex, ARIA-Roles,
|
|
10
|
+
// Pointer-vs-Keyboard-Subtleties — alles geschenkt von Radix.
|
|
11
|
+
// - Portal'd Content rendert über Stacking-Context-Grenzen (nützlich
|
|
12
|
+
// in Dialogs/Popovers).
|
|
13
|
+
// - Keyboard-Nav (↑↓ + Home/End) funktioniert von Haus aus.
|
|
14
|
+
import * as Primitive from "@radix-ui/react-dropdown-menu";
|
|
15
|
+
import { Check } from "lucide-react";
|
|
16
|
+
import { cn } from "../lib/cn.js";
|
|
17
|
+
export const DropdownMenu = Primitive.Root;
|
|
18
|
+
export const DropdownMenuTrigger = Primitive.Trigger;
|
|
19
|
+
export const DropdownMenuPortal = Primitive.Portal;
|
|
20
|
+
const contentClass = "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 " +
|
|
21
|
+
"text-popover-foreground shadow-md " +
|
|
22
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out " +
|
|
23
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 " +
|
|
24
|
+
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 " +
|
|
25
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2";
|
|
26
|
+
export function DropdownMenuContent({ className, sideOffset = 4, portalContainer, ...props }) {
|
|
27
|
+
return (_jsx(Primitive.Portal, { container: portalContainer, children: _jsx(Primitive.Content, { sideOffset: sideOffset, className: cn(contentClass, className), ...props }) }));
|
|
28
|
+
}
|
|
29
|
+
const itemClass = "relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm " +
|
|
30
|
+
"outline-none transition-colors " +
|
|
31
|
+
"focus:bg-accent focus:text-accent-foreground " +
|
|
32
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50";
|
|
33
|
+
export function DropdownMenuItem({ className, ...props }) {
|
|
34
|
+
return _jsx(Primitive.Item, { className: cn(itemClass, className), ...props });
|
|
35
|
+
}
|
|
36
|
+
// CheckboxItem mit Check-Icon links — für "ausgewählter Eintrag in
|
|
37
|
+
// einer Liste"-Patterns (TenantSwitcher, LanguageSwitcher). Radix
|
|
38
|
+
// rendert <ItemIndicator> nur wenn checked=true, kein eigener Branch
|
|
39
|
+
// nötig.
|
|
40
|
+
export function DropdownMenuCheckboxItem({ className, children, checked, ...props }) {
|
|
41
|
+
return (_jsxs(Primitive.CheckboxItem, { checked: checked, className: cn(itemClass, "pl-8 pr-2", className), ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(Primitive.ItemIndicator, { children: _jsx(Check, { className: "h-3.5 w-3.5" }) }) }), children] }));
|
|
42
|
+
}
|
|
43
|
+
export const DropdownMenuRadioGroup = Primitive.RadioGroup;
|
|
44
|
+
// RadioItem with a dot indicator on the left — for exclusive single-choice
|
|
45
|
+
// selection (e.g. WorkspaceSwitcher). Unlike CheckboxItem, Radix renders
|
|
46
|
+
// role="menuitemradio" + aria-checked here instead of role="menuitemcheckbox",
|
|
47
|
+
// which announces "one of several" to screen readers instead of "on/off".
|
|
48
|
+
export function DropdownMenuRadioItem({ className, children, ...props }) {
|
|
49
|
+
return (_jsxs(Primitive.RadioItem, { className: cn(itemClass, "pl-8 pr-2", className), ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(Primitive.ItemIndicator, { children: _jsx(Check, { className: "h-3.5 w-3.5" }) }) }), children] }));
|
|
50
|
+
}
|
|
51
|
+
export function DropdownMenuLabel({ className, ...props }) {
|
|
52
|
+
return (_jsx(Primitive.Label, { className: cn("px-2 py-1.5 text-xs text-muted-foreground", className), ...props }));
|
|
53
|
+
}
|
|
54
|
+
export function DropdownMenuSeparator({ className, ...props }) {
|
|
55
|
+
return _jsx(Primitive.Separator, { className: cn("-mx-1 my-1 h-px bg-border", className), ...props });
|
|
56
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { EmbeddedListInputProps } from "../../index.ts";
|
|
3
|
+
type ScrollAffordance = {
|
|
4
|
+
readonly canScrollLeft: boolean;
|
|
5
|
+
readonly canScrollRight: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare function computeScrollAffordance(scrollLeft: number, scrollWidth: number, clientWidth: number): ScrollAffordance;
|
|
8
|
+
export declare function EmbeddedListInput({ id, columns, rows, totals, currency, disabled, fixedRows, minItems, maxItems, listIssues, rowIssues, cellIssues, onCellChange, onAddRow, onRemoveRow, onDuplicateRow, onMoveRow, onPasteCells, addLabel, actionsLabel, removeLabel, duplicateLabel, moveUpLabel, moveDownLabel, emptyLabel, emptyCtaLabel, testId, }: EmbeddedListInputProps): ReactNode;
|
|
9
|
+
export {};
|