@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,60 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
import { cn } from "../../../lib/utils";
|
|
4
|
+
|
|
5
|
+
interface BulletsProps extends Omit<React.ComponentProps<"div">, "onSelect"> {
|
|
6
|
+
/** How many items there are. */
|
|
7
|
+
count: number;
|
|
8
|
+
/** The item shown, from 0. */
|
|
9
|
+
index: number;
|
|
10
|
+
/** Goes to item `index`; without it the bullets only say where one is. */
|
|
11
|
+
onSelect?: (index: number) => void;
|
|
12
|
+
/** Each bullet's accessible name, from its index (default "Item 2 of 5"). */
|
|
13
|
+
labelOf?: (index: number) => string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** Simple dots saying which of `count` items shows (a carousel, an image viewer); a click goes to one. */
|
|
17
|
+
function Bullets({
|
|
18
|
+
count,
|
|
19
|
+
index,
|
|
20
|
+
onSelect,
|
|
21
|
+
labelOf = (i) => `Item ${i + 1} of ${count}`,
|
|
22
|
+
className,
|
|
23
|
+
...props
|
|
24
|
+
}: BulletsProps) {
|
|
25
|
+
if (count < 2) return null;
|
|
26
|
+
return (
|
|
27
|
+
<div
|
|
28
|
+
data-slot="bullets"
|
|
29
|
+
role="tablist"
|
|
30
|
+
className={cn("flex items-center", className)}
|
|
31
|
+
{...props}
|
|
32
|
+
>
|
|
33
|
+
{Array.from({ length: count }, (_, i) => (
|
|
34
|
+
<button
|
|
35
|
+
key={i}
|
|
36
|
+
type="button"
|
|
37
|
+
role="tab"
|
|
38
|
+
aria-selected={i === index}
|
|
39
|
+
aria-label={labelOf(i)}
|
|
40
|
+
data-slot="bullet"
|
|
41
|
+
disabled={!onSelect}
|
|
42
|
+
className="group/bullet m-0 flex cursor-pointer appearance-none items-center justify-center border-0 bg-transparent p-1 outline-none focus:outline-none disabled:cursor-default"
|
|
43
|
+
onClick={() => onSelect?.(i)}
|
|
44
|
+
>
|
|
45
|
+
<span
|
|
46
|
+
className={cn(
|
|
47
|
+
"block size-1.5 rounded-full transition-colors duration-150",
|
|
48
|
+
i === index
|
|
49
|
+
? "bg-foreground/55"
|
|
50
|
+
: "bg-foreground/20 group-hover/bullet:bg-foreground/40 group-focus-visible/bullet:bg-foreground/40",
|
|
51
|
+
)}
|
|
52
|
+
/>
|
|
53
|
+
</button>
|
|
54
|
+
))}
|
|
55
|
+
</div>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export { Bullets };
|
|
60
|
+
export type { BulletsProps };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
name: Button
|
|
2
|
+
description: "Ghost-first button with 5 variants and 6 sizes. Default variant is ghost (no background), reflecting Linear's minimal UI philosophy."
|
|
3
|
+
layer: core
|
|
4
|
+
category: action
|
|
5
|
+
when_to_use:
|
|
6
|
+
- "For triggering actions and submitting forms"
|
|
7
|
+
- "For interactive controls that perform an immediate action"
|
|
8
|
+
- "For property values in detail panels (use variant=property)"
|
|
9
|
+
- "For icon-only actions in toolbars (use size=icon/icon-sm/icon-lg)"
|
|
10
|
+
when_not_to_use:
|
|
11
|
+
- "For navigation — use Button with render={<a href=… />}"
|
|
12
|
+
- "For toggling state — use Toggle component"
|
|
13
|
+
- "For segmented choices — use SegmentGroup component"
|
|
14
|
+
composition_partners:
|
|
15
|
+
- Dialog (as DialogTrigger child)
|
|
16
|
+
- DropdownMenu (as DropdownMenuTrigger child)
|
|
17
|
+
- Tooltip (wrap with TooltipTrigger)
|
|
18
|
+
- PropertyRow (as value display with variant=property)
|
|
19
|
+
props:
|
|
20
|
+
- name: variant
|
|
21
|
+
type: "'ghost' | 'primary' | 'outline' | 'destructive' | 'property'"
|
|
22
|
+
required: false
|
|
23
|
+
default: "'ghost'"
|
|
24
|
+
description: "Button visual style variant"
|
|
25
|
+
- name: size
|
|
26
|
+
type: "'sm' | 'default' | 'lg' | 'icon' | 'icon-sm' | 'icon-lg'"
|
|
27
|
+
required: false
|
|
28
|
+
default: "'default'"
|
|
29
|
+
description: "Button size"
|
|
30
|
+
- name: render
|
|
31
|
+
type: "ReactElement | (props, state) => ReactElement"
|
|
32
|
+
required: false
|
|
33
|
+
description: "Replace the rendered element (e.g. render={<a href=… />} for links)"
|
|
34
|
+
- name: disabled
|
|
35
|
+
type: boolean
|
|
36
|
+
required: false
|
|
37
|
+
description: "Whether the button is disabled"
|
|
38
|
+
props_priority:
|
|
39
|
+
- variant
|
|
40
|
+
- size
|
|
41
|
+
- render
|
|
42
|
+
- disabled
|
|
43
|
+
variants:
|
|
44
|
+
- ghost: "Default — no background, text-secondary. Hover shows bg-hover. Linear's primary button style."
|
|
45
|
+
- primary: "Filled accent background. Use sparingly for the single most important action."
|
|
46
|
+
- outline: "Bordered, transparent background. For secondary actions needing visual weight."
|
|
47
|
+
- destructive: "Red text, subtle red hover background. For dangerous/irreversible actions."
|
|
48
|
+
- property: "Bordered, rounded-default, font-normal. For property value buttons in detail panels. Has special compound variants for icon sizes."
|
|
49
|
+
sizes:
|
|
50
|
+
- sm: "h-sm (20px), text-xs, px-1.5"
|
|
51
|
+
- default: "h-md (28px), text-sm, px-2"
|
|
52
|
+
- lg: "h-lg (32px), text-base, px-3"
|
|
53
|
+
- icon: "size-md (28px square), for icon-only buttons"
|
|
54
|
+
- icon-sm: "size-sm (24px square), for compact icon buttons"
|
|
55
|
+
- icon-lg: "size-lg (32px square), for large icon buttons"
|
|
56
|
+
example_prompts:
|
|
57
|
+
- "Create a ghost button for a toolbar action"
|
|
58
|
+
- "Add a primary accent button for the main CTA"
|
|
59
|
+
- "Create a destructive delete button"
|
|
60
|
+
- "Create an icon-only button with size=icon-sm"
|
|
61
|
+
- "Add a property button showing the current status value"
|
|
62
|
+
anti_patterns:
|
|
63
|
+
- "Don't override variant colors with className — use the variant prop"
|
|
64
|
+
- "Don't use primary variant liberally — reserve for the single most important action per view"
|
|
65
|
+
- "Don't add focus rings via className — the component uses bg-hover/bg-accent-hover for focus, not ring styles"
|
|
66
|
+
- "Don't use h-* or padding classes — use the size prop"
|
|
67
|
+
- "Don't add speculative or decorative icon-only actions — every Button must perform a real, understandable action; omit controls whose consequence is undefined"
|
|
68
|
+
examples:
|
|
69
|
+
- title: "Default ghost button"
|
|
70
|
+
code: "<Button>Click me</Button>"
|
|
71
|
+
- title: "Primary CTA"
|
|
72
|
+
code: '<Button variant="primary">Save changes</Button>'
|
|
73
|
+
- title: "Destructive action"
|
|
74
|
+
code: '<Button variant="destructive">Delete issue</Button>'
|
|
75
|
+
- title: "Icon button"
|
|
76
|
+
code: |
|
|
77
|
+
import { Plus } from 'lucide-react';
|
|
78
|
+
|
|
79
|
+
<Tooltip>
|
|
80
|
+
<TooltipTrigger render={<Button size="icon-sm" aria-label="Add item" />}>
|
|
81
|
+
<Plus size={14} />
|
|
82
|
+
</TooltipTrigger>
|
|
83
|
+
<TooltipContent>Add item</TooltipContent>
|
|
84
|
+
</Tooltip>
|
|
85
|
+
- title: "Property button in detail panel"
|
|
86
|
+
code: |
|
|
87
|
+
<Button variant="property" size="sm">
|
|
88
|
+
<StatusIcon status="in-progress" size="sm" />
|
|
89
|
+
In Progress
|
|
90
|
+
</Button>
|
|
91
|
+
accessibility_notes: "Preserves native <button> keyboard behavior (Enter/Space). Uses outline-hidden with bg-based focus indicators (not ring). Use disabled prop, not aria-disabled. Every icon-only Button needs an aria-label and a Tooltip, but a label cannot rescue an action with no meaningful behavior."
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
4
|
+
|
|
5
|
+
import { cn } from "../../../lib/utils";
|
|
6
|
+
|
|
7
|
+
// Optical centring (Bridge): with the system font a label sits 1px low, so the text sizes (sm, default,
|
|
8
|
+
// lg) get 1px of bottom padding and their icons a -1px bottom margin (centred on the button, not the
|
|
9
|
+
// text box); the icon-only sizes keep both at zero. (CSS cannot tell a lone icon from icon + text: a
|
|
10
|
+
// text node is not an element, so the size is the signal.)
|
|
11
|
+
const labelled = "pb-px [&_svg]:-mb-px";
|
|
12
|
+
|
|
13
|
+
const buttonVariants = cva(
|
|
14
|
+
"inline-flex items-center justify-center gap-[5px] whitespace-nowrap no-underline font-medium bg-transparent transition-[background,color,border-color] duration-100 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-hidden cursor-pointer",
|
|
15
|
+
{
|
|
16
|
+
variants: {
|
|
17
|
+
variant: {
|
|
18
|
+
ghost:
|
|
19
|
+
"text-secondary hover:bg-hover hover:text-foreground focus-visible:bg-hover focus-visible:text-foreground",
|
|
20
|
+
primary:
|
|
21
|
+
"bg-accent text-accent-foreground hover:bg-accent-hover focus-visible:bg-accent-hover",
|
|
22
|
+
outline:
|
|
23
|
+
"border border-input bg-surface hover:bg-hover text-foreground focus-visible:border-accent",
|
|
24
|
+
destructive:
|
|
25
|
+
"text-destructive hover:bg-destructive-subtle focus-visible:bg-destructive-subtle",
|
|
26
|
+
property:
|
|
27
|
+
"border border-border bg-surface text-secondary hover:bg-hover hover:text-foreground focus-visible:border-accent [&_svg]:text-muted",
|
|
28
|
+
},
|
|
29
|
+
size: {
|
|
30
|
+
sm: `h-sm px-1.5 text-xs rounded-control ${labelled}`,
|
|
31
|
+
default: `h-md px-2 text-sm rounded-control ${labelled}`,
|
|
32
|
+
lg: `h-lg px-3 text-base rounded-control ${labelled}`,
|
|
33
|
+
icon: "size-[var(--height-md)] rounded-control",
|
|
34
|
+
"icon-sm": "size-[var(--height-sm)] rounded-control",
|
|
35
|
+
"icon-lg": "size-[var(--height-lg)] rounded-control",
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
compoundVariants: [
|
|
39
|
+
{
|
|
40
|
+
variant: "property",
|
|
41
|
+
className: "rounded-control px-2.5 gap-1.5 font-normal",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
variant: "property",
|
|
45
|
+
size: "icon",
|
|
46
|
+
className: "px-0",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
variant: "property",
|
|
50
|
+
size: "icon-sm",
|
|
51
|
+
className: "px-0",
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
variant: "property",
|
|
55
|
+
size: "icon-lg",
|
|
56
|
+
className: "px-0",
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
defaultVariants: {
|
|
60
|
+
variant: "ghost",
|
|
61
|
+
size: "default",
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
interface ButtonProps extends React.ComponentProps<"button">, VariantProps<typeof buttonVariants> {
|
|
67
|
+
/** Replace the rendered element (e.g. render={<a href="…" />} for router links) */
|
|
68
|
+
render?: useRender.RenderProp;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function Button({ className, variant, size, render, ref, ...props }: ButtonProps) {
|
|
72
|
+
return useRender({
|
|
73
|
+
// Default to a plain <button /> render element instead of Base UI's
|
|
74
|
+
// defaultTagName path, which injects type="button" — the pre-migration
|
|
75
|
+
// <button> was implicitly type="submit" inside forms, and consumers rely
|
|
76
|
+
// on <form><Button>Save</Button></form> submitting.
|
|
77
|
+
render: render ?? <button />,
|
|
78
|
+
ref: ref as React.Ref<HTMLButtonElement>,
|
|
79
|
+
props: {
|
|
80
|
+
"data-slot": "button",
|
|
81
|
+
// The kit contract's attributes (kit/kit.tsx): a rendering styles the button by them. `data-component`,
|
|
82
|
+
// not `data-slot`: a trigger rendering a Button (`render={<Button />}`) sets its own slot over it.
|
|
83
|
+
"data-component": "button",
|
|
84
|
+
"data-variant": variant ?? "ghost",
|
|
85
|
+
"data-size": size ?? "default",
|
|
86
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
87
|
+
...props,
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export { Button, buttonVariants };
|
|
93
|
+
export type { ButtonProps };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
name: Card
|
|
2
|
+
description: "Surface container with border or elevation for grouping related content. Used for Kanban cards, dashboard widgets, settings panels, and any bounded content region."
|
|
3
|
+
layer: core
|
|
4
|
+
category: layout
|
|
5
|
+
when_to_use:
|
|
6
|
+
- "For bounded content regions that need visual separation (Kanban cards, dashboard widgets)"
|
|
7
|
+
- "For interactive cards that open detail views on click"
|
|
8
|
+
- "For grouping related content with consistent padding and border radius"
|
|
9
|
+
when_not_to_use:
|
|
10
|
+
- "For navigation items — use Sidebar or List"
|
|
11
|
+
- "For modal content — use Dialog"
|
|
12
|
+
- "For full-width sections with no visual boundary — use plain layout elements"
|
|
13
|
+
composition_partners:
|
|
14
|
+
- StatusIcon (status indicator inside cards)
|
|
15
|
+
- Avatar (assignee display)
|
|
16
|
+
- Label (category tags on cards)
|
|
17
|
+
- Badge (count indicators)
|
|
18
|
+
- DropdownMenu (card action menu in CardHeader)
|
|
19
|
+
- Button (actions in CardHeader)
|
|
20
|
+
- Tooltip (hover info on card elements)
|
|
21
|
+
props:
|
|
22
|
+
- name: variant
|
|
23
|
+
type: "'outline' | 'elevated' | 'ghost'"
|
|
24
|
+
required: false
|
|
25
|
+
default: "'outline'"
|
|
26
|
+
description: "Visual style — outline has border, elevated has shadow, ghost has neither"
|
|
27
|
+
- name: size
|
|
28
|
+
type: "'sm' | 'default' | 'lg'"
|
|
29
|
+
required: false
|
|
30
|
+
default: "'default'"
|
|
31
|
+
description: "Padding size — sm (p-2), default (p-3), lg (p-4)"
|
|
32
|
+
- name: interactive
|
|
33
|
+
type: "boolean"
|
|
34
|
+
required: false
|
|
35
|
+
default: "false"
|
|
36
|
+
description: "Adds cursor-pointer and hover:bg-hover for clickable cards"
|
|
37
|
+
- name: children
|
|
38
|
+
type: React.ReactNode
|
|
39
|
+
required: false
|
|
40
|
+
description: "Card content — free-form, no structured slots"
|
|
41
|
+
- name: className
|
|
42
|
+
type: string
|
|
43
|
+
required: false
|
|
44
|
+
description: "Additional CSS classes merged via cn()"
|
|
45
|
+
props_priority:
|
|
46
|
+
- variant
|
|
47
|
+
- size
|
|
48
|
+
- interactive
|
|
49
|
+
- children
|
|
50
|
+
variants:
|
|
51
|
+
- outline: "bg-surface with border-[0.5px] border-border — default, for inline cards"
|
|
52
|
+
- elevated: "bg-surface with shadow-sm — for floating/dragged cards"
|
|
53
|
+
- ghost: "No border or shadow — for content grouping without visual chrome"
|
|
54
|
+
sizes:
|
|
55
|
+
- sm: "p-2 — compact cards"
|
|
56
|
+
- default: "p-3 — standard cards"
|
|
57
|
+
- lg: "p-4 — spacious cards, dashboard widgets"
|
|
58
|
+
examples:
|
|
59
|
+
- title: "Kanban card"
|
|
60
|
+
code: |
|
|
61
|
+
<Card variant="outline" interactive onClick={() => openIssue(id)}>
|
|
62
|
+
<CardHeader>
|
|
63
|
+
<span className="text-sm text-secondary">MAS-42</span>
|
|
64
|
+
<DropdownMenu items={cardActions} />
|
|
65
|
+
</CardHeader>
|
|
66
|
+
<p className="text-sm font-medium">Fix tooltip positioning</p>
|
|
67
|
+
<div className="flex items-center gap-2 mt-2">
|
|
68
|
+
<Label variant="bug">Bug</Label>
|
|
69
|
+
<span className="flex-1" />
|
|
70
|
+
<Avatar name="Jane Doe" size="xs" />
|
|
71
|
+
</div>
|
|
72
|
+
</Card>
|
|
73
|
+
- title: "Elevated dashboard widget"
|
|
74
|
+
code: |
|
|
75
|
+
<Card variant="elevated" size="lg">
|
|
76
|
+
<CardHeader>
|
|
77
|
+
<h3 className="text-sm font-semibold">Sprint Progress</h3>
|
|
78
|
+
</CardHeader>
|
|
79
|
+
<div>Chart content here</div>
|
|
80
|
+
</Card>
|
|
81
|
+
- title: "Ghost grouping"
|
|
82
|
+
code: |
|
|
83
|
+
<Card variant="ghost">
|
|
84
|
+
<p className="text-xs text-muted">Grouped content without visual chrome</p>
|
|
85
|
+
</Card>
|
|
86
|
+
anti_patterns:
|
|
87
|
+
- "Don't add structured slots (title, description, footer) — keep Card as a surface primitive with free children"
|
|
88
|
+
- "Don't use Card for navigation items — use Sidebar or List"
|
|
89
|
+
- "Don't nest Cards inside Cards — flatten the hierarchy"
|
|
90
|
+
- "Don't use variant='ghost' when you just need a div with padding — Card adds semantic grouping and data-slot"
|
|
91
|
+
accessibility_notes: "Renders as a <div>. The interactive prop is styling-only (cursor, hover, focus-visible). Consumer must add role='button', tabIndex={0}, and onClick/onKeyDown for keyboard accessibility. Card provides focus-visible:bg-hover so keyboard focus is visible."
|
|
92
|
+
notes: "Sub-components: Card (surface container), CardHeader (flex row for title + actions with mb-2 spacing). Uses rounded-dialog (the control radius, never under 8px: 8px by default) for border radius. No new tokens required — uses existing bg-surface, border, shadow-sm."
|
|
93
|
+
related_patterns:
|
|
94
|
+
- kanban-board
|
|
@@ -0,0 +1,54 @@
|
|
|
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 cardVariants = cva("rounded-dialog text-foreground", {
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
outline: "bg-surface border-[0.5px] border-border",
|
|
10
|
+
elevated: "bg-surface shadow-sm",
|
|
11
|
+
ghost: "",
|
|
12
|
+
},
|
|
13
|
+
size: {
|
|
14
|
+
sm: "p-2",
|
|
15
|
+
default: "p-3",
|
|
16
|
+
lg: "p-4",
|
|
17
|
+
},
|
|
18
|
+
interactive: {
|
|
19
|
+
true: "cursor-pointer hover:bg-hover focus-visible:bg-hover transition-colors duration-75 outline-hidden",
|
|
20
|
+
false: "",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: {
|
|
24
|
+
variant: "outline",
|
|
25
|
+
size: "default",
|
|
26
|
+
interactive: false,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
interface CardProps extends React.ComponentProps<"div">, VariantProps<typeof cardVariants> {}
|
|
31
|
+
|
|
32
|
+
function Card({ className, variant, size, interactive, ...props }: CardProps) {
|
|
33
|
+
return (
|
|
34
|
+
<div
|
|
35
|
+
data-slot="card"
|
|
36
|
+
className={cn(cardVariants({ variant, size, interactive, className }))}
|
|
37
|
+
{...props}
|
|
38
|
+
/>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const cardHeaderVariants = cva("flex items-center justify-between mb-2 [&:last-child]:mb-0");
|
|
43
|
+
|
|
44
|
+
interface CardHeaderProps
|
|
45
|
+
extends React.ComponentProps<"div">, VariantProps<typeof cardHeaderVariants> {}
|
|
46
|
+
|
|
47
|
+
function CardHeader({ className, ...props }: CardHeaderProps) {
|
|
48
|
+
return (
|
|
49
|
+
<div data-slot="card-header" className={cn(cardHeaderVariants({ className }))} {...props} />
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export { Card, cardVariants, CardHeader, cardHeaderVariants };
|
|
54
|
+
export type { CardProps, CardHeaderProps };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
name: Checkbox
|
|
2
|
+
description: "A compact 16px checkbox built on Base UI. Supports checked, unchecked, and indeterminate states."
|
|
3
|
+
layer: core
|
|
4
|
+
category: input
|
|
5
|
+
when_to_use:
|
|
6
|
+
- "For boolean selections in forms"
|
|
7
|
+
- "For multi-select lists with select-all (indeterminate)"
|
|
8
|
+
- "For task completion toggles"
|
|
9
|
+
when_not_to_use:
|
|
10
|
+
- "For on/off settings — use Toggle component"
|
|
11
|
+
- "For single-choice selection — use radio buttons"
|
|
12
|
+
composition_partners:
|
|
13
|
+
- Label
|
|
14
|
+
- Table
|
|
15
|
+
- Dialog
|
|
16
|
+
props:
|
|
17
|
+
- name: checked
|
|
18
|
+
type: "boolean | 'indeterminate'"
|
|
19
|
+
required: false
|
|
20
|
+
description: "Controlled checked state. Pass 'indeterminate' for mixed state (e.g. select-all)."
|
|
21
|
+
- name: onCheckedChange
|
|
22
|
+
type: "(checked: boolean, eventDetails) => void"
|
|
23
|
+
required: false
|
|
24
|
+
description: "Callback when checked state changes. BEHAVIOR CHANGE vs Radix: the first argument is always a boolean (never 'indeterminate'), and Base UI passes an eventDetails object as second argument (eventDetails.cancel() prevents the change)."
|
|
25
|
+
- name: disabled
|
|
26
|
+
type: boolean
|
|
27
|
+
required: false
|
|
28
|
+
description: "Whether the checkbox is disabled"
|
|
29
|
+
- name: defaultChecked
|
|
30
|
+
type: "boolean | 'indeterminate'"
|
|
31
|
+
required: false
|
|
32
|
+
description: "Initial checked state (uncontrolled mode). 'indeterminate' shows the dash until the first user toggle (which checks the box, like Radix)."
|
|
33
|
+
props_priority:
|
|
34
|
+
- checked
|
|
35
|
+
- onCheckedChange
|
|
36
|
+
- disabled
|
|
37
|
+
- defaultChecked
|
|
38
|
+
examples:
|
|
39
|
+
- title: "Uncontrolled checkbox"
|
|
40
|
+
code: "<Checkbox defaultChecked />"
|
|
41
|
+
- title: "Controlled checkbox"
|
|
42
|
+
code: |
|
|
43
|
+
<Checkbox
|
|
44
|
+
checked={selected}
|
|
45
|
+
onCheckedChange={setSelected}
|
|
46
|
+
/>
|
|
47
|
+
- title: "Indeterminate (select-all)"
|
|
48
|
+
code: |
|
|
49
|
+
<Checkbox
|
|
50
|
+
checked={allSelected ? true : someSelected ? "indeterminate" : false}
|
|
51
|
+
onCheckedChange={toggleAll}
|
|
52
|
+
/>
|
|
53
|
+
anti_patterns:
|
|
54
|
+
- "Don't mix controlled and uncontrolled indeterminate — use checked='indeterminate' (controlled) or defaultChecked='indeterminate' (uncontrolled, cleared on first toggle), not both"
|
|
55
|
+
- "Don't add custom size via className — the 16px size is fixed by design"
|
|
56
|
+
- "Don't use Toggle instead of Checkbox for form submissions — Checkbox has proper form semantics"
|
|
57
|
+
- "Don't pair a Checkbox with a StatusIcon (done/todo) in the same row — both encode the same complete/incomplete boolean, which is redundant and visually noisy. Pick one: Checkbox for a binary completion toggle, StatusIcon only when you have ≥3 real workflow states."
|
|
58
|
+
accessibility_notes: "Renders native checkbox role. Supports indeterminate via aria-checked='mixed'. Keyboard: Space to toggle. Label association via wrapping or htmlFor/id."
|
|
59
|
+
notes: "Indeterminate works controlled (checked='indeterminate') and uncontrolled (defaultChecked='indeterminate' — the dash shows until the first user toggle, which checks the box, matching Radix)."
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox";
|
|
3
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
4
|
+
|
|
5
|
+
import { cn } from "../../../lib/utils";
|
|
6
|
+
import { KitPart } from "../../../kit/kit";
|
|
7
|
+
|
|
8
|
+
const checkboxVariants = cva(
|
|
9
|
+
"size-4 shrink-0 rounded-sm border border-border cursor-pointer inline-flex items-center justify-center transition-colors duration-100 data-checked:bg-accent data-checked:border-accent data-checked:text-white data-indeterminate:bg-accent data-indeterminate:border-accent data-indeterminate:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:opacity-50 disabled:cursor-not-allowed",
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
interface CheckboxProps
|
|
13
|
+
extends
|
|
14
|
+
Omit<
|
|
15
|
+
React.ComponentProps<typeof CheckboxPrimitive.Root>,
|
|
16
|
+
// `render`/`nativeButton`/`indeterminate` are managed internally (the
|
|
17
|
+
// control always renders a native <button>; indeterminate derives from
|
|
18
|
+
// checked/defaultChecked). They are also discarded at runtime below,
|
|
19
|
+
// since JS consumers bypass the TS Omit.
|
|
20
|
+
"checked" | "defaultChecked" | "indeterminate" | "render" | "nativeButton"
|
|
21
|
+
>,
|
|
22
|
+
VariantProps<typeof checkboxVariants> {
|
|
23
|
+
/** Radix-compatible checked state: `true`, `false`, or `"indeterminate"`.
|
|
24
|
+
* Translated internally to Base UI's separate `indeterminate` boolean prop. */
|
|
25
|
+
checked?: boolean | "indeterminate";
|
|
26
|
+
/** Radix-compatible uncontrolled initial state, incl. `"indeterminate"`.
|
|
27
|
+
* The first user toggle checks the box and clears the indeterminate dash. */
|
|
28
|
+
defaultChecked?: boolean | "indeterminate";
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function Checkbox({
|
|
32
|
+
className,
|
|
33
|
+
checked,
|
|
34
|
+
defaultChecked,
|
|
35
|
+
onCheckedChange,
|
|
36
|
+
...props
|
|
37
|
+
}: CheckboxProps) {
|
|
38
|
+
// Uncontrolled Radix-style `defaultChecked="indeterminate"`: show the dash
|
|
39
|
+
// until the first non-canceled user toggle, which then behaves like Radix
|
|
40
|
+
// (indeterminate → checked).
|
|
41
|
+
const [uncontrolledIndeterminate, setUncontrolledIndeterminate] = React.useState(
|
|
42
|
+
defaultChecked === "indeterminate",
|
|
43
|
+
);
|
|
44
|
+
const indeterminate =
|
|
45
|
+
checked === "indeterminate" || (checked === undefined && uncontrolledIndeterminate);
|
|
46
|
+
// The TS Omit hides these, but JS consumers could still pass them and the
|
|
47
|
+
// {...props} spread comes last — discard so the internal values always win.
|
|
48
|
+
delete (props as Record<string, unknown>).render;
|
|
49
|
+
delete (props as Record<string, unknown>).nativeButton;
|
|
50
|
+
delete (props as Record<string, unknown>).indeterminate;
|
|
51
|
+
return (
|
|
52
|
+
<CheckboxPrimitive.Root
|
|
53
|
+
data-slot="checkbox"
|
|
54
|
+
// Render a native <button> (Base UI defaults to <span>) to keep the
|
|
55
|
+
// Radix-era DOM contract: native disabled attr + :disabled styling.
|
|
56
|
+
render={<button type="button" />}
|
|
57
|
+
nativeButton
|
|
58
|
+
className={cn(checkboxVariants({ className }))}
|
|
59
|
+
checked={checked === "indeterminate" ? false : checked}
|
|
60
|
+
defaultChecked={defaultChecked === "indeterminate" ? false : defaultChecked}
|
|
61
|
+
indeterminate={indeterminate}
|
|
62
|
+
onCheckedChange={(nextChecked, eventDetails) => {
|
|
63
|
+
onCheckedChange?.(nextChecked, eventDetails);
|
|
64
|
+
if (!eventDetails.isCanceled) setUncontrolledIndeterminate(false);
|
|
65
|
+
}}
|
|
66
|
+
{...props}
|
|
67
|
+
>
|
|
68
|
+
<CheckboxPrimitive.Indicator className="flex items-center justify-center">
|
|
69
|
+
<KitPart
|
|
70
|
+
name="checkbox.glyph"
|
|
71
|
+
props={{ state: indeterminate ? "indeterminate" : "checked" }}
|
|
72
|
+
>
|
|
73
|
+
{indeterminate ? (
|
|
74
|
+
<svg
|
|
75
|
+
aria-hidden="true"
|
|
76
|
+
className="size-3"
|
|
77
|
+
viewBox="0 0 24 24"
|
|
78
|
+
fill="none"
|
|
79
|
+
stroke="currentColor"
|
|
80
|
+
strokeWidth="3"
|
|
81
|
+
strokeLinecap="round"
|
|
82
|
+
>
|
|
83
|
+
<path d="M5 12h14" />
|
|
84
|
+
</svg>
|
|
85
|
+
) : (
|
|
86
|
+
<svg
|
|
87
|
+
aria-hidden="true"
|
|
88
|
+
className="size-3"
|
|
89
|
+
viewBox="0 0 24 24"
|
|
90
|
+
fill="none"
|
|
91
|
+
stroke="currentColor"
|
|
92
|
+
strokeWidth="3"
|
|
93
|
+
strokeLinecap="round"
|
|
94
|
+
strokeLinejoin="round"
|
|
95
|
+
>
|
|
96
|
+
<polyline points="20 6 9 17 4 12" />
|
|
97
|
+
</svg>
|
|
98
|
+
)}
|
|
99
|
+
</KitPart>
|
|
100
|
+
</CheckboxPrimitive.Indicator>
|
|
101
|
+
</CheckboxPrimitive.Root>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export { Checkbox, checkboxVariants };
|
|
106
|
+
export type { CheckboxProps };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
import { cn } from "../../../lib/utils";
|
|
4
|
+
|
|
5
|
+
/** Things side by side on a line, centred, 8px apart, wrapping when they must (a control, then its badge). It takes
|
|
6
|
+
* the room it sits in (a PropertyRow's value). */
|
|
7
|
+
function Cluster({ className, ...props }: React.ComponentProps<"div">) {
|
|
8
|
+
return (
|
|
9
|
+
<div
|
|
10
|
+
data-slot="cluster"
|
|
11
|
+
className={cn("flex min-w-0 flex-1 flex-wrap items-center gap-2", className)}
|
|
12
|
+
{...props}
|
|
13
|
+
/>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { Cluster };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Cluster } from "./cluster";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: CodeBlock
|
|
2
|
+
description: "Code to read and copy: the kit's mono font on the hover tint, its line breaks and indentation kept, long lines scrolling sideways (ScrollArea), a Copy button in its corner on hover or focus. Coloured from tokens a caller highlights (Shiki in its own bundle), the colours from the theme."
|
|
3
|
+
layer: core
|
|
4
|
+
category: data-display
|
|
5
|
+
when_to_use:
|
|
6
|
+
- "A sample's code (Design system), a command to run, a value to paste elsewhere"
|
|
7
|
+
when_not_to_use:
|
|
8
|
+
- "A word of code inside a sentence — use a <code> element"
|
|
9
|
+
- "A key to press — use Kbd"
|
|
10
|
+
props:
|
|
11
|
+
- name: code
|
|
12
|
+
type: string
|
|
13
|
+
required: true
|
|
14
|
+
description: "The code, as written"
|
|
15
|
+
- name: tokens
|
|
16
|
+
type: "{ content: string; color?: string }[][]"
|
|
17
|
+
required: false
|
|
18
|
+
description: "The code cut into coloured pieces, line by line (Shiki's codeToTokens(…).tokens with its css-variables theme, run in the caller's bundle, never the kit's); none: plain. Copy copies code"
|
|
19
|
+
- name: language
|
|
20
|
+
type: string
|
|
21
|
+
required: false
|
|
22
|
+
description: "Its language ('tsx', 'css'): data-language"
|
|
23
|
+
composition_partners:
|
|
24
|
+
- Collapsible (closed under a sample)
|
|
25
|
+
examples:
|
|
26
|
+
- title: "A component's call"
|
|
27
|
+
code: |
|
|
28
|
+
<CodeBlock language="tsx" code={'<MultiPane nav={list} main={record} />'} />
|
|
29
|
+
accessibility_notes: "The Copy button is named Copy code, then Copied for a moment; it shows on hover and on keyboard focus."
|
|
30
|
+
notes: "Sub-parts by data-slot: code-block (data-language). Copies with the kit's copyText (plain HTTP on the LAN included)."
|