@brightspot/ui 1.10.0 → 1.11.0
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/dist/components/action-bar/ActionBar.d.ts +163 -0
- package/dist/components/action-bar/ActionBar.d.ts.map +1 -0
- package/dist/components/action-bar/ActionBar.js +479 -0
- package/dist/components/action-bar/ActionBar.js.map +1 -0
- package/dist/components/action-bar/ActionItem.d.ts +103 -0
- package/dist/components/action-bar/ActionItem.d.ts.map +1 -0
- package/dist/components/action-bar/ActionItem.js +237 -0
- package/dist/components/action-bar/ActionItem.js.map +1 -0
- package/dist/components/dropdown/Dropdown.d.ts +3 -1
- package/dist/components/dropdown/Dropdown.d.ts.map +1 -1
- package/dist/components/dropdown/Dropdown.js +22 -6
- package/dist/components/dropdown/Dropdown.js.map +1 -1
- package/dist/components/dropdown/DropdownItem.d.ts +14 -1
- package/dist/components/dropdown/DropdownItem.d.ts.map +1 -1
- package/dist/components/dropdown/DropdownItem.js +20 -1
- package/dist/components/dropdown/DropdownItem.js.map +1 -1
- package/dist/components/dropdown/DropdownMenu.d.ts +3 -5
- package/dist/components/dropdown/DropdownMenu.d.ts.map +1 -1
- package/dist/components/dropdown/DropdownMenu.js +17 -32
- package/dist/components/dropdown/DropdownMenu.js.map +1 -1
- package/dist/components/pagination/Pagination.d.ts +33 -4
- package/dist/components/pagination/Pagination.d.ts.map +1 -1
- package/dist/components/pagination/Pagination.js +80 -16
- package/dist/components/pagination/Pagination.js.map +1 -1
- package/dist/components/tabs/Tab.d.ts +108 -0
- package/dist/components/tabs/Tab.d.ts.map +1 -0
- package/dist/components/tabs/Tab.js +152 -0
- package/dist/components/tabs/Tab.js.map +1 -0
- package/dist/components/tabs/Tabs.d.ts +126 -0
- package/dist/components/tabs/Tabs.d.ts.map +1 -0
- package/dist/components/tabs/Tabs.js +390 -0
- package/dist/components/tabs/Tabs.js.map +1 -0
- package/dist/custom-elements.json +2635 -1591
- package/dist/storybook/assets/ActionBar.stories--nAeDC-G.js +408 -0
- package/dist/storybook/assets/ActionItem.stories-BHrGjk-P.js +203 -0
- package/dist/storybook/assets/{Avatar.stories-B26mRkkZ.js → Avatar.stories-Da-mRj6_.js} +1 -1
- package/dist/storybook/assets/{AvatarGroup.stories-J7lVGsMY.js → AvatarGroup.stories-BQlaC_yl.js} +1 -1
- package/dist/storybook/assets/{Badge.stories-BpTIV61M.js → Badge.stories-DnVnOrnF.js} +1 -1
- package/dist/storybook/assets/{Button-Dg-fIrzT.js → Button-CFLAI1H9.js} +1 -1
- package/dist/storybook/assets/{Button.stories-gPKRVbxk.js → Button.stories-DxaBOjwv.js} +1 -1
- package/dist/storybook/assets/{Celebrate.stories-DbY-sKEe.js → Celebrate.stories-CuMm15Nr.js} +1 -1
- package/dist/storybook/assets/{CircularProgress.stories-DeH5JYX_.js → CircularProgress.stories-DRN8Mtvj.js} +1 -1
- package/dist/storybook/assets/{ClipboardMixin.stories-C-lZ4uuw.js → ClipboardMixin.stories-DR7Ou2Av.js} +1 -1
- package/dist/storybook/assets/{Color-6BZIO3FS-Cu6zVIuG.js → Color-6BZIO3FS-Die62Y0Z.js} +1 -1
- package/dist/storybook/assets/{Colors.stories-D6XYMrTD.js → Colors.stories-bIq_ssbI.js} +1 -1
- package/dist/storybook/assets/{CombinedEffects.stories-jFekKTYg.js → CombinedEffects.stories-CtKzOUZn.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin-g50hRCPT.js → ComponentStatesMixin-DMLCk9fE.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin.stories-D3Q5pR38.js → ComponentStatesMixin.stories-D8UI9o-d.js} +1 -1
- package/dist/storybook/assets/{CopyToClipboard.stories-COZZ1VC2.js → CopyToClipboard.stories-ti6CpJNp.js} +1 -1
- package/dist/storybook/assets/{Debounce.stories-Dl10LAnx.js → Debounce.stories-DzZUSvbk.js} +1 -1
- package/dist/storybook/assets/{DocsRenderer-LL677BLK-CFLtMbUx.js → DocsRenderer-LL677BLK-CIRGv5IX.js} +3 -3
- package/dist/storybook/assets/{Dropdown.stories-Drwq-0Z2.js → Dropdown.stories-Lt4cY0Re.js} +41 -14
- package/dist/storybook/assets/{Events.stories-dODeR-g-.js → Events.stories-B1ddcgpT.js} +1 -1
- package/dist/storybook/assets/{Heading.stories-CH7_-_q3.js → Heading.stories-DI4w61cf.js} +1 -1
- package/dist/storybook/assets/{HueRipple.stories-CH1Y739k.js → HueRipple.stories-DjhoxxEw.js} +1 -1
- package/dist/storybook/assets/{Icon.stories-CPjM-jTU.js → Icon.stories-CpziAhae.js} +1 -1
- package/dist/storybook/assets/{IconButton.stories-DuzqvcnN.js → IconButton.stories-KjN28hfc.js} +1 -1
- package/dist/storybook/assets/{LinearProgress.stories-C7IdnJd3.js → LinearProgress.stories-DcIpdz6R.js} +1 -1
- package/dist/storybook/assets/Pagination.stories-BBkLEwoP.js +252 -0
- package/dist/storybook/assets/{Popover.stories-Ca1F-wrI.js → Popover.stories-DLv48c2h.js} +1 -1
- package/dist/storybook/assets/{ReadyMixin-DNZ5dCsZ.js → ReadyMixin-Cw2Dfbu2.js} +1 -1
- package/dist/storybook/assets/RovingTabindexMixin.stories-BWaFx9mu.js +192 -0
- package/dist/storybook/assets/{Rtc.stories-BVJc1vCA.js → Rtc.stories-Ve7Bwo_l.js} +1 -1
- package/dist/storybook/assets/ScrollShadow.stories-C6XmrRLm.js +17 -0
- package/dist/storybook/assets/{Switch.stories-BEEHP8mD.js → Switch.stories-Cf8WM1LG.js} +1 -1
- package/dist/storybook/assets/Tab.stories-CEtdEtOx.js +218 -0
- package/dist/storybook/assets/Tabs.stories-CIAO1bPO.js +211 -0
- package/dist/storybook/assets/{Throttle.stories-C4xsYeAb.js → Throttle.stories-BqxVIb-r.js} +1 -1
- package/dist/storybook/assets/{Tooltip.stories-Ccm4AnSv.js → Tooltip.stories-B6fw6875.js} +1 -1
- package/dist/storybook/assets/{Welcome.stories-Degjk-M0.js → Welcome.stories-CfJtSM19.js} +1 -1
- package/dist/storybook/assets/{Widget.stories-OKnZ9sDs.js → Widget.stories-CiOho7lO.js} +1 -1
- package/dist/storybook/assets/{WithTooltip-65CFNBJE-CXL3TyJ2.js → WithTooltip-65CFNBJE-PGcopp73.js} +2 -2
- package/dist/storybook/assets/{blocks-DLdUKG_W.js → blocks-dP2DwISI.js} +5 -5
- package/dist/storybook/assets/{formatter-EIJCOSYU-29NCxjfM.js → formatter-EIJCOSYU-CZSAC3tg.js} +1 -1
- package/dist/storybook/assets/if-defined-B1RdczOE.js +1 -0
- package/dist/storybook/assets/{iframe-BqvwP3or.js → iframe-DloIUNZz.js} +161 -161
- package/dist/storybook/assets/iframe-bJgLXZKK.css +1 -0
- package/dist/storybook/assets/{index-BIyTv1BF.js → index-DKF0ypu5.js} +1 -1
- package/dist/storybook/assets/onFind-C0l4Gew0.js +1 -0
- package/dist/storybook/assets/{onFind.stories-D64-QZqf.js → onFind.stories-DOTt9puO.js} +1 -1
- package/dist/storybook/assets/{onRemove.stories-BICsnIJL.js → onRemove.stories-CQ9ZC5dm.js} +1 -1
- package/dist/storybook/assets/{onVisible.stories-DpDZP9_5.js → onVisible.stories-Cbj5_Vz0.js} +1 -1
- package/dist/storybook/assets/style-map-DLXysq3r.js +1 -0
- package/dist/storybook/assets/{syntaxhighlighter-ED5Y7EFY-Bz_DuQj8.js → syntaxhighlighter-ED5Y7EFY-Bjjbl9ca.js} +1 -1
- package/dist/storybook/iframe.html +2 -2
- package/dist/storybook/index.json +1 -1
- package/dist/storybook/project.json +1 -1
- package/dist/tailwind-plugin-action-bar.d.ts +2 -0
- package/dist/tailwind-plugin-action-bar.d.ts.map +1 -0
- package/dist/tailwind-plugin-action-bar.js +120 -0
- package/dist/tailwind-plugin-action-bar.js.map +1 -0
- package/dist/tailwind-plugin-action-bar.ts +134 -0
- package/dist/tailwind-plugin-badge.js +4 -5
- package/dist/tailwind-plugin-badge.js.map +1 -1
- package/dist/tailwind-plugin-badge.ts +4 -5
- package/dist/tailwind-plugin-button.js +1 -0
- package/dist/tailwind-plugin-button.js.map +1 -1
- package/dist/tailwind-plugin-button.ts +1 -0
- package/dist/tailwind-plugin-pagination.js +13 -23
- package/dist/tailwind-plugin-pagination.js.map +1 -1
- package/dist/tailwind-plugin-pagination.ts +15 -25
- package/dist/tailwind-plugin-tabs.d.ts +2 -0
- package/dist/tailwind-plugin-tabs.d.ts.map +1 -0
- package/dist/tailwind-plugin-tabs.js +151 -0
- package/dist/tailwind-plugin-tabs.js.map +1 -0
- package/dist/tailwind-plugin-tabs.ts +162 -0
- package/dist/util/EventEmitterMixin.d.ts +16 -0
- package/dist/util/EventEmitterMixin.d.ts.map +1 -1
- package/dist/util/EventEmitterMixin.js.map +1 -1
- package/dist/util/RovingTabindexMixin.d.ts +38 -0
- package/dist/util/RovingTabindexMixin.d.ts.map +1 -0
- package/dist/util/RovingTabindexMixin.js +83 -0
- package/dist/util/RovingTabindexMixin.js.map +1 -0
- package/docs/components/ActionBar.md +71 -0
- package/docs/components/ActionItem.md +76 -0
- package/docs/components/Dropdown.md +7 -7
- package/docs/components/DropdownItem.md +9 -5
- package/docs/components/DropdownMenu.md +12 -12
- package/docs/components/Pagination.md +37 -34
- package/docs/components/README.md +4 -0
- package/docs/components/Tab.md +73 -0
- package/docs/components/Tabs.md +77 -0
- package/package.json +1 -1
- package/dist/storybook/assets/Pagination.stories-C4cLjS_9.js +0 -272
- package/dist/storybook/assets/ScrollShadow.stories-C3W5o9ZW.js +0 -17
- package/dist/storybook/assets/if-defined-BZFPaJjl.js +0 -1
- package/dist/storybook/assets/iframe-C5bIZMJ5.css +0 -1
- package/dist/storybook/assets/onFind-1l3EPW-I.js +0 -1
- package/dist/storybook/assets/style-map-CBrSnxRe.js +0 -1
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import plugin from 'tailwindcss/plugin'
|
|
2
|
+
declare let module: any
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Tabs component styles.
|
|
6
|
+
*
|
|
7
|
+
* Class Names:
|
|
8
|
+
*
|
|
9
|
+
* btu-tabs - Root container
|
|
10
|
+
* btu-tabs-xs - Extra small container padding
|
|
11
|
+
* btu-tabs-sm - Small container padding
|
|
12
|
+
* btu-tabs-md - Medium container padding (default)
|
|
13
|
+
* btu-tabs-lg - Large container padding
|
|
14
|
+
* btu-tab - Individual tab wrapper
|
|
15
|
+
* btu-tab-button - Inner tab button
|
|
16
|
+
* btu-tab-button-xs - Extra small button height/text
|
|
17
|
+
* btu-tab-button-sm - Small button height/text
|
|
18
|
+
* btu-tab-button-md - Medium button height/text (default)
|
|
19
|
+
* btu-tab-button-lg - Large button height/text
|
|
20
|
+
* btu-tab-indicator - Active tab underline indicator
|
|
21
|
+
* btu-tabs-menu-mode - Menu variant overflow override
|
|
22
|
+
* btu-tab-menu-wrapper - Menu variant wrapper for label and dropdown
|
|
23
|
+
* btu-tab-menu-label - Menu variant active tab label
|
|
24
|
+
*
|
|
25
|
+
* CSS Custom Properties:
|
|
26
|
+
*
|
|
27
|
+
* --tabs-active-color - Text and icon color of the active tab (default: gray-700)
|
|
28
|
+
* --tabs-active-indicator-color - Color of the active tab underline indicator (default: primary gradient)
|
|
29
|
+
* --tabs-border-color - Bottom border divider color (default: gray-200)
|
|
30
|
+
* --tabs-color - Text and icon color for all tabs (default: gray-500)
|
|
31
|
+
* --tabs-background - Background color for all tab buttons (default: transparent)
|
|
32
|
+
* --tabs-container-background - Background color of the tabs container (default: theme white)
|
|
33
|
+
* --tabs-hover-background - Background color of a tab on hover (default: gray-100)
|
|
34
|
+
* --tabs-hover-color - Text and icon color of a tab on hover (default: gray-700)
|
|
35
|
+
* --tabs-gap - Spacing between tabs (default: 1rem)
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
module.exports = plugin(function ({ addComponents, addBase, config, theme }) {
|
|
39
|
+
const fontSize_xs = config('theme.fontSize.xs')?.[0] ?? '0.75rem'
|
|
40
|
+
const fontSize_sm = config('theme.fontSize.sm')?.[0] ?? '0.875rem'
|
|
41
|
+
const fontSize_base = config('theme.fontSize.base')?.[0] ?? '1rem'
|
|
42
|
+
|
|
43
|
+
addBase({
|
|
44
|
+
'@keyframes btu-tab-draw': {
|
|
45
|
+
from: { transform: 'scaleX(0)' },
|
|
46
|
+
to: { transform: 'scaleX(1)' },
|
|
47
|
+
},
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
addComponents({
|
|
51
|
+
'.btu-tabs': {
|
|
52
|
+
display: 'flex',
|
|
53
|
+
alignItems: 'center',
|
|
54
|
+
gap: 'var(--tabs-gap, 1rem)',
|
|
55
|
+
position: 'relative',
|
|
56
|
+
borderBottom: '1px solid var(--tabs-border-color, oklch(var(--btu-theme-gray-200)))',
|
|
57
|
+
backgroundColor: 'var(--tabs-container-background, var(--btu-theme-white))',
|
|
58
|
+
overflowX: 'auto',
|
|
59
|
+
overflowY: 'clip',
|
|
60
|
+
},
|
|
61
|
+
// In menu mode, disable scrolling so the dropdown can extend beyond the container
|
|
62
|
+
'.btu-tabs-menu-mode': {
|
|
63
|
+
overflowX: 'visible',
|
|
64
|
+
overflowY: 'visible',
|
|
65
|
+
},
|
|
66
|
+
'.btu-tabs-xs': { paddingInline: '1rem' },
|
|
67
|
+
'.btu-tabs-sm': { paddingInline: '1rem' },
|
|
68
|
+
'.btu-tabs-md': { paddingInline: '1.5rem' },
|
|
69
|
+
'.btu-tabs-lg': { paddingInline: '1.5rem' },
|
|
70
|
+
|
|
71
|
+
'.btu-tab': {
|
|
72
|
+
display: 'inline-flex',
|
|
73
|
+
flexDirection: 'column',
|
|
74
|
+
alignItems: 'center',
|
|
75
|
+
flexShrink: '0',
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
'.btu-tab-button': {
|
|
79
|
+
position: 'relative',
|
|
80
|
+
display: 'inline-flex',
|
|
81
|
+
alignItems: 'center',
|
|
82
|
+
justifyContent: 'center',
|
|
83
|
+
gap: '0.5rem',
|
|
84
|
+
paddingInline: '0.5rem',
|
|
85
|
+
cursor: 'pointer',
|
|
86
|
+
whiteSpace: 'nowrap',
|
|
87
|
+
boxSizing: 'border-box',
|
|
88
|
+
backgroundColor: 'var(--tabs-background, transparent)',
|
|
89
|
+
color: 'var(--tabs-color, oklch(var(--btu-theme-gray-500)))',
|
|
90
|
+
transitionProperty: 'color, background-color',
|
|
91
|
+
transitionDuration: '150ms',
|
|
92
|
+
transitionTimingFunction: 'ease',
|
|
93
|
+
'&:hover:not([aria-disabled="true"])': {
|
|
94
|
+
backgroundColor: 'var(--tabs-hover-background, oklch(var(--btu-theme-gray-100)))',
|
|
95
|
+
color: 'var(--tabs-hover-color, oklch(var(--btu-theme-gray-700)))',
|
|
96
|
+
},
|
|
97
|
+
'&[aria-selected="true"]:not([aria-disabled="true"])': {
|
|
98
|
+
color: 'var(--tabs-active-color, oklch(var(--btu-theme-gray-700)))',
|
|
99
|
+
},
|
|
100
|
+
'&[aria-disabled="true"]': {
|
|
101
|
+
color: 'oklch(var(--btu-theme-gray-300))',
|
|
102
|
+
cursor: 'not-allowed',
|
|
103
|
+
},
|
|
104
|
+
'&:focus-visible': {
|
|
105
|
+
outline: 'none',
|
|
106
|
+
boxShadow:
|
|
107
|
+
'inset 0 0 0 3px oklch(var(--btu-theme-primary-100)), inset 0 0 0 4px oklch(var(--btu-theme-primary-600))',
|
|
108
|
+
},
|
|
109
|
+
'@media (prefers-reduced-motion: reduce)': {
|
|
110
|
+
transitionDuration: '0.01ms',
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
'.btu-tab-button-xs': {
|
|
115
|
+
height: '2.25rem',
|
|
116
|
+
fontSize: fontSize_xs,
|
|
117
|
+
fontWeight: '400',
|
|
118
|
+
},
|
|
119
|
+
'.btu-tab-button-sm': {
|
|
120
|
+
height: '2.75rem',
|
|
121
|
+
fontSize: fontSize_sm,
|
|
122
|
+
fontWeight: '500',
|
|
123
|
+
},
|
|
124
|
+
'.btu-tab-button-md': {
|
|
125
|
+
height: '3.25rem',
|
|
126
|
+
fontSize: fontSize_sm,
|
|
127
|
+
fontWeight: '500',
|
|
128
|
+
},
|
|
129
|
+
'.btu-tab-button-lg': {
|
|
130
|
+
height: '3.5rem',
|
|
131
|
+
fontSize: fontSize_base,
|
|
132
|
+
fontWeight: '500',
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
'.btu-tab-indicator': {
|
|
136
|
+
position: 'absolute',
|
|
137
|
+
bottom: '0',
|
|
138
|
+
left: '0',
|
|
139
|
+
right: '0',
|
|
140
|
+
height: '0.125rem',
|
|
141
|
+
background: `var(--tabs-active-indicator-color, ${theme('backgroundImage.primary-gradient')})`,
|
|
142
|
+
transformOrigin: 'left',
|
|
143
|
+
animation: 'btu-tab-draw 200ms ease-out',
|
|
144
|
+
'@media (prefers-reduced-motion: reduce)': {
|
|
145
|
+
animationDuration: '0.01ms',
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
|
|
149
|
+
'.btu-tab-menu-wrapper': {
|
|
150
|
+
display: 'inline-flex',
|
|
151
|
+
alignItems: 'center',
|
|
152
|
+
gap: '0.5rem',
|
|
153
|
+
},
|
|
154
|
+
|
|
155
|
+
'.btu-tab-menu-label': {
|
|
156
|
+
fontSize: fontSize_sm,
|
|
157
|
+
fontWeight: '500',
|
|
158
|
+
color: 'var(--tabs-active-color, oklch(var(--btu-theme-gray-700)))',
|
|
159
|
+
whiteSpace: 'nowrap',
|
|
160
|
+
},
|
|
161
|
+
})
|
|
162
|
+
})
|
|
@@ -60,17 +60,33 @@ export interface CustomEventMap {
|
|
|
60
60
|
'btu-dropdown-item-ready': CustomEvent<unknown>;
|
|
61
61
|
'btu-dropdown-item-select': CustomEvent<{
|
|
62
62
|
label: string;
|
|
63
|
+
value: string;
|
|
63
64
|
selected: boolean;
|
|
64
65
|
}>;
|
|
65
66
|
'btu-dropdown-item-favorite': CustomEvent<{
|
|
66
67
|
label: string;
|
|
67
68
|
favorited: boolean;
|
|
68
69
|
}>;
|
|
70
|
+
'btu-tabs-ready': CustomEvent<unknown>;
|
|
71
|
+
'btu-tab-ready': CustomEvent<unknown>;
|
|
72
|
+
'btu-tab-change': CustomEvent<{
|
|
73
|
+
name: string;
|
|
74
|
+
}>;
|
|
75
|
+
'btu-tabs-show': CustomEvent<{
|
|
76
|
+
name: string;
|
|
77
|
+
}>;
|
|
78
|
+
'btu-tabs-hide': CustomEvent<{
|
|
79
|
+
name: string;
|
|
80
|
+
}>;
|
|
69
81
|
'btu-switch-ready': CustomEvent<unknown>;
|
|
70
82
|
'btu-switch-change': CustomEvent<{
|
|
71
83
|
checked: boolean;
|
|
72
84
|
}>;
|
|
73
85
|
'btu-switch-focus': CustomEvent<unknown>;
|
|
86
|
+
'btu-action-bar-ready': CustomEvent<unknown>;
|
|
87
|
+
'btu-action-item-click': CustomEvent<{
|
|
88
|
+
label: string;
|
|
89
|
+
}>;
|
|
74
90
|
}
|
|
75
91
|
interface CombinedEventMap extends HTMLElementEventMap, CustomEventMap {
|
|
76
92
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventEmitterMixin.d.ts","sourceRoot":"","sources":["../../src/util/EventEmitterMixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAEhC,KAAK,WAAW,CAAC,CAAC,GAAG,MAAM,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA;AACxD,KAAK,iBAAiB,CAAC,CAAC,IAAI,CAAC,SAAS,WAAW,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;AAEtE;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,uBAAuB,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;IAC7C,0BAA0B,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;IAChD,mBAAmB,EAAE,WAAW,CAAC;QAAE,KAAK,EAAE,KAAK,CAAA;KAAE,CAAC,CAAA;IAClD,kBAAkB,EAAE,WAAW,C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AE,UAAU,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"EventEmitterMixin.js","sourceRoot":"","sources":["../../src/util/EventEmitterMixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AA2EhC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAoC,UAAa,EAAE,EAAE;IACpF,MAAM,sBAAuB,SAAQ,UAAU;QAC7C;;;;WAIG;QACH,iBAAiB;YACf,KAAK,CAAC,iBAAiB,EAAE,CAAA;YACzB,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CACpB,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,uBAAuB,EAAE,EAAE,CAAC,EAC5C,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAE,KAAK,EAAE,CAAC,CACnD,CAAA;QACH,CAAC;QAED;;;;WAIG;QACH,oBAAoB;YAClB,KAAK,CAAC,oBAAoB,EAAE,CAAA;YAC5B,IAAI,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAA;QACvC,CAAC;QAED;;;;;;;;;;;;;;;;WAgBG;QACH,IAAI,CAAiC,IAAO,EAAE,MAA6C;YACzF,OAAO,IAAI,CAAC,aAAa,CACvB,IAAI,WAAW,CAAC,IAAI,EAAE;gBACpB,OAAO,EAAE,IAAI;gBACb,UAAU,EAAE,KAAK;gBACjB,QAAQ,EAAE,IAAI;gBACd,MAAM;aACP,CAAC,CACH,CAAA;QACH,CAAC;KACF;IACD,OAAO,sBAAqE,CAAA;AAC9E,CAAC,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
type Constructor<T = object> = new (...args: any[]) => T;
|
|
3
|
+
export declare class RovingTabindexInterface {
|
|
4
|
+
_rovingIndex: number;
|
|
5
|
+
_getRovingTargets(): HTMLElement[];
|
|
6
|
+
_rovingFocus(index: number, shouldFocus?: boolean): void;
|
|
7
|
+
_rovingNext(): void;
|
|
8
|
+
_rovingPrev(): void;
|
|
9
|
+
_rovingFirst(): void;
|
|
10
|
+
_rovingLast(): void;
|
|
11
|
+
_rovingCurrentIndex(): number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @mixin
|
|
15
|
+
* Mixin that provides roving tabindex navigation primitives for toolbar
|
|
16
|
+
* and menu components following WAI-ARIA keyboard patterns.
|
|
17
|
+
*
|
|
18
|
+
* Subclasses override `_getRovingTargets()` to return the focusable HTMLElements
|
|
19
|
+
* in DOM order. The mixin manages tabindex across those targets (one `0`, rest `-1`)
|
|
20
|
+
* and provides wrapping next/prev/first/last navigation.
|
|
21
|
+
*
|
|
22
|
+
* Does NOT install a keydown handler — each component defines its own
|
|
23
|
+
* (horizontal vs vertical, RTL, extra keys like Enter/Escape).
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* import { RovingTabindexMixin } from './RovingTabindexMixin'
|
|
28
|
+
*
|
|
29
|
+
* class MyToolbar extends RovingTabindexMixin(LitElement) {
|
|
30
|
+
* _getRovingTargets(): HTMLElement[] {
|
|
31
|
+
* return Array.from(this.querySelectorAll('button'))
|
|
32
|
+
* }
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare const RovingTabindexMixin: <T extends Constructor<LitElement>>(superClass: T) => Constructor<RovingTabindexInterface> & T;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=RovingTabindexMixin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RovingTabindexMixin.d.ts","sourceRoot":"","sources":["../../src/util/RovingTabindexMixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAEhC,KAAK,WAAW,CAAC,CAAC,GAAG,MAAM,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA;AAExD,MAAM,CAAC,OAAO,OAAO,uBAAuB;IAC1C,YAAY,EAAE,MAAM,CAAA;IACpB,iBAAiB,IAAI,WAAW,EAAE;IAClC,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,OAAO,GAAG,IAAI;IACxD,WAAW,IAAI,IAAI;IACnB,WAAW,IAAI,IAAI;IACnB,YAAY,IAAI,IAAI;IACpB,WAAW,IAAI,IAAI;IACnB,mBAAmB,IAAI,MAAM;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS,WAAW,CAAC,UAAU,CAAC,EAAE,YAAY,CAAC,KAuDpD,WAAW,CAAC,uBAAuB,CAAC,GAAG,CACtE,CAAA"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* @mixin
|
|
4
|
+
* Mixin that provides roving tabindex navigation primitives for toolbar
|
|
5
|
+
* and menu components following WAI-ARIA keyboard patterns.
|
|
6
|
+
*
|
|
7
|
+
* Subclasses override `_getRovingTargets()` to return the focusable HTMLElements
|
|
8
|
+
* in DOM order. The mixin manages tabindex across those targets (one `0`, rest `-1`)
|
|
9
|
+
* and provides wrapping next/prev/first/last navigation.
|
|
10
|
+
*
|
|
11
|
+
* Does NOT install a keydown handler — each component defines its own
|
|
12
|
+
* (horizontal vs vertical, RTL, extra keys like Enter/Escape).
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* import { RovingTabindexMixin } from './RovingTabindexMixin'
|
|
17
|
+
*
|
|
18
|
+
* class MyToolbar extends RovingTabindexMixin(LitElement) {
|
|
19
|
+
* _getRovingTargets(): HTMLElement[] {
|
|
20
|
+
* return Array.from(this.querySelectorAll('button'))
|
|
21
|
+
* }
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export const RovingTabindexMixin = (superClass) => {
|
|
26
|
+
class RovingTabindexClass extends superClass {
|
|
27
|
+
constructor() {
|
|
28
|
+
super(...arguments);
|
|
29
|
+
/** Index of the last focused target */
|
|
30
|
+
this._rovingIndex = 0;
|
|
31
|
+
}
|
|
32
|
+
/** Override: return focusable HTMLElements in navigation order */
|
|
33
|
+
_getRovingTargets() {
|
|
34
|
+
return [];
|
|
35
|
+
}
|
|
36
|
+
/** Set tabindex 0 on target at index, -1 on all others. Optionally focus. */
|
|
37
|
+
_rovingFocus(index, shouldFocus = true) {
|
|
38
|
+
const targets = this._getRovingTargets();
|
|
39
|
+
if (targets.length === 0)
|
|
40
|
+
return;
|
|
41
|
+
const clamped = Math.max(0, Math.min(index, targets.length - 1));
|
|
42
|
+
targets.forEach((t, i) => t.setAttribute('tabindex', i === clamped ? '0' : '-1'));
|
|
43
|
+
if (shouldFocus)
|
|
44
|
+
targets[clamped]?.focus();
|
|
45
|
+
this._rovingIndex = clamped;
|
|
46
|
+
}
|
|
47
|
+
/** Move to next target (wraps to first) */
|
|
48
|
+
_rovingNext() {
|
|
49
|
+
const targets = this._getRovingTargets();
|
|
50
|
+
if (targets.length === 0)
|
|
51
|
+
return;
|
|
52
|
+
const current = this._rovingCurrentIndex();
|
|
53
|
+
const next = current < targets.length - 1 ? current + 1 : 0;
|
|
54
|
+
this._rovingFocus(next);
|
|
55
|
+
}
|
|
56
|
+
/** Move to previous target (wraps to last) */
|
|
57
|
+
_rovingPrev() {
|
|
58
|
+
const targets = this._getRovingTargets();
|
|
59
|
+
if (targets.length === 0)
|
|
60
|
+
return;
|
|
61
|
+
const current = this._rovingCurrentIndex();
|
|
62
|
+
const prev = current > 0 ? current - 1 : targets.length - 1;
|
|
63
|
+
this._rovingFocus(prev);
|
|
64
|
+
}
|
|
65
|
+
/** Focus first target */
|
|
66
|
+
_rovingFirst() {
|
|
67
|
+
this._rovingFocus(0);
|
|
68
|
+
}
|
|
69
|
+
/** Focus last target */
|
|
70
|
+
_rovingLast() {
|
|
71
|
+
const targets = this._getRovingTargets();
|
|
72
|
+
if (targets.length > 0)
|
|
73
|
+
this._rovingFocus(targets.length - 1);
|
|
74
|
+
}
|
|
75
|
+
/** Find index of currently focused target */
|
|
76
|
+
_rovingCurrentIndex() {
|
|
77
|
+
const active = document.activeElement;
|
|
78
|
+
return this._getRovingTargets().findIndex(t => t === active || t.contains(active));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return RovingTabindexClass;
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=RovingTabindexMixin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RovingTabindexMixin.js","sourceRoot":"","sources":["../../src/util/RovingTabindexMixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAehC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAoC,UAAa,EAAE,EAAE;IACtF,MAAM,mBAAoB,SAAQ,UAAU;QAA5C;;YACE,uCAAuC;YACvC,iBAAY,GAAG,CAAC,CAAA;QAmDlB,CAAC;QAjDC,kEAAkE;QAClE,iBAAiB;YACf,OAAO,EAAE,CAAA;QACX,CAAC;QAED,6EAA6E;QAC7E,YAAY,CAAC,KAAa,EAAE,WAAW,GAAG,IAAI;YAC5C,MAAM,OAAO,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAA;YACxC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;gBAAE,OAAM;YAChC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAA;YAChE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CA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gBAAE,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;QAC/D,CAAC;QAED,6CAA6C;QAC7C,mBAAmB;YACjB,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAA;YACrC,OAAO,IAAI,CAAC,iBAAiB,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,MAAM,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAA;QACpF,CAAC;KACF;IACD,OAAO,mBAA+D,CAAA;AACxE,CAAC,CAAA"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# `src/components/action-bar/ActionBar.ts`:
|
|
2
|
+
|
|
3
|
+
## class: `ActionBar`, `btu-action-bar`
|
|
4
|
+
|
|
5
|
+
### Superclass
|
|
6
|
+
|
|
7
|
+
| Name | Module | Package |
|
|
8
|
+
| ------------ | ------ | ------- |
|
|
9
|
+
| `LitElement` | | lit |
|
|
10
|
+
|
|
11
|
+
### Mixins
|
|
12
|
+
|
|
13
|
+
| Name | Module | Package |
|
|
14
|
+
| --------------------- | -------------------------------- | ------- |
|
|
15
|
+
| `RovingTabindexMixin` | /src/util/RovingTabindexMixin.js | |
|
|
16
|
+
| `EventEmitterMixin` | /src/util/EventEmitterMixin.js | |
|
|
17
|
+
| `ReadyMixin` | /src/util/ReadyMixin.js | |
|
|
18
|
+
|
|
19
|
+
### Fields
|
|
20
|
+
|
|
21
|
+
| Name | Privacy | Type | Default | Description | Inherited From |
|
|
22
|
+
| ----------- | ------- | ----------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
|
|
23
|
+
| `position` | | `Position` | `'bottom'` | Bar position: 'top' or 'bottom' (default). | |
|
|
24
|
+
| `sticky` | | `boolean` | `false` | Enables CSS sticky positioning. When combined with position='top',
the bar sticks to the top of the scroll container. With position='bottom'
(default), it sticks to the bottom. | |
|
|
25
|
+
| `alignment` | | `Alignment` | `'default'` | Content alignment: 'default' (two-zone), 'start', 'center', 'end'.
Non-default alignments disable two-zone layout. | |
|
|
26
|
+
| `shadow` | | `boolean` | `false` | Adds a box-shadow to the bar. | |
|
|
27
|
+
| `label` | | `string` | `''` | Accessible label for the toolbar region. | |
|
|
28
|
+
| `compact` | | `boolean` | `false` | Enables progressive label compacting. When space shrinks, items marked
\`compactable\` (with icons) have their labels hidden one-by-one
from least to most important before items overflow into "More". | |
|
|
29
|
+
|
|
30
|
+
### Events
|
|
31
|
+
|
|
32
|
+
| Name | Type | Description | Inherited From |
|
|
33
|
+
| ----------------------- | ------------------------------ | ------------------------------------------------------------------- | -------------- |
|
|
34
|
+
| `btu-action-bar-ready` | `CustomEvent` | Fired after first render and initialization | |
|
|
35
|
+
| `btu-action-item-click` | `CustomEvent<{label: string}>` | Fired when an action item is clicked (bubbles from btu-action-item) | |
|
|
36
|
+
|
|
37
|
+
### Attributes
|
|
38
|
+
|
|
39
|
+
| Name | Field | Inherited From |
|
|
40
|
+
| ---------------- | --------- | -------------- |
|
|
41
|
+
| `position` | position | |
|
|
42
|
+
| `sticky` | sticky | |
|
|
43
|
+
| `item-alignment` | alignment | |
|
|
44
|
+
| `shadow` | shadow | |
|
|
45
|
+
| `label` | label | |
|
|
46
|
+
| `compact` | compact | |
|
|
47
|
+
|
|
48
|
+
### CSS Properties
|
|
49
|
+
|
|
50
|
+
| Name | Default | Description |
|
|
51
|
+
| --------------------------- | ------- | ------------------------------------ |
|
|
52
|
+
| `--action-bar-gap` | | Gap between items (default: 0.75rem) |
|
|
53
|
+
| `--action-bar-padding` | | Bar padding (default: 1.5rem) |
|
|
54
|
+
| `--action-bar-background` | | Background color (default: white) |
|
|
55
|
+
| `--action-bar-border-color` | | Border color (default: gray-200) |
|
|
56
|
+
| `--action-bar-z-index` | | Z-index (default: 100) |
|
|
57
|
+
|
|
58
|
+
### Slots
|
|
59
|
+
|
|
60
|
+
| Name | Description |
|
|
61
|
+
| ---- | ---------------------------------------- |
|
|
62
|
+
| | One or more \`btu-action-item\` elements |
|
|
63
|
+
|
|
64
|
+
<hr/>
|
|
65
|
+
|
|
66
|
+
## Exports
|
|
67
|
+
|
|
68
|
+
| Kind | Name | Declaration | Module | Package |
|
|
69
|
+
| --------------------------- | ---------------- | ----------- | -------------------------------------- | ------- |
|
|
70
|
+
| `js` | `default` | ActionBar | src/components/action-bar/ActionBar.ts | |
|
|
71
|
+
| `custom-element-definition` | `btu-action-bar` | ActionBar | src/components/action-bar/ActionBar.ts | |
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# `src/components/action-bar/ActionItem.ts`:
|
|
2
|
+
|
|
3
|
+
## class: `ActionItem`, `btu-action-item`
|
|
4
|
+
|
|
5
|
+
### Superclass
|
|
6
|
+
|
|
7
|
+
| Name | Module | Package |
|
|
8
|
+
| ------------ | ------ | ------- |
|
|
9
|
+
| `LitElement` | | lit |
|
|
10
|
+
|
|
11
|
+
### Mixins
|
|
12
|
+
|
|
13
|
+
| Name | Module | Package |
|
|
14
|
+
| ------------------- | ------------------------------ | ------- |
|
|
15
|
+
| `TooltipMixin` | /src/util/TooltipMixin.js | |
|
|
16
|
+
| `EventEmitterMixin` | /src/util/EventEmitterMixin.js | |
|
|
17
|
+
| `ReadyMixin` | /src/util/ReadyMixin.js | |
|
|
18
|
+
|
|
19
|
+
### Fields
|
|
20
|
+
|
|
21
|
+
| Name | Privacy | Type | Default | Description | Inherited From |
|
|
22
|
+
| ------------- | ------- | ------------------------ | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
|
|
23
|
+
| `label` | | `string` | `''` | Button label text. | |
|
|
24
|
+
| `variant` | | `ActionItemVariant` | `'secondary'` | Visual variant: 'primary', 'secondary', 'tertiary', 'destructive'. | |
|
|
25
|
+
| `iconName` | | `string` | `''` | Lucide icon name for the leading icon. | |
|
|
26
|
+
| `iconOnly` | | `boolean` | `false` | Show icon only, hiding the label. Tooltip activates automatically with the label text. | |
|
|
27
|
+
| `disabled` | | `boolean` | `false` | Disables the action item. The button remains focusable for accessibility
but click events are suppressed. | |
|
|
28
|
+
| `loading` | | `boolean` | `false` | Shows a loading spinner and prevents interaction. | |
|
|
29
|
+
| `zone` | | `'start' \| 'end' \| ''` | `''` | Zone placement: 'start' or 'end'. Used by ActionBar for two-zone layout.
If unset, auto-detected from variant (destructive → start, others → end). | |
|
|
30
|
+
| `compactable` | | `boolean` | `false` | Opt-in for progressive label compacting. When the parent bar has \`compact\`
enabled and space shrinks, compactable items with icons have their labels
hidden one-by-one (least important first) before overflowing.
Items without an icon ignore this attribute and go directly to overflow. | |
|
|
31
|
+
|
|
32
|
+
### Methods
|
|
33
|
+
|
|
34
|
+
| Name | Privacy | Description | Parameters | Return | Inherited From |
|
|
35
|
+
| --------------------- | ------- | ----------- | ---------- | ------------------------ | -------------- |
|
|
36
|
+
| `_relayTooltipAttrs` | private | | | `void` | |
|
|
37
|
+
| `_handleClick` | private | | | `void` | |
|
|
38
|
+
| `_getSpinnerColor` | private | | | `string` | |
|
|
39
|
+
| `_buildButtonClasses` | private | | | `string` | |
|
|
40
|
+
| `_getButtonStyles` | private | | | `Record<string, string>` | |
|
|
41
|
+
|
|
42
|
+
### Events
|
|
43
|
+
|
|
44
|
+
| Name | Type | Description | Inherited From |
|
|
45
|
+
| ----------------------- | ------------------------------ | -------------------------------------------------------------------------- | -------------- |
|
|
46
|
+
| `btu-action-item-click` | `CustomEvent<{label: string}>` | Fired when the action item is clicked (not fired when disabled or loading) | |
|
|
47
|
+
|
|
48
|
+
### Attributes
|
|
49
|
+
|
|
50
|
+
| Name | Field | Inherited From |
|
|
51
|
+
| ------------- | ----------- | -------------- |
|
|
52
|
+
| `label` | label | |
|
|
53
|
+
| `variant` | variant | |
|
|
54
|
+
| `icon-name` | iconName | |
|
|
55
|
+
| `icon-only` | iconOnly | |
|
|
56
|
+
| `disabled` | disabled | |
|
|
57
|
+
| `loading` | loading | |
|
|
58
|
+
| `zone` | zone | |
|
|
59
|
+
| `compactable` | compactable | |
|
|
60
|
+
|
|
61
|
+
### CSS Properties
|
|
62
|
+
|
|
63
|
+
| Name | Default | Description |
|
|
64
|
+
| ------------------------ | ------- | -------------------------------- |
|
|
65
|
+
| `--button-color` | | Override button background color |
|
|
66
|
+
| `--button-text-color` | | Override button text color |
|
|
67
|
+
| `--button-border-radius` | | Override button border radius |
|
|
68
|
+
|
|
69
|
+
<hr/>
|
|
70
|
+
|
|
71
|
+
## Exports
|
|
72
|
+
|
|
73
|
+
| Kind | Name | Declaration | Module | Package |
|
|
74
|
+
| --------------------------- | ----------------- | ----------- | --------------------------------------- | ------- |
|
|
75
|
+
| `js` | `default` | ActionItem | src/components/action-bar/ActionItem.ts | |
|
|
76
|
+
| `custom-element-definition` | `btu-action-item` | ActionItem | src/components/action-bar/ActionItem.ts | |
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
|
|
43
43
|
### Events
|
|
44
44
|
|
|
45
|
-
| Name | Type
|
|
46
|
-
| ---------------------------- |
|
|
47
|
-
| `btu-dropdown-ready` | `CustomEvent`
|
|
48
|
-
| `btu-dropdown-show` | `CustomEvent`
|
|
49
|
-
| `btu-dropdown-hide` | `CustomEvent`
|
|
50
|
-
| `btu-dropdown-item-select` | `CustomEvent<{label: string, selected: boolean}>`
|
|
51
|
-
| `btu-dropdown-item-favorite` | `CustomEvent<{label: string, favorited: boolean}>`
|
|
45
|
+
| Name | Type | Description | Inherited From |
|
|
46
|
+
| ---------------------------- | ---------------------------------------------------------------- | ----------------------------------------------------------------------------- | -------------- |
|
|
47
|
+
| `btu-dropdown-ready` | `CustomEvent` | Fired after first render and initialization | |
|
|
48
|
+
| `btu-dropdown-show` | `CustomEvent` | Fired when the dropdown panel opens | |
|
|
49
|
+
| `btu-dropdown-hide` | `CustomEvent` | Fired when the dropdown panel closes | |
|
|
50
|
+
| `btu-dropdown-item-select` | `CustomEvent<{label: string, value: string, selected: boolean}>` | Fired when a menu item is activated (bubbles from btu-dropdown-item) | |
|
|
51
|
+
| `btu-dropdown-item-favorite` | `CustomEvent<{label: string, favorited: boolean}>` | Fired when a menu item's favorite is toggled (bubbles from btu-dropdown-item) | |
|
|
52
52
|
|
|
53
53
|
### Attributes
|
|
54
54
|
|
|
@@ -23,9 +23,11 @@
|
|
|
23
23
|
| `type` | | `'default' \| 'divider' \| 'subhead'` | `'default'` | Item type: 'default', 'divider', or 'subhead'. | |
|
|
24
24
|
| `iconSymbol` | | `string` | `''` | Lucide icon symbol. | |
|
|
25
25
|
| `shortcut` | | `string` | `''` | Keyboard shortcut display text. | |
|
|
26
|
+
| `value` | | `string` | `''` | Optional data value associated with the item. | |
|
|
26
27
|
| `disabled` | | `boolean` | `false` | Whether the item is disabled. | |
|
|
27
28
|
| `selected` | | `boolean` | `false` | Whether the item is selected/checked. | |
|
|
28
29
|
| `favorited` | | `boolean` | `false` | Whether the item is favorited. | |
|
|
30
|
+
| `error` | | `boolean` | `false` | Whether the item has an error. | |
|
|
29
31
|
|
|
30
32
|
### Methods
|
|
31
33
|
|
|
@@ -36,11 +38,11 @@
|
|
|
36
38
|
|
|
37
39
|
### Events
|
|
38
40
|
|
|
39
|
-
| Name | Type
|
|
40
|
-
| ---------------------------- |
|
|
41
|
-
| `btu-dropdown-item-ready` | `CustomEvent`
|
|
42
|
-
| `btu-dropdown-item-select` | `CustomEvent<{label: string, selected: boolean}>`
|
|
43
|
-
| `btu-dropdown-item-favorite` | `CustomEvent<{label: string, favorited: boolean}>`
|
|
41
|
+
| Name | Type | Description | Inherited From |
|
|
42
|
+
| ---------------------------- | ---------------------------------------------------------------- | ------------------------------ | -------------- |
|
|
43
|
+
| `btu-dropdown-item-ready` | `CustomEvent` | Fired after first render | |
|
|
44
|
+
| `btu-dropdown-item-select` | `CustomEvent<{label: string, value: string, selected: boolean}>` | Fired when item is activated | |
|
|
45
|
+
| `btu-dropdown-item-favorite` | `CustomEvent<{label: string, favorited: boolean}>` | Fired when favorite is toggled | |
|
|
44
46
|
|
|
45
47
|
### Attributes
|
|
46
48
|
|
|
@@ -50,9 +52,11 @@
|
|
|
50
52
|
| `type` | type | |
|
|
51
53
|
| `icon-symbol` | iconSymbol | |
|
|
52
54
|
| `shortcut` | shortcut | |
|
|
55
|
+
| `value` | value | |
|
|
53
56
|
| `disabled` | disabled | |
|
|
54
57
|
| `selected` | selected | |
|
|
55
58
|
| `favorited` | favorited | |
|
|
59
|
+
| `error` | error | |
|
|
56
60
|
|
|
57
61
|
<hr/>
|
|
58
62
|
|
|
@@ -10,10 +10,11 @@
|
|
|
10
10
|
|
|
11
11
|
### Mixins
|
|
12
12
|
|
|
13
|
-
| Name
|
|
14
|
-
|
|
|
15
|
-
| `
|
|
16
|
-
| `
|
|
13
|
+
| Name | Module | Package |
|
|
14
|
+
| --------------------- | -------------------------------- | ------- |
|
|
15
|
+
| `RovingTabindexMixin` | /src/util/RovingTabindexMixin.js | |
|
|
16
|
+
| `EventEmitterMixin` | /src/util/EventEmitterMixin.js | |
|
|
17
|
+
| `ReadyMixin` | /src/util/ReadyMixin.js | |
|
|
17
18
|
|
|
18
19
|
### Fields
|
|
19
20
|
|
|
@@ -31,14 +32,13 @@
|
|
|
31
32
|
|
|
32
33
|
### Methods
|
|
33
34
|
|
|
34
|
-
| Name
|
|
35
|
-
|
|
|
36
|
-
| `
|
|
37
|
-
| `
|
|
38
|
-
| `
|
|
39
|
-
| `
|
|
40
|
-
| `
|
|
41
|
-
| `_handleTypeahead` | private | Typeahead character matching with 500ms accumulation | `char: string, focusable: DropdownItem[]` | `void` | |
|
|
35
|
+
| Name | Privacy | Description | Parameters | Return | Inherited From |
|
|
36
|
+
| -------------------- | ------- | --------------------------------------------------------------- | ----------------------------------------- | ---------------- | -------------- |
|
|
37
|
+
| `_getRovingTargets` | | Override: return menuitem elements from focusable items | | `HTMLElement[]` | |
|
|
38
|
+
| `_configureItems` | private | Configure all child items with menu-level settings | | `void` | |
|
|
39
|
+
| `_getAllItems` | private | Get all btu-dropdown-item children | | `DropdownItem[]` | |
|
|
40
|
+
| `_getFocusableItems` | private | Get only focusable items (default type, skip dividers/subheads) | | `DropdownItem[]` | |
|
|
41
|
+
| `_handleTypeahead` | private | Typeahead character matching with 500ms accumulation | `char: string, focusable: DropdownItem[]` | `void` | |
|
|
42
42
|
|
|
43
43
|
### Events
|
|
44
44
|
|