@kardalum/plugin-sdk 0.0.0-stage → 0.16.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/CHANGELOG.md +118 -0
- package/LICENSE +202 -0
- package/README.md +80 -2
- package/dist/admin-section-registry.d.ts +34 -0
- package/dist/admin-section-registry.js +49 -0
- package/dist/built-in-serializers.d.ts +3 -0
- package/dist/built-in-serializers.js +18 -0
- package/dist/built-in-settings-schemas.d.ts +14 -0
- package/dist/built-in-settings-schemas.js +225 -0
- package/dist/built-in-value-schemas.d.ts +4 -0
- package/dist/built-in-value-schemas.js +47 -0
- package/dist/built-ins.d.ts +1 -0
- package/dist/built-ins.js +257 -0
- package/dist/capabilities.d.ts +29 -0
- package/dist/capabilities.js +67 -0
- package/dist/data-type-plugin.d.ts +28 -0
- package/dist/data-type-plugin.js +1 -0
- package/dist/datatype-validation.d.ts +26 -0
- package/dist/datatype-validation.js +110 -0
- package/dist/datatypes-entry.d.ts +4 -0
- package/dist/datatypes-entry.js +18 -0
- package/dist/define-plugin.d.ts +25 -0
- package/dist/define-plugin.js +51 -0
- package/dist/entitlement-entry.d.ts +5 -0
- package/dist/entitlement-entry.js +24 -0
- package/dist/entitlement-gate.d.ts +36 -0
- package/dist/entitlement-gate.js +201 -0
- package/dist/entitlement-types.d.ts +39 -0
- package/dist/entitlement-types.js +1 -0
- package/dist/entitlement.d.ts +57 -0
- package/dist/entitlement.js +170 -0
- package/dist/host-entry.d.ts +1 -0
- package/dist/host-entry.js +11 -0
- package/dist/icon-name.d.ts +1 -0
- package/dist/icon-name.js +1 -0
- package/dist/icons.d.ts +2 -0
- package/dist/icons.js +10 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +94 -0
- package/dist/license-verdict-keys.d.ts +18 -0
- package/dist/license-verdict-keys.js +26 -0
- package/dist/local-host.d.ts +3 -0
- package/dist/local-host.js +38 -0
- package/dist/manifest-entry.d.ts +8 -0
- package/dist/manifest-entry.js +13 -0
- package/dist/manifest-schema.d.ts +476 -0
- package/dist/manifest-schema.js +823 -0
- package/dist/manifest.d.ts +611 -0
- package/dist/manifest.js +86 -0
- package/dist/media/media-picker.d.ts +39 -0
- package/dist/media/media-picker.js +447 -0
- package/dist/media/upload-error.d.ts +12 -0
- package/dist/media/upload-error.js +30 -0
- package/dist/plugin-context.d.ts +82 -0
- package/dist/plugin-context.js +77 -0
- package/dist/plugin-screen-context.d.ts +71 -0
- package/dist/plugin-screen-context.js +41 -0
- package/dist/read-all-pages.d.ts +23 -0
- package/dist/read-all-pages.js +30 -0
- package/dist/register-built-ins.d.ts +1 -0
- package/dist/register-built-ins.js +41 -0
- package/dist/registry.d.ts +4 -0
- package/dist/registry.js +17 -0
- package/dist/rendition-eligibility.d.ts +24 -0
- package/dist/rendition-eligibility.js +40 -0
- package/dist/richtext/block-panel.d.ts +27 -0
- package/dist/richtext/block-panel.js +232 -0
- package/dist/richtext/extensions.d.ts +19 -0
- package/dist/richtext/extensions.js +56 -0
- package/dist/richtext/insert-menu.d.ts +24 -0
- package/dist/richtext/insert-menu.js +142 -0
- package/dist/richtext/kardalum-block.d.ts +33 -0
- package/dist/richtext/kardalum-block.js +282 -0
- package/dist/richtext/style-listbox.d.ts +10 -0
- package/dist/richtext/style-listbox.js +69 -0
- package/dist/richtext/text-style-class.d.ts +18 -0
- package/dist/richtext/text-style-class.js +36 -0
- package/dist/simple-storage-value-provider.d.ts +9 -0
- package/dist/simple-storage-value-provider.js +96 -0
- package/dist/structured-storage-types.d.ts +61 -0
- package/dist/structured-storage-types.js +11 -0
- package/dist/tailwind.d.ts +1 -0
- package/dist/tailwind.js +5 -0
- package/dist/tokens/system-dark.css +75 -0
- package/dist/tokens/tokens.css +239 -0
- package/dist/tokens/tokens.json +212 -0
- package/dist/tokens.d.ts +1 -0
- package/dist/tokens.js +11 -0
- package/dist/ui-entry.d.ts +5 -0
- package/dist/ui-entry.js +42 -0
- package/dist/views/content-list-preview.d.ts +1 -0
- package/dist/views/content-list-preview.js +14 -0
- package/dist/views/content-list-settings-view.d.ts +1 -0
- package/dist/views/content-list-settings-view.js +97 -0
- package/dist/views/content-list-view.d.ts +19 -0
- package/dist/views/content-list-view.js +248 -0
- package/dist/views/crop-view.d.ts +55 -0
- package/dist/views/crop-view.js +161 -0
- package/dist/views/date-range-view.d.ts +6 -0
- package/dist/views/date-range-view.js +55 -0
- package/dist/views/file-upload-view.d.ts +43 -0
- package/dist/views/file-upload-view.js +104 -0
- package/dist/views/html-code-editor.d.ts +10 -0
- package/dist/views/html-code-editor.js +101 -0
- package/dist/views/html-view.d.ts +3 -0
- package/dist/views/html-view.js +53 -0
- package/dist/views/image-view.d.ts +3 -0
- package/dist/views/image-view.js +372 -0
- package/dist/views/rich-text-view.d.ts +2 -0
- package/dist/views/rich-text-view.js +429 -0
- package/node_modules/@kardalum/api-schemas/LICENSE +202 -0
- package/node_modules/@kardalum/api-schemas/README.md +56 -0
- package/node_modules/@kardalum/api-schemas/dist/action.schema.d.ts +30 -0
- package/node_modules/@kardalum/api-schemas/dist/action.schema.js +88 -0
- package/node_modules/@kardalum/api-schemas/dist/api-error.schema.d.ts +17 -0
- package/node_modules/@kardalum/api-schemas/dist/api-error.schema.js +25 -0
- package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.d.ts +93 -0
- package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.js +88 -0
- package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.d.ts +89 -0
- package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +60 -0
- package/node_modules/@kardalum/api-schemas/dist/asset.schema.d.ts +24 -0
- package/node_modules/@kardalum/api-schemas/dist/asset.schema.js +47 -0
- package/node_modules/@kardalum/api-schemas/dist/auth.schema.d.ts +38 -0
- package/node_modules/@kardalum/api-schemas/dist/auth.schema.js +38 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +542 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +357 -0
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +158 -0
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +139 -0
- package/node_modules/@kardalum/api-schemas/dist/content-path.d.ts +125 -0
- package/node_modules/@kardalum/api-schemas/dist/content-path.js +260 -0
- package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.d.ts +20 -0
- package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.js +23 -0
- package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.d.ts +152 -0
- package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.js +82 -0
- package/node_modules/@kardalum/api-schemas/dist/content-version.schema.d.ts +18 -0
- package/node_modules/@kardalum/api-schemas/dist/content-version.schema.js +22 -0
- package/node_modules/@kardalum/api-schemas/dist/content.schema.d.ts +17 -0
- package/node_modules/@kardalum/api-schemas/dist/content.schema.js +20 -0
- package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +352 -0
- package/node_modules/@kardalum/api-schemas/dist/core-actions.js +133 -0
- package/node_modules/@kardalum/api-schemas/dist/culture-direction.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/culture-direction.js +9 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +37 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.js +32 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.d.ts +9 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +32 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +298 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +138 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type.schema.d.ts +121 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type.schema.js +147 -0
- package/node_modules/@kardalum/api-schemas/dist/health.schema.d.ts +6 -0
- package/node_modules/@kardalum/api-schemas/dist/health.schema.js +5 -0
- package/node_modules/@kardalum/api-schemas/dist/html-entities.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/html-entities.js +250 -0
- package/node_modules/@kardalum/api-schemas/dist/index.d.ts +113 -0
- package/node_modules/@kardalum/api-schemas/dist/index.js +64 -0
- package/node_modules/@kardalum/api-schemas/dist/licensing.schema.d.ts +15 -0
- package/node_modules/@kardalum/api-schemas/dist/licensing.schema.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.d.ts +73 -0
- package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.js +104 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +682 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +269 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +177 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +222 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.d.ts +77 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.js +53 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-use.d.ts +75 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-use.js +117 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference.d.ts +27 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference.js +279 -0
- package/node_modules/@kardalum/api-schemas/dist/media-rendition.schema.d.ts +74 -0
- package/node_modules/@kardalum/api-schemas/dist/media-rendition.schema.js +157 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.d.ts +80 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.js +156 -0
- package/node_modules/@kardalum/api-schemas/dist/nav.schema.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/nav.schema.js +55 -0
- package/node_modules/@kardalum/api-schemas/dist/node-access.schema.d.ts +846 -0
- package/node_modules/@kardalum/api-schemas/dist/node-access.schema.js +356 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.d.ts +20 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +27 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +249 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.js +84 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-text.d.ts +65 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-text.js +889 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +172 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +196 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +31 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +38 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +69 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.js +59 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +585 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +536 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-locales.d.ts +75 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-locales.js +213 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +391 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +413 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +29 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +100 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +44 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +162 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.d.ts +31 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.js +25 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.d.ts +15 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.js +24 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +314 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +338 -0
- package/node_modules/@kardalum/api-schemas/dist/render-editing.d.ts +79 -0
- package/node_modules/@kardalum/api-schemas/dist/render-editing.js +50 -0
- package/node_modules/@kardalum/api-schemas/dist/render-settings-api.schema.d.ts +9 -0
- package/node_modules/@kardalum/api-schemas/dist/render-settings-api.schema.js +13 -0
- package/node_modules/@kardalum/api-schemas/dist/reserved-slugs.d.ts +2 -0
- package/node_modules/@kardalum/api-schemas/dist/reserved-slugs.js +16 -0
- package/node_modules/@kardalum/api-schemas/dist/role.schema.d.ts +96 -0
- package/node_modules/@kardalum/api-schemas/dist/role.schema.js +75 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content-outcome.schema.d.ts +17 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content-outcome.schema.js +27 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.d.ts +35 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.js +79 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +138 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +105 -0
- package/node_modules/@kardalum/api-schemas/dist/sites.schema.d.ts +243 -0
- package/node_modules/@kardalum/api-schemas/dist/sites.schema.js +296 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +47 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.js +27 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +30 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.js +19 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.d.ts +112 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +74 -0
- package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +41 -0
- package/node_modules/@kardalum/api-schemas/dist/template.schema.js +39 -0
- package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.d.ts +21 -0
- package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +97 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +73 -0
- package/node_modules/@kardalum/api-schemas/package.json +35 -0
- package/node_modules/@kardalum/design-tokens/LICENSE +202 -0
- package/node_modules/@kardalum/design-tokens/README.md +29 -0
- package/node_modules/@kardalum/design-tokens/dist/build-css.d.ts +32 -0
- package/node_modules/@kardalum/design-tokens/dist/build-css.js +88 -0
- package/node_modules/@kardalum/design-tokens/dist/generate.d.ts +1 -0
- package/node_modules/@kardalum/design-tokens/dist/generate.js +18 -0
- package/node_modules/@kardalum/design-tokens/dist/index.d.ts +6 -0
- package/node_modules/@kardalum/design-tokens/dist/index.js +4 -0
- package/node_modules/@kardalum/design-tokens/dist/system-dark.css +75 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +33 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +54 -0
- package/node_modules/@kardalum/design-tokens/dist/theme-css.d.ts +12 -0
- package/node_modules/@kardalum/design-tokens/dist/theme-css.js +42 -0
- package/node_modules/@kardalum/design-tokens/dist/theme-types.d.ts +43 -0
- package/node_modules/@kardalum/design-tokens/dist/theme-types.js +1 -0
- package/node_modules/@kardalum/design-tokens/dist/themes/dark.d.ts +13 -0
- package/node_modules/@kardalum/design-tokens/dist/themes/dark.js +120 -0
- package/node_modules/@kardalum/design-tokens/dist/themes/index.d.ts +5 -0
- package/node_modules/@kardalum/design-tokens/dist/themes/index.js +4 -0
- package/node_modules/@kardalum/design-tokens/dist/themes/light.d.ts +9 -0
- package/node_modules/@kardalum/design-tokens/dist/themes/light.js +13 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.css +239 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +25 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.js +276 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.json +212 -0
- package/node_modules/@kardalum/design-tokens/dist/types.d.ts +91 -0
- package/node_modules/@kardalum/design-tokens/dist/types.js +5 -0
- package/node_modules/@kardalum/design-tokens/package.json +42 -0
- package/node_modules/@kardalum/plugin-package/LICENSE +202 -0
- package/node_modules/@kardalum/plugin-package/README.md +71 -0
- package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +111 -0
- package/node_modules/@kardalum/plugin-package/dist/build-reference.js +61 -0
- package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +103 -0
- package/node_modules/@kardalum/plugin-package/dist/capabilities.js +351 -0
- package/node_modules/@kardalum/plugin-package/dist/docs-contract.d.ts +50 -0
- package/node_modules/@kardalum/plugin-package/dist/docs-contract.js +659 -0
- package/node_modules/@kardalum/plugin-package/dist/envelope.d.ts +19 -0
- package/node_modules/@kardalum/plugin-package/dist/envelope.js +104 -0
- package/node_modules/@kardalum/plugin-package/dist/extract.d.ts +37 -0
- package/node_modules/@kardalum/plugin-package/dist/extract.js +199 -0
- package/node_modules/@kardalum/plugin-package/dist/hash.d.ts +17 -0
- package/node_modules/@kardalum/plugin-package/dist/hash.js +69 -0
- package/node_modules/@kardalum/plugin-package/dist/index.d.ts +13 -0
- package/node_modules/@kardalum/plugin-package/dist/index.js +8 -0
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +185 -0
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +236 -0
- package/node_modules/@kardalum/plugin-package/dist/package-contract.d.ts +50 -0
- package/node_modules/@kardalum/plugin-package/dist/package-contract.js +115 -0
- package/node_modules/@kardalum/plugin-package/dist/reference-entry.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/reference-entry.js +6 -0
- package/node_modules/@kardalum/plugin-package/dist/sample-content.d.ts +20 -0
- package/node_modules/@kardalum/plugin-package/dist/sample-content.js +57 -0
- package/node_modules/@kardalum/plugin-package/dist/types.d.ts +43 -0
- package/node_modules/@kardalum/plugin-package/dist/types.js +15 -0
- package/node_modules/@kardalum/plugin-package/package.json +54 -0
- package/node_modules/@kardalum/ui/LICENSE +202 -0
- package/node_modules/@kardalum/ui/README.md +35 -0
- package/node_modules/@kardalum/ui/dist/components/alert-dialog.d.ts +14 -0
- package/node_modules/@kardalum/ui/dist/components/alert-dialog.js +38 -0
- package/node_modules/@kardalum/ui/dist/components/badge.d.ts +9 -0
- package/node_modules/@kardalum/ui/dist/components/badge.js +30 -0
- package/node_modules/@kardalum/ui/dist/components/button.d.ts +11 -0
- package/node_modules/@kardalum/ui/dist/components/button.js +37 -0
- package/node_modules/@kardalum/ui/dist/components/checkbox.d.ts +5 -0
- package/node_modules/@kardalum/ui/dist/components/checkbox.js +7 -0
- package/node_modules/@kardalum/ui/dist/components/dialog.d.ts +17 -0
- package/node_modules/@kardalum/ui/dist/components/dialog.js +48 -0
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.d.ts +18 -0
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +53 -0
- package/node_modules/@kardalum/ui/dist/components/empty-state.d.ts +30 -0
- package/node_modules/@kardalum/ui/dist/components/empty-state.js +9 -0
- package/node_modules/@kardalum/ui/dist/components/input.d.ts +4 -0
- package/node_modules/@kardalum/ui/dist/components/input.js +6 -0
- package/node_modules/@kardalum/ui/dist/components/panel.d.ts +5 -0
- package/node_modules/@kardalum/ui/dist/components/panel.js +6 -0
- package/node_modules/@kardalum/ui/dist/components/property-field.d.ts +19 -0
- package/node_modules/@kardalum/ui/dist/components/property-field.js +89 -0
- package/node_modules/@kardalum/ui/dist/components/sheet.d.ts +17 -0
- package/node_modules/@kardalum/ui/dist/components/sheet.js +55 -0
- package/node_modules/@kardalum/ui/dist/components/skeleton.d.ts +3 -0
- package/node_modules/@kardalum/ui/dist/components/skeleton.js +9 -0
- package/node_modules/@kardalum/ui/dist/components/switch.d.ts +5 -0
- package/node_modules/@kardalum/ui/dist/components/switch.js +7 -0
- package/node_modules/@kardalum/ui/dist/components/tab-strip.d.ts +34 -0
- package/node_modules/@kardalum/ui/dist/components/tab-strip.js +72 -0
- package/node_modules/@kardalum/ui/dist/components/toast.d.ts +18 -0
- package/node_modules/@kardalum/ui/dist/components/toast.js +42 -0
- package/node_modules/@kardalum/ui/dist/components/toaster.d.ts +12 -0
- package/node_modules/@kardalum/ui/dist/components/toaster.js +11 -0
- package/node_modules/@kardalum/ui/dist/components/use-toast.d.ts +17 -0
- package/node_modules/@kardalum/ui/dist/components/use-toast.js +62 -0
- package/node_modules/@kardalum/ui/dist/index.d.ts +18 -0
- package/node_modules/@kardalum/ui/dist/index.js +18 -0
- package/node_modules/@kardalum/ui/dist/lib/cn.d.ts +2 -0
- package/node_modules/@kardalum/ui/dist/lib/cn.js +5 -0
- package/node_modules/@kardalum/ui/package.json +63 -0
- package/package.json +146 -4
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface PropertyFieldProps extends Omit<React.ComponentProps<'div'>, 'children'> {
|
|
3
|
+
label: React.ReactNode;
|
|
4
|
+
htmlFor?: string;
|
|
5
|
+
required?: boolean;
|
|
6
|
+
requiredText?: string;
|
|
7
|
+
helpText?: React.ReactNode;
|
|
8
|
+
error?: React.ReactNode;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export interface PropertyFieldControlProps {
|
|
12
|
+
id: string;
|
|
13
|
+
'aria-labelledby': string;
|
|
14
|
+
'aria-describedby'?: string;
|
|
15
|
+
'aria-invalid'?: true;
|
|
16
|
+
}
|
|
17
|
+
export declare function usePropertyFieldControl(): Partial<PropertyFieldControlProps>;
|
|
18
|
+
declare function PropertyField({ label, htmlFor, required, requiredText, helpText, error, className, children, ...props }: PropertyFieldProps): React.JSX.Element;
|
|
19
|
+
export { PropertyField };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { jsxs as _jsxs, Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { cn } from '../lib/cn.js';
|
|
4
|
+
const PropertyFieldContext = React.createContext(null);
|
|
5
|
+
// The escape hatch for a control this component cannot reach by cloning:
|
|
6
|
+
// the registry-driven content form hands PropertyField a plugin's view
|
|
7
|
+
// component, not a DOM element, so there is no child element to attach
|
|
8
|
+
// `id`/`aria-*` to. Any control rendered *anywhere* under a PropertyField
|
|
9
|
+
// can spread the result of this hook onto itself and be correctly named,
|
|
10
|
+
// described and marked invalid — which is how a third-party data-type
|
|
11
|
+
// plugin's editor gets an accessible name without the host knowing
|
|
12
|
+
// anything about its internals.
|
|
13
|
+
//
|
|
14
|
+
// Returns an EMPTY object outside a PropertyField (never null), so every
|
|
15
|
+
// call site can spread the result unconditionally —
|
|
16
|
+
// `<input {...usePropertyFieldControl()} />` — and a view stays usable
|
|
17
|
+
// both inside and outside a field without a `?? {}` at each use.
|
|
18
|
+
const NO_PROPERTY_FIELD = Object.freeze({});
|
|
19
|
+
export function usePropertyFieldControl() {
|
|
20
|
+
return React.useContext(PropertyFieldContext) ?? NO_PROPERTY_FIELD;
|
|
21
|
+
}
|
|
22
|
+
// A `<label for>` only resolves to a *labelable* element. Handing the
|
|
23
|
+
// control id to a child that is not one (a wrapper <div> holding a
|
|
24
|
+
// preview, the real control and a button, say) makes the label resolve to
|
|
25
|
+
// that wrapper, and the control inside it is left with no accessible name:
|
|
26
|
+
// the SEO plugin's social image field, S254j. So an intrinsic child is
|
|
27
|
+
// only wired up when it is labelable. A component child is assumed to
|
|
28
|
+
// forward `id` to whatever control it renders, which is how every
|
|
29
|
+
// <Input>/<Select>/<Checkbox> caller works today; a component that does
|
|
30
|
+
// not forward it reaches the same wiring through usePropertyFieldControl().
|
|
31
|
+
const LABELABLE_ELEMENTS = new Set([
|
|
32
|
+
'button',
|
|
33
|
+
'input',
|
|
34
|
+
'meter',
|
|
35
|
+
'output',
|
|
36
|
+
'progress',
|
|
37
|
+
'select',
|
|
38
|
+
'textarea',
|
|
39
|
+
]);
|
|
40
|
+
function acceptsControlId(child) {
|
|
41
|
+
if (!React.isValidElement(child))
|
|
42
|
+
return false;
|
|
43
|
+
return typeof child.type === 'string' ? LABELABLE_ELEMENTS.has(child.type) : true;
|
|
44
|
+
}
|
|
45
|
+
function PropertyField({ label, htmlFor, required, requiredText, helpText, error, className, children, ...props }) {
|
|
46
|
+
const helpId = React.useId();
|
|
47
|
+
const errorId = React.useId();
|
|
48
|
+
const labelId = React.useId();
|
|
49
|
+
const generatedControlId = React.useId();
|
|
50
|
+
// A caller that already owns its control's id keeps it; everything else
|
|
51
|
+
// gets a generated one, which is what the context hands to a nested
|
|
52
|
+
// control and what a wired child is cloned with.
|
|
53
|
+
const controlId = htmlFor ?? generatedControlId;
|
|
54
|
+
const describedBy = error ? errorId : helpText ? helpId : undefined;
|
|
55
|
+
// aria-labelledby rather than relying on <label for> alone: `for` only
|
|
56
|
+
// associates with *labelable* elements, and some editors are neither
|
|
57
|
+
// (TipTap's contenteditable is a div with role="textbox"). Pointing at
|
|
58
|
+
// the label element names every control the same way.
|
|
59
|
+
const controlProps = {
|
|
60
|
+
id: controlId,
|
|
61
|
+
'aria-labelledby': labelId,
|
|
62
|
+
...(describedBy ? { 'aria-describedby': describedBy } : {}),
|
|
63
|
+
...(error ? { 'aria-invalid': true } : {}),
|
|
64
|
+
};
|
|
65
|
+
// Wire id/labelledby/describedby/invalid onto the control automatically
|
|
66
|
+
// when there's exactly one and it can carry them: the common case (an
|
|
67
|
+
// <input>/<select>/<Input> child). A composite child (multiple elements)
|
|
68
|
+
// and a wrapper element child are left untouched; the caller wires its
|
|
69
|
+
// own aria in that case, or the control deep inside it calls
|
|
70
|
+
// usePropertyFieldControl().
|
|
71
|
+
const wiredChild = acceptsControlId(children) ? children : null;
|
|
72
|
+
const control = wiredChild
|
|
73
|
+
? React.cloneElement(wiredChild, {
|
|
74
|
+
id: wiredChild.props.id ?? controlId,
|
|
75
|
+
'aria-describedby': [wiredChild.props['aria-describedby'], describedBy].filter(Boolean).join(' ') ||
|
|
76
|
+
undefined,
|
|
77
|
+
'aria-invalid': error ? true : wiredChild.props['aria-invalid'],
|
|
78
|
+
})
|
|
79
|
+
: children;
|
|
80
|
+
// Point `for` at the id the caller vouched for, or at the child we just
|
|
81
|
+
// wired. With neither there is no labelable control to name, and a `for`
|
|
82
|
+
// that resolves to a <div> (or to nothing) is worse than none at all.
|
|
83
|
+
const labelFor = htmlFor ?? (wiredChild ? controlId : undefined);
|
|
84
|
+
// gap-2 (8px) between the label, the control and the help text: a half step
|
|
85
|
+
// such as gap-1.5 emits no rule under the token preset, which replaces
|
|
86
|
+
// Tailwind's spacing scale, so the label sat flush against its field.
|
|
87
|
+
return (_jsxs("div", { "data-slot": "property-field", className: cn('flex flex-col gap-2', className), ...props, children: [_jsxs("label", { id: labelId, htmlFor: labelFor, className: "text-sm font-medium text-text-primary", children: [label, required && (_jsxs(_Fragment, { children: [_jsxs("span", { "aria-hidden": "true", className: "text-danger-600", children: [' ', "*"] }), requiredText && _jsxs("span", { className: "sr-only", children: [" (", requiredText, ")"] })] }))] }), _jsx(PropertyFieldContext.Provider, { value: controlProps, children: control }), error ? (_jsx("p", { id: errorId, role: "alert", className: "text-xs text-danger-600", children: error })) : (helpText && (_jsx("p", { id: helpId, className: "text-xs text-text-tertiary", children: helpText })))] }));
|
|
88
|
+
}
|
|
89
|
+
export { PropertyField };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
3
|
+
declare const Sheet: React.FC<DialogPrimitive.DialogProps>;
|
|
4
|
+
declare const SheetTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const SheetPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
6
|
+
declare const SheetClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare function SheetOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): React.JSX.Element;
|
|
8
|
+
declare function SheetContent({ className, children, ...props }: React.ComponentProps<typeof DialogPrimitive.Content>): React.JSX.Element;
|
|
9
|
+
declare function SheetHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
10
|
+
declare function SheetFooter({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
11
|
+
declare function SheetTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): React.JSX.Element;
|
|
12
|
+
declare function SheetDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): React.JSX.Element;
|
|
13
|
+
interface SheetCloseButtonProps extends React.ComponentProps<typeof DialogPrimitive.Close> {
|
|
14
|
+
'aria-label': string;
|
|
15
|
+
}
|
|
16
|
+
declare function SheetCloseButton({ className, ...props }: SheetCloseButtonProps): React.JSX.Element;
|
|
17
|
+
export { Sheet, SheetTrigger, SheetPortal, SheetClose, SheetCloseButton, SheetOverlay, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
4
|
+
import { cn } from '../lib/cn.js';
|
|
5
|
+
// A right-side drawer variant of Dialog — same Radix primitive underneath
|
|
6
|
+
// (focus trap, Escape handling, aria wiring: SheetContent is still a
|
|
7
|
+
// DialogPrimitive.Content, so it still carries role="dialog"/aria-modal
|
|
8
|
+
// the way DialogContent does), just a different Content shell: a
|
|
9
|
+
// fixed-width panel pinned to the inline end of the viewport instead of a
|
|
10
|
+
// centered card. Ported by hand in the shadcn/ui model (same convention as
|
|
11
|
+
// dialog.tsx/alert-dialog.tsx: retargeted to @kardalum/design-tokens
|
|
12
|
+
// classes, no tailwindcss-animate dependency, no owned strings). First
|
|
13
|
+
// added for S197 Item 5's media picker drawer — the first place this
|
|
14
|
+
// admin needs a side-sheet through this primitive rather than a centered
|
|
15
|
+
// dialog (block-overlay.tsx's on-page block param panel is its own
|
|
16
|
+
// bespoke non-Radix side panel, not a Dialog at all — see that file's own
|
|
17
|
+
// doc comment for why it needed a manual focus trap instead of this).
|
|
18
|
+
const Sheet = DialogPrimitive.Root;
|
|
19
|
+
const SheetTrigger = DialogPrimitive.Trigger;
|
|
20
|
+
const SheetPortal = DialogPrimitive.Portal;
|
|
21
|
+
const SheetClose = DialogPrimitive.Close;
|
|
22
|
+
function SheetOverlay({ className, ...props }) {
|
|
23
|
+
return (_jsx(DialogPrimitive.Overlay, { className: cn('fixed inset-0 z-50 bg-background-overlay', className), ...props }));
|
|
24
|
+
}
|
|
25
|
+
// Slides in from the inline end on mount via a plain CSS transition, not
|
|
26
|
+
// Radix's own animation data-attributes (this package takes no
|
|
27
|
+
// tailwindcss-animate dependency — see dialog.tsx's own doc comment).
|
|
28
|
+
// `motion-safe:`/`motion-reduce:` gate the transition itself, same guard
|
|
29
|
+
// overlay-insert.tsx's "+" button already uses for its own color
|
|
30
|
+
// transition: under prefers-reduced-motion the panel still ends up in its
|
|
31
|
+
// final position on the very next frame, just without the slide.
|
|
32
|
+
function SheetContent({ className, children, ...props }) {
|
|
33
|
+
const [entered, setEntered] = React.useState(false);
|
|
34
|
+
React.useEffect(() => {
|
|
35
|
+
const frame = requestAnimationFrame(() => setEntered(true));
|
|
36
|
+
return () => cancelAnimationFrame(frame);
|
|
37
|
+
}, []);
|
|
38
|
+
return (_jsxs(SheetPortal, { children: [_jsx(SheetOverlay, {}), _jsx(DialogPrimitive.Content, { className: cn('fixed inset-y-0 end-0 z-50 flex h-full w-full max-w-md flex-col border-s border-border-default bg-background-elevated shadow-xl', 'motion-safe:transition-transform motion-safe:duration-normal motion-safe:ease-standard motion-reduce:transition-none', entered ? 'translate-x-0' : 'ltr:translate-x-full rtl:-translate-x-full', className), ...props, children: children })] }));
|
|
39
|
+
}
|
|
40
|
+
function SheetHeader({ className, ...props }) {
|
|
41
|
+
return (_jsx("div", { className: cn('flex shrink-0 items-center gap-2 border-b border-border-default px-4 py-3 text-start', className), ...props }));
|
|
42
|
+
}
|
|
43
|
+
function SheetFooter({ className, ...props }) {
|
|
44
|
+
return (_jsx("div", { className: cn('mt-auto flex shrink-0 justify-end gap-2 border-t border-border-default px-4 py-3', className), ...props }));
|
|
45
|
+
}
|
|
46
|
+
function SheetTitle({ className, ...props }) {
|
|
47
|
+
return (_jsx(DialogPrimitive.Title, { className: cn('text-base font-semibold text-text-primary', className), ...props }));
|
|
48
|
+
}
|
|
49
|
+
function SheetDescription({ className, ...props }) {
|
|
50
|
+
return (_jsx(DialogPrimitive.Description, { className: cn('text-sm text-text-secondary', className), ...props }));
|
|
51
|
+
}
|
|
52
|
+
function SheetCloseButton({ className, ...props }) {
|
|
53
|
+
return (_jsx(DialogPrimitive.Close, { className: cn('ms-auto shrink-0 rounded-md p-1 text-text-secondary opacity-70 transition-colors duration-fast hover:bg-background-hover hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-600', className), ...props, children: _jsxs("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "h-4 w-4", children: [_jsx("path", { d: "M18 6 6 18" }), _jsx("path", { d: "m6 6 12 12" })] }) }));
|
|
54
|
+
}
|
|
55
|
+
export { Sheet, SheetTrigger, SheetPortal, SheetClose, SheetCloseButton, SheetOverlay, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '../lib/cn.js';
|
|
3
|
+
// Loading placeholder for async lists. background.hover is deliberately
|
|
4
|
+
// reused as the shimmer base — it's the "subtle wash" token and is
|
|
5
|
+
// theme-remapped, so the skeleton stays subtle in dark mode too.
|
|
6
|
+
function Skeleton({ className, ...props }) {
|
|
7
|
+
return (_jsx("div", { "data-slot": "skeleton", "aria-hidden": "true", className: cn('animate-pulse rounded-md bg-background-hover', className), ...props }));
|
|
8
|
+
}
|
|
9
|
+
export { Skeleton };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
3
|
+
export type SwitchProps = React.ComponentProps<typeof SwitchPrimitive.Root>;
|
|
4
|
+
declare function Switch({ className, ...props }: SwitchProps): React.JSX.Element;
|
|
5
|
+
export { Switch };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
3
|
+
import { cn } from '../lib/cn.js';
|
|
4
|
+
function Switch({ className, ...props }) {
|
|
5
|
+
return (_jsx(SwitchPrimitive.Root, { "data-slot": "switch", className: cn('peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-600 focus-visible:ring-offset-2 focus-visible:ring-offset-background-base disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary-600 data-[state=unchecked]:bg-border-strong', className), ...props, children: _jsx(SwitchPrimitive.Thumb, { "data-slot": "switch-thumb", className: "pointer-events-none block h-5 w-5 rounded-full bg-background-elevated shadow-sm ring-0 transition-transform data-[state=unchecked]:translate-x-0 ltr:data-[state=checked]:translate-x-5 rtl:data-[state=checked]:-translate-x-5" }) }));
|
|
6
|
+
}
|
|
7
|
+
export { Switch };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface TabStripItem {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
/** Secondary text rendered after the label inside the tab (e.g. a
|
|
6
|
+
* language tab's "Published" / "Draft" / "Changes not published"
|
|
7
|
+
* state), part of the tab's accessible name. */
|
|
8
|
+
detail?: string;
|
|
9
|
+
/** Shows a small error dot next to the label (e.g. a blocked-save
|
|
10
|
+
* validation error on a field that lives in this tab, when the tab
|
|
11
|
+
* itself isn't the active one). */
|
|
12
|
+
hasError?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface TabStripProps {
|
|
15
|
+
tabs: TabStripItem[];
|
|
16
|
+
activeId: string;
|
|
17
|
+
onChange: (id: string) => void;
|
|
18
|
+
/** Accessible name for the tablist — pass translated text. */
|
|
19
|
+
label: string;
|
|
20
|
+
/** Appended to a tab's accessible name when that tab's `hasError` is
|
|
21
|
+
* set (e.g. "Has an error") — pass translated text. Only needed if any
|
|
22
|
+
* tab uses `hasError`. */
|
|
23
|
+
errorLabel?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Prefix for the generated tab/panel DOM ids so aria-controls /
|
|
26
|
+
* aria-labelledby wiring stays consistent — pair with tabStripTabId /
|
|
27
|
+
* tabStripPanelId on the consumer's panel element.
|
|
28
|
+
*/
|
|
29
|
+
idPrefix: string;
|
|
30
|
+
className?: string;
|
|
31
|
+
}
|
|
32
|
+
export declare function tabStripTabId(idPrefix: string, id: string): string;
|
|
33
|
+
export declare function tabStripPanelId(idPrefix: string, id: string): string;
|
|
34
|
+
export declare function TabStrip({ tabs, activeId, onChange, label, errorLabel, idPrefix, className }: TabStripProps): React.JSX.Element;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { cn } from '../lib/cn.js';
|
|
4
|
+
export function tabStripTabId(idPrefix, id) {
|
|
5
|
+
return `${idPrefix}-tab-${id}`;
|
|
6
|
+
}
|
|
7
|
+
export function tabStripPanelId(idPrefix, id) {
|
|
8
|
+
return `${idPrefix}-panel-${id}`;
|
|
9
|
+
}
|
|
10
|
+
// Roving-tabindex tab strip (WAI-ARIA tabs pattern): the active tab is the
|
|
11
|
+
// only tab stop; Arrow/Home/End move activation. Arrow direction flips
|
|
12
|
+
// under the nearest dir="rtl" to follow the visual order.
|
|
13
|
+
export function TabStrip({ tabs, activeId, onChange, label, errorLabel, idPrefix, className }) {
|
|
14
|
+
const listRef = React.useRef(null);
|
|
15
|
+
// The tab an arrow key asked for. Focus follows it only once the consumer
|
|
16
|
+
// has actually selected it: a consumer may refuse or defer the change
|
|
17
|
+
// (S230e: the content editor does while a save runs, and asks first when
|
|
18
|
+
// there are unsaved edits), and focus must never land on a tab that is
|
|
19
|
+
// not selected. The request only lives until the next render, so a
|
|
20
|
+
// refused one can never move focus later, when something else selects
|
|
21
|
+
// that tab.
|
|
22
|
+
const focusRequest = React.useRef(null);
|
|
23
|
+
React.useEffect(() => {
|
|
24
|
+
const requested = focusRequest.current;
|
|
25
|
+
focusRequest.current = null;
|
|
26
|
+
if (requested === null || requested !== activeId)
|
|
27
|
+
return;
|
|
28
|
+
const id = tabStripTabId(idPrefix, activeId);
|
|
29
|
+
Array.from(listRef.current?.querySelectorAll('[role="tab"]') ?? [])
|
|
30
|
+
.find((tab) => tab.id === id)
|
|
31
|
+
?.focus();
|
|
32
|
+
});
|
|
33
|
+
function handleKeyDown(event) {
|
|
34
|
+
const index = tabs.findIndex((tab) => tab.id === activeId);
|
|
35
|
+
if (index === -1)
|
|
36
|
+
return;
|
|
37
|
+
// The nearest dir wins, so a strip inside a right-to-left region
|
|
38
|
+
// follows its own visual order even in a left-to-right page.
|
|
39
|
+
const rtl = event.currentTarget.closest('[dir]')?.getAttribute('dir') === 'rtl';
|
|
40
|
+
let next;
|
|
41
|
+
switch (event.key) {
|
|
42
|
+
case 'ArrowRight':
|
|
43
|
+
next = rtl ? index - 1 : index + 1;
|
|
44
|
+
break;
|
|
45
|
+
case 'ArrowLeft':
|
|
46
|
+
next = rtl ? index + 1 : index - 1;
|
|
47
|
+
break;
|
|
48
|
+
case 'Home':
|
|
49
|
+
next = 0;
|
|
50
|
+
break;
|
|
51
|
+
case 'End':
|
|
52
|
+
next = tabs.length - 1;
|
|
53
|
+
break;
|
|
54
|
+
default:
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
event.preventDefault();
|
|
58
|
+
const target = tabs[(next + tabs.length) % tabs.length];
|
|
59
|
+
if (!target)
|
|
60
|
+
return;
|
|
61
|
+
focusRequest.current = target.id;
|
|
62
|
+
onChange(target.id);
|
|
63
|
+
}
|
|
64
|
+
return (_jsx("div", { ref: listRef, role: "tablist", "aria-label": label, onKeyDown: handleKeyDown, className: cn('flex items-end gap-1 overflow-x-auto border-b border-border-default', className), children: tabs.map((tab) => {
|
|
65
|
+
const active = tab.id === activeId;
|
|
66
|
+
return (_jsxs("button", { type: "button", role: "tab", id: tabStripTabId(idPrefix, tab.id), "aria-selected": active, "aria-controls": tabStripPanelId(idPrefix, tab.id), "aria-label": tab.hasError && errorLabel
|
|
67
|
+
? `${tab.label}${tab.detail ? `, ${tab.detail}` : ''}: ${errorLabel}`
|
|
68
|
+
: undefined, tabIndex: active ? 0 : -1, onClick: () => onChange(tab.id), className: cn('-mb-px inline-flex items-center gap-1 whitespace-nowrap rounded-t-md border-b-2 px-3 py-2 text-sm transition-colors duration-fast focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-600 focus-visible:ring-offset-2 focus-visible:ring-offset-background-base', active
|
|
69
|
+
? 'border-primary-300 font-medium text-text-primary'
|
|
70
|
+
: 'border-transparent text-text-secondary hover:text-text-primary'), children: [tab.label, tab.detail && _jsx("span", { className: "text-xs text-text-tertiary", children: tab.detail }), tab.hasError && (_jsx("span", { "aria-hidden": "true", className: "size-1 shrink-0 rounded-full bg-danger-500" }))] }, tab.id));
|
|
71
|
+
}) }));
|
|
72
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as ToastPrimitives from '@radix-ui/react-toast';
|
|
3
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
4
|
+
declare const ToastProvider: React.FC<ToastPrimitives.ToastProviderProps>;
|
|
5
|
+
declare function ToastViewport({ className, ...props }: React.ComponentProps<typeof ToastPrimitives.Viewport>): React.JSX.Element;
|
|
6
|
+
declare const toastVariants: (props?: ({
|
|
7
|
+
variant?: "default" | "success" | "danger" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
export interface ToastProps extends React.ComponentProps<typeof ToastPrimitives.Root>, VariantProps<typeof toastVariants> {
|
|
10
|
+
}
|
|
11
|
+
declare function Toast({ className, variant, ...props }: ToastProps): React.JSX.Element;
|
|
12
|
+
declare function ToastTitle({ className, ...props }: React.ComponentProps<typeof ToastPrimitives.Title>): React.JSX.Element;
|
|
13
|
+
declare function ToastDescription({ className, ...props }: React.ComponentProps<typeof ToastPrimitives.Description>): React.JSX.Element;
|
|
14
|
+
interface ToastCloseProps extends React.ComponentProps<typeof ToastPrimitives.Close> {
|
|
15
|
+
'aria-label': string;
|
|
16
|
+
}
|
|
17
|
+
declare function ToastClose({ className, ...props }: ToastCloseProps): React.JSX.Element;
|
|
18
|
+
export { ToastProvider, ToastViewport, Toast, ToastTitle, ToastDescription, ToastClose };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as ToastPrimitives from '@radix-ui/react-toast';
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { cn } from '../lib/cn.js';
|
|
5
|
+
// Ported from shadcn/ui's Toast (Radix @radix-ui/react-toast under the
|
|
6
|
+
// hood), retargeted to @kardalum/design-tokens classes and trimmed: no
|
|
7
|
+
// tailwindcss-animate dependency (swipe transforms via arbitrary values
|
|
8
|
+
// only), logical properties for the viewport position, and no owned
|
|
9
|
+
// strings — the close button's aria-label comes from the caller
|
|
10
|
+
// (see Toaster).
|
|
11
|
+
const ToastProvider = ToastPrimitives.Provider;
|
|
12
|
+
function ToastViewport({ className, ...props }) {
|
|
13
|
+
return (_jsx(ToastPrimitives.Viewport, { className: cn('fixed bottom-0 end-0 z-50 flex max-h-screen w-full flex-col gap-2 p-4 sm:max-w-sm', className), ...props }));
|
|
14
|
+
}
|
|
15
|
+
const toastVariants = cva(
|
|
16
|
+
// Inverted card (ink on light / light on dark — both come from the same
|
|
17
|
+
// two tokens, so no theme-specific class is needed).
|
|
18
|
+
'group pointer-events-auto relative flex w-full items-center justify-between gap-4 overflow-hidden rounded-lg border bg-text-primary p-4 pe-8 text-background-elevated shadow-lg transition-opacity data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[swipe=cancel]:translate-x-0 data-[swipe=end]:opacity-0 data-[state=closed]:opacity-0', {
|
|
19
|
+
variants: {
|
|
20
|
+
variant: {
|
|
21
|
+
default: 'border-text-primary',
|
|
22
|
+
success: 'border-primary-300',
|
|
23
|
+
danger: 'border-danger-300',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
variant: 'default',
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
function Toast({ className, variant, ...props }) {
|
|
31
|
+
return (_jsx(ToastPrimitives.Root, { className: cn(toastVariants({ variant, className })), ...props }));
|
|
32
|
+
}
|
|
33
|
+
function ToastTitle({ className, ...props }) {
|
|
34
|
+
return _jsx(ToastPrimitives.Title, { className: cn('text-sm font-semibold', className), ...props });
|
|
35
|
+
}
|
|
36
|
+
function ToastDescription({ className, ...props }) {
|
|
37
|
+
return (_jsx(ToastPrimitives.Description, { className: cn('text-sm text-background-elevated opacity-80', className), ...props }));
|
|
38
|
+
}
|
|
39
|
+
function ToastClose({ className, ...props }) {
|
|
40
|
+
return (_jsx(ToastPrimitives.Close, { className: cn('absolute end-2 top-2 rounded-md p-1 text-background-elevated opacity-70 transition-colors duration-fast hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-600', className), ...props, children: _jsxs("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "h-4 w-4", children: [_jsx("path", { d: "M18 6 6 18" }), _jsx("path", { d: "m6 6 12 12" })] }) }));
|
|
41
|
+
}
|
|
42
|
+
export { ToastProvider, ToastViewport, Toast, ToastTitle, ToastDescription, ToastClose };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface ToasterProps {
|
|
3
|
+
/** Translated aria-label for each toast's close button. */
|
|
4
|
+
closeLabel: string;
|
|
5
|
+
/**
|
|
6
|
+
* Translated screen-reader announcement label (Radix prepends it to
|
|
7
|
+
* each toast's announced text; its built-in default is English
|
|
8
|
+
* "Notification", which would bypass i18n).
|
|
9
|
+
*/
|
|
10
|
+
label: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function Toaster({ closeLabel, label }: ToasterProps): React.JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Toast, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, } from './toast.js';
|
|
3
|
+
import { useToast } from './use-toast.js';
|
|
4
|
+
// Mount once at the app root; toast() calls from anywhere render here.
|
|
5
|
+
export function Toaster({ closeLabel, label }) {
|
|
6
|
+
const { toasts } = useToast();
|
|
7
|
+
// Swipe-to-dismiss should push toward the nearest screen edge, which is
|
|
8
|
+
// direction-dependent (the viewport sits at inset-inline-end).
|
|
9
|
+
const swipeDirection = typeof document !== 'undefined' && document.documentElement.dir === 'rtl' ? 'left' : 'right';
|
|
10
|
+
return (_jsxs(ToastProvider, { label: label, swipeDirection: swipeDirection, children: [toasts.map(({ id, title, description, ...props }) => (_jsxs(Toast, { ...props, children: [_jsxs("div", { className: "grid gap-1", children: [title && _jsx(ToastTitle, { children: title }), description && _jsx(ToastDescription, { children: description })] }), _jsx(ToastClose, { "aria-label": closeLabel })] }, id))), _jsx(ToastViewport, {})] }));
|
|
11
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ToastProps } from './toast.js';
|
|
3
|
+
export interface ToasterToast extends Omit<ToastProps, 'title'> {
|
|
4
|
+
id: string;
|
|
5
|
+
title?: React.ReactNode;
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare function dismiss(id?: string): void;
|
|
9
|
+
export declare function toast(props: Omit<ToasterToast, 'id' | 'open' | 'onOpenChange'>): {
|
|
10
|
+
id: string;
|
|
11
|
+
dismiss: () => void;
|
|
12
|
+
};
|
|
13
|
+
export declare function useToast(): {
|
|
14
|
+
toast: typeof toast;
|
|
15
|
+
dismiss: typeof dismiss;
|
|
16
|
+
toasts: ToasterToast[];
|
|
17
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
// Module-level toast store (shadcn/ui's use-toast pattern, trimmed):
|
|
3
|
+
// toast() can be called from anywhere — event handlers, async completions
|
|
4
|
+
// — and every mounted useToast() subscriber re-renders. The Toaster is
|
|
5
|
+
// the one subscriber in practice.
|
|
6
|
+
const TOAST_LIMIT = 3;
|
|
7
|
+
// How long a dismissed toast stays in state after close, so Radix can
|
|
8
|
+
// finish its exit transition before the element unmounts.
|
|
9
|
+
const TOAST_REMOVE_DELAY = 300;
|
|
10
|
+
let counter = 0;
|
|
11
|
+
function nextId() {
|
|
12
|
+
counter = (counter + 1) % Number.MAX_SAFE_INTEGER;
|
|
13
|
+
return counter.toString();
|
|
14
|
+
}
|
|
15
|
+
const listeners = new Set();
|
|
16
|
+
let memoryState = { toasts: [] };
|
|
17
|
+
const removeTimeouts = new Map();
|
|
18
|
+
function setState(next) {
|
|
19
|
+
memoryState = next;
|
|
20
|
+
listeners.forEach((listener) => listener(memoryState));
|
|
21
|
+
}
|
|
22
|
+
function scheduleRemove(id) {
|
|
23
|
+
if (removeTimeouts.has(id))
|
|
24
|
+
return;
|
|
25
|
+
removeTimeouts.set(id, setTimeout(() => {
|
|
26
|
+
removeTimeouts.delete(id);
|
|
27
|
+
setState({ toasts: memoryState.toasts.filter((toast) => toast.id !== id) });
|
|
28
|
+
}, TOAST_REMOVE_DELAY));
|
|
29
|
+
}
|
|
30
|
+
export function dismiss(id) {
|
|
31
|
+
const targets = id === undefined ? memoryState.toasts.map((toast) => toast.id) : [id];
|
|
32
|
+
setState({
|
|
33
|
+
toasts: memoryState.toasts.map((toast) => targets.includes(toast.id) ? { ...toast, open: false } : toast),
|
|
34
|
+
});
|
|
35
|
+
targets.forEach(scheduleRemove);
|
|
36
|
+
}
|
|
37
|
+
export function toast(props) {
|
|
38
|
+
const id = nextId();
|
|
39
|
+
const entry = {
|
|
40
|
+
...props,
|
|
41
|
+
id,
|
|
42
|
+
open: true,
|
|
43
|
+
// Radix drives open=false on auto-dismiss timeout and swipe-away;
|
|
44
|
+
// route both through dismiss() so removal is scheduled either way.
|
|
45
|
+
onOpenChange: (open) => {
|
|
46
|
+
if (!open)
|
|
47
|
+
dismiss(id);
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
setState({ toasts: [entry, ...memoryState.toasts].slice(0, TOAST_LIMIT) });
|
|
51
|
+
return { id, dismiss: () => dismiss(id) };
|
|
52
|
+
}
|
|
53
|
+
export function useToast() {
|
|
54
|
+
const [state, setLocal] = React.useState(memoryState);
|
|
55
|
+
React.useEffect(() => {
|
|
56
|
+
listeners.add(setLocal);
|
|
57
|
+
return () => {
|
|
58
|
+
listeners.delete(setLocal);
|
|
59
|
+
};
|
|
60
|
+
}, []);
|
|
61
|
+
return { ...state, toast, dismiss };
|
|
62
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { Button, buttonVariants, type ButtonProps } from './components/button.js';
|
|
2
|
+
export { Input, type InputProps } from './components/input.js';
|
|
3
|
+
export { Checkbox, type CheckboxProps } from './components/checkbox.js';
|
|
4
|
+
export { Switch, type SwitchProps } from './components/switch.js';
|
|
5
|
+
export { Panel, type PanelProps } from './components/panel.js';
|
|
6
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, } from './components/alert-dialog.js';
|
|
7
|
+
export { Badge, badgeVariants, type BadgeProps } from './components/badge.js';
|
|
8
|
+
export { Dialog, DialogTrigger, DialogPortal, DialogOverlay, DialogClose, DialogCloseButton, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, } from './components/dialog.js';
|
|
9
|
+
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuPortal, DropdownMenuGroup, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, } from './components/dropdown-menu.js';
|
|
10
|
+
export { EmptyState, type EmptyStateProps } from './components/empty-state.js';
|
|
11
|
+
export { Sheet, SheetTrigger, SheetPortal, SheetClose, SheetCloseButton, SheetOverlay, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, } from './components/sheet.js';
|
|
12
|
+
export { Skeleton } from './components/skeleton.js';
|
|
13
|
+
export { Toast, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, type ToastProps, } from './components/toast.js';
|
|
14
|
+
export { Toaster, type ToasterProps } from './components/toaster.js';
|
|
15
|
+
export { toast, dismiss, useToast, type ToasterToast } from './components/use-toast.js';
|
|
16
|
+
export { PropertyField, usePropertyFieldControl, type PropertyFieldControlProps, type PropertyFieldProps, } from './components/property-field.js';
|
|
17
|
+
export { TabStrip, tabStripPanelId, tabStripTabId, type TabStripItem, type TabStripProps, } from './components/tab-strip.js';
|
|
18
|
+
export { cn } from './lib/cn.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { Button, buttonVariants } from './components/button.js';
|
|
2
|
+
export { Input } from './components/input.js';
|
|
3
|
+
export { Checkbox } from './components/checkbox.js';
|
|
4
|
+
export { Switch } from './components/switch.js';
|
|
5
|
+
export { Panel } from './components/panel.js';
|
|
6
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, } from './components/alert-dialog.js';
|
|
7
|
+
export { Badge, badgeVariants } from './components/badge.js';
|
|
8
|
+
export { Dialog, DialogTrigger, DialogPortal, DialogOverlay, DialogClose, DialogCloseButton, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, } from './components/dialog.js';
|
|
9
|
+
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuPortal, DropdownMenuGroup, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, } from './components/dropdown-menu.js';
|
|
10
|
+
export { EmptyState } from './components/empty-state.js';
|
|
11
|
+
export { Sheet, SheetTrigger, SheetPortal, SheetClose, SheetCloseButton, SheetOverlay, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, } from './components/sheet.js';
|
|
12
|
+
export { Skeleton } from './components/skeleton.js';
|
|
13
|
+
export { Toast, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, } from './components/toast.js';
|
|
14
|
+
export { Toaster } from './components/toaster.js';
|
|
15
|
+
export { toast, dismiss, useToast } from './components/use-toast.js';
|
|
16
|
+
export { PropertyField, usePropertyFieldControl, } from './components/property-field.js';
|
|
17
|
+
export { TabStrip, tabStripPanelId, tabStripTabId, } from './components/tab-strip.js';
|
|
18
|
+
export { cn } from './lib/cn.js';
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kardalum/ui",
|
|
3
|
+
"version": "0.14.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"description": "Kardalum's shadcn/ui-derived component library used to build the admin UI and plugin SDK components.",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=22.12"
|
|
9
|
+
},
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/kardalum/kardalum-devkit/issues"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "dist/index.js",
|
|
15
|
+
"types": "dist/index.d.ts",
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"!dist/**/*.test.*"
|
|
19
|
+
],
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/kardalum/kardalum-devkit.git"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://kardalum.com",
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"@radix-ui/react-alert-dialog": "1.1.18",
|
|
27
|
+
"@radix-ui/react-checkbox": "1.3.6",
|
|
28
|
+
"@radix-ui/react-dialog": "1.1.18",
|
|
29
|
+
"@radix-ui/react-dropdown-menu": "2.1.24",
|
|
30
|
+
"@radix-ui/react-slot": "1.3.0",
|
|
31
|
+
"@radix-ui/react-switch": "1.3.7",
|
|
32
|
+
"@radix-ui/react-toast": "1.2.18",
|
|
33
|
+
"class-variance-authority": "0.7.1",
|
|
34
|
+
"clsx": "2.1.1",
|
|
35
|
+
"react": "^19.0.0",
|
|
36
|
+
"react-dom": "^19.0.0",
|
|
37
|
+
"tailwind-merge": "3.6.0"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@radix-ui/react-alert-dialog": "1.1.18",
|
|
41
|
+
"@radix-ui/react-checkbox": "1.3.6",
|
|
42
|
+
"@radix-ui/react-dialog": "1.1.18",
|
|
43
|
+
"@radix-ui/react-dropdown-menu": "2.1.24",
|
|
44
|
+
"@radix-ui/react-slot": "1.3.0",
|
|
45
|
+
"@radix-ui/react-switch": "1.3.7",
|
|
46
|
+
"@radix-ui/react-toast": "1.2.18",
|
|
47
|
+
"@testing-library/react": "16.3.2",
|
|
48
|
+
"@types/react": "19.2.17",
|
|
49
|
+
"@types/react-dom": "19.2.3",
|
|
50
|
+
"class-variance-authority": "0.7.1",
|
|
51
|
+
"clsx": "2.1.1",
|
|
52
|
+
"jsdom": "26.1.0",
|
|
53
|
+
"react": "19.2.7",
|
|
54
|
+
"react-dom": "19.2.7",
|
|
55
|
+
"tailwind-merge": "3.6.0",
|
|
56
|
+
"vitest": "3.2.6",
|
|
57
|
+
"@kardalum/test-utils": "0.0.0"
|
|
58
|
+
},
|
|
59
|
+
"scripts": {
|
|
60
|
+
"build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p .",
|
|
61
|
+
"test": "vitest run"
|
|
62
|
+
}
|
|
63
|
+
}
|