@brightspot/ui 6.8.0 → 6.8.2
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/CHANGELOG.md +661 -0
- package/README.md +18 -2
- package/dist/storybook/CHANGELOG.md +661 -0
- package/dist/storybook/README.md +195 -0
- package/dist/storybook/assets/{ActionBar.stories-CJBn-mku.js → ActionBar.stories-TlhuCumU.js} +31 -28
- package/dist/storybook/assets/ActionItem-CjtyGLd5.js +16 -0
- package/dist/storybook/assets/{ActionItem.stories-DXzC9C1u.js → ActionItem.stories-BVlNQvfP.js} +2 -2
- package/dist/storybook/assets/AiSparkle.stories-DMzc8JUe.js +73 -0
- package/dist/storybook/assets/Avatar-C6Li1sPI.js +4 -0
- package/dist/storybook/assets/Avatar.stories-COj6XrPn.js +213 -0
- package/dist/storybook/assets/AvatarGroup-DgxRTZBe.js +1 -0
- package/dist/storybook/assets/AvatarGroup.stories-Dh3e7iN2.js +225 -0
- package/dist/storybook/assets/Badge-bWrvpEgX.js +1 -0
- package/dist/storybook/assets/{Badge.stories-DEpoJpUZ.js → Badge.stories-KXpmEXpt.js} +4 -4
- package/dist/storybook/assets/Banner-FSFX1AIb.css +1 -0
- package/dist/storybook/assets/{Banner.stories--jeU6fKq.js → Banner.stories-Cnhm3dXK.js} +14 -14
- package/dist/storybook/assets/Button-DE0s-gat.js +10 -0
- package/dist/storybook/assets/Button.stories-Cwg1YZEb.js +54 -0
- package/dist/storybook/assets/ButtonGroup-CoLI5nGO.js +1 -0
- package/dist/storybook/assets/{ButtonGroup.stories-CerE_0AC.js → ButtonGroup.stories-VhnKPP1n.js} +7 -7
- package/dist/storybook/assets/Card-DyntwdY-.css +1 -0
- package/dist/storybook/assets/{Card.stories-5SxHtU3Y.js → Card.stories-BgpL90zB.js} +60 -29
- package/dist/storybook/assets/{Celebrate.stories-COS789GX.js → Celebrate.stories-D3NJgYcX.js} +5 -5
- package/dist/storybook/assets/Checkbox-BC1T_KxW.js +30 -0
- package/dist/storybook/assets/{Checkbox.stories-DuQu38Gv.js → Checkbox.stories-AFQNz7dQ.js} +10 -10
- package/dist/storybook/assets/CircularProgress-eqVb2jUD.js +42 -0
- package/dist/storybook/assets/{CircularProgress.stories-Lf2Ws46Y.js → CircularProgress.stories-B6t8VhmJ.js} +2 -2
- package/dist/storybook/assets/ClipboardMixin-DcxrOy5B.js +1 -0
- package/dist/storybook/assets/{ClipboardMixin.stories-BT5KfLZ_.js → ClipboardMixin.stories-BqtQMjmS.js} +6 -6
- package/dist/storybook/assets/{Color-6BZIO3FS-BNBxjqrS.js → Color-6BZIO3FS-CDluohEc.js} +1 -1
- package/dist/storybook/assets/{Colors.stories-Ck6bXbd0.js → Colors.stories-CqTniDIa.js} +1 -1
- package/dist/storybook/assets/{CombinedEffects.stories-DLELdAMr.js → CombinedEffects.stories-FwW0chy5.js} +2 -2
- package/dist/storybook/assets/{ComponentStatesMixin-B6uJL_2c.js → ComponentStatesMixin-hUqOL2aW.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin.stories-fiyrALkY.js → ComponentStatesMixin.stories-CwGoq685.js} +1 -1
- package/dist/storybook/assets/{CopyToClipboard.stories-2OfBH19_.js → CopyToClipboard.stories-DUGjgtQx.js} +18 -10
- package/dist/storybook/assets/{Debounce.stories-C9qo3lIN.js → Debounce.stories-CrWfXhKS.js} +1 -1
- package/dist/storybook/assets/{DocsRenderer-LL677BLK-CBVYZYjR.js → DocsRenderer-LL677BLK-9e51z9Xc.js} +3 -3
- package/dist/storybook/assets/{Dropdown.stories-15ZDMkRz.js → Dropdown.stories-BsBxV0wp.js} +2 -2
- package/dist/storybook/assets/DropdownMenu-B-LvOIGj.js +42 -0
- package/dist/storybook/assets/EmptyState-h0A4Qpiu.css +1 -0
- package/dist/storybook/assets/{EmptyState.stories-Bjb8hzYj.js → EmptyState.stories-CJ1w8Tp2.js} +33 -21
- package/dist/storybook/assets/EscaAvatar.stories-BoLLSj9q.js +140 -0
- package/dist/storybook/assets/{Events.stories-BV0vMF2I.js → Events.stories-C3sTBwPJ.js} +2 -2
- package/dist/storybook/assets/{Heading.stories-CEUJqUbQ.js → Heading.stories-jmXDRBmM.js} +1 -1
- package/dist/storybook/assets/{HueRipple.stories-CwvtcOM_.js → HueRipple.stories-BPx5aSYd.js} +2 -2
- package/dist/storybook/assets/Icon-CWyJRQf7.js +34409 -0
- package/dist/storybook/assets/{Icon.stories-AB_v-61c.js → Icon.stories-iYBxmv2x.js} +10 -10
- package/dist/storybook/assets/IconButton-Di5Rgs7F.js +12 -0
- package/dist/storybook/assets/{IconButton.stories-BHuHsM3k.js → IconButton.stories-DENLoxVk.js} +2 -2
- package/dist/storybook/assets/LinearProgress-D9ngIVlv.js +25 -0
- package/dist/storybook/assets/{LinearProgress.stories-BNN5SXe3.js → LinearProgress.stories-u90B_VJR.js} +2 -2
- package/dist/storybook/assets/Message-CM3eexdu.css +1 -0
- package/dist/storybook/assets/Message-nFAa55c_.js +28 -0
- package/dist/storybook/assets/{Message.stories-DdLhMXnb.js → Message.stories-B4rpz5rI.js} +2 -2
- package/dist/storybook/assets/OnFindMixin-oL1bvTFj.js +1 -0
- package/dist/storybook/assets/{OnFindMixin.stories-B-5TeBOF.js → OnFindMixin.stories-CdeS5sFA.js} +9 -9
- package/dist/storybook/assets/Pagination-CSWcjuDU.js +88 -0
- package/dist/storybook/assets/{Pagination.stories-C9zsOdb2.js → Pagination.stories-Da2WzJkv.js} +33 -33
- package/dist/storybook/assets/{Popover.stories-BiqIwebU.js → Popover.stories-CVljlVHc.js} +16 -16
- package/dist/storybook/assets/ProgressMixin-CeSrn0_P.js +1 -0
- package/dist/storybook/assets/Radio-rvfGhZwK.js +25 -0
- package/dist/storybook/assets/{Radio.stories-BmrEdPkm.js → Radio.stories-B0wHdJuc.js} +6 -6
- package/dist/storybook/assets/{RadioGroup.stories-ChARVXs3.js → RadioGroup.stories-D8krOSlP.js} +22 -22
- package/dist/storybook/assets/{ReadyMixin-BbuzH3uO.js → ReadyMixin-CvX_eidU.js} +1 -1
- package/dist/storybook/assets/RovingTabindexMixin-9z8lwaM9.js +1 -0
- package/dist/storybook/assets/{RovingTabindexMixin.stories-xm4b394_.js → RovingTabindexMixin.stories-Y8vBWjJp.js} +5 -5
- package/dist/storybook/assets/{Rtc.stories-DdcMaELA.js → Rtc.stories-D3Y-z8y_.js} +1 -1
- package/dist/storybook/assets/{ScrollShadow.stories-CI67Ougx.js → ScrollShadow.stories-1KD0lWHX.js} +1 -1
- package/dist/storybook/assets/{Switch.stories-DOqrRkxc.js → Switch.stories-Bsqvm_HE.js} +60 -27
- package/dist/storybook/assets/{Tab.stories-DN8o4cf_.js → Tab.stories-CzcTisNs.js} +7 -7
- package/dist/storybook/assets/Tabs-DdpYNZSW.js +17 -0
- package/dist/storybook/assets/{Tabs.stories-BEowfCcl.js → Tabs.stories-UOS3V0J4.js} +6 -6
- package/dist/storybook/assets/{Throttle.stories-BZ_nsuw1.js → Throttle.stories-C8jgzh6e.js} +1 -1
- package/dist/storybook/assets/Tooltip.stories-B5BoI0cH.js +143 -0
- package/dist/storybook/assets/TooltipMixin-CVKslCDt.js +1 -0
- package/dist/storybook/assets/{Upload.stories-sAEiabwq.js → Upload.stories-BsQDCDqo.js} +102 -52
- package/dist/storybook/assets/UploadItem-CYQqNwUF.js +54 -0
- package/dist/storybook/assets/{UploadItem.stories-C19JMfmB.js → UploadItem.stories-_le7XBTV.js} +4 -4
- package/dist/storybook/assets/{Welcome.stories-C30jg0r1.js → Welcome.stories-rramKkhd.js} +38 -8
- package/dist/storybook/assets/Widget-elBzGg8w.css +1 -0
- package/dist/storybook/assets/Widget.stories-DtbAaklk.js +279 -0
- package/dist/storybook/assets/{WithTooltip-65CFNBJE-PFRy5maL.js → WithTooltip-65CFNBJE-DK6GcBuR.js} +1 -1
- package/dist/storybook/assets/ai-sparkle-BZMJJAxY.js +1 -0
- package/dist/storybook/assets/aria-D5THOgos.js +1 -0
- package/dist/storybook/assets/{blocks-DLjjvsFT.js → blocks-DHnzPh43.js} +5 -5
- package/dist/storybook/assets/esca-glow-BwdhBvIX.js +2 -0
- package/dist/storybook/assets/esca-idle-B-fumiIb.js +1 -0
- package/dist/storybook/assets/esca-search-rwNfo19I.js +1 -0
- package/dist/storybook/assets/esca-task-complete-BAJP2dY2.js +1 -0
- package/dist/storybook/assets/esca-wave-Bjs4CUR7.js +1 -0
- package/dist/storybook/assets/{formatter-EIJCOSYU-D39uscG_.js → formatter-EIJCOSYU-qig-qWlG.js} +1 -1
- package/dist/storybook/assets/i18n-BQ-Uj-0B.js +1 -0
- package/dist/storybook/assets/if-defined-DerKRcyC.js +1 -0
- package/dist/storybook/assets/{iframe-B9buZjP7.js → iframe-DlBK9Drk.js} +24 -24
- package/dist/storybook/assets/{index-BdEHup-4.js → index-CItQyB37.js} +1 -1
- package/dist/storybook/assets/lottie_svg-C3v6xdng.js +2 -0
- package/dist/storybook/assets/{onFind-CGzSFqNN.js → onFind-Ci35eu2y.js} +1 -1
- package/dist/storybook/assets/{onFind.stories-Dq71qO14.js → onFind.stories-BmbwWWo1.js} +1 -1
- package/dist/storybook/assets/{onRemove.stories-B1GqLH_U.js → onRemove.stories-DFWCIgE4.js} +1 -1
- package/dist/storybook/assets/{onVisible.stories-BNKxOfLw.js → onVisible.stories-B-onpgE-.js} +1 -1
- package/dist/storybook/assets/property-Bmq4RTSP.js +1 -0
- package/dist/storybook/assets/ref-BhKk4SDh.js +1 -0
- package/dist/storybook/assets/state-DVIUS0Gf.js +1 -0
- package/dist/storybook/assets/{style-map-qCiIYcp5.js → style-map-DE4G47KD.js} +1 -1
- package/dist/storybook/assets/{syntaxhighlighter-ED5Y7EFY-CUM-CaRF.js → syntaxhighlighter-ED5Y7EFY-Dfgnal1d.js} +1 -1
- package/dist/storybook/custom-elements.json +11835 -0
- package/dist/storybook/docs/components/ActionBar.md +55 -0
- package/dist/storybook/docs/components/ActionItem.md +50 -0
- package/dist/storybook/docs/components/AiSparkle.md +33 -0
- package/dist/storybook/docs/components/Avatar.md +45 -0
- package/dist/storybook/docs/components/AvatarGroup.md +34 -0
- package/dist/storybook/docs/components/Badge.md +47 -0
- package/dist/storybook/docs/components/Banner.md +35 -0
- package/dist/storybook/docs/components/ButtonGroup.md +65 -0
- package/dist/storybook/docs/components/Card.md +67 -0
- package/dist/storybook/docs/components/Checkbox.md +49 -0
- package/dist/storybook/docs/components/CircularProgress.md +40 -0
- package/dist/storybook/docs/components/CopyToClipboard.md +51 -0
- package/dist/storybook/docs/components/Dropdown.md +74 -0
- package/dist/storybook/docs/components/DropdownItem.md +45 -0
- package/dist/storybook/docs/components/DropdownMenu.md +41 -0
- package/dist/storybook/docs/components/EmptyState.md +62 -0
- package/dist/storybook/docs/components/EscaAvatar.md +40 -0
- package/dist/storybook/docs/components/Icon.md +40 -0
- package/dist/storybook/docs/components/IconButton.md +36 -0
- package/dist/storybook/docs/components/LinearProgress.md +37 -0
- package/dist/storybook/docs/components/Message.md +50 -0
- package/dist/storybook/docs/components/Pagination.md +70 -0
- package/dist/storybook/docs/components/Popover.md +59 -0
- package/dist/storybook/docs/components/README.md +48 -0
- package/dist/storybook/docs/components/Radio.md +55 -0
- package/dist/storybook/docs/components/RadioGroup.md +34 -0
- package/dist/storybook/docs/components/Switch.md +48 -0
- package/dist/storybook/docs/components/Tab.md +40 -0
- package/dist/storybook/docs/components/Tabs.md +49 -0
- package/dist/storybook/docs/components/Upload.md +63 -0
- package/dist/storybook/docs/components/UploadItem.md +30 -0
- package/dist/storybook/docs/components/Widget.md +88 -0
- package/dist/storybook/docs/dari-elements.md +55 -0
- package/dist/storybook/iframe.html +1 -1
- package/dist/storybook/index.html +29 -2
- package/dist/storybook/llms-full.txt +1721 -0
- package/dist/storybook/llms.txt +65 -0
- package/dist/storybook/project.json +1 -1
- package/dist/storybook/robots.txt +7 -0
- package/dist/storybook/sb-addons/storybook-3/manager-bundle.js +1 -1
- package/dist/storybook/sitemap.xml +90 -0
- package/docs/components/ActionBar.md +41 -64
- package/docs/components/ActionItem.md +50 -96
- package/docs/components/AiSparkle.md +23 -60
- package/docs/components/Avatar.md +45 -88
- package/docs/components/AvatarGroup.md +24 -44
- package/docs/components/Badge.md +34 -62
- package/docs/components/Banner.md +25 -39
- package/docs/components/ButtonGroup.md +65 -99
- package/docs/components/Card.md +67 -83
- package/docs/components/Checkbox.md +49 -91
- package/docs/components/CircularProgress.md +40 -84
- package/docs/components/CopyToClipboard.md +35 -40
- package/docs/components/Dropdown.md +74 -120
- package/docs/components/DropdownItem.md +45 -81
- package/docs/components/DropdownMenu.md +30 -70
- package/docs/components/EmptyState.md +45 -62
- package/docs/components/EscaAvatar.md +30 -61
- package/docs/components/Icon.md +29 -62
- package/docs/components/IconButton.md +36 -83
- package/docs/components/LinearProgress.md +28 -70
- package/docs/components/Message.md +38 -63
- package/docs/components/Pagination.md +70 -100
- package/docs/components/Popover.md +46 -79
- package/docs/components/README.md +34 -40
- package/docs/components/Radio.md +55 -105
- package/docs/components/RadioGroup.md +26 -55
- package/docs/components/Switch.md +48 -84
- package/docs/components/Tab.md +30 -70
- package/docs/components/Tabs.md +49 -86
- package/docs/components/Upload.md +63 -112
- package/docs/components/UploadItem.md +22 -53
- package/docs/components/Widget.md +66 -67
- package/llms.txt +63 -0
- package/package.json +9 -6
- package/dist/storybook/assets/AiSparkle.stories-BfjT5jrJ.js +0 -72
- package/dist/storybook/assets/Avatar.stories-D8lnIZaY.js +0 -213
- package/dist/storybook/assets/AvatarGroup.stories-Cz9oVah0.js +0 -225
- package/dist/storybook/assets/Button-2ucj5lUP.js +0 -10
- package/dist/storybook/assets/Button.stories-ndl1RJd7.js +0 -54
- package/dist/storybook/assets/EscaAvatar.stories-Rc2MSzCX.js +0 -139
- package/dist/storybook/assets/LucideDynamicLoader-BuoNL33C.js +0 -1
- package/dist/storybook/assets/Tooltip.stories-3bar43ZN.js +0 -143
- package/dist/storybook/assets/Widget.stories-9-1XpZNl.js +0 -233
- package/dist/storybook/assets/if-defined-BwWBCoAU.js +0 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# `<btu-dropdown>`
|
|
2
|
+
|
|
3
|
+
A dropdown component that renders a trigger button and manages a floating panel
|
|
4
|
+
containing a `btu-dropdown-menu`.
|
|
5
|
+
|
|
6
|
+
Uses the native Popover API and CSS anchor positioning for panel management.
|
|
7
|
+
The trigger button is built with existing `btu-button-*` classes.
|
|
8
|
+
|
|
9
|
+
**Trigger button styling:** Set `--button-*` CSS custom properties on `<btu-dropdown>`
|
|
10
|
+
or a parent element to customize the trigger via CSS inheritance (e.g.,
|
|
11
|
+
`--button-border-radius`, `--button-color-background`). See
|
|
12
|
+
`tailwind-plugin-button.ts` for available props.
|
|
13
|
+
|
|
14
|
+
```js
|
|
15
|
+
import '@brightspot/ui/components/dropdown/Dropdown.js'
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Interactive examples: https://ui.brightspot.com/?path=/docs/components-dropdown--docs
|
|
19
|
+
|
|
20
|
+
## Attributes
|
|
21
|
+
|
|
22
|
+
| Attribute | Property | Type | Default | Description |
|
|
23
|
+
| --- | --- | --- | --- | --- |
|
|
24
|
+
| `label` | `label` | `string` | `''` | Trigger button text. |
|
|
25
|
+
| `open` | `open` | `boolean` | `false` | Panel visibility state. Can be set programmatically (e.g., for tour UIs) — syncs to `showPopover()`/`hidePopover()` in `updated()`. |
|
|
26
|
+
| `placement` | `placement` | `'bottom-start' \| 'bottom-end' \| 'top-start' \| 'top-end'` | `'bottom-start'` | Panel placement: 'bottom-start', 'bottom-end', 'top-start', 'top-end'. |
|
|
27
|
+
| `size` | `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Button size: 'sm', 'md', 'lg'. |
|
|
28
|
+
| `disabled` | `disabled` | `boolean` | `false` | Prevents opening. |
|
|
29
|
+
| `variant` | `variant` | `'primary' \| 'secondary' \| 'tertiary' \| 'primary-clear' \| 'secondary-clear' \| 'tertiary-clear'` | `'secondary'` | Button variant: 'primary', 'secondary', 'tertiary', 'primary-clear', 'secondary-clear', 'tertiary-clear'. |
|
|
30
|
+
| `symbol` | `symbol` | `string` | `''` | Lucide icon symbol for the trigger. |
|
|
31
|
+
| `icon-position` | `iconPosition` | `'leading' \| 'trailing'` | `'leading'` | Icon position: 'leading' or 'trailing'. |
|
|
32
|
+
| `icon-only` | `iconOnly` | `boolean` | `false` | Hides label, shows icon only. |
|
|
33
|
+
| `stay-open-on-select` | `stayOpenOnSelect` | `boolean` | `false` | Keeps panel open on item click. |
|
|
34
|
+
| `no-chevron` | `noChevron` | `boolean` | `false` | Hides the chevron icon on the trigger button. |
|
|
35
|
+
| `tooltip` | `tooltip` | `string` | `''` | Tooltip text content. Set to empty string to remove the tooltip. |
|
|
36
|
+
| `tooltip-position` | `tooltipPosition` | `'top' \| 'bottom' \| 'left' \| 'right'` | `'top'` | Position relative to the host element. Auto-flips when constrained by the viewport. |
|
|
37
|
+
| `tooltip-delay` | `tooltipDelay` | `number` | `300` | Show delay in milliseconds (hover trigger only). |
|
|
38
|
+
| `tooltip-offset` | `tooltipOffset` | `'sm' \| 'md' \| 'lg' \| 'xl' \| null` | `null` | Gap between host and tooltip (sm=4px, md=8px, lg=12px, xl=16px). |
|
|
39
|
+
| `tooltip-no-arrow` | `tooltipNoArrow` | `boolean` | `false` | Hide the arrow pseudo-element. |
|
|
40
|
+
| `tooltip-trigger` | `tooltipTrigger` | `string` | `'hover focus'` | Space-separated trigger types: 'hover', 'focus', 'click'. |
|
|
41
|
+
|
|
42
|
+
## Events
|
|
43
|
+
|
|
44
|
+
| Event | Detail | Description |
|
|
45
|
+
| --- | --- | --- |
|
|
46
|
+
| `btu-dropdown-ready` | | Fired after first render and initialization |
|
|
47
|
+
| `btu-dropdown-show` | | Fired when the dropdown panel opens |
|
|
48
|
+
| `btu-dropdown-hide` | | Fired when the dropdown panel closes |
|
|
49
|
+
| `btu-dropdown-item-select` | `{label: string, value: string, selected: boolean}` | Fired when a menu item is activated (bubbles from btu-dropdown-item) |
|
|
50
|
+
| `btu-dropdown-item-favorite` | `{label: string, favorited: boolean}` | Fired when a menu item's favorite is toggled (bubbles from btu-dropdown-item) |
|
|
51
|
+
|
|
52
|
+
## Slots
|
|
53
|
+
|
|
54
|
+
| Slot | Description |
|
|
55
|
+
| --- | --- |
|
|
56
|
+
| (default) | A `btu-dropdown-menu` element containing `btu-dropdown-item` children |
|
|
57
|
+
|
|
58
|
+
## CSS custom properties
|
|
59
|
+
|
|
60
|
+
| Property | Description |
|
|
61
|
+
| --- | --- |
|
|
62
|
+
| `--dropdown-panel-background` | Panel background color (default: white) |
|
|
63
|
+
| `--dropdown-panel-border-color` | Panel border color (default: gray-200) |
|
|
64
|
+
| `--dropdown-panel-border-radius` | Panel border radius (default: borderRadius.lg) |
|
|
65
|
+
| `--dropdown-panel-min-width` | Panel minimum width (default: max(12rem, anchor-size(width))) |
|
|
66
|
+
| `--dropdown-item-background` | Item background color (default: transparent) |
|
|
67
|
+
| `--dropdown-item-color` | Item text color (default: gray-700) |
|
|
68
|
+
| `--dropdown-item-hover-background` | Item hover background (default: gray-100) |
|
|
69
|
+
| `--dropdown-item-hover-color` | Item hover text color (default: gray-900) |
|
|
70
|
+
| `--dropdown-item-selected-background` | Selected item background (default: primary-50) |
|
|
71
|
+
| `--dropdown-item-selected-color` | Selected item text color (default: primary-700) |
|
|
72
|
+
| `--dropdown-item-font-size` | Item font size (default: fontSize.sm) |
|
|
73
|
+
| `--dropdown-divider-color` | Divider line color (default: gray-200) |
|
|
74
|
+
| `--dropdown-empty-color` | Empty state text color (default: gray-400) |
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# `<btu-dropdown-item>`
|
|
2
|
+
|
|
3
|
+
A menu item component for use inside `btu-dropdown-menu`.
|
|
4
|
+
|
|
5
|
+
Renders as a menu item, divider, or subhead depending on the `type` property.
|
|
6
|
+
Supports checkbox mode (inherited from parent menu), icons, keyboard shortcuts,
|
|
7
|
+
and favorite toggles.
|
|
8
|
+
|
|
9
|
+
```js
|
|
10
|
+
import '@brightspot/ui/components/dropdown/DropdownItem.js'
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Attributes
|
|
14
|
+
|
|
15
|
+
| Attribute | Property | Type | Default | Description |
|
|
16
|
+
| --- | --- | --- | --- | --- |
|
|
17
|
+
| `label` | `label` | `string` | `''` | Display text for the item. |
|
|
18
|
+
| `type` | `type` | `'default' \| 'divider' \| 'subhead'` | `'default'` | Item type: 'default', 'divider', or 'subhead'. |
|
|
19
|
+
| `symbol` | `symbol` | `string` | `''` | Lucide icon symbol. |
|
|
20
|
+
| `shortcut` | `shortcut` | `string` | `''` | Keyboard shortcut display text. |
|
|
21
|
+
| `value` | `value` | `string` | `''` | Optional data value associated with the item. |
|
|
22
|
+
| `disabled` | `disabled` | `boolean` | `false` | Whether the item is disabled. |
|
|
23
|
+
| `selected` | `selected` | `boolean` | `false` | Whether the item is selected/checked. |
|
|
24
|
+
| `favorited` | `favorited` | `boolean` | `false` | Whether the item is favorited. |
|
|
25
|
+
| `error` | `error` | `boolean` | `false` | Whether the item has an error. |
|
|
26
|
+
|
|
27
|
+
## Events
|
|
28
|
+
|
|
29
|
+
| Event | Detail | Description |
|
|
30
|
+
| --- | --- | --- |
|
|
31
|
+
| `btu-dropdown-item-ready` | | Fired after first render |
|
|
32
|
+
| `btu-dropdown-item-select` | `{label: string, value: string, selected: boolean}` | Fired when item is activated |
|
|
33
|
+
| `btu-dropdown-item-favorite` | `{label: string, favorited: boolean}` | Fired when favorite is toggled |
|
|
34
|
+
|
|
35
|
+
## CSS custom properties
|
|
36
|
+
|
|
37
|
+
| Property | Description |
|
|
38
|
+
| --- | --- |
|
|
39
|
+
| `--dropdown-item-font-size` | Item font size (default: theme fontSize.sm) |
|
|
40
|
+
| `--dropdown-item-color` | Item text color (default: gray-700) |
|
|
41
|
+
| `--dropdown-item-background` | Item background color (default: transparent) |
|
|
42
|
+
| `--dropdown-item-hover-background` | Background on hover (default: gray-100) |
|
|
43
|
+
| `--dropdown-item-hover-color` | Text color on hover (default: gray-900) |
|
|
44
|
+
| `--dropdown-item-selected-background` | Background when selected (default: primary-50) |
|
|
45
|
+
| `--dropdown-item-selected-color` | Text color when selected (default: primary-700) |
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# `<btu-dropdown-menu>`
|
|
2
|
+
|
|
3
|
+
A menu container component that provides keyboard navigation and ARIA menu semantics.
|
|
4
|
+
|
|
5
|
+
Contains `btu-dropdown-item` children and manages roving tabindex, typeahead search,
|
|
6
|
+
and keyboard navigation following the WAI-ARIA Menu Button Pattern.
|
|
7
|
+
|
|
8
|
+
```js
|
|
9
|
+
import '@brightspot/ui/components/dropdown/DropdownMenu.js'
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Attributes
|
|
13
|
+
|
|
14
|
+
| Attribute | Property | Type | Default | Description |
|
|
15
|
+
| --- | --- | --- | --- | --- |
|
|
16
|
+
| `name` | `name` | `string` | `''` | Accessible name for the menu, displayed in header when header is true. |
|
|
17
|
+
| `header` | `header` | `boolean` | `false` | Show header bar with menu name. |
|
|
18
|
+
| `checkbox` | `checkbox` | `boolean` | `false` | Enable checkbox mode for items (menuitemcheckbox role). |
|
|
19
|
+
| `icon` | `icon` | `boolean` | `false` | Show icons before each item. |
|
|
20
|
+
| `symbol` | `symbol` | `string` | `''` | Fallback Lucide icon symbol for items without their own. |
|
|
21
|
+
| `favorites` | `favorites` | `boolean` | `false` | Show favorite toggle on each item. |
|
|
22
|
+
| `shortcuts` | `shortcuts` | `boolean` | `false` | Show keyboard shortcut text on each item. |
|
|
23
|
+
| `empty-message` | `emptyMessage` | `string` | `'No items available'` | Message displayed when the menu has no focusable items. |
|
|
24
|
+
|
|
25
|
+
## Events
|
|
26
|
+
|
|
27
|
+
| Event | Detail | Description |
|
|
28
|
+
| --- | --- | --- |
|
|
29
|
+
| `btu-dropdown-menu-ready` | | Fired after first render |
|
|
30
|
+
|
|
31
|
+
## Slots
|
|
32
|
+
|
|
33
|
+
| Slot | Description |
|
|
34
|
+
| --- | --- |
|
|
35
|
+
| (default) | Menu items (`btu-dropdown-item` elements) |
|
|
36
|
+
|
|
37
|
+
## CSS custom properties
|
|
38
|
+
|
|
39
|
+
| Property | Description |
|
|
40
|
+
| --- | --- |
|
|
41
|
+
| `--dropdown-empty-color` | Empty state text color (default: gray-400) |
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# `<btu-empty-state>`
|
|
2
|
+
|
|
3
|
+
An empty state component for displaying placeholder content when no data is available.
|
|
4
|
+
|
|
5
|
+
Supports a graphic slot for icons/images/pictures/SVGs, a heading, a description,
|
|
6
|
+
and an actions slot for buttons or links. Available in three sizes (sm, md, lg)
|
|
7
|
+
with semantic heading levels.
|
|
8
|
+
|
|
9
|
+
## Architecture: Light DOM + Pseudo-Slots
|
|
10
|
+
|
|
11
|
+
This component uses **Light DOM** (no Shadow Root) with pseudo-slots:
|
|
12
|
+
- User-provided children are physically moved into internal containers
|
|
13
|
+
- Movement is based on `slot` attributes
|
|
14
|
+
- The `onFind` utility detects and redistributes newly-added children (one-time per element)
|
|
15
|
+
|
|
16
|
+
### Node Redistribution Rules
|
|
17
|
+
- `slot="graphic"` - Moved to graphic container (icon, image, picture, or SVG)
|
|
18
|
+
- `slot="actions"` - Moved to an internal `btu-button-group` (variant="spaced")
|
|
19
|
+
|
|
20
|
+
### Actions composition
|
|
21
|
+
|
|
22
|
+
The actions container IS a `btu-button-group` with `variant="spaced"`. Its `size`
|
|
23
|
+
is mapped from the empty-state `size` prop (sm→small, md→medium, lg→large) so all
|
|
24
|
+
child `btu-button` / `btu-icon-button` elements get consistent sizing and group
|
|
25
|
+
semantics (`role="group"`, roving tabindex, disabled propagation) for free.
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
import '@brightspot/ui/components/empty-state/EmptyState.js'
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Interactive examples: https://ui.brightspot.com/?path=/docs/components-empty-state--docs
|
|
32
|
+
|
|
33
|
+
## Attributes
|
|
34
|
+
|
|
35
|
+
| Attribute | Property | Type | Default | Description |
|
|
36
|
+
| --- | --- | --- | --- | --- |
|
|
37
|
+
| `heading` | `heading` | `string` | `''` | Heading text displayed in the empty state. |
|
|
38
|
+
| `description` | `description` | `string \| undefined` | | Description text displayed below the heading. |
|
|
39
|
+
| `size` | `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Size variant of the empty state. Affects spacing, description text, graphic size, and — when `heading-level` is unset — the default heading level (sm→5, md→4, lg→3). |
|
|
40
|
+
| `heading-level` | `headingLevel` | `number \| undefined` | | Heading level (1-6). When set to a valid integer 1-6, overrides the size-based default and drives both the semantic h1-h6 tag and the visual heading size (btu-heading-1 through btu-heading-6). Invalid values log a warning and fall back to the size-based default. |
|
|
41
|
+
|
|
42
|
+
## Events
|
|
43
|
+
|
|
44
|
+
| Event | Detail | Description |
|
|
45
|
+
| --- | --- | --- |
|
|
46
|
+
| `btu-empty-state-ready` | | Fired after first render and initialization |
|
|
47
|
+
| `btu-button-group-ready` | | Bubbles from the internal actions button-group |
|
|
48
|
+
|
|
49
|
+
## Slots
|
|
50
|
+
|
|
51
|
+
| Slot | Description |
|
|
52
|
+
| --- | --- |
|
|
53
|
+
| `graphic` | Pseudo-slot for icon, image, picture, or SVG graphic. When the child is a `btu-icon`, the component overrides its `size` attribute based on the empty-state `size` prop (sm→md, md→lg, lg→xl). Use an `img`, `picture`, or inline `svg` for full size control. |
|
|
54
|
+
| `actions` | Pseudo-slot for action buttons. Children are moved into an internal `btu-button-group` (variant="spaced"), so size and disabled state are managed by the group. |
|
|
55
|
+
|
|
56
|
+
## CSS custom properties
|
|
57
|
+
|
|
58
|
+
| Property | Description |
|
|
59
|
+
| --- | --- |
|
|
60
|
+
| `--empty-state-max-width` | Maximum width of the content block (default: min(75cqw, 360px)) |
|
|
61
|
+
| `--empty-state-color-heading` | Heading text color (default: gray-900) |
|
|
62
|
+
| `--empty-state-color-description` | Description text color (default: gray-500) |
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# `<btu-esca-avatar>`
|
|
2
|
+
|
|
3
|
+
The animated avatar for the Esca AI assistant, driven entirely by its `state` attribute so the same
|
|
4
|
+
element works wherever the assistant appears.
|
|
5
|
+
|
|
6
|
+
Accessibility: the avatar is a visual indicator, not a status channel. By default it exposes a static
|
|
7
|
+
accessible name (`role="img"`, `aria-label="Esca"`) so it reads like an author/identity avatar; both
|
|
8
|
+
are only set when absent, so consumers can override them.
|
|
9
|
+
- When the assistant is already named in the surrounding UI (the common case in a chat), treat the
|
|
10
|
+
avatar as decorative: set `aria-hidden="true"` to avoid a redundant announcement.
|
|
11
|
+
- Do NOT convey activity (thinking / done) by changing this element's ARIA per `state` — a looping
|
|
12
|
+
`search` would announce repeatedly. Surface status as text in a polite `aria-live` region owned by
|
|
13
|
+
the chat UI, which has the context to word and time announcements. This component intentionally
|
|
14
|
+
does not announce its own state.
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
import '@brightspot/ui/components/esca-avatar/EscaAvatar.js'
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Interactive examples: https://ui.brightspot.com/?path=/docs/components-esca-avatar--docs
|
|
21
|
+
|
|
22
|
+
## Attributes
|
|
23
|
+
|
|
24
|
+
| Attribute | Property | Type | Default | Description |
|
|
25
|
+
| --- | --- | --- | --- | --- |
|
|
26
|
+
| `state` | `state` | `'idle' \| 'wave' \| 'search' \| 'complete' \| 'glow'` | `'idle'` | Animation to play; changing it swaps the clip. |
|
|
27
|
+
| `size` | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | Size of the avatar, mirroring `<btu-avatar>`'s scale. `--esca-avatar-size` overrides it. |
|
|
28
|
+
|
|
29
|
+
## Events
|
|
30
|
+
|
|
31
|
+
| Event | Detail | Description |
|
|
32
|
+
| --- | --- | --- |
|
|
33
|
+
| `btu-esca-avatar-ready` | | Fired after the first render |
|
|
34
|
+
| `btu-esca-avatar-complete` | `{state: string}` | Fired when a non-looping animation finishes |
|
|
35
|
+
|
|
36
|
+
## CSS custom properties
|
|
37
|
+
|
|
38
|
+
| Property | Description |
|
|
39
|
+
| --- | --- |
|
|
40
|
+
| `--esca-avatar-size` | Width and height of the avatar; overrides the `size` attribute (default: 2.5rem) |
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# `<btu-icon>`
|
|
2
|
+
|
|
3
|
+
An icon component for displaying Lucide icons.
|
|
4
|
+
|
|
5
|
+
Icons inherit parent text color by default or can use gradient fills.
|
|
6
|
+
All icons are from the Lucide icon library (https://lucide.dev/icons/).
|
|
7
|
+
Supports both direct SVG rendering and mask-based gradient fills.
|
|
8
|
+
|
|
9
|
+
```js
|
|
10
|
+
import '@brightspot/ui/components/icon/Icon.js'
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The CMS page defines this element itself, so a plugin can use it there without the import.
|
|
14
|
+
|
|
15
|
+
Interactive examples: https://ui.brightspot.com/?path=/docs/components-icon--docs
|
|
16
|
+
|
|
17
|
+
## Attributes
|
|
18
|
+
|
|
19
|
+
| Attribute | Property | Type | Default | Description |
|
|
20
|
+
| --- | --- | --- | --- | --- |
|
|
21
|
+
| `size` | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | Size of the icon. - 'xs': Extra small (0.75rem) - 'sm': Small (1rem) - 'md': Medium (1.25rem, default) - 'lg': Large (1.5rem) - 'xl': Extra large (1.75rem) |
|
|
22
|
+
| `symbol` | `symbol` | `string` | `'circle-dashed'` | Lucide icon name to display. See https://lucide.dev/icons/ for available icons. Lucide v1 removed all brand logos - legacy facebook/instagram/slack/twitter swap to the vendored brand marks at runtime, any other brand name falls back to circle-dashed. |
|
|
23
|
+
| `brand` | `brand` | `string \| undefined` | | Vendored brand mark to display instead of a Lucide icon (names in src/brand-icons.ts); takes precedence over `symbol`. |
|
|
24
|
+
| `gradient` | `gradient` | `IconGradientColor \| undefined` | | Theme color to use for gradient fill. When set, icon displays with gradient. When undefined, icon inherits parent text color. |
|
|
25
|
+
| `emphasize` | `emphasize` | `boolean \| 'pulse' \| undefined` | | Emphasize mode — renders a tonal circle with ring behind the icon. Colors are derived from `currentColor` via oklch relative color syntax. Defaults to primary; override with Tailwind `text-*` classes or `style="color: ..."`. Set as a boolean for the static circle, or `"pulse"` for a one-shot ring animation. Not intended for use with `gradient` — the two features target conflicting rendering modes. |
|
|
26
|
+
|
|
27
|
+
## Events
|
|
28
|
+
|
|
29
|
+
| Event | Detail | Description |
|
|
30
|
+
| --- | --- | --- |
|
|
31
|
+
| `btu-icon-ready` | | Fired after first render and initialization |
|
|
32
|
+
|
|
33
|
+
## CSS custom properties
|
|
34
|
+
|
|
35
|
+
| Property | Description |
|
|
36
|
+
| --- | --- |
|
|
37
|
+
| `--icon-size` | Icon size (overrides size default) |
|
|
38
|
+
| `--icon-stroke-width` | SVG stroke width as a unitless number in viewBox units; scales visually with icon size (default: 2) |
|
|
39
|
+
| `--icon-fill` | Icon fill color for filled icons (e.g., "currentColor") |
|
|
40
|
+
| `--icon-svg` | SVG data URI for mask-based rendering |
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# `<btu-icon-button>`
|
|
2
|
+
|
|
3
|
+
Surfaces the different actions someone can perform in an interface where space is limited.
|
|
4
|
+
|
|
5
|
+
Uses an icon to communicate the action and supports multiple visual types and sizes.
|
|
6
|
+
Tooltip support is built-in for accessibility in compact layouts.
|
|
7
|
+
|
|
8
|
+
```js
|
|
9
|
+
import '@brightspot/ui/components/icon-button/IconButton.js'
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Interactive examples: https://ui.brightspot.com/?path=/docs/components-icon-button--docs
|
|
13
|
+
|
|
14
|
+
## Attributes
|
|
15
|
+
|
|
16
|
+
| Attribute | Property | Type | Default | Description |
|
|
17
|
+
| --- | --- | --- | --- | --- |
|
|
18
|
+
| `name` | `name` | `string \| undefined` | | Optional name for the button which can be used to identify the button in a callback. |
|
|
19
|
+
| `type` | `type` | `'primary' \| 'primary-clear' \| 'primary-stroke' \| 'secondary' \| 'secondary-clear' \| 'secondary-stroke' \| 'tertiary' \| 'tertiary-clear' \| 'tertiary-stroke'` | `'primary'` | Specifies the type of icon-button, controlling the visual style. |
|
|
20
|
+
| `symbol` | `symbol` | `string \| undefined` | | Lucide icon symbol. |
|
|
21
|
+
| `size` | `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Specifies the size of icon-button. |
|
|
22
|
+
| `destructive` | `destructive` | `boolean` | `false` | Specifies an icon-button will be used to take any destructive action overriding the default color used for the icon-button type with the error color. |
|
|
23
|
+
| `disabled` | `disabled` | `boolean` | `false` | Disables the button, preventing interaction and indicating an inactive state. |
|
|
24
|
+
| `tooltip` | `tooltip` | `string` | `''` | Tooltip text content. Set to empty string to remove the tooltip. |
|
|
25
|
+
| `tooltip-position` | `tooltipPosition` | `'top' \| 'bottom' \| 'left' \| 'right'` | `'top'` | Position relative to the host element. Auto-flips when constrained by the viewport. |
|
|
26
|
+
| `tooltip-delay` | `tooltipDelay` | `number` | `300` | Show delay in milliseconds (hover trigger only). |
|
|
27
|
+
| `tooltip-offset` | `tooltipOffset` | `'sm' \| 'md' \| 'lg' \| 'xl' \| null` | `null` | Gap between host and tooltip (sm=4px, md=8px, lg=12px, xl=16px). |
|
|
28
|
+
| `tooltip-no-arrow` | `tooltipNoArrow` | `boolean` | `false` | Hide the arrow pseudo-element. |
|
|
29
|
+
| `tooltip-trigger` | `tooltipTrigger` | `string` | `'hover focus'` | Space-separated trigger types: 'hover', 'focus', 'click'. |
|
|
30
|
+
|
|
31
|
+
## Events
|
|
32
|
+
|
|
33
|
+
| Event | Detail | Description |
|
|
34
|
+
| --- | --- | --- |
|
|
35
|
+
| `btu-icon-button-ready` | | Fired after first render and initialization |
|
|
36
|
+
| `btu-icon-button-click` | `{name: string \| undefined}` | Fired when the button is clicked |
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# `<btu-linear-progress>`
|
|
2
|
+
|
|
3
|
+
A horizontal linear progress bar for showing task completion.
|
|
4
|
+
|
|
5
|
+
```js
|
|
6
|
+
import '@brightspot/ui/components/linear-progress/LinearProgress.js'
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Interactive examples: https://ui.brightspot.com/?path=/docs/components-linear-progress--docs
|
|
10
|
+
|
|
11
|
+
## Attributes
|
|
12
|
+
|
|
13
|
+
| Attribute | Property | Type | Default | Description |
|
|
14
|
+
| --- | --- | --- | --- | --- |
|
|
15
|
+
| `color` | `color` | `ProgressColors` | `'primary'` | Color theme of the progress indicator. Supports: black, white, primary, teal, gray, purple, rose, error, warning, success |
|
|
16
|
+
| `thickness` | `thickness` | `number \| undefined` | | Stroke width of the progress indicator. |
|
|
17
|
+
| `progress` | `progress` | `number` | | Progress value for determinate variant. Clamped to 0–100. |
|
|
18
|
+
| `label` | `label` | `string \| undefined` | | Optional label text to display with the progress indicator. |
|
|
19
|
+
| `initial-animation` | `initialAnimation` | `boolean` | `true` | Whether to animate progress from 0 to target value when component first becomes visible. |
|
|
20
|
+
| `aria-label` | `ariaLabel` | `string \| null` | `null` | Optional aria-label attribute for screen readers. Describes what the progress indicator represents. |
|
|
21
|
+
| `aria-labelledby` | `ariaLabelledBy` | `string \| null` | `null` | Optional aria-labelledby attribute for screen readers. References the ID of an element that labels the progress indicator. |
|
|
22
|
+
| `aria-valuetext` | `ariaValueText` | `string \| null` | `null` | Optional aria-valuetext attribute for screen readers. Provides human-readable text alternative for progress value. |
|
|
23
|
+
| `completion-announcement` | `completionAnnouncement` | `string \| undefined` | | Optional message to announce to screen readers when progress reaches 100%. If not provided, no announcement will be made on completion. |
|
|
24
|
+
|
|
25
|
+
## Events
|
|
26
|
+
|
|
27
|
+
| Event | Detail | Description |
|
|
28
|
+
| --- | --- | --- |
|
|
29
|
+
| `btu-linear-progress-ready` | | Fired after first render and initialization |
|
|
30
|
+
| `btu-linear-progress-complete` | | Fired when progress reaches 100 |
|
|
31
|
+
|
|
32
|
+
## CSS custom properties
|
|
33
|
+
|
|
34
|
+
| Property | Description |
|
|
35
|
+
| --- | --- |
|
|
36
|
+
| `--progress-color` | Custom progress bar color (overrides theme color) |
|
|
37
|
+
| `--track-color` | Track/background color (overrides default gray-100) |
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# `<btu-message>`
|
|
2
|
+
|
|
3
|
+
A message for communicating high-visibility content that is not tied to the
|
|
4
|
+
user's current task — alerts, breaking news, and persistent status. Use it on
|
|
5
|
+
its own as a contained, bordered card, or place it inside a `<btu-banner>` to
|
|
6
|
+
span the full width of the page (e.g., pinned above the CMS content area).
|
|
7
|
+
|
|
8
|
+
Messages render a leading icon, an optional badge, a label, an optional
|
|
9
|
+
description, and an optional dismiss control. The label and description
|
|
10
|
+
stack vertically in a text column; everything else sits on the same row.
|
|
11
|
+
|
|
12
|
+
```js
|
|
13
|
+
import '@brightspot/ui/components/banner/Message.js'
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Interactive examples: https://ui.brightspot.com/?path=/docs/components-message--docs
|
|
17
|
+
|
|
18
|
+
## Attributes
|
|
19
|
+
|
|
20
|
+
| Attribute | Property | Type | Default | Description |
|
|
21
|
+
| --- | --- | --- | --- | --- |
|
|
22
|
+
| `variant` | `variant` | `'primary' \| 'info' \| 'warning' \| 'error' \| 'success'` | `'info'` | Visual style and semantic meaning of the message. |
|
|
23
|
+
| `label` | `label` | `string \| undefined` | | The primary message or title text displayed. |
|
|
24
|
+
| `symbol` | `symbol` | `string \| undefined` | | Name of the Lucide icon to display. Defaults to a sensible icon per variant. |
|
|
25
|
+
| `dismissible` | `dismissible` | `boolean` | `false` | If true, a close icon is provided to allow the user to hide the message. |
|
|
26
|
+
|
|
27
|
+
## Events
|
|
28
|
+
|
|
29
|
+
| Event | Detail | Description |
|
|
30
|
+
| --- | --- | --- |
|
|
31
|
+
| `btu-message-ready` | | Fired after the message is first rendered and initialized |
|
|
32
|
+
| `btu-message-dismiss` | | Fired when the user clicks the close/dismiss button. Cancelable: the message hides itself (sets `hidden`) unless the listener calls `preventDefault()`. |
|
|
33
|
+
|
|
34
|
+
## Slots
|
|
35
|
+
|
|
36
|
+
| Slot | Description |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| `badge` | Pseudo-slot for a leading status/version tag, typically a `<btu-badge>`. The slotted child is moved into the header row, before the label. |
|
|
39
|
+
| `description` | Pseudo-slot for supporting text rendered directly beneath the label. Slot a single inline element (e.g., `<span slot="description">`) or a block element to enable rich content (links, emphasis). |
|
|
40
|
+
| `actions` | Pseudo-slot for CTA buttons, links, or a `<btu-pagination>`. Children with `slot="actions"` are moved into an internal container on the trailing edge of the body. `.btu-button` children inherit the message's foreground color across all states. The message does not emit an action-click event — attach handlers to your own elements. |
|
|
41
|
+
|
|
42
|
+
## CSS custom properties
|
|
43
|
+
|
|
44
|
+
| Property | Description |
|
|
45
|
+
| --- | --- |
|
|
46
|
+
| `--message-color-background` | Overrides the background color for the message |
|
|
47
|
+
| `--message-color-foreground` | Overrides the text and icon color |
|
|
48
|
+
| `--message-color-border` | Overrides the border color (defaults to the variant's 300 shade) |
|
|
49
|
+
| `--message-padding` | Overrides the internal padding (default: 1rem) |
|
|
50
|
+
| `--message-border-radius` | Overrides the corner rounding (default: 8px) |
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# `<btu-pagination>`
|
|
2
|
+
|
|
3
|
+
A pagination component for navigating through paged content.
|
|
4
|
+
|
|
5
|
+
Supports multiple layout variants (Search, Widget, Widget Small, Calendar)
|
|
6
|
+
through configurable props and pseudo-slots.
|
|
7
|
+
|
|
8
|
+
**Page size modes:**
|
|
9
|
+
|
|
10
|
+
- **Built-in** (default): When no `slot="page-size"` is provided and `page-size-changer`
|
|
11
|
+
is true, Pagination renders its own `btu-dropdown` from the `page-size-options` attribute.
|
|
12
|
+
Events, label sync, and page size changes are managed automatically.
|
|
13
|
+
|
|
14
|
+
- **Custom slot**: When a child has `slot="page-size"`, the built-in dropdown is suppressed.
|
|
15
|
+
The consumer owns all behavior — event handling, label sync, etc. Use this for non-standard
|
|
16
|
+
selectors like a calendar week/month toggle.
|
|
17
|
+
|
|
18
|
+
**Page jumper modes:**
|
|
19
|
+
|
|
20
|
+
- **Built-in**: When `page-jumper` is true and no `slot="jumper"` is provided, Pagination
|
|
21
|
+
renders a dropdown with "Page 1" through "Page N" items. Fully reactive — updates
|
|
22
|
+
automatically when page, page size, or total items change.
|
|
23
|
+
|
|
24
|
+
- **Custom slot**: When a child has `slot="jumper"`, the built-in dropdown is suppressed.
|
|
25
|
+
The consumer owns all behavior. Use this for custom jumper content like a "Today" button.
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
import '@brightspot/ui/components/pagination/Pagination.js'
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Interactive examples: https://ui.brightspot.com/?path=/docs/components-pagination--docs
|
|
32
|
+
|
|
33
|
+
## Attributes
|
|
34
|
+
|
|
35
|
+
| Attribute | Property | Type | Default | Description |
|
|
36
|
+
| --- | --- | --- | --- | --- |
|
|
37
|
+
| `page` | `page` | `number` | `1` | Current page number (1-based) |
|
|
38
|
+
| `page-size` | `pageSize` | `number` | `0` | Number of items per page |
|
|
39
|
+
| `disabled` | `disabled` | `boolean` | `false` | Disables all pagination controls |
|
|
40
|
+
| `loading` | `loading` | `boolean` | `false` | Shows loading spinner and dims controls |
|
|
41
|
+
| `hide-on-single-page` | `hideOnSinglePage` | `boolean` | `true` | Hide controls when there is only one page |
|
|
42
|
+
| `page-size-changer` | `pageSizeChanger` | `boolean` | `true` | Show the page size dropdown |
|
|
43
|
+
| `page-size-options` | `pageSizeOptions` | `string` | `'10, 20, 50'` | Comma-separated page size options |
|
|
44
|
+
| `total-items` | `totalItems` | `number` | `0` | Total number of items across all pages |
|
|
45
|
+
| `boundary-buttons` | `boundaryButtons` | `boolean` | `true` | Show first and last page buttons |
|
|
46
|
+
| `hide-total-count` | `hideTotalCount` | `boolean` | `false` | Hide the item count display (e.g., "1-10 of 200") |
|
|
47
|
+
| `page-jumper` | `pageJumper` | `boolean` | `false` | Show the page jumper dropdown. Intended for moderate page counts (under ~100 pages). For large datasets, use a custom `slot="jumper"` with a virtualized or input-based control. |
|
|
48
|
+
| `label` | `label` | `string \| undefined` | | Accessible label for the pagination nav landmark |
|
|
49
|
+
|
|
50
|
+
## Events
|
|
51
|
+
|
|
52
|
+
| Event | Detail | Description |
|
|
53
|
+
| --- | --- | --- |
|
|
54
|
+
| `btu-pagination-ready` | | Fired after first render |
|
|
55
|
+
| `btu-pagination-change` | `{page: number, pageSize: number}` | Fired on page navigation |
|
|
56
|
+
| `btu-pagination-page-size-change` | `{page: number, pageSize: number}` | Fired on page size change |
|
|
57
|
+
|
|
58
|
+
## Slots
|
|
59
|
+
|
|
60
|
+
| Slot | Description |
|
|
61
|
+
| --- | --- |
|
|
62
|
+
| `page-size` | Custom page-size selector (replaces built-in dropdown). Consumer manages all behavior. |
|
|
63
|
+
| `jumper` | Custom jumper content (replaces built-in page jumper dropdown). Consumer manages all behavior. |
|
|
64
|
+
|
|
65
|
+
## CSS custom properties
|
|
66
|
+
|
|
67
|
+
| Property | Description |
|
|
68
|
+
| --- | --- |
|
|
69
|
+
| `--pagination-color-background` | Background color for dropdowns, buttons, and jumper |
|
|
70
|
+
| `--pagination-color-foreground` | Text/icon color |
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# `<btu-popover>`
|
|
2
|
+
|
|
3
|
+
A popover component for displaying rich interactive content anchored to a trigger element.
|
|
4
|
+
|
|
5
|
+
Uses the native HTML Popover API for top-layer rendering, light dismiss (click-outside
|
|
6
|
+
and Escape for click triggers), and focus management. CSS anchor positioning handles
|
|
7
|
+
viewport-aware placement.
|
|
8
|
+
|
|
9
|
+
For click triggers (`popover="auto"`), the browser provides:
|
|
10
|
+
- Light dismiss (Escape key and click-outside)
|
|
11
|
+
- Top-layer rendering (no z-index needed)
|
|
12
|
+
- Focus restoration on close
|
|
13
|
+
- `autofocus` support — add `autofocus` to an element inside `slot="content"`
|
|
14
|
+
to have it receive focus when the popover opens
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
import '@brightspot/ui/components/popover/Popover.js'
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Interactive examples: https://ui.brightspot.com/?path=/docs/components-popover--docs
|
|
21
|
+
|
|
22
|
+
## Attributes
|
|
23
|
+
|
|
24
|
+
| Attribute | Property | Type | Default | Description |
|
|
25
|
+
| --- | --- | --- | --- | --- |
|
|
26
|
+
| `position` | `position` | `'top' \| 'bottom' \| 'left' \| 'right'` | `'bottom'` | Position relative to the trigger element. Auto-flips when constrained by the viewport. |
|
|
27
|
+
| `trigger` | `trigger` | `'click' \| 'hover' \| 'focus'` | `'click'` | How the popover is activated. - 'click': Toggle on click with light dismiss - 'hover': Show on mouseenter with delay - 'focus': Show on focusin |
|
|
28
|
+
| `delay` | `delay` | `number` | `300` | Show delay in milliseconds (hover trigger only). |
|
|
29
|
+
| `offset` | `offset` | `'sm' \| 'md' \| 'lg' \| 'xl' \| null` | `null` | Gap between trigger and popover (sm=4px, md=8px, lg=12px, xl=16px). |
|
|
30
|
+
| `no-arrow` | `noArrow` | `boolean` | `false` | Hide the arrow pseudo-element. |
|
|
31
|
+
| `inverted` | `inverted` | `boolean` | `false` | Invert the panel surface (dark on light pages, light on dark pages). Opt-in, since the panel holds arbitrary rich content. |
|
|
32
|
+
| `open` | `open` | `boolean` | `false` | Programmatic open/close state (reflected). |
|
|
33
|
+
| `panel-label` | `panelLabel` | `string` | `''` | Accessible label for the popover panel (applied as aria-label on the dialog). |
|
|
34
|
+
|
|
35
|
+
## Events
|
|
36
|
+
|
|
37
|
+
| Event | Detail | Description |
|
|
38
|
+
| --- | --- | --- |
|
|
39
|
+
| `btu-popover-show` | | Fired when the popover opens |
|
|
40
|
+
| `btu-popover-hide` | | Fired when the popover closes |
|
|
41
|
+
|
|
42
|
+
## Slots
|
|
43
|
+
|
|
44
|
+
| Slot | Description |
|
|
45
|
+
| --- | --- |
|
|
46
|
+
| `trigger` | The element that activates the popover |
|
|
47
|
+
| `content` | Rich HTML content displayed inside the popover panel |
|
|
48
|
+
|
|
49
|
+
## CSS custom properties
|
|
50
|
+
|
|
51
|
+
| Property | Description |
|
|
52
|
+
| --- | --- |
|
|
53
|
+
| `--popover-color-background` | Panel background color (default: var(--btu-theme-white); inverted: var(--btu-theme-black)) |
|
|
54
|
+
| `--popover-color-content` | Panel text color (default: oklch(var(--btu-theme-gray-900)); inverted: var(--btu-theme-white)) |
|
|
55
|
+
| `--popover-border-radius` | Panel corner radius (default: theme borderRadius.lg) |
|
|
56
|
+
| `--popover-border-width` | Edge width, panel and arrow (default: 1px; 0 removes it) |
|
|
57
|
+
| `--popover-border-color` | Edge color, panel and arrow (default: oklch(var(--btu-theme-gray-200))) |
|
|
58
|
+
| `--popover-offset` | Gap between trigger and panel (default: 8px; see btu-popover-offset-{sm\|md\|lg\|xl}) |
|
|
59
|
+
| `--popover-arrow-size` | Width/height of the pointer arrow (default: 8px) |
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Brightspot UI component API reference
|
|
2
|
+
|
|
3
|
+
Generated from the Custom Elements Manifest by `yarn cem:docs`. Don't edit these files by hand.
|
|
4
|
+
|
|
5
|
+
## Using these in a plugin
|
|
6
|
+
|
|
7
|
+
The CMS page already styles every component here, but it defines only four of the elements: `btu-badge`, `btu-copy-to-clipboard`, `btu-icon` and `btu-widget`.
|
|
8
|
+
|
|
9
|
+
Import any other element in your plugin's frontend entry, for example
|
|
10
|
+
`import '@brightspot/ui/components/card/Card.js'`, or the tag stays an undefined, inert element. That includes elements
|
|
11
|
+
your Java renders through the generated `com.brightspot.ui.dari` classes. Importing one of the four changes nothing on a
|
|
12
|
+
CMS page, because the CMS defines it first.
|
|
13
|
+
|
|
14
|
+
See [Dari HTML elements](../dari-elements.md) for how to render these components from Java.
|
|
15
|
+
|
|
16
|
+
## Components
|
|
17
|
+
|
|
18
|
+
- [`<btu-action-bar>`](ActionBar.md): A persistent container for primary, secondary, tertiary, and destructive actions within an interface, typically anchored to the bottom of a view
|
|
19
|
+
- [`<btu-action-item>`](ActionItem.md): An action item button for use within `btu-action-bar`
|
|
20
|
+
- [`<btu-ai-sparkle>`](AiSparkle.md): The animated AI-branding sparkle
|
|
21
|
+
- [`<btu-avatar>`](Avatar.md): An avatar component for displaying user profile images with fallback support
|
|
22
|
+
- [`<btu-avatar-group>`](AvatarGroup.md): A container component for grouping multiple avatars with consistent styling
|
|
23
|
+
- [`<btu-badge>`](Badge.md): A badge component for highlighting important information
|
|
24
|
+
- [`<btu-banner>`](Banner.md): A full-width container that pins a `<btu-message>` to the top of the CMS or a content edit page
|
|
25
|
+
- [`<btu-button-group>`](ButtonGroup.md): A semantic container for grouping related buttons together
|
|
26
|
+
- [`<btu-card>`](Card.md): A flexible content container for presenting and organizing information
|
|
27
|
+
- [`<btu-checkbox>`](Checkbox.md): A checkbox component for selecting one or more options from a set
|
|
28
|
+
- [`<btu-circular-progress>`](CircularProgress.md): A circular progress indicator for showing loading states or progress
|
|
29
|
+
- [`<btu-copy-to-clipboard>`](CopyToClipboard.md): A button component that copies text to the system clipboard
|
|
30
|
+
- [`<btu-dropdown>`](Dropdown.md): A dropdown component that renders a trigger button and manages a floating panel containing a `btu-dropdown-menu`
|
|
31
|
+
- [`<btu-dropdown-item>`](DropdownItem.md): A menu item component for use inside `btu-dropdown-menu`
|
|
32
|
+
- [`<btu-dropdown-menu>`](DropdownMenu.md): A menu container component that provides keyboard navigation and ARIA menu semantics
|
|
33
|
+
- [`<btu-empty-state>`](EmptyState.md): An empty state component for displaying placeholder content when no data is available
|
|
34
|
+
- [`<btu-esca-avatar>`](EscaAvatar.md): The animated avatar for the Esca AI assistant, driven entirely by its `state` attribute so the same element works wherever the assistant appears
|
|
35
|
+
- [`<btu-icon>`](Icon.md): An icon component for displaying Lucide icons
|
|
36
|
+
- [`<btu-icon-button>`](IconButton.md): Surfaces the different actions someone can perform in an interface where space is limited
|
|
37
|
+
- [`<btu-linear-progress>`](LinearProgress.md): A horizontal linear progress bar for showing task completion
|
|
38
|
+
- [`<btu-message>`](Message.md): A message for communicating high-visibility content that is not tied to the user's current task — alerts, breaking news, and persistent status
|
|
39
|
+
- [`<btu-pagination>`](Pagination.md): A pagination component for navigating through paged content
|
|
40
|
+
- [`<btu-popover>`](Popover.md): A popover component for displaying rich interactive content anchored to a trigger element
|
|
41
|
+
- [`<btu-radio>`](Radio.md): A single radio option, selectable from a set of mutually exclusive choices
|
|
42
|
+
- [`<btu-radio-group>`](RadioGroup.md): A container that groups `btu-radio` options into a single-select control
|
|
43
|
+
- [`<btu-switch>`](Switch.md): A toggle switch component for binary on/off states
|
|
44
|
+
- [`<btu-tab>`](Tab.md): An individual tab within a tab group
|
|
45
|
+
- [`<btu-tabs>`](Tabs.md): A container component for managing a group of tabs
|
|
46
|
+
- [`<btu-upload>`](Upload.md): A file upload component with drop zone and file list
|
|
47
|
+
- [`<btu-upload-item>`](UploadItem.md): Internal upload item sub-component for displaying individual file upload state
|
|
48
|
+
- [`<btu-widget>`](Widget.md): A widget component for displaying content with header, body, and footer sections
|