@next-buildr/editor 0.0.0-stage → 2.0.1
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/LICENSE +21 -0
- package/README.md +4 -2
- package/dist/.tsbuildinfo +1 -0
- package/dist/app/builder-editor.d.ts +8 -0
- package/dist/app/builder-editor.d.ts.map +1 -0
- package/dist/app/builder-editor.js +14 -0
- package/dist/app/builder-editor.test.d.ts +2 -0
- package/dist/app/builder-editor.test.d.ts.map +1 -0
- package/dist/app/builder-editor.test.js +199 -0
- package/dist/app/config.d.ts +59 -0
- package/dist/app/config.d.ts.map +1 -0
- package/dist/app/config.js +18 -0
- package/dist/app/content-language.test.d.ts +2 -0
- package/dist/app/content-language.test.d.ts.map +1 -0
- package/dist/app/content-language.test.js +157 -0
- package/dist/app/editor-app.d.ts +17 -0
- package/dist/app/editor-app.d.ts.map +1 -0
- package/dist/app/editor-app.js +206 -0
- package/dist/app/editor-app.test.d.ts +2 -0
- package/dist/app/editor-app.test.d.ts.map +1 -0
- package/dist/app/editor-app.test.js +135 -0
- package/dist/app/layout.d.ts +32 -0
- package/dist/app/layout.d.ts.map +1 -0
- package/dist/app/layout.js +82 -0
- package/dist/app/manifest.d.ts +12 -0
- package/dist/app/manifest.d.ts.map +1 -0
- package/dist/app/manifest.js +17 -0
- package/dist/app/shell-panels.d.ts +15 -0
- package/dist/app/shell-panels.d.ts.map +1 -0
- package/dist/app/shell-panels.js +5 -0
- package/dist/app/small-screen.d.ts +12 -0
- package/dist/app/small-screen.d.ts.map +1 -0
- package/dist/app/small-screen.js +33 -0
- package/dist/app/small-screen.test.d.ts +2 -0
- package/dist/app/small-screen.test.d.ts.map +1 -0
- package/dist/app/small-screen.test.js +108 -0
- package/dist/app/status-info.d.ts +14 -0
- package/dist/app/status-info.d.ts.map +1 -0
- package/dist/app/status-info.js +34 -0
- package/dist/app/use-resizable.d.ts +34 -0
- package/dist/app/use-resizable.d.ts.map +1 -0
- package/dist/app/use-resizable.js +84 -0
- package/dist/canvas-host/canvas-frame.d.ts +53 -0
- package/dist/canvas-host/canvas-frame.d.ts.map +1 -0
- package/dist/canvas-host/canvas-frame.js +146 -0
- package/dist/canvas-host/canvas-frame.test.d.ts +2 -0
- package/dist/canvas-host/canvas-frame.test.d.ts.map +1 -0
- package/dist/canvas-host/canvas-frame.test.js +91 -0
- package/dist/canvas-host/host.d.ts +109 -0
- package/dist/canvas-host/host.d.ts.map +1 -0
- package/dist/canvas-host/host.js +293 -0
- package/dist/canvas-host/host.test.d.ts +2 -0
- package/dist/canvas-host/host.test.d.ts.map +1 -0
- package/dist/canvas-host/host.test.js +398 -0
- package/dist/canvas-host/index.d.ts +5 -0
- package/dist/canvas-host/index.d.ts.map +1 -0
- package/dist/canvas-host/index.js +2 -0
- package/dist/clipboard/clipboard.d.ts +38 -0
- package/dist/clipboard/clipboard.d.ts.map +1 -0
- package/dist/clipboard/clipboard.js +160 -0
- package/dist/clipboard/clipboard.test.d.ts +2 -0
- package/dist/clipboard/clipboard.test.d.ts.map +1 -0
- package/dist/clipboard/clipboard.test.js +457 -0
- package/dist/clipboard/format.d.ts +27 -0
- package/dist/clipboard/format.d.ts.map +1 -0
- package/dist/clipboard/format.js +37 -0
- package/dist/clipboard/index.d.ts +6 -0
- package/dist/clipboard/index.d.ts.map +1 -0
- package/dist/clipboard/index.js +3 -0
- package/dist/clipboard/react.d.ts +20 -0
- package/dist/clipboard/react.d.ts.map +1 -0
- package/dist/clipboard/react.js +71 -0
- package/dist/dialogs/index.d.ts +2 -0
- package/dist/dialogs/index.d.ts.map +1 -0
- package/dist/dialogs/index.js +1 -0
- package/dist/dialogs/media-picker/index.d.ts +7 -0
- package/dist/dialogs/media-picker/index.d.ts.map +1 -0
- package/dist/dialogs/media-picker/index.js +3 -0
- package/dist/dialogs/media-picker/library.d.ts +17 -0
- package/dist/dialogs/media-picker/library.d.ts.map +1 -0
- package/dist/dialogs/media-picker/library.js +9 -0
- package/dist/dialogs/media-picker/media-picker.d.ts +18 -0
- package/dist/dialogs/media-picker/media-picker.d.ts.map +1 -0
- package/dist/dialogs/media-picker/media-picker.js +99 -0
- package/dist/dialogs/media-picker/media-picker.test.d.ts +2 -0
- package/dist/dialogs/media-picker/media-picker.test.d.ts.map +1 -0
- package/dist/dialogs/media-picker/media-picker.test.js +161 -0
- package/dist/dialogs/media-picker/media-ref.d.ts +28 -0
- package/dist/dialogs/media-picker/media-ref.d.ts.map +1 -0
- package/dist/dialogs/media-picker/media-ref.js +52 -0
- package/dist/dnd/check.d.ts +8 -0
- package/dist/dnd/check.d.ts.map +1 -0
- package/dist/dnd/check.js +12 -0
- package/dist/dnd/destinations.d.ts +15 -0
- package/dist/dnd/destinations.d.ts.map +1 -0
- package/dist/dnd/destinations.js +43 -0
- package/dist/dnd/dnd-react.test.d.ts +2 -0
- package/dist/dnd/dnd-react.test.d.ts.map +1 -0
- package/dist/dnd/dnd-react.test.js +93 -0
- package/dist/dnd/dnd.test.d.ts +2 -0
- package/dist/dnd/dnd.test.d.ts.map +1 -0
- package/dist/dnd/dnd.test.js +327 -0
- package/dist/dnd/engine.d.ts +85 -0
- package/dist/dnd/engine.d.ts.map +1 -0
- package/dist/dnd/engine.js +185 -0
- package/dist/dnd/fragment.d.ts +6 -0
- package/dist/dnd/fragment.d.ts.map +1 -0
- package/dist/dnd/fragment.js +18 -0
- package/dist/dnd/geometry.d.ts +30 -0
- package/dist/dnd/geometry.d.ts.map +1 -0
- package/dist/dnd/geometry.js +31 -0
- package/dist/dnd/index.d.ts +14 -0
- package/dist/dnd/index.d.ts.map +1 -0
- package/dist/dnd/index.js +7 -0
- package/dist/dnd/move-to-dialog.d.ts +13 -0
- package/dist/dnd/move-to-dialog.d.ts.map +1 -0
- package/dist/dnd/move-to-dialog.js +30 -0
- package/dist/dnd/react.d.ts +43 -0
- package/dist/dnd/react.d.ts.map +1 -0
- package/dist/dnd/react.js +185 -0
- package/dist/dnd/tree-target.d.ts +29 -0
- package/dist/dnd/tree-target.d.ts.map +1 -0
- package/dist/dnd/tree-target.js +97 -0
- package/dist/fonts/LICENSE-inter.txt +93 -0
- package/dist/fonts/inter-latin-400-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-500-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-600-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-400-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-500-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-600-normal.woff2 +0 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/messages/en.d.ts +335 -0
- package/dist/messages/en.d.ts.map +1 -0
- package/dist/messages/en.js +332 -0
- package/dist/messages/index.d.ts +16 -0
- package/dist/messages/index.d.ts.map +1 -0
- package/dist/messages/index.js +22 -0
- package/dist/messages/pl.d.ts +3 -0
- package/dist/messages/pl.d.ts.map +1 -0
- package/dist/messages/pl.js +327 -0
- package/dist/panels/breadcrumbs/breadcrumbs.d.ts +6 -0
- package/dist/panels/breadcrumbs/breadcrumbs.d.ts.map +1 -0
- package/dist/panels/breadcrumbs/breadcrumbs.js +24 -0
- package/dist/panels/breadcrumbs/breadcrumbs.test.d.ts +2 -0
- package/dist/panels/breadcrumbs/breadcrumbs.test.d.ts.map +1 -0
- package/dist/panels/breadcrumbs/breadcrumbs.test.js +56 -0
- package/dist/panels/index.d.ts +9 -0
- package/dist/panels/index.d.ts.map +1 -0
- package/dist/panels/index.js +6 -0
- package/dist/panels/insert/catalog.d.ts +30 -0
- package/dist/panels/insert/catalog.d.ts.map +1 -0
- package/dist/panels/insert/catalog.js +76 -0
- package/dist/panels/insert/catalog.order.test.d.ts +2 -0
- package/dist/panels/insert/catalog.order.test.d.ts.map +1 -0
- package/dist/panels/insert/catalog.order.test.js +17 -0
- package/dist/panels/insert/category-name.d.ts +4 -0
- package/dist/panels/insert/category-name.d.ts.map +1 -0
- package/dist/panels/insert/category-name.js +8 -0
- package/dist/panels/insert/index.d.ts +3 -0
- package/dist/panels/insert/index.d.ts.map +1 -0
- package/dist/panels/insert/index.js +2 -0
- package/dist/panels/insert/insert-panel.d.ts +7 -0
- package/dist/panels/insert/insert-panel.d.ts.map +1 -0
- package/dist/panels/insert/insert-panel.js +155 -0
- package/dist/panels/insert/insert-panel.test.d.ts +2 -0
- package/dist/panels/insert/insert-panel.test.d.ts.map +1 -0
- package/dist/panels/insert/insert-panel.test.js +323 -0
- package/dist/panels/insert/target.d.ts +17 -0
- package/dist/panels/insert/target.d.ts.map +1 -0
- package/dist/panels/insert/target.js +48 -0
- package/dist/panels/inspector/controls/boolean.d.ts +4 -0
- package/dist/panels/inspector/controls/boolean.d.ts.map +1 -0
- package/dist/panels/inspector/controls/boolean.js +4 -0
- package/dist/panels/inspector/controls/compound.d.ts +15 -0
- package/dist/panels/inspector/controls/compound.d.ts.map +1 -0
- package/dist/panels/inspector/controls/compound.js +99 -0
- package/dist/panels/inspector/controls/compound.test.d.ts +2 -0
- package/dist/panels/inspector/controls/compound.test.d.ts.map +1 -0
- package/dist/panels/inspector/controls/compound.test.js +195 -0
- package/dist/panels/inspector/controls/icon.d.ts +5 -0
- package/dist/panels/inspector/controls/icon.d.ts.map +1 -0
- package/dist/panels/inspector/controls/icon.js +6 -0
- package/dist/panels/inspector/controls/index.d.ts +13 -0
- package/dist/panels/inspector/controls/index.d.ts.map +1 -0
- package/dist/panels/inspector/controls/index.js +11 -0
- package/dist/panels/inspector/controls/label.d.ts +4 -0
- package/dist/panels/inspector/controls/label.d.ts.map +1 -0
- package/dist/panels/inspector/controls/label.js +8 -0
- package/dist/panels/inspector/controls/link.d.ts +5 -0
- package/dist/panels/inspector/controls/link.d.ts.map +1 -0
- package/dist/panels/inspector/controls/link.js +6 -0
- package/dist/panels/inspector/controls/media.d.ts +9 -0
- package/dist/panels/inspector/controls/media.d.ts.map +1 -0
- package/dist/panels/inspector/controls/media.js +21 -0
- package/dist/panels/inspector/controls/number.d.ts +10 -0
- package/dist/panels/inspector/controls/number.d.ts.map +1 -0
- package/dist/panels/inspector/controls/number.js +33 -0
- package/dist/panels/inspector/controls/rich-text-model.d.ts +20 -0
- package/dist/panels/inspector/controls/rich-text-model.d.ts.map +1 -0
- package/dist/panels/inspector/controls/rich-text-model.js +91 -0
- package/dist/panels/inspector/controls/rich-text.d.ts +10 -0
- package/dist/panels/inspector/controls/rich-text.d.ts.map +1 -0
- package/dist/panels/inspector/controls/rich-text.js +159 -0
- package/dist/panels/inspector/controls/select.d.ts +5 -0
- package/dist/panels/inspector/controls/select.d.ts.map +1 -0
- package/dist/panels/inspector/controls/select.js +16 -0
- package/dist/panels/inspector/controls/select.test.d.ts +2 -0
- package/dist/panels/inspector/controls/select.test.d.ts.map +1 -0
- package/dist/panels/inspector/controls/select.test.js +43 -0
- package/dist/panels/inspector/controls/text.d.ts +4 -0
- package/dist/panels/inspector/controls/text.d.ts.map +1 -0
- package/dist/panels/inspector/controls/text.js +5 -0
- package/dist/panels/inspector/controls/textarea.d.ts +4 -0
- package/dist/panels/inspector/controls/textarea.d.ts.map +1 -0
- package/dist/panels/inspector/controls/textarea.js +4 -0
- package/dist/panels/inspector/controls/types.d.ts +16 -0
- package/dist/panels/inspector/controls/types.d.ts.map +1 -0
- package/dist/panels/inspector/controls/types.js +1 -0
- package/dist/panels/inspector/index.d.ts +17 -0
- package/dist/panels/inspector/index.d.ts.map +1 -0
- package/dist/panels/inspector/index.js +9 -0
- package/dist/panels/inspector/inspector.d.ts +16 -0
- package/dist/panels/inspector/inspector.d.ts.map +1 -0
- package/dist/panels/inspector/inspector.js +116 -0
- package/dist/panels/inspector/inspector.test.d.ts +2 -0
- package/dist/panels/inspector/inspector.test.d.ts.map +1 -0
- package/dist/panels/inspector/inspector.test.js +328 -0
- package/dist/panels/inspector/props-panel.d.ts +26 -0
- package/dist/panels/inspector/props-panel.d.ts.map +1 -0
- package/dist/panels/inspector/props-panel.js +117 -0
- package/dist/panels/inspector/styles/box-model.d.ts +20 -0
- package/dist/panels/inspector/styles/box-model.d.ts.map +1 -0
- package/dist/panels/inspector/styles/box-model.js +31 -0
- package/dist/panels/inspector/styles/index.d.ts +5 -0
- package/dist/panels/inspector/styles/index.d.ts.map +1 -0
- package/dist/panels/inspector/styles/index.js +2 -0
- package/dist/panels/inspector/styles/model.d.ts +55 -0
- package/dist/panels/inspector/styles/model.d.ts.map +1 -0
- package/dist/panels/inspector/styles/model.js +111 -0
- package/dist/panels/inspector/styles/segments.d.ts +18 -0
- package/dist/panels/inspector/styles/segments.d.ts.map +1 -0
- package/dist/panels/inspector/styles/segments.js +75 -0
- package/dist/panels/inspector/styles/sides-editor.d.ts +34 -0
- package/dist/panels/inspector/styles/sides-editor.d.ts.map +1 -0
- package/dist/panels/inspector/styles/sides-editor.js +86 -0
- package/dist/panels/inspector/styles/style-inspector.d.ts +15 -0
- package/dist/panels/inspector/styles/style-inspector.d.ts.map +1 -0
- package/dist/panels/inspector/styles/style-inspector.js +219 -0
- package/dist/panels/inspector/styles/style-inspector.test.d.ts +2 -0
- package/dist/panels/inspector/styles/style-inspector.test.d.ts.map +1 -0
- package/dist/panels/inspector/styles/style-inspector.test.js +265 -0
- package/dist/panels/inspector/styles/token-picker.d.ts +15 -0
- package/dist/panels/inspector/styles/token-picker.d.ts.map +1 -0
- package/dist/panels/inspector/styles/token-picker.js +23 -0
- package/dist/panels/inspector/styles/use-style-value.d.ts +28 -0
- package/dist/panels/inspector/styles/use-style-value.d.ts.map +1 -0
- package/dist/panels/inspector/styles/use-style-value.js +51 -0
- package/dist/panels/inspector/value.d.ts +20 -0
- package/dist/panels/inspector/value.d.ts.map +1 -0
- package/dist/panels/inspector/value.js +32 -0
- package/dist/panels/inspector/values/analyze.d.ts +49 -0
- package/dist/panels/inspector/values/analyze.d.ts.map +1 -0
- package/dist/panels/inspector/values/analyze.js +115 -0
- package/dist/panels/inspector/values/data.d.ts +18 -0
- package/dist/panels/inspector/values/data.d.ts.map +1 -0
- package/dist/panels/inspector/values/data.js +10 -0
- package/dist/panels/inspector/values/translation.d.ts +20 -0
- package/dist/panels/inspector/values/translation.d.ts.map +1 -0
- package/dist/panels/inspector/values/translation.js +25 -0
- package/dist/panels/inspector/values/value-editor.d.ts +30 -0
- package/dist/panels/inspector/values/value-editor.d.ts.map +1 -0
- package/dist/panels/inspector/values/value-editor.js +191 -0
- package/dist/panels/inspector/values/values.test.d.ts +2 -0
- package/dist/panels/inspector/values/values.test.d.ts.map +1 -0
- package/dist/panels/inspector/values/values.test.js +173 -0
- package/dist/panels/issues/collect.d.ts +70 -0
- package/dist/panels/issues/collect.d.ts.map +1 -0
- package/dist/panels/issues/collect.js +96 -0
- package/dist/panels/issues/index.d.ts +5 -0
- package/dist/panels/issues/index.d.ts.map +1 -0
- package/dist/panels/issues/index.js +2 -0
- package/dist/panels/issues/issues-panel.d.ts +17 -0
- package/dist/panels/issues/issues-panel.d.ts.map +1 -0
- package/dist/panels/issues/issues-panel.js +77 -0
- package/dist/panels/layers/flatten.d.ts +28 -0
- package/dist/panels/layers/flatten.d.ts.map +1 -0
- package/dist/panels/layers/flatten.js +61 -0
- package/dist/panels/layers/layers-panel.d.ts +14 -0
- package/dist/panels/layers/layers-panel.d.ts.map +1 -0
- package/dist/panels/layers/layers-panel.js +428 -0
- package/dist/panels/layers/layers-panel.test.d.ts +2 -0
- package/dist/panels/layers/layers-panel.test.d.ts.map +1 -0
- package/dist/panels/layers/layers-panel.test.js +315 -0
- package/dist/persistence/controller.d.ts +55 -0
- package/dist/persistence/controller.d.ts.map +1 -0
- package/dist/persistence/controller.js +341 -0
- package/dist/persistence/index.d.ts +6 -0
- package/dist/persistence/index.d.ts.map +1 -0
- package/dist/persistence/index.js +3 -0
- package/dist/persistence/load.d.ts +35 -0
- package/dist/persistence/load.d.ts.map +1 -0
- package/dist/persistence/load.js +67 -0
- package/dist/persistence/persistence.test.d.ts +2 -0
- package/dist/persistence/persistence.test.d.ts.map +1 -0
- package/dist/persistence/persistence.test.js +483 -0
- package/dist/persistence/react.d.ts +18 -0
- package/dist/persistence/react.d.ts.map +1 -0
- package/dist/persistence/react.js +105 -0
- package/dist/persistence/types.d.ts +182 -0
- package/dist/persistence/types.d.ts.map +1 -0
- package/dist/persistence/types.js +1 -0
- package/dist/preview/index.d.ts +3 -0
- package/dist/preview/index.d.ts.map +1 -0
- package/dist/preview/index.js +2 -0
- package/dist/preview/prepare.d.ts +16 -0
- package/dist/preview/prepare.d.ts.map +1 -0
- package/dist/preview/prepare.js +21 -0
- package/dist/preview/preview.d.ts +27 -0
- package/dist/preview/preview.d.ts.map +1 -0
- package/dist/preview/preview.js +51 -0
- package/dist/preview/preview.test.d.ts +2 -0
- package/dist/preview/preview.test.d.ts.map +1 -0
- package/dist/preview/preview.test.js +129 -0
- package/dist/shortcuts/actions.d.ts +17 -0
- package/dist/shortcuts/actions.d.ts.map +1 -0
- package/dist/shortcuts/actions.js +85 -0
- package/dist/shortcuts/index.d.ts +11 -0
- package/dist/shortcuts/index.d.ts.map +1 -0
- package/dist/shortcuts/index.js +5 -0
- package/dist/shortcuts/keys.d.ts +29 -0
- package/dist/shortcuts/keys.d.ts.map +1 -0
- package/dist/shortcuts/keys.js +100 -0
- package/dist/shortcuts/map.d.ts +17 -0
- package/dist/shortcuts/map.d.ts.map +1 -0
- package/dist/shortcuts/map.js +31 -0
- package/dist/shortcuts/registry.d.ts +32 -0
- package/dist/shortcuts/registry.d.ts.map +1 -0
- package/dist/shortcuts/registry.js +53 -0
- package/dist/shortcuts/shortcuts.d.ts +32 -0
- package/dist/shortcuts/shortcuts.d.ts.map +1 -0
- package/dist/shortcuts/shortcuts.js +95 -0
- package/dist/shortcuts/shortcuts.test.d.ts +2 -0
- package/dist/shortcuts/shortcuts.test.d.ts.map +1 -0
- package/dist/shortcuts/shortcuts.test.js +263 -0
- package/dist/store/create-store.d.ts +13 -0
- package/dist/store/create-store.d.ts.map +1 -0
- package/dist/store/create-store.js +248 -0
- package/dist/store/index.d.ts +9 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +5 -0
- package/dist/store/locale.d.ts +23 -0
- package/dist/store/locale.d.ts.map +1 -0
- package/dist/store/locale.js +31 -0
- package/dist/store/react.d.ts +17 -0
- package/dist/store/react.d.ts.map +1 -0
- package/dist/store/react.js +32 -0
- package/dist/store/selection.d.ts +32 -0
- package/dist/store/selection.d.ts.map +1 -0
- package/dist/store/selection.js +84 -0
- package/dist/store/selection.test.d.ts +2 -0
- package/dist/store/selection.test.d.ts.map +1 -0
- package/dist/store/selection.test.js +95 -0
- package/dist/store/selectors.d.ts +18 -0
- package/dist/store/selectors.d.ts.map +1 -0
- package/dist/store/selectors.js +39 -0
- package/dist/store/store.test.d.ts +2 -0
- package/dist/store/store.test.d.ts.map +1 -0
- package/dist/store/store.test.js +331 -0
- package/dist/store/types.d.ts +114 -0
- package/dist/store/types.d.ts.map +1 -0
- package/dist/store/types.js +1 -0
- package/dist/styles/tokens.test.d.ts +2 -0
- package/dist/styles/tokens.test.d.ts.map +1 -0
- package/dist/styles/tokens.test.js +199 -0
- package/dist/styles.css +2885 -0
- package/dist/toolbar/brand.d.ts +7 -0
- package/dist/toolbar/brand.d.ts.map +1 -0
- package/dist/toolbar/brand.js +11 -0
- package/dist/toolbar/breakpoint-control.d.ts +9 -0
- package/dist/toolbar/breakpoint-control.d.ts.map +1 -0
- package/dist/toolbar/breakpoint-control.js +23 -0
- package/dist/toolbar/editable-title.d.ts +14 -0
- package/dist/toolbar/editable-title.d.ts.map +1 -0
- package/dist/toolbar/editable-title.js +46 -0
- package/dist/toolbar/editable-title.test.d.ts +2 -0
- package/dist/toolbar/editable-title.test.d.ts.map +1 -0
- package/dist/toolbar/editable-title.test.js +53 -0
- package/dist/toolbar/index.d.ts +12 -0
- package/dist/toolbar/index.d.ts.map +1 -0
- package/dist/toolbar/index.js +5 -0
- package/dist/toolbar/locale-switcher.d.ts +10 -0
- package/dist/toolbar/locale-switcher.d.ts.map +1 -0
- package/dist/toolbar/locale-switcher.js +20 -0
- package/dist/toolbar/more-menu.d.ts +12 -0
- package/dist/toolbar/more-menu.d.ts.map +1 -0
- package/dist/toolbar/more-menu.js +47 -0
- package/dist/toolbar/panel-toggles.d.ts +9 -0
- package/dist/toolbar/panel-toggles.d.ts.map +1 -0
- package/dist/toolbar/panel-toggles.js +19 -0
- package/dist/toolbar/publish-dialog.d.ts +18 -0
- package/dist/toolbar/publish-dialog.d.ts.map +1 -0
- package/dist/toolbar/publish-dialog.js +49 -0
- package/dist/toolbar/publish.test.d.ts +2 -0
- package/dist/toolbar/publish.test.d.ts.map +1 -0
- package/dist/toolbar/publish.test.js +258 -0
- package/dist/toolbar/sample-picker.d.ts +18 -0
- package/dist/toolbar/sample-picker.d.ts.map +1 -0
- package/dist/toolbar/sample-picker.js +72 -0
- package/dist/toolbar/sample-picker.test.d.ts +2 -0
- package/dist/toolbar/sample-picker.test.d.ts.map +1 -0
- package/dist/toolbar/sample-picker.test.js +78 -0
- package/dist/toolbar/save-indicator.d.ts +8 -0
- package/dist/toolbar/save-indicator.d.ts.map +1 -0
- package/dist/toolbar/save-indicator.js +30 -0
- package/dist/toolbar/theme.d.ts +22 -0
- package/dist/toolbar/theme.d.ts.map +1 -0
- package/dist/toolbar/theme.js +46 -0
- package/dist/toolbar/theme.test.d.ts +2 -0
- package/dist/toolbar/theme.test.d.ts.map +1 -0
- package/dist/toolbar/theme.test.js +49 -0
- package/dist/toolbar/toolbar-centre.d.ts +13 -0
- package/dist/toolbar/toolbar-centre.d.ts.map +1 -0
- package/dist/toolbar/toolbar-centre.js +7 -0
- package/dist/toolbar/toolbar-left.d.ts +12 -0
- package/dist/toolbar/toolbar-left.d.ts.map +1 -0
- package/dist/toolbar/toolbar-left.js +16 -0
- package/dist/toolbar/toolbar-right.d.ts +19 -0
- package/dist/toolbar/toolbar-right.d.ts.map +1 -0
- package/dist/toolbar/toolbar-right.js +21 -0
- package/dist/toolbar/toolbar.d.ts +38 -0
- package/dist/toolbar/toolbar.d.ts.map +1 -0
- package/dist/toolbar/toolbar.js +27 -0
- package/dist/toolbar/toolbar.test.d.ts +2 -0
- package/dist/toolbar/toolbar.test.d.ts.map +1 -0
- package/dist/toolbar/toolbar.test.js +289 -0
- package/dist/toolbar/use-overflow-level.d.ts +9 -0
- package/dist/toolbar/use-overflow-level.d.ts.map +1 -0
- package/dist/toolbar/use-overflow-level.js +40 -0
- package/dist/toolbar/zoom-menu.d.ts +10 -0
- package/dist/toolbar/zoom-menu.d.ts.map +1 -0
- package/dist/toolbar/zoom-menu.js +17 -0
- package/dist/ui/icon.d.ts +102 -0
- package/dist/ui/icon.d.ts.map +1 -0
- package/dist/ui/icon.js +182 -0
- package/dist/ui/icon.test.d.ts +2 -0
- package/dist/ui/icon.test.d.ts.map +1 -0
- package/dist/ui/icon.test.js +115 -0
- package/dist/ui/index.d.ts +11 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +5 -0
- package/dist/ui/panel.d.ts +18 -0
- package/dist/ui/panel.d.ts.map +1 -0
- package/dist/ui/panel.js +21 -0
- package/dist/ui/portal.d.ts +14 -0
- package/dist/ui/portal.d.ts.map +1 -0
- package/dist/ui/portal.js +14 -0
- package/dist/ui/primitives.d.ts +190 -0
- package/dist/ui/primitives.d.ts.map +1 -0
- package/dist/ui/primitives.js +164 -0
- package/dist/ui/primitives.test.d.ts +2 -0
- package/dist/ui/primitives.test.d.ts.map +1 -0
- package/dist/ui/primitives.test.js +215 -0
- package/dist/ui/toast.d.ts +39 -0
- package/dist/ui/toast.d.ts.map +1 -0
- package/dist/ui/toast.js +76 -0
- package/dist/ui/toast.test.d.ts +2 -0
- package/dist/ui/toast.test.d.ts.map +1 -0
- package/dist/ui/toast.test.js +95 -0
- package/package.json +67 -3
package/dist/ui/icon.js
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { AlignCenterVertical, AlignEndVertical, AlignHorizontalJustifyCenter, AlignHorizontalJustifyEnd, AlignHorizontalJustifyStart, AlignHorizontalSpaceAround, AlignHorizontalSpaceBetween, AlignStartVertical, ArrowDown, ArrowLeft, ArrowRight, ArrowUp, Award, Ban, Box, Braces, Calendar, CaseLower, CaseSensitive, CaseUpper, ChartColumn, Check, ChevronDown, ChevronRight, ChevronsUpDown, Circle, CircleAlert, CircleCheck, ClipboardList, Clock, Code, Columns2, Columns3, Copy, CreditCard, Database, Dot, Ellipsis, Eye, File, FileText, Folder, GalleryHorizontal, Globe, Grid3x3, Hash, Heading, Heart, History, Image, Images, Info, Italic, Keyboard, Layers, LayoutGrid, LayoutTemplate, Link, Link2, List, ListChecks, ListOrdered, LoaderCircle, Lock, Mail, MapPin, Megaphone, Menu, MessageSquare, Monitor, MonitorSmartphone, Moon, MousePointerClick, Music, Navigation, PanelBottom, PanelLeft, PanelRight, PanelTop, Phone, Pilcrow, Play, Quote, Radio, RectangleHorizontal, RectangleVertical, Redo2, Repeat, RotateCcw, Rows2, Rows3, Search, SeparatorHorizontal, ShoppingBag, ShoppingCart, Sigma, SlidersHorizontal, Smartphone, Sparkles, Square, SquareCheck, SquareChevronDown, SquareDashed, SquarePen, Star, StretchVertical, Strikethrough, Sun, Table, Tablet, Tag, TextAlignCenter, TextAlignEnd, TextAlignJustify, TextAlignStart, TextCursorInput, ToggleLeft, Trash2, TriangleAlert, Type, Underline, Undo2, Unlink2, User, Users, Video, X, } from 'lucide-react';
|
|
3
|
+
/*
|
|
4
|
+
* The icon vocabulary of the editor. Both maps are static and curated on purpose: each icon is
|
|
5
|
+
* imported by name so the bundler keeps only these (no `DynamicIcon`, no whole-set import).
|
|
6
|
+
* Names are lucide's canonical kebab-case names; a unit test checks every one against lucide's
|
|
7
|
+
* own export list. To support another icon, add it to a map (see docs/component-registry.md).
|
|
8
|
+
*/
|
|
9
|
+
/** The icons the editor's own chrome uses. */
|
|
10
|
+
const EDITOR_ICONS = {
|
|
11
|
+
'text-align-center': TextAlignCenter,
|
|
12
|
+
'align-center-vertical': AlignCenterVertical,
|
|
13
|
+
'align-end-vertical': AlignEndVertical,
|
|
14
|
+
'align-horizontal-justify-center': AlignHorizontalJustifyCenter,
|
|
15
|
+
'align-horizontal-justify-end': AlignHorizontalJustifyEnd,
|
|
16
|
+
'align-horizontal-justify-start': AlignHorizontalJustifyStart,
|
|
17
|
+
'align-horizontal-space-around': AlignHorizontalSpaceAround,
|
|
18
|
+
'align-horizontal-space-between': AlignHorizontalSpaceBetween,
|
|
19
|
+
'text-align-justify': TextAlignJustify,
|
|
20
|
+
'text-align-start': TextAlignStart,
|
|
21
|
+
'text-align-end': TextAlignEnd,
|
|
22
|
+
'align-start-vertical': AlignStartVertical,
|
|
23
|
+
'arrow-right': ArrowRight,
|
|
24
|
+
braces: Braces,
|
|
25
|
+
calendar: Calendar,
|
|
26
|
+
database: Database,
|
|
27
|
+
hash: Hash,
|
|
28
|
+
image: Image,
|
|
29
|
+
sigma: Sigma,
|
|
30
|
+
'stretch-vertical': StretchVertical,
|
|
31
|
+
'toggle-left': ToggleLeft,
|
|
32
|
+
type: Type,
|
|
33
|
+
ban: Ban,
|
|
34
|
+
'case-lower': CaseLower,
|
|
35
|
+
'case-sensitive': CaseSensitive,
|
|
36
|
+
'case-upper': CaseUpper,
|
|
37
|
+
italic: Italic,
|
|
38
|
+
'link-2': Link2,
|
|
39
|
+
strikethrough: Strikethrough,
|
|
40
|
+
underline: Underline,
|
|
41
|
+
'unlink-2': Unlink2,
|
|
42
|
+
'arrow-down': ArrowDown,
|
|
43
|
+
'arrow-left': ArrowLeft,
|
|
44
|
+
'arrow-up': ArrowUp,
|
|
45
|
+
box: Box,
|
|
46
|
+
check: Check,
|
|
47
|
+
'chevron-down': ChevronDown,
|
|
48
|
+
'chevron-right': ChevronRight,
|
|
49
|
+
circle: Circle,
|
|
50
|
+
copy: Copy,
|
|
51
|
+
'circle-alert': CircleAlert,
|
|
52
|
+
'circle-check': CircleCheck,
|
|
53
|
+
ellipsis: Ellipsis,
|
|
54
|
+
eye: Eye,
|
|
55
|
+
history: History,
|
|
56
|
+
keyboard: Keyboard,
|
|
57
|
+
'layout-grid': LayoutGrid,
|
|
58
|
+
info: Info,
|
|
59
|
+
link: Link,
|
|
60
|
+
list: List,
|
|
61
|
+
'list-ordered': ListOrdered,
|
|
62
|
+
'loader-circle': LoaderCircle,
|
|
63
|
+
lock: Lock,
|
|
64
|
+
monitor: Monitor,
|
|
65
|
+
'monitor-smartphone': MonitorSmartphone,
|
|
66
|
+
moon: Moon,
|
|
67
|
+
'mouse-pointer-click': MousePointerClick,
|
|
68
|
+
'panel-left': PanelLeft,
|
|
69
|
+
'panel-right': PanelRight,
|
|
70
|
+
'redo-2': Redo2,
|
|
71
|
+
'rotate-ccw': RotateCcw,
|
|
72
|
+
smartphone: Smartphone,
|
|
73
|
+
sun: Sun,
|
|
74
|
+
tablet: Tablet,
|
|
75
|
+
'trash-2': Trash2,
|
|
76
|
+
search: Search,
|
|
77
|
+
'triangle-alert': TriangleAlert,
|
|
78
|
+
'undo-2': Undo2,
|
|
79
|
+
x: X,
|
|
80
|
+
};
|
|
81
|
+
/** Icons a component's `meta.icon` may name: the built-in catalogue plus a common vocabulary. */
|
|
82
|
+
const COMPONENT_ICONS = {
|
|
83
|
+
// built-in components
|
|
84
|
+
file: File,
|
|
85
|
+
'rectangle-horizontal': RectangleHorizontal,
|
|
86
|
+
'square-dashed': SquareDashed,
|
|
87
|
+
'rows-3': Rows3,
|
|
88
|
+
'layout-grid': LayoutGrid,
|
|
89
|
+
'panel-top': PanelTop,
|
|
90
|
+
heading: Heading,
|
|
91
|
+
type: Type,
|
|
92
|
+
pilcrow: Pilcrow,
|
|
93
|
+
link: Link,
|
|
94
|
+
'mouse-pointer-click': MousePointerClick,
|
|
95
|
+
image: Image,
|
|
96
|
+
sparkles: Sparkles,
|
|
97
|
+
tag: Tag,
|
|
98
|
+
'separator-horizontal': SeparatorHorizontal,
|
|
99
|
+
list: List,
|
|
100
|
+
dot: Dot,
|
|
101
|
+
'chevrons-up-down': ChevronsUpDown,
|
|
102
|
+
'chevron-down': ChevronDown,
|
|
103
|
+
repeat: Repeat,
|
|
104
|
+
ellipsis: Ellipsis,
|
|
105
|
+
'clipboard-list': ClipboardList,
|
|
106
|
+
'text-cursor-input': TextCursorInput,
|
|
107
|
+
'text-align-start': TextAlignStart,
|
|
108
|
+
'square-check': SquareCheck,
|
|
109
|
+
'square-chevron-down': SquareChevronDown,
|
|
110
|
+
// layout
|
|
111
|
+
box: Box,
|
|
112
|
+
square: Square,
|
|
113
|
+
'rectangle-vertical': RectangleVertical,
|
|
114
|
+
'rows-2': Rows2,
|
|
115
|
+
'columns-2': Columns2,
|
|
116
|
+
'columns-3': Columns3,
|
|
117
|
+
'layout-template': LayoutTemplate,
|
|
118
|
+
'panel-left': PanelLeft,
|
|
119
|
+
'panel-right': PanelRight,
|
|
120
|
+
'panel-bottom': PanelBottom,
|
|
121
|
+
layers: Layers,
|
|
122
|
+
folder: Folder,
|
|
123
|
+
menu: Menu,
|
|
124
|
+
navigation: Navigation,
|
|
125
|
+
// text
|
|
126
|
+
'file-text': FileText,
|
|
127
|
+
quote: Quote,
|
|
128
|
+
'list-ordered': ListOrdered,
|
|
129
|
+
'list-checks': ListChecks,
|
|
130
|
+
'message-square': MessageSquare,
|
|
131
|
+
megaphone: Megaphone,
|
|
132
|
+
// media
|
|
133
|
+
video: Video,
|
|
134
|
+
play: Play,
|
|
135
|
+
music: Music,
|
|
136
|
+
images: Images,
|
|
137
|
+
'gallery-horizontal': GalleryHorizontal,
|
|
138
|
+
star: Star,
|
|
139
|
+
heart: Heart,
|
|
140
|
+
award: Award,
|
|
141
|
+
// form
|
|
142
|
+
'square-pen': SquarePen,
|
|
143
|
+
circle: Circle,
|
|
144
|
+
radio: Radio,
|
|
145
|
+
'toggle-left': ToggleLeft,
|
|
146
|
+
'sliders-horizontal': SlidersHorizontal,
|
|
147
|
+
search: Search,
|
|
148
|
+
mail: Mail,
|
|
149
|
+
phone: Phone,
|
|
150
|
+
// data
|
|
151
|
+
table: Table,
|
|
152
|
+
'grid-3x3': Grid3x3,
|
|
153
|
+
'chart-column': ChartColumn,
|
|
154
|
+
database: Database,
|
|
155
|
+
code: Code,
|
|
156
|
+
globe: Globe,
|
|
157
|
+
'map-pin': MapPin,
|
|
158
|
+
calendar: Calendar,
|
|
159
|
+
clock: Clock,
|
|
160
|
+
user: User,
|
|
161
|
+
users: Users,
|
|
162
|
+
'shopping-cart': ShoppingCart,
|
|
163
|
+
'shopping-bag': ShoppingBag,
|
|
164
|
+
'credit-card': CreditCard,
|
|
165
|
+
};
|
|
166
|
+
/** The names `ComponentIcon` resolves (everything else shows the neutral `box`). */
|
|
167
|
+
export const componentIconNames = Object.keys(COMPONENT_ICONS);
|
|
168
|
+
const SIZES = { sm: 16, md: 20 };
|
|
169
|
+
const STROKE = 1.5;
|
|
170
|
+
function draw(Glyph, name, size, label, className, fallback) {
|
|
171
|
+
return (_jsx(Glyph, { size: SIZES[size], strokeWidth: STROKE, absoluteStrokeWidth: true, className: className === undefined ? 'bd-icon' : `bd-icon ${className}`, "data-icon": name, ...(fallback ? { 'data-fallback': 'true' } : {}), ...(label === undefined ? { 'aria-hidden': true } : { role: 'img', 'aria-label': label }) }));
|
|
172
|
+
}
|
|
173
|
+
/** One of the editor's own icons, drawn in `currentColor`. */
|
|
174
|
+
export function Icon({ name, size = 'sm', label, className }) {
|
|
175
|
+
return draw(EDITOR_ICONS[name], name, size, label, className, false);
|
|
176
|
+
}
|
|
177
|
+
/** The icon of a component; a missing or unknown name gives a neutral box, never a letter. */
|
|
178
|
+
export function ComponentIcon({ meta, size = 'sm', className }) {
|
|
179
|
+
const name = meta?.icon;
|
|
180
|
+
const glyph = name !== undefined && Object.hasOwn(COMPONENT_ICONS, name) ? COMPONENT_ICONS[name] : undefined;
|
|
181
|
+
return draw(glyph ?? Box, glyph === undefined ? 'box' : name, size, undefined, className, glyph === undefined);
|
|
182
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.test.d.ts","sourceRoot":"","sources":["../../src/ui/icon.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// @vitest-environment jsdom
|
|
3
|
+
import { readdirSync, readFileSync, statSync } from 'node:fs';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import { icons } from 'lucide-react';
|
|
6
|
+
import { act } from 'react';
|
|
7
|
+
import { createRoot } from 'react-dom/client';
|
|
8
|
+
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
|
|
9
|
+
import { axe } from 'vitest-axe';
|
|
10
|
+
import * as matchers from 'vitest-axe/matchers';
|
|
11
|
+
import { MessagesProvider } from '../messages/index.js';
|
|
12
|
+
import { ComponentIcon, componentIconNames, Icon, IconButton } from './index.js';
|
|
13
|
+
expect.extend(matchers);
|
|
14
|
+
globalThis.IS_REACT_ACT_ENVIRONMENT = true;
|
|
15
|
+
const pascal = (kebab) => kebab
|
|
16
|
+
.split('-')
|
|
17
|
+
.map((part) => part.charAt(0).toUpperCase() + part.slice(1))
|
|
18
|
+
.join('');
|
|
19
|
+
let container;
|
|
20
|
+
let root;
|
|
21
|
+
beforeEach(() => {
|
|
22
|
+
container = document.createElement('div');
|
|
23
|
+
document.body.append(container);
|
|
24
|
+
root = createRoot(container);
|
|
25
|
+
});
|
|
26
|
+
afterEach(() => {
|
|
27
|
+
act(() => root.unmount());
|
|
28
|
+
document.body.innerHTML = '';
|
|
29
|
+
});
|
|
30
|
+
const show = (node) => act(async () => root.render(_jsx(MessagesProvider, { locale: "en", children: node })));
|
|
31
|
+
describe('icon maps', () => {
|
|
32
|
+
it('name only real lucide icons (checked against the lucide-react export list)', () => {
|
|
33
|
+
const unknown = componentIconNames.filter((name) => !(pascal(name) in icons));
|
|
34
|
+
expect(unknown).toEqual([]);
|
|
35
|
+
expect(componentIconNames.length).toBeGreaterThanOrEqual(60);
|
|
36
|
+
});
|
|
37
|
+
it('draws every editor icon, under real lucide names', async () => {
|
|
38
|
+
const names = [
|
|
39
|
+
'text-align-center',
|
|
40
|
+
'text-align-start',
|
|
41
|
+
'arrow-right',
|
|
42
|
+
'braces',
|
|
43
|
+
'database',
|
|
44
|
+
'hash',
|
|
45
|
+
'sigma',
|
|
46
|
+
'stretch-vertical',
|
|
47
|
+
'type',
|
|
48
|
+
'arrow-down',
|
|
49
|
+
'arrow-left',
|
|
50
|
+
'arrow-up',
|
|
51
|
+
'box',
|
|
52
|
+
'chevron-down',
|
|
53
|
+
'chevron-right',
|
|
54
|
+
'eye',
|
|
55
|
+
'layout-grid',
|
|
56
|
+
'link',
|
|
57
|
+
'list',
|
|
58
|
+
'list-ordered',
|
|
59
|
+
'lock',
|
|
60
|
+
'monitor-smartphone',
|
|
61
|
+
'redo-2',
|
|
62
|
+
'search',
|
|
63
|
+
'triangle-alert',
|
|
64
|
+
'undo-2',
|
|
65
|
+
'x',
|
|
66
|
+
];
|
|
67
|
+
await show(names.map((name) => _jsx(Icon, { name: name }, name)));
|
|
68
|
+
expect(names.filter((name) => !(pascal(name) in icons))).toEqual([]);
|
|
69
|
+
expect(container.querySelectorAll('svg')).toHaveLength(names.length);
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
describe('Icon and ComponentIcon', () => {
|
|
73
|
+
it('is decorative by default and an image with a label', async () => {
|
|
74
|
+
await show(_jsxs(_Fragment, { children: [_jsx(Icon, { name: "lock" }), _jsx(Icon, { name: "eye", label: "Visible" })] }));
|
|
75
|
+
const [decorative, named] = [...container.querySelectorAll('svg')];
|
|
76
|
+
expect(decorative?.getAttribute('aria-hidden')).toBe('true');
|
|
77
|
+
expect(named?.getAttribute('role')).toBe('img');
|
|
78
|
+
expect(named?.getAttribute('aria-label')).toBe('Visible');
|
|
79
|
+
expect(named?.hasAttribute('aria-hidden')).toBe(false);
|
|
80
|
+
expect(await axe(container)).toHaveNoViolations();
|
|
81
|
+
});
|
|
82
|
+
it('falls back to the neutral box for an unknown, inherited or missing name', async () => {
|
|
83
|
+
await show(_jsxs(_Fragment, { children: [_jsx(ComponentIcon, { meta: { icon: 'layout-grid' } }), _jsx(ComponentIcon, { meta: { icon: 'nope' } }), _jsx(ComponentIcon, { meta: { icon: 'constructor' } }), _jsx(ComponentIcon, { meta: {} }), _jsx(ComponentIcon, { meta: undefined })] }));
|
|
84
|
+
const svgs = [...container.querySelectorAll('svg')];
|
|
85
|
+
expect(svgs.map((svg) => svg.getAttribute('data-icon'))).toEqual([
|
|
86
|
+
'layout-grid',
|
|
87
|
+
'box',
|
|
88
|
+
'box',
|
|
89
|
+
'box',
|
|
90
|
+
'box',
|
|
91
|
+
]);
|
|
92
|
+
expect(svgs.slice(1).every((svg) => svg.getAttribute('data-fallback') === 'true')).toBe(true);
|
|
93
|
+
expect(container.textContent).toBe('');
|
|
94
|
+
});
|
|
95
|
+
it('keeps the accessible name of an icon button', async () => {
|
|
96
|
+
await show(_jsx(IconButton, { label: "Undo", icon: "undo-2" }));
|
|
97
|
+
const button = container.querySelector('button');
|
|
98
|
+
expect(button?.getAttribute('aria-label')).toBe('Undo');
|
|
99
|
+
expect(button?.querySelector('svg')?.getAttribute('aria-hidden')).toBe('true');
|
|
100
|
+
expect(await axe(container)).toHaveNoViolations();
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
describe('no glyph icons (PB-120)', () => {
|
|
104
|
+
const walk = (dir) => readdirSync(dir).flatMap((entry) => {
|
|
105
|
+
const path = join(dir, entry);
|
|
106
|
+
if (statSync(path).isDirectory())
|
|
107
|
+
return entry === 'fonts' ? [] : walk(path);
|
|
108
|
+
return path.endsWith('.tsx') && !path.endsWith('.test.tsx') ? [path] : [];
|
|
109
|
+
});
|
|
110
|
+
it('uses no arrow, triangle, emoji or multiplication-sign glyph in any component file', () => {
|
|
111
|
+
const glyph = /[←-⇿■-◿☀-➿×\u{1F300}-\u{1FAFF}]/u;
|
|
112
|
+
const offenders = walk(join(import.meta.dirname, '..')).filter((file) => glyph.test(readFileSync(file, 'utf8')));
|
|
113
|
+
expect(offenders).toEqual([]);
|
|
114
|
+
});
|
|
115
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type { ComponentIconProps, IconName, IconProps } from './icon.tsx';
|
|
2
|
+
export { ComponentIcon, componentIconNames, Icon } from './icon.tsx';
|
|
3
|
+
export type { PanelProps } from './panel.tsx';
|
|
4
|
+
export { Panel, PanelBody, PanelFooter, PanelHeader } from './panel.tsx';
|
|
5
|
+
export type { PortalContainerProviderProps } from './portal.tsx';
|
|
6
|
+
export { PortalContainerProvider, usePortalContainer } from './portal.tsx';
|
|
7
|
+
export type { ButtonProps, ColorInputProps, ColorSwatchProps, ContextMenuProps, DialogProps, IconButtonProps, InputProps, MenuItem, NumberUnitInputProps, PopoverProps, SegmentedControlProps, SegmentOption, SelectOption, SelectProps, TabItem, TabsProps, ToggleProps, TooltipProps, } from './primitives.tsx';
|
|
8
|
+
export { Button, ColorInput, ColorSwatch, ContextMenu, Dialog, hexOf, IconButton, Input, NumberUnitInput, Popover, SegmentedControl, Select, stepNumberText, Tabs, Toggle, Tooltip, } from './primitives.tsx';
|
|
9
|
+
export type { ToastApi, ToastOptions, ToastVariant } from './toast.tsx';
|
|
10
|
+
export { TOAST_MS, ToastProvider, useToast } from './toast.tsx';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,kBAAkB,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACrE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACzE,YAAY,EAAE,4BAA4B,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC3E,YAAY,EACV,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,UAAU,EACV,QAAQ,EACR,oBAAoB,EACpB,YAAY,EACZ,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,WAAW,EACX,OAAO,EACP,SAAS,EACT,WAAW,EACX,YAAY,GACb,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,MAAM,EACN,UAAU,EACV,WAAW,EACX,WAAW,EACX,MAAM,EACN,KAAK,EACL,UAAU,EACV,KAAK,EACL,eAAe,EACf,OAAO,EACP,gBAAgB,EAChB,MAAM,EACN,cAAc,EACd,IAAI,EACJ,MAAM,EACN,OAAO,GACR,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/ui/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { ComponentIcon, componentIconNames, Icon } from './icon.js';
|
|
2
|
+
export { Panel, PanelBody, PanelFooter, PanelHeader } from './panel.js';
|
|
3
|
+
export { PortalContainerProvider, usePortalContainer } from './portal.js';
|
|
4
|
+
export { Button, ColorInput, ColorSwatch, ContextMenu, Dialog, hexOf, IconButton, Input, NumberUnitInput, Popover, SegmentedControl, Select, stepNumberText, Tabs, Toggle, Tooltip, } from './primitives.js';
|
|
5
|
+
export { TOAST_MS, ToastProvider, useToast } from './toast.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface PanelProps extends HTMLAttributes<HTMLElement> {
|
|
3
|
+
/** The element: a landmark `aside` for the shell's side panels, a `section` inside them. */
|
|
4
|
+
readonly as?: 'aside' | 'section' | 'div';
|
|
5
|
+
readonly children?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The panel frame (docs/editor-design.md#panel-anatomy): a flat column that scrolls as one; its
|
|
9
|
+
* header and footer stick to the top and bottom edge of it.
|
|
10
|
+
*/
|
|
11
|
+
export declare function Panel({ as: Tag, className, ...rest }: PanelProps): import("react").JSX.Element;
|
|
12
|
+
/** The 40px header: tabs or a title. Sticks to the top of the panel. */
|
|
13
|
+
export declare function PanelHeader({ className, ...rest }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
14
|
+
/** The content, with `--bd-space-4` padding on every side. */
|
|
15
|
+
export declare function PanelBody({ className, ...rest }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
16
|
+
/** Optional actions or a summary; sticks to the bottom of the panel. */
|
|
17
|
+
export declare function PanelFooter({ className, ...rest }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel.d.ts","sourceRoot":"","sources":["../../src/ui/panel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvD,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAC,WAAW,CAAC;IAC7D,4FAA4F;IAC5F,QAAQ,CAAC,EAAE,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,KAAK,CAAC;IAC1C,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,EAAE,EAAE,EAAE,GAAW,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,UAAU,+BAExE;AAED,wEAAwE;AACxE,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,cAAc,CAAC,cAAc,CAAC,+BAEjF;AAED,8DAA8D;AAC9D,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,cAAc,CAAC,cAAc,CAAC,+BAE/E;AAED,wEAAwE;AACxE,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,cAAc,CAAC,cAAc,CAAC,+BAEjF"}
|
package/dist/ui/panel.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
const cx = (...parts) => parts.filter(Boolean).join(' ');
|
|
3
|
+
/**
|
|
4
|
+
* The panel frame (docs/editor-design.md#panel-anatomy): a flat column that scrolls as one; its
|
|
5
|
+
* header and footer stick to the top and bottom edge of it.
|
|
6
|
+
*/
|
|
7
|
+
export function Panel({ as: Tag = 'div', className, ...rest }) {
|
|
8
|
+
return _jsx(Tag, { ...rest, className: cx('bd-panel', className) });
|
|
9
|
+
}
|
|
10
|
+
/** The 40px header: tabs or a title. Sticks to the top of the panel. */
|
|
11
|
+
export function PanelHeader({ className, ...rest }) {
|
|
12
|
+
return _jsx("div", { ...rest, className: cx('bd-panel-header', className) });
|
|
13
|
+
}
|
|
14
|
+
/** The content, with `--bd-space-4` padding on every side. */
|
|
15
|
+
export function PanelBody({ className, ...rest }) {
|
|
16
|
+
return _jsx("div", { ...rest, className: cx('bd-panel-body', className) });
|
|
17
|
+
}
|
|
18
|
+
/** Optional actions or a summary; sticks to the bottom of the panel. */
|
|
19
|
+
export function PanelFooter({ className, ...rest }) {
|
|
20
|
+
return _jsx("div", { ...rest, className: cx('bd-panel-footer', className) });
|
|
21
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export interface PortalContainerProviderProps {
|
|
3
|
+
/** The editor root; floating layers render inside it, so they inherit its theme (`data-theme`). */
|
|
4
|
+
readonly container: HTMLElement | null;
|
|
5
|
+
readonly children: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Where Radix renders menus, popovers, dialogs and tooltips. Without a provider they go to
|
|
9
|
+
* `document.body`, outside `.buildr-editor`, and miss the theme the root carries.
|
|
10
|
+
*/
|
|
11
|
+
export declare function PortalContainerProvider({ container, children }: PortalContainerProviderProps): import("react").JSX.Element;
|
|
12
|
+
/** The element floating layers render into; `undefined` (Radix's default, `document.body`) without a provider. */
|
|
13
|
+
export declare function usePortalContainer(): HTMLElement | undefined;
|
|
14
|
+
//# sourceMappingURL=portal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../src/ui/portal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAc,MAAM,OAAO,CAAC;AAIlE,MAAM,WAAW,4BAA4B;IAC3C,mGAAmG;IACnG,QAAQ,CAAC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IACvC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC9B;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,4BAA4B,+BAI5F;AAED,kHAAkH;AAClH,wBAAgB,kBAAkB,IAAI,WAAW,GAAG,SAAS,CAE5D"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext } from 'react';
|
|
3
|
+
const PortalContainerContext = createContext(null);
|
|
4
|
+
/**
|
|
5
|
+
* Where Radix renders menus, popovers, dialogs and tooltips. Without a provider they go to
|
|
6
|
+
* `document.body`, outside `.buildr-editor`, and miss the theme the root carries.
|
|
7
|
+
*/
|
|
8
|
+
export function PortalContainerProvider({ container, children }) {
|
|
9
|
+
return (_jsx(PortalContainerContext.Provider, { value: container, children: children }));
|
|
10
|
+
}
|
|
11
|
+
/** The element floating layers render into; `undefined` (Radix's default, `document.body`) without a provider. */
|
|
12
|
+
export function usePortalContainer() {
|
|
13
|
+
return useContext(PortalContainerContext) ?? undefined;
|
|
14
|
+
}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import type { ButtonHTMLAttributes, InputHTMLAttributes, ReactNode, Ref } from 'react';
|
|
2
|
+
import { type IconName } from './icon.tsx';
|
|
3
|
+
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
|
+
readonly variant?: 'default' | 'primary' | 'ghost' | 'danger';
|
|
5
|
+
readonly ref?: Ref<HTMLButtonElement>;
|
|
6
|
+
}
|
|
7
|
+
export declare function Button({ variant, className, type, ...rest }: ButtonProps): import("react").JSX.Element;
|
|
8
|
+
export interface IconButtonProps extends Omit<ButtonProps, 'children' | 'aria-label'> {
|
|
9
|
+
/** What the button does: it has no text, so this is its name for everyone who cannot see the icon. */
|
|
10
|
+
readonly label: string;
|
|
11
|
+
readonly icon: IconName;
|
|
12
|
+
/** Shown after the name in the tooltip only (a keyboard shortcut), not part of the accessible name. */
|
|
13
|
+
readonly hint?: string | undefined;
|
|
14
|
+
}
|
|
15
|
+
/** A button with an icon and a required accessible name; the name is also its tooltip. */
|
|
16
|
+
export declare function IconButton({ label, icon, hint, className, ...rest }: IconButtonProps): import("react").JSX.Element;
|
|
17
|
+
export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
18
|
+
readonly ref?: Ref<HTMLInputElement>;
|
|
19
|
+
}
|
|
20
|
+
export declare function Input({ className, ...rest }: InputProps): import("react").JSX.Element;
|
|
21
|
+
export interface SelectOption {
|
|
22
|
+
readonly value: string;
|
|
23
|
+
readonly label: string;
|
|
24
|
+
}
|
|
25
|
+
export interface SelectProps {
|
|
26
|
+
readonly value: string;
|
|
27
|
+
readonly onValueChange: (value: string) => void;
|
|
28
|
+
readonly options: readonly SelectOption[];
|
|
29
|
+
/** The accessible name of the control. */
|
|
30
|
+
readonly label: string;
|
|
31
|
+
readonly disabled?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export declare function Select({ value, onValueChange, options, label, disabled }: SelectProps): import("react").JSX.Element;
|
|
34
|
+
export interface TabItem {
|
|
35
|
+
readonly value: string;
|
|
36
|
+
readonly label: string;
|
|
37
|
+
readonly content: ReactNode;
|
|
38
|
+
}
|
|
39
|
+
export interface TabsProps {
|
|
40
|
+
readonly items: readonly TabItem[];
|
|
41
|
+
/** The accessible name of the tab list. */
|
|
42
|
+
readonly label: string;
|
|
43
|
+
readonly value?: string;
|
|
44
|
+
readonly defaultValue?: string;
|
|
45
|
+
readonly onValueChange?: (value: string) => void;
|
|
46
|
+
}
|
|
47
|
+
export declare function Tabs({ items, label, value, defaultValue, onValueChange }: TabsProps): import("react").JSX.Element;
|
|
48
|
+
export interface PopoverProps {
|
|
49
|
+
/** The element that opens it; it must accept a ref and props (a `Button`). */
|
|
50
|
+
readonly trigger: ReactNode;
|
|
51
|
+
readonly children: ReactNode;
|
|
52
|
+
readonly open?: boolean;
|
|
53
|
+
readonly onOpenChange?: (open: boolean) => void;
|
|
54
|
+
/** Extra class on the floating panel (a menu-like popover drops the default padding). */
|
|
55
|
+
readonly contentClassName?: string;
|
|
56
|
+
readonly align?: 'start' | 'center' | 'end';
|
|
57
|
+
/** The accessible name of the panel. */
|
|
58
|
+
readonly label?: string;
|
|
59
|
+
}
|
|
60
|
+
export declare function Popover({ trigger, children, open, onOpenChange, contentClassName, align, label, }: PopoverProps): import("react").JSX.Element;
|
|
61
|
+
export interface DialogProps {
|
|
62
|
+
readonly open: boolean;
|
|
63
|
+
readonly onOpenChange: (open: boolean) => void;
|
|
64
|
+
readonly title: string;
|
|
65
|
+
readonly description?: string;
|
|
66
|
+
/** The body: it scrolls when it is taller than the dialog; the header and footer stay put. */
|
|
67
|
+
readonly children?: ReactNode;
|
|
68
|
+
/** Actions, right-aligned under the body. */
|
|
69
|
+
readonly footer?: ReactNode;
|
|
70
|
+
/** Omits the close button, for a dialog that can only be left by choosing (a conflict). */
|
|
71
|
+
readonly hideClose?: boolean;
|
|
72
|
+
}
|
|
73
|
+
/** A modal: header (title, description, close icon button), scrollable body, right-aligned footer. */
|
|
74
|
+
export declare function Dialog({ open, onOpenChange, title, description, children, footer, hideClose, }: DialogProps): import("react").JSX.Element;
|
|
75
|
+
export interface TooltipProps {
|
|
76
|
+
readonly content: string;
|
|
77
|
+
readonly children: ReactNode;
|
|
78
|
+
}
|
|
79
|
+
export declare function Tooltip({ content, children }: TooltipProps): import("react").JSX.Element;
|
|
80
|
+
export interface ToggleProps {
|
|
81
|
+
readonly pressed: boolean;
|
|
82
|
+
readonly onPressedChange: (pressed: boolean) => void;
|
|
83
|
+
readonly children: ReactNode;
|
|
84
|
+
/** Required when the toggle shows only an icon. */
|
|
85
|
+
readonly label?: string;
|
|
86
|
+
readonly disabled?: boolean;
|
|
87
|
+
}
|
|
88
|
+
export declare function Toggle({ pressed, onPressedChange, children, label, disabled }: ToggleProps): import("react").JSX.Element;
|
|
89
|
+
export interface MenuItem {
|
|
90
|
+
readonly id: string;
|
|
91
|
+
readonly label: string;
|
|
92
|
+
readonly onSelect: () => void;
|
|
93
|
+
readonly disabled?: boolean;
|
|
94
|
+
readonly danger?: boolean;
|
|
95
|
+
}
|
|
96
|
+
export interface ContextMenuProps {
|
|
97
|
+
/** The area the menu opens on (right click, the menu key, Shift+F10). */
|
|
98
|
+
readonly children: ReactNode;
|
|
99
|
+
readonly items: readonly MenuItem[];
|
|
100
|
+
readonly label: string;
|
|
101
|
+
}
|
|
102
|
+
export declare function ContextMenu({ children, items, label }: ContextMenuProps): import("react").JSX.Element;
|
|
103
|
+
export interface SegmentOption {
|
|
104
|
+
readonly value: string;
|
|
105
|
+
/** Text of the segment; with an `icon` and `iconOnly` it is only the accessible name and tooltip. */
|
|
106
|
+
readonly label: string;
|
|
107
|
+
readonly icon?: IconName;
|
|
108
|
+
readonly iconOnly?: boolean;
|
|
109
|
+
}
|
|
110
|
+
export interface SegmentedControlProps {
|
|
111
|
+
readonly options: readonly SegmentOption[];
|
|
112
|
+
/** The pressed segment (`undefined`: none). */
|
|
113
|
+
readonly value: string | undefined;
|
|
114
|
+
/** Called with the segment that was pressed, also when it is the one already pressed. */
|
|
115
|
+
readonly onValueChange: (value: string) => void;
|
|
116
|
+
/** The accessible name of the group. */
|
|
117
|
+
readonly label: string;
|
|
118
|
+
readonly disabled?: boolean;
|
|
119
|
+
readonly className?: string;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* A row of mutually exclusive toggle buttons (`aria-pressed`) for a short list of choices: value
|
|
123
|
+
* modes, direction, alignment. Icon-only segments take their name and tooltip from `label`.
|
|
124
|
+
*/
|
|
125
|
+
export declare function SegmentedControl({ options, value, onValueChange, label, disabled, className, }: SegmentedControlProps): import("react").JSX.Element;
|
|
126
|
+
/** Adds `delta` to a `12px` / `0.5` / `1.5rem` text; `undefined` when the text is not that. */
|
|
127
|
+
export declare function stepNumberText(text: string, delta: number, defaultUnit: string): string | undefined;
|
|
128
|
+
export interface NumberUnitInputProps {
|
|
129
|
+
readonly id?: string;
|
|
130
|
+
/** What is stored: `12px`, `0.5`, a token or a keyword. */
|
|
131
|
+
readonly value: string;
|
|
132
|
+
readonly onValueChange: (text: string) => void;
|
|
133
|
+
/** The units the grammar allows; empty for a bare number. Nothing else is offered. */
|
|
134
|
+
readonly units: readonly string[];
|
|
135
|
+
/** Accessible name of the unit menu. */
|
|
136
|
+
readonly unitLabel: string;
|
|
137
|
+
/** How much an arrow key adds (Shift: x10, Alt: /10). */
|
|
138
|
+
readonly step?: number;
|
|
139
|
+
/** The grammar takes a bare number as well as a length: the menu then also offers "no unit". */
|
|
140
|
+
readonly bareNumber?: boolean;
|
|
141
|
+
readonly disabled?: boolean;
|
|
142
|
+
readonly invalid?: boolean;
|
|
143
|
+
readonly describedBy?: string | undefined;
|
|
144
|
+
/** The accessible name, when no `<label>` points at the field. */
|
|
145
|
+
readonly ariaLabel?: string | undefined;
|
|
146
|
+
readonly list?: string | undefined;
|
|
147
|
+
readonly placeholder?: string | undefined;
|
|
148
|
+
/** A narrow field for a row of several (the sides of a box). */
|
|
149
|
+
readonly compact?: boolean;
|
|
150
|
+
/** The unit shown while nothing is typed: a row's shared unit. */
|
|
151
|
+
readonly unit?: string | undefined;
|
|
152
|
+
/** Leaves the unit menu out: the unit is chosen elsewhere (`unit`). */
|
|
153
|
+
readonly hideUnitMenu?: boolean;
|
|
154
|
+
readonly onBlur?: () => void;
|
|
155
|
+
readonly onFocus?: () => void;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* A field for a number with a unit chosen from a menu: the field holds only the number, the menu
|
|
159
|
+
* the unit, so nobody has to type `px`. Typing digits keeps the unit shown; typing a keyword or a
|
|
160
|
+
* token (`auto`, `$space.4`) switches to text and disables the menu until the field is emptied;
|
|
161
|
+
* typing a whole length (`1.5rem`) still works. ArrowUp/ArrowDown step the number (Shift x10, Alt
|
|
162
|
+
* /10). It only produces text; the caller checks it against the grammar before anything is stored,
|
|
163
|
+
* so it cannot make a value the grammar refuses representable.
|
|
164
|
+
*/
|
|
165
|
+
export declare function NumberUnitInput({ id, value, onValueChange, units, unitLabel, step, bareNumber, disabled, invalid, describedBy, ariaLabel, list, placeholder, compact, unit: sharedUnit, hideUnitMenu, onBlur, onFocus, }: NumberUnitInputProps): import("react").JSX.Element;
|
|
166
|
+
export interface ColorSwatchProps {
|
|
167
|
+
/** A colour value from the theme; an unknown notation or `undefined` shows an empty swatch. */
|
|
168
|
+
readonly color: string | undefined;
|
|
169
|
+
readonly className?: string;
|
|
170
|
+
}
|
|
171
|
+
/** A small decorative square filled with a colour. */
|
|
172
|
+
export declare function ColorSwatch({ color, className }: ColorSwatchProps): import("react").JSX.Element;
|
|
173
|
+
/** `#abc` and `#aabbcc` as the `#rrggbb` a colour input takes; `undefined` for any other notation. */
|
|
174
|
+
export declare function hexOf(color: string | undefined): string | undefined;
|
|
175
|
+
export interface ColorInputProps {
|
|
176
|
+
/** The colour being edited, as the theme or the author wrote it; only the swatch paints it. */
|
|
177
|
+
readonly color: string | undefined;
|
|
178
|
+
/** Accessible name of the picker. */
|
|
179
|
+
readonly label: string;
|
|
180
|
+
readonly disabled?: boolean;
|
|
181
|
+
/** Called with a `#rrggbb` colour the browser's own picker chose. */
|
|
182
|
+
readonly onColorChange: (hex: string) => void;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* The colour swatch as a button that opens the browser's colour picker. The native input sits
|
|
186
|
+
* invisibly over the swatch, so it keeps the platform's keyboard and screen-reader behaviour; what
|
|
187
|
+
* it returns is a hex colour, which the caller still checks against the grammar.
|
|
188
|
+
*/
|
|
189
|
+
export declare function ColorInput({ color, label, disabled, onColorChange }: ColorInputProps): import("react").JSX.Element;
|
|
190
|
+
//# sourceMappingURL=primitives.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../src/ui/primitives.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGvF,OAAO,EAAQ,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAOjD,MAAM,WAAW,WAAY,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IAC1E,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC9D,QAAQ,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;CACvC;AAED,wBAAgB,MAAM,CAAC,EAAE,OAAmB,EAAE,SAAS,EAAE,IAAe,EAAE,GAAG,IAAI,EAAE,EAAE,WAAW,+BAI/F;AAED,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,WAAW,EAAE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