@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
|
@@ -1,84 +1,48 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
| `
|
|
23
|
-
| `
|
|
24
|
-
| `
|
|
25
|
-
| `
|
|
26
|
-
| `
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
|
|
49
|
-
### Attributes
|
|
50
|
-
|
|
51
|
-
| Name | Field | Inherited From |
|
|
52
|
-
| ---------------- | ------------- | -------------- |
|
|
53
|
-
| `size` | size | |
|
|
54
|
-
| `label` | label | |
|
|
55
|
-
| `description` | description | |
|
|
56
|
-
| `checked` | checked | |
|
|
57
|
-
| `disabled` | disabled | |
|
|
58
|
-
| `name` | name | |
|
|
59
|
-
| `label-position` | labelPosition | |
|
|
60
|
-
| `on-icon` | onIcon | |
|
|
61
|
-
| `off-icon` | offIcon | |
|
|
62
|
-
|
|
63
|
-
### CSS Properties
|
|
64
|
-
|
|
65
|
-
| Name | Default | Description |
|
|
66
|
-
| -------------------------- | ------- | ----------------------------------------------------------------------------------- |
|
|
67
|
-
| `--switch-color-track-on` | | Background color when the toggle is checked (default: var(--btu-theme-primary-700)) |
|
|
68
|
-
| `--switch-color-track-off` | | Background color when the toggle is unchecked (default: var(--btu-theme-gray-300)) |
|
|
69
|
-
| `--switch-color-knob` | | Color of the sliding circular handle (default: var(--btu-theme-white)) |
|
|
70
|
-
| `--switch-label-spacing` | | Distance between the switch and the text label (default: 0.75rem) |
|
|
71
|
-
| `--switch-track-width` | | Track width (default: sm 1.75rem, md 2.25rem, lg 2.75rem) |
|
|
72
|
-
| `--switch-track-height` | | Track height (default: sm 1rem, md 1.25rem, lg 1.5rem) |
|
|
73
|
-
| `--switch-knob-size` | | Knob diameter (default: sm 0.75rem, md 1rem, lg 1.25rem) |
|
|
74
|
-
| `--switch-knob-padding` | | Space between knob and track edges (default: 0.125rem) |
|
|
75
|
-
| `--switch-track-icon-size` | | Size of the track icons (default: sm 0.5rem, md 0.625rem, lg 0.75rem) |
|
|
76
|
-
|
|
77
|
-
<hr/>
|
|
78
|
-
|
|
79
|
-
## Exports
|
|
80
|
-
|
|
81
|
-
| Kind | Name | Declaration | Module | Package |
|
|
82
|
-
| --------------------------- | ------------ | ----------- | ------------------------------- | ------- |
|
|
83
|
-
| `js` | `default` | Switch | src/components/switch/Switch.ts | |
|
|
84
|
-
| `custom-element-definition` | `btu-switch` | Switch | src/components/switch/Switch.ts | |
|
|
1
|
+
# `<btu-switch>`
|
|
2
|
+
|
|
3
|
+
A toggle switch component for binary on/off states.
|
|
4
|
+
|
|
5
|
+
Uses a hidden checkbox internally for accessibility, styled via the
|
|
6
|
+
`btu-switch` Tailwind plugin classes.
|
|
7
|
+
|
|
8
|
+
```js
|
|
9
|
+
import '@brightspot/ui/components/switch/Switch.js'
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Interactive examples: https://ui.brightspot.com/?path=/docs/components-switch--docs
|
|
13
|
+
|
|
14
|
+
## Attributes
|
|
15
|
+
|
|
16
|
+
| Attribute | Property | Type | Default | Description |
|
|
17
|
+
| --- | --- | --- | --- | --- |
|
|
18
|
+
| `size` | `size` | `'sm' \| 'md' \| 'lg'` | `'sm'` | Controls the physical dimensions of the switch and the associated label typography. |
|
|
19
|
+
| `label` | `label` | `string \| undefined` | | The primary text displayed next to the toggle. |
|
|
20
|
+
| `description` | `description` | `string \| undefined` | | Optional helper text or secondary information displayed below the label. |
|
|
21
|
+
| `checked` | `checked` | `boolean` | `false` | The current state of the switch (on/off). |
|
|
22
|
+
| `disabled` | `disabled` | `boolean` | `false` | If true, the toggle is non-interactive and visually muted. |
|
|
23
|
+
| `name` | `name` | `string \| undefined` | | Name of the control for form participation. |
|
|
24
|
+
| `label-position` | `labelPosition` | `'start' \| 'end'` | `'end'` | Determines if the label appears to the left or right of the switch. |
|
|
25
|
+
| `on-icon` | `onIcon` | `string \| undefined` | | Lucide icon name shown on the track when the switch is checked (on). |
|
|
26
|
+
| `off-icon` | `offIcon` | `string \| undefined` | | Lucide icon name shown on the track when the switch is unchecked (off). |
|
|
27
|
+
|
|
28
|
+
## Events
|
|
29
|
+
|
|
30
|
+
| Event | Detail | Description |
|
|
31
|
+
| --- | --- | --- |
|
|
32
|
+
| `btu-switch-ready` | | Fired after the toggle is first rendered and initialized |
|
|
33
|
+
| `btu-switch-change` | `{ checked: boolean }` | Fired when the user toggles the switch |
|
|
34
|
+
| `btu-switch-focus` | | Fired when the component gains focus |
|
|
35
|
+
|
|
36
|
+
## CSS custom properties
|
|
37
|
+
|
|
38
|
+
| Property | Description |
|
|
39
|
+
| --- | --- |
|
|
40
|
+
| `--switch-color-track-on` | Background color when the toggle is checked (default: var(--btu-theme-primary-700)) |
|
|
41
|
+
| `--switch-color-track-off` | Background color when the toggle is unchecked (default: var(--btu-theme-gray-300)) |
|
|
42
|
+
| `--switch-color-knob` | Color of the sliding circular handle (default: var(--btu-theme-white)) |
|
|
43
|
+
| `--switch-label-spacing` | Distance between the switch and the text label (default: 0.75rem) |
|
|
44
|
+
| `--switch-track-width` | Track width (default: sm 1.75rem, md 2.25rem, lg 2.75rem) |
|
|
45
|
+
| `--switch-track-height` | Track height (default: sm 1rem, md 1.25rem, lg 1.5rem) |
|
|
46
|
+
| `--switch-knob-size` | Knob diameter (default: sm 0.75rem, md 1rem, lg 1.25rem) |
|
|
47
|
+
| `--switch-knob-padding` | Space between knob and track edges (default: 0.125rem) |
|
|
48
|
+
| `--switch-track-icon-size` | Size of the track icons (default: sm 0.5rem, md 0.625rem, lg 0.75rem) |
|
package/docs/components/Tab.md
CHANGED
|
@@ -1,80 +1,40 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `<btu-tab>`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
An individual tab within a tab group.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Renders a button with role="tab" that participates in keyboard navigation
|
|
6
|
+
and selection state managed by the parent `btu-tabs` container.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
```js
|
|
9
|
+
import '@brightspot/ui/components/tabs/Tab.js'
|
|
10
|
+
```
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
Interactive examples: https://ui.brightspot.com/?path=/docs/components-tabs-tab--docs
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
| ------------------- | ------------------------------ | ------- |
|
|
15
|
-
| `EventEmitterMixin` | /src/util/EventEmitterMixin.js | |
|
|
16
|
-
| `ReadyMixin` | /src/util/ReadyMixin.js | |
|
|
14
|
+
## Attributes
|
|
17
15
|
|
|
18
|
-
|
|
16
|
+
| Attribute | Property | Type | Default | Description |
|
|
17
|
+
| --- | --- | --- | --- | --- |
|
|
18
|
+
| `name` | `name` | `string \| undefined` | | Value that identifies this tab and links it to panel elements that share the same `name` attribute. |
|
|
19
|
+
| `label` | `label` | `string \| undefined` | | Text displayed in the tab. |
|
|
20
|
+
| `description` | `description` | `string \| undefined` | | Accessibility description for screen readers. |
|
|
21
|
+
| `disabled` | `disabled` | `boolean` | `false` | Whether the tab is disabled and non-interactive. |
|
|
22
|
+
| `symbol` | `symbol` | `string \| undefined` | | Lucide icon symbol to display. |
|
|
23
|
+
| `icon-position` | `iconPosition` | `'leading' \| 'trailing'` | `'leading'` | Placement of the icon relative to the label. |
|
|
24
|
+
| `icon-only` | `iconOnly` | `boolean` | `false` | When true, hides the label visually while maintaining accessibility. |
|
|
25
|
+
| `error` | `error` | `boolean` | `false` | When true, displays an error badge on the tab. |
|
|
26
|
+
| `badge` | `badge` | `string \| undefined` | | Displays a badge with the given value alongside the label. |
|
|
19
27
|
|
|
20
|
-
|
|
21
|
-
| --------- | ------- | ---- | ------- | ----------- | -------------- |
|
|
22
|
-
| `tagName` | | | | | |
|
|
28
|
+
## Events
|
|
23
29
|
|
|
24
|
-
|
|
30
|
+
| Event | Detail | Description |
|
|
31
|
+
| --- | --- | --- |
|
|
32
|
+
| `btu-tab-ready` | | Fired after first render |
|
|
33
|
+
| `btu-tab-change` | `{name: string}` | Fired when a non-disabled tab with a name is clicked |
|
|
25
34
|
|
|
26
|
-
|
|
27
|
-
| ------------------------- | ------- | ------------------------- | ----------- | ----------------------------------------------------------------------------------------------------- | -------------- |
|
|
28
|
-
| `name` | | `string \| undefined` | | Value that identifies this tab and links it to panel elements that share the same \`name\` attribute. | |
|
|
29
|
-
| `label` | | `string \| undefined` | | Text displayed in the tab. | |
|
|
30
|
-
| `description` | | `string \| undefined` | | Accessibility description for screen readers. | |
|
|
31
|
-
| `disabled` | | `boolean` | `false` | Whether the tab is disabled and non-interactive. | |
|
|
32
|
-
| `symbol` | | `string \| undefined` | | Lucide icon symbol to display. | |
|
|
33
|
-
| `iconPosition` | | `'leading' \| 'trailing'` | `'leading'` | Placement of the icon relative to the label. | |
|
|
34
|
-
| `iconOnly` | | `boolean` | `false` | When true, hides the label visually while maintaining accessibility. | |
|
|
35
|
-
| `error` | | `boolean` | `false` | When true, displays an error badge on the tab. | |
|
|
36
|
-
| `badge` | | `string \| undefined` | | Displays a badge with the given value alongside the label. | |
|
|
37
|
-
| `_initialClassesCaptured` | private | `boolean` | `false` | | |
|
|
35
|
+
## CSS custom properties
|
|
38
36
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
|
42
|
-
|
|
|
43
|
-
| `emit` | | Dispatches a type-safe CustomEvent with standardized configuration.

All events are configured with:
- bubbles: true (event propagates up the DOM tree)
- cancelable: false (event cannot be cancelled)
- composed: true (event crosses shadow DOM boundaries) | `type: K, detail: UnpackCustomEvent<CustomEventMap[K]>` | `boolean` | EventEmitterMixin |
|
|
44
|
-
|
|
45
|
-
### Events
|
|
46
|
-
|
|
47
|
-
| Name | Type | Description | Inherited From |
|
|
48
|
-
| ---------------- | ----------------------------- | ---------------------------------------------------- | -------------- |
|
|
49
|
-
| `btu-tab-ready` | `CustomEvent` | Fired after first render | |
|
|
50
|
-
| `btu-tab-change` | `CustomEvent<{name: string}>` | Fired when a non-disabled tab with a name is clicked | |
|
|
51
|
-
|
|
52
|
-
### Attributes
|
|
53
|
-
|
|
54
|
-
| Name | Field | Inherited From |
|
|
55
|
-
| --------------- | ------------ | -------------- |
|
|
56
|
-
| `name` | name | |
|
|
57
|
-
| `label` | label | |
|
|
58
|
-
| `description` | description | |
|
|
59
|
-
| `disabled` | disabled | |
|
|
60
|
-
| `symbol` | symbol | |
|
|
61
|
-
| `icon-position` | iconPosition | |
|
|
62
|
-
| `icon-only` | iconOnly | |
|
|
63
|
-
| `error` | error | |
|
|
64
|
-
| `badge` | badge | |
|
|
65
|
-
|
|
66
|
-
### CSS Properties
|
|
67
|
-
|
|
68
|
-
| Name | Default | Description |
|
|
69
|
-
| -------------------------- | ------- | ---------------------------------------------------------------- |
|
|
70
|
-
| `--badge-color-background` | | Background color of the count indicator badge (default: gray-50) |
|
|
71
|
-
| `--badge-color-foreground` | | Text color of the count indicator badge (default: gray-800) |
|
|
72
|
-
|
|
73
|
-
<hr/>
|
|
74
|
-
|
|
75
|
-
## Exports
|
|
76
|
-
|
|
77
|
-
| Kind | Name | Declaration | Module | Package |
|
|
78
|
-
| --------------------------- | --------- | ----------- | -------------------------- | ------- |
|
|
79
|
-
| `js` | `default` | Tab | src/components/tabs/Tab.ts | |
|
|
80
|
-
| `custom-element-definition` | `btu-tab` | Tab | src/components/tabs/Tab.ts | |
|
|
37
|
+
| Property | Description |
|
|
38
|
+
| --- | --- |
|
|
39
|
+
| `--badge-color-background` | Background color of the count indicator badge (default: gray-50) |
|
|
40
|
+
| `--badge-color-foreground` | Text color of the count indicator badge (default: gray-800) |
|
package/docs/components/Tabs.md
CHANGED
|
@@ -1,86 +1,49 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
|
22
|
-
|
|
|
23
|
-
| `
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
|
30
|
-
|
|
|
31
|
-
| `
|
|
32
|
-
| `
|
|
33
|
-
| `
|
|
34
|
-
| `
|
|
35
|
-
| `
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
| `
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
|
50
|
-
| ---------------- | ----------------------------- | --------------------------------------------------------------------- | -------------- |
|
|
51
|
-
| `btu-tabs-ready` | `CustomEvent` | Fired after first render and initialization | |
|
|
52
|
-
| `btu-tabs-show` | `CustomEvent<{name: string}>` | Fired when a tab becomes active | |
|
|
53
|
-
| `btu-tabs-hide` | `CustomEvent<{name: string}>` | Fired when a tab is deactivated | |
|
|
54
|
-
| `btu-tab-change` | `CustomEvent<{name: string}>` | Fired when a tab is selected (bubbles from btu-tab) | |
|
|
55
|
-
| `btu-tab-ready` | `CustomEvent` | Fired when a child tab finishes initialization (bubbles from btu-tab) | |
|
|
56
|
-
|
|
57
|
-
### Attributes
|
|
58
|
-
|
|
59
|
-
| Name | Field | Inherited From |
|
|
60
|
-
| ------------ | --------- | -------------- |
|
|
61
|
-
| `size` | size | |
|
|
62
|
-
| `active-tab` | activeTab | |
|
|
63
|
-
| `variant` | variant | |
|
|
64
|
-
|
|
65
|
-
### CSS Properties
|
|
66
|
-
|
|
67
|
-
| Name | Default | Description |
|
|
68
|
-
| ------------------------------- | ------- | ------------------------------------------------------------------------------------------------------- |
|
|
69
|
-
| `--tabs-active-color` | | Text and icon color of the active tab (default: gray-700) |
|
|
70
|
-
| `--tabs-active-indicator-color` | | Color of the active tab underline indicator (default: primary-500 → primary-700 → primary-900 gradient) |
|
|
71
|
-
| `--tabs-border-color` | | Color of the bottom border divider (default: gray-200) |
|
|
72
|
-
| `--tabs-color` | | Text and icon color for all tabs (default: gray-500; active/hover tabs use gray-700) |
|
|
73
|
-
| `--tabs-background` | | Background color for all tab buttons (default: transparent) |
|
|
74
|
-
| `--tabs-container-background` | | Background color of the tabs container (default: theme white) |
|
|
75
|
-
| `--tabs-hover-background` | | Background color of a tab on hover (default: gray-100) |
|
|
76
|
-
| `--tabs-hover-color` | | Text and icon color of a tab on hover (default: gray-700) |
|
|
77
|
-
| `--tabs-gap` | | Spacing between tabs (default: 1rem) |
|
|
78
|
-
|
|
79
|
-
<hr/>
|
|
80
|
-
|
|
81
|
-
## Exports
|
|
82
|
-
|
|
83
|
-
| Kind | Name | Declaration | Module | Package |
|
|
84
|
-
| --------------------------- | ---------- | ----------- | --------------------------- | ------- |
|
|
85
|
-
| `js` | `default` | Tabs | src/components/tabs/Tabs.ts | |
|
|
86
|
-
| `custom-element-definition` | `btu-tabs` | Tabs | src/components/tabs/Tabs.ts | |
|
|
1
|
+
# `<btu-tabs>`
|
|
2
|
+
|
|
3
|
+
A container component for managing a group of tabs.
|
|
4
|
+
|
|
5
|
+
Provides selection state management, size propagation to child tabs,
|
|
6
|
+
and keyboard navigation following the WAI-ARIA Tabs pattern.
|
|
7
|
+
|
|
8
|
+
When a tab becomes active, direct sibling elements that share the same
|
|
9
|
+
`name` value are shown; other siblings with a `name` attribute are
|
|
10
|
+
hidden. Only direct siblings are managed — nested tab groups control their
|
|
11
|
+
own panels independently.
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
import '@brightspot/ui/components/tabs/Tabs.js'
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Interactive examples: https://ui.brightspot.com/?path=/docs/components-tabs--docs
|
|
18
|
+
|
|
19
|
+
## Attributes
|
|
20
|
+
|
|
21
|
+
| Attribute | Property | Type | Default | Description |
|
|
22
|
+
| --- | --- | --- | --- | --- |
|
|
23
|
+
| `size` | `size` | `'xs' \| 'sm' \| 'md' \| 'lg'` | `'md'` | Size variant applied to all child tabs. |
|
|
24
|
+
| `active-tab` | `activeTab` | `string \| undefined` | | The `name` value of the currently active tab. |
|
|
25
|
+
| `variant` | `variant` | `'full' \| 'menu'` | `'full'` | Layout variant. - 'full': tabs scroll horizontally when they overflow (default) - 'menu': all tabs are hidden; the active tab label and a chevron dropdown are shown instead |
|
|
26
|
+
|
|
27
|
+
## Events
|
|
28
|
+
|
|
29
|
+
| Event | Detail | Description |
|
|
30
|
+
| --- | --- | --- |
|
|
31
|
+
| `btu-tabs-ready` | | Fired after first render and initialization |
|
|
32
|
+
| `btu-tabs-show` | `{name: string}` | Fired when a tab becomes active |
|
|
33
|
+
| `btu-tabs-hide` | `{name: string}` | Fired when a tab is deactivated |
|
|
34
|
+
| `btu-tab-change` | `{name: string}` | Fired when a tab is selected (bubbles from btu-tab) |
|
|
35
|
+
| `btu-tab-ready` | | Fired when a child tab finishes initialization (bubbles from btu-tab) |
|
|
36
|
+
|
|
37
|
+
## CSS custom properties
|
|
38
|
+
|
|
39
|
+
| Property | Description |
|
|
40
|
+
| --- | --- |
|
|
41
|
+
| `--tabs-active-color` | Text and icon color of the active tab (default: gray-700) |
|
|
42
|
+
| `--tabs-active-indicator-color` | Color of the active tab underline indicator (default: primary-500 → primary-700 → primary-900 gradient) |
|
|
43
|
+
| `--tabs-border-color` | Color of the bottom border divider (default: gray-200) |
|
|
44
|
+
| `--tabs-color` | Text and icon color for all tabs (default: gray-500; active/hover tabs use gray-700) |
|
|
45
|
+
| `--tabs-background` | Background color for all tab buttons (default: transparent) |
|
|
46
|
+
| `--tabs-container-background` | Background color of the tabs container (default: theme white) |
|
|
47
|
+
| `--tabs-hover-background` | Background color of a tab on hover (default: gray-100) |
|
|
48
|
+
| `--tabs-hover-color` | Text and icon color of a tab on hover (default: gray-700) |
|
|
49
|
+
| `--tabs-gap` | Spacing between tabs (default: 1rem) |
|