@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,18 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
import { multiPaneNarrowWidth } from "../layout/multi-pane";
|
|
4
|
+
|
|
5
|
+
/** A template's box narrower than MultiPane's narrow width: one pane at a time, as on a phone. */
|
|
6
|
+
export function useNarrow(ref: React.RefObject<HTMLDivElement | null>) {
|
|
7
|
+
const [narrow, setNarrow] = React.useState(false);
|
|
8
|
+
React.useLayoutEffect(() => {
|
|
9
|
+
const element = ref.current;
|
|
10
|
+
if (!element || typeof ResizeObserver === "undefined") return;
|
|
11
|
+
const measure = (width: number) => setNarrow(width > 0 && width < multiPaneNarrowWidth);
|
|
12
|
+
measure(element.getBoundingClientRect().width);
|
|
13
|
+
const observer = new ResizeObserver(([entry]) => entry && measure(entry.contentRect.width));
|
|
14
|
+
observer.observe(element);
|
|
15
|
+
return () => observer.disconnect();
|
|
16
|
+
}, [ref]);
|
|
17
|
+
return narrow;
|
|
18
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
// @bridge/ui: the kit's browser entry, one shared module in the page (AD-10). Themes are static CSS generated by the
|
|
2
|
+
// host (theme/generate-tokens.ts), selected by <html data-theme>; the wallpaper's alone is drawn in the page.
|
|
3
|
+
export { cn } from "./lib/utils";
|
|
4
|
+
export { copyText } from "./lib/clipboard";
|
|
5
|
+
export { formatDate, formatNumber, userLocale } from "./lib/dates";
|
|
6
|
+
export { isComposing, modalOpen } from "./lib/keys";
|
|
7
|
+
export {
|
|
8
|
+
BRIDGE_THEMES,
|
|
9
|
+
DEFAULT_THEME,
|
|
10
|
+
PACK_THEMES_EVENT,
|
|
11
|
+
THEMES,
|
|
12
|
+
THEME_STORAGE_KEY,
|
|
13
|
+
allThemes,
|
|
14
|
+
modeOfTheme,
|
|
15
|
+
resolveTheme,
|
|
16
|
+
setPackThemes,
|
|
17
|
+
themeOfMode,
|
|
18
|
+
} from "./theme/themes";
|
|
19
|
+
export {
|
|
20
|
+
applyTheme,
|
|
21
|
+
getColourMode,
|
|
22
|
+
getModeChoice,
|
|
23
|
+
getTheme,
|
|
24
|
+
hasOwnTheme,
|
|
25
|
+
refreshTheme,
|
|
26
|
+
setMode,
|
|
27
|
+
setTheme,
|
|
28
|
+
themeSources,
|
|
29
|
+
useColourMode,
|
|
30
|
+
useThemeOfMode,
|
|
31
|
+
} from "./theme/set-theme";
|
|
32
|
+
export {
|
|
33
|
+
followBridgeAppearance,
|
|
34
|
+
getBridgeAppearance,
|
|
35
|
+
hasOwnAppearance,
|
|
36
|
+
setBridgeAppearance,
|
|
37
|
+
setWorkspaceAppearance,
|
|
38
|
+
useOwnAppearance,
|
|
39
|
+
} from "./theme/appearance";
|
|
40
|
+
export type { Appearance, WorkspaceAppearance } from "./theme/appearance";
|
|
41
|
+
export {
|
|
42
|
+
CLIENT_APPEARANCE_KEY,
|
|
43
|
+
addMineImage,
|
|
44
|
+
everywhereOf,
|
|
45
|
+
getClientAppearance,
|
|
46
|
+
mineImageOf,
|
|
47
|
+
mineOf,
|
|
48
|
+
setMine,
|
|
49
|
+
setMineFields,
|
|
50
|
+
setEverywhere,
|
|
51
|
+
setPreference,
|
|
52
|
+
subscribeClientAppearance,
|
|
53
|
+
useClientAppearance,
|
|
54
|
+
} from "./theme/client-appearance-react";
|
|
55
|
+
export type {
|
|
56
|
+
ClientAppearance,
|
|
57
|
+
ClientAppearanceChange,
|
|
58
|
+
ClientAppearanceStore,
|
|
59
|
+
Fields as MineFields,
|
|
60
|
+
} from "./theme/client-appearance";
|
|
61
|
+
export type { Mode, ThemeInfo, ThemePair } from "./theme/themes";
|
|
62
|
+
export { PROFILE_KEY, createProfile, currentWorkspace, profile } from "./profile/profile";
|
|
63
|
+
export type { Profile, Where, WorkspaceRef } from "./profile/profile";
|
|
64
|
+
export { useWallpaperTheme } from "./theme/wallpaper-theme-react";
|
|
65
|
+
export {
|
|
66
|
+
PackThemesProvider,
|
|
67
|
+
useHostThemes,
|
|
68
|
+
usePackThemes,
|
|
69
|
+
useThemes,
|
|
70
|
+
} from "./theme/pack-themes-react";
|
|
71
|
+
export type { PackThemeRoutes } from "./theme/pack-themes-react";
|
|
72
|
+
export {
|
|
73
|
+
DEFAULT_KIT,
|
|
74
|
+
KIT_CONTRACT,
|
|
75
|
+
KIT_STORAGE_KEY,
|
|
76
|
+
KitPart,
|
|
77
|
+
applyKit,
|
|
78
|
+
getKit,
|
|
79
|
+
getRenderings,
|
|
80
|
+
registerRendering,
|
|
81
|
+
setKit,
|
|
82
|
+
subscribeRenderings,
|
|
83
|
+
useCapability,
|
|
84
|
+
useKit,
|
|
85
|
+
useKitRoot,
|
|
86
|
+
useRendering,
|
|
87
|
+
useRenderings,
|
|
88
|
+
} from "./kit/kit";
|
|
89
|
+
export type { KitCapability, KitParts, KitRoots, Rendering } from "./kit/kit";
|
|
90
|
+
export { Button, buttonVariants } from "./components/core/button";
|
|
91
|
+
export type { ButtonProps } from "./components/core/button";
|
|
92
|
+
export { Input, inputVariants, noAutofill } from "./components/core/input";
|
|
93
|
+
export type { InputProps } from "./components/core/input";
|
|
94
|
+
export { Textarea } from "./components/core/input";
|
|
95
|
+
export type { TextareaProps } from "./components/core/input";
|
|
96
|
+
export { PromptField } from "./components/composite/prompt-field";
|
|
97
|
+
export type { PromptFieldProps } from "./components/composite/prompt-field";
|
|
98
|
+
export { EditableField, InlineFields } from "./components/core/editable-field";
|
|
99
|
+
export type { EditableFieldProps, EditableFieldState } from "./components/core/editable-field";
|
|
100
|
+
export {
|
|
101
|
+
Field,
|
|
102
|
+
FieldLabel,
|
|
103
|
+
FieldDescription,
|
|
104
|
+
FieldError,
|
|
105
|
+
FieldRow,
|
|
106
|
+
useFieldControl,
|
|
107
|
+
} from "./components/core/field";
|
|
108
|
+
export type {
|
|
109
|
+
FieldProps,
|
|
110
|
+
FieldLabelProps,
|
|
111
|
+
FieldDescriptionProps,
|
|
112
|
+
FieldErrorProps,
|
|
113
|
+
} from "./components/core/field";
|
|
114
|
+
export {
|
|
115
|
+
Select,
|
|
116
|
+
SelectTrigger,
|
|
117
|
+
SelectValue,
|
|
118
|
+
SelectContent,
|
|
119
|
+
SelectItem,
|
|
120
|
+
SelectGroup,
|
|
121
|
+
SelectLabel,
|
|
122
|
+
SelectSeparator,
|
|
123
|
+
} from "./components/core/select";
|
|
124
|
+
export type {
|
|
125
|
+
SelectProps,
|
|
126
|
+
SelectTriggerProps,
|
|
127
|
+
SelectValueProps,
|
|
128
|
+
SelectContentProps,
|
|
129
|
+
SelectItemProps,
|
|
130
|
+
SelectGroupProps,
|
|
131
|
+
SelectLabelProps,
|
|
132
|
+
SelectSeparatorProps,
|
|
133
|
+
} from "./components/core/select";
|
|
134
|
+
export { Combobox } from "./components/core/combobox";
|
|
135
|
+
export type { ComboboxProps } from "./components/core/combobox";
|
|
136
|
+
export { Picker } from "./components/composite/picker";
|
|
137
|
+
export type { PickerProps } from "./components/composite/picker";
|
|
138
|
+
export { TagInput } from "./components/composite/tag-input";
|
|
139
|
+
export type { TagInputProps } from "./components/composite/tag-input";
|
|
140
|
+
export { DataMenuTrigger, PickMenu, PickSelect } from "./components/core/pick-menu";
|
|
141
|
+
export type {
|
|
142
|
+
DataMenuTriggerProps,
|
|
143
|
+
PickMenuProps,
|
|
144
|
+
PickOption,
|
|
145
|
+
PickSelectProps,
|
|
146
|
+
} from "./components/core/pick-menu";
|
|
147
|
+
export { TagPill, TagDot, TagList, FilterChip, tagColor } from "./components/core/tag-pill";
|
|
148
|
+
export type { TagPillProps, FilterChipProps } from "./components/core/tag-pill";
|
|
149
|
+
export { TagMenu } from "./components/core/pick-menu";
|
|
150
|
+
export type { TagMenuProps, TagCount } from "./components/core/pick-menu";
|
|
151
|
+
export { Bullets } from "./components/core/bullets";
|
|
152
|
+
export type { BulletsProps } from "./components/core/bullets";
|
|
153
|
+
export { Thumbnail } from "./components/core/thumbnail";
|
|
154
|
+
export type { ThumbnailKind, ThumbnailProps } from "./components/core/thumbnail";
|
|
155
|
+
export { DropZone } from "./components/core/drop-zone";
|
|
156
|
+
export type { DropZoneHandle, DropZoneProps } from "./components/core/drop-zone";
|
|
157
|
+
export { Progress } from "./components/core/progress";
|
|
158
|
+
export type { ProgressProps } from "./components/core/progress";
|
|
159
|
+
export { ImageField } from "./components/composite/image-field";
|
|
160
|
+
export type { ImageFieldProps, ImageFieldValue } from "./components/composite/image-field";
|
|
161
|
+
export { StatusIcon, statusIconVariants } from "./components/core/status-icon";
|
|
162
|
+
export type { StatusIconStatus, StatusIconProps } from "./components/core/status-icon";
|
|
163
|
+
export { Avatar, avatarVariants, getInitials } from "./components/core/avatar";
|
|
164
|
+
export type { AvatarProps, AvatarSize } from "./components/core/avatar";
|
|
165
|
+
export { Label, labelVariants } from "./components/core/label";
|
|
166
|
+
export type { LabelProps, LabelVariant } from "./components/core/label";
|
|
167
|
+
export { Badge, badgeVariants } from "./components/core/badge";
|
|
168
|
+
export type { BadgeProps } from "./components/core/badge";
|
|
169
|
+
export { Skeleton, ListSkeleton, DetailSkeleton } from "./components/core/skeleton";
|
|
170
|
+
export type { SkeletonProps } from "./components/core/skeleton";
|
|
171
|
+
export { Card, cardVariants, CardHeader, cardHeaderVariants } from "./components/core/card";
|
|
172
|
+
export type { CardProps, CardHeaderProps } from "./components/core/card";
|
|
173
|
+
export { Section, sectionVariants } from "./components/core/section";
|
|
174
|
+
export type { SectionProps } from "./components/core/section";
|
|
175
|
+
export { ScrollArea, ScrollAreaScrollbar } from "./components/core/scroll-area";
|
|
176
|
+
export { Pane, PaneHeader, PaneBody, PaneFooter, PaneNote } from "./components/core/pane";
|
|
177
|
+
export { MainContent } from "./components/core/main-content";
|
|
178
|
+
export type { MainContentProps } from "./components/core/main-content";
|
|
179
|
+
export { Collapsible, CollapsibleTrigger, CollapsiblePanel } from "./components/core/collapsible";
|
|
180
|
+
export { CodeBlock } from "./components/core/code-block";
|
|
181
|
+
export type { CodeBlockProps, CodeToken } from "./components/core/code-block";
|
|
182
|
+
export { Cluster } from "./components/core/cluster";
|
|
183
|
+
export {
|
|
184
|
+
MultiPane,
|
|
185
|
+
multiPaneNarrowWidth,
|
|
186
|
+
multiPaneAsideWidth,
|
|
187
|
+
ListDetail,
|
|
188
|
+
listDetailNarrowWidth,
|
|
189
|
+
} from "./components/layout/multi-pane";
|
|
190
|
+
export type { MultiPaneProps, ListDetailProps } from "./components/layout/multi-pane";
|
|
191
|
+
export { SinglePane } from "./components/layout/single-pane";
|
|
192
|
+
export type { SinglePaneProps } from "./components/layout/single-pane";
|
|
193
|
+
export {
|
|
194
|
+
AddressBookTemplate,
|
|
195
|
+
ListDetailTemplate,
|
|
196
|
+
} from "./components/template/address-book-template";
|
|
197
|
+
export type {
|
|
198
|
+
AddressBookTemplateProps,
|
|
199
|
+
ListDetailTemplateProps,
|
|
200
|
+
} from "./components/template/address-book-template";
|
|
201
|
+
export { MailTemplate } from "./components/template/mail-template";
|
|
202
|
+
export type { MailTemplateProps } from "./components/template/mail-template";
|
|
203
|
+
export { SplitView, SplitPane, SplitHandle } from "./components/core/split-view";
|
|
204
|
+
export type {
|
|
205
|
+
SplitViewProps,
|
|
206
|
+
SplitPaneProps,
|
|
207
|
+
SplitHandleProps,
|
|
208
|
+
} from "./components/core/split-view";
|
|
209
|
+
export { EmptyState } from "./components/core/empty-state";
|
|
210
|
+
export type { EmptyStateProps } from "./components/core/empty-state";
|
|
211
|
+
export { Wizard, WizardStep, useWizard } from "./components/composite/wizard";
|
|
212
|
+
export type { WizardProps, WizardStepProps } from "./components/composite/wizard";
|
|
213
|
+
export {
|
|
214
|
+
Detail,
|
|
215
|
+
DetailHeader,
|
|
216
|
+
DetailTitle,
|
|
217
|
+
DetailHint,
|
|
218
|
+
DetailSubtitle,
|
|
219
|
+
} from "./components/core/detail";
|
|
220
|
+
export { Popover, PopoverTrigger, PopoverContent } from "./components/core/popover";
|
|
221
|
+
export type {
|
|
222
|
+
PopoverProps,
|
|
223
|
+
PopoverTriggerProps,
|
|
224
|
+
PopoverContentProps,
|
|
225
|
+
} from "./components/core/popover";
|
|
226
|
+
export { Kbd } from "./components/core/kbd";
|
|
227
|
+
export type { KbdProps } from "./components/core/kbd";
|
|
228
|
+
export { DraftBar } from "./components/composite/draft-bar";
|
|
229
|
+
export type { DraftBarProps } from "./components/composite/draft-bar";
|
|
230
|
+
export type { ScrollAreaProps, ScrollAreaScrollbarProps } from "./components/core/scroll-area";
|
|
231
|
+
export {
|
|
232
|
+
SortableBoard,
|
|
233
|
+
SortableList,
|
|
234
|
+
SortableItem,
|
|
235
|
+
DragHandle,
|
|
236
|
+
useSortableDragState,
|
|
237
|
+
arrayMove,
|
|
238
|
+
} from "./components/core/sortable";
|
|
239
|
+
export type {
|
|
240
|
+
SortableBoardProps,
|
|
241
|
+
SortableListProps,
|
|
242
|
+
SortableItemProps,
|
|
243
|
+
DragHandleProps,
|
|
244
|
+
SortableDragState,
|
|
245
|
+
MoveEvent,
|
|
246
|
+
} from "./components/core/sortable";
|
|
247
|
+
export { ColourPicker, THEME_COLOURS, THEME_COLOUR_GROUPS } from "./components/core/colour-picker";
|
|
248
|
+
export type { ColourGroup, ColourPickerProps, ColourSwatch } from "./components/core/colour-picker";
|
|
249
|
+
export { Slider } from "./components/core/slider";
|
|
250
|
+
export type { SliderProps } from "./components/core/slider";
|
|
251
|
+
export { Toggle, toggleVariants } from "./components/core/toggle";
|
|
252
|
+
export type { ToggleProps } from "./components/core/toggle";
|
|
253
|
+
export { Checkbox, checkboxVariants } from "./components/core/checkbox";
|
|
254
|
+
export type { CheckboxProps } from "./components/core/checkbox";
|
|
255
|
+
export {
|
|
256
|
+
Properties,
|
|
257
|
+
propertiesVariants,
|
|
258
|
+
PropertyRow,
|
|
259
|
+
propertyRowVariants,
|
|
260
|
+
PropertyPlaceholder,
|
|
261
|
+
PropertyGrid,
|
|
262
|
+
} from "./components/composite/properties";
|
|
263
|
+
export type { PropertiesProps, PropertyRowProps } from "./components/composite/properties";
|
|
264
|
+
export { Tabs, TabsList, tabsListVariants, TabsTrigger, TabsContent } from "./components/core/tabs";
|
|
265
|
+
export type {
|
|
266
|
+
TabsProps,
|
|
267
|
+
TabsListProps,
|
|
268
|
+
TabsTriggerProps,
|
|
269
|
+
TabsContentProps,
|
|
270
|
+
} from "./components/core/tabs";
|
|
271
|
+
export {
|
|
272
|
+
Sidebar,
|
|
273
|
+
sidebarVariants,
|
|
274
|
+
SidebarContent,
|
|
275
|
+
SidebarHeader,
|
|
276
|
+
SidebarSection,
|
|
277
|
+
SidebarItem,
|
|
278
|
+
sidebarItemVariants,
|
|
279
|
+
SidebarFooter,
|
|
280
|
+
SidebarGroup,
|
|
281
|
+
SidebarGroupTrigger,
|
|
282
|
+
SidebarGroupContent,
|
|
283
|
+
SidebarTree,
|
|
284
|
+
SidebarTreeItem,
|
|
285
|
+
SidebarCollapse,
|
|
286
|
+
SidebarResizeHandle,
|
|
287
|
+
SIDEBAR_MIN_WIDTH,
|
|
288
|
+
SIDEBAR_DEFAULT_WIDTH,
|
|
289
|
+
clampSidebarWidth,
|
|
290
|
+
} from "./components/shell/sidebar";
|
|
291
|
+
export type {
|
|
292
|
+
SidebarProps,
|
|
293
|
+
SidebarContentProps,
|
|
294
|
+
SidebarHeaderProps,
|
|
295
|
+
SidebarSectionProps,
|
|
296
|
+
SidebarItemProps,
|
|
297
|
+
SidebarFooterProps,
|
|
298
|
+
SidebarGroupProps,
|
|
299
|
+
SidebarGroupTriggerProps,
|
|
300
|
+
SidebarGroupContentProps,
|
|
301
|
+
SidebarTreeProps,
|
|
302
|
+
SidebarTreeItemProps,
|
|
303
|
+
SidebarCollapseProps,
|
|
304
|
+
SidebarResizeHandleProps,
|
|
305
|
+
} from "./components/shell/sidebar";
|
|
306
|
+
export { Icon, ICON_NAMES } from "./components/core/icon";
|
|
307
|
+
export type { IconProps } from "./components/core/icon";
|
|
308
|
+
export {
|
|
309
|
+
DEFAULT_ICON_SET,
|
|
310
|
+
ICON_SET_STORAGE_KEY,
|
|
311
|
+
applyIconSet,
|
|
312
|
+
getIconSet,
|
|
313
|
+
getIconSets,
|
|
314
|
+
registerIconSet,
|
|
315
|
+
setIconSet,
|
|
316
|
+
subscribeIconSets,
|
|
317
|
+
useIconSetId,
|
|
318
|
+
useIconSets,
|
|
319
|
+
} from "./components/core/icon/icon-sets";
|
|
320
|
+
export type { IconData, IconSet } from "./components/core/icon/icon-sets";
|
|
321
|
+
export { AppShell, appShellVariants } from "./components/shell/app-shell";
|
|
322
|
+
export type { AppShellProps } from "./components/shell/app-shell";
|
|
323
|
+
export {
|
|
324
|
+
ResizablePanelGroup,
|
|
325
|
+
ResizablePanel,
|
|
326
|
+
ResizableHandle,
|
|
327
|
+
usePanelRef,
|
|
328
|
+
} from "./components/core/resizable";
|
|
329
|
+
export type {
|
|
330
|
+
PanelImperativeHandle,
|
|
331
|
+
ResizablePanelGroupProps,
|
|
332
|
+
ResizablePanelProps,
|
|
333
|
+
ResizableHandleProps,
|
|
334
|
+
} from "./components/core/resizable";
|
|
335
|
+
export { Breadcrumb, breadcrumbVariants } from "./components/core/breadcrumb";
|
|
336
|
+
export type { BreadcrumbProps, BreadcrumbItem } from "./components/core/breadcrumb";
|
|
337
|
+
export { SegmentGroup, segmentGroupVariants } from "./components/core/segment-group";
|
|
338
|
+
export type { SegmentGroupProps, SegmentGroupItem } from "./components/core/segment-group";
|
|
339
|
+
export { ToggleGroup } from "./components/core/toggle-group";
|
|
340
|
+
export type { ToggleGroupProps, ToggleGroupItem } from "./components/core/toggle-group";
|
|
341
|
+
export {
|
|
342
|
+
DropdownMenu,
|
|
343
|
+
DropdownMenuTrigger,
|
|
344
|
+
DropdownMenuContent,
|
|
345
|
+
DropdownMenuItem,
|
|
346
|
+
dropdownMenuItemVariants,
|
|
347
|
+
DropdownMenuSeparator,
|
|
348
|
+
DropdownMenuLabel,
|
|
349
|
+
DropdownMenuGroup,
|
|
350
|
+
DropdownMenuShortcut,
|
|
351
|
+
DropdownMenuSub,
|
|
352
|
+
DropdownMenuSubTrigger,
|
|
353
|
+
DropdownMenuSubContent,
|
|
354
|
+
ContextMenu,
|
|
355
|
+
ContextMenuTrigger,
|
|
356
|
+
openContextMenuFromKey,
|
|
357
|
+
} from "./components/core/dropdown-menu";
|
|
358
|
+
export type {
|
|
359
|
+
DropdownMenuProps,
|
|
360
|
+
DropdownMenuTriggerProps,
|
|
361
|
+
DropdownMenuContentProps,
|
|
362
|
+
DropdownMenuItemProps,
|
|
363
|
+
DropdownMenuSeparatorProps,
|
|
364
|
+
DropdownMenuLabelProps,
|
|
365
|
+
DropdownMenuGroupProps,
|
|
366
|
+
DropdownMenuShortcutProps,
|
|
367
|
+
DropdownMenuSubProps,
|
|
368
|
+
DropdownMenuSubTriggerProps,
|
|
369
|
+
DropdownMenuSubContentProps,
|
|
370
|
+
ContextMenuProps,
|
|
371
|
+
ContextMenuTriggerProps,
|
|
372
|
+
} from "./components/core/dropdown-menu";
|
|
373
|
+
export {
|
|
374
|
+
Dialog,
|
|
375
|
+
DialogTrigger,
|
|
376
|
+
DialogContent,
|
|
377
|
+
dialogContentVariants,
|
|
378
|
+
DialogHeader,
|
|
379
|
+
DialogBody,
|
|
380
|
+
DialogFooter,
|
|
381
|
+
DialogTitle,
|
|
382
|
+
DialogDescription,
|
|
383
|
+
DialogClose,
|
|
384
|
+
DialogMaximize,
|
|
385
|
+
} from "./components/core/dialog";
|
|
386
|
+
export type {
|
|
387
|
+
DialogProps,
|
|
388
|
+
DialogTriggerProps,
|
|
389
|
+
DialogContentProps,
|
|
390
|
+
DialogHeaderProps,
|
|
391
|
+
DialogBodyProps,
|
|
392
|
+
DialogFooterProps,
|
|
393
|
+
DialogTitleProps,
|
|
394
|
+
DialogDescriptionProps,
|
|
395
|
+
DialogCloseProps,
|
|
396
|
+
DialogMaximizeProps,
|
|
397
|
+
} from "./components/core/dialog";
|
|
398
|
+
export {
|
|
399
|
+
TooltipProvider,
|
|
400
|
+
Tooltip,
|
|
401
|
+
TooltipTrigger,
|
|
402
|
+
TooltipContent,
|
|
403
|
+
Tip,
|
|
404
|
+
} from "./components/core/tooltip";
|
|
405
|
+
export type {
|
|
406
|
+
TooltipProps,
|
|
407
|
+
TooltipProviderProps,
|
|
408
|
+
TooltipTriggerProps,
|
|
409
|
+
TooltipContentProps,
|
|
410
|
+
} from "./components/core/tooltip";
|
|
411
|
+
export {
|
|
412
|
+
ToastProvider,
|
|
413
|
+
ToastAction,
|
|
414
|
+
ToastStack,
|
|
415
|
+
toastVariants,
|
|
416
|
+
useToast,
|
|
417
|
+
} from "./components/core/toast";
|
|
418
|
+
export type {
|
|
419
|
+
ToastProviderProps,
|
|
420
|
+
ToastStackProps,
|
|
421
|
+
ToastShown,
|
|
422
|
+
ToastSink,
|
|
423
|
+
ToastActionProps,
|
|
424
|
+
ToastData,
|
|
425
|
+
ToastInput,
|
|
426
|
+
ToastVariant,
|
|
427
|
+
ToastContextValue,
|
|
428
|
+
} from "./components/core/toast";
|
|
429
|
+
export {
|
|
430
|
+
SnoozeMenu,
|
|
431
|
+
SnoozeDialog,
|
|
432
|
+
snoozePresets,
|
|
433
|
+
snoozeChoicesOf,
|
|
434
|
+
snoozeWakeLabel,
|
|
435
|
+
customSnooze,
|
|
436
|
+
DEFAULT_SNOOZE_CHOICES,
|
|
437
|
+
MAX_SNOOZE_MINUTES,
|
|
438
|
+
} from "./components/composite/snooze-menu";
|
|
439
|
+
export type {
|
|
440
|
+
SnoozeMenuProps,
|
|
441
|
+
SnoozeDialogProps,
|
|
442
|
+
SnoozePreset,
|
|
443
|
+
SnoozeChoice,
|
|
444
|
+
SnoozeDay,
|
|
445
|
+
} from "./components/composite/snooze-menu";
|
|
446
|
+
export {
|
|
447
|
+
BulkBar,
|
|
448
|
+
BulkAction,
|
|
449
|
+
BulkSeparator,
|
|
450
|
+
List,
|
|
451
|
+
listVariants,
|
|
452
|
+
ListItem,
|
|
453
|
+
listItemVariants,
|
|
454
|
+
ListGroup,
|
|
455
|
+
} from "./components/composite/list";
|
|
456
|
+
export type {
|
|
457
|
+
BulkBarProps,
|
|
458
|
+
BulkActionProps,
|
|
459
|
+
ListProps,
|
|
460
|
+
ListItemProps,
|
|
461
|
+
SwipeAction,
|
|
462
|
+
ListGroupProps,
|
|
463
|
+
} from "./components/composite/list";
|
|
464
|
+
export * from "./components/composite/command";
|
|
465
|
+
export { ScreenLink, FollowProvider, useFollow, gestureOf } from "./components/core/screen-link";
|
|
466
|
+
export { ViewScopeProvider, useEditing, useEditingSignal } from "./lib/view-scope";
|
|
467
|
+
export type { ViewScope, EditingRegistration } from "./lib/view-scope";
|
|
468
|
+
export type {
|
|
469
|
+
ScreenLinkProps,
|
|
470
|
+
Follow,
|
|
471
|
+
FollowEvent,
|
|
472
|
+
FollowTarget,
|
|
473
|
+
Gesture,
|
|
474
|
+
} from "./components/core/screen-link";
|
|
475
|
+
export {
|
|
476
|
+
Table,
|
|
477
|
+
tableVariants,
|
|
478
|
+
TableHeader,
|
|
479
|
+
TableBody,
|
|
480
|
+
TableFooter,
|
|
481
|
+
TableRow,
|
|
482
|
+
tableRowVariants,
|
|
483
|
+
TableHead,
|
|
484
|
+
TableCell,
|
|
485
|
+
ExpandToggle,
|
|
486
|
+
expandToggleVariants,
|
|
487
|
+
GroupHeader,
|
|
488
|
+
groupHeaderVariants,
|
|
489
|
+
CollapsibleRows,
|
|
490
|
+
} from "./components/core/table";
|
|
491
|
+
export type {
|
|
492
|
+
TableProps,
|
|
493
|
+
TableHeaderProps,
|
|
494
|
+
TableBodyProps,
|
|
495
|
+
TableFooterProps,
|
|
496
|
+
TableRowProps,
|
|
497
|
+
TableHeadProps,
|
|
498
|
+
TableCellProps,
|
|
499
|
+
ExpandToggleProps,
|
|
500
|
+
GroupHeaderProps,
|
|
501
|
+
CollapsibleRowsProps,
|
|
502
|
+
} from "./components/core/table";
|
|
503
|
+
// Reading a JSON answer: one shape for a refusal on every page (`lib/json.ts`), a plugin's own or one installed.
|
|
504
|
+
export { HttpError, ensureOk, isRecord, listOf, readJson, refusalOf } from "./lib/json";
|
|
505
|
+
export type { Refusal } from "./lib/json";
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
// The contract check of a rendering (`@bridge/ui/testing`), for a pack's tests (in a DOM: jsdom, a browser):
|
|
2
|
+
// it mounts each root the rendering gives, around a probe with state, switches to the rendering live, and
|
|
3
|
+
// reports what the switch broke: the content remounted (its state lost), the root replaced the kit's element,
|
|
4
|
+
// or dropped the wiring the kit gave it. Each part is drawn once in each state. An empty list: the rendering
|
|
5
|
+
// keeps the contract.
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { act } from "react";
|
|
8
|
+
import { createRoot } from "react-dom/client";
|
|
9
|
+
|
|
10
|
+
import { Checkbox } from "../components/core/checkbox/checkbox";
|
|
11
|
+
import {
|
|
12
|
+
Dialog,
|
|
13
|
+
DialogContent,
|
|
14
|
+
DialogDescription,
|
|
15
|
+
DialogTitle,
|
|
16
|
+
} from "../components/core/dialog/dialog";
|
|
17
|
+
import {
|
|
18
|
+
DEFAULT_KIT,
|
|
19
|
+
registerRendering,
|
|
20
|
+
setKit,
|
|
21
|
+
type KitParts,
|
|
22
|
+
type KitRoots,
|
|
23
|
+
type Rendering,
|
|
24
|
+
} from "./kit";
|
|
25
|
+
|
|
26
|
+
interface RootFixture {
|
|
27
|
+
/** The component the root belongs to, around `probe`. */
|
|
28
|
+
render: (probe: React.ReactNode) => React.ReactElement;
|
|
29
|
+
/** The root's element once mounted. */
|
|
30
|
+
find: () => HTMLElement | null;
|
|
31
|
+
/** Attributes the kit's wiring sets, which the rendering's root must keep. */
|
|
32
|
+
wiring: readonly string[];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const roots: { [K in keyof KitRoots]-?: RootFixture } = {
|
|
36
|
+
"dialog.content": {
|
|
37
|
+
render: (probe) => (
|
|
38
|
+
<Dialog open>
|
|
39
|
+
<DialogContent>
|
|
40
|
+
<DialogTitle>Probe</DialogTitle>
|
|
41
|
+
<DialogDescription>Contract check</DialogDescription>
|
|
42
|
+
{probe}
|
|
43
|
+
</DialogContent>
|
|
44
|
+
</Dialog>
|
|
45
|
+
),
|
|
46
|
+
find: () => document.querySelector<HTMLElement>('[data-slot="dialog-content"]'),
|
|
47
|
+
wiring: ["role", "aria-labelledby", "aria-describedby", "data-slot", "tabindex"],
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const parts: { [K in keyof KitParts]-?: () => React.ReactElement } = {
|
|
52
|
+
"checkbox.glyph": () => (
|
|
53
|
+
<>
|
|
54
|
+
<Checkbox defaultChecked aria-label="checked" />
|
|
55
|
+
<Checkbox defaultChecked="indeterminate" aria-label="indeterminate" />
|
|
56
|
+
</>
|
|
57
|
+
),
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/** A field with state: its mounts are counted, and what was typed must survive the switch. */
|
|
61
|
+
function Probe({ mounted }: { mounted: () => void }) {
|
|
62
|
+
React.useEffect(mounted, [mounted]);
|
|
63
|
+
return <input data-probe aria-label="probe" />;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** What `rendering` breaks in the contract; empty when nothing. It registers the rendering for the check. */
|
|
67
|
+
export async function checkRendering(rendering: Rendering): Promise<string[]> {
|
|
68
|
+
const problems: string[] = [];
|
|
69
|
+
(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true;
|
|
70
|
+
const unregister = registerRendering(rendering);
|
|
71
|
+
const container = document.body.appendChild(document.createElement("div"));
|
|
72
|
+
const page = createRoot(container);
|
|
73
|
+
try {
|
|
74
|
+
for (const [name, fixture] of Object.entries(roots) as [keyof KitRoots, RootFixture][]) {
|
|
75
|
+
if (!rendering.roots?.[name]) continue;
|
|
76
|
+
let mounts = 0;
|
|
77
|
+
const mounted = () => {
|
|
78
|
+
mounts++;
|
|
79
|
+
};
|
|
80
|
+
await act(async () => setKit(DEFAULT_KIT));
|
|
81
|
+
await act(async () => page.render(fixture.render(<Probe mounted={mounted} />)));
|
|
82
|
+
const before = fixture.find();
|
|
83
|
+
const probe = document.querySelector<HTMLInputElement>("[data-probe]")!;
|
|
84
|
+
probe.value = "typed";
|
|
85
|
+
const wiring = Object.fromEntries(fixture.wiring.map((a) => [a, before?.getAttribute(a)]));
|
|
86
|
+
await act(async () => setKit(rendering.id));
|
|
87
|
+
const after = fixture.find();
|
|
88
|
+
if (mounts !== 1)
|
|
89
|
+
problems.push(
|
|
90
|
+
`root "${name}": the switch remounts its content (state lost); keep the kit's element and its children in place`,
|
|
91
|
+
);
|
|
92
|
+
if (document.querySelector<HTMLInputElement>("[data-probe]")?.value !== "typed")
|
|
93
|
+
problems.push(`root "${name}": what was typed inside is lost on the switch`);
|
|
94
|
+
if (!after)
|
|
95
|
+
problems.push(
|
|
96
|
+
`root "${name}": the root lost the attribute data-slot; spread the kit's props on it`,
|
|
97
|
+
);
|
|
98
|
+
else {
|
|
99
|
+
if (after !== before)
|
|
100
|
+
problems.push(
|
|
101
|
+
`root "${name}": the root replaces the kit's element (<${before?.tagName.toLowerCase()}> became <${after.tagName.toLowerCase()}>)`,
|
|
102
|
+
);
|
|
103
|
+
for (const [attribute, value] of Object.entries(wiring)) {
|
|
104
|
+
if (after.getAttribute(attribute) !== value)
|
|
105
|
+
problems.push(
|
|
106
|
+
`root "${name}": the root drops ${attribute}; spread the kit's props on it`,
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
await act(async () => page.render(<></>));
|
|
111
|
+
}
|
|
112
|
+
for (const [name, render] of Object.entries(parts) as [
|
|
113
|
+
keyof KitParts,
|
|
114
|
+
() => React.ReactElement,
|
|
115
|
+
][]) {
|
|
116
|
+
if (!rendering.parts?.[name]) continue;
|
|
117
|
+
try {
|
|
118
|
+
await act(async () => page.render(render()));
|
|
119
|
+
} catch (error) {
|
|
120
|
+
problems.push(`part "${name}": drawing it throws: ${(error as Error).message}`);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
} finally {
|
|
124
|
+
await act(async () => page.unmount());
|
|
125
|
+
container.remove();
|
|
126
|
+
setKit(DEFAULT_KIT);
|
|
127
|
+
unregister();
|
|
128
|
+
}
|
|
129
|
+
return problems;
|
|
130
|
+
}
|