@bridgebrew/ui 0.0.0-stage → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +39 -2
- package/SOURCE.md +182 -0
- package/dist/build.js +871 -0
- package/dist/theme-css.js +896 -0
- package/dist/themes.js +69 -0
- package/dist/types/build/stylesheet.d.ts +31 -0
- package/dist/types/components/composite/command/command.d.ts +94 -0
- package/dist/types/components/composite/command/index.d.ts +2 -0
- package/dist/types/components/composite/draft-bar/draft-bar.d.ts +12 -0
- package/dist/types/components/composite/draft-bar/index.d.ts +2 -0
- package/dist/types/components/composite/image-field/image-field.d.ts +33 -0
- package/dist/types/components/composite/image-field/index.d.ts +2 -0
- package/dist/types/components/composite/list/index.d.ts +3 -0
- package/dist/types/components/composite/list/list-swipe.d.ts +28 -0
- package/dist/types/components/composite/list/list.d.ts +95 -0
- package/dist/types/components/composite/picker/index.d.ts +2 -0
- package/dist/types/components/composite/picker/picker.d.ts +44 -0
- package/dist/types/components/composite/prompt-field/index.d.ts +2 -0
- package/dist/types/components/composite/prompt-field/prompt-field.d.ts +18 -0
- package/dist/types/components/composite/properties/index.d.ts +2 -0
- package/dist/types/components/composite/properties/properties.d.ts +24 -0
- package/dist/types/components/composite/snooze-menu/index.d.ts +4 -0
- package/dist/types/components/composite/snooze-menu/presets.d.ts +36 -0
- package/dist/types/components/composite/snooze-menu/snooze-menu.d.ts +27 -0
- package/dist/types/components/composite/tag-input/index.d.ts +2 -0
- package/dist/types/components/composite/tag-input/tag-input.d.ts +22 -0
- package/dist/types/components/composite/wizard/index.d.ts +2 -0
- package/dist/types/components/composite/wizard/wizard.d.ts +53 -0
- package/dist/types/components/core/avatar/avatar.d.ts +16 -0
- package/dist/types/components/core/avatar/index.d.ts +2 -0
- package/dist/types/components/core/badge/badge.d.ts +8 -0
- package/dist/types/components/core/badge/index.d.ts +2 -0
- package/dist/types/components/core/breadcrumb/breadcrumb.d.ts +21 -0
- package/dist/types/components/core/breadcrumb/index.d.ts +2 -0
- package/dist/types/components/core/bullets/bullets.d.ts +15 -0
- package/dist/types/components/core/bullets/index.d.ts +2 -0
- package/dist/types/components/core/button/button.d.ts +14 -0
- package/dist/types/components/core/button/index.d.ts +2 -0
- package/dist/types/components/core/card/card.d.ts +16 -0
- package/dist/types/components/core/card/index.d.ts +2 -0
- package/dist/types/components/core/checkbox/checkbox.d.ts +15 -0
- package/dist/types/components/core/checkbox/index.d.ts +2 -0
- package/dist/types/components/core/cluster/cluster.d.ts +5 -0
- package/dist/types/components/core/cluster/index.d.ts +1 -0
- package/dist/types/components/core/code-block/code-block.d.ts +18 -0
- package/dist/types/components/core/code-block/index.d.ts +2 -0
- package/dist/types/components/core/collapsible/collapsible.d.ts +8 -0
- package/dist/types/components/core/collapsible/index.d.ts +1 -0
- package/dist/types/components/core/colour-picker/colour-picker.d.ts +25 -0
- package/dist/types/components/core/colour-picker/index.d.ts +4 -0
- package/dist/types/components/core/combobox/combobox.d.ts +63 -0
- package/dist/types/components/core/combobox/index.d.ts +2 -0
- package/dist/types/components/core/detail/detail.d.ts +12 -0
- package/dist/types/components/core/detail/index.d.ts +1 -0
- package/dist/types/components/core/dialog/dialog.d.ts +43 -0
- package/dist/types/components/core/dialog/drag.d.ts +4 -0
- package/dist/types/components/core/dialog/index.d.ts +2 -0
- package/dist/types/components/core/drop-zone/drop-zone.d.ts +23 -0
- package/dist/types/components/core/drop-zone/index.d.ts +2 -0
- package/dist/types/components/core/dropdown-menu/dropdown-menu.d.ts +78 -0
- package/dist/types/components/core/dropdown-menu/index.d.ts +2 -0
- package/dist/types/components/core/editable-field/editable-field.d.ts +42 -0
- package/dist/types/components/core/editable-field/index.d.ts +2 -0
- package/dist/types/components/core/empty-state/empty-state.d.ts +11 -0
- package/dist/types/components/core/empty-state/index.d.ts +2 -0
- package/dist/types/components/core/field/field.d.ts +31 -0
- package/dist/types/components/core/field/index.d.ts +2 -0
- package/dist/types/components/core/icon/icon-sets.d.ts +38 -0
- package/dist/types/components/core/icon/icon.d.ts +14 -0
- package/dist/types/components/core/icon/index.d.ts +2 -0
- package/dist/types/components/core/input/index.d.ts +4 -0
- package/dist/types/components/core/input/input.d.ts +22 -0
- package/dist/types/components/core/input/textarea.d.ts +8 -0
- package/dist/types/components/core/kbd/index.d.ts +2 -0
- package/dist/types/components/core/kbd/kbd.d.ts +7 -0
- package/dist/types/components/core/label/index.d.ts +2 -0
- package/dist/types/components/core/label/label.d.ts +13 -0
- package/dist/types/components/core/main-content/index.d.ts +2 -0
- package/dist/types/components/core/main-content/main-content.d.ts +18 -0
- package/dist/types/components/core/pane/index.d.ts +1 -0
- package/dist/types/components/core/pane/pane.d.ts +12 -0
- package/dist/types/components/core/pick-menu/index.d.ts +4 -0
- package/dist/types/components/core/pick-menu/pick-menu.d.ts +57 -0
- package/dist/types/components/core/pick-menu/tag-menu.d.ts +19 -0
- package/dist/types/components/core/popover/index.d.ts +2 -0
- package/dist/types/components/core/popover/popover.d.ts +22 -0
- package/dist/types/components/core/progress/index.d.ts +2 -0
- package/dist/types/components/core/progress/progress.d.ts +13 -0
- package/dist/types/components/core/resizable/index.d.ts +2 -0
- package/dist/types/components/core/resizable/resizable.d.ts +15 -0
- package/dist/types/components/core/resizable/use-remembered-layout.d.ts +31 -0
- package/dist/types/components/core/screen-link/index.d.ts +2 -0
- package/dist/types/components/core/screen-link/screen-link.d.ts +52 -0
- package/dist/types/components/core/scroll-area/index.d.ts +2 -0
- package/dist/types/components/core/scroll-area/scroll-area.d.ts +13 -0
- package/dist/types/components/core/scroll-area/steps.d.ts +5 -0
- package/dist/types/components/core/section/index.d.ts +2 -0
- package/dist/types/components/core/section/section.d.ts +16 -0
- package/dist/types/components/core/segment-group/index.d.ts +2 -0
- package/dist/types/components/core/segment-group/segment-group.d.ts +24 -0
- package/dist/types/components/core/select/index.d.ts +2 -0
- package/dist/types/components/core/select/select.d.ts +39 -0
- package/dist/types/components/core/skeleton/index.d.ts +2 -0
- package/dist/types/components/core/skeleton/skeleton.d.ts +13 -0
- package/dist/types/components/core/slider/index.d.ts +2 -0
- package/dist/types/components/core/slider/slider.d.ts +9 -0
- package/dist/types/components/core/sortable/index.d.ts +2 -0
- package/dist/types/components/core/sortable/sortable.d.ts +53 -0
- package/dist/types/components/core/split-view/index.d.ts +2 -0
- package/dist/types/components/core/split-view/split-view.d.ts +28 -0
- package/dist/types/components/core/status-icon/index.d.ts +2 -0
- package/dist/types/components/core/status-icon/status-icon.d.ts +13 -0
- package/dist/types/components/core/table/collapsible-rows.d.ts +7 -0
- package/dist/types/components/core/table/expand-toggle.d.ts +10 -0
- package/dist/types/components/core/table/group-header.d.ts +14 -0
- package/dist/types/components/core/table/index.d.ts +8 -0
- package/dist/types/components/core/table/table.d.ts +31 -0
- package/dist/types/components/core/tabs/index.d.ts +2 -0
- package/dist/types/components/core/tabs/tabs.d.ts +20 -0
- package/dist/types/components/core/tag-pill/index.d.ts +2 -0
- package/dist/types/components/core/tag-pill/tag-pill.d.ts +25 -0
- package/dist/types/components/core/thumbnail/index.d.ts +2 -0
- package/dist/types/components/core/thumbnail/thumbnail.d.ts +23 -0
- package/dist/types/components/core/toast/index.d.ts +2 -0
- package/dist/types/components/core/toast/toast.d.ts +88 -0
- package/dist/types/components/core/toggle/index.d.ts +2 -0
- package/dist/types/components/core/toggle/toggle.d.ts +9 -0
- package/dist/types/components/core/toggle-group/index.d.ts +2 -0
- package/dist/types/components/core/toggle-group/toggle-group.d.ts +21 -0
- package/dist/types/components/core/tooltip/index.d.ts +2 -0
- package/dist/types/components/core/tooltip/tooltip.d.ts +33 -0
- package/dist/types/components/layout/multi-pane/index.d.ts +4 -0
- package/dist/types/components/layout/multi-pane/list-detail.d.ts +17 -0
- package/dist/types/components/layout/multi-pane/multi-pane.d.ts +34 -0
- package/dist/types/components/layout/single-pane/index.d.ts +2 -0
- package/dist/types/components/layout/single-pane/single-pane.d.ts +11 -0
- package/dist/types/components/shell/app-shell/app-shell.d.ts +12 -0
- package/dist/types/components/shell/app-shell/index.d.ts +2 -0
- package/dist/types/components/shell/sidebar/index.d.ts +2 -0
- package/dist/types/components/shell/sidebar/sidebar-group.d.ts +45 -0
- package/dist/types/components/shell/sidebar/sidebar-item.d.ts +19 -0
- package/dist/types/components/shell/sidebar/sidebar-resize-handle.d.ts +17 -0
- package/dist/types/components/shell/sidebar/sidebar-tree.d.ts +42 -0
- package/dist/types/components/shell/sidebar/sidebar.d.ts +27 -0
- package/dist/types/components/template/address-book-template/address-book-template.d.ts +15 -0
- package/dist/types/components/template/address-book-template/index.d.ts +2 -0
- package/dist/types/components/template/mail-template/index.d.ts +2 -0
- package/dist/types/components/template/mail-template/mail-template.d.ts +11 -0
- package/dist/types/components/template/use-narrow.d.ts +3 -0
- package/dist/types/index.d.ts +149 -0
- package/dist/types/kit/check-rendering.d.ts +3 -0
- package/dist/types/kit/kit.d.ts +76 -0
- package/dist/types/lib/clipboard.d.ts +5 -0
- package/dist/types/lib/dates.d.ts +9 -0
- package/dist/types/lib/json.d.ts +26 -0
- package/dist/types/lib/keys.d.ts +15 -0
- package/dist/types/lib/utils.d.ts +2 -0
- package/dist/types/lib/view-scope.d.ts +22 -0
- package/dist/types/profile/profile.d.ts +34 -0
- package/dist/types/theme/appearance.d.ts +31 -0
- package/dist/types/theme/boot.d.ts +3 -0
- package/dist/types/theme/client-appearance-react.d.ts +3 -0
- package/dist/types/theme/client-appearance.d.ts +69 -0
- package/dist/types/theme/generate-tokens.d.ts +45 -0
- package/dist/types/theme/pack-themes-react.d.ts +24 -0
- package/dist/types/theme/palette.d.ts +111 -0
- package/dist/types/theme/semantic-mapping.d.ts +28 -0
- package/dist/types/theme/set-theme.d.ts +30 -0
- package/dist/types/theme/theme-colours.d.ts +14 -0
- package/dist/types/theme/theme-css.d.ts +3 -0
- package/dist/types/theme/themes.d.ts +63 -0
- package/dist/types/theme/wallpaper-sheet.d.ts +16 -0
- package/dist/types/theme/wallpaper-theme-react.d.ts +7 -0
- package/dist/types/theme/wallpaper-theme.d.ts +37 -0
- package/package.json +87 -3
- package/src/build/stylesheet.ts +128 -0
- package/src/components/composite/command/command.meta.yaml +74 -0
- package/src/components/composite/command/command.tsx +939 -0
- package/src/components/composite/command/index.ts +17 -0
- package/src/components/composite/draft-bar/draft-bar.meta.yaml +19 -0
- package/src/components/composite/draft-bar/draft-bar.tsx +57 -0
- package/src/components/composite/draft-bar/index.ts +2 -0
- package/src/components/composite/image-field/image-field.meta.yaml +69 -0
- package/src/components/composite/image-field/image-field.tsx +267 -0
- package/src/components/composite/image-field/index.ts +2 -0
- package/src/components/composite/list/index.ts +18 -0
- package/src/components/composite/list/list-swipe.tsx +163 -0
- package/src/components/composite/list/list.meta.yaml +238 -0
- package/src/components/composite/list/list.tsx +868 -0
- package/src/components/composite/picker/index.ts +2 -0
- package/src/components/composite/picker/picker.meta.yaml +103 -0
- package/src/components/composite/picker/picker.tsx +276 -0
- package/src/components/composite/prompt-field/index.ts +2 -0
- package/src/components/composite/prompt-field/prompt-field.meta.yaml +60 -0
- package/src/components/composite/prompt-field/prompt-field.tsx +81 -0
- package/src/components/composite/properties/index.ts +9 -0
- package/src/components/composite/properties/properties.meta.yaml +56 -0
- package/src/components/composite/properties/properties.tsx +132 -0
- package/src/components/composite/snooze-menu/index.ts +11 -0
- package/src/components/composite/snooze-menu/presets.ts +169 -0
- package/src/components/composite/snooze-menu/snooze-menu.meta.yaml +58 -0
- package/src/components/composite/snooze-menu/snooze-menu.tsx +146 -0
- package/src/components/composite/tag-input/index.ts +2 -0
- package/src/components/composite/tag-input/tag-input.meta.yaml +51 -0
- package/src/components/composite/tag-input/tag-input.tsx +404 -0
- package/src/components/composite/wizard/index.ts +2 -0
- package/src/components/composite/wizard/wizard.meta.yaml +73 -0
- package/src/components/composite/wizard/wizard.tsx +256 -0
- package/src/components/core/avatar/avatar.meta.yaml +71 -0
- package/src/components/core/avatar/avatar.tsx +92 -0
- package/src/components/core/avatar/index.ts +2 -0
- package/src/components/core/badge/badge.meta.yaml +34 -0
- package/src/components/core/badge/badge.tsx +23 -0
- package/src/components/core/badge/index.ts +2 -0
- package/src/components/core/breadcrumb/breadcrumb.meta.yaml +45 -0
- package/src/components/core/breadcrumb/breadcrumb.tsx +110 -0
- package/src/components/core/breadcrumb/index.ts +2 -0
- package/src/components/core/bullets/bullets.meta.yaml +37 -0
- package/src/components/core/bullets/bullets.tsx +60 -0
- package/src/components/core/bullets/index.ts +2 -0
- package/src/components/core/button/button.meta.yaml +91 -0
- package/src/components/core/button/button.tsx +93 -0
- package/src/components/core/button/index.ts +2 -0
- package/src/components/core/card/card.meta.yaml +94 -0
- package/src/components/core/card/card.tsx +54 -0
- package/src/components/core/card/index.ts +2 -0
- package/src/components/core/checkbox/checkbox.meta.yaml +59 -0
- package/src/components/core/checkbox/checkbox.tsx +106 -0
- package/src/components/core/checkbox/index.ts +2 -0
- package/src/components/core/cluster/cluster.meta.yaml +4 -0
- package/src/components/core/cluster/cluster.tsx +17 -0
- package/src/components/core/cluster/index.ts +1 -0
- package/src/components/core/code-block/code-block.meta.yaml +30 -0
- package/src/components/core/code-block/code-block.tsx +93 -0
- package/src/components/core/code-block/index.ts +2 -0
- package/src/components/core/collapsible/collapsible.meta.yaml +34 -0
- package/src/components/core/collapsible/collapsible.tsx +54 -0
- package/src/components/core/collapsible/index.ts +1 -0
- package/src/components/core/colour-picker/colour-picker.meta.yaml +52 -0
- package/src/components/core/colour-picker/colour-picker.tsx +314 -0
- package/src/components/core/colour-picker/index.ts +4 -0
- package/src/components/core/combobox/combobox.meta.yaml +75 -0
- package/src/components/core/combobox/combobox.tsx +288 -0
- package/src/components/core/combobox/index.ts +2 -0
- package/src/components/core/detail/detail.meta.yaml +13 -0
- package/src/components/core/detail/detail.tsx +73 -0
- package/src/components/core/detail/index.ts +1 -0
- package/src/components/core/dialog/dialog.meta.yaml +95 -0
- package/src/components/core/dialog/dialog.tsx +254 -0
- package/src/components/core/dialog/drag.ts +40 -0
- package/src/components/core/dialog/index.ts +25 -0
- package/src/components/core/drop-zone/drop-zone.meta.yaml +55 -0
- package/src/components/core/drop-zone/drop-zone.tsx +146 -0
- package/src/components/core/drop-zone/index.ts +2 -0
- package/src/components/core/dropdown-menu/dropdown-menu.meta.yaml +118 -0
- package/src/components/core/dropdown-menu/dropdown-menu.tsx +407 -0
- package/src/components/core/dropdown-menu/index.ts +32 -0
- package/src/components/core/editable-field/editable-field.meta.yaml +120 -0
- package/src/components/core/editable-field/editable-field.tsx +346 -0
- package/src/components/core/editable-field/index.ts +2 -0
- package/src/components/core/empty-state/empty-state.meta.yaml +21 -0
- package/src/components/core/empty-state/empty-state.tsx +42 -0
- package/src/components/core/empty-state/index.ts +2 -0
- package/src/components/core/field/field.meta.yaml +37 -0
- package/src/components/core/field/field.tsx +100 -0
- package/src/components/core/field/index.ts +9 -0
- package/src/components/core/icon/curated-names.json +107 -0
- package/src/components/core/icon/icon-sets.ts +109 -0
- package/src/components/core/icon/icon.meta.yaml +30 -0
- package/src/components/core/icon/icon.tsx +93 -0
- package/src/components/core/icon/index.ts +2 -0
- package/src/components/core/input/index.ts +4 -0
- package/src/components/core/input/input.meta.yaml +98 -0
- package/src/components/core/input/input.tsx +133 -0
- package/src/components/core/input/textarea.meta.yaml +79 -0
- package/src/components/core/input/textarea.tsx +63 -0
- package/src/components/core/kbd/index.ts +2 -0
- package/src/components/core/kbd/kbd.meta.yaml +12 -0
- package/src/components/core/kbd/kbd.tsx +29 -0
- package/src/components/core/label/index.ts +2 -0
- package/src/components/core/label/label.meta.yaml +55 -0
- package/src/components/core/label/label.tsx +72 -0
- package/src/components/core/main-content/index.ts +2 -0
- package/src/components/core/main-content/main-content.meta.yaml +23 -0
- package/src/components/core/main-content/main-content.tsx +49 -0
- package/src/components/core/pane/index.ts +1 -0
- package/src/components/core/pane/pane.meta.yaml +13 -0
- package/src/components/core/pane/pane.tsx +64 -0
- package/src/components/core/pick-menu/index.ts +4 -0
- package/src/components/core/pick-menu/pick-menu.meta.yaml +36 -0
- package/src/components/core/pick-menu/pick-menu.tsx +348 -0
- package/src/components/core/pick-menu/tag-menu.meta.yaml +7 -0
- package/src/components/core/pick-menu/tag-menu.tsx +79 -0
- package/src/components/core/popover/index.ts +2 -0
- package/src/components/core/popover/popover.meta.yaml +16 -0
- package/src/components/core/popover/popover.tsx +66 -0
- package/src/components/core/progress/index.ts +2 -0
- package/src/components/core/progress/progress.meta.yaml +47 -0
- package/src/components/core/progress/progress.tsx +56 -0
- package/src/components/core/resizable/index.ts +13 -0
- package/src/components/core/resizable/resizable.meta.yaml +110 -0
- package/src/components/core/resizable/resizable.tsx +125 -0
- package/src/components/core/resizable/use-remembered-layout.ts +261 -0
- package/src/components/core/screen-link/index.ts +2 -0
- package/src/components/core/screen-link/screen-link.meta.yaml +34 -0
- package/src/components/core/screen-link/screen-link.tsx +100 -0
- package/src/components/core/scroll-area/index.ts +2 -0
- package/src/components/core/scroll-area/scroll-area.meta.yaml +72 -0
- package/src/components/core/scroll-area/scroll-area.tsx +95 -0
- package/src/components/core/scroll-area/steps.tsx +72 -0
- package/src/components/core/section/index.ts +2 -0
- package/src/components/core/section/section.meta.yaml +72 -0
- package/src/components/core/section/section.tsx +93 -0
- package/src/components/core/segment-group/index.ts +2 -0
- package/src/components/core/segment-group/segment-group.meta.yaml +71 -0
- package/src/components/core/segment-group/segment-group.tsx +166 -0
- package/src/components/core/select/index.ts +20 -0
- package/src/components/core/select/select.meta.yaml +48 -0
- package/src/components/core/select/select.tsx +226 -0
- package/src/components/core/skeleton/index.ts +2 -0
- package/src/components/core/skeleton/skeleton.meta.yaml +50 -0
- package/src/components/core/skeleton/skeleton.tsx +71 -0
- package/src/components/core/slider/index.ts +2 -0
- package/src/components/core/slider/slider.meta.yaml +55 -0
- package/src/components/core/slider/slider.tsx +46 -0
- package/src/components/core/sortable/index.ts +16 -0
- package/src/components/core/sortable/sortable.meta.yaml +125 -0
- package/src/components/core/sortable/sortable.tsx +471 -0
- package/src/components/core/split-view/index.ts +2 -0
- package/src/components/core/split-view/split-view.meta.yaml +85 -0
- package/src/components/core/split-view/split-view.tsx +193 -0
- package/src/components/core/status-icon/index.ts +2 -0
- package/src/components/core/status-icon/status-icon.meta.yaml +64 -0
- package/src/components/core/status-icon/status-icon.tsx +94 -0
- package/src/components/core/table/collapsible-rows.tsx +30 -0
- package/src/components/core/table/expand-toggle.tsx +58 -0
- package/src/components/core/table/group-header.tsx +35 -0
- package/src/components/core/table/index.ts +26 -0
- package/src/components/core/table/table.meta.yaml +67 -0
- package/src/components/core/table/table.tsx +166 -0
- package/src/components/core/tabs/index.ts +2 -0
- package/src/components/core/tabs/tabs.meta.yaml +57 -0
- package/src/components/core/tabs/tabs.tsx +74 -0
- package/src/components/core/tag-pill/index.ts +2 -0
- package/src/components/core/tag-pill/tag-pill.meta.yaml +19 -0
- package/src/components/core/tag-pill/tag-pill.tsx +102 -0
- package/src/components/core/thumbnail/index.ts +2 -0
- package/src/components/core/thumbnail/thumbnail.meta.yaml +59 -0
- package/src/components/core/thumbnail/thumbnail.tsx +162 -0
- package/src/components/core/toast/index.ts +12 -0
- package/src/components/core/toast/toast.meta.yaml +93 -0
- package/src/components/core/toast/toast.tsx +763 -0
- package/src/components/core/toggle/index.ts +2 -0
- package/src/components/core/toggle/toggle.meta.yaml +53 -0
- package/src/components/core/toggle/toggle.tsx +44 -0
- package/src/components/core/toggle-group/index.ts +2 -0
- package/src/components/core/toggle-group/toggle-group.meta.yaml +59 -0
- package/src/components/core/toggle-group/toggle-group.tsx +68 -0
- package/src/components/core/tooltip/index.ts +7 -0
- package/src/components/core/tooltip/tooltip.meta.yaml +93 -0
- package/src/components/core/tooltip/tooltip.tsx +198 -0
- package/src/components/layout/multi-pane/index.ts +4 -0
- package/src/components/layout/multi-pane/list-detail.tsx +45 -0
- package/src/components/layout/multi-pane/multi-pane.meta.yaml +67 -0
- package/src/components/layout/multi-pane/multi-pane.tsx +158 -0
- package/src/components/layout/single-pane/index.ts +2 -0
- package/src/components/layout/single-pane/single-pane.meta.yaml +35 -0
- package/src/components/layout/single-pane/single-pane.tsx +48 -0
- package/src/components/shell/app-shell/app-shell.meta.yaml +65 -0
- package/src/components/shell/app-shell/app-shell.tsx +61 -0
- package/src/components/shell/app-shell/index.ts +2 -0
- package/src/components/shell/sidebar/index.ts +35 -0
- package/src/components/shell/sidebar/sidebar-group.tsx +254 -0
- package/src/components/shell/sidebar/sidebar-item.tsx +88 -0
- package/src/components/shell/sidebar/sidebar-resize-handle.tsx +101 -0
- package/src/components/shell/sidebar/sidebar-tree.tsx +325 -0
- package/src/components/shell/sidebar/sidebar.meta.yaml +126 -0
- package/src/components/shell/sidebar/sidebar.tsx +142 -0
- package/src/components/template/address-book-template/address-book-template.meta.yaml +22 -0
- package/src/components/template/address-book-template/address-book-template.tsx +201 -0
- package/src/components/template/address-book-template/index.ts +2 -0
- package/src/components/template/mail-template/index.ts +2 -0
- package/src/components/template/mail-template/mail-template.meta.yaml +22 -0
- package/src/components/template/mail-template/mail-template.tsx +731 -0
- package/src/components/template/use-narrow.ts +18 -0
- package/src/index.ts +505 -0
- package/src/kit/check-rendering.tsx +130 -0
- package/src/kit/kit.tsx +177 -0
- package/src/lib/clipboard.ts +27 -0
- package/src/lib/dates.ts +13 -0
- package/src/lib/json.ts +59 -0
- package/src/lib/keys.ts +54 -0
- package/src/lib/utils.ts +12 -0
- package/src/lib/view-scope.tsx +60 -0
- package/src/profile/profile.ts +238 -0
- package/src/theme/appearance.ts +198 -0
- package/src/theme/boot.ts +6 -0
- package/src/theme/client-appearance-react.ts +14 -0
- package/src/theme/client-appearance.ts +284 -0
- package/src/theme/generate-tokens.ts +658 -0
- package/src/theme/pack-themes-react.ts +107 -0
- package/src/theme/palette.ts +301 -0
- package/src/theme/semantic-mapping.ts +165 -0
- package/src/theme/set-theme.ts +162 -0
- package/src/theme/theme-colours.ts +60 -0
- package/src/theme/theme-css.ts +15 -0
- package/src/theme/themes.ts +133 -0
- package/src/theme/wallpaper-sheet.ts +58 -0
- package/src/theme/wallpaper-theme-react.ts +60 -0
- package/src/theme/wallpaper-theme.ts +231 -0
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
import { cn } from "../../../lib/utils";
|
|
4
|
+
import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from "../resizable";
|
|
5
|
+
import { useRememberedLayout, type PaneStart } from "../resizable/use-remembered-layout";
|
|
6
|
+
|
|
7
|
+
// shadcn's Resizable under Bridge's names (a list beside its record is MultiPane): SplitView the group, SplitPane a
|
|
8
|
+
// panel, SplitHandle the handle placed between two panes, as shadcn places it. Ours: `resizable={false}` renders the same
|
|
9
|
+
// panes at fixed sizes (a pane's defaultSize its flex basis, the panes without one sharing the rest), each SplitHandle a
|
|
10
|
+
// plain divider. A SplitPane may hold another SplitView, the other orientation, for a grid.
|
|
11
|
+
|
|
12
|
+
type Orientation = "horizontal" | "vertical";
|
|
13
|
+
const Split = React.createContext<{
|
|
14
|
+
orientation: Orientation;
|
|
15
|
+
resizable: boolean;
|
|
16
|
+
/** The edge's double-click: forget this workspace's kept sizes, the panes back to their `defaultSize` (only with a
|
|
17
|
+
* `storageKey`). */
|
|
18
|
+
forget?: () => void;
|
|
19
|
+
/** Each pane with a `defaultSize` puts its way back to it here. */
|
|
20
|
+
starts?: Map<string, PaneStart & { named: boolean }>;
|
|
21
|
+
}>({
|
|
22
|
+
orientation: "horizontal",
|
|
23
|
+
resizable: true,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
interface SplitViewProps extends React.ComponentProps<"div"> {
|
|
27
|
+
/** `horizontal`: the panes side by side; `vertical`: one above the other (shadcn's `orientation`). */
|
|
28
|
+
orientation?: Orientation;
|
|
29
|
+
/** Its handles drag (default); off, the sizes stay as given and the handles are dividers. */
|
|
30
|
+
resizable?: boolean;
|
|
31
|
+
/** `<plugin>/<screen>/<split>@v<n>`: the sizes a user dragged, kept per workspace in their profile (research-049). */
|
|
32
|
+
storageKey?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function SplitView({
|
|
36
|
+
orientation = "horizontal",
|
|
37
|
+
resizable = true,
|
|
38
|
+
storageKey,
|
|
39
|
+
className,
|
|
40
|
+
children,
|
|
41
|
+
...props
|
|
42
|
+
}: SplitViewProps) {
|
|
43
|
+
const [starts] = React.useState(() => new Map<string, PaneStart & { named: boolean }>());
|
|
44
|
+
const remembered = useRememberedLayout(
|
|
45
|
+
resizable ? storageKey : undefined,
|
|
46
|
+
() => [...starts.values()],
|
|
47
|
+
orientation,
|
|
48
|
+
// A generated id changes at a remount: sizes are kept only for panes the caller named.
|
|
49
|
+
() => [...starts.values()].every(({ named }) => named),
|
|
50
|
+
);
|
|
51
|
+
const remembers = resizable && storageKey !== undefined;
|
|
52
|
+
const split = React.useMemo(
|
|
53
|
+
() => ({
|
|
54
|
+
orientation,
|
|
55
|
+
resizable,
|
|
56
|
+
starts,
|
|
57
|
+
...(remembers && { forget: remembered.forget }),
|
|
58
|
+
}),
|
|
59
|
+
[orientation, resizable, starts, remembers, remembered.forget],
|
|
60
|
+
);
|
|
61
|
+
return (
|
|
62
|
+
<Split.Provider value={split}>
|
|
63
|
+
<div
|
|
64
|
+
data-slot="split-view"
|
|
65
|
+
data-orientation={orientation}
|
|
66
|
+
className={cn(
|
|
67
|
+
"flex min-h-0 min-w-0 flex-1",
|
|
68
|
+
!resizable && orientation === "vertical" && "flex-col",
|
|
69
|
+
className,
|
|
70
|
+
)}
|
|
71
|
+
{...props}
|
|
72
|
+
>
|
|
73
|
+
{resizable ? (
|
|
74
|
+
<ResizablePanelGroup
|
|
75
|
+
orientation={orientation}
|
|
76
|
+
{...(remembered.defaultLayout !== undefined && {
|
|
77
|
+
defaultLayout: remembered.defaultLayout,
|
|
78
|
+
})}
|
|
79
|
+
groupRef={remembered.groupRef}
|
|
80
|
+
elementRef={remembered.elementRef}
|
|
81
|
+
onLayoutChange={remembered.onLayoutChange}
|
|
82
|
+
onLayoutChanged={remembered.onLayoutChanged}
|
|
83
|
+
className="min-h-0 flex-1"
|
|
84
|
+
>
|
|
85
|
+
{children}
|
|
86
|
+
</ResizablePanelGroup>
|
|
87
|
+
) : (
|
|
88
|
+
children
|
|
89
|
+
)}
|
|
90
|
+
</div>
|
|
91
|
+
</Split.Provider>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
interface SplitPaneProps extends React.ComponentProps<"div"> {
|
|
96
|
+
/** Its size at first: `"25%"`, `"240px"`; none: a share of what the sized panes leave. */
|
|
97
|
+
defaultSize?: string;
|
|
98
|
+
/** Its least size, the same units. */
|
|
99
|
+
minSize?: string;
|
|
100
|
+
/** Its greatest size, the same units. */
|
|
101
|
+
maxSize?: string;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function SplitPane({
|
|
105
|
+
defaultSize,
|
|
106
|
+
minSize,
|
|
107
|
+
maxSize,
|
|
108
|
+
id,
|
|
109
|
+
className,
|
|
110
|
+
style,
|
|
111
|
+
children,
|
|
112
|
+
...props
|
|
113
|
+
}: SplitPaneProps) {
|
|
114
|
+
const { orientation, resizable, starts } = React.useContext(Split);
|
|
115
|
+
const ownId = React.useId();
|
|
116
|
+
const paneId = id ?? ownId;
|
|
117
|
+
// Its way back to its starting size, for a double-click on a handle or a reset in another tab.
|
|
118
|
+
// Registered once, in the panes' order (the library's constraints follow it); its size updated in place.
|
|
119
|
+
React.useEffect(() => {
|
|
120
|
+
if (!resizable || !starts) return;
|
|
121
|
+
starts.set(paneId, { id: paneId, named: id !== undefined });
|
|
122
|
+
return () => void starts.delete(paneId);
|
|
123
|
+
}, [resizable, starts, paneId, id]);
|
|
124
|
+
React.useEffect(() => {
|
|
125
|
+
const start = starts?.get(paneId);
|
|
126
|
+
if (start) start.size = defaultSize;
|
|
127
|
+
}, [starts, paneId, defaultSize, resizable, id]);
|
|
128
|
+
const classes = cn("relative min-h-0 min-w-0 overflow-hidden", className);
|
|
129
|
+
if (resizable)
|
|
130
|
+
return (
|
|
131
|
+
<ResizablePanel
|
|
132
|
+
id={paneId}
|
|
133
|
+
{...(defaultSize !== undefined && { defaultSize })}
|
|
134
|
+
{...(minSize !== undefined && { minSize })}
|
|
135
|
+
{...(maxSize !== undefined && { maxSize })}
|
|
136
|
+
className={classes}
|
|
137
|
+
>
|
|
138
|
+
<div data-slot="split-pane" className="h-full min-h-0 min-w-0" style={style} {...props}>
|
|
139
|
+
{children}
|
|
140
|
+
</div>
|
|
141
|
+
</ResizablePanel>
|
|
142
|
+
);
|
|
143
|
+
const across = orientation === "horizontal";
|
|
144
|
+
return (
|
|
145
|
+
<div
|
|
146
|
+
data-slot="split-pane"
|
|
147
|
+
{...(id !== undefined && { id })}
|
|
148
|
+
className={classes}
|
|
149
|
+
style={{
|
|
150
|
+
flex: defaultSize === undefined ? "1 1 0" : `0 0 ${defaultSize}`,
|
|
151
|
+
...(minSize !== undefined && { [across ? "minWidth" : "minHeight"]: minSize }),
|
|
152
|
+
...(maxSize !== undefined && { [across ? "maxWidth" : "maxHeight"]: maxSize }),
|
|
153
|
+
...style,
|
|
154
|
+
}}
|
|
155
|
+
{...props}
|
|
156
|
+
>
|
|
157
|
+
{children}
|
|
158
|
+
</div>
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
interface SplitHandleProps {
|
|
163
|
+
/** A visible grip on the handle (shadcn's `withHandle`); a fixed view's divider has none. */
|
|
164
|
+
withHandle?: boolean;
|
|
165
|
+
className?: string;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function SplitHandle({ withHandle = false, className }: SplitHandleProps) {
|
|
169
|
+
const { orientation, resizable, forget } = React.useContext(Split);
|
|
170
|
+
if (resizable)
|
|
171
|
+
return (
|
|
172
|
+
<ResizableHandle
|
|
173
|
+
withHandle={withHandle}
|
|
174
|
+
className={className}
|
|
175
|
+
{...(forget !== undefined && { onDoubleClick: forget })}
|
|
176
|
+
/>
|
|
177
|
+
);
|
|
178
|
+
return (
|
|
179
|
+
<div
|
|
180
|
+
role="separator"
|
|
181
|
+
aria-orientation={orientation === "horizontal" ? "vertical" : "horizontal"}
|
|
182
|
+
data-slot="split-divider"
|
|
183
|
+
className={cn(
|
|
184
|
+
"shrink-0 bg-border",
|
|
185
|
+
orientation === "horizontal" ? "w-px" : "h-px",
|
|
186
|
+
className,
|
|
187
|
+
)}
|
|
188
|
+
/>
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export { SplitView, SplitPane, SplitHandle };
|
|
193
|
+
export type { SplitViewProps, SplitPaneProps, SplitHandleProps };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
name: StatusIcon
|
|
2
|
+
description: "Status indicator (a problem's states carry a sign: ! or ✓; a bare dot without a sign is drawn as a ring with a dot inside, never a full disc) rendered as styled circles. Supports 6 predefined workflow states."
|
|
3
|
+
layer: core
|
|
4
|
+
category: data-display
|
|
5
|
+
when_to_use:
|
|
6
|
+
- "For displaying issue/task workflow status (backlog, todo, in-progress, etc.)"
|
|
7
|
+
- "For status columns in tables and list views"
|
|
8
|
+
- "For compact status representation alongside text"
|
|
9
|
+
when_not_to_use:
|
|
10
|
+
- "For colored category tags — use Label component"
|
|
11
|
+
- "For numeric indicators — use Badge component"
|
|
12
|
+
- "For custom status values not in the predefined set — extend the component first"
|
|
13
|
+
- "For a binary complete/incomplete toggle — use Checkbox alone. StatusIcon earns its place only when there are ≥3 real workflow states (backlog/in-progress/in-review/…)."
|
|
14
|
+
composition_partners:
|
|
15
|
+
- Table (in status columns)
|
|
16
|
+
- Properties (as value display)
|
|
17
|
+
- SidebarItem (as icon slot)
|
|
18
|
+
props:
|
|
19
|
+
- name: status
|
|
20
|
+
type: "'backlog' | 'todo' | 'in-progress' | 'in-review' | 'done' | 'cancelled' | 'error' | 'warning' | 'resolved'"
|
|
21
|
+
required: true
|
|
22
|
+
description: "Workflow state determining the visual style; error, warning and resolved are a problem's (Health)"
|
|
23
|
+
- name: size
|
|
24
|
+
type: "'sm' | 'default'"
|
|
25
|
+
required: false
|
|
26
|
+
default: "'default'"
|
|
27
|
+
description: "Icon size — sm (12px) or default (14px)"
|
|
28
|
+
- name: aria-label
|
|
29
|
+
type: string
|
|
30
|
+
required: false
|
|
31
|
+
description: "Accessible label describing the status"
|
|
32
|
+
props_priority:
|
|
33
|
+
- status
|
|
34
|
+
- size
|
|
35
|
+
variants:
|
|
36
|
+
- backlog: "Dashed circle outline — work not yet planned"
|
|
37
|
+
- todo: "Solid circle outline — planned but not started"
|
|
38
|
+
- in-progress: "Half-filled circle with accent color — actively being worked on"
|
|
39
|
+
- in-review: "Three-quarter filled circle — pending review"
|
|
40
|
+
- done: "Fully filled circle with accent color — completed"
|
|
41
|
+
- cancelled: "Crossed-out circle — cancelled or won't do"
|
|
42
|
+
- error: "Full destructive disc with a ! inside: an open error"
|
|
43
|
+
- warning: "Full warning disc with a ! inside: an open warning"
|
|
44
|
+
- resolved: "Full success disc with a check inside: a problem resolved"
|
|
45
|
+
sizes:
|
|
46
|
+
- sm: "12px circle"
|
|
47
|
+
- default: "14px circle"
|
|
48
|
+
examples:
|
|
49
|
+
- title: "In-progress status"
|
|
50
|
+
code: '<StatusIcon status="in-progress" />'
|
|
51
|
+
- title: "Done status with label"
|
|
52
|
+
code: |
|
|
53
|
+
<span className="flex items-center gap-2">
|
|
54
|
+
<StatusIcon status="done" />
|
|
55
|
+
Done
|
|
56
|
+
</span>
|
|
57
|
+
- title: "Small status in table"
|
|
58
|
+
code: '<StatusIcon status="todo" size="sm" />'
|
|
59
|
+
anti_patterns:
|
|
60
|
+
- "Don't pass status values not in the predefined set — they will render as empty"
|
|
61
|
+
- "Don't override the circle dimensions via className — use the size prop"
|
|
62
|
+
- "Don't use StatusIcon for non-workflow status — it's specifically designed for issue tracking states"
|
|
63
|
+
- "Don't pair StatusIcon (done/todo) with a Checkbox to express the same completion state — they duplicate one boolean. Either drive completion with the Checkbox and drop the icon, or use StatusIcon for a richer multi-state workflow and drop the checkbox."
|
|
64
|
+
accessibility_notes: "Renders as a <span> with aria-label. The visual status is CSS-only (borders, backgrounds), so always provide aria-label for screen reader users."
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
+
|
|
4
|
+
import { cn } from "../../../lib/utils";
|
|
5
|
+
|
|
6
|
+
type Status =
|
|
7
|
+
| "backlog"
|
|
8
|
+
| "todo"
|
|
9
|
+
| "in-progress"
|
|
10
|
+
| "in-review"
|
|
11
|
+
| "done"
|
|
12
|
+
| "cancelled"
|
|
13
|
+
| "error"
|
|
14
|
+
| "warning"
|
|
15
|
+
| "resolved";
|
|
16
|
+
|
|
17
|
+
const statusIconVariants = cva("inline-block shrink-0 rounded-full", {
|
|
18
|
+
variants: {
|
|
19
|
+
status: {
|
|
20
|
+
backlog: "border-[1.5px] border-dashed border-muted",
|
|
21
|
+
todo: "border-[1.5px] border-muted",
|
|
22
|
+
"in-progress":
|
|
23
|
+
"border-2 border-warning relative overflow-hidden after:absolute after:inset-y-0 after:left-0 after:right-1/2 after:bg-warning",
|
|
24
|
+
"in-review":
|
|
25
|
+
"border-2 border-accent relative overflow-hidden after:absolute after:inset-y-0 after:left-0 after:right-1/2 after:bg-accent",
|
|
26
|
+
done: "border-2 border-accent bg-accent",
|
|
27
|
+
cancelled: "border-2 border-muted bg-muted",
|
|
28
|
+
// A problem (Health): open as an error or a warning, or resolved.
|
|
29
|
+
// A problem's states (Health): a full disc with its sign inside (owner, 21 October 2026). A status shown as a bare
|
|
30
|
+
// dot, with no sign, is a ring with a dot inside it and a gap between instead, never a full disc.
|
|
31
|
+
error: "bg-destructive text-background inline-flex items-center justify-center",
|
|
32
|
+
warning: "bg-warning text-background inline-flex items-center justify-center",
|
|
33
|
+
resolved: "bg-success text-background inline-flex items-center justify-center",
|
|
34
|
+
},
|
|
35
|
+
size: {
|
|
36
|
+
sm: "size-3",
|
|
37
|
+
default: "size-3.5",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
defaultVariants: {
|
|
41
|
+
size: "default",
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
/** The sign inside a problem's disc: ! for an open error or warning, ✓ once resolved (strokes in the disc's text colour). */
|
|
46
|
+
const sign = (path: string) => (
|
|
47
|
+
<svg
|
|
48
|
+
viewBox="0 0 12 12"
|
|
49
|
+
className="size-[70%]"
|
|
50
|
+
fill="none"
|
|
51
|
+
stroke="currentColor"
|
|
52
|
+
strokeWidth={2}
|
|
53
|
+
strokeLinecap="round"
|
|
54
|
+
strokeLinejoin="round"
|
|
55
|
+
aria-hidden
|
|
56
|
+
>
|
|
57
|
+
<path d={path} />
|
|
58
|
+
</svg>
|
|
59
|
+
);
|
|
60
|
+
const signs: Partial<Record<Status, React.ReactNode>> = {
|
|
61
|
+
error: sign("M6 3.2v3.4M6 8.8v.01"),
|
|
62
|
+
warning: sign("M6 3.2v3.4M6 8.8v.01"),
|
|
63
|
+
resolved: sign("M3.4 6.2l1.8 1.8 3.4-3.6"),
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
interface StatusIconProps
|
|
67
|
+
extends
|
|
68
|
+
Omit<React.ComponentProps<"span">, "children">,
|
|
69
|
+
Omit<VariantProps<typeof statusIconVariants>, "status"> {
|
|
70
|
+
status: Status;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function StatusIcon({
|
|
74
|
+
className,
|
|
75
|
+
status,
|
|
76
|
+
size,
|
|
77
|
+
"aria-label": ariaLabel,
|
|
78
|
+
...props
|
|
79
|
+
}: StatusIconProps) {
|
|
80
|
+
return (
|
|
81
|
+
<span
|
|
82
|
+
role="img"
|
|
83
|
+
aria-label={ariaLabel ?? status.replace(/-/g, " ")}
|
|
84
|
+
data-slot="status-icon"
|
|
85
|
+
className={cn(statusIconVariants({ status, size, className }))}
|
|
86
|
+
{...props}
|
|
87
|
+
>
|
|
88
|
+
{signs[status]}
|
|
89
|
+
</span>
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export { StatusIcon, statusIconVariants };
|
|
94
|
+
export type { Status as StatusIconStatus, StatusIconProps };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
import { cn } from "../../../lib/utils";
|
|
4
|
+
|
|
5
|
+
interface CollapsibleRowsProps extends React.ComponentProps<"div"> {
|
|
6
|
+
expanded: boolean;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function CollapsibleRows({ className, expanded, children, ...props }: CollapsibleRowsProps) {
|
|
10
|
+
return (
|
|
11
|
+
<div
|
|
12
|
+
role="presentation"
|
|
13
|
+
data-slot="collapsible-rows"
|
|
14
|
+
data-state={expanded ? "open" : "closed"}
|
|
15
|
+
className={cn(
|
|
16
|
+
"grid transition-[grid-template-rows] duration-200 ease-out",
|
|
17
|
+
expanded ? "grid-rows-[1fr]" : "grid-rows-[0fr]",
|
|
18
|
+
className,
|
|
19
|
+
)}
|
|
20
|
+
{...props}
|
|
21
|
+
>
|
|
22
|
+
<div role="presentation" className="overflow-hidden min-h-0">
|
|
23
|
+
{children}
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { CollapsibleRows };
|
|
30
|
+
export type { CollapsibleRowsProps };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
+
|
|
4
|
+
import { cn } from "../../../lib/utils";
|
|
5
|
+
|
|
6
|
+
const expandToggleVariants = cva(
|
|
7
|
+
"size-4 flex items-center justify-center border-0 bg-transparent cursor-pointer text-muted rounded-[3px] p-0 shrink-0 transition-all duration-150 hover:bg-active hover:text-foreground",
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
interface ExpandToggleProps
|
|
11
|
+
extends
|
|
12
|
+
Omit<React.ComponentProps<"button">, "children">,
|
|
13
|
+
VariantProps<typeof expandToggleVariants> {
|
|
14
|
+
expanded: boolean;
|
|
15
|
+
onExpandedChange: (expanded: boolean) => void;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function ExpandToggle({
|
|
19
|
+
className,
|
|
20
|
+
expanded,
|
|
21
|
+
onExpandedChange,
|
|
22
|
+
onClick,
|
|
23
|
+
...props
|
|
24
|
+
}: ExpandToggleProps) {
|
|
25
|
+
return (
|
|
26
|
+
<button
|
|
27
|
+
type="button"
|
|
28
|
+
data-slot="expand-toggle"
|
|
29
|
+
data-state={expanded ? "open" : "closed"}
|
|
30
|
+
aria-expanded={expanded}
|
|
31
|
+
aria-label={expanded ? "Collapse" : "Expand"}
|
|
32
|
+
className={cn(expandToggleVariants({ className }))}
|
|
33
|
+
{...props}
|
|
34
|
+
onClick={(e) => {
|
|
35
|
+
e.stopPropagation();
|
|
36
|
+
onExpandedChange(!expanded);
|
|
37
|
+
onClick?.(e);
|
|
38
|
+
}}
|
|
39
|
+
>
|
|
40
|
+
<svg
|
|
41
|
+
className={cn(
|
|
42
|
+
"size-3 transition-transform duration-150 ease-out",
|
|
43
|
+
!expanded && "-rotate-90",
|
|
44
|
+
)}
|
|
45
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
46
|
+
viewBox="0 0 24 24"
|
|
47
|
+
fill="none"
|
|
48
|
+
stroke="currentColor"
|
|
49
|
+
strokeWidth="2.5"
|
|
50
|
+
>
|
|
51
|
+
<path d="m6 9 6 6 6-6" />
|
|
52
|
+
</svg>
|
|
53
|
+
</button>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export { ExpandToggle, expandToggleVariants };
|
|
58
|
+
export type { ExpandToggleProps };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
+
|
|
4
|
+
import { cn } from "../../../lib/utils";
|
|
5
|
+
|
|
6
|
+
const groupHeaderVariants = cva(
|
|
7
|
+
"flex items-center gap-1.5 px-4 pt-3.5 pb-1.5 text-sm font-semibold text-foreground bg-hover sticky top-0 z-10",
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
interface GroupHeaderProps
|
|
11
|
+
extends Omit<React.ComponentProps<"div">, "children">, VariantProps<typeof groupHeaderVariants> {
|
|
12
|
+
/** Status icon or any ReactNode to display before the label */
|
|
13
|
+
icon?: React.ReactNode;
|
|
14
|
+
/** Group label text (e.g., "In Progress") */
|
|
15
|
+
label: string;
|
|
16
|
+
/** Item count — omit to hide count entirely */
|
|
17
|
+
count?: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function GroupHeader({ className, icon, label, count, ...props }: GroupHeaderProps) {
|
|
21
|
+
return (
|
|
22
|
+
<div data-slot="group-header" className={cn(groupHeaderVariants({ className }))} {...props}>
|
|
23
|
+
{icon}
|
|
24
|
+
<span data-slot="group-header-label">{label}</span>
|
|
25
|
+
{count !== undefined && (
|
|
26
|
+
<span data-slot="group-header-count" className="text-muted font-normal">
|
|
27
|
+
{count}
|
|
28
|
+
</span>
|
|
29
|
+
)}
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export { GroupHeader, groupHeaderVariants };
|
|
35
|
+
export type { GroupHeaderProps };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export {
|
|
2
|
+
Table,
|
|
3
|
+
tableVariants,
|
|
4
|
+
TableHeader,
|
|
5
|
+
TableBody,
|
|
6
|
+
TableFooter,
|
|
7
|
+
TableRow,
|
|
8
|
+
tableRowVariants,
|
|
9
|
+
TableHead,
|
|
10
|
+
TableCell,
|
|
11
|
+
} from "./table";
|
|
12
|
+
export type {
|
|
13
|
+
TableProps,
|
|
14
|
+
TableHeaderProps,
|
|
15
|
+
TableBodyProps,
|
|
16
|
+
TableFooterProps,
|
|
17
|
+
TableRowProps,
|
|
18
|
+
TableHeadProps,
|
|
19
|
+
TableCellProps,
|
|
20
|
+
} from "./table";
|
|
21
|
+
export { ExpandToggle, expandToggleVariants } from "./expand-toggle";
|
|
22
|
+
export type { ExpandToggleProps } from "./expand-toggle";
|
|
23
|
+
export { GroupHeader, groupHeaderVariants } from "./group-header";
|
|
24
|
+
export type { GroupHeaderProps } from "./group-header";
|
|
25
|
+
export { CollapsibleRows } from "./collapsible-rows";
|
|
26
|
+
export type { CollapsibleRowsProps } from "./collapsible-rows";
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
name: Table
|
|
2
|
+
description: "CSS Grid-based data table with column definitions, expandable rows, collapsible groups, and sticky headers."
|
|
3
|
+
layer: core
|
|
4
|
+
category: data-display
|
|
5
|
+
when_to_use:
|
|
6
|
+
- "For displaying structured data in rows and columns"
|
|
7
|
+
- "For issue lists, user tables, or any tabular data"
|
|
8
|
+
- "For tables with expandable/collapsible row groups"
|
|
9
|
+
when_not_to_use:
|
|
10
|
+
- "For key-value detail views — use Properties component"
|
|
11
|
+
- "For simple lists without columns — use a plain list"
|
|
12
|
+
- "For card-based layouts — use a grid of cards"
|
|
13
|
+
composition_partners:
|
|
14
|
+
- StatusIcon (in status columns)
|
|
15
|
+
- Avatar (in user columns)
|
|
16
|
+
- Label (in category columns)
|
|
17
|
+
- Badge (in count columns)
|
|
18
|
+
- DropdownMenu (for row actions)
|
|
19
|
+
- CollapsibleRows (for expandable groups)
|
|
20
|
+
- GroupHeader (for section headers)
|
|
21
|
+
props:
|
|
22
|
+
- name: columns
|
|
23
|
+
type: string
|
|
24
|
+
required: false
|
|
25
|
+
description: "CSS grid-template-columns value (e.g. 'auto 1fr 120px'). Inherited by all TableRow children via context."
|
|
26
|
+
- name: size
|
|
27
|
+
type: "'default' | 'sm'"
|
|
28
|
+
required: false
|
|
29
|
+
default: "'default'"
|
|
30
|
+
description: "Row height variant — 'default' (40px) or 'sm' (36px). Applies to TableRow sub-component."
|
|
31
|
+
props_priority:
|
|
32
|
+
- columns
|
|
33
|
+
- size
|
|
34
|
+
examples:
|
|
35
|
+
- title: "Basic table"
|
|
36
|
+
code: |
|
|
37
|
+
<Table columns="1fr 200px 100px">
|
|
38
|
+
<TableHeader>
|
|
39
|
+
<TableRow>
|
|
40
|
+
<TableHead>Name</TableHead>
|
|
41
|
+
<TableHead>Status</TableHead>
|
|
42
|
+
<TableHead>Priority</TableHead>
|
|
43
|
+
</TableRow>
|
|
44
|
+
</TableHeader>
|
|
45
|
+
<TableBody>
|
|
46
|
+
<TableRow>
|
|
47
|
+
<TableCell>Fix login bug</TableCell>
|
|
48
|
+
<TableCell><StatusIcon status="in-progress" /></TableCell>
|
|
49
|
+
<TableCell>High</TableCell>
|
|
50
|
+
</TableRow>
|
|
51
|
+
</TableBody>
|
|
52
|
+
</Table>
|
|
53
|
+
- title: "Compact table rows"
|
|
54
|
+
code: |
|
|
55
|
+
<TableRow size="sm">
|
|
56
|
+
<TableCell>Compact row content</TableCell>
|
|
57
|
+
</TableRow>
|
|
58
|
+
anti_patterns:
|
|
59
|
+
- "Don't use HTML <table> elements — Table uses CSS Grid via div[role='table']"
|
|
60
|
+
- "Don't set grid-template-columns on individual rows — use the columns prop on Table root for consistency"
|
|
61
|
+
- "Don't nest tables — use CollapsibleRows for expandable content"
|
|
62
|
+
- "Don't forget TableHeader + TableBody structure — they provide proper row group semantics"
|
|
63
|
+
accessibility_notes: "Uses role='table', role='rowgroup', role='row', role='columnheader', role='cell' for full table semantics. Keyboard navigation relies on interactive content within cells."
|
|
64
|
+
notes: "Sub-components: Table, TableHeader, TableBody, TableFooter, TableRow (with size variant), TableHead, TableCell. TableRow size variants: 'default' (40px) and 'sm' (36px). Columns are passed via React Context from Table to all TableRow descendants."
|
|
65
|
+
related_patterns:
|
|
66
|
+
- list-view
|
|
67
|
+
- crud-page
|