@bridgebrew/ui 0.0.0-stage → 0.1.9
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 +39 -2
- package/SOURCE.md +182 -0
- package/dist/build.js +871 -0
- package/dist/theme-css.js +896 -0
- package/dist/themes.js +69 -0
- package/dist/types/build/stylesheet.d.ts +31 -0
- package/dist/types/components/composite/command/command.d.ts +94 -0
- package/dist/types/components/composite/command/index.d.ts +2 -0
- package/dist/types/components/composite/draft-bar/draft-bar.d.ts +12 -0
- package/dist/types/components/composite/draft-bar/index.d.ts +2 -0
- package/dist/types/components/composite/image-field/image-field.d.ts +33 -0
- package/dist/types/components/composite/image-field/index.d.ts +2 -0
- package/dist/types/components/composite/list/index.d.ts +3 -0
- package/dist/types/components/composite/list/list-swipe.d.ts +28 -0
- package/dist/types/components/composite/list/list.d.ts +95 -0
- package/dist/types/components/composite/picker/index.d.ts +2 -0
- package/dist/types/components/composite/picker/picker.d.ts +44 -0
- package/dist/types/components/composite/prompt-field/index.d.ts +2 -0
- package/dist/types/components/composite/prompt-field/prompt-field.d.ts +18 -0
- package/dist/types/components/composite/properties/index.d.ts +2 -0
- package/dist/types/components/composite/properties/properties.d.ts +24 -0
- package/dist/types/components/composite/snooze-menu/index.d.ts +4 -0
- package/dist/types/components/composite/snooze-menu/presets.d.ts +36 -0
- package/dist/types/components/composite/snooze-menu/snooze-menu.d.ts +27 -0
- package/dist/types/components/composite/tag-input/index.d.ts +2 -0
- package/dist/types/components/composite/tag-input/tag-input.d.ts +22 -0
- package/dist/types/components/composite/wizard/index.d.ts +2 -0
- package/dist/types/components/composite/wizard/wizard.d.ts +53 -0
- package/dist/types/components/core/avatar/avatar.d.ts +16 -0
- package/dist/types/components/core/avatar/index.d.ts +2 -0
- package/dist/types/components/core/badge/badge.d.ts +8 -0
- package/dist/types/components/core/badge/index.d.ts +2 -0
- package/dist/types/components/core/breadcrumb/breadcrumb.d.ts +21 -0
- package/dist/types/components/core/breadcrumb/index.d.ts +2 -0
- package/dist/types/components/core/bullets/bullets.d.ts +15 -0
- package/dist/types/components/core/bullets/index.d.ts +2 -0
- package/dist/types/components/core/button/button.d.ts +14 -0
- package/dist/types/components/core/button/index.d.ts +2 -0
- package/dist/types/components/core/card/card.d.ts +16 -0
- package/dist/types/components/core/card/index.d.ts +2 -0
- package/dist/types/components/core/checkbox/checkbox.d.ts +15 -0
- package/dist/types/components/core/checkbox/index.d.ts +2 -0
- package/dist/types/components/core/cluster/cluster.d.ts +5 -0
- package/dist/types/components/core/cluster/index.d.ts +1 -0
- package/dist/types/components/core/code-block/code-block.d.ts +18 -0
- package/dist/types/components/core/code-block/index.d.ts +2 -0
- package/dist/types/components/core/collapsible/collapsible.d.ts +8 -0
- package/dist/types/components/core/collapsible/index.d.ts +1 -0
- package/dist/types/components/core/colour-picker/colour-picker.d.ts +25 -0
- package/dist/types/components/core/colour-picker/index.d.ts +4 -0
- package/dist/types/components/core/combobox/combobox.d.ts +63 -0
- package/dist/types/components/core/combobox/index.d.ts +2 -0
- package/dist/types/components/core/detail/detail.d.ts +12 -0
- package/dist/types/components/core/detail/index.d.ts +1 -0
- package/dist/types/components/core/dialog/dialog.d.ts +43 -0
- package/dist/types/components/core/dialog/drag.d.ts +4 -0
- package/dist/types/components/core/dialog/index.d.ts +2 -0
- package/dist/types/components/core/drop-zone/drop-zone.d.ts +23 -0
- package/dist/types/components/core/drop-zone/index.d.ts +2 -0
- package/dist/types/components/core/dropdown-menu/dropdown-menu.d.ts +78 -0
- package/dist/types/components/core/dropdown-menu/index.d.ts +2 -0
- package/dist/types/components/core/editable-field/editable-field.d.ts +42 -0
- package/dist/types/components/core/editable-field/index.d.ts +2 -0
- package/dist/types/components/core/empty-state/empty-state.d.ts +11 -0
- package/dist/types/components/core/empty-state/index.d.ts +2 -0
- package/dist/types/components/core/field/field.d.ts +31 -0
- package/dist/types/components/core/field/index.d.ts +2 -0
- package/dist/types/components/core/icon/icon-sets.d.ts +38 -0
- package/dist/types/components/core/icon/icon.d.ts +14 -0
- package/dist/types/components/core/icon/index.d.ts +2 -0
- package/dist/types/components/core/input/index.d.ts +4 -0
- package/dist/types/components/core/input/input.d.ts +22 -0
- package/dist/types/components/core/input/textarea.d.ts +8 -0
- package/dist/types/components/core/kbd/index.d.ts +2 -0
- package/dist/types/components/core/kbd/kbd.d.ts +7 -0
- package/dist/types/components/core/label/index.d.ts +2 -0
- package/dist/types/components/core/label/label.d.ts +13 -0
- package/dist/types/components/core/main-content/index.d.ts +2 -0
- package/dist/types/components/core/main-content/main-content.d.ts +18 -0
- package/dist/types/components/core/pane/index.d.ts +1 -0
- package/dist/types/components/core/pane/pane.d.ts +12 -0
- package/dist/types/components/core/pick-menu/index.d.ts +4 -0
- package/dist/types/components/core/pick-menu/pick-menu.d.ts +57 -0
- package/dist/types/components/core/pick-menu/tag-menu.d.ts +19 -0
- package/dist/types/components/core/popover/index.d.ts +2 -0
- package/dist/types/components/core/popover/popover.d.ts +22 -0
- package/dist/types/components/core/progress/index.d.ts +2 -0
- package/dist/types/components/core/progress/progress.d.ts +13 -0
- package/dist/types/components/core/resizable/index.d.ts +2 -0
- package/dist/types/components/core/resizable/resizable.d.ts +15 -0
- package/dist/types/components/core/resizable/use-remembered-layout.d.ts +31 -0
- package/dist/types/components/core/screen-link/index.d.ts +2 -0
- package/dist/types/components/core/screen-link/screen-link.d.ts +52 -0
- package/dist/types/components/core/scroll-area/index.d.ts +2 -0
- package/dist/types/components/core/scroll-area/scroll-area.d.ts +13 -0
- package/dist/types/components/core/scroll-area/steps.d.ts +5 -0
- package/dist/types/components/core/section/index.d.ts +2 -0
- package/dist/types/components/core/section/section.d.ts +16 -0
- package/dist/types/components/core/segment-group/index.d.ts +2 -0
- package/dist/types/components/core/segment-group/segment-group.d.ts +24 -0
- package/dist/types/components/core/select/index.d.ts +2 -0
- package/dist/types/components/core/select/select.d.ts +39 -0
- package/dist/types/components/core/skeleton/index.d.ts +2 -0
- package/dist/types/components/core/skeleton/skeleton.d.ts +13 -0
- package/dist/types/components/core/slider/index.d.ts +2 -0
- package/dist/types/components/core/slider/slider.d.ts +9 -0
- package/dist/types/components/core/sortable/index.d.ts +2 -0
- package/dist/types/components/core/sortable/sortable.d.ts +53 -0
- package/dist/types/components/core/split-view/index.d.ts +2 -0
- package/dist/types/components/core/split-view/split-view.d.ts +28 -0
- package/dist/types/components/core/status-icon/index.d.ts +2 -0
- package/dist/types/components/core/status-icon/status-icon.d.ts +13 -0
- package/dist/types/components/core/table/collapsible-rows.d.ts +7 -0
- package/dist/types/components/core/table/expand-toggle.d.ts +10 -0
- package/dist/types/components/core/table/group-header.d.ts +14 -0
- package/dist/types/components/core/table/index.d.ts +8 -0
- package/dist/types/components/core/table/table.d.ts +31 -0
- package/dist/types/components/core/tabs/index.d.ts +2 -0
- package/dist/types/components/core/tabs/tabs.d.ts +20 -0
- package/dist/types/components/core/tag-pill/index.d.ts +2 -0
- package/dist/types/components/core/tag-pill/tag-pill.d.ts +25 -0
- package/dist/types/components/core/thumbnail/index.d.ts +2 -0
- package/dist/types/components/core/thumbnail/thumbnail.d.ts +23 -0
- package/dist/types/components/core/toast/index.d.ts +2 -0
- package/dist/types/components/core/toast/toast.d.ts +88 -0
- package/dist/types/components/core/toggle/index.d.ts +2 -0
- package/dist/types/components/core/toggle/toggle.d.ts +9 -0
- package/dist/types/components/core/toggle-group/index.d.ts +2 -0
- package/dist/types/components/core/toggle-group/toggle-group.d.ts +21 -0
- package/dist/types/components/core/tooltip/index.d.ts +2 -0
- package/dist/types/components/core/tooltip/tooltip.d.ts +33 -0
- package/dist/types/components/layout/multi-pane/index.d.ts +4 -0
- package/dist/types/components/layout/multi-pane/list-detail.d.ts +17 -0
- package/dist/types/components/layout/multi-pane/multi-pane.d.ts +34 -0
- package/dist/types/components/layout/single-pane/index.d.ts +2 -0
- package/dist/types/components/layout/single-pane/single-pane.d.ts +11 -0
- package/dist/types/components/shell/app-shell/app-shell.d.ts +12 -0
- package/dist/types/components/shell/app-shell/index.d.ts +2 -0
- package/dist/types/components/shell/sidebar/index.d.ts +2 -0
- package/dist/types/components/shell/sidebar/sidebar-group.d.ts +45 -0
- package/dist/types/components/shell/sidebar/sidebar-item.d.ts +19 -0
- package/dist/types/components/shell/sidebar/sidebar-resize-handle.d.ts +17 -0
- package/dist/types/components/shell/sidebar/sidebar-tree.d.ts +42 -0
- package/dist/types/components/shell/sidebar/sidebar.d.ts +27 -0
- package/dist/types/components/template/address-book-template/address-book-template.d.ts +15 -0
- package/dist/types/components/template/address-book-template/index.d.ts +2 -0
- package/dist/types/components/template/mail-template/index.d.ts +2 -0
- package/dist/types/components/template/mail-template/mail-template.d.ts +11 -0
- package/dist/types/components/template/use-narrow.d.ts +3 -0
- package/dist/types/index.d.ts +149 -0
- package/dist/types/kit/check-rendering.d.ts +3 -0
- package/dist/types/kit/kit.d.ts +76 -0
- package/dist/types/lib/clipboard.d.ts +5 -0
- package/dist/types/lib/dates.d.ts +9 -0
- package/dist/types/lib/json.d.ts +26 -0
- package/dist/types/lib/keys.d.ts +15 -0
- package/dist/types/lib/utils.d.ts +2 -0
- package/dist/types/lib/view-scope.d.ts +22 -0
- package/dist/types/profile/profile.d.ts +34 -0
- package/dist/types/theme/appearance.d.ts +31 -0
- package/dist/types/theme/boot.d.ts +3 -0
- package/dist/types/theme/client-appearance-react.d.ts +3 -0
- package/dist/types/theme/client-appearance.d.ts +69 -0
- package/dist/types/theme/generate-tokens.d.ts +45 -0
- package/dist/types/theme/pack-themes-react.d.ts +24 -0
- package/dist/types/theme/palette.d.ts +111 -0
- package/dist/types/theme/semantic-mapping.d.ts +28 -0
- package/dist/types/theme/set-theme.d.ts +30 -0
- package/dist/types/theme/theme-colours.d.ts +14 -0
- package/dist/types/theme/theme-css.d.ts +3 -0
- package/dist/types/theme/themes.d.ts +63 -0
- package/dist/types/theme/wallpaper-sheet.d.ts +16 -0
- package/dist/types/theme/wallpaper-theme-react.d.ts +7 -0
- package/dist/types/theme/wallpaper-theme.d.ts +37 -0
- package/package.json +87 -3
- package/src/build/stylesheet.ts +128 -0
- package/src/components/composite/command/command.meta.yaml +74 -0
- package/src/components/composite/command/command.tsx +939 -0
- package/src/components/composite/command/index.ts +17 -0
- package/src/components/composite/draft-bar/draft-bar.meta.yaml +19 -0
- package/src/components/composite/draft-bar/draft-bar.tsx +57 -0
- package/src/components/composite/draft-bar/index.ts +2 -0
- package/src/components/composite/image-field/image-field.meta.yaml +69 -0
- package/src/components/composite/image-field/image-field.tsx +267 -0
- package/src/components/composite/image-field/index.ts +2 -0
- package/src/components/composite/list/index.ts +18 -0
- package/src/components/composite/list/list-swipe.tsx +163 -0
- package/src/components/composite/list/list.meta.yaml +238 -0
- package/src/components/composite/list/list.tsx +868 -0
- package/src/components/composite/picker/index.ts +2 -0
- package/src/components/composite/picker/picker.meta.yaml +103 -0
- package/src/components/composite/picker/picker.tsx +276 -0
- package/src/components/composite/prompt-field/index.ts +2 -0
- package/src/components/composite/prompt-field/prompt-field.meta.yaml +60 -0
- package/src/components/composite/prompt-field/prompt-field.tsx +81 -0
- package/src/components/composite/properties/index.ts +9 -0
- package/src/components/composite/properties/properties.meta.yaml +56 -0
- package/src/components/composite/properties/properties.tsx +132 -0
- package/src/components/composite/snooze-menu/index.ts +11 -0
- package/src/components/composite/snooze-menu/presets.ts +169 -0
- package/src/components/composite/snooze-menu/snooze-menu.meta.yaml +58 -0
- package/src/components/composite/snooze-menu/snooze-menu.tsx +146 -0
- package/src/components/composite/tag-input/index.ts +2 -0
- package/src/components/composite/tag-input/tag-input.meta.yaml +51 -0
- package/src/components/composite/tag-input/tag-input.tsx +404 -0
- package/src/components/composite/wizard/index.ts +2 -0
- package/src/components/composite/wizard/wizard.meta.yaml +73 -0
- package/src/components/composite/wizard/wizard.tsx +256 -0
- package/src/components/core/avatar/avatar.meta.yaml +71 -0
- package/src/components/core/avatar/avatar.tsx +92 -0
- package/src/components/core/avatar/index.ts +2 -0
- package/src/components/core/badge/badge.meta.yaml +34 -0
- package/src/components/core/badge/badge.tsx +23 -0
- package/src/components/core/badge/index.ts +2 -0
- package/src/components/core/breadcrumb/breadcrumb.meta.yaml +45 -0
- package/src/components/core/breadcrumb/breadcrumb.tsx +110 -0
- package/src/components/core/breadcrumb/index.ts +2 -0
- package/src/components/core/bullets/bullets.meta.yaml +37 -0
- package/src/components/core/bullets/bullets.tsx +60 -0
- package/src/components/core/bullets/index.ts +2 -0
- package/src/components/core/button/button.meta.yaml +91 -0
- package/src/components/core/button/button.tsx +93 -0
- package/src/components/core/button/index.ts +2 -0
- package/src/components/core/card/card.meta.yaml +94 -0
- package/src/components/core/card/card.tsx +54 -0
- package/src/components/core/card/index.ts +2 -0
- package/src/components/core/checkbox/checkbox.meta.yaml +59 -0
- package/src/components/core/checkbox/checkbox.tsx +106 -0
- package/src/components/core/checkbox/index.ts +2 -0
- package/src/components/core/cluster/cluster.meta.yaml +4 -0
- package/src/components/core/cluster/cluster.tsx +17 -0
- package/src/components/core/cluster/index.ts +1 -0
- package/src/components/core/code-block/code-block.meta.yaml +30 -0
- package/src/components/core/code-block/code-block.tsx +93 -0
- package/src/components/core/code-block/index.ts +2 -0
- package/src/components/core/collapsible/collapsible.meta.yaml +34 -0
- package/src/components/core/collapsible/collapsible.tsx +54 -0
- package/src/components/core/collapsible/index.ts +1 -0
- package/src/components/core/colour-picker/colour-picker.meta.yaml +52 -0
- package/src/components/core/colour-picker/colour-picker.tsx +314 -0
- package/src/components/core/colour-picker/index.ts +4 -0
- package/src/components/core/combobox/combobox.meta.yaml +75 -0
- package/src/components/core/combobox/combobox.tsx +288 -0
- package/src/components/core/combobox/index.ts +2 -0
- package/src/components/core/detail/detail.meta.yaml +13 -0
- package/src/components/core/detail/detail.tsx +73 -0
- package/src/components/core/detail/index.ts +1 -0
- package/src/components/core/dialog/dialog.meta.yaml +95 -0
- package/src/components/core/dialog/dialog.tsx +254 -0
- package/src/components/core/dialog/drag.ts +40 -0
- package/src/components/core/dialog/index.ts +25 -0
- package/src/components/core/drop-zone/drop-zone.meta.yaml +55 -0
- package/src/components/core/drop-zone/drop-zone.tsx +146 -0
- package/src/components/core/drop-zone/index.ts +2 -0
- package/src/components/core/dropdown-menu/dropdown-menu.meta.yaml +118 -0
- package/src/components/core/dropdown-menu/dropdown-menu.tsx +407 -0
- package/src/components/core/dropdown-menu/index.ts +32 -0
- package/src/components/core/editable-field/editable-field.meta.yaml +120 -0
- package/src/components/core/editable-field/editable-field.tsx +346 -0
- package/src/components/core/editable-field/index.ts +2 -0
- package/src/components/core/empty-state/empty-state.meta.yaml +21 -0
- package/src/components/core/empty-state/empty-state.tsx +42 -0
- package/src/components/core/empty-state/index.ts +2 -0
- package/src/components/core/field/field.meta.yaml +37 -0
- package/src/components/core/field/field.tsx +100 -0
- package/src/components/core/field/index.ts +9 -0
- package/src/components/core/icon/curated-names.json +107 -0
- package/src/components/core/icon/icon-sets.ts +109 -0
- package/src/components/core/icon/icon.meta.yaml +30 -0
- package/src/components/core/icon/icon.tsx +93 -0
- package/src/components/core/icon/index.ts +2 -0
- package/src/components/core/input/index.ts +4 -0
- package/src/components/core/input/input.meta.yaml +98 -0
- package/src/components/core/input/input.tsx +133 -0
- package/src/components/core/input/textarea.meta.yaml +79 -0
- package/src/components/core/input/textarea.tsx +63 -0
- package/src/components/core/kbd/index.ts +2 -0
- package/src/components/core/kbd/kbd.meta.yaml +12 -0
- package/src/components/core/kbd/kbd.tsx +29 -0
- package/src/components/core/label/index.ts +2 -0
- package/src/components/core/label/label.meta.yaml +55 -0
- package/src/components/core/label/label.tsx +72 -0
- package/src/components/core/main-content/index.ts +2 -0
- package/src/components/core/main-content/main-content.meta.yaml +23 -0
- package/src/components/core/main-content/main-content.tsx +49 -0
- package/src/components/core/pane/index.ts +1 -0
- package/src/components/core/pane/pane.meta.yaml +13 -0
- package/src/components/core/pane/pane.tsx +64 -0
- package/src/components/core/pick-menu/index.ts +4 -0
- package/src/components/core/pick-menu/pick-menu.meta.yaml +36 -0
- package/src/components/core/pick-menu/pick-menu.tsx +348 -0
- package/src/components/core/pick-menu/tag-menu.meta.yaml +7 -0
- package/src/components/core/pick-menu/tag-menu.tsx +79 -0
- package/src/components/core/popover/index.ts +2 -0
- package/src/components/core/popover/popover.meta.yaml +16 -0
- package/src/components/core/popover/popover.tsx +66 -0
- package/src/components/core/progress/index.ts +2 -0
- package/src/components/core/progress/progress.meta.yaml +47 -0
- package/src/components/core/progress/progress.tsx +56 -0
- package/src/components/core/resizable/index.ts +13 -0
- package/src/components/core/resizable/resizable.meta.yaml +110 -0
- package/src/components/core/resizable/resizable.tsx +125 -0
- package/src/components/core/resizable/use-remembered-layout.ts +261 -0
- package/src/components/core/screen-link/index.ts +2 -0
- package/src/components/core/screen-link/screen-link.meta.yaml +34 -0
- package/src/components/core/screen-link/screen-link.tsx +100 -0
- package/src/components/core/scroll-area/index.ts +2 -0
- package/src/components/core/scroll-area/scroll-area.meta.yaml +72 -0
- package/src/components/core/scroll-area/scroll-area.tsx +95 -0
- package/src/components/core/scroll-area/steps.tsx +72 -0
- package/src/components/core/section/index.ts +2 -0
- package/src/components/core/section/section.meta.yaml +72 -0
- package/src/components/core/section/section.tsx +93 -0
- package/src/components/core/segment-group/index.ts +2 -0
- package/src/components/core/segment-group/segment-group.meta.yaml +71 -0
- package/src/components/core/segment-group/segment-group.tsx +166 -0
- package/src/components/core/select/index.ts +20 -0
- package/src/components/core/select/select.meta.yaml +48 -0
- package/src/components/core/select/select.tsx +226 -0
- package/src/components/core/skeleton/index.ts +2 -0
- package/src/components/core/skeleton/skeleton.meta.yaml +50 -0
- package/src/components/core/skeleton/skeleton.tsx +71 -0
- package/src/components/core/slider/index.ts +2 -0
- package/src/components/core/slider/slider.meta.yaml +55 -0
- package/src/components/core/slider/slider.tsx +46 -0
- package/src/components/core/sortable/index.ts +16 -0
- package/src/components/core/sortable/sortable.meta.yaml +125 -0
- package/src/components/core/sortable/sortable.tsx +471 -0
- package/src/components/core/split-view/index.ts +2 -0
- package/src/components/core/split-view/split-view.meta.yaml +85 -0
- package/src/components/core/split-view/split-view.tsx +193 -0
- package/src/components/core/status-icon/index.ts +2 -0
- package/src/components/core/status-icon/status-icon.meta.yaml +64 -0
- package/src/components/core/status-icon/status-icon.tsx +94 -0
- package/src/components/core/table/collapsible-rows.tsx +30 -0
- package/src/components/core/table/expand-toggle.tsx +58 -0
- package/src/components/core/table/group-header.tsx +35 -0
- package/src/components/core/table/index.ts +26 -0
- package/src/components/core/table/table.meta.yaml +67 -0
- package/src/components/core/table/table.tsx +166 -0
- package/src/components/core/tabs/index.ts +2 -0
- package/src/components/core/tabs/tabs.meta.yaml +57 -0
- package/src/components/core/tabs/tabs.tsx +74 -0
- package/src/components/core/tag-pill/index.ts +2 -0
- package/src/components/core/tag-pill/tag-pill.meta.yaml +19 -0
- package/src/components/core/tag-pill/tag-pill.tsx +102 -0
- package/src/components/core/thumbnail/index.ts +2 -0
- package/src/components/core/thumbnail/thumbnail.meta.yaml +59 -0
- package/src/components/core/thumbnail/thumbnail.tsx +162 -0
- package/src/components/core/toast/index.ts +12 -0
- package/src/components/core/toast/toast.meta.yaml +93 -0
- package/src/components/core/toast/toast.tsx +763 -0
- package/src/components/core/toggle/index.ts +2 -0
- package/src/components/core/toggle/toggle.meta.yaml +53 -0
- package/src/components/core/toggle/toggle.tsx +44 -0
- package/src/components/core/toggle-group/index.ts +2 -0
- package/src/components/core/toggle-group/toggle-group.meta.yaml +59 -0
- package/src/components/core/toggle-group/toggle-group.tsx +68 -0
- package/src/components/core/tooltip/index.ts +7 -0
- package/src/components/core/tooltip/tooltip.meta.yaml +93 -0
- package/src/components/core/tooltip/tooltip.tsx +198 -0
- package/src/components/layout/multi-pane/index.ts +4 -0
- package/src/components/layout/multi-pane/list-detail.tsx +45 -0
- package/src/components/layout/multi-pane/multi-pane.meta.yaml +67 -0
- package/src/components/layout/multi-pane/multi-pane.tsx +158 -0
- package/src/components/layout/single-pane/index.ts +2 -0
- package/src/components/layout/single-pane/single-pane.meta.yaml +35 -0
- package/src/components/layout/single-pane/single-pane.tsx +48 -0
- package/src/components/shell/app-shell/app-shell.meta.yaml +65 -0
- package/src/components/shell/app-shell/app-shell.tsx +61 -0
- package/src/components/shell/app-shell/index.ts +2 -0
- package/src/components/shell/sidebar/index.ts +35 -0
- package/src/components/shell/sidebar/sidebar-group.tsx +254 -0
- package/src/components/shell/sidebar/sidebar-item.tsx +88 -0
- package/src/components/shell/sidebar/sidebar-resize-handle.tsx +101 -0
- package/src/components/shell/sidebar/sidebar-tree.tsx +325 -0
- package/src/components/shell/sidebar/sidebar.meta.yaml +126 -0
- package/src/components/shell/sidebar/sidebar.tsx +142 -0
- package/src/components/template/address-book-template/address-book-template.meta.yaml +22 -0
- package/src/components/template/address-book-template/address-book-template.tsx +201 -0
- package/src/components/template/address-book-template/index.ts +2 -0
- package/src/components/template/mail-template/index.ts +2 -0
- package/src/components/template/mail-template/mail-template.meta.yaml +22 -0
- package/src/components/template/mail-template/mail-template.tsx +731 -0
- package/src/components/template/use-narrow.ts +18 -0
- package/src/index.ts +505 -0
- package/src/kit/check-rendering.tsx +130 -0
- package/src/kit/kit.tsx +177 -0
- package/src/lib/clipboard.ts +27 -0
- package/src/lib/dates.ts +13 -0
- package/src/lib/json.ts +59 -0
- package/src/lib/keys.ts +54 -0
- package/src/lib/utils.ts +12 -0
- package/src/lib/view-scope.tsx +60 -0
- package/src/profile/profile.ts +238 -0
- package/src/theme/appearance.ts +198 -0
- package/src/theme/boot.ts +6 -0
- package/src/theme/client-appearance-react.ts +14 -0
- package/src/theme/client-appearance.ts +284 -0
- package/src/theme/generate-tokens.ts +658 -0
- package/src/theme/pack-themes-react.ts +107 -0
- package/src/theme/palette.ts +301 -0
- package/src/theme/semantic-mapping.ts +165 -0
- package/src/theme/set-theme.ts +162 -0
- package/src/theme/theme-colours.ts +60 -0
- package/src/theme/theme-css.ts +15 -0
- package/src/theme/themes.ts +133 -0
- package/src/theme/wallpaper-sheet.ts +58 -0
- package/src/theme/wallpaper-theme-react.ts +60 -0
- package/src/theme/wallpaper-theme.ts +231 -0
|
@@ -0,0 +1,471 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import {
|
|
3
|
+
DndContext,
|
|
4
|
+
DragOverlay,
|
|
5
|
+
closestCorners,
|
|
6
|
+
closestCenter,
|
|
7
|
+
KeyboardSensor,
|
|
8
|
+
PointerSensor,
|
|
9
|
+
TouchSensor,
|
|
10
|
+
useSensor,
|
|
11
|
+
useSensors,
|
|
12
|
+
type DragStartEvent,
|
|
13
|
+
type DragEndEvent,
|
|
14
|
+
type DragMoveEvent,
|
|
15
|
+
type Announcements,
|
|
16
|
+
type UniqueIdentifier,
|
|
17
|
+
useDroppable,
|
|
18
|
+
} from "@dnd-kit/core";
|
|
19
|
+
import {
|
|
20
|
+
SortableContext,
|
|
21
|
+
sortableKeyboardCoordinates,
|
|
22
|
+
useSortable,
|
|
23
|
+
verticalListSortingStrategy,
|
|
24
|
+
horizontalListSortingStrategy,
|
|
25
|
+
arrayMove,
|
|
26
|
+
hasSortableData,
|
|
27
|
+
} from "@dnd-kit/sortable";
|
|
28
|
+
import { CSS } from "@dnd-kit/utilities";
|
|
29
|
+
|
|
30
|
+
import { cn } from "../../../lib/utils";
|
|
31
|
+
|
|
32
|
+
// --- Types ---
|
|
33
|
+
|
|
34
|
+
interface MoveEvent {
|
|
35
|
+
itemId: string;
|
|
36
|
+
fromContainerId: string;
|
|
37
|
+
toContainerId: string;
|
|
38
|
+
fromIndex: number;
|
|
39
|
+
toIndex: number;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// --- Shared sensors ---
|
|
43
|
+
|
|
44
|
+
function useDefaultSensors() {
|
|
45
|
+
return useSensors(
|
|
46
|
+
useSensor(PointerSensor, {
|
|
47
|
+
activationConstraint: { distance: 5 },
|
|
48
|
+
}),
|
|
49
|
+
useSensor(TouchSensor, {
|
|
50
|
+
activationConstraint: { delay: 250, tolerance: 5 },
|
|
51
|
+
}),
|
|
52
|
+
useSensor(KeyboardSensor, {
|
|
53
|
+
coordinateGetter: sortableKeyboardCoordinates,
|
|
54
|
+
}),
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// --- Drag state context (for drop zone highlighting) ---
|
|
59
|
+
|
|
60
|
+
interface SortableDragState {
|
|
61
|
+
/** ID of the item currently being dragged, or null */
|
|
62
|
+
activeId: string | null;
|
|
63
|
+
/** ID of the container currently being hovered over, or null */
|
|
64
|
+
overContainerId: string | null;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const SortableDragStateContext = React.createContext<SortableDragState>({
|
|
68
|
+
activeId: null,
|
|
69
|
+
overContainerId: null,
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
function useSortableDragState(): SortableDragState {
|
|
73
|
+
return React.useContext(SortableDragStateContext);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// --- DragHandle context ---
|
|
77
|
+
|
|
78
|
+
interface DragHandleContextValue {
|
|
79
|
+
listeners: Record<string, any> | undefined;
|
|
80
|
+
attributes: Record<string, any> | undefined;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const DragHandleContext = React.createContext<DragHandleContextValue>({
|
|
84
|
+
listeners: undefined,
|
|
85
|
+
attributes: undefined,
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
// --- SortableBoard ---
|
|
89
|
+
|
|
90
|
+
interface SortableBoardProps {
|
|
91
|
+
onMove?: (event: MoveEvent) => void;
|
|
92
|
+
children: React.ReactNode;
|
|
93
|
+
/** Render function for the drag overlay content. Receives the active item id. */
|
|
94
|
+
renderOverlay?: (activeId: string) => React.ReactNode;
|
|
95
|
+
className?: string;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// The settle animation (`bridge-ui-swing-settle`, a damped pendulum from --swing-from) is in the kit stylesheet
|
|
99
|
+
// (theme/generate-tokens.ts): the page's CSP refuses an injected <style>.
|
|
100
|
+
|
|
101
|
+
const DROP_ANIMATION = {
|
|
102
|
+
duration: 300,
|
|
103
|
+
easing: "cubic-bezier(0.25, 1, 0.5, 1)",
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
function SortableBoardImpl({ onMove, children, renderOverlay, className }: SortableBoardProps) {
|
|
107
|
+
const [activeId, setActiveId] = React.useState<string | null>(null);
|
|
108
|
+
const [overContainerId, setOverContainerId] = React.useState<string | null>(null);
|
|
109
|
+
const [rotation, setRotation] = React.useState(0);
|
|
110
|
+
const [settleFrom, setSettleFrom] = React.useState<number | null>(null);
|
|
111
|
+
const lastDeltaRef = React.useRef(0);
|
|
112
|
+
const settleTimerRef = React.useRef<ReturnType<typeof setTimeout>>(undefined);
|
|
113
|
+
const sensors = useDefaultSensors();
|
|
114
|
+
|
|
115
|
+
React.useEffect(() => () => clearTimeout(settleTimerRef.current), []);
|
|
116
|
+
|
|
117
|
+
function handleDragStart(event: DragStartEvent) {
|
|
118
|
+
setActiveId(String(event.active.id));
|
|
119
|
+
setOverContainerId(null);
|
|
120
|
+
setRotation(0);
|
|
121
|
+
setSettleFrom(null);
|
|
122
|
+
lastDeltaRef.current = 0;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Keep the latest rotation in a ref so the settle timer can read it
|
|
126
|
+
const latestRotationRef = React.useRef(0);
|
|
127
|
+
React.useEffect(() => {
|
|
128
|
+
latestRotationRef.current = rotation;
|
|
129
|
+
}, [rotation]);
|
|
130
|
+
|
|
131
|
+
const scheduleSettle = React.useCallback(() => {
|
|
132
|
+
clearTimeout(settleTimerRef.current);
|
|
133
|
+
settleTimerRef.current = setTimeout(() => {
|
|
134
|
+
const from = latestRotationRef.current;
|
|
135
|
+
if (Math.abs(from) > 0.5) {
|
|
136
|
+
setSettleFrom(from);
|
|
137
|
+
}
|
|
138
|
+
setRotation(0);
|
|
139
|
+
}, 80);
|
|
140
|
+
}, []);
|
|
141
|
+
|
|
142
|
+
function handleDragMove(event: DragMoveEvent) {
|
|
143
|
+
const dx = event.delta.x - lastDeltaRef.current;
|
|
144
|
+
lastDeltaRef.current = event.delta.x;
|
|
145
|
+
|
|
146
|
+
// Swing physics — deadzone + heavy smoothing for a gentle, fluid tilt
|
|
147
|
+
setSettleFrom(null);
|
|
148
|
+
const dampedDx = Math.abs(dx) < 2 ? 0 : dx;
|
|
149
|
+
const raw = Math.max(-6, Math.min(6, dampedDx * 0.8));
|
|
150
|
+
// Smoothing: 50% previous + 50% new → responsive but no jitter
|
|
151
|
+
const smoothed = latestRotationRef.current * 0.5 + raw * 0.5;
|
|
152
|
+
setRotation(smoothed);
|
|
153
|
+
scheduleSettle();
|
|
154
|
+
|
|
155
|
+
// Track which container we're over
|
|
156
|
+
const over = event.over;
|
|
157
|
+
const overSortable = hasSortableData(over) ? over.data.current.sortable : undefined;
|
|
158
|
+
const overContainerId = overSortable?.containerId;
|
|
159
|
+
setOverContainerId(overContainerId ? String(overContainerId) : over ? String(over.id) : null);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function handleDragEnd(event: DragEndEvent) {
|
|
163
|
+
const { active, over } = event;
|
|
164
|
+
setActiveId(null);
|
|
165
|
+
setOverContainerId(null);
|
|
166
|
+
setRotation(0);
|
|
167
|
+
setSettleFrom(null);
|
|
168
|
+
lastDeltaRef.current = 0;
|
|
169
|
+
clearTimeout(settleTimerRef.current);
|
|
170
|
+
|
|
171
|
+
if (!over || !onMove || active.id === over.id) return;
|
|
172
|
+
|
|
173
|
+
const activeSortable = hasSortableData(active) ? active.data.current.sortable : undefined;
|
|
174
|
+
const overSortable = hasSortableData(over) ? over.data.current.sortable : undefined;
|
|
175
|
+
|
|
176
|
+
const activeContainer = activeSortable?.containerId;
|
|
177
|
+
const overContainer = overSortable?.containerId ?? String(over.id);
|
|
178
|
+
|
|
179
|
+
if (!activeContainer || !overContainer) return;
|
|
180
|
+
|
|
181
|
+
const fromIndex = activeSortable?.index ?? 0;
|
|
182
|
+
// toIndex is null when dropping on an empty container — default to 0
|
|
183
|
+
const toIndex = overSortable?.index ?? 0;
|
|
184
|
+
|
|
185
|
+
onMove({
|
|
186
|
+
itemId: String(active.id),
|
|
187
|
+
fromContainerId: String(activeContainer),
|
|
188
|
+
toContainerId: String(overContainer),
|
|
189
|
+
fromIndex,
|
|
190
|
+
toIndex,
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function handleDragCancel() {
|
|
195
|
+
setActiveId(null);
|
|
196
|
+
setOverContainerId(null);
|
|
197
|
+
setRotation(0);
|
|
198
|
+
setSettleFrom(null);
|
|
199
|
+
lastDeltaRef.current = 0;
|
|
200
|
+
clearTimeout(settleTimerRef.current);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// When settling: CSS keyframe animation. When moving: inline transform.
|
|
204
|
+
const isSettling = settleFrom !== null;
|
|
205
|
+
const overlayStyle: React.CSSProperties = isSettling
|
|
206
|
+
? ({
|
|
207
|
+
"--swing-from": `${settleFrom}deg`,
|
|
208
|
+
animation: `bridge-ui-swing-settle 900ms ease-out forwards`,
|
|
209
|
+
animationIterationCount: "1",
|
|
210
|
+
} as React.CSSProperties)
|
|
211
|
+
: {
|
|
212
|
+
transform: `rotate(${rotation}deg)`,
|
|
213
|
+
transition: "transform 80ms ease-out",
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
const dragState: SortableDragState = { activeId, overContainerId };
|
|
217
|
+
|
|
218
|
+
return (
|
|
219
|
+
<SortableDragStateContext.Provider value={dragState}>
|
|
220
|
+
<DndContext
|
|
221
|
+
sensors={sensors}
|
|
222
|
+
collisionDetection={closestCorners}
|
|
223
|
+
onDragStart={handleDragStart}
|
|
224
|
+
onDragMove={handleDragMove}
|
|
225
|
+
onDragEnd={handleDragEnd}
|
|
226
|
+
onDragCancel={handleDragCancel}
|
|
227
|
+
>
|
|
228
|
+
<div data-slot="sortable-board" className={className}>
|
|
229
|
+
{children}
|
|
230
|
+
</div>
|
|
231
|
+
<DragOverlay dropAnimation={DROP_ANIMATION}>
|
|
232
|
+
{activeId && renderOverlay ? (
|
|
233
|
+
<div className="shadow-md opacity-90 cursor-grabbing" style={overlayStyle}>
|
|
234
|
+
{renderOverlay(activeId)}
|
|
235
|
+
</div>
|
|
236
|
+
) : null}
|
|
237
|
+
</DragOverlay>
|
|
238
|
+
</DndContext>
|
|
239
|
+
</SortableDragStateContext.Provider>
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// --- SortableList ---
|
|
244
|
+
|
|
245
|
+
interface SortableListProps {
|
|
246
|
+
id: string;
|
|
247
|
+
items: string[];
|
|
248
|
+
onReorder?: (items: string[]) => void;
|
|
249
|
+
/** An item's name in screen reader announcements (standalone list); the id when absent. */
|
|
250
|
+
itemLabel?: (id: string) => string;
|
|
251
|
+
orientation?: "vertical" | "horizontal";
|
|
252
|
+
children: React.ReactNode;
|
|
253
|
+
className?: string;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function SortableList({
|
|
257
|
+
id,
|
|
258
|
+
items,
|
|
259
|
+
onReorder,
|
|
260
|
+
itemLabel,
|
|
261
|
+
orientation = "vertical",
|
|
262
|
+
children,
|
|
263
|
+
className,
|
|
264
|
+
}: SortableListProps) {
|
|
265
|
+
const strategy =
|
|
266
|
+
orientation === "horizontal" ? horizontalListSortingStrategy : verticalListSortingStrategy;
|
|
267
|
+
|
|
268
|
+
// Standalone mode: wrap in DndContext if not inside a SortableBoard
|
|
269
|
+
const isStandalone = !React.useContext(SortableListInBoardContext);
|
|
270
|
+
|
|
271
|
+
// Make the list a droppable target so empty lists can receive drops
|
|
272
|
+
const { setNodeRef } = useDroppable({ id });
|
|
273
|
+
|
|
274
|
+
const content = (
|
|
275
|
+
<SortableContext id={id} items={items} strategy={strategy}>
|
|
276
|
+
<div ref={setNodeRef} data-slot="sortable-list" className={cn(className, "min-h-[40px]")}>
|
|
277
|
+
{children}
|
|
278
|
+
</div>
|
|
279
|
+
</SortableContext>
|
|
280
|
+
);
|
|
281
|
+
|
|
282
|
+
if (isStandalone) {
|
|
283
|
+
return (
|
|
284
|
+
<StandaloneSortableList items={items} onReorder={onReorder} itemLabel={itemLabel}>
|
|
285
|
+
{content}
|
|
286
|
+
</StandaloneSortableList>
|
|
287
|
+
);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
return content;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// Context to detect if SortableList is inside a SortableBoard
|
|
294
|
+
const SortableListInBoardContext = React.createContext(false);
|
|
295
|
+
|
|
296
|
+
// Public SortableBoard: SortableBoardImpl wrapped so nested SortableLists
|
|
297
|
+
// know they live inside a board (and skip their standalone DndContext).
|
|
298
|
+
function SortableBoard(props: SortableBoardProps) {
|
|
299
|
+
return (
|
|
300
|
+
<SortableListInBoardContext.Provider value={true}>
|
|
301
|
+
<SortableBoardImpl {...props} />
|
|
302
|
+
</SortableListInBoardContext.Provider>
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
interface StandaloneSortableListProps {
|
|
307
|
+
items: string[];
|
|
308
|
+
onReorder?: ((items: string[]) => void) | undefined;
|
|
309
|
+
itemLabel?: ((id: string) => string) | undefined;
|
|
310
|
+
children: React.ReactNode;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/** dnd-kit's announcements, naming an item by `label` (not its id) and its place by its position in `items`. */
|
|
314
|
+
function namedAnnouncements(items: string[], label: (id: string) => string): Announcements {
|
|
315
|
+
const name = (id: UniqueIdentifier) => label(String(id));
|
|
316
|
+
const place = (id: UniqueIdentifier) =>
|
|
317
|
+
`position ${items.indexOf(String(id)) + 1} of ${items.length}`;
|
|
318
|
+
return {
|
|
319
|
+
onDragStart: ({ active }) => `Picked up ${name(active.id)}, at ${place(active.id)}.`,
|
|
320
|
+
onDragOver: ({ active, over }) =>
|
|
321
|
+
over ? `${name(active.id)} moved to ${place(over.id)}.` : undefined,
|
|
322
|
+
onDragEnd: ({ active, over }) =>
|
|
323
|
+
over ? `${name(active.id)} dropped at ${place(over.id)}.` : `${name(active.id)} dropped.`,
|
|
324
|
+
onDragCancel: ({ active }) => `Moving ${name(active.id)} was cancelled.`,
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
function StandaloneSortableList({
|
|
329
|
+
items,
|
|
330
|
+
onReorder,
|
|
331
|
+
itemLabel,
|
|
332
|
+
children,
|
|
333
|
+
}: StandaloneSortableListProps) {
|
|
334
|
+
const sensors = useDefaultSensors();
|
|
335
|
+
const announcements = React.useMemo(
|
|
336
|
+
() => (itemLabel ? namedAnnouncements(items, itemLabel) : undefined),
|
|
337
|
+
[items, itemLabel],
|
|
338
|
+
);
|
|
339
|
+
|
|
340
|
+
function handleDragEnd(event: DragEndEvent) {
|
|
341
|
+
const { active, over } = event;
|
|
342
|
+
if (!over || active.id === over.id || !onReorder) return;
|
|
343
|
+
|
|
344
|
+
const oldIndex = items.indexOf(String(active.id));
|
|
345
|
+
const newIndex = items.indexOf(String(over.id));
|
|
346
|
+
if (oldIndex !== -1 && newIndex !== -1) {
|
|
347
|
+
onReorder(arrayMove(items, oldIndex, newIndex));
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
return (
|
|
352
|
+
<DndContext
|
|
353
|
+
sensors={sensors}
|
|
354
|
+
collisionDetection={closestCenter}
|
|
355
|
+
onDragEnd={handleDragEnd}
|
|
356
|
+
{...(announcements ? { accessibility: { announcements } } : {})}
|
|
357
|
+
>
|
|
358
|
+
{children}
|
|
359
|
+
</DndContext>
|
|
360
|
+
);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
// --- SortableItem ---
|
|
364
|
+
|
|
365
|
+
interface SortableItemProps {
|
|
366
|
+
id: string;
|
|
367
|
+
disabled?: boolean;
|
|
368
|
+
/**
|
|
369
|
+
* When true, the entire item is the drag activator. When false (default), only a DragHandle child activates drag.
|
|
370
|
+
* `"pointer"`: the entire item drags with the pointer only, adding no role, tab stop or key handling, for an item that
|
|
371
|
+
* is itself a control (a list option): offer another way to reorder from the keyboard.
|
|
372
|
+
*/
|
|
373
|
+
dragFullItem?: boolean | "pointer";
|
|
374
|
+
children: React.ReactNode;
|
|
375
|
+
className?: string;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
function SortableItem({
|
|
379
|
+
id,
|
|
380
|
+
disabled = false,
|
|
381
|
+
dragFullItem = false,
|
|
382
|
+
children,
|
|
383
|
+
className,
|
|
384
|
+
}: SortableItemProps) {
|
|
385
|
+
const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({
|
|
386
|
+
id,
|
|
387
|
+
disabled,
|
|
388
|
+
});
|
|
389
|
+
|
|
390
|
+
const style: React.CSSProperties = {
|
|
391
|
+
transform: CSS.Transform.toString(transform),
|
|
392
|
+
transition,
|
|
393
|
+
};
|
|
394
|
+
const pointerOnly = dragFullItem === "pointer";
|
|
395
|
+
const wrapperProps: React.HTMLAttributes<HTMLDivElement> = !dragFullItem
|
|
396
|
+
? {}
|
|
397
|
+
: pointerOnly
|
|
398
|
+
? ({
|
|
399
|
+
onPointerDown: listeners?.onPointerDown,
|
|
400
|
+
onTouchStart: listeners?.onTouchStart,
|
|
401
|
+
} as React.HTMLAttributes<HTMLDivElement>)
|
|
402
|
+
: { ...attributes, ...listeners };
|
|
403
|
+
|
|
404
|
+
return (
|
|
405
|
+
<DragHandleContext.Provider
|
|
406
|
+
value={
|
|
407
|
+
dragFullItem ? { listeners: undefined, attributes: undefined } : { listeners, attributes }
|
|
408
|
+
}
|
|
409
|
+
>
|
|
410
|
+
<div
|
|
411
|
+
ref={setNodeRef}
|
|
412
|
+
data-slot="sortable-item"
|
|
413
|
+
data-dragging={isDragging || undefined}
|
|
414
|
+
style={style}
|
|
415
|
+
className={cn(
|
|
416
|
+
isDragging && "opacity-40",
|
|
417
|
+
dragFullItem && !isDragging && "cursor-grab",
|
|
418
|
+
dragFullItem && isDragging && "cursor-grabbing",
|
|
419
|
+
className,
|
|
420
|
+
)}
|
|
421
|
+
{...wrapperProps}
|
|
422
|
+
>
|
|
423
|
+
{children}
|
|
424
|
+
</div>
|
|
425
|
+
</DragHandleContext.Provider>
|
|
426
|
+
);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
// --- DragHandle ---
|
|
430
|
+
|
|
431
|
+
interface DragHandleProps extends React.ComponentProps<"button"> {}
|
|
432
|
+
|
|
433
|
+
function DragHandle({ className, ...props }: DragHandleProps) {
|
|
434
|
+
const { listeners, attributes } = React.useContext(DragHandleContext);
|
|
435
|
+
|
|
436
|
+
return (
|
|
437
|
+
<button
|
|
438
|
+
data-slot="drag-handle"
|
|
439
|
+
className={cn(
|
|
440
|
+
"inline-flex items-center justify-center size-5 cursor-grab active:cursor-grabbing text-muted hover:text-secondary transition-colors duration-75 touch-none shrink-0",
|
|
441
|
+
className,
|
|
442
|
+
)}
|
|
443
|
+
aria-label="Drag handle"
|
|
444
|
+
{...props}
|
|
445
|
+
{...attributes}
|
|
446
|
+
{...(listeners as React.DOMAttributes<HTMLButtonElement> | undefined)}
|
|
447
|
+
type="button"
|
|
448
|
+
>
|
|
449
|
+
<svg width="10" height="14" viewBox="0 0 10 14" fill="currentColor" aria-hidden="true">
|
|
450
|
+
<circle cx="2.5" cy="2" r="1.2" />
|
|
451
|
+
<circle cx="7.5" cy="2" r="1.2" />
|
|
452
|
+
<circle cx="2.5" cy="7" r="1.2" />
|
|
453
|
+
<circle cx="7.5" cy="7" r="1.2" />
|
|
454
|
+
<circle cx="2.5" cy="12" r="1.2" />
|
|
455
|
+
<circle cx="7.5" cy="12" r="1.2" />
|
|
456
|
+
</svg>
|
|
457
|
+
</button>
|
|
458
|
+
);
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
// --- Exports ---
|
|
462
|
+
|
|
463
|
+
export { SortableBoard, SortableList, SortableItem, DragHandle, useSortableDragState, arrayMove };
|
|
464
|
+
export type {
|
|
465
|
+
SortableBoardProps,
|
|
466
|
+
SortableListProps,
|
|
467
|
+
SortableItemProps,
|
|
468
|
+
DragHandleProps,
|
|
469
|
+
SortableDragState,
|
|
470
|
+
MoveEvent,
|
|
471
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
name: SplitView
|
|
2
|
+
description: "shadcn's Resizable under Bridge's names: SplitView the group, SplitPane a panel, SplitHandle the handle placed between two panes, over react-resizable-panels (the kit's Resizable). One addition: resizable={false} renders the same panes at fixed sizes, each SplitHandle a plain divider. Nestable for a grid."
|
|
3
|
+
layer: core
|
|
4
|
+
category: layout
|
|
5
|
+
when_to_use:
|
|
6
|
+
- "For any split of a view into columns or rows: an editor beside its preview, a console under a canvas, a sidebar of tools"
|
|
7
|
+
- "For a grid of panes: a vertical SplitView inside a pane of a horizontal one"
|
|
8
|
+
- "For a fixed split with dividers (resizable={false}): the same markup, nothing to drag"
|
|
9
|
+
when_not_to_use:
|
|
10
|
+
- "For a list beside its record (a plugin's list-and-record screen) — use MultiPane: when room runs out its panes leave from the right"
|
|
11
|
+
composition_partners:
|
|
12
|
+
- SplitPane, SplitHandle (its parts)
|
|
13
|
+
- Pane, ScrollArea (a pane's content)
|
|
14
|
+
- MultiPane (a pane may hold one)
|
|
15
|
+
props:
|
|
16
|
+
- name: orientation
|
|
17
|
+
type: "'horizontal' | 'vertical'"
|
|
18
|
+
required: false
|
|
19
|
+
default: "'horizontal'"
|
|
20
|
+
description: "SplitView: horizontal, the panes side by side; vertical, one above the other (shadcn's orientation)"
|
|
21
|
+
- name: resizable
|
|
22
|
+
type: boolean
|
|
23
|
+
required: false
|
|
24
|
+
default: "true"
|
|
25
|
+
description: "SplitView: the handles drag; off, each sized pane keeps its defaultSize as its flex basis, the others share the rest, and each SplitHandle is a plain divider"
|
|
26
|
+
- name: storageKey
|
|
27
|
+
type: string
|
|
28
|
+
required: false
|
|
29
|
+
description: "SplitView: `<plugin>/<screen>/<split>@v<n>` (e.g. 'sessions/browser/list@v1'): the sizes a user dragged, kept per workspace in their profile and brought back there; a double-click on a handle forgets them. Omit for no memory"
|
|
30
|
+
- name: id
|
|
31
|
+
type: string
|
|
32
|
+
required: false
|
|
33
|
+
description: "SplitPane: its panel's id (the key of its size in a remembered layout); not put on the pane's inner div"
|
|
34
|
+
- name: defaultSize
|
|
35
|
+
type: string
|
|
36
|
+
required: false
|
|
37
|
+
description: "SplitPane: its size at first ('25%', '240px'); none, a share of what the sized panes leave"
|
|
38
|
+
- name: minSize
|
|
39
|
+
type: string
|
|
40
|
+
required: false
|
|
41
|
+
description: "SplitPane: its least size, the same units"
|
|
42
|
+
- name: maxSize
|
|
43
|
+
type: string
|
|
44
|
+
required: false
|
|
45
|
+
description: "SplitPane: its greatest size, the same units"
|
|
46
|
+
- name: withHandle
|
|
47
|
+
type: boolean
|
|
48
|
+
required: false
|
|
49
|
+
default: "false"
|
|
50
|
+
description: "SplitHandle: a visible grip (shadcn's withHandle); none on a fixed view's divider"
|
|
51
|
+
props_priority:
|
|
52
|
+
- orientation
|
|
53
|
+
- resizable
|
|
54
|
+
- storageKey
|
|
55
|
+
- defaultSize
|
|
56
|
+
- minSize
|
|
57
|
+
- withHandle
|
|
58
|
+
examples:
|
|
59
|
+
- title: "A sidebar of tools beside the canvas"
|
|
60
|
+
code: |
|
|
61
|
+
<SplitView orientation="horizontal">
|
|
62
|
+
<SplitPane defaultSize="25%" minSize="200px">…</SplitPane>
|
|
63
|
+
<SplitHandle withHandle />
|
|
64
|
+
<SplitPane>…</SplitPane>
|
|
65
|
+
</SplitView>
|
|
66
|
+
- title: "A grid: an editor over its console, beside a preview, fixed"
|
|
67
|
+
code: |
|
|
68
|
+
<SplitView resizable={false}>
|
|
69
|
+
<SplitPane defaultSize="50%">
|
|
70
|
+
<SplitView orientation="vertical" resizable={false}>
|
|
71
|
+
<SplitPane>…</SplitPane>
|
|
72
|
+
<SplitHandle />
|
|
73
|
+
<SplitPane defaultSize="160px">…</SplitPane>
|
|
74
|
+
</SplitView>
|
|
75
|
+
</SplitPane>
|
|
76
|
+
<SplitHandle />
|
|
77
|
+
<SplitPane>…</SplitPane>
|
|
78
|
+
</SplitView>
|
|
79
|
+
anti_patterns:
|
|
80
|
+
- "Don't expect handles to appear by themselves: place a SplitHandle between two panes, as in shadcn"
|
|
81
|
+
- "Don't rebuild a list beside its record with it — MultiPane keeps the list alone when narrow"
|
|
82
|
+
accessibility_notes: "Resizable: each SplitHandle is a focusable separator (arrow keys resize, react-resizable-panels), aria-orientation horizontal in a vertical view. Fixed: a divider with role separator, not focusable."
|
|
83
|
+
notes: "Sub-parts by data-slot: split-view (data-orientation), split-pane, resizable-panel and resizable-handle when resizable, split-divider when not. SplitPane and SplitHandle read their view's orientation and resizable from it (a nested view sets its own). Each pane clips its overflow and lets its content shrink: a pane scrolls through a ScrollArea of its own."
|
|
84
|
+
related_patterns:
|
|
85
|
+
- multi-pane
|