@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,109 @@
|
|
|
1
|
+
// Icon sets (Bridge addition): `Icon` draws its names from the chosen set, a choice of its own beside the
|
|
2
|
+
// kit's rendering and the theme. Lucide is the kit's own and the default; any other set comes from a plugin,
|
|
3
|
+
// which registers it (`registerIconSet`, usually in a `_host` plugin so that it is on every page). The
|
|
4
|
+
// choice is `<html data-icons>`, set before the first mount by the boot kernel and live by `setIconSet`.
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
|
|
7
|
+
/** One icon as SVG data: its `viewBox`, and paths each with its fill ("currentColor" for the text colour). */
|
|
8
|
+
export interface IconData {
|
|
9
|
+
viewBox: string;
|
|
10
|
+
paths: readonly (readonly [fill: string, d: string])[];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface IconSet {
|
|
14
|
+
/** Lowercase letters, digits and dashes; "lucide" is the kit's own. */
|
|
15
|
+
id: string;
|
|
16
|
+
label: string;
|
|
17
|
+
/** By `Icon` name; a name the set lacks is drawn by Lucide. */
|
|
18
|
+
icons: Readonly<Record<string, IconData>>;
|
|
19
|
+
/** Pixel art: drawn with crisp edges. */
|
|
20
|
+
pixelated?: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** Where the page keeps the chosen set; the boot kernel reads it before the first mount. */
|
|
24
|
+
export const ICON_SET_STORAGE_KEY = "bridge.icons";
|
|
25
|
+
export const DEFAULT_ICON_SET = "lucide";
|
|
26
|
+
const ID = /^[a-z0-9-]+$/;
|
|
27
|
+
|
|
28
|
+
let sets: readonly IconSet[] = [];
|
|
29
|
+
const listeners = new Set<() => void>();
|
|
30
|
+
const notify = () => listeners.forEach((listener) => listener());
|
|
31
|
+
/** Told only when a set comes or goes (`theme/appearance.ts` follows which ids exist). */
|
|
32
|
+
const registry = new Set<() => void>();
|
|
33
|
+
const changed = () => {
|
|
34
|
+
notify();
|
|
35
|
+
registry.forEach((listener) => listener());
|
|
36
|
+
};
|
|
37
|
+
/** The registered sets' ids. */
|
|
38
|
+
export const iconSetIds = () => sets.map((s) => s.id);
|
|
39
|
+
/** Calls `listener` each time a set is registered or removed, until the returned function. */
|
|
40
|
+
export function onIconSetsChange(listener: () => void): () => void {
|
|
41
|
+
registry.add(listener);
|
|
42
|
+
return () => {
|
|
43
|
+
registry.delete(listener);
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Registers a set, until the returned function removes it. Throws on a bad or taken id. */
|
|
48
|
+
export function registerIconSet(set: IconSet): () => void {
|
|
49
|
+
if (!ID.test(set.id) || set.id === DEFAULT_ICON_SET)
|
|
50
|
+
throw new Error(
|
|
51
|
+
`icon set id "${set.id}": lowercase letters, digits and dashes, not "${DEFAULT_ICON_SET}"`,
|
|
52
|
+
);
|
|
53
|
+
if (sets.some((s) => s.id === set.id))
|
|
54
|
+
throw new Error(`icon set "${set.id}" is already registered`);
|
|
55
|
+
sets = [...sets, set];
|
|
56
|
+
changed();
|
|
57
|
+
return () => {
|
|
58
|
+
sets = sets.filter((s) => s !== set);
|
|
59
|
+
changed();
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** The chosen set's id (`<html data-icons>`), registered or not yet; "lucide" when none. */
|
|
64
|
+
export function getIconSet(): string {
|
|
65
|
+
const id = document.documentElement.dataset.icons;
|
|
66
|
+
return id && ID.test(id) ? id : DEFAULT_ICON_SET;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** Shows a set without remembering it (the Bridge default, `theme/appearance.ts`). */
|
|
70
|
+
export function applyIconSet(id: string): void {
|
|
71
|
+
if (!ID.test(id)) throw new Error(`icon set id "${id}": lowercase letters, digits and dashes`);
|
|
72
|
+
const root = document.documentElement;
|
|
73
|
+
if (id === DEFAULT_ICON_SET) delete root.dataset.icons;
|
|
74
|
+
else root.dataset.icons = id;
|
|
75
|
+
notify();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** Chooses a set for this browser and remembers it, "lucide" included: it overrides the Bridge default. A storage
|
|
79
|
+
* failure leaves it chosen for this page only. */
|
|
80
|
+
export function setIconSet(id: string): void {
|
|
81
|
+
applyIconSet(id);
|
|
82
|
+
try {
|
|
83
|
+
localStorage.setItem(ICON_SET_STORAGE_KEY, id);
|
|
84
|
+
} catch {
|
|
85
|
+
// Storage blocked or full: the choice lasts until the page reloads.
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const subscribe = (onChange: () => void) => {
|
|
90
|
+
listeners.add(onChange);
|
|
91
|
+
return () => {
|
|
92
|
+
listeners.delete(onChange);
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
const getSets = () => sets;
|
|
96
|
+
/** The registered sets, outside React (the shell's look resolution: research-035). */
|
|
97
|
+
export const getIconSets = (): readonly IconSet[] => sets;
|
|
98
|
+
/** Calls `onChange` when a set comes or goes (or the choice changes); returns the unsubscribe. */
|
|
99
|
+
export const subscribeIconSets = (onChange: () => void) => subscribe(onChange);
|
|
100
|
+
|
|
101
|
+
/** The registered sets, re-rendering the caller when one comes or goes. */
|
|
102
|
+
export function useIconSets(): readonly IconSet[] {
|
|
103
|
+
return React.useSyncExternalStore(subscribe, getSets, getSets);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** The chosen set's id, re-rendering the caller when it changes. */
|
|
107
|
+
export function useIconSetId(): string {
|
|
108
|
+
return React.useSyncExternalStore(subscribe, getIconSet, () => DEFAULT_ICON_SET);
|
|
109
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: Icon
|
|
2
|
+
description: "A 16px navigation icon named by a string: any lucide icon by its kebab-case name (https://lucide.dev/icons, listed in ICON_NAMES); an unknown or missing name shows `file`. Decorative: aria-hidden, in the current text colour."
|
|
3
|
+
layer: core
|
|
4
|
+
category: data-display
|
|
5
|
+
when_to_use:
|
|
6
|
+
- "For an icon a manifest or other data names as a string (sidebar screens)"
|
|
7
|
+
- "For the icon slot of SidebarItem or SidebarTreeItem"
|
|
8
|
+
when_not_to_use:
|
|
9
|
+
- "For a status — use StatusIcon"
|
|
10
|
+
- "For a lucide alias (trash-2, building-2) — use the icon's own name (ICON_NAMES lists them); an alias shows `file`"
|
|
11
|
+
composition_partners:
|
|
12
|
+
- SidebarItem, SidebarTreeItem (as icon)
|
|
13
|
+
props:
|
|
14
|
+
- name: name
|
|
15
|
+
type: string
|
|
16
|
+
required: false
|
|
17
|
+
description: "A lucide icon's kebab-case name (ICON_NAMES); anything else shows the default `file` icon"
|
|
18
|
+
- name: size
|
|
19
|
+
type: number
|
|
20
|
+
required: false
|
|
21
|
+
default: "16"
|
|
22
|
+
description: "Width and height in pixels"
|
|
23
|
+
examples:
|
|
24
|
+
- title: "A screen's icon"
|
|
25
|
+
code: '<Icon name="inbox" />'
|
|
26
|
+
- title: "Contact details (mail, phone, at-sign, map-pin, building, cake) and actions (user-plus, filter)"
|
|
27
|
+
code: '<Button variant="outline"><Icon name="user-plus" />New contact</Button>'
|
|
28
|
+
- title: "A pull request's state (git-pull-request-arrow open in text-success, git-pull-request-draft draft in text-muted, git-merge merged in text-merged, git-pull-request-closed closed in text-destructive)"
|
|
29
|
+
code: '<Icon name="git-merge" className="text-merged" />'
|
|
30
|
+
accessibility_notes: "Always aria-hidden: the label next to it names the item."
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Building2,
|
|
3
|
+
CircleHelp,
|
|
4
|
+
createLucideIcon,
|
|
5
|
+
File,
|
|
6
|
+
House,
|
|
7
|
+
icons as lucide,
|
|
8
|
+
LayoutDashboard,
|
|
9
|
+
ListFilter,
|
|
10
|
+
Undo2,
|
|
11
|
+
type LucideIcon,
|
|
12
|
+
type LucideProps,
|
|
13
|
+
} from "lucide-react";
|
|
14
|
+
|
|
15
|
+
import { DEFAULT_ICON_SET, useIconSetId, useIconSets } from "./icon-sets";
|
|
16
|
+
|
|
17
|
+
/** Lucide's kebab-case name for its PascalCase export (`ArrowDownAZ` → `arrow-down-a-z`, `Grid2x2` → `grid-2x2`),
|
|
18
|
+
* the reverse of lucide's own `toPascalCase`; icon.test.tsx checks it against lucide's own list of names. */
|
|
19
|
+
const kebab = (pascal: string) =>
|
|
20
|
+
pascal
|
|
21
|
+
.replace(/(?<=[a-z\d])(?=[A-Z])|(?<=[A-Z])(?=[A-Z])|(?<=[a-zA-Z])(?<!\d[a-z])(?=\d)/g, "-")
|
|
22
|
+
.toLowerCase();
|
|
23
|
+
|
|
24
|
+
/** A phone barred (a screen not made for a phone): lucide's `smartphone`, a cross on its screen. Lucide has none. */
|
|
25
|
+
const SmartphoneOff = createLucideIcon("smartphone-off", [
|
|
26
|
+
["rect", { width: "14", height: "20", x: "5", y: "2", rx: "2", ry: "2", key: "body" }],
|
|
27
|
+
["path", { d: "m9.5 7.5 5 5", key: "cross-a" }],
|
|
28
|
+
["path", { d: "m14.5 7.5-5 5", key: "cross-b" }],
|
|
29
|
+
["path", { d: "M12 18h.01", key: "dot" }],
|
|
30
|
+
]);
|
|
31
|
+
|
|
32
|
+
// Every lucide icon by its kebab-case name, so a manifest can name any of them as a string; the kit module bundles
|
|
33
|
+
// them all (one ES module, no lazy chunk: Bridge serves the kit as a single file). The names the kit gave
|
|
34
|
+
// when its set was curated keep drawing what they drew (`circle-help`, a name lucide moved), `building` and `undo`
|
|
35
|
+
// over lucide's own of that name.
|
|
36
|
+
const icons = new Map<string, LucideIcon>([
|
|
37
|
+
...Object.entries(lucide).map(([name, icon]) => [kebab(name), icon] as const),
|
|
38
|
+
["building", Building2],
|
|
39
|
+
["circle-help", CircleHelp],
|
|
40
|
+
["dashboard", LayoutDashboard],
|
|
41
|
+
["filter", ListFilter],
|
|
42
|
+
["home", House],
|
|
43
|
+
["smartphone-off", SmartphoneOff],
|
|
44
|
+
["undo", Undo2],
|
|
45
|
+
]);
|
|
46
|
+
|
|
47
|
+
/** The names `Icon` knows, sorted: every lucide icon (https://lucide.dev/icons), a few names of the kit's own, and
|
|
48
|
+
* `smartphone-off`, drawn by the kit. */
|
|
49
|
+
const ICON_NAMES = [...icons.keys()].sort();
|
|
50
|
+
|
|
51
|
+
interface IconProps extends Omit<LucideProps, "ref"> {
|
|
52
|
+
/** A lucide name (`ICON_NAMES`); anything else (or nothing) shows the default `file` icon. */
|
|
53
|
+
name?: string | undefined;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** A 16px navigation icon, decorative (`aria-hidden`), in the current text colour, from the chosen icon
|
|
57
|
+
* set (./icon-sets.ts). A set chosen but not registered yet (its plugin still loading) shows an empty box of
|
|
58
|
+
* the icon's size, so the page does not flash Lucide first; a name the set lacks is drawn by Lucide. */
|
|
59
|
+
function Icon({ name, size = 16, ...props }: IconProps) {
|
|
60
|
+
const chosen = useIconSetId();
|
|
61
|
+
const sets = useIconSets();
|
|
62
|
+
if (chosen !== DEFAULT_ICON_SET) {
|
|
63
|
+
const set = sets.find((s) => s.id === chosen);
|
|
64
|
+
// Drawn data has no stroke to set.
|
|
65
|
+
const { strokeWidth: _, absoluteStrokeWidth: __, ...svg } = props;
|
|
66
|
+
const own = set && Object.hasOwn(set.icons, name ?? "") ? set.icons[name!] : undefined;
|
|
67
|
+
// A name Lucide does not know either shows the set's `file`, as Lucide shows its own.
|
|
68
|
+
const icon = own ?? (set && !icons.has(name ?? "") ? set.icons.file : undefined);
|
|
69
|
+
if (!set || icon) {
|
|
70
|
+
return (
|
|
71
|
+
<svg
|
|
72
|
+
data-slot="icon"
|
|
73
|
+
width={size}
|
|
74
|
+
height={size}
|
|
75
|
+
viewBox={icon?.viewBox}
|
|
76
|
+
fill="currentColor"
|
|
77
|
+
shapeRendering={set?.pixelated ? "crispEdges" : undefined}
|
|
78
|
+
aria-hidden="true"
|
|
79
|
+
{...svg}
|
|
80
|
+
>
|
|
81
|
+
{icon?.paths.map(([fill, d], i) => (
|
|
82
|
+
<path key={i} fill={fill} d={d} />
|
|
83
|
+
))}
|
|
84
|
+
</svg>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
const Glyph = icons.get(name ?? "") ?? File;
|
|
89
|
+
return <Glyph data-slot="icon" size={size} aria-hidden="true" {...props} />;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export { Icon, ICON_NAMES };
|
|
93
|
+
export type { IconProps };
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
name: Input
|
|
2
|
+
description: "A text input component for forms and data entry"
|
|
3
|
+
layer: core
|
|
4
|
+
category: input
|
|
5
|
+
when_to_use:
|
|
6
|
+
- "For single-line text entry in forms"
|
|
7
|
+
- "For email, password, number, and other standard input types"
|
|
8
|
+
when_not_to_use:
|
|
9
|
+
- "For multi-line text — use a Textarea component"
|
|
10
|
+
- "For selecting from predefined options — use Select or Combobox"
|
|
11
|
+
- "For toggling boolean values — use Switch or Checkbox"
|
|
12
|
+
composition_partners:
|
|
13
|
+
- Form (field)
|
|
14
|
+
- Card (content)
|
|
15
|
+
- Dialog (form fields)
|
|
16
|
+
props:
|
|
17
|
+
- name: variant
|
|
18
|
+
type: "'inline' | 'inline-title' | 'inline-description' | 'outline'"
|
|
19
|
+
required: false
|
|
20
|
+
default: "'inline'"
|
|
21
|
+
description: "Input visual variant — inline for borderless editing, inline-title for headings, inline-description for body text, outline for forms"
|
|
22
|
+
- name: size
|
|
23
|
+
type: "'sm' | 'default' | 'lg'"
|
|
24
|
+
required: false
|
|
25
|
+
default: "'default'"
|
|
26
|
+
description: "Input height — sm (26px), default (30px), lg (34px) at the look's default Control height; they follow it (Settings › Appearance › Look). The same default for every variant (outline included), so an Input and a Button left at their default line up. Ignored by inline-title/inline-description."
|
|
27
|
+
- name: type
|
|
28
|
+
type: string
|
|
29
|
+
required: false
|
|
30
|
+
default: "'text'"
|
|
31
|
+
description: "HTML input type (text, email, password, number, etc.)"
|
|
32
|
+
- name: placeholder
|
|
33
|
+
type: string
|
|
34
|
+
required: false
|
|
35
|
+
description: "Placeholder text"
|
|
36
|
+
- name: disabled
|
|
37
|
+
type: boolean
|
|
38
|
+
required: false
|
|
39
|
+
description: "Whether the input is disabled"
|
|
40
|
+
- name: label
|
|
41
|
+
type: string
|
|
42
|
+
required: false
|
|
43
|
+
description: "Optional label text rendered as a floating label above the input"
|
|
44
|
+
- name: icon
|
|
45
|
+
type: React.ReactNode
|
|
46
|
+
required: false
|
|
47
|
+
description: "Icon element rendered inside the input, left-aligned. Use lucide-react icons at size={14}. Wrapped in aria-hidden span."
|
|
48
|
+
- name: shortcut
|
|
49
|
+
type: string
|
|
50
|
+
required: false
|
|
51
|
+
description: "Keyboard shortcut hint rendered inside the input, right-aligned (e.g., '⌘K'). Styled as text-xs text-muted."
|
|
52
|
+
- name: aria-invalid
|
|
53
|
+
type: boolean
|
|
54
|
+
required: false
|
|
55
|
+
description: "Error state — renders with error styling when true"
|
|
56
|
+
props_priority:
|
|
57
|
+
- variant
|
|
58
|
+
- icon
|
|
59
|
+
- shortcut
|
|
60
|
+
- type
|
|
61
|
+
- placeholder
|
|
62
|
+
- disabled
|
|
63
|
+
- aria-invalid
|
|
64
|
+
variants:
|
|
65
|
+
- inline: "Default — borderless, transparent background. For in-place editing."
|
|
66
|
+
- inline-title: "Borderless large text (xl, semibold). For heading editing in detail views."
|
|
67
|
+
- outline: "0.5px outline input with surface background. For explicit forms. Supports icon and shortcut props."
|
|
68
|
+
notes: "The inline-description variant exists in inputVariants but is used exclusively by the Textarea component. Use Textarea for multi-line descriptions, not Input with inline-description."
|
|
69
|
+
examples:
|
|
70
|
+
- title: "Default outline input"
|
|
71
|
+
code: '<Input placeholder="Enter email..." type="email" />'
|
|
72
|
+
- title: "Heading input for title editing"
|
|
73
|
+
code: '<Input variant="inline-title" placeholder="Issue title" />'
|
|
74
|
+
- title: "Input with error state"
|
|
75
|
+
code: '<Input aria-invalid placeholder="Required field" />'
|
|
76
|
+
- title: "Search input with icon"
|
|
77
|
+
code: |
|
|
78
|
+
import { Search } from 'lucide-react';
|
|
79
|
+
|
|
80
|
+
<Input variant="outline" size="sm" icon={<Search size={14} />} placeholder="Search..." />
|
|
81
|
+
- title: "Input with keyboard shortcut"
|
|
82
|
+
code: |
|
|
83
|
+
import { Search } from 'lucide-react';
|
|
84
|
+
|
|
85
|
+
<Input variant="outline" icon={<Search size={14} />} shortcut="⌘K" placeholder="Search..." />
|
|
86
|
+
example_prompts:
|
|
87
|
+
- "Create an email input field"
|
|
88
|
+
- "Add a password input with placeholder"
|
|
89
|
+
- "Create a disabled input"
|
|
90
|
+
- "Add an input with error state"
|
|
91
|
+
- "Create a search input with icon"
|
|
92
|
+
- "Add an input with keyboard shortcut display"
|
|
93
|
+
anti_patterns:
|
|
94
|
+
- "Don't use a custom error prop — use aria-invalid for error state"
|
|
95
|
+
- "Don't force a fixed width — Input is w-full by default, let the parent control width"
|
|
96
|
+
- "Don't wrap Input in a relative div to add icons — use the built-in icon prop instead"
|
|
97
|
+
- "Don't add manual padding (pl-7, pr-8) when using icon/shortcut — the component handles padding automatically"
|
|
98
|
+
accessibility_notes: "Renders native <input> element. Supports label association via htmlFor/id. Error state via aria-invalid (announced by screen readers). Keyboard navigable via Tab. Focus ring visible on keyboard navigation only. Icon prop is wrapped in aria-hidden='true' (decorative only). Shortcut hint is visual-only with pointer-events-none."
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
+
|
|
4
|
+
import { cn } from "../../../lib/utils";
|
|
5
|
+
import { useFieldControl } from "../field/field";
|
|
6
|
+
|
|
7
|
+
const inputVariants = cva(
|
|
8
|
+
"flex w-full min-w-0 font-sans text-foreground outline-hidden transition-[background,border-color] duration-150 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 placeholder:text-placeholder file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
inline:
|
|
13
|
+
"border-none bg-transparent px-1 -mx-1 rounded-control hover:bg-hover focus:bg-transparent cursor-text aria-invalid:text-destructive",
|
|
14
|
+
"inline-title":
|
|
15
|
+
"border-none bg-transparent text-xl font-semibold leading-[1.4] px-1 -mx-1 rounded-control hover:bg-hover focus:bg-transparent cursor-text aria-invalid:text-destructive",
|
|
16
|
+
"inline-description":
|
|
17
|
+
"border-none bg-transparent text-field px-1 -mx-1 rounded-control hover:bg-hover focus:bg-transparent min-h-[60px] resize-none cursor-text aria-invalid:text-destructive",
|
|
18
|
+
outline:
|
|
19
|
+
"border-[0.5px] border-input bg-surface rounded-control px-2.5 focus:border-accent aria-invalid:border-destructive",
|
|
20
|
+
},
|
|
21
|
+
size: {
|
|
22
|
+
sm: "h-sm text-sm",
|
|
23
|
+
default: "h-md text-sm",
|
|
24
|
+
lg: "h-lg text-sm",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
compoundVariants: [
|
|
28
|
+
{
|
|
29
|
+
variant: "inline-title",
|
|
30
|
+
className: "h-auto text-xl leading-[1.4]",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
variant: "inline-description",
|
|
34
|
+
className: "h-auto text-field",
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
defaultVariants: {
|
|
38
|
+
variant: "inline",
|
|
39
|
+
size: "default",
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
interface InputProps
|
|
45
|
+
extends
|
|
46
|
+
Omit<React.ComponentProps<"input">, "size">,
|
|
47
|
+
Omit<VariantProps<typeof inputVariants>, "variant"> {
|
|
48
|
+
/** Visual variant. Use the Textarea component for multi-line descriptions. */
|
|
49
|
+
variant?: "inline" | "inline-title" | "outline";
|
|
50
|
+
label?: string;
|
|
51
|
+
/** Icon element rendered inside the input, left-aligned. */
|
|
52
|
+
icon?: React.ReactNode;
|
|
53
|
+
/** Keyboard shortcut hint rendered inside the input, right-aligned (e.g., "⌘K"). */
|
|
54
|
+
shortcut?: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** The autocomplete value that keeps the browser's autofill out (owner, 17 October 2026): Bridge's fields are rarely
|
|
58
|
+
* the user's own, and Chrome filled a new contact with their name and email. Chrome ignores "off" for addresses and
|
|
59
|
+
* names but fills no field whose autocomplete value it does not know (the Chromium team's advice). */
|
|
60
|
+
const noAutofill = "bridge-no-autofill";
|
|
61
|
+
|
|
62
|
+
function Input({
|
|
63
|
+
className,
|
|
64
|
+
type,
|
|
65
|
+
variant,
|
|
66
|
+
size,
|
|
67
|
+
label,
|
|
68
|
+
icon,
|
|
69
|
+
shortcut,
|
|
70
|
+
id: idProp,
|
|
71
|
+
...props
|
|
72
|
+
}: InputProps) {
|
|
73
|
+
const autoId = React.useId();
|
|
74
|
+
const id = idProp || (label ? autoId : undefined);
|
|
75
|
+
|
|
76
|
+
const inputElement = useFieldControl(
|
|
77
|
+
<input
|
|
78
|
+
type={type}
|
|
79
|
+
id={id}
|
|
80
|
+
data-slot="input"
|
|
81
|
+
data-variant={variant ?? "inline"}
|
|
82
|
+
data-size={size ?? "default"}
|
|
83
|
+
className={cn(
|
|
84
|
+
inputVariants({ variant, size }),
|
|
85
|
+
icon && "pl-7",
|
|
86
|
+
shortcut && "pr-8",
|
|
87
|
+
className,
|
|
88
|
+
)}
|
|
89
|
+
// No autofill by default (owner, 17 October 2026): see noAutofill. A login form asks for it (autoComplete="username").
|
|
90
|
+
autoComplete={noAutofill}
|
|
91
|
+
{...props}
|
|
92
|
+
/>,
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
const needsAdornmentWrapper = icon || shortcut;
|
|
96
|
+
|
|
97
|
+
const content = needsAdornmentWrapper ? (
|
|
98
|
+
<div data-slot="input-adornment" className="relative flex items-center w-full">
|
|
99
|
+
{icon && (
|
|
100
|
+
<span
|
|
101
|
+
aria-hidden="true"
|
|
102
|
+
className="absolute left-2 top-1/2 -translate-y-1/2 text-muted pointer-events-none flex items-center"
|
|
103
|
+
>
|
|
104
|
+
{icon}
|
|
105
|
+
</span>
|
|
106
|
+
)}
|
|
107
|
+
{inputElement}
|
|
108
|
+
{shortcut && (
|
|
109
|
+
<span className="absolute right-2 top-1/2 -translate-y-1/2 text-xs text-muted font-normal pointer-events-none">
|
|
110
|
+
{shortcut}
|
|
111
|
+
</span>
|
|
112
|
+
)}
|
|
113
|
+
</div>
|
|
114
|
+
) : (
|
|
115
|
+
inputElement
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
if (label) {
|
|
119
|
+
return (
|
|
120
|
+
<div data-slot="input-wrapper">
|
|
121
|
+
<label htmlFor={id} className="text-sm font-medium">
|
|
122
|
+
{label}
|
|
123
|
+
</label>
|
|
124
|
+
{content}
|
|
125
|
+
</div>
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return content;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export { Input, inputVariants, noAutofill };
|
|
133
|
+
export type { InputProps };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
name: Textarea
|
|
2
|
+
description: "Auto-growing multiline text input for descriptions, comments, notes, and chatbot-style memo drafts."
|
|
3
|
+
layer: core
|
|
4
|
+
category: input
|
|
5
|
+
when_to_use:
|
|
6
|
+
- "For multiline text entry (descriptions, comments, notes)"
|
|
7
|
+
- "For conversational prompts or agent memos where users may draft multiple lines before sending"
|
|
8
|
+
- "For inline editing of longer text content"
|
|
9
|
+
- "For auto-growing text areas that expand with content"
|
|
10
|
+
when_not_to_use:
|
|
11
|
+
- "For single-line text — use Input component"
|
|
12
|
+
- "For rich text editing — Textarea is plain text only"
|
|
13
|
+
- "For code editing — use a dedicated code editor"
|
|
14
|
+
composition_partners:
|
|
15
|
+
- Dialog (in form fields)
|
|
16
|
+
- Properties (as editable value)
|
|
17
|
+
- Button (send/submit action in a memo composer)
|
|
18
|
+
props:
|
|
19
|
+
- name: variant
|
|
20
|
+
type: "'default' | 'outline'"
|
|
21
|
+
required: false
|
|
22
|
+
default: "'default'"
|
|
23
|
+
description: "default: borderless inline description; outline: bordered like Input variant='outline', for forms"
|
|
24
|
+
- name: placeholder
|
|
25
|
+
type: string
|
|
26
|
+
required: false
|
|
27
|
+
description: "Placeholder text shown when empty"
|
|
28
|
+
- name: onInput
|
|
29
|
+
type: "(e: React.FormEvent<HTMLTextAreaElement>) => void"
|
|
30
|
+
required: false
|
|
31
|
+
description: "Input event handler (also triggers auto-resize)"
|
|
32
|
+
- name: disabled
|
|
33
|
+
type: boolean
|
|
34
|
+
required: false
|
|
35
|
+
description: "Whether the textarea is disabled"
|
|
36
|
+
- name: className
|
|
37
|
+
type: string
|
|
38
|
+
required: false
|
|
39
|
+
description: "Additional CSS classes"
|
|
40
|
+
props_priority:
|
|
41
|
+
- placeholder
|
|
42
|
+
- onInput
|
|
43
|
+
- disabled
|
|
44
|
+
examples:
|
|
45
|
+
- title: "Basic textarea"
|
|
46
|
+
code: '<Textarea placeholder="Add a description..." />'
|
|
47
|
+
- title: "Textarea with value"
|
|
48
|
+
code: |
|
|
49
|
+
<Textarea
|
|
50
|
+
value={description}
|
|
51
|
+
onInput={(e) => setDescription(e.currentTarget.value)}
|
|
52
|
+
/>
|
|
53
|
+
- title: "Agent memo composer"
|
|
54
|
+
code: |
|
|
55
|
+
const [memo, setMemo] = useState("");
|
|
56
|
+
|
|
57
|
+
<form
|
|
58
|
+
className="flex items-end gap-2"
|
|
59
|
+
onSubmit={(event) => {
|
|
60
|
+
event.preventDefault();
|
|
61
|
+
if (!memo.trim()) return;
|
|
62
|
+
sendMemo(memo);
|
|
63
|
+
}}
|
|
64
|
+
>
|
|
65
|
+
<Textarea
|
|
66
|
+
aria-label="Memo for the agents"
|
|
67
|
+
placeholder="Add a memo for Dev and Reviewer..."
|
|
68
|
+
value={memo}
|
|
69
|
+
onInput={(e) => setMemo(e.currentTarget.value)}
|
|
70
|
+
/>
|
|
71
|
+
<Button type="submit" variant="primary" disabled={!memo.trim()}>Send</Button>
|
|
72
|
+
</form>
|
|
73
|
+
anti_patterns:
|
|
74
|
+
- "Don't set a fixed height — Textarea auto-resizes to fit content"
|
|
75
|
+
- "Don't use rows prop to control height — the auto-resize mechanism overrides it"
|
|
76
|
+
- "Don't use for single-line inputs — use Input component instead"
|
|
77
|
+
- "Don't model a chatbot prompt, comment, or agent memo as a single-line Input — drafting intent is multiline even when the initial state is compact"
|
|
78
|
+
accessibility_notes: "Renders native <textarea> element. Supports label association via htmlFor/id. Keyboard navigable via Tab. Uses the 'inline-description' input variant styling, or 'outline' with variant='outline'."
|
|
79
|
+
notes: "Auto-resize works by resetting height to 0px then setting it to scrollHeight on each input event. Shares CVA variants with Input component."
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
import { cn } from "../../../lib/utils";
|
|
4
|
+
import { inputVariants, noAutofill } from "./input";
|
|
5
|
+
import { useFieldControl } from "../field/field";
|
|
6
|
+
|
|
7
|
+
function autoResize(el: HTMLTextAreaElement) {
|
|
8
|
+
el.style.height = "auto";
|
|
9
|
+
el.style.height = el.scrollHeight + "px";
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface TextareaProps extends Omit<React.ComponentProps<"textarea">, "children"> {
|
|
13
|
+
/** `default`: borderless (inline description); `outline`: bordered like `Input variant="outline"`. */
|
|
14
|
+
variant?: "default" | "outline";
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function Textarea({
|
|
18
|
+
className,
|
|
19
|
+
onInput,
|
|
20
|
+
ref: externalRef,
|
|
21
|
+
value,
|
|
22
|
+
variant = "default",
|
|
23
|
+
...props
|
|
24
|
+
}: TextareaProps) {
|
|
25
|
+
const internalRef = React.useRef<HTMLTextAreaElement>(null);
|
|
26
|
+
|
|
27
|
+
React.useEffect(() => {
|
|
28
|
+
if (internalRef.current) autoResize(internalRef.current);
|
|
29
|
+
}, [value]);
|
|
30
|
+
|
|
31
|
+
return useFieldControl(
|
|
32
|
+
<textarea
|
|
33
|
+
ref={(node) => {
|
|
34
|
+
internalRef.current = node;
|
|
35
|
+
if (typeof externalRef === "function") externalRef(node);
|
|
36
|
+
else if (externalRef != null) {
|
|
37
|
+
(externalRef as { current: HTMLTextAreaElement | null }).current = node;
|
|
38
|
+
}
|
|
39
|
+
}}
|
|
40
|
+
data-slot="textarea"
|
|
41
|
+
data-variant={variant}
|
|
42
|
+
className={cn(
|
|
43
|
+
variant === "outline"
|
|
44
|
+
? [
|
|
45
|
+
inputVariants({ variant: "outline", size: null }),
|
|
46
|
+
"min-h-[84px] py-1.5 text-sm resize-none",
|
|
47
|
+
]
|
|
48
|
+
: inputVariants({ variant: "inline-description" }),
|
|
49
|
+
className,
|
|
50
|
+
)}
|
|
51
|
+
onInput={(e) => {
|
|
52
|
+
autoResize(e.currentTarget);
|
|
53
|
+
onInput?.(e);
|
|
54
|
+
}}
|
|
55
|
+
value={value}
|
|
56
|
+
autoComplete={noAutofill}
|
|
57
|
+
{...props}
|
|
58
|
+
/>,
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { Textarea };
|
|
63
|
+
export type { TextareaProps };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
name: Kbd
|
|
2
|
+
description: "A key as a small cap (11px, a 0.5px border on the badge tint), research-033's mockup `.kbd`. tone inverse: inside a primary button."
|
|
3
|
+
layer: core
|
|
4
|
+
category: data-display
|
|
5
|
+
when_to_use:
|
|
6
|
+
- "A shortcut next to a button's label (Create ⌘↵, Clear search Esc, New contact C)"
|
|
7
|
+
- "Keys in a line of help (Enter, Esc) or a menu item's shortcut"
|
|
8
|
+
props:
|
|
9
|
+
- name: tone
|
|
10
|
+
type: '"default" | "inverse"'
|
|
11
|
+
required: false
|
|
12
|
+
default: '"default"'
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
import { cn } from "../../../lib/utils";
|
|
4
|
+
|
|
5
|
+
// research-033's mockup `.kbd`: a key as a small cap (11px, a 0.5px border on the badge tint). `inverse`: inside a
|
|
6
|
+
// primary button (no tint, the button's colour, a light border).
|
|
7
|
+
|
|
8
|
+
interface KbdProps extends React.ComponentProps<"kbd"> {
|
|
9
|
+
tone?: "default" | "inverse";
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function Kbd({ tone = "default", className, ...props }: KbdProps) {
|
|
13
|
+
return (
|
|
14
|
+
<kbd
|
|
15
|
+
data-slot="kbd"
|
|
16
|
+
className={cn(
|
|
17
|
+
"inline-flex min-w-4 justify-center rounded-[3px] border-[0.5px] px-1 font-sans text-[11px] leading-4",
|
|
18
|
+
tone === "inverse"
|
|
19
|
+
? "border-[rgb(255_255_255/40%)] bg-transparent text-inherit"
|
|
20
|
+
: "border-border bg-badge text-muted",
|
|
21
|
+
className,
|
|
22
|
+
)}
|
|
23
|
+
{...props}
|
|
24
|
+
/>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { Kbd };
|
|
29
|
+
export type { KbdProps };
|