@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,166 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
+
|
|
4
|
+
import { cn } from "../../../lib/utils";
|
|
5
|
+
|
|
6
|
+
// --- TableContext ---
|
|
7
|
+
|
|
8
|
+
interface TableContextValue {
|
|
9
|
+
columns?: string | undefined;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const TableContext = React.createContext<TableContextValue>({});
|
|
13
|
+
|
|
14
|
+
function useTableContext() {
|
|
15
|
+
return React.useContext(TableContext);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// --- Table ---
|
|
19
|
+
|
|
20
|
+
const tableVariants = cva("w-full text-sm");
|
|
21
|
+
|
|
22
|
+
interface TableProps extends React.ComponentProps<"div">, VariantProps<typeof tableVariants> {
|
|
23
|
+
/** CSS grid-template-columns, e.g. "auto 1fr 120px" */
|
|
24
|
+
columns?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function Table({ className, columns, ...props }: TableProps) {
|
|
28
|
+
const ctx = React.useMemo(() => ({ columns }), [columns]);
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<TableContext.Provider value={ctx}>
|
|
32
|
+
<div role="table" data-slot="table" className={cn(tableVariants({ className }))} {...props} />
|
|
33
|
+
</TableContext.Provider>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// --- TableHeader ---
|
|
38
|
+
|
|
39
|
+
interface TableHeaderProps extends React.ComponentProps<"div"> {}
|
|
40
|
+
|
|
41
|
+
function TableHeader({ className, ...props }: TableHeaderProps) {
|
|
42
|
+
return (
|
|
43
|
+
<div
|
|
44
|
+
role="rowgroup"
|
|
45
|
+
data-slot="table-header"
|
|
46
|
+
className={cn("border-b-[0.5px] border-border", className)}
|
|
47
|
+
{...props}
|
|
48
|
+
/>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// --- TableBody ---
|
|
53
|
+
|
|
54
|
+
interface TableBodyProps extends React.ComponentProps<"div"> {}
|
|
55
|
+
|
|
56
|
+
function TableBody({ className, ...props }: TableBodyProps) {
|
|
57
|
+
return (
|
|
58
|
+
<div
|
|
59
|
+
role="rowgroup"
|
|
60
|
+
data-slot="table-body"
|
|
61
|
+
className={cn(
|
|
62
|
+
"[&>[data-slot=table-row]:hover]:bg-hover [&_[data-slot=collapsible-rows]_[data-slot=table-row]:hover]:bg-hover",
|
|
63
|
+
className,
|
|
64
|
+
)}
|
|
65
|
+
{...props}
|
|
66
|
+
/>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// --- TableFooter ---
|
|
71
|
+
|
|
72
|
+
interface TableFooterProps extends React.ComponentProps<"div"> {}
|
|
73
|
+
|
|
74
|
+
function TableFooter({ className, ...props }: TableFooterProps) {
|
|
75
|
+
return (
|
|
76
|
+
<div
|
|
77
|
+
role="rowgroup"
|
|
78
|
+
data-slot="table-footer"
|
|
79
|
+
className={cn("bg-surface font-medium", className)}
|
|
80
|
+
{...props}
|
|
81
|
+
/>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// --- TableRow ---
|
|
86
|
+
|
|
87
|
+
const tableRowVariants = cva("grid items-center transition-colors duration-75", {
|
|
88
|
+
variants: {
|
|
89
|
+
size: {
|
|
90
|
+
default: "h-[40px]",
|
|
91
|
+
sm: "h-[36px]",
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
defaultVariants: { size: "default" },
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
interface TableRowProps
|
|
98
|
+
extends React.ComponentProps<"div">, VariantProps<typeof tableRowVariants> {}
|
|
99
|
+
|
|
100
|
+
function TableRow({ className, size, style, ...props }: TableRowProps) {
|
|
101
|
+
const { columns } = useTableContext();
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<div
|
|
105
|
+
role="row"
|
|
106
|
+
data-slot="table-row"
|
|
107
|
+
className={cn(tableRowVariants({ size, className }))}
|
|
108
|
+
style={columns ? { gridTemplateColumns: columns, ...style } : style}
|
|
109
|
+
{...props}
|
|
110
|
+
/>
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// --- TableHead ---
|
|
115
|
+
|
|
116
|
+
interface TableHeadProps extends React.ComponentProps<"div"> {}
|
|
117
|
+
|
|
118
|
+
function TableHead({ className, ...props }: TableHeadProps) {
|
|
119
|
+
return (
|
|
120
|
+
<div
|
|
121
|
+
role="columnheader"
|
|
122
|
+
data-slot="table-head"
|
|
123
|
+
className={cn(
|
|
124
|
+
"px-4 py-2 text-left text-sm font-medium text-muted flex items-center",
|
|
125
|
+
className,
|
|
126
|
+
)}
|
|
127
|
+
{...props}
|
|
128
|
+
/>
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// --- TableCell ---
|
|
133
|
+
|
|
134
|
+
interface TableCellProps extends React.ComponentProps<"div"> {}
|
|
135
|
+
|
|
136
|
+
function TableCell({ className, ...props }: TableCellProps) {
|
|
137
|
+
return (
|
|
138
|
+
<div
|
|
139
|
+
role="cell"
|
|
140
|
+
data-slot="table-cell"
|
|
141
|
+
className={cn("px-4 py-2 flex items-center", className)}
|
|
142
|
+
{...props}
|
|
143
|
+
/>
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export {
|
|
148
|
+
Table,
|
|
149
|
+
tableVariants,
|
|
150
|
+
TableHeader,
|
|
151
|
+
TableBody,
|
|
152
|
+
TableFooter,
|
|
153
|
+
TableRow,
|
|
154
|
+
tableRowVariants,
|
|
155
|
+
TableHead,
|
|
156
|
+
TableCell,
|
|
157
|
+
};
|
|
158
|
+
export type {
|
|
159
|
+
TableProps,
|
|
160
|
+
TableHeaderProps,
|
|
161
|
+
TableBodyProps,
|
|
162
|
+
TableFooterProps,
|
|
163
|
+
TableRowProps,
|
|
164
|
+
TableHeadProps,
|
|
165
|
+
TableCellProps,
|
|
166
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
name: Tabs
|
|
2
|
+
description: "Underline-style tabs with optional count badges, built on Base UI Tabs primitive."
|
|
3
|
+
layer: core
|
|
4
|
+
category: navigation
|
|
5
|
+
when_to_use:
|
|
6
|
+
- "For switching between views or content sections"
|
|
7
|
+
- "For organizing content into logical groups (e.g. Activity, Comments, History)"
|
|
8
|
+
- "For tab bars with count indicators"
|
|
9
|
+
when_not_to_use:
|
|
10
|
+
- "For primary navigation — use Sidebar"
|
|
11
|
+
- "For segmented controls with immediate value selection — use SegmentGroup"
|
|
12
|
+
- "For accordion-style collapsible content — use a disclosure pattern"
|
|
13
|
+
composition_partners:
|
|
14
|
+
- Badge (rendered automatically via count prop)
|
|
15
|
+
- Table (as tab content)
|
|
16
|
+
- Properties (as tab content)
|
|
17
|
+
props:
|
|
18
|
+
- name: value
|
|
19
|
+
type: "any | null"
|
|
20
|
+
required: false
|
|
21
|
+
description: "Controlled active tab value"
|
|
22
|
+
- name: defaultValue
|
|
23
|
+
type: "any | null"
|
|
24
|
+
required: false
|
|
25
|
+
description: "Default active tab (uncontrolled)"
|
|
26
|
+
- name: onValueChange
|
|
27
|
+
type: "(value: any | null, eventDetails) => void"
|
|
28
|
+
required: false
|
|
29
|
+
description: "Callback when the active tab changes. Base UI passes eventDetails as the second argument; user-initiated changes can be canceled."
|
|
30
|
+
- name: count
|
|
31
|
+
type: number
|
|
32
|
+
required: false
|
|
33
|
+
description: "Optional count displayed as muted text next to the tab label (TabsTrigger only)"
|
|
34
|
+
props_priority:
|
|
35
|
+
- defaultValue
|
|
36
|
+
- value
|
|
37
|
+
- onValueChange
|
|
38
|
+
examples:
|
|
39
|
+
- title: "Basic tabs"
|
|
40
|
+
code: |
|
|
41
|
+
<Tabs defaultValue="activity">
|
|
42
|
+
<TabsList>
|
|
43
|
+
<TabsTrigger value="activity">Activity</TabsTrigger>
|
|
44
|
+
<TabsTrigger value="comments" count={3}>Comments</TabsTrigger>
|
|
45
|
+
</TabsList>
|
|
46
|
+
<TabsContent value="activity">Activity content</TabsContent>
|
|
47
|
+
<TabsContent value="comments">Comments content</TabsContent>
|
|
48
|
+
</Tabs>
|
|
49
|
+
anti_patterns:
|
|
50
|
+
- "Don't use Tabs without TabsList and TabsTrigger — the underline style requires the full component tree"
|
|
51
|
+
- "Don't mix controlled and uncontrolled modes — use either value+onValueChange or defaultValue"
|
|
52
|
+
- "Don't put count on TabsContent — it belongs on TabsTrigger only"
|
|
53
|
+
accessibility_notes: "Built on Base UI Tabs — renders role='tablist', role='tab', role='tabpanel'. Keyboard: Arrow keys to navigate tabs, Enter/Space to activate. Active tab indicated by the data-active attribute."
|
|
54
|
+
notes: "Sub-components: Tabs (root), TabsList (tab bar), TabsTrigger (individual tab with optional count), TabsContent (panel). Active tab shows a 1.5px underline indicator."
|
|
55
|
+
related_patterns:
|
|
56
|
+
- detail-panel
|
|
57
|
+
- crud-page
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Tabs as TabsPrimitive } from "@base-ui/react/tabs";
|
|
3
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
4
|
+
|
|
5
|
+
import { cn } from "../../../lib/utils";
|
|
6
|
+
|
|
7
|
+
// --- Tabs (root) ---
|
|
8
|
+
|
|
9
|
+
interface TabsProps extends React.ComponentProps<typeof TabsPrimitive.Root> {}
|
|
10
|
+
|
|
11
|
+
function Tabs({ className, ...props }: TabsProps) {
|
|
12
|
+
return <TabsPrimitive.Root data-slot="tabs" className={className} {...props} />;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// --- TabsList ---
|
|
16
|
+
|
|
17
|
+
const tabsListVariants = cva("flex items-center gap-0 border-b border-border");
|
|
18
|
+
|
|
19
|
+
interface TabsListProps
|
|
20
|
+
extends React.ComponentProps<typeof TabsPrimitive.List>, VariantProps<typeof tabsListVariants> {}
|
|
21
|
+
|
|
22
|
+
function TabsList({ className, ...props }: TabsListProps) {
|
|
23
|
+
return (
|
|
24
|
+
<TabsPrimitive.List
|
|
25
|
+
data-slot="tabs-list"
|
|
26
|
+
className={cn(tabsListVariants({ className }))}
|
|
27
|
+
{...props}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// --- TabsTrigger ---
|
|
33
|
+
|
|
34
|
+
interface TabsTriggerProps extends React.ComponentProps<typeof TabsPrimitive.Tab> {
|
|
35
|
+
/** Optional count displayed as muted text next to label */
|
|
36
|
+
count?: number;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function TabsTrigger({ className, children, count, ...props }: TabsTriggerProps) {
|
|
40
|
+
return (
|
|
41
|
+
<TabsPrimitive.Tab
|
|
42
|
+
data-slot="tabs-trigger"
|
|
43
|
+
className={cn(
|
|
44
|
+
"relative flex items-center gap-[5px] px-3 py-0 h-[36px] text-sm font-medium text-muted cursor-pointer border-0 bg-transparent transition-colors duration-150",
|
|
45
|
+
"hover:text-secondary",
|
|
46
|
+
"data-active:text-foreground",
|
|
47
|
+
"after:absolute after:bottom-[-0.5px] after:left-3 after:right-3 after:h-[1.5px] after:bg-foreground after:rounded-[1px] after:content-[''] after:hidden",
|
|
48
|
+
"data-active:after:block",
|
|
49
|
+
className,
|
|
50
|
+
)}
|
|
51
|
+
{...props}
|
|
52
|
+
>
|
|
53
|
+
{children}
|
|
54
|
+
{count !== undefined && (
|
|
55
|
+
<span data-slot="tabs-trigger-count" className="text-xs text-muted font-normal">
|
|
56
|
+
{count}
|
|
57
|
+
</span>
|
|
58
|
+
)}
|
|
59
|
+
</TabsPrimitive.Tab>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// --- TabsContent ---
|
|
64
|
+
|
|
65
|
+
interface TabsContentProps extends React.ComponentProps<typeof TabsPrimitive.Panel> {}
|
|
66
|
+
|
|
67
|
+
function TabsContent({ className, ...props }: TabsContentProps) {
|
|
68
|
+
return (
|
|
69
|
+
<TabsPrimitive.Panel data-slot="tabs-content" className={cn("p-4", className)} {...props} />
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export { Tabs, TabsList, tabsListVariants, TabsTrigger, TabsContent };
|
|
74
|
+
export type { TabsProps, TabsListProps, TabsTriggerProps, TabsContentProps };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
name: TagPill
|
|
2
|
+
description: "A tag as a round pill with a coloured dot (research-033's mockup); tagColor(name) gives that tag's colour everywhere it shows."
|
|
3
|
+
layer: core
|
|
4
|
+
category: data-display
|
|
5
|
+
when_to_use:
|
|
6
|
+
- "A record's tags on its card or its list row"
|
|
7
|
+
- "tagColor for a tag's dot elsewhere (a menu option, a filter chip)"
|
|
8
|
+
when_not_to_use:
|
|
9
|
+
- "To edit tags — PickMenu (multiple) opens from a pill or a + button"
|
|
10
|
+
props:
|
|
11
|
+
- name: name
|
|
12
|
+
type: string
|
|
13
|
+
required: true
|
|
14
|
+
description: "The tag; its colour comes from it (any case)"
|
|
15
|
+
- name: size
|
|
16
|
+
type: "'sm' | 'default'"
|
|
17
|
+
required: false
|
|
18
|
+
default: "'default'"
|
|
19
|
+
description: "'sm' for a list row (20px)"
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
import { X } from "lucide-react";
|
|
4
|
+
|
|
5
|
+
import { cn } from "../../../lib/utils";
|
|
6
|
+
|
|
7
|
+
// research-033's mockup: a tag as a round pill with a coloured dot, the same colour wherever the tag shows (the card,
|
|
8
|
+
// a list row, the tag menu, the filter), from its name.
|
|
9
|
+
|
|
10
|
+
/** A tag's colour, from its name (any case): always the same for the same tag. */
|
|
11
|
+
function tagColor(name: string): string {
|
|
12
|
+
let hue = 0;
|
|
13
|
+
for (const char of name.toLowerCase()) hue = (hue * 31 + char.charCodeAt(0)) % 360;
|
|
14
|
+
return `oklch(62% 0.15 ${hue})`;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface TagPillProps extends React.ComponentProps<"span"> {
|
|
18
|
+
name: string;
|
|
19
|
+
/** `sm`: a list row's (20px). */
|
|
20
|
+
size?: "sm" | "default";
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function TagPill({ name, size = "default", className, ...props }: TagPillProps) {
|
|
24
|
+
return (
|
|
25
|
+
<span
|
|
26
|
+
data-slot="tag-pill"
|
|
27
|
+
className={cn(
|
|
28
|
+
"inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full border-[0.5px] border-border bg-surface pr-2.5 pl-2 text-secondary",
|
|
29
|
+
size === "sm" ? "h-5 text-[11px]" : "h-sm text-xs",
|
|
30
|
+
className,
|
|
31
|
+
)}
|
|
32
|
+
{...props}
|
|
33
|
+
>
|
|
34
|
+
<span
|
|
35
|
+
aria-hidden="true"
|
|
36
|
+
className="size-[7px] shrink-0 rounded-full"
|
|
37
|
+
style={{ background: tagColor(name) }}
|
|
38
|
+
/>
|
|
39
|
+
{name}
|
|
40
|
+
</span>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** A tag's coloured dot alone (a menu's option, a filter chip). */
|
|
45
|
+
function TagDot({ name, className, ...props }: React.ComponentProps<"span"> & { name: string }) {
|
|
46
|
+
return (
|
|
47
|
+
<span
|
|
48
|
+
aria-hidden="true"
|
|
49
|
+
data-slot="tag-dot"
|
|
50
|
+
className={cn("size-2 shrink-0 rounded-full", className)}
|
|
51
|
+
style={{ background: tagColor(name) }}
|
|
52
|
+
{...props}
|
|
53
|
+
/>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** A record's tags (research-033's mockup): pills that wrap, then the + that opens the tag menu (no step back onto
|
|
58
|
+
* the column's edge after a pill). */
|
|
59
|
+
function TagList({ className, ...props }: React.ComponentProps<"div">) {
|
|
60
|
+
return (
|
|
61
|
+
<div
|
|
62
|
+
role="group"
|
|
63
|
+
data-slot="tag-list"
|
|
64
|
+
className={cn(
|
|
65
|
+
"flex min-h-sm flex-wrap items-center gap-1 [&>[data-slot=tag-pill]+[data-slot=data-menu-trigger]]:ml-0",
|
|
66
|
+
className,
|
|
67
|
+
)}
|
|
68
|
+
{...props}
|
|
69
|
+
/>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
interface FilterChipProps extends Omit<React.ComponentProps<"button">, "onClick"> {
|
|
74
|
+
/** The tag the list is filtered by. */
|
|
75
|
+
name: string;
|
|
76
|
+
onRemove: () => void;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** A list's filter in its footer (research-033's mockup): the tag's dot and name, a ✕; a click removes it. */
|
|
80
|
+
function FilterChip({ name, onRemove, className, ...props }: FilterChipProps) {
|
|
81
|
+
return (
|
|
82
|
+
<button
|
|
83
|
+
type="button"
|
|
84
|
+
data-slot="filter-chip"
|
|
85
|
+
aria-label={`Remove filter ${name}`}
|
|
86
|
+
title="Remove filter"
|
|
87
|
+
onClick={onRemove}
|
|
88
|
+
className={cn(
|
|
89
|
+
"inline-flex h-5 cursor-pointer items-center gap-[5px] rounded-full border-[0.5px] border-border bg-transparent pr-1.5 pl-2 font-[inherit] text-[11px] text-secondary hover:bg-hover hover:text-foreground",
|
|
90
|
+
className,
|
|
91
|
+
)}
|
|
92
|
+
{...props}
|
|
93
|
+
>
|
|
94
|
+
<TagDot name={name} />
|
|
95
|
+
{name}
|
|
96
|
+
<X aria-hidden="true" size={11} />
|
|
97
|
+
</button>
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export { TagPill, TagDot, TagList, FilterChip, tagColor };
|
|
102
|
+
export type { TagPillProps, FilterChipProps };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
name: Thumbnail
|
|
2
|
+
description: "A square tile of a media or file grid: a picture, a video's first frame with a play badge, a folder or a file, its name truncated below."
|
|
3
|
+
layer: core
|
|
4
|
+
category: data-display
|
|
5
|
+
when_to_use:
|
|
6
|
+
- "A grid of images or videos a click opens (the session gallery)"
|
|
7
|
+
- "A grid of folders or files a click opens or selects"
|
|
8
|
+
when_not_to_use:
|
|
9
|
+
- "One image inside a record or an article — use ImageField"
|
|
10
|
+
- "A row of files — use List"
|
|
11
|
+
props:
|
|
12
|
+
- name: src
|
|
13
|
+
type: string
|
|
14
|
+
required: false
|
|
15
|
+
description: "The image or video's URL; an image without one shows the image icon"
|
|
16
|
+
- name: kind
|
|
17
|
+
type: "'image' | 'video' | 'folder' | 'file'"
|
|
18
|
+
required: true
|
|
19
|
+
description: "What the tile shows"
|
|
20
|
+
- name: name
|
|
21
|
+
type: string
|
|
22
|
+
required: true
|
|
23
|
+
description: "The tile's accessible name and the name truncated under the preview"
|
|
24
|
+
- name: onOpen
|
|
25
|
+
type: "() => void"
|
|
26
|
+
required: false
|
|
27
|
+
description: "Opens the media or the file; a click or Enter"
|
|
28
|
+
- name: selected
|
|
29
|
+
type: boolean
|
|
30
|
+
required: false
|
|
31
|
+
default: "false"
|
|
32
|
+
description: "Draws the accent ring and sets data-selected"
|
|
33
|
+
- name: badge
|
|
34
|
+
type: ReactNode
|
|
35
|
+
required: false
|
|
36
|
+
description: 'A corner mark top right (a pin, "public")'
|
|
37
|
+
- name: menu
|
|
38
|
+
type: ReactNode
|
|
39
|
+
required: false
|
|
40
|
+
description: "An actions trigger top right, shown on hover or focus (a menu)"
|
|
41
|
+
- name: className
|
|
42
|
+
type: string
|
|
43
|
+
required: false
|
|
44
|
+
description: "Additional CSS classes merged via cn()"
|
|
45
|
+
props_priority:
|
|
46
|
+
- kind
|
|
47
|
+
- name
|
|
48
|
+
- src
|
|
49
|
+
- onOpen
|
|
50
|
+
- selected
|
|
51
|
+
examples:
|
|
52
|
+
- title: "A grid of the session's images"
|
|
53
|
+
code: '<Thumbnail kind="image" name={image.name} src={image.url} onOpen={() => setIndex(i)} selected={i === index} badge={pinned && <Icon name="pin" />} />'
|
|
54
|
+
- title: "A video"
|
|
55
|
+
code: '<Thumbnail kind="video" name={clip.name} src={clip.url} onOpen={() => play(clip)} />'
|
|
56
|
+
anti_patterns:
|
|
57
|
+
- "Don't put an interactive menu inside the tile's button — the tile renders badge and menu as its own corners, outside the button"
|
|
58
|
+
- "Don't set a fixed width on the tile — it fills its grid cell and stays square"
|
|
59
|
+
accessibility_notes: "A button named by `name`; the preview (an image, a video, a folder or a file icon) is decorative. No focus ring on a click; a keyboard focus draws the accent ring. `badge` and `menu` are not part of the button's name."
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
import { cn } from "../../../lib/utils";
|
|
4
|
+
import { Icon } from "../icon";
|
|
5
|
+
import { Skeleton } from "../skeleton";
|
|
6
|
+
|
|
7
|
+
type ThumbnailKind = "image" | "video" | "folder" | "file";
|
|
8
|
+
|
|
9
|
+
interface ThumbnailProps extends Omit<React.ComponentProps<"div">, "onOpen"> {
|
|
10
|
+
/** The image or video's URL (`image` and `video`). */
|
|
11
|
+
src?: string;
|
|
12
|
+
/** What the tile shows: a picture, a video's first frame, a folder or a file. */
|
|
13
|
+
kind: ThumbnailKind;
|
|
14
|
+
/** The tile's accessible name and the name truncated under it. */
|
|
15
|
+
name: string;
|
|
16
|
+
/** Opens the media or the file; a click or Enter. */
|
|
17
|
+
onOpen?: () => void;
|
|
18
|
+
/** Draws the ring (the tile a grid has selected). */
|
|
19
|
+
selected?: boolean;
|
|
20
|
+
/** A corner mark top right (a pin, "public"). */
|
|
21
|
+
badge?: React.ReactNode;
|
|
22
|
+
/** An actions trigger top right, shown on hover or focus (a menu). */
|
|
23
|
+
menu?: React.ReactNode;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** A square tile of a media or file grid (extracted from the session gallery): a picture, a video's first frame
|
|
27
|
+
* with its play badge, a folder or a file, the name truncated below. */
|
|
28
|
+
function Thumbnail({
|
|
29
|
+
src,
|
|
30
|
+
kind,
|
|
31
|
+
name,
|
|
32
|
+
onOpen,
|
|
33
|
+
selected = false,
|
|
34
|
+
badge,
|
|
35
|
+
menu,
|
|
36
|
+
className,
|
|
37
|
+
...props
|
|
38
|
+
}: ThumbnailProps) {
|
|
39
|
+
// The outcome is kept with the URL it is about: a new `src` is loading at once, with no effect to reset it. An effect
|
|
40
|
+
// ran after the image's own load event when the browser had it cached, and left the skeleton pulsing over it.
|
|
41
|
+
const [outcome, setOutcome] = React.useState<{
|
|
42
|
+
src: string | undefined;
|
|
43
|
+
state: "loaded" | "error";
|
|
44
|
+
}>();
|
|
45
|
+
const state = outcome !== undefined && outcome.src === src ? outcome.state : "loading";
|
|
46
|
+
const setState = (next: "loaded" | "error") => setOutcome({ src, state: next });
|
|
47
|
+
/** An image the browser already has may be complete before React listens for its load event (seen: grid, list, grid
|
|
48
|
+
* again): read where it stands as the element is attached, not only from the event. */
|
|
49
|
+
const settled = (image: HTMLImageElement | null) => {
|
|
50
|
+
if (image === null || !image.complete || state !== "loading") return;
|
|
51
|
+
setState(image.naturalWidth > 0 ? "loaded" : "error");
|
|
52
|
+
};
|
|
53
|
+
const broken = state === "error" || (kind === "image" && !src);
|
|
54
|
+
return (
|
|
55
|
+
<div
|
|
56
|
+
data-slot="thumbnail"
|
|
57
|
+
data-kind={kind}
|
|
58
|
+
data-selected={selected ? "true" : undefined}
|
|
59
|
+
className={cn("group/thumbnail relative flex min-w-0 flex-col", className)}
|
|
60
|
+
{...props}
|
|
61
|
+
>
|
|
62
|
+
<button
|
|
63
|
+
type="button"
|
|
64
|
+
data-slot="thumbnail-button"
|
|
65
|
+
aria-label={name}
|
|
66
|
+
title={name}
|
|
67
|
+
className="m-0 flex min-w-0 cursor-pointer appearance-none flex-col gap-1 rounded-lg border-0 bg-transparent p-0 text-left outline-none focus:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-background"
|
|
68
|
+
onClick={() => onOpen?.()}
|
|
69
|
+
>
|
|
70
|
+
<span
|
|
71
|
+
data-slot="thumbnail-preview"
|
|
72
|
+
className={cn(
|
|
73
|
+
"relative block aspect-square w-full overflow-hidden rounded-lg border border-solid border-border bg-hover",
|
|
74
|
+
selected && "ring-2 ring-accent",
|
|
75
|
+
)}
|
|
76
|
+
>
|
|
77
|
+
{kind === "image" &&
|
|
78
|
+
(broken ? (
|
|
79
|
+
<span
|
|
80
|
+
data-slot="thumbnail-fallback"
|
|
81
|
+
className="flex size-full items-center justify-center text-muted"
|
|
82
|
+
>
|
|
83
|
+
<Icon name="image" size={20} />
|
|
84
|
+
</span>
|
|
85
|
+
) : (
|
|
86
|
+
<>
|
|
87
|
+
{state === "loading" && (
|
|
88
|
+
<Skeleton className="absolute inset-0 size-full rounded-none" />
|
|
89
|
+
)}
|
|
90
|
+
<img
|
|
91
|
+
data-slot="thumbnail-image"
|
|
92
|
+
className="block size-full object-cover"
|
|
93
|
+
src={src}
|
|
94
|
+
alt=""
|
|
95
|
+
loading="lazy"
|
|
96
|
+
ref={settled}
|
|
97
|
+
onLoad={() => setState("loaded")}
|
|
98
|
+
onError={() => setState("error")}
|
|
99
|
+
/>
|
|
100
|
+
</>
|
|
101
|
+
))}
|
|
102
|
+
{kind === "video" && (
|
|
103
|
+
<>
|
|
104
|
+
<video
|
|
105
|
+
className="block size-full object-cover"
|
|
106
|
+
src={src}
|
|
107
|
+
preload="metadata"
|
|
108
|
+
muted
|
|
109
|
+
playsInline
|
|
110
|
+
aria-hidden="true"
|
|
111
|
+
/>
|
|
112
|
+
<span
|
|
113
|
+
data-slot="thumbnail-play"
|
|
114
|
+
aria-hidden="true"
|
|
115
|
+
className="absolute inset-0 flex items-center justify-center"
|
|
116
|
+
>
|
|
117
|
+
<span className="inline-flex size-9 items-center justify-center rounded-full bg-black/55 text-white">
|
|
118
|
+
<svg
|
|
119
|
+
aria-hidden="true"
|
|
120
|
+
viewBox="0 0 16 16"
|
|
121
|
+
className="ml-0.5 size-4 fill-current"
|
|
122
|
+
>
|
|
123
|
+
<path d="M4 2.5v11l9-5.5z" />
|
|
124
|
+
</svg>
|
|
125
|
+
</span>
|
|
126
|
+
</span>
|
|
127
|
+
</>
|
|
128
|
+
)}
|
|
129
|
+
{(kind === "folder" || kind === "file") && (
|
|
130
|
+
<span
|
|
131
|
+
data-slot="thumbnail-art"
|
|
132
|
+
data-icon={kind}
|
|
133
|
+
className="flex size-full items-center justify-center text-muted"
|
|
134
|
+
>
|
|
135
|
+
<Icon name={kind} size={20} />
|
|
136
|
+
</span>
|
|
137
|
+
)}
|
|
138
|
+
{badge != null && (
|
|
139
|
+
<span data-slot="thumbnail-badge" className="absolute top-1.5 right-1.5 z-10">
|
|
140
|
+
{badge}
|
|
141
|
+
</span>
|
|
142
|
+
)}
|
|
143
|
+
</span>
|
|
144
|
+
<span className="block w-full truncate text-xs text-secondary">{name}</span>
|
|
145
|
+
</button>
|
|
146
|
+
{menu != null && (
|
|
147
|
+
<span
|
|
148
|
+
data-slot="thumbnail-menu"
|
|
149
|
+
className={cn(
|
|
150
|
+
"absolute right-1.5 z-10 opacity-0 transition-opacity duration-100 group-hover/thumbnail:opacity-100 group-focus-within/thumbnail:opacity-100 focus-within:opacity-100",
|
|
151
|
+
badge != null ? "top-9" : "top-1.5",
|
|
152
|
+
)}
|
|
153
|
+
>
|
|
154
|
+
{menu}
|
|
155
|
+
</span>
|
|
156
|
+
)}
|
|
157
|
+
</div>
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export { Thumbnail };
|
|
162
|
+
export type { ThumbnailKind, ThumbnailProps };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { ToastProvider, ToastAction, ToastStack, toastVariants, useToast } from "./toast";
|
|
2
|
+
export type {
|
|
3
|
+
ToastProviderProps,
|
|
4
|
+
ToastStackProps,
|
|
5
|
+
ToastShown,
|
|
6
|
+
ToastSink,
|
|
7
|
+
ToastActionProps,
|
|
8
|
+
ToastData,
|
|
9
|
+
ToastInput,
|
|
10
|
+
ToastVariant,
|
|
11
|
+
ToastContextValue,
|
|
12
|
+
} from "./toast";
|