@bridgebrew/ui 0.0.0-stage → 0.1.10-next.79
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,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const SIDEBAR_MIN_WIDTH = 190;
|
|
3
|
+
declare const SIDEBAR_DEFAULT_WIDTH = 220;
|
|
4
|
+
declare const clampSidebarWidth: (width: number) => number;
|
|
5
|
+
interface SidebarResizeHandleProps extends Omit<React.ComponentProps<"div">, "children"> {
|
|
6
|
+
/** The sidebar's width in px (a Sidebar reads it from `--sidebar-width`). */
|
|
7
|
+
width: number;
|
|
8
|
+
/** Called with the next width, already clamped: while dragging, per key, on double-click. */
|
|
9
|
+
onWidthChange: (width: number) => void;
|
|
10
|
+
}
|
|
11
|
+
/** An 8px vertical separator on the sidebar's right edge: drag it (pointer capture), ArrowLeft/Right
|
|
12
|
+
* by 8px, double-click for the default width; clamped between 190px and half the viewport. Place it
|
|
13
|
+
* absolutely in a positioned container whose left edge is the sidebar's: the width is the pointer's
|
|
14
|
+
* x minus that edge. */
|
|
15
|
+
declare function SidebarResizeHandle({ width, onWidthChange, className, style, ...props }: SidebarResizeHandleProps): React.JSX.Element;
|
|
16
|
+
export { SidebarResizeHandle, SIDEBAR_MIN_WIDTH, SIDEBAR_DEFAULT_WIDTH, clampSidebarWidth };
|
|
17
|
+
export type { SidebarResizeHandleProps };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
interface SidebarTreeProps extends React.ComponentProps<"div"> {
|
|
3
|
+
/** Navigation: rows of text (after their icon, when given), permanent chevrons on the right, and hierarchy guides. */
|
|
4
|
+
variant?: "default" | "navigation";
|
|
5
|
+
/** The indent of a level, 12px by default (wider for a phone's larger icons). */
|
|
6
|
+
indent?: number;
|
|
7
|
+
}
|
|
8
|
+
/** A navigation tree of SidebarTreeItem rows (`role="tree"`; name it with `aria-label`) with one tab
|
|
9
|
+
* stop: the row last focused, else the active one (a new active row takes the stop), else the first
|
|
10
|
+
* row shown. The rows handle the arrow keys. */
|
|
11
|
+
declare function SidebarTree({ className, variant, indent, ...props }: SidebarTreeProps): React.JSX.Element;
|
|
12
|
+
interface SidebarTreeItemProps extends Omit<React.ComponentProps<"div">, "onSelect"> {
|
|
13
|
+
/** The item's title; also names its toggle ("Toggle <label>"). */
|
|
14
|
+
label: string;
|
|
15
|
+
/** Shown before the label. With children, the chevron takes its place on hover and keyboard focus,
|
|
16
|
+
* and always where nothing can hover (touch screens). */
|
|
17
|
+
icon?: React.ReactNode;
|
|
18
|
+
/** Nesting level, 0 at the top; 12px of indent a level (the tree's `indent`). */
|
|
19
|
+
depth?: number;
|
|
20
|
+
active?: boolean | undefined;
|
|
21
|
+
/** Set when the item has children: whether they show. Leave undefined for a leaf. */
|
|
22
|
+
expanded?: boolean | undefined;
|
|
23
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
24
|
+
/** Clicking the row anywhere but the toggle, or Enter/Space on the focused item: the item itself
|
|
25
|
+
* is selectable, children or not. */
|
|
26
|
+
onSelect?: () => void;
|
|
27
|
+
/** Shown at the right end, outside the label (a count, a status icon): the item's description.
|
|
28
|
+
* Non-interactive: it sits in the clickable row. */
|
|
29
|
+
trailing?: React.ReactNode;
|
|
30
|
+
/** The children rows (SidebarTreeItems at `depth + 1`), in a `group` that opens and closes with `expanded`. */
|
|
31
|
+
children?: React.ReactNode;
|
|
32
|
+
/** Lines from this row's icon to each of its children (a branch into each, rounded on the last), saying they belong
|
|
33
|
+
* to it (without it, the `navigation` variant draws a straight line of its own). */
|
|
34
|
+
guide?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/** One `treeitem` of a SidebarTree: its row (the icon or, with children, a toggle; the label) and its
|
|
37
|
+
* children rows. The item is the focus target (the row's two buttons are for the mouse only):
|
|
38
|
+
* Up/Down move across the rows shown, Home/End to the first/last, Right opens or moves to the first
|
|
39
|
+
* child, Left closes or moves to the parent, Enter/Space select as a row click does. */
|
|
40
|
+
declare function SidebarTreeItem({ className, style, label, icon, depth, active, expanded, onExpandedChange, onSelect, onClick, trailing, children, guide, ...props }: SidebarTreeItemProps): React.JSX.Element;
|
|
41
|
+
export { SidebarTree, SidebarTreeItem };
|
|
42
|
+
export type { SidebarTreeProps, SidebarTreeItemProps };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
import { SidebarCollapse, SidebarGroup, SidebarGroupContent, SidebarGroupTrigger, type SidebarCollapseProps, type SidebarGroupContentProps, type SidebarGroupProps, type SidebarGroupTriggerProps } from "./sidebar-group";
|
|
4
|
+
import { SidebarItem, sidebarItemVariants, type SidebarItemProps } from "./sidebar-item";
|
|
5
|
+
import { SIDEBAR_DEFAULT_WIDTH, SIDEBAR_MIN_WIDTH, SidebarResizeHandle, clampSidebarWidth, type SidebarResizeHandleProps } from "./sidebar-resize-handle";
|
|
6
|
+
import { SidebarTree, SidebarTreeItem, type SidebarTreeItemProps, type SidebarTreeProps } from "./sidebar-tree";
|
|
7
|
+
declare const sidebarVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
8
|
+
interface SidebarProps extends React.ComponentProps<"nav">, VariantProps<typeof sidebarVariants> {
|
|
9
|
+
}
|
|
10
|
+
declare function Sidebar({ className, ...props }: SidebarProps): React.JSX.Element;
|
|
11
|
+
interface SidebarContentProps extends React.ComponentProps<"div"> {
|
|
12
|
+
}
|
|
13
|
+
declare function SidebarContent({ className, ...props }: SidebarContentProps): React.JSX.Element;
|
|
14
|
+
interface SidebarHeaderProps extends React.ComponentProps<"div"> {
|
|
15
|
+
}
|
|
16
|
+
/** Brand / app header for the top of a sidebar. Use as the first child of
|
|
17
|
+
* SidebarContent — its `px-1.5` matches SidebarItem so the brand icon lands on
|
|
18
|
+
* the same left rail as the nav item icons (no manual alignment). */
|
|
19
|
+
declare function SidebarHeader({ className, ...props }: SidebarHeaderProps): React.JSX.Element;
|
|
20
|
+
interface SidebarSectionProps extends React.ComponentProps<"div"> {
|
|
21
|
+
}
|
|
22
|
+
declare function SidebarSection({ className, ...props }: SidebarSectionProps): React.JSX.Element;
|
|
23
|
+
interface SidebarFooterProps extends React.ComponentProps<"div"> {
|
|
24
|
+
}
|
|
25
|
+
declare function SidebarFooter({ className, ...props }: SidebarFooterProps): React.JSX.Element;
|
|
26
|
+
export { Sidebar, sidebarVariants, SidebarContent, SidebarHeader, SidebarSection, SidebarItem, sidebarItemVariants, SidebarFooter, SidebarGroup, SidebarGroupTrigger, SidebarGroupContent, SidebarTree, SidebarTreeItem, SidebarCollapse, SidebarResizeHandle, SIDEBAR_MIN_WIDTH, SIDEBAR_DEFAULT_WIDTH, clampSidebarWidth, };
|
|
27
|
+
export type { SidebarProps, SidebarContentProps, SidebarHeaderProps, SidebarSectionProps, SidebarItemProps, SidebarFooterProps, SidebarGroupProps, SidebarGroupTriggerProps, SidebarGroupContentProps, SidebarTreeProps, SidebarTreeItemProps, SidebarCollapseProps, SidebarResizeHandleProps, };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
interface AddressBookTemplateProps extends Omit<React.ComponentProps<"div">, "children"> {
|
|
3
|
+
/** Driven by a shell (Bridge's phone shell: the opened person is the screen's item, its Back closes it): the person
|
|
4
|
+
* open, none for the list alone. Without `onOpen`, the template keeps its own (the first person, its own Back). */
|
|
5
|
+
openId?: string | undefined;
|
|
6
|
+
/** A row opened, with `openId`: the shell opens it (`ctx.screen.open`). */
|
|
7
|
+
onOpen?: ((id: string) => void) | undefined;
|
|
8
|
+
}
|
|
9
|
+
declare function AddressBookTemplate({ openId: driven, onOpen, ...props }: AddressBookTemplateProps): React.JSX.Element;
|
|
10
|
+
/** @deprecated AddressBookTemplate, its name until November 2026 (published in 0.1.x, so kept). */
|
|
11
|
+
declare const ListDetailTemplate: typeof AddressBookTemplate;
|
|
12
|
+
/** @deprecated AddressBookTemplateProps. */
|
|
13
|
+
type ListDetailTemplateProps = AddressBookTemplateProps;
|
|
14
|
+
export { AddressBookTemplate, ListDetailTemplate };
|
|
15
|
+
export type { AddressBookTemplateProps, ListDetailTemplateProps };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
interface MailTemplateProps extends Omit<React.ComponentProps<"div">, "children"> {
|
|
3
|
+
/** Driven by a shell (Bridge's phone shell: the mail open is the screen's item, its Back closes it): the mail open,
|
|
4
|
+
* none for the list alone. Without `onOpen`, the template keeps its own (the first mail, its own Back). */
|
|
5
|
+
openId?: string | undefined;
|
|
6
|
+
/** A row opened, with `openId`: the shell opens it (`ctx.screen.open`). */
|
|
7
|
+
onOpen?: ((id: string) => void) | undefined;
|
|
8
|
+
}
|
|
9
|
+
declare function MailTemplate({ openId: driven, onOpen, ...props }: MailTemplateProps): React.JSX.Element;
|
|
10
|
+
export { MailTemplate };
|
|
11
|
+
export type { MailTemplateProps };
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
export { cn } from "./lib/utils";
|
|
2
|
+
export { copyText } from "./lib/clipboard";
|
|
3
|
+
export { formatDate, formatNumber, userLocale } from "./lib/dates";
|
|
4
|
+
export { isComposing, modalOpen } from "./lib/keys";
|
|
5
|
+
export { BRIDGE_THEMES, DEFAULT_THEME, PACK_THEMES_EVENT, THEMES, THEME_STORAGE_KEY, allThemes, modeOfTheme, resolveTheme, setPackThemes, themeOfMode, } from "./theme/themes";
|
|
6
|
+
export { applyTheme, getColourMode, getModeChoice, getTheme, hasOwnTheme, refreshTheme, setMode, setTheme, themeSources, useColourMode, useThemeOfMode, } from "./theme/set-theme";
|
|
7
|
+
export { followBridgeAppearance, getBridgeAppearance, hasOwnAppearance, setBridgeAppearance, setWorkspaceAppearance, useOwnAppearance, } from "./theme/appearance";
|
|
8
|
+
export type { Appearance, WorkspaceAppearance } from "./theme/appearance";
|
|
9
|
+
export { CLIENT_APPEARANCE_KEY, addMineImage, everywhereOf, getClientAppearance, mineImageOf, mineOf, setMine, setMineFields, setEverywhere, setPreference, subscribeClientAppearance, useClientAppearance, } from "./theme/client-appearance-react";
|
|
10
|
+
export type { ClientAppearance, ClientAppearanceChange, ClientAppearanceStore, Fields as MineFields, } from "./theme/client-appearance";
|
|
11
|
+
export type { Mode, ThemeInfo, ThemePair } from "./theme/themes";
|
|
12
|
+
export { PROFILE_KEY, createProfile, currentWorkspace, profile } from "./profile/profile";
|
|
13
|
+
export type { Profile, Where, WorkspaceRef } from "./profile/profile";
|
|
14
|
+
export { useWallpaperTheme } from "./theme/wallpaper-theme-react";
|
|
15
|
+
export { PackThemesProvider, useHostThemes, usePackThemes, useThemes, } from "./theme/pack-themes-react";
|
|
16
|
+
export type { PackThemeRoutes } from "./theme/pack-themes-react";
|
|
17
|
+
export { DEFAULT_KIT, KIT_CONTRACT, KIT_STORAGE_KEY, KitPart, applyKit, getKit, getRenderings, registerRendering, setKit, subscribeRenderings, useCapability, useKit, useKitRoot, useRendering, useRenderings, } from "./kit/kit";
|
|
18
|
+
export type { KitCapability, KitParts, KitRoots, Rendering } from "./kit/kit";
|
|
19
|
+
export { Button, buttonVariants } from "./components/core/button";
|
|
20
|
+
export type { ButtonProps } from "./components/core/button";
|
|
21
|
+
export { Input, inputVariants, noAutofill } from "./components/core/input";
|
|
22
|
+
export type { InputProps } from "./components/core/input";
|
|
23
|
+
export { Textarea } from "./components/core/input";
|
|
24
|
+
export type { TextareaProps } from "./components/core/input";
|
|
25
|
+
export { PromptField } from "./components/composite/prompt-field";
|
|
26
|
+
export type { PromptFieldProps } from "./components/composite/prompt-field";
|
|
27
|
+
export { EditableField, InlineFields } from "./components/core/editable-field";
|
|
28
|
+
export type { EditableFieldProps, EditableFieldState } from "./components/core/editable-field";
|
|
29
|
+
export { Field, FieldLabel, FieldDescription, FieldError, FieldRow, useFieldControl, } from "./components/core/field";
|
|
30
|
+
export type { FieldProps, FieldLabelProps, FieldDescriptionProps, FieldErrorProps, } from "./components/core/field";
|
|
31
|
+
export { Select, SelectTrigger, SelectValue, SelectContent, SelectItem, SelectGroup, SelectLabel, SelectSeparator, } from "./components/core/select";
|
|
32
|
+
export type { SelectProps, SelectTriggerProps, SelectValueProps, SelectContentProps, SelectItemProps, SelectGroupProps, SelectLabelProps, SelectSeparatorProps, } from "./components/core/select";
|
|
33
|
+
export { Combobox } from "./components/core/combobox";
|
|
34
|
+
export type { ComboboxProps } from "./components/core/combobox";
|
|
35
|
+
export { Picker } from "./components/composite/picker";
|
|
36
|
+
export type { PickerProps } from "./components/composite/picker";
|
|
37
|
+
export { TagInput } from "./components/composite/tag-input";
|
|
38
|
+
export type { TagInputProps } from "./components/composite/tag-input";
|
|
39
|
+
export { DataMenuTrigger, PickMenu, PickSelect } from "./components/core/pick-menu";
|
|
40
|
+
export type { DataMenuTriggerProps, PickMenuProps, PickOption, PickSelectProps, } from "./components/core/pick-menu";
|
|
41
|
+
export { TagPill, TagDot, TagList, FilterChip, tagColor } from "./components/core/tag-pill";
|
|
42
|
+
export type { TagPillProps, FilterChipProps } from "./components/core/tag-pill";
|
|
43
|
+
export { TagMenu } from "./components/core/pick-menu";
|
|
44
|
+
export type { TagMenuProps, TagCount } from "./components/core/pick-menu";
|
|
45
|
+
export { Bullets } from "./components/core/bullets";
|
|
46
|
+
export type { BulletsProps } from "./components/core/bullets";
|
|
47
|
+
export { Thumbnail } from "./components/core/thumbnail";
|
|
48
|
+
export type { ThumbnailKind, ThumbnailProps } from "./components/core/thumbnail";
|
|
49
|
+
export { DropZone } from "./components/core/drop-zone";
|
|
50
|
+
export type { DropZoneHandle, DropZoneProps } from "./components/core/drop-zone";
|
|
51
|
+
export { Progress } from "./components/core/progress";
|
|
52
|
+
export type { ProgressProps } from "./components/core/progress";
|
|
53
|
+
export { ImageField } from "./components/composite/image-field";
|
|
54
|
+
export type { ImageFieldProps, ImageFieldValue } from "./components/composite/image-field";
|
|
55
|
+
export { StatusIcon, statusIconVariants } from "./components/core/status-icon";
|
|
56
|
+
export type { StatusIconStatus, StatusIconProps } from "./components/core/status-icon";
|
|
57
|
+
export { Avatar, avatarVariants, getInitials } from "./components/core/avatar";
|
|
58
|
+
export type { AvatarProps, AvatarSize } from "./components/core/avatar";
|
|
59
|
+
export { Label, labelVariants } from "./components/core/label";
|
|
60
|
+
export type { LabelProps, LabelVariant } from "./components/core/label";
|
|
61
|
+
export { Badge, badgeVariants } from "./components/core/badge";
|
|
62
|
+
export type { BadgeProps } from "./components/core/badge";
|
|
63
|
+
export { Skeleton, ListSkeleton, DetailSkeleton } from "./components/core/skeleton";
|
|
64
|
+
export type { SkeletonProps } from "./components/core/skeleton";
|
|
65
|
+
export { Card, cardVariants, CardHeader, cardHeaderVariants } from "./components/core/card";
|
|
66
|
+
export type { CardProps, CardHeaderProps } from "./components/core/card";
|
|
67
|
+
export { Section, sectionVariants } from "./components/core/section";
|
|
68
|
+
export type { SectionProps } from "./components/core/section";
|
|
69
|
+
export { ScrollArea, ScrollAreaScrollbar } from "./components/core/scroll-area";
|
|
70
|
+
export { Pane, PaneHeader, PaneBody, PaneFooter, PaneNote } from "./components/core/pane";
|
|
71
|
+
export { MainContent } from "./components/core/main-content";
|
|
72
|
+
export type { MainContentProps } from "./components/core/main-content";
|
|
73
|
+
export { Collapsible, CollapsibleTrigger, CollapsiblePanel } from "./components/core/collapsible";
|
|
74
|
+
export { CodeBlock } from "./components/core/code-block";
|
|
75
|
+
export type { CodeBlockProps, CodeToken } from "./components/core/code-block";
|
|
76
|
+
export { Cluster } from "./components/core/cluster";
|
|
77
|
+
export { MultiPane, multiPaneNarrowWidth, multiPaneAsideWidth, ListDetail, listDetailNarrowWidth, } from "./components/layout/multi-pane";
|
|
78
|
+
export type { MultiPaneProps, ListDetailProps } from "./components/layout/multi-pane";
|
|
79
|
+
export { SinglePane } from "./components/layout/single-pane";
|
|
80
|
+
export type { SinglePaneProps } from "./components/layout/single-pane";
|
|
81
|
+
export { AddressBookTemplate, ListDetailTemplate, } from "./components/template/address-book-template";
|
|
82
|
+
export type { AddressBookTemplateProps, ListDetailTemplateProps, } from "./components/template/address-book-template";
|
|
83
|
+
export { MailTemplate } from "./components/template/mail-template";
|
|
84
|
+
export type { MailTemplateProps } from "./components/template/mail-template";
|
|
85
|
+
export { SplitView, SplitPane, SplitHandle } from "./components/core/split-view";
|
|
86
|
+
export type { SplitViewProps, SplitPaneProps, SplitHandleProps, } from "./components/core/split-view";
|
|
87
|
+
export { EmptyState } from "./components/core/empty-state";
|
|
88
|
+
export type { EmptyStateProps } from "./components/core/empty-state";
|
|
89
|
+
export { Wizard, WizardStep, useWizard } from "./components/composite/wizard";
|
|
90
|
+
export type { WizardProps, WizardStepProps } from "./components/composite/wizard";
|
|
91
|
+
export { Detail, DetailHeader, DetailTitle, DetailHint, DetailSubtitle, } from "./components/core/detail";
|
|
92
|
+
export { Popover, PopoverTrigger, PopoverContent } from "./components/core/popover";
|
|
93
|
+
export type { PopoverProps, PopoverTriggerProps, PopoverContentProps, } from "./components/core/popover";
|
|
94
|
+
export { Kbd } from "./components/core/kbd";
|
|
95
|
+
export type { KbdProps } from "./components/core/kbd";
|
|
96
|
+
export { DraftBar } from "./components/composite/draft-bar";
|
|
97
|
+
export type { DraftBarProps } from "./components/composite/draft-bar";
|
|
98
|
+
export type { ScrollAreaProps, ScrollAreaScrollbarProps } from "./components/core/scroll-area";
|
|
99
|
+
export { SortableBoard, SortableList, SortableItem, DragHandle, useSortableDragState, arrayMove, } from "./components/core/sortable";
|
|
100
|
+
export type { SortableBoardProps, SortableListProps, SortableItemProps, DragHandleProps, SortableDragState, MoveEvent, } from "./components/core/sortable";
|
|
101
|
+
export { ColourPicker, THEME_COLOURS, THEME_COLOUR_GROUPS } from "./components/core/colour-picker";
|
|
102
|
+
export type { ColourGroup, ColourPickerProps, ColourSwatch } from "./components/core/colour-picker";
|
|
103
|
+
export { Slider } from "./components/core/slider";
|
|
104
|
+
export type { SliderProps } from "./components/core/slider";
|
|
105
|
+
export { Toggle, toggleVariants } from "./components/core/toggle";
|
|
106
|
+
export type { ToggleProps } from "./components/core/toggle";
|
|
107
|
+
export { Checkbox, checkboxVariants } from "./components/core/checkbox";
|
|
108
|
+
export type { CheckboxProps } from "./components/core/checkbox";
|
|
109
|
+
export { Properties, propertiesVariants, PropertyRow, propertyRowVariants, PropertyPlaceholder, PropertyGrid, } from "./components/composite/properties";
|
|
110
|
+
export type { PropertiesProps, PropertyRowProps } from "./components/composite/properties";
|
|
111
|
+
export { Tabs, TabsList, tabsListVariants, TabsTrigger, TabsContent } from "./components/core/tabs";
|
|
112
|
+
export type { TabsProps, TabsListProps, TabsTriggerProps, TabsContentProps, } from "./components/core/tabs";
|
|
113
|
+
export { Sidebar, sidebarVariants, SidebarContent, SidebarHeader, SidebarSection, SidebarItem, sidebarItemVariants, SidebarFooter, SidebarGroup, SidebarGroupTrigger, SidebarGroupContent, SidebarTree, SidebarTreeItem, SidebarCollapse, SidebarResizeHandle, SIDEBAR_MIN_WIDTH, SIDEBAR_DEFAULT_WIDTH, clampSidebarWidth, } from "./components/shell/sidebar";
|
|
114
|
+
export type { SidebarProps, SidebarContentProps, SidebarHeaderProps, SidebarSectionProps, SidebarItemProps, SidebarFooterProps, SidebarGroupProps, SidebarGroupTriggerProps, SidebarGroupContentProps, SidebarTreeProps, SidebarTreeItemProps, SidebarCollapseProps, SidebarResizeHandleProps, } from "./components/shell/sidebar";
|
|
115
|
+
export { Icon, ICON_NAMES } from "./components/core/icon";
|
|
116
|
+
export type { IconProps } from "./components/core/icon";
|
|
117
|
+
export { DEFAULT_ICON_SET, ICON_SET_STORAGE_KEY, applyIconSet, getIconSet, getIconSets, registerIconSet, setIconSet, subscribeIconSets, useIconSetId, useIconSets, } from "./components/core/icon/icon-sets";
|
|
118
|
+
export type { IconData, IconSet } from "./components/core/icon/icon-sets";
|
|
119
|
+
export { AppShell, appShellVariants } from "./components/shell/app-shell";
|
|
120
|
+
export type { AppShellProps } from "./components/shell/app-shell";
|
|
121
|
+
export { ResizablePanelGroup, ResizablePanel, ResizableHandle, usePanelRef, } from "./components/core/resizable";
|
|
122
|
+
export type { PanelImperativeHandle, ResizablePanelGroupProps, ResizablePanelProps, ResizableHandleProps, } from "./components/core/resizable";
|
|
123
|
+
export { Breadcrumb, breadcrumbVariants } from "./components/core/breadcrumb";
|
|
124
|
+
export type { BreadcrumbProps, BreadcrumbItem } from "./components/core/breadcrumb";
|
|
125
|
+
export { SegmentGroup, segmentGroupVariants } from "./components/core/segment-group";
|
|
126
|
+
export type { SegmentGroupProps, SegmentGroupItem } from "./components/core/segment-group";
|
|
127
|
+
export { ToggleGroup } from "./components/core/toggle-group";
|
|
128
|
+
export type { ToggleGroupProps, ToggleGroupItem } from "./components/core/toggle-group";
|
|
129
|
+
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, dropdownMenuItemVariants, DropdownMenuSeparator, DropdownMenuLabel, DropdownMenuGroup, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, ContextMenu, ContextMenuTrigger, openContextMenuFromKey, } from "./components/core/dropdown-menu";
|
|
130
|
+
export type { DropdownMenuProps, DropdownMenuTriggerProps, DropdownMenuContentProps, DropdownMenuItemProps, DropdownMenuSeparatorProps, DropdownMenuLabelProps, DropdownMenuGroupProps, DropdownMenuShortcutProps, DropdownMenuSubProps, DropdownMenuSubTriggerProps, DropdownMenuSubContentProps, ContextMenuProps, ContextMenuTriggerProps, } from "./components/core/dropdown-menu";
|
|
131
|
+
export { Dialog, DialogTrigger, DialogContent, dialogContentVariants, DialogHeader, DialogBody, DialogFooter, DialogTitle, DialogDescription, DialogClose, DialogMaximize, } from "./components/core/dialog";
|
|
132
|
+
export type { DialogProps, DialogTriggerProps, DialogContentProps, DialogHeaderProps, DialogBodyProps, DialogFooterProps, DialogTitleProps, DialogDescriptionProps, DialogCloseProps, DialogMaximizeProps, } from "./components/core/dialog";
|
|
133
|
+
export { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent, Tip, } from "./components/core/tooltip";
|
|
134
|
+
export type { TooltipProps, TooltipProviderProps, TooltipTriggerProps, TooltipContentProps, } from "./components/core/tooltip";
|
|
135
|
+
export { ToastProvider, ToastAction, ToastStack, toastVariants, useToast, } from "./components/core/toast";
|
|
136
|
+
export type { ToastProviderProps, ToastStackProps, ToastShown, ToastSink, ToastActionProps, ToastData, ToastInput, ToastVariant, ToastContextValue, } from "./components/core/toast";
|
|
137
|
+
export { SnoozeMenu, SnoozeDialog, snoozePresets, snoozeChoicesOf, snoozeWakeLabel, customSnooze, DEFAULT_SNOOZE_CHOICES, MAX_SNOOZE_MINUTES, } from "./components/composite/snooze-menu";
|
|
138
|
+
export type { SnoozeMenuProps, SnoozeDialogProps, SnoozePreset, SnoozeChoice, SnoozeDay, } from "./components/composite/snooze-menu";
|
|
139
|
+
export { BulkBar, BulkAction, BulkSeparator, List, listVariants, ListItem, listItemVariants, ListGroup, } from "./components/composite/list";
|
|
140
|
+
export type { BulkBarProps, BulkActionProps, ListProps, ListItemProps, SwipeAction, ListGroupProps, } from "./components/composite/list";
|
|
141
|
+
export * from "./components/composite/command";
|
|
142
|
+
export { ScreenLink, FollowProvider, useFollow, gestureOf } from "./components/core/screen-link";
|
|
143
|
+
export { ViewScopeProvider, useEditing, useEditingSignal } from "./lib/view-scope";
|
|
144
|
+
export type { ViewScope, EditingRegistration } from "./lib/view-scope";
|
|
145
|
+
export type { ScreenLinkProps, Follow, FollowEvent, FollowTarget, Gesture, } from "./components/core/screen-link";
|
|
146
|
+
export { Table, tableVariants, TableHeader, TableBody, TableFooter, TableRow, tableRowVariants, TableHead, TableCell, ExpandToggle, expandToggleVariants, GroupHeader, groupHeaderVariants, CollapsibleRows, } from "./components/core/table";
|
|
147
|
+
export type { TableProps, TableHeaderProps, TableBodyProps, TableFooterProps, TableRowProps, TableHeadProps, TableCellProps, ExpandToggleProps, GroupHeaderProps, CollapsibleRowsProps, } from "./components/core/table";
|
|
148
|
+
export { HttpError, ensureOk, isRecord, listOf, readJson, refusalOf } from "./lib/json";
|
|
149
|
+
export type { Refusal } from "./lib/json";
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** The contract a rendering is written for; a rendering of another version is refused. */
|
|
3
|
+
export declare const KIT_CONTRACT = 1;
|
|
4
|
+
/** The kit's own rendering. */
|
|
5
|
+
export declare const DEFAULT_KIT = "default";
|
|
6
|
+
/** Where the page keeps the chosen rendering; the boot kernel reads it before the first mount. */
|
|
7
|
+
export declare const KIT_STORAGE_KEY = "bridge.kit";
|
|
8
|
+
/** The parts a rendering may draw, with the props the kit gives each. */
|
|
9
|
+
export interface KitParts {
|
|
10
|
+
/** Inside the checkbox, when it is checked or indeterminate. */
|
|
11
|
+
"checkbox.glyph": {
|
|
12
|
+
state: "checked" | "indeterminate";
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/** The roots a rendering may render: it gets the kit's wiring and must spread it on the same element. */
|
|
16
|
+
export interface KitRoots {
|
|
17
|
+
/** The dialog's window (a `div` with `role="dialog"`). */
|
|
18
|
+
"dialog.content": React.ComponentPropsWithRef<"div">;
|
|
19
|
+
}
|
|
20
|
+
/** Behaviours the kit implements, off unless the rendering turns them on. */
|
|
21
|
+
export type KitCapability =
|
|
22
|
+
/** The dialog's header drags its window (kept on screen; a reopened dialog starts centred). */
|
|
23
|
+
"dialog.dragByTitleBar"
|
|
24
|
+
/** A scrollbar gets a step button at each end (`data-slot="scroll-area-step"`, `data-direction`). */
|
|
25
|
+
| "scrollArea.stepButtons";
|
|
26
|
+
export interface Rendering {
|
|
27
|
+
/** Lowercase letters, digits and dashes; "default" is the kit's own. */
|
|
28
|
+
id: string;
|
|
29
|
+
label: string;
|
|
30
|
+
/** `KIT_CONTRACT` when it was written. */
|
|
31
|
+
contract: number;
|
|
32
|
+
parts?: {
|
|
33
|
+
[K in keyof KitParts]?: (props: KitParts[K]) => React.ReactNode;
|
|
34
|
+
};
|
|
35
|
+
roots?: {
|
|
36
|
+
[K in keyof KitRoots]?: (props: KitRoots[K]) => React.ReactElement;
|
|
37
|
+
};
|
|
38
|
+
capabilities?: readonly KitCapability[];
|
|
39
|
+
/** The canvas an app shell paints behind its windows (a CSS colour, dark: what sits on it takes light ink), where
|
|
40
|
+
* the user chose none; none: the shell's own. */
|
|
41
|
+
canvas?: string;
|
|
42
|
+
}
|
|
43
|
+
/** The registered renderings' ids. */
|
|
44
|
+
export declare const renderingIds: () => string[];
|
|
45
|
+
/** Calls `listener` each time a rendering is registered or removed, until the returned function. */
|
|
46
|
+
export declare function onRenderingsChange(listener: () => void): () => void;
|
|
47
|
+
/** Registers a rendering, until the returned function removes it. Throws on a bad or taken id, or another
|
|
48
|
+
* contract version. */
|
|
49
|
+
export declare function registerRendering(rendering: Rendering): () => void;
|
|
50
|
+
/** The chosen rendering's id (`<html data-kit>`), registered or not yet; "default" when none. */
|
|
51
|
+
export declare function getKit(): string;
|
|
52
|
+
/** Shows a rendering without remembering it (the Bridge default, `theme/appearance.ts`). */
|
|
53
|
+
export declare function applyKit(id: string): void;
|
|
54
|
+
/** Chooses a rendering for this browser and remembers it, "default" (the kit's own) included: it overrides the Bridge
|
|
55
|
+
* default. A storage failure leaves it chosen for this page only. */
|
|
56
|
+
export declare function setKit(id: string): void;
|
|
57
|
+
/** The registered renderings, outside React (the shell's look resolution: research-035). */
|
|
58
|
+
export declare const getRenderings: () => readonly Rendering[];
|
|
59
|
+
/** Calls `onChange` when a rendering comes or goes (or the choice changes); returns the unsubscribe. */
|
|
60
|
+
export declare const subscribeRenderings: (onChange: () => void) => () => void;
|
|
61
|
+
/** The chosen rendering's id, re-rendering the caller when it changes. */
|
|
62
|
+
export declare function useKit(): string;
|
|
63
|
+
/** The registered renderings, re-rendering the caller when one comes or goes. */
|
|
64
|
+
export declare function useRenderings(): readonly Rendering[];
|
|
65
|
+
/** The chosen rendering if registered (its pack may still be loading: the kit draws itself meanwhile). */
|
|
66
|
+
export declare function useRendering(): Rendering | undefined;
|
|
67
|
+
/** Whether the chosen rendering turns `capability` on. */
|
|
68
|
+
export declare function useCapability(capability: KitCapability): boolean;
|
|
69
|
+
/** The chosen rendering's root for `name`, if it has one. */
|
|
70
|
+
export declare function useKitRoot<K extends keyof KitRoots>(name: K): ((props: KitRoots[K]) => React.ReactElement) | undefined;
|
|
71
|
+
/** Draws part `name` from the chosen rendering, or the kit's own (`children`). */
|
|
72
|
+
export declare function KitPart<K extends keyof KitParts>({ name, props, children, }: {
|
|
73
|
+
name: K;
|
|
74
|
+
props: KitParts[K];
|
|
75
|
+
children: React.ReactNode;
|
|
76
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Copies `text`. The Clipboard API exists only in a secure context, and Bridge on the LAN is plain HTTP
|
|
2
|
+
* (`http://192.168.…`); it also rejects where the page lacks the permission (a frame without `clipboard-write`).
|
|
3
|
+
* There, a hidden textarea and `execCommand('copy')`. The textarea goes inside the open dialog,
|
|
4
|
+
* if any, so its focus trap does not take the selection away. Rejects when neither works. */
|
|
5
|
+
export declare function copyText(text: string): Promise<void>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** The user's locale: the browser's first preferred language, so dates and numbers show in the user's system format.
|
|
2
|
+
* Undefined outside a browser, which lets `Intl` take the runtime's own. Never a fixed `en-US`: a French user reads
|
|
3
|
+
* `03/12/1985` as 3 December. */
|
|
4
|
+
export declare const userLocale: () => string | undefined;
|
|
5
|
+
/** A date, a time or both in the user's format: `options` say which parts (`{ dateStyle: 'medium' }`,
|
|
6
|
+
* `{ hour: 'numeric', minute: '2-digit' }`); none gives the date and the time. Stored values stay ISO. */
|
|
7
|
+
export declare const formatDate: (value: Date | string | number, options?: Intl.DateTimeFormatOptions) => string;
|
|
8
|
+
/** A number in the user's format: `1,234` in English, `1 234` in French. */
|
|
9
|
+
export declare const formatNumber: (value: number, options?: Intl.NumberFormatOptions) => string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** An object, neither `null` nor an array: what a parsed JSON value is checked to be before its fields are read. */
|
|
2
|
+
export declare const isRecord: (value: unknown) => value is Record<string, unknown>;
|
|
3
|
+
/** `value`'s items when it is an array, else none: an array from outside read without `Array.isArray`'s `any[]`. */
|
|
4
|
+
export declare const listOf: (value: unknown) => unknown[];
|
|
5
|
+
/** What a refused answer says: its `error.message` (else `HTTP <status>`), and its `code` and `hint` when strings. */
|
|
6
|
+
export interface Refusal {
|
|
7
|
+
message: string;
|
|
8
|
+
code?: string;
|
|
9
|
+
hint?: string;
|
|
10
|
+
}
|
|
11
|
+
/** The refusal in `body`, an answer of status `status`. */
|
|
12
|
+
export declare const refusalOf: (body: unknown, status: number) => Refusal;
|
|
13
|
+
/** A refused answer as an Error: the refusal's message, its `code` and `hint`, and the `status`. */
|
|
14
|
+
export declare class HttpError extends Error {
|
|
15
|
+
readonly status: number;
|
|
16
|
+
readonly code: string | undefined;
|
|
17
|
+
readonly hint: string | undefined;
|
|
18
|
+
constructor(status: number, refusal: Refusal);
|
|
19
|
+
}
|
|
20
|
+
/** Throws an `HttpError` when `res` is not ok. An ok answer's body is not read: for a caller that needs none of its
|
|
21
|
+
* fields, so a 2xx cut short (a host restarting) still counts as done. */
|
|
22
|
+
export declare function ensureOk(res: Response): Promise<void>;
|
|
23
|
+
/** `res`'s JSON body. Throws an `HttpError` when `res` is not ok, and when its body is not JSON even under a 2xx (the
|
|
24
|
+
* request aborted mid-answer): never an answer without its fields. The body is `unknown`: an answer of Bridge's own
|
|
25
|
+
* routes is typed once where it is read (`as T`); one from elsewhere is checked. */
|
|
26
|
+
export declare function readJson(res: Response): Promise<unknown>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare const KEY_LABELS: Record<string, string>;
|
|
2
|
+
/** The keys as the menus show them: modifiers glued to the key ("⌘⌫", "⇧J"),
|
|
3
|
+
* a sequence keeping its space ("G P"). */
|
|
4
|
+
declare function formatKeys(keys: string): string;
|
|
5
|
+
/** The key belongs to an input method's composition (Japanese, Chinese, Korean…): the Enter that confirms the composed
|
|
6
|
+
* text is not a submit, nor a digit typed there a pick. Safari sends that last Enter with `isComposing` false and
|
|
7
|
+
* keyCode 229. Takes a React event or a native one. */
|
|
8
|
+
declare function isComposing(event: KeyboardEvent | {
|
|
9
|
+
nativeEvent: KeyboardEvent;
|
|
10
|
+
}): boolean;
|
|
11
|
+
/** A modal dialog is open (the shortcuts' help, a confirmation): the keys are its own, no page shortcut acts under it.
|
|
12
|
+
* The kit's `DialogContent` is known by its backdrop, open (its popup's `data-slot` can be a caller's, and a popover's
|
|
13
|
+
* popup is a `role="dialog"` too); another one says `aria-modal="true"` or is an alert dialog. */
|
|
14
|
+
declare function modalOpen(): boolean;
|
|
15
|
+
export { KEY_LABELS, formatKeys, isComposing, modalOpen };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** One editor's registration in a view's scope: `set` says whether it holds unsaved changes, `remove` takes it out. */
|
|
3
|
+
interface EditingRegistration {
|
|
4
|
+
set(dirty: boolean): void;
|
|
5
|
+
remove(): void;
|
|
6
|
+
}
|
|
7
|
+
/** What the shell provides around a window's view. */
|
|
8
|
+
interface ViewScope {
|
|
9
|
+
register(): EditingRegistration;
|
|
10
|
+
}
|
|
11
|
+
/** The shell's, around a window's view. */
|
|
12
|
+
declare function ViewScopeProvider({ value, children, }: {
|
|
13
|
+
value: ViewScope | null;
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
}): React.JSX.Element;
|
|
16
|
+
/** An editor's signal in the view it renders in: call it with whether it holds unsaved changes (from a form
|
|
17
|
+
* subscription: no render needed). Registered while mounted, removed when unmounted; outside a shell, nothing. */
|
|
18
|
+
declare function useEditingSignal(): (dirty: boolean) => void;
|
|
19
|
+
/** A hand-made view's editor: `dirty` while it holds unsaved changes (its view is then `editing`). */
|
|
20
|
+
declare function useEditing(dirty: boolean): void;
|
|
21
|
+
export { ViewScopeProvider, useEditing, useEditingSignal };
|
|
22
|
+
export type { ViewScope, EditingRegistration };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** The prefix of this browser's keys: `<prefix><namespace>|<key>|<level>` per entry, `<prefix>device` and `<prefix>counter`. */
|
|
2
|
+
export declare const PROFILE_KEY = "bridge.profile:";
|
|
3
|
+
/** One Bridge's workspace: the page's Bridge and the workspace's slug in its path. */
|
|
4
|
+
export interface WorkspaceRef {
|
|
5
|
+
bridgeId: string;
|
|
6
|
+
slug: string;
|
|
7
|
+
}
|
|
8
|
+
/** The level an entry belongs to: the whole client, or one workspace of one Bridge. */
|
|
9
|
+
export type Where = {
|
|
10
|
+
scope: "global";
|
|
11
|
+
} | {
|
|
12
|
+
scope: "workspace";
|
|
13
|
+
workspace: WorkspaceRef;
|
|
14
|
+
};
|
|
15
|
+
/** The user's profile: values by namespace and key, at a level. */
|
|
16
|
+
export interface Profile {
|
|
17
|
+
/** The value in effect for `where.workspace` (its own, else the client-wide one), else the client-wide one. */
|
|
18
|
+
get(namespace: string, key: string, where?: {
|
|
19
|
+
workspace?: WorkspaceRef;
|
|
20
|
+
}): unknown;
|
|
21
|
+
/** The explicit entry of one level only: `undefined` where the value is inherited or reset. */
|
|
22
|
+
read(namespace: string, key: string, where: Where): unknown;
|
|
23
|
+
set(namespace: string, key: string, value: unknown, where: Where): void;
|
|
24
|
+
/** Leaves a tombstone at that level: the level reads `undefined`, the next level shows through. */
|
|
25
|
+
reset(namespace: string, key: string, where: Where): void;
|
|
26
|
+
/** Calls `listener` on each change (this page's or another tab's); returns the unsubscribe. */
|
|
27
|
+
subscribe(listener: () => void): () => void;
|
|
28
|
+
}
|
|
29
|
+
/** A profile kept in this browser's storage. A write storage refuses (blocked, full) still holds for this page. */
|
|
30
|
+
export declare function createProfile(): Profile;
|
|
31
|
+
/** This page's profile: entries are read from storage at each operation. */
|
|
32
|
+
export declare const profile: Profile;
|
|
33
|
+
/** The page's workspace: its Bridge (`meta[name="bridge-instance-id"]`) and the slug in its path; none without either. */
|
|
34
|
+
export declare function currentWorkspace(): WorkspaceRef | undefined;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface Appearance {
|
|
2
|
+
kit: string;
|
|
3
|
+
icons: string;
|
|
4
|
+
/** A theme id, or "system". */
|
|
5
|
+
theme: string;
|
|
6
|
+
}
|
|
7
|
+
/** What a workspace proposes to the page (its `appearance` settings, research-028): each left out follows the Bridge
|
|
8
|
+
* default. */
|
|
9
|
+
export interface WorkspaceAppearance {
|
|
10
|
+
kit?: string | undefined;
|
|
11
|
+
icons?: string | undefined;
|
|
12
|
+
lightTheme?: string | undefined;
|
|
13
|
+
darkTheme?: string | undefined;
|
|
14
|
+
/** The controls' height and radius in pixels (`--control-height`, `--control-radius` on `<html>`): left out, the
|
|
15
|
+
* stylesheet's (30, 8), or a rendering's own. */
|
|
16
|
+
controlHeight?: number | undefined;
|
|
17
|
+
controlRadius?: number | undefined;
|
|
18
|
+
}
|
|
19
|
+
/** The Bridge default look this page was given (or last told). */
|
|
20
|
+
export declare function getBridgeAppearance(): Appearance;
|
|
21
|
+
/** Whether this browser chose any part of its look itself (its mode aside). */
|
|
22
|
+
export declare function hasOwnAppearance(): boolean;
|
|
23
|
+
/** Drops this browser's choices (but its mode): the page follows the workspace and the Bridge default again. */
|
|
24
|
+
export declare function followBridgeAppearance(): void;
|
|
25
|
+
/** A new Bridge default (System saved it): kept on the page, and shown on each axis nothing above it decides. */
|
|
26
|
+
export declare function setBridgeAppearance(next: Appearance): void;
|
|
27
|
+
/** The workspace shown proposes `next` (none: nothing): kept on the page, and shown on each axis the browser did not
|
|
28
|
+
* choose. An id that is no id is left out. */
|
|
29
|
+
export declare function setWorkspaceAppearance(next: WorkspaceAppearance | undefined): void;
|
|
30
|
+
/** Whether this browser has its own look, re-rendering the caller when that may have changed. */
|
|
31
|
+
export declare function useOwnAppearance(): boolean;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export type Fields = Record<string, unknown>;
|
|
2
|
+
export interface ClientAppearance {
|
|
3
|
+
/** Client-wide preferences, by field (`mode`, `workspaceTransition`). */
|
|
4
|
+
prefs: Fields;
|
|
5
|
+
/** Mine of this page's Bridge's workspaces, by slug. */
|
|
6
|
+
workspaces: Record<string, Fields>;
|
|
7
|
+
/** Mine's images, by id (16 hex digits): data URLs. */
|
|
8
|
+
images: Record<string, string>;
|
|
9
|
+
/** The desktop app's home page: each joined Bridge's workspaces' Mine, by instance id then slug (no images). */
|
|
10
|
+
instances?: Record<string, Record<string, Fields>>;
|
|
11
|
+
}
|
|
12
|
+
/** A write: the preferences (whole), one workspace's Mine (whole; `null` drops it), images added. Images no workspace
|
|
13
|
+
* names any more, and not added by this write, are dropped. */
|
|
14
|
+
export interface ClientAppearanceChange {
|
|
15
|
+
prefs?: Fields;
|
|
16
|
+
workspace?: {
|
|
17
|
+
slug: string;
|
|
18
|
+
fields: Fields | null;
|
|
19
|
+
};
|
|
20
|
+
images?: Record<string, string>;
|
|
21
|
+
}
|
|
22
|
+
/** Where it is kept: `get` is synchronous (the boot kernel reads it before the first paint). */
|
|
23
|
+
export interface ClientAppearanceStore {
|
|
24
|
+
get(): ClientAppearance | null;
|
|
25
|
+
write(change: ClientAppearanceChange): Promise<{
|
|
26
|
+
ok: true;
|
|
27
|
+
} | {
|
|
28
|
+
ok: false;
|
|
29
|
+
error: string;
|
|
30
|
+
}>;
|
|
31
|
+
subscribe(listener: (next: ClientAppearance) => void): () => void;
|
|
32
|
+
}
|
|
33
|
+
declare global {
|
|
34
|
+
interface Window {
|
|
35
|
+
bridgeAppearance?: ClientAppearanceStore;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/** This browser's key. */
|
|
39
|
+
export declare const CLIENT_APPEARANCE_KEY = "bridge.appearance";
|
|
40
|
+
/** `state` with `change` applied (./client-appearance.test.ts). */
|
|
41
|
+
export declare function applyChange(state: ClientAppearance, change: ClientAppearanceChange): ClientAppearance;
|
|
42
|
+
/** The client's appearance now (the same object until it changes). */
|
|
43
|
+
export declare const getClientAppearance: () => ClientAppearance;
|
|
44
|
+
/** Calls `listener` on each change; returns the unsubscribe. */
|
|
45
|
+
export declare const subscribeClientAppearance: (listener: () => void) => () => void;
|
|
46
|
+
/** Workspace `slug`'s Mine (none: `{}`). */
|
|
47
|
+
export declare const mineOf: (slug: string | undefined) => Fields;
|
|
48
|
+
/** Sets (`undefined`: drops) field `field` of workspace `slug`'s Mine. */
|
|
49
|
+
export declare const setMine: (slug: string, field: string, value: unknown) => Promise<string | undefined>;
|
|
50
|
+
/** Replaces workspace `slug`'s Mine (`null`, or fields all `undefined`: drops it). */
|
|
51
|
+
export declare function setMineFields(slug: string, fields: Fields | null): Promise<string | undefined>;
|
|
52
|
+
/** The user's look everywhere (research-035, the desktop app): the look fields naming a plugin (style, icons, window
|
|
53
|
+
* manager, navigation) they want wherever the workspace's Bridge has it, kept with the client-wide preferences. */
|
|
54
|
+
export declare const everywhereOf: () => Fields;
|
|
55
|
+
/** Sets (`undefined`: drops) field `field` of the look everywhere; the app keeps a joined Bridge's page from changing it. */
|
|
56
|
+
export declare function setEverywhere(field: string, value: unknown): Promise<string | undefined>;
|
|
57
|
+
/** Sets (`undefined`: drops) client-wide preference `field`. */
|
|
58
|
+
export declare function setPreference(field: string, value: unknown): Promise<string | undefined>;
|
|
59
|
+
/** Mine's image `id`, as a URL the page can show, if the client keeps it. */
|
|
60
|
+
export declare function mineImageOf(id: string): string | undefined;
|
|
61
|
+
/** Keeps `file` (an image) for Mine: drawn at most `maxSide` wide or high, encoded as WebP (JPEG where the browser cannot),
|
|
62
|
+
* under a new id, written with field `field` of workspace `slug`'s Mine naming it (its `mode` half, else the whole
|
|
63
|
+
* field) in the same change, so no other write drops it first; answers the id, or why not. */
|
|
64
|
+
export declare function addMineImage(file: Blob, slug: string, field: string, mode?: "light" | "dark"): Promise<{
|
|
65
|
+
value: string;
|
|
66
|
+
} | {
|
|
67
|
+
error: string;
|
|
68
|
+
hint?: string;
|
|
69
|
+
}>;
|