@panphora/bevel 0.1.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/LICENSE +16 -0
- package/README.md +226 -0
- package/bevel-fonts.css +16 -0
- package/bevel.css +3075 -0
- package/bevel.js +2126 -0
- package/dist/react/components/activity-feed.d.ts +89 -0
- package/dist/react/components/activity-feed.js +54 -0
- package/dist/react/components/alert-dialog.d.ts +14 -0
- package/dist/react/components/alert-dialog.js +19 -0
- package/dist/react/components/app-shell.d.ts +98 -0
- package/dist/react/components/app-shell.js +86 -0
- package/dist/react/components/app-toolbar.d.ts +19 -0
- package/dist/react/components/app-toolbar.js +22 -0
- package/dist/react/components/avatar-group.d.ts +67 -0
- package/dist/react/components/avatar-group.js +49 -0
- package/dist/react/components/badge-and-pill.d.ts +34 -0
- package/dist/react/components/badge-and-pill.js +12 -0
- package/dist/react/components/breadcrumbs.d.ts +56 -0
- package/dist/react/components/breadcrumbs.js +44 -0
- package/dist/react/components/bulk-bar.d.ts +22 -0
- package/dist/react/components/bulk-bar.js +59 -0
- package/dist/react/components/button.d.ts +15 -0
- package/dist/react/components/button.js +20 -0
- package/dist/react/components/callout-and-hint.d.ts +17 -0
- package/dist/react/components/callout-and-hint.js +8 -0
- package/dist/react/components/checkbox.d.ts +5 -0
- package/dist/react/components/checkbox.js +13 -0
- package/dist/react/components/chip.d.ts +149 -0
- package/dist/react/components/chip.js +29 -0
- package/dist/react/components/code-block.d.ts +50 -0
- package/dist/react/components/code-block.js +77 -0
- package/dist/react/components/code-editor.d.ts +122 -0
- package/dist/react/components/code-editor.js +695 -0
- package/dist/react/components/column-manager.d.ts +28 -0
- package/dist/react/components/column-manager.js +85 -0
- package/dist/react/components/combobox.d.ts +32 -0
- package/dist/react/components/combobox.js +37 -0
- package/dist/react/components/data-grid.d.ts +108 -0
- package/dist/react/components/data-grid.js +159 -0
- package/dist/react/components/data-table.d.ts +2 -0
- package/dist/react/components/data-table.js +6 -0
- package/dist/react/components/date.d.ts +23 -0
- package/dist/react/components/date.js +11 -0
- package/dist/react/components/details.d.ts +13 -0
- package/dist/react/components/details.js +20 -0
- package/dist/react/components/dialog.d.ts +74 -0
- package/dist/react/components/dialog.js +31 -0
- package/dist/react/components/diff-view.d.ts +73 -0
- package/dist/react/components/diff-view.js +68 -0
- package/dist/react/components/documents.d.ts +70 -0
- package/dist/react/components/documents.js +10 -0
- package/dist/react/components/drawer.d.ts +45 -0
- package/dist/react/components/drawer.js +35 -0
- package/dist/react/components/editable-grid-cells.d.ts +32 -0
- package/dist/react/components/editable-grid-cells.js +116 -0
- package/dist/react/components/eyebrow-kicker-lede-pull-quote.d.ts +39 -0
- package/dist/react/components/eyebrow-kicker-lede-pull-quote.js +12 -0
- package/dist/react/components/field.d.ts +32 -0
- package/dist/react/components/field.js +27 -0
- package/dist/react/components/file-tree.d.ts +75 -0
- package/dist/react/components/file-tree.js +247 -0
- package/dist/react/components/file.d.ts +43 -0
- package/dist/react/components/file.js +73 -0
- package/dist/react/components/files-table.d.ts +174 -0
- package/dist/react/components/files-table.js +237 -0
- package/dist/react/components/filter-builder.d.ts +37 -0
- package/dist/react/components/filter-builder.js +109 -0
- package/dist/react/components/form-error-summary.d.ts +16 -0
- package/dist/react/components/form-error-summary.js +49 -0
- package/dist/react/components/icon-button.d.ts +8 -0
- package/dist/react/components/icon-button.js +14 -0
- package/dist/react/components/icon.d.ts +7 -0
- package/dist/react/components/icon.js +15 -0
- package/dist/react/components/image.d.ts +72 -0
- package/dist/react/components/image.js +24 -0
- package/dist/react/components/inline-edit.d.ts +70 -0
- package/dist/react/components/inline-edit.js +149 -0
- package/dist/react/components/input.d.ts +29 -0
- package/dist/react/components/input.js +20 -0
- package/dist/react/components/kanban-board.d.ts +140 -0
- package/dist/react/components/kanban-board.js +374 -0
- package/dist/react/components/layout.d.ts +51 -0
- package/dist/react/components/layout.js +28 -0
- package/dist/react/components/list.d.ts +28 -0
- package/dist/react/components/list.js +6 -0
- package/dist/react/components/masthead-and-verdict.d.ts +60 -0
- package/dist/react/components/masthead-and-verdict.js +8 -0
- package/dist/react/components/menu.d.ts +26 -0
- package/dist/react/components/menu.js +31 -0
- package/dist/react/components/multi-select-picker.d.ts +49 -0
- package/dist/react/components/multi-select-picker.js +20 -0
- package/dist/react/components/note.d.ts +33 -0
- package/dist/react/components/note.js +8 -0
- package/dist/react/components/number-field.d.ts +16 -0
- package/dist/react/components/number-field.js +17 -0
- package/dist/react/components/pagination.d.ts +45 -0
- package/dist/react/components/pagination.js +87 -0
- package/dist/react/components/persistent-action-banner.d.ts +71 -0
- package/dist/react/components/persistent-action-banner.js +39 -0
- package/dist/react/components/popconfirm.d.ts +42 -0
- package/dist/react/components/popconfirm.js +59 -0
- package/dist/react/components/popover.d.ts +16 -0
- package/dist/react/components/popover.js +21 -0
- package/dist/react/components/progress-and-gauge.d.ts +44 -0
- package/dist/react/components/progress-and-gauge.js +19 -0
- package/dist/react/components/radio.d.ts +7 -0
- package/dist/react/components/radio.js +13 -0
- package/dist/react/components/rich-text-toolbar.d.ts +26 -0
- package/dist/react/components/rich-text-toolbar.js +64 -0
- package/dist/react/components/rows-and-card.d.ts +88 -0
- package/dist/react/components/rows-and-card.js +10 -0
- package/dist/react/components/save-status-indicator.d.ts +11 -0
- package/dist/react/components/save-status-indicator.js +33 -0
- package/dist/react/components/segmented-control.d.ts +21 -0
- package/dist/react/components/segmented-control.js +15 -0
- package/dist/react/components/select.d.ts +29 -0
- package/dist/react/components/select.js +29 -0
- package/dist/react/components/selectable-cards.d.ts +30 -0
- package/dist/react/components/selectable-cards.js +29 -0
- package/dist/react/components/settings-rows.d.ts +51 -0
- package/dist/react/components/settings-rows.js +8 -0
- package/dist/react/components/sidebar-nav.d.ts +77 -0
- package/dist/react/components/sidebar-nav.js +41 -0
- package/dist/react/components/skeleton-and-empty.d.ts +51 -0
- package/dist/react/components/skeleton-and-empty.js +14 -0
- package/dist/react/components/slider.d.ts +19 -0
- package/dist/react/components/slider.js +17 -0
- package/dist/react/components/small-charts.d.ts +60 -0
- package/dist/react/components/small-charts.js +76 -0
- package/dist/react/components/sortable.d.ts +30 -0
- package/dist/react/components/sortable.js +85 -0
- package/dist/react/components/split-button.d.ts +38 -0
- package/dist/react/components/split-button.js +43 -0
- package/dist/react/components/split-panes.d.ts +35 -0
- package/dist/react/components/split-panes.js +102 -0
- package/dist/react/components/stat-tiles.d.ts +54 -0
- package/dist/react/components/stat-tiles.js +8 -0
- package/dist/react/components/steps.d.ts +11 -0
- package/dist/react/components/steps.js +13 -0
- package/dist/react/components/switch.d.ts +6 -0
- package/dist/react/components/switch.js +13 -0
- package/dist/react/components/table.d.ts +61 -0
- package/dist/react/components/table.js +6 -0
- package/dist/react/components/tabs.d.ts +7 -0
- package/dist/react/components/tabs.js +13 -0
- package/dist/react/components/tags.d.ts +33 -0
- package/dist/react/components/tags.js +83 -0
- package/dist/react/components/textarea.d.ts +10 -0
- package/dist/react/components/textarea.js +6 -0
- package/dist/react/components/toast.d.ts +35 -0
- package/dist/react/components/toast.js +90 -0
- package/dist/react/components/tooltip-and-key.d.ts +20 -0
- package/dist/react/components/tooltip-and-key.js +20 -0
- package/dist/react/components/tree-view.d.ts +34 -0
- package/dist/react/components/tree-view.js +118 -0
- package/dist/react/components/upload-dropzone.d.ts +92 -0
- package/dist/react/components/upload-dropzone.js +116 -0
- package/dist/react/components/wizard-shell.d.ts +78 -0
- package/dist/react/components/wizard-shell.js +176 -0
- package/dist/react/fonts.css.d.ts +1 -0
- package/dist/react/index.d.ts +76 -0
- package/dist/react/index.js +77 -0
- package/dist/react/integrations/quickcrop.d.ts +58 -0
- package/dist/react/integrations/quickcrop.js +137 -0
- package/dist/react/integrations/richclay.d.ts +43 -0
- package/dist/react/integrations/richclay.js +129 -0
- package/dist/react/internal/classes.d.ts +3 -0
- package/dist/react/internal/classes.js +10 -0
- package/dist/react/internal/close-mark.d.ts +1 -0
- package/dist/react/internal/close-mark.js +10 -0
- package/dist/react/internal/controllable-state.d.ts +9 -0
- package/dist/react/internal/controllable-state.js +22 -0
- package/dist/react/internal/drop-effect.d.ts +28 -0
- package/dist/react/internal/drop-effect.js +8 -0
- package/dist/react/internal/form-reset.d.ts +2 -0
- package/dist/react/internal/form-reset.js +22 -0
- package/dist/react/internal/format.d.ts +1 -0
- package/dist/react/internal/format.js +14 -0
- package/dist/react/internal/link.d.ts +2 -0
- package/dist/react/internal/link.js +8 -0
- package/dist/react/internal/part.d.ts +20 -0
- package/dist/react/internal/part.js +47 -0
- package/dist/react/internal/pointer-session.d.ts +8 -0
- package/dist/react/internal/pointer-session.js +60 -0
- package/dist/react/internal/refs.d.ts +2 -0
- package/dist/react/internal/refs.js +22 -0
- package/dist/react/internal/rich-text.d.ts +28 -0
- package/dist/react/internal/rich-text.js +4 -0
- package/dist/react/internal/table-context.d.ts +39 -0
- package/dist/react/internal/table-context.js +12 -0
- package/dist/react/internal/use-object-url.d.ts +1 -0
- package/dist/react/internal/use-object-url.js +15 -0
- package/dist/react/layout.css +274 -0
- package/dist/react/layout.css.d.ts +1 -0
- package/dist/react/models/filter.d.ts +31 -0
- package/dist/react/models/filter.js +79 -0
- package/dist/react/models/kanban.d.ts +51 -0
- package/dist/react/models/kanban.js +35 -0
- package/dist/react/models/reorder.d.ts +9 -0
- package/dist/react/models/reorder.js +23 -0
- package/dist/react/models/table.d.ts +85 -0
- package/dist/react/models/table.js +144 -0
- package/dist/react/models/tree.d.ts +16 -0
- package/dist/react/models/tree.js +26 -0
- package/dist/react/provider.d.ts +18 -0
- package/dist/react/provider.js +31 -0
- package/dist/react/recipes/context-hypercms.d.ts +17 -0
- package/dist/react/recipes/context-hypercms.js +71 -0
- package/dist/react/recipes/context-quickcrop.d.ts +8 -0
- package/dist/react/recipes/context-quickcrop.js +49 -0
- package/dist/react/theme.css +8004 -0
- package/dist/react/theme.css.d.ts +1 -0
- package/examples/README.md +34 -0
- package/examples/components/activity-feed.html +28 -0
- package/examples/components/app-shell.html +12 -0
- package/examples/components/app-toolbar.html +38 -0
- package/examples/components/avatar-group.html +27 -0
- package/examples/components/breadcrumbs.html +26 -0
- package/examples/components/bulk-bar.html +22 -0
- package/examples/components/code-block.html +12 -0
- package/examples/components/code-editor.html +25 -0
- package/examples/components/column-manager.html +9 -0
- package/examples/components/combobox.html +13 -0
- package/examples/components/context-hypercms.css +41 -0
- package/examples/components/context-hypercms.html +40 -0
- package/examples/components/context-hypercms.js +62 -0
- package/examples/components/context-quickcrop.html +137 -0
- package/examples/components/diff-view.html +9 -0
- package/examples/components/drawer.html +11 -0
- package/examples/components/editable-grid-cells.html +9 -0
- package/examples/components/file-browser.html +53 -0
- package/examples/components/file-tree.html +34 -0
- package/examples/components/files-table.html +80 -0
- package/examples/components/filter-builder.html +11 -0
- package/examples/components/form-error-summary.html +11 -0
- package/examples/components/index.html +51 -0
- package/examples/components/inline-edit.html +42 -0
- package/examples/components/kanban-board.html +42 -0
- package/examples/components/manifest.json +3279 -0
- package/examples/components/modal.html +11 -0
- package/examples/components/multi-select-picker.html +13 -0
- package/examples/components/pagination.html +32 -0
- package/examples/components/persistent-action-banner.html +23 -0
- package/examples/components/popconfirm.html +13 -0
- package/examples/components/popover-menu.html +13 -0
- package/examples/components/reference/baseline/DECISIONS.md +85 -0
- package/examples/components/reference/baseline/README.md +58 -0
- package/examples/components/reference/baseline/bevel-fonts.css +16 -0
- package/examples/components/reference/baseline/bevel.css +1339 -0
- package/examples/components/reference/baseline/bevel.js +496 -0
- package/examples/components/reference/baseline/fonts/LICENSE-ibm-plex-mono.txt +93 -0
- package/examples/components/reference/baseline/fonts/LICENSE-ibm-plex-sans.txt +93 -0
- package/examples/components/reference/baseline/fonts/LICENSE-newsreader.txt +93 -0
- package/examples/components/reference/baseline/fonts/ibm-plex-mono-latin-400-normal.woff2 +0 -0
- package/examples/components/reference/baseline/fonts/ibm-plex-mono-latin-500-normal.woff2 +0 -0
- package/examples/components/reference/baseline/fonts/ibm-plex-mono-latin-600-normal.woff2 +0 -0
- package/examples/components/reference/baseline/fonts/ibm-plex-sans-latin-400-italic.woff2 +0 -0
- package/examples/components/reference/baseline/fonts/ibm-plex-sans-latin-400-normal.woff2 +0 -0
- package/examples/components/reference/baseline/fonts/ibm-plex-sans-latin-500-normal.woff2 +0 -0
- package/examples/components/reference/baseline/fonts/ibm-plex-sans-latin-600-normal.woff2 +0 -0
- package/examples/components/reference/baseline/fonts/newsreader-latin-opsz-italic.woff2 +0 -0
- package/examples/components/reference/baseline/fonts/newsreader-latin-opsz-normal.woff2 +0 -0
- package/examples/components/reference/fable/IMPROVEMENTS.md +106 -0
- package/examples/components/reference/fable/PARENT-REPAIRS.md +17 -0
- package/examples/components/reference/fable/__pycache__/build_repairs.cpython-311.pyc +0 -0
- package/examples/components/reference/fable/__pycache__/kanban.cpython-311.pyc +0 -0
- package/examples/components/reference/fable/as-authored/IMPROVEMENTS-completed.md +106 -0
- package/examples/components/reference/fable/as-authored/base-astra.css +17 -0
- package/examples/components/reference/fable/as-authored/base-parent.css +416 -0
- package/examples/components/reference/fable/as-authored/build.py +858 -0
- package/examples/components/reference/fable/as-authored/fable.css +823 -0
- package/examples/components/reference/fable/as-authored/kanban-completed.css +235 -0
- package/examples/components/reference/fable/as-authored/kanban-completed.html +53 -0
- package/examples/components/reference/fable/as-authored/kanban-completed.py +212 -0
- package/examples/components/reference/fable/as-authored/kanban.py +207 -0
- package/examples/components/reference/fable/base-astra.css +17 -0
- package/examples/components/reference/fable/base-parent.css +416 -0
- package/examples/components/reference/fable/build.py +858 -0
- package/examples/components/reference/fable/build_repairs.py +25 -0
- package/examples/components/reference/fable/components/activity-feed.html +3 -0
- package/examples/components/reference/fable/components/app-toolbar.html +3 -0
- package/examples/components/reference/fable/components/avatar-group.html +4 -0
- package/examples/components/reference/fable/components/breadcrumbs.html +3 -0
- package/examples/components/reference/fable/components/code-block.html +9 -0
- package/examples/components/reference/fable/components/column-manager.html +3 -0
- package/examples/components/reference/fable/components/combobox.html +6 -0
- package/examples/components/reference/fable/components/context-hypercms.html +3 -0
- package/examples/components/reference/fable/components/context-quickcrop.html +4 -0
- package/examples/components/reference/fable/components/diff-view.html +13 -0
- package/examples/components/reference/fable/components/drawer.html +3 -0
- package/examples/components/reference/fable/components/editable-grid-cells.html +3 -0
- package/examples/components/reference/fable/components/filter-builder.html +3 -0
- package/examples/components/reference/fable/components/form-error-summary.html +4 -0
- package/examples/components/reference/fable/components/inline-edit.html +3 -0
- package/examples/components/reference/fable/components/kanban-board.html +53 -0
- package/examples/components/reference/fable/components/modal.html +3 -0
- package/examples/components/reference/fable/components/multi-select-picker.html +5 -0
- package/examples/components/reference/fable/components/pagination.html +3 -0
- package/examples/components/reference/fable/components/persistent-action-banner.html +4 -0
- package/examples/components/reference/fable/components/popconfirm.html +5 -0
- package/examples/components/reference/fable/components/popover-menu.html +3 -0
- package/examples/components/reference/fable/components/rich-text-toolbar.html +3 -0
- package/examples/components/reference/fable/components/save-status-indicator.html +2 -0
- package/examples/components/reference/fable/components/selectable-cards.html +3 -0
- package/examples/components/reference/fable/components/settings-rows.html +3 -0
- package/examples/components/reference/fable/components/sidebar-nav.html +4 -0
- package/examples/components/reference/fable/components/small-charts.html +5 -0
- package/examples/components/reference/fable/components/split-button.html +4 -0
- package/examples/components/reference/fable/components/split-panes.html +8 -0
- package/examples/components/reference/fable/components/stat-tiles.html +3 -0
- package/examples/components/reference/fable/components/toast-stack.html +5 -0
- package/examples/components/reference/fable/components/tree-view.html +4 -0
- package/examples/components/reference/fable/components/upload-dropzone.html +6 -0
- package/examples/components/reference/fable/components/wizard-shell.html +3 -0
- package/examples/components/reference/fable/coverage.json +414 -0
- package/examples/components/reference/fable/fable.css +823 -0
- package/examples/components/reference/fable/index.html +5 -0
- package/examples/components/reference/fable/kanban.css +237 -0
- package/examples/components/reference/fable/kanban.py +212 -0
- package/examples/components/reference/fable/parent-repairs.css +9 -0
- package/examples/components/reference/fixtures/data.json +102 -0
- package/examples/components/reference/fixtures/host.js +47 -0
- package/examples/components/reference/fixtures/static-host.js +39 -0
- package/examples/components/reference/fixtures/workspace.jpg +0 -0
- package/examples/components/reference/parent/CHANGES.md +179 -0
- package/examples/components/reference/parent/__pycache__/kanban.cpython-311.pyc +0 -0
- package/examples/components/reference/parent/base-astra.css +17 -0
- package/examples/components/reference/parent/base-parent.css +416 -0
- package/examples/components/reference/parent/build.py +148 -0
- package/examples/components/reference/parent/components/activity-feed.html +2 -0
- package/examples/components/reference/parent/components/app-toolbar.html +2 -0
- package/examples/components/reference/parent/components/avatar-group.html +4 -0
- package/examples/components/reference/parent/components/breadcrumbs.html +2 -0
- package/examples/components/reference/parent/components/code-block.html +8 -0
- package/examples/components/reference/parent/components/column-manager.html +2 -0
- package/examples/components/reference/parent/components/combobox.html +6 -0
- package/examples/components/reference/parent/components/context-hypercms.html +2 -0
- package/examples/components/reference/parent/components/context-quickcrop.html +4 -0
- package/examples/components/reference/parent/components/diff-view.html +4 -0
- package/examples/components/reference/parent/components/drawer.html +2 -0
- package/examples/components/reference/parent/components/editable-grid-cells.html +2 -0
- package/examples/components/reference/parent/components/filter-builder.html +2 -0
- package/examples/components/reference/parent/components/form-error-summary.html +2 -0
- package/examples/components/reference/parent/components/inline-edit.html +2 -0
- package/examples/components/reference/parent/components/kanban-board.html +84 -0
- package/examples/components/reference/parent/components/modal.html +2 -0
- package/examples/components/reference/parent/components/multi-select-picker.html +5 -0
- package/examples/components/reference/parent/components/pagination.html +2 -0
- package/examples/components/reference/parent/components/persistent-action-banner.html +4 -0
- package/examples/components/reference/parent/components/popconfirm.html +5 -0
- package/examples/components/reference/parent/components/popover-menu.html +2 -0
- package/examples/components/reference/parent/components/rich-text-toolbar.html +2 -0
- package/examples/components/reference/parent/components/save-status-indicator.html +2 -0
- package/examples/components/reference/parent/components/selectable-cards.html +2 -0
- package/examples/components/reference/parent/components/settings-rows.html +2 -0
- package/examples/components/reference/parent/components/sidebar-nav.html +4 -0
- package/examples/components/reference/parent/components/small-charts.html +2 -0
- package/examples/components/reference/parent/components/split-button.html +5 -0
- package/examples/components/reference/parent/components/split-panes.html +8 -0
- package/examples/components/reference/parent/components/stat-tiles.html +2 -0
- package/examples/components/reference/parent/components/toast-stack.html +5 -0
- package/examples/components/reference/parent/components/tree-view.html +4 -0
- package/examples/components/reference/parent/components/upload-dropzone.html +6 -0
- package/examples/components/reference/parent/components/wizard-shell.html +2 -0
- package/examples/components/reference/parent/coverage.json +414 -0
- package/examples/components/reference/parent/index.html +1 -0
- package/examples/components/reference/parent/kanban.css +114 -0
- package/examples/components/reference/parent/kanban.py +55 -0
- package/examples/components/reference/parent/refinement.css +53 -0
- package/examples/components/reference/selected/build.py +70 -0
- package/examples/components/reference/selected/components/activity-feed.html +3 -0
- package/examples/components/reference/selected/components/app-toolbar.html +3 -0
- package/examples/components/reference/selected/components/avatar-group.html +4 -0
- package/examples/components/reference/selected/components/breadcrumbs.html +3 -0
- package/examples/components/reference/selected/components/code-block.html +9 -0
- package/examples/components/reference/selected/components/column-manager.html +3 -0
- package/examples/components/reference/selected/components/combobox.html +6 -0
- package/examples/components/reference/selected/components/context-hypercms.html +3 -0
- package/examples/components/reference/selected/components/context-quickcrop.html +4 -0
- package/examples/components/reference/selected/components/diff-view.html +13 -0
- package/examples/components/reference/selected/components/drawer.html +3 -0
- package/examples/components/reference/selected/components/editable-grid-cells.html +3 -0
- package/examples/components/reference/selected/components/filter-builder.html +3 -0
- package/examples/components/reference/selected/components/form-error-summary.html +4 -0
- package/examples/components/reference/selected/components/inline-edit.html +3 -0
- package/examples/components/reference/selected/components/kanban-board.html +53 -0
- package/examples/components/reference/selected/components/modal.html +2 -0
- package/examples/components/reference/selected/components/multi-select-picker.html +5 -0
- package/examples/components/reference/selected/components/pagination.html +3 -0
- package/examples/components/reference/selected/components/persistent-action-banner.html +4 -0
- package/examples/components/reference/selected/components/popconfirm.html +5 -0
- package/examples/components/reference/selected/components/popover-menu.html +3 -0
- package/examples/components/reference/selected/components/rich-text-toolbar.html +3 -0
- package/examples/components/reference/selected/components/save-status-indicator.html +2 -0
- package/examples/components/reference/selected/components/selectable-cards.html +3 -0
- package/examples/components/reference/selected/components/settings-rows.html +3 -0
- package/examples/components/reference/selected/components/sidebar-nav.html +4 -0
- package/examples/components/reference/selected/components/small-charts.html +5 -0
- package/examples/components/reference/selected/components/split-button.html +4 -0
- package/examples/components/reference/selected/components/split-panes.html +8 -0
- package/examples/components/reference/selected/components/stat-tiles.html +3 -0
- package/examples/components/reference/selected/components/toast-stack.html +5 -0
- package/examples/components/reference/selected/components/tree-view.html +4 -0
- package/examples/components/reference/selected/components/upload-dropzone.html +6 -0
- package/examples/components/reference/selected/components/wizard-shell.html +3 -0
- package/examples/components/reference/selected/corrections.css +11 -0
- package/examples/components/reference/selected/coverage.json +413 -0
- package/examples/components/reference/selected/gallery-build.mjs +49 -0
- package/examples/components/reference/selected/gallery-spec.json +12 -0
- package/examples/components/reference/selected/index.html +1 -0
- package/examples/components/reference/selected/kanban-comparison.json +6 -0
- package/examples/components/reference/selected/manifest.json +476 -0
- package/examples/components/reference/sha256.json +142 -0
- package/examples/components/reference/sources/diagonal-close.svg +1 -0
- package/examples/components/reference/sources/hyperclay/public-assets/css/hyperclay-app-source.css +614 -0
- package/examples/components/reference/sources/hyperclay/public-assets/js/app.js +94 -0
- package/examples/components/reference/sources/hyperclayjs/src/ui/theModal.js +897 -0
- package/examples/components/reference/sources/hypercms/scripts/build-theme.js +203 -0
- package/examples/components/reference/sources/hypercms/src/anchor.js +24 -0
- package/examples/components/reference/sources/hypercms/src/apply-loop.js +167 -0
- package/examples/components/reference/sources/hypercms/src/diagnostics.js +44 -0
- package/examples/components/reference/sources/hypercms/src/enhance.js +173 -0
- package/examples/components/reference/sources/hypercms/src/events.js +955 -0
- package/examples/components/reference/sources/hypercms/src/form-builder.js +518 -0
- package/examples/components/reference/sources/hypercms/src/form-rules.js +208 -0
- package/examples/components/reference/sources/hypercms/src/hooks.js +100 -0
- package/examples/components/reference/sources/hypercms/src/hypercms-bundle.js +10 -0
- package/examples/components/reference/sources/hypercms/src/hypercms.js +347 -0
- package/examples/components/reference/sources/hypercms/src/morph.js +10 -0
- package/examples/components/reference/sources/hypercms/src/path.js +61 -0
- package/examples/components/reference/sources/hypercms/src/place.js +131 -0
- package/examples/components/reference/sources/hypercms/src/platform.js +131 -0
- package/examples/components/reference/sources/hypercms/src/refresh.js +87 -0
- package/examples/components/reference/sources/hypercms/src/richclay-bridge.js +140 -0
- package/examples/components/reference/sources/hypercms/src/row-identity.js +111 -0
- package/examples/components/reference/sources/hypercms/src/scaffold.js +10 -0
- package/examples/components/reference/sources/hypercms/src/session.js +303 -0
- package/examples/components/reference/sources/hypercms/src/shell.js +248 -0
- package/examples/components/reference/sources/hypercms/src/styles.css +298 -0
- package/examples/components/reference/sources/hypercms/src/targets.js +144 -0
- package/examples/components/reference/sources/hypercms/src/templates.js +656 -0
- package/examples/components/reference/sources/hypercms/src/theme/pixel-quiet.overrides.css +761 -0
- package/examples/components/reference/sources/hypercms/src/theme.generated.css +1772 -0
- package/examples/components/reference/sources/hypercms/src/toggle.js +666 -0
- package/examples/components/reference/sources/hypercms/src/unresolved.js +211 -0
- package/examples/components/reference/sources/hypercms/src/vendor/mirk.vendor.js +212 -0
- package/examples/components/reference/sources/hypercms/src/views/inline-layer.js +421 -0
- package/examples/components/reference/sources/hypercms/src/views/inline.js +1072 -0
- package/examples/components/reference/sources/hypercms/src/views/sidebar.js +97 -0
- package/examples/components/reference/sources/modal-reference.html +301 -0
- package/examples/components/reference/sources/quickcrop/quickcrop.css +124 -0
- package/examples/components/reference/sources/quickcrop/quickcrop.js +400 -0
- package/examples/components/reference/sources/richclay/richclay.css +416 -0
- package/examples/components/reference/sources/richclay/richclay.js +2962 -0
- package/examples/components/reference/sources/richclay/src/a11y.js +67 -0
- package/examples/components/reference/sources/richclay/src/browser-global.js +7 -0
- package/examples/components/reference/sources/richclay/src/buttons.js +254 -0
- package/examples/components/reference/sources/richclay/src/hyperclay.js +470 -0
- package/examples/components/reference/sources/richclay/src/normalize.js +380 -0
- package/examples/components/reference/sources/richclay/src/richclay.js +1356 -0
- package/examples/components/reference/sources/richclay/src/sanitize.js +189 -0
- package/examples/components/reference/sources/richclay/src/styles.js +23 -0
- package/examples/components/reference/sources/richclay/src/toolbar-float.js +175 -0
- package/examples/components/reference/sources/richclay/src/toolbar.js +394 -0
- package/examples/components/reference/sources/richclay/src/vendor-bundle.js +15 -0
- package/examples/components/reference/sources/richclay/vendor/DOMPURIFY-LICENSE +202 -0
- package/examples/components/reference/sources/richclay/vendor/DOMPURIFY-LICENSE-MPL +373 -0
- package/examples/components/reference/sources/richclay/vendor/SQUIRE-LICENSE +21 -0
- package/examples/components/reference/sources/richclay/vendor/purify.es.mjs +2249 -0
- package/examples/components/reference/sources/richclay/vendor/purify.min.js +3 -0
- package/examples/components/reference/sources/richclay/vendor/squire.js +22 -0
- package/examples/components/reference/sources/richclay/vendor/squire.mjs +22 -0
- package/examples/components/reference/sources/richclay/vendor/squire.provenance.json +19 -0
- package/examples/components/rich-text-toolbar.html +43 -0
- package/examples/components/save-status-indicator.html +11 -0
- package/examples/components/selectable-cards.html +9 -0
- package/examples/components/settings-rows.html +10 -0
- package/examples/components/sidebar-nav.html +9 -0
- package/examples/components/small-charts.html +21 -0
- package/examples/components/split-button.html +13 -0
- package/examples/components/split-panes-editor.html +6 -0
- package/examples/components/split-panes.html +9 -0
- package/examples/components/stat-tiles.html +23 -0
- package/examples/components/toast-stack.html +21 -0
- package/examples/components/tree-view.html +9 -0
- package/examples/components/upload-dropzone.html +88 -0
- package/examples/components/wizard-shell.html +50 -0
- package/examples/datastar/index.html +38 -0
- package/examples/datastar/server.mjs +31 -0
- package/examples/fixtures/field-guide.pdf +14 -0
- package/examples/fixtures/workspace.jpg +0 -0
- package/examples/setup-peers.mjs +35 -0
- package/fonts/LICENSE-ibm-plex-mono.txt +93 -0
- package/fonts/LICENSE-ibm-plex-sans.txt +93 -0
- package/fonts/LICENSE-newsreader.txt +93 -0
- package/fonts/ibm-plex-mono-latin-400-normal.woff2 +0 -0
- package/fonts/ibm-plex-mono-latin-500-normal.woff2 +0 -0
- package/fonts/ibm-plex-mono-latin-600-normal.woff2 +0 -0
- package/fonts/ibm-plex-sans-latin-400-italic.woff2 +0 -0
- package/fonts/ibm-plex-sans-latin-400-normal.woff2 +0 -0
- package/fonts/ibm-plex-sans-latin-500-normal.woff2 +0 -0
- package/fonts/ibm-plex-sans-latin-600-normal.woff2 +0 -0
- package/fonts/newsreader-latin-opsz-italic.woff2 +0 -0
- package/fonts/newsreader-latin-opsz-normal.woff2 +0 -0
- package/icons/LICENSE +21 -0
- package/icons/house.json +71 -0
- package/icons/icons.d.ts +17 -0
- package/icons/icons.js +648 -0
- package/icons/icons.svg +126 -0
- package/icons/marks/build-tray.source.mjs +45 -0
- package/icons/marks/hyperclay-local.svg +11 -0
- package/icons/phosphor.json +53 -0
- package/icons/round.json +8 -0
- package/integrations/datastar.js +202 -0
- package/integrations/quickcrop.css +26 -0
- package/integrations/quickcrop.js +56 -0
- package/integrations/richclay.css +100 -0
- package/integrations/richclay.js +131 -0
- package/package.json +630 -0
- package/react/README.md +244 -0
- package/src/README.md +83 -0
- package/vendor/datastar/datastar-1.0.3.js +10 -0
- package/vendor/datastar/provenance.json +6 -0
- package/vendor/floating-ui/LICENSE-core +20 -0
- package/vendor/floating-ui/LICENSE-dom +20 -0
- package/vendor/floating-ui/floating-ui.core.umd.min.js +1 -0
- package/vendor/floating-ui/floating-ui.dom.umd.min.js +1 -0
- package/vendor/floating-ui/provenance.json +17 -0
- package/vendor/richclay/LICENSE +16 -0
- package/vendor/richclay/THIRD-PARTY-NOTICES.md +45 -0
- package/vendor/richclay/provenance.json +17 -0
- package/vendor/richclay/richclay.css +404 -0
- package/vendor/richclay/richclay.js +2940 -0
- package/vendor/richclay/vendor/DOMPURIFY-LICENSE +202 -0
- package/vendor/richclay/vendor/DOMPURIFY-LICENSE-MPL +373 -0
- package/vendor/richclay/vendor/SQUIRE-LICENSE +21 -0
- package/vendor/richclay/vendor/purify.min.js +3 -0
- package/vendor/richclay/vendor/squire.js +22 -0
- package/vendor/richclay/vendor/squire.provenance.json +30 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export * from './provider.js';
|
|
2
|
+
export * from './components/activity-feed.js';
|
|
3
|
+
export * from './components/alert-dialog.js';
|
|
4
|
+
export * from './components/app-shell.js';
|
|
5
|
+
export * from './components/app-toolbar.js';
|
|
6
|
+
export * from './components/avatar-group.js';
|
|
7
|
+
export * from './components/badge-and-pill.js';
|
|
8
|
+
export * from './components/breadcrumbs.js';
|
|
9
|
+
export * from './components/bulk-bar.js';
|
|
10
|
+
export * from './components/button.js';
|
|
11
|
+
export * from './components/callout-and-hint.js';
|
|
12
|
+
export * from './components/checkbox.js';
|
|
13
|
+
export * from './components/chip.js';
|
|
14
|
+
export * from './components/code-block.js';
|
|
15
|
+
export * from './components/column-manager.js';
|
|
16
|
+
export * from './components/combobox.js';
|
|
17
|
+
export * from './components/data-grid.js';
|
|
18
|
+
export * from './components/data-table.js';
|
|
19
|
+
export * from './components/date.js';
|
|
20
|
+
export * from './components/details.js';
|
|
21
|
+
export * from './components/dialog.js';
|
|
22
|
+
export * from './components/diff-view.js';
|
|
23
|
+
export * from './components/documents.js';
|
|
24
|
+
export * from './components/drawer.js';
|
|
25
|
+
export * from './components/editable-grid-cells.js';
|
|
26
|
+
export * from './components/eyebrow-kicker-lede-pull-quote.js';
|
|
27
|
+
export * from './components/field.js';
|
|
28
|
+
export * from './components/file.js';
|
|
29
|
+
export * from './components/files-table.js';
|
|
30
|
+
export * from './components/filter-builder.js';
|
|
31
|
+
export * from './components/form-error-summary.js';
|
|
32
|
+
export * from './components/icon.js';
|
|
33
|
+
export * from './components/icon-button.js';
|
|
34
|
+
export * from './components/image.js';
|
|
35
|
+
export * from './components/inline-edit.js';
|
|
36
|
+
export * from './components/input.js';
|
|
37
|
+
export * from './components/kanban-board.js';
|
|
38
|
+
export * from './components/layout.js';
|
|
39
|
+
export * from './components/list.js';
|
|
40
|
+
export * from './components/masthead-and-verdict.js';
|
|
41
|
+
export * from './components/menu.js';
|
|
42
|
+
export * from './components/multi-select-picker.js';
|
|
43
|
+
export * from './components/note.js';
|
|
44
|
+
export * from './components/number-field.js';
|
|
45
|
+
export * from './components/pagination.js';
|
|
46
|
+
export * from './components/persistent-action-banner.js';
|
|
47
|
+
export * from './components/popconfirm.js';
|
|
48
|
+
export * from './components/popover.js';
|
|
49
|
+
export * from './components/progress-and-gauge.js';
|
|
50
|
+
export * from './components/radio.js';
|
|
51
|
+
export * from './components/rich-text-toolbar.js';
|
|
52
|
+
export * from './components/rows-and-card.js';
|
|
53
|
+
export * from './components/save-status-indicator.js';
|
|
54
|
+
export * from './components/segmented-control.js';
|
|
55
|
+
export * from './components/select.js';
|
|
56
|
+
export * from './components/selectable-cards.js';
|
|
57
|
+
export * from './components/settings-rows.js';
|
|
58
|
+
export * from './components/sidebar-nav.js';
|
|
59
|
+
export * from './components/skeleton-and-empty.js';
|
|
60
|
+
export * from './components/slider.js';
|
|
61
|
+
export * from './components/small-charts.js';
|
|
62
|
+
export * from './components/sortable.js';
|
|
63
|
+
export * from './components/split-button.js';
|
|
64
|
+
export * from './components/split-panes.js';
|
|
65
|
+
export * from './components/stat-tiles.js';
|
|
66
|
+
export * from './components/steps.js';
|
|
67
|
+
export * from './components/switch.js';
|
|
68
|
+
export * from './components/table.js';
|
|
69
|
+
export * from './components/tabs.js';
|
|
70
|
+
export * from './components/tags.js';
|
|
71
|
+
export * from './components/textarea.js';
|
|
72
|
+
export * from './components/toast.js';
|
|
73
|
+
export * from './components/tooltip-and-key.js';
|
|
74
|
+
export * from './components/tree-view.js';
|
|
75
|
+
export * from './components/upload-dropzone.js';
|
|
76
|
+
export * from './components/wizard-shell.js';
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
export * from "./provider.js";
|
|
3
|
+
export * from "./components/activity-feed.js";
|
|
4
|
+
export * from "./components/alert-dialog.js";
|
|
5
|
+
export * from "./components/app-shell.js";
|
|
6
|
+
export * from "./components/app-toolbar.js";
|
|
7
|
+
export * from "./components/avatar-group.js";
|
|
8
|
+
export * from "./components/badge-and-pill.js";
|
|
9
|
+
export * from "./components/breadcrumbs.js";
|
|
10
|
+
export * from "./components/bulk-bar.js";
|
|
11
|
+
export * from "./components/button.js";
|
|
12
|
+
export * from "./components/callout-and-hint.js";
|
|
13
|
+
export * from "./components/checkbox.js";
|
|
14
|
+
export * from "./components/chip.js";
|
|
15
|
+
export * from "./components/code-block.js";
|
|
16
|
+
export * from "./components/column-manager.js";
|
|
17
|
+
export * from "./components/combobox.js";
|
|
18
|
+
export * from "./components/data-grid.js";
|
|
19
|
+
export * from "./components/data-table.js";
|
|
20
|
+
export * from "./components/date.js";
|
|
21
|
+
export * from "./components/details.js";
|
|
22
|
+
export * from "./components/dialog.js";
|
|
23
|
+
export * from "./components/diff-view.js";
|
|
24
|
+
export * from "./components/documents.js";
|
|
25
|
+
export * from "./components/drawer.js";
|
|
26
|
+
export * from "./components/editable-grid-cells.js";
|
|
27
|
+
export * from "./components/eyebrow-kicker-lede-pull-quote.js";
|
|
28
|
+
export * from "./components/field.js";
|
|
29
|
+
export * from "./components/file.js";
|
|
30
|
+
export * from "./components/files-table.js";
|
|
31
|
+
export * from "./components/filter-builder.js";
|
|
32
|
+
export * from "./components/form-error-summary.js";
|
|
33
|
+
export * from "./components/icon.js";
|
|
34
|
+
export * from "./components/icon-button.js";
|
|
35
|
+
export * from "./components/image.js";
|
|
36
|
+
export * from "./components/inline-edit.js";
|
|
37
|
+
export * from "./components/input.js";
|
|
38
|
+
export * from "./components/kanban-board.js";
|
|
39
|
+
export * from "./components/layout.js";
|
|
40
|
+
export * from "./components/list.js";
|
|
41
|
+
export * from "./components/masthead-and-verdict.js";
|
|
42
|
+
export * from "./components/menu.js";
|
|
43
|
+
export * from "./components/multi-select-picker.js";
|
|
44
|
+
export * from "./components/note.js";
|
|
45
|
+
export * from "./components/number-field.js";
|
|
46
|
+
export * from "./components/pagination.js";
|
|
47
|
+
export * from "./components/persistent-action-banner.js";
|
|
48
|
+
export * from "./components/popconfirm.js";
|
|
49
|
+
export * from "./components/popover.js";
|
|
50
|
+
export * from "./components/progress-and-gauge.js";
|
|
51
|
+
export * from "./components/radio.js";
|
|
52
|
+
export * from "./components/rich-text-toolbar.js";
|
|
53
|
+
export * from "./components/rows-and-card.js";
|
|
54
|
+
export * from "./components/save-status-indicator.js";
|
|
55
|
+
export * from "./components/segmented-control.js";
|
|
56
|
+
export * from "./components/select.js";
|
|
57
|
+
export * from "./components/selectable-cards.js";
|
|
58
|
+
export * from "./components/settings-rows.js";
|
|
59
|
+
export * from "./components/sidebar-nav.js";
|
|
60
|
+
export * from "./components/skeleton-and-empty.js";
|
|
61
|
+
export * from "./components/slider.js";
|
|
62
|
+
export * from "./components/small-charts.js";
|
|
63
|
+
export * from "./components/sortable.js";
|
|
64
|
+
export * from "./components/split-button.js";
|
|
65
|
+
export * from "./components/split-panes.js";
|
|
66
|
+
export * from "./components/stat-tiles.js";
|
|
67
|
+
export * from "./components/steps.js";
|
|
68
|
+
export * from "./components/switch.js";
|
|
69
|
+
export * from "./components/table.js";
|
|
70
|
+
export * from "./components/tabs.js";
|
|
71
|
+
export * from "./components/tags.js";
|
|
72
|
+
export * from "./components/textarea.js";
|
|
73
|
+
export * from "./components/toast.js";
|
|
74
|
+
export * from "./components/tooltip-and-key.js";
|
|
75
|
+
export * from "./components/tree-view.js";
|
|
76
|
+
export * from "./components/upload-dropzone.js";
|
|
77
|
+
export * from "./components/wizard-shell.js";
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type ComponentProps, type RefObject } from 'react';
|
|
2
|
+
import { Dialog } from '../components/dialog.js';
|
|
3
|
+
export interface QuickcropResult {
|
|
4
|
+
blob: Blob;
|
|
5
|
+
dataURL: string;
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
}
|
|
9
|
+
export interface QuickcropOptions {
|
|
10
|
+
aspect?: number;
|
|
11
|
+
type?: string;
|
|
12
|
+
quality?: number;
|
|
13
|
+
maxWidth?: number;
|
|
14
|
+
maxHeight?: number;
|
|
15
|
+
minSize?: number;
|
|
16
|
+
labels?: {
|
|
17
|
+
confirm?: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface QuickcropSession {
|
|
21
|
+
content: HTMLElement;
|
|
22
|
+
confirmLabel: string;
|
|
23
|
+
onConfirm: () => void;
|
|
24
|
+
onCancel: () => void;
|
|
25
|
+
}
|
|
26
|
+
export interface QuickcropModal {
|
|
27
|
+
fit: () => {
|
|
28
|
+
width: number;
|
|
29
|
+
height: number;
|
|
30
|
+
};
|
|
31
|
+
open: (session: QuickcropSession) => {
|
|
32
|
+
close: () => void;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export type QuickcropFunction = (file: Blob, options: QuickcropOptions & {
|
|
36
|
+
modal: QuickcropModal;
|
|
37
|
+
}) => Promise<QuickcropResult | null>;
|
|
38
|
+
export interface QuickcropController {
|
|
39
|
+
crop: (file: File, options?: QuickcropOptions) => Promise<QuickcropResult | null>;
|
|
40
|
+
cancel: () => void;
|
|
41
|
+
reset: () => Promise<QuickcropResult | null>;
|
|
42
|
+
setAspect: (aspect?: number) => Promise<QuickcropResult | null>;
|
|
43
|
+
session: QuickcropSession | null;
|
|
44
|
+
pending: boolean;
|
|
45
|
+
error: Error | null;
|
|
46
|
+
returnFocusRef: RefObject<HTMLElement | null>;
|
|
47
|
+
}
|
|
48
|
+
export declare function useQuickcrop({ quickcrop, onResult, onError }: {
|
|
49
|
+
quickcrop: QuickcropFunction;
|
|
50
|
+
onResult?: (result: QuickcropResult) => void;
|
|
51
|
+
onError?: (error: Error) => void;
|
|
52
|
+
}): QuickcropController;
|
|
53
|
+
export interface QuickcropDialogProps extends Omit<ComponentProps<typeof Dialog.Popup>, 'children'> {
|
|
54
|
+
cropper: QuickcropController;
|
|
55
|
+
title?: string;
|
|
56
|
+
children?: React.ReactNode;
|
|
57
|
+
}
|
|
58
|
+
export declare function QuickcropDialog({ cropper, title, children, style, ...props }: QuickcropDialogProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
4
|
+
import { Dialog } from "../components/dialog.js";
|
|
5
|
+
import { Button } from "../components/button.js";
|
|
6
|
+
function useQuickcrop({ quickcrop, onResult, onError }) {
|
|
7
|
+
const [session, setSession] = useState(null), [pending, setPending] = useState(false), [error, setError] = useState(null);
|
|
8
|
+
const latest = useRef({ quickcrop, onResult, onError });
|
|
9
|
+
latest.current = { quickcrop, onResult, onError };
|
|
10
|
+
const mounted = useRef(true), generation = useRef(0), active = useRef(null), previous = useRef(Promise.resolve(null));
|
|
11
|
+
const returnFocusRef = useRef(null);
|
|
12
|
+
const source = useRef(null);
|
|
13
|
+
const cancel = useCallback(() => {
|
|
14
|
+
generation.current++;
|
|
15
|
+
const session2 = active.current;
|
|
16
|
+
active.current = null;
|
|
17
|
+
session2?.onCancel();
|
|
18
|
+
if (mounted.current) {
|
|
19
|
+
setSession(null);
|
|
20
|
+
setPending(false);
|
|
21
|
+
}
|
|
22
|
+
}, []);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
mounted.current = true;
|
|
25
|
+
return () => {
|
|
26
|
+
mounted.current = false;
|
|
27
|
+
cancel();
|
|
28
|
+
};
|
|
29
|
+
}, [cancel]);
|
|
30
|
+
const start = useCallback((file, options, initial) => {
|
|
31
|
+
cancel();
|
|
32
|
+
const token = generation.current, prior = previous.current;
|
|
33
|
+
source.current = { file, options, initial };
|
|
34
|
+
if (mounted.current) {
|
|
35
|
+
setPending(true);
|
|
36
|
+
setError(null);
|
|
37
|
+
}
|
|
38
|
+
const current = () => mounted.current && generation.current === token;
|
|
39
|
+
const requireCurrent = () => {
|
|
40
|
+
if (!current()) throw new Error("The crop request was replaced or closed.");
|
|
41
|
+
};
|
|
42
|
+
const result = (async () => {
|
|
43
|
+
await prior;
|
|
44
|
+
if (!current()) return null;
|
|
45
|
+
try {
|
|
46
|
+
if (typeof latest.current.quickcrop !== "function") throw new Error("useQuickcrop requires a consumer supplied quickcrop function.");
|
|
47
|
+
const result2 = await latest.current.quickcrop(file, { ...options, modal: {
|
|
48
|
+
fit: () => {
|
|
49
|
+
requireCurrent();
|
|
50
|
+
return { width: Math.max(120, Math.min(648, window.innerWidth - 148)), height: Math.max(120, window.innerHeight - 332) };
|
|
51
|
+
},
|
|
52
|
+
open: (supplied) => {
|
|
53
|
+
requireCurrent();
|
|
54
|
+
let used = false;
|
|
55
|
+
const host = { ...supplied, onConfirm: () => {
|
|
56
|
+
if (used || !current()) return;
|
|
57
|
+
used = true;
|
|
58
|
+
supplied.onConfirm();
|
|
59
|
+
}, onCancel: () => {
|
|
60
|
+
if (used) return;
|
|
61
|
+
used = true;
|
|
62
|
+
supplied.onCancel();
|
|
63
|
+
} };
|
|
64
|
+
active.current = host;
|
|
65
|
+
setSession(host);
|
|
66
|
+
return { close: () => {
|
|
67
|
+
if (active.current === host) active.current = null;
|
|
68
|
+
if (current()) setSession(null);
|
|
69
|
+
} };
|
|
70
|
+
}
|
|
71
|
+
} });
|
|
72
|
+
if (!current()) return null;
|
|
73
|
+
if (result2) latest.current.onResult?.(result2);
|
|
74
|
+
return result2;
|
|
75
|
+
} catch (cause) {
|
|
76
|
+
if (current()) {
|
|
77
|
+
const error2 = cause instanceof Error ? cause : new Error(String(cause));
|
|
78
|
+
setError(error2);
|
|
79
|
+
latest.current.onError?.(error2);
|
|
80
|
+
}
|
|
81
|
+
return null;
|
|
82
|
+
} finally {
|
|
83
|
+
if (current()) {
|
|
84
|
+
active.current = null;
|
|
85
|
+
setSession(null);
|
|
86
|
+
setPending(false);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
})();
|
|
90
|
+
previous.current = result;
|
|
91
|
+
return result;
|
|
92
|
+
}, [cancel]);
|
|
93
|
+
const crop = useCallback((file, options = {}) => {
|
|
94
|
+
returnFocusRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
95
|
+
return start(file, options, options);
|
|
96
|
+
}, [start]);
|
|
97
|
+
const reset = useCallback(() => source.current ? start(source.current.file, source.current.initial, source.current.initial) : Promise.resolve(null), [start]);
|
|
98
|
+
const setAspect = useCallback((aspect) => source.current ? start(source.current.file, { ...source.current.options, aspect }, source.current.initial) : Promise.resolve(null), [start]);
|
|
99
|
+
return { session, pending, error, cancel, crop, reset, setAspect, returnFocusRef };
|
|
100
|
+
}
|
|
101
|
+
function Stage({ session }) {
|
|
102
|
+
const host = useRef(null);
|
|
103
|
+
useEffect(() => {
|
|
104
|
+
const node = host.current;
|
|
105
|
+
node.append(session.content);
|
|
106
|
+
return () => {
|
|
107
|
+
if (session.content.parentElement === node) session.content.remove();
|
|
108
|
+
};
|
|
109
|
+
}, [session]);
|
|
110
|
+
return /* @__PURE__ */ jsx("div", { ref: host, className: "bevel-r-quickcrop__stage" });
|
|
111
|
+
}
|
|
112
|
+
function QuickcropDialog({ cropper, title = "Crop image", children, style, ...props }) {
|
|
113
|
+
const size = { width: "min(48rem, calc(100vw - 2rem))", maxWidth: "none" };
|
|
114
|
+
return /* @__PURE__ */ jsx(Dialog.Root, { open: cropper.session !== null, onOpenChange: (open) => {
|
|
115
|
+
if (!open) cropper.cancel();
|
|
116
|
+
}, children: /* @__PURE__ */ jsxs(Dialog.Portal, { children: [
|
|
117
|
+
/* @__PURE__ */ jsx(Dialog.Backdrop, {}),
|
|
118
|
+
/* @__PURE__ */ jsxs(Dialog.Popup, { finalFocus: cropper.returnFocusRef, ...props, style: typeof style === "function" ? (state) => ({ ...size, ...style(state) }) : { ...size, ...style }, children: [
|
|
119
|
+
/* @__PURE__ */ jsxs(Dialog.Header, { children: [
|
|
120
|
+
/* @__PURE__ */ jsx(Dialog.Title, { children: title }),
|
|
121
|
+
/* @__PURE__ */ jsx(Dialog.Description, { children: "Adjust the selection, then confirm the crop." })
|
|
122
|
+
] }),
|
|
123
|
+
/* @__PURE__ */ jsxs(Dialog.Body, { children: [
|
|
124
|
+
cropper.session && /* @__PURE__ */ jsx(Stage, { session: cropper.session }),
|
|
125
|
+
children
|
|
126
|
+
] }),
|
|
127
|
+
/* @__PURE__ */ jsxs(Dialog.Footer, { children: [
|
|
128
|
+
/* @__PURE__ */ jsx(Button, { onClick: cropper.cancel, children: "Cancel" }),
|
|
129
|
+
/* @__PURE__ */ jsx(Button, { variant: "primary", onClick: () => cropper.session?.onConfirm(), children: cropper.session?.confirmLabel ?? "Crop" })
|
|
130
|
+
] })
|
|
131
|
+
] })
|
|
132
|
+
] }) });
|
|
133
|
+
}
|
|
134
|
+
export {
|
|
135
|
+
QuickcropDialog,
|
|
136
|
+
useQuickcrop
|
|
137
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type ComponentProps } from 'react';
|
|
2
|
+
import { type RichTextController } from '../internal/rich-text.js';
|
|
3
|
+
export type { RichTextController } from '../internal/rich-text.js';
|
|
4
|
+
interface Control {
|
|
5
|
+
id?: string;
|
|
6
|
+
value?: string;
|
|
7
|
+
label: string;
|
|
8
|
+
isActive?: (editor: RichclayInstance) => boolean;
|
|
9
|
+
isDisabled?: (editor: RichclayInstance) => boolean;
|
|
10
|
+
options?: readonly Control[];
|
|
11
|
+
run?: (editor: RichclayInstance) => unknown;
|
|
12
|
+
}
|
|
13
|
+
interface SquireEvents {
|
|
14
|
+
addEventListener: (type: string, listener: (event: Event) => void) => void;
|
|
15
|
+
removeEventListener: (type: string, listener: (event: Event) => void) => void;
|
|
16
|
+
}
|
|
17
|
+
export interface RichclayInstance {
|
|
18
|
+
element: HTMLElement;
|
|
19
|
+
registry: ReadonlyMap<string, Control>;
|
|
20
|
+
squire: SquireEvents | null;
|
|
21
|
+
getHTML: () => string;
|
|
22
|
+
setHTML: (html: string) => unknown;
|
|
23
|
+
focus: () => unknown;
|
|
24
|
+
saveSelection: () => unknown;
|
|
25
|
+
restoreSelection: () => unknown;
|
|
26
|
+
runControl: (control: Control) => unknown;
|
|
27
|
+
destroy: () => void;
|
|
28
|
+
}
|
|
29
|
+
export type RichclayConstructor = new (element: HTMLElement, options: Record<string, unknown>) => RichclayInstance;
|
|
30
|
+
export interface RichclayEditorProps extends Omit<ComponentProps<'div'>, 'children' | 'dangerouslySetInnerHTML' | 'defaultValue' | 'onChange'> {
|
|
31
|
+
RichClay: RichclayConstructor;
|
|
32
|
+
Squire: unknown;
|
|
33
|
+
value?: string;
|
|
34
|
+
defaultValue?: string;
|
|
35
|
+
onValueChange?: (html: string) => void;
|
|
36
|
+
onReady?: (controller: RichTextController | null) => void;
|
|
37
|
+
readOnly?: boolean;
|
|
38
|
+
inline?: boolean;
|
|
39
|
+
singleLine?: boolean;
|
|
40
|
+
placeholder?: string;
|
|
41
|
+
sanitize?: Record<string, unknown>;
|
|
42
|
+
}
|
|
43
|
+
export declare function RichclayEditor({ RichClay, Squire, value, defaultValue, onValueChange, onReady, readOnly, inline, singleLine, placeholder, sanitize, ref, ...props }: RichclayEditorProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useReducer, useRef } from "react";
|
|
4
|
+
import { nativePart } from "../internal/part.js";
|
|
5
|
+
import { useMergedRefs } from "../internal/refs.js";
|
|
6
|
+
import { emptyRichTextSnapshot } from "../internal/rich-text.js";
|
|
7
|
+
const Host = nativePart("div", "bevel-r-richtext__editor");
|
|
8
|
+
function RichclayEditor({ RichClay, Squire, value, defaultValue = "", onValueChange, onReady, readOnly = false, inline = false, singleLine = false, placeholder, sanitize, ref, ...props }) {
|
|
9
|
+
const host = useRef(null), merged = useMergedRefs(ref, host), instance = useRef(null);
|
|
10
|
+
const latest = useRef({ value, onValueChange, onReady }), content = useRef(value ?? defaultValue), suppress = useRef(false);
|
|
11
|
+
const [, refreshValue] = useReducer((revision) => revision + 1, 0);
|
|
12
|
+
const canonical = useRef({ html: "" });
|
|
13
|
+
latest.current = { value, onValueChange, onReady };
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (typeof RichClay !== "function" || !Squire) throw new Error("RichclayEditor requires the consumer supplied RichClay constructor and Squire.");
|
|
16
|
+
const node = host.current, listeners = /* @__PURE__ */ new Set();
|
|
17
|
+
let active = true, snapshot = emptyRichTextSnapshot;
|
|
18
|
+
const editor = new RichClay(node, {
|
|
19
|
+
Squire,
|
|
20
|
+
hyperclay: false,
|
|
21
|
+
toolbar: false,
|
|
22
|
+
readOnly,
|
|
23
|
+
inline,
|
|
24
|
+
singleLine,
|
|
25
|
+
placeholder,
|
|
26
|
+
sanitize,
|
|
27
|
+
onChange: (html) => {
|
|
28
|
+
if (active && !suppress.current) {
|
|
29
|
+
content.current = html;
|
|
30
|
+
latest.current.onValueChange?.(html);
|
|
31
|
+
refreshValue();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
instance.current = editor;
|
|
36
|
+
suppress.current = true;
|
|
37
|
+
try {
|
|
38
|
+
editor.setHTML(latest.current.value ?? content.current);
|
|
39
|
+
} finally {
|
|
40
|
+
suppress.current = false;
|
|
41
|
+
}
|
|
42
|
+
canonical.current = { value: latest.current.value, html: editor.getHTML() };
|
|
43
|
+
const readCommand = (control, id) => ({
|
|
44
|
+
id,
|
|
45
|
+
label: control.label,
|
|
46
|
+
active: Boolean(control.isActive?.(editor)),
|
|
47
|
+
disabled: readOnly || Boolean(control.isDisabled?.(editor)),
|
|
48
|
+
toggle: typeof control.isActive === "function",
|
|
49
|
+
...control.options ? { options: control.options.map((option) => readCommand(option, `${id}:${option.value}`)) } : {}
|
|
50
|
+
});
|
|
51
|
+
const refresh = (event) => {
|
|
52
|
+
if (!active) return;
|
|
53
|
+
const history = event;
|
|
54
|
+
const state = history?.detail ?? history;
|
|
55
|
+
const selection = node.ownerDocument.getSelection(), range = selection?.rangeCount && selection.getRangeAt(0), rect = range && !selection?.isCollapsed && node.contains(range.commonAncestorContainer) ? range.getBoundingClientRect?.() : null;
|
|
56
|
+
const next = {
|
|
57
|
+
commands: [...editor.registry].map(([id, control]) => readCommand(control, id)),
|
|
58
|
+
canUndo: state?.canUndo ?? snapshot.canUndo,
|
|
59
|
+
canRedo: state?.canRedo ?? snapshot.canRedo,
|
|
60
|
+
selection: rect ? { left: rect.left, top: rect.top, width: rect.width, height: rect.height } : null
|
|
61
|
+
};
|
|
62
|
+
next.commands = next.commands.map((command) => command.id === "undo" ? { ...command, disabled: command.disabled || !next.canUndo } : command.id === "redo" ? { ...command, disabled: command.disabled || !next.canRedo } : command);
|
|
63
|
+
if (JSON.stringify(next) === JSON.stringify(snapshot)) return;
|
|
64
|
+
snapshot = next;
|
|
65
|
+
listeners.forEach((listener) => listener());
|
|
66
|
+
};
|
|
67
|
+
const controller = {
|
|
68
|
+
subscribe: (listener) => {
|
|
69
|
+
listeners.add(listener);
|
|
70
|
+
return () => {
|
|
71
|
+
listeners.delete(listener);
|
|
72
|
+
};
|
|
73
|
+
},
|
|
74
|
+
getSnapshot: () => snapshot,
|
|
75
|
+
focus: () => {
|
|
76
|
+
if (active) editor.focus();
|
|
77
|
+
},
|
|
78
|
+
getHTML: () => editor.getHTML(),
|
|
79
|
+
saveSelection: () => {
|
|
80
|
+
if (active) editor.saveSelection();
|
|
81
|
+
},
|
|
82
|
+
run: (id) => {
|
|
83
|
+
if (!active || readOnly) return;
|
|
84
|
+
const [parent, option] = id.split(":"), control = option ? editor.registry.get(parent)?.options?.find((control2) => control2.value === option) : editor.registry.get(id);
|
|
85
|
+
if (!control?.run) throw new Error(`Richclay command is unavailable: ${id}`);
|
|
86
|
+
editor.restoreSelection();
|
|
87
|
+
editor.runControl(control);
|
|
88
|
+
refresh();
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
const events = ["input", "pathChange", "select", "cursor", "undoStateChange"];
|
|
92
|
+
events.forEach((type) => editor.squire?.addEventListener(type, refresh));
|
|
93
|
+
node.ownerDocument.addEventListener("selectionchange", refresh);
|
|
94
|
+
refresh();
|
|
95
|
+
latest.current.onReady?.(controller);
|
|
96
|
+
return () => {
|
|
97
|
+
active = false;
|
|
98
|
+
content.current = editor.getHTML();
|
|
99
|
+
events.forEach((type) => editor.squire?.removeEventListener(type, refresh));
|
|
100
|
+
node.ownerDocument.removeEventListener("selectionchange", refresh);
|
|
101
|
+
listeners.clear();
|
|
102
|
+
latest.current.onReady?.(null);
|
|
103
|
+
editor.destroy();
|
|
104
|
+
instance.current = null;
|
|
105
|
+
};
|
|
106
|
+
}, [RichClay, Squire, readOnly, inline, singleLine]);
|
|
107
|
+
useEffect(() => {
|
|
108
|
+
const editor = instance.current;
|
|
109
|
+
if (value === void 0 || !editor) return;
|
|
110
|
+
const html = editor.getHTML();
|
|
111
|
+
if (value === html) {
|
|
112
|
+
canonical.current = { value, html };
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
if (canonical.current.value === value && canonical.current.html === html) return;
|
|
116
|
+
suppress.current = true;
|
|
117
|
+
try {
|
|
118
|
+
editor.setHTML(value);
|
|
119
|
+
content.current = value;
|
|
120
|
+
canonical.current = { value, html: editor.getHTML() };
|
|
121
|
+
} finally {
|
|
122
|
+
suppress.current = false;
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
return /* @__PURE__ */ jsx(Host, { role: "textbox", "aria-multiline": !singleLine, "aria-readonly": readOnly || void 0, ...props, ref: merged });
|
|
126
|
+
}
|
|
127
|
+
export {
|
|
128
|
+
RichclayEditor
|
|
129
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type StateClassName<State> = string | ((state: State) => string | undefined);
|
|
2
|
+
export declare function classes<State>(base: string, extra?: StateClassName<State>): StateClassName<State>;
|
|
3
|
+
export declare function cx(...values: Array<string | false | null | undefined>): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
function classes(base, extra) {
|
|
2
|
+
return typeof extra === "function" ? (state) => [base, extra(state)].filter(Boolean).join(" ") : [base, extra].filter(Boolean).join(" ");
|
|
3
|
+
}
|
|
4
|
+
function cx(...values) {
|
|
5
|
+
return values.filter(Boolean).join(" ");
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
classes,
|
|
9
|
+
cx
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function CloseMark(): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { ICONS } from "@panphora/bevel/icons";
|
|
4
|
+
const close = ICONS.close;
|
|
5
|
+
function CloseMark() {
|
|
6
|
+
return /* @__PURE__ */ jsx("svg", { viewBox: close.viewBox, fill: "currentColor", "aria-hidden": "true", focusable: "false", dangerouslySetInnerHTML: { __html: close.inner } });
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
CloseMark
|
|
10
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface ChangeDetails {
|
|
2
|
+
reason: string;
|
|
3
|
+
event?: Event | React.SyntheticEvent;
|
|
4
|
+
}
|
|
5
|
+
export declare function useControllableState<Value>({ value, defaultValue, onChange }: {
|
|
6
|
+
value?: Value;
|
|
7
|
+
defaultValue: Value;
|
|
8
|
+
onChange?: (value: Value, details: ChangeDetails) => void;
|
|
9
|
+
}): [Value, (next: Value | ((previous: Value) => Value), details: ChangeDetails) => void];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useRef, useState } from "react";
|
|
3
|
+
function useControllableState({ value, defaultValue, onChange }) {
|
|
4
|
+
const [internal, setInternal] = useState(defaultValue);
|
|
5
|
+
const current = value !== void 0 ? value : internal;
|
|
6
|
+
const latest = useRef({ current, value, onChange });
|
|
7
|
+
latest.current = { current, value, onChange };
|
|
8
|
+
const change = useCallback((next, details) => {
|
|
9
|
+
const previous = latest.current;
|
|
10
|
+
const result = typeof next === "function" ? next(previous.current) : next;
|
|
11
|
+
if (Object.is(result, previous.current)) return;
|
|
12
|
+
if (previous.value === void 0) {
|
|
13
|
+
latest.current = { ...previous, current: result };
|
|
14
|
+
setInternal(result);
|
|
15
|
+
}
|
|
16
|
+
previous.onChange?.(result, details);
|
|
17
|
+
}, []);
|
|
18
|
+
return [current, change];
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
useControllableState
|
|
22
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The drop effect a tree should negotiate for one drag.
|
|
3
|
+
*
|
|
4
|
+
* `dropEffect` is not a cursor label. A value that does not intersect the source's `effectAllowed`
|
|
5
|
+
* makes the browser refuse the drop outright: `dragover` is prevented, `drop` NEVER fires, and the
|
|
6
|
+
* only trace is `dragend` reporting `dropEffect === 'none'`. So a hardcoded `'copy'` cancels every
|
|
7
|
+
* move a consumer's own rows offer, while the hover paint still looks correct, which is why the
|
|
8
|
+
* paint is not the thing to assert.
|
|
9
|
+
*
|
|
10
|
+
* Files dragged in from the desktop are always a copy. Anything dragged inside the page is a move
|
|
11
|
+
* when the source permits one, which is what a row dropped on a folder means.
|
|
12
|
+
*
|
|
13
|
+
* ⚠ This is a pure function rather than a closure because **the DOM cannot test it.** Writing
|
|
14
|
+
* `effectAllowed` on a synthetic `DataTransfer` does not stick in Chrome: the value stays `'none'`
|
|
15
|
+
* whatever you assign. Measured 2026-09-17 across all nine `effectAllowed` values plus a fresh
|
|
16
|
+
* transfer, with and without files, and every case reported `effectAllowed: 'none'` and
|
|
17
|
+
* `defaultPrevented: false`. A synthetic drag therefore always takes the "source permits nothing"
|
|
18
|
+
* branch, so no dispatched event can tell one mapping from another and every such test reads as a
|
|
19
|
+
* pass. Testing a real drag needs CDP drag interception. Keeping the decision pure is what makes
|
|
20
|
+
* the mapping assertable at all.
|
|
21
|
+
*/
|
|
22
|
+
export interface DropEffectInput {
|
|
23
|
+
/** True when the drag carries files from outside the page, which is always a copy. */
|
|
24
|
+
external: boolean;
|
|
25
|
+
/** The source's `effectAllowed`, or undefined when there is no transfer to read. */
|
|
26
|
+
effectAllowed: string | undefined;
|
|
27
|
+
}
|
|
28
|
+
export declare function dropEffectFor({ external, effectAllowed }: DropEffectInput): 'copy' | 'move';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const MOVE_ALLOWED = /* @__PURE__ */ new Set(["move", "copyMove", "linkMove", "all", "uninitialized"]);
|
|
2
|
+
function dropEffectFor({ external, effectAllowed }) {
|
|
3
|
+
if (external) return "copy";
|
|
4
|
+
return effectAllowed === void 0 || MOVE_ALLOWED.has(effectAllowed) ? "move" : "copy";
|
|
5
|
+
}
|
|
6
|
+
export {
|
|
7
|
+
dropEffectFor
|
|
8
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
3
|
+
function useFormReset(input, reset) {
|
|
4
|
+
const latest = useRef(reset);
|
|
5
|
+
latest.current = reset;
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
const form = input.current?.form;
|
|
8
|
+
if (!form) return;
|
|
9
|
+
let active = true;
|
|
10
|
+
const listener = (event) => queueMicrotask(() => {
|
|
11
|
+
if (active && !event.defaultPrevented) latest.current(event);
|
|
12
|
+
});
|
|
13
|
+
form.addEventListener("reset", listener);
|
|
14
|
+
return () => {
|
|
15
|
+
active = false;
|
|
16
|
+
form.removeEventListener("reset", listener);
|
|
17
|
+
};
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
useFormReset
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function formatBytes(value: number): string;
|