@brightspot/ui 1.10.0 → 3.0.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/avatar/AvatarGroup.d.ts +3 -0
- package/dist/components/avatar/AvatarGroup.d.ts.map +1 -1
- package/dist/components/avatar/AvatarGroup.js +3 -0
- package/dist/components/avatar/AvatarGroup.js.map +1 -1
- package/dist/components/badge/Badge.d.ts +3 -1
- package/dist/components/badge/Badge.d.ts.map +1 -1
- package/dist/components/badge/Badge.js +2 -0
- package/dist/components/badge/Badge.js.map +1 -1
- package/dist/components/button-group/ButtonGroup.d.ts +138 -0
- package/dist/components/button-group/ButtonGroup.d.ts.map +1 -0
- package/dist/components/button-group/ButtonGroup.js +436 -0
- package/dist/components/button-group/ButtonGroup.js.map +1 -0
- package/dist/components/checkbox/Checkbox.d.ts +107 -0
- package/dist/components/checkbox/Checkbox.d.ts.map +1 -0
- package/dist/components/checkbox/Checkbox.js +224 -0
- package/dist/components/checkbox/Checkbox.js.map +1 -0
- package/dist/components/circular-progress/CircularProgress.d.ts +2 -2
- package/dist/components/circular-progress/CircularProgress.js +2 -2
- package/dist/components/copy-to-clipboard/CopyToClipboard.d.ts +7 -2
- package/dist/components/copy-to-clipboard/CopyToClipboard.d.ts.map +1 -1
- package/dist/components/copy-to-clipboard/CopyToClipboard.js +10 -5
- package/dist/components/copy-to-clipboard/CopyToClipboard.js.map +1 -1
- package/dist/components/dropdown/Dropdown.d.ts +8 -6
- package/dist/components/dropdown/Dropdown.d.ts.map +1 -1
- package/dist/components/dropdown/Dropdown.js +33 -22
- package/dist/components/dropdown/Dropdown.js.map +1 -1
- package/dist/components/dropdown/DropdownItem.d.ts +28 -7
- package/dist/components/dropdown/DropdownItem.d.ts.map +1 -1
- package/dist/components/dropdown/DropdownItem.js +41 -16
- package/dist/components/dropdown/DropdownItem.js.map +1 -1
- package/dist/components/dropdown/DropdownMenu.d.ts +6 -8
- package/dist/components/dropdown/DropdownMenu.d.ts.map +1 -1
- package/dist/components/dropdown/DropdownMenu.js +22 -37
- package/dist/components/dropdown/DropdownMenu.js.map +1 -1
- package/dist/components/empty-state/EmptyState.css +4 -0
- package/dist/components/empty-state/EmptyState.d.ts +103 -0
- package/dist/components/empty-state/EmptyState.d.ts.map +1 -0
- package/dist/components/empty-state/EmptyState.js +209 -0
- package/dist/components/empty-state/EmptyState.js.map +1 -0
- package/dist/components/icon/Icon.d.ts +23 -10
- package/dist/components/icon/Icon.d.ts.map +1 -1
- package/dist/components/icon/Icon.js +40 -9
- package/dist/components/icon/Icon.js.map +1 -1
- package/dist/components/icon-button/IconButton.d.ts +7 -21
- package/dist/components/icon-button/IconButton.d.ts.map +1 -1
- package/dist/components/icon-button/IconButton.js +12 -18
- package/dist/components/icon-button/IconButton.js.map +1 -1
- package/dist/components/linear-progress/LinearProgress.d.ts +2 -2
- package/dist/components/linear-progress/LinearProgress.js +2 -2
- 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 +88 -24
- package/dist/components/pagination/Pagination.js.map +1 -1
- package/dist/components/popover/Popover.d.ts +6 -0
- package/dist/components/popover/Popover.d.ts.map +1 -1
- package/dist/components/popover/Popover.js +6 -0
- package/dist/components/popover/Popover.js.map +1 -1
- package/dist/components/switch/Switch.d.ts +5 -1
- package/dist/components/switch/Switch.d.ts.map +1 -1
- package/dist/components/switch/Switch.js +10 -6
- package/dist/components/switch/Switch.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/components/upload/Upload.d.ts +157 -0
- package/dist/components/upload/Upload.d.ts.map +1 -0
- package/dist/components/upload/Upload.js +538 -0
- package/dist/components/upload/Upload.js.map +1 -0
- package/dist/components/upload/UploadItem.d.ts +73 -0
- package/dist/components/upload/UploadItem.d.ts.map +1 -0
- package/dist/components/upload/UploadItem.js +180 -0
- package/dist/components/upload/UploadItem.js.map +1 -0
- package/dist/components/widget/Widget.d.ts +1 -6
- package/dist/components/widget/Widget.d.ts.map +1 -1
- package/dist/components/widget/Widget.js +1 -6
- package/dist/components/widget/Widget.js.map +1 -1
- package/dist/custom-elements.json +8445 -1989
- package/dist/storybook/assets/ActionBar.stories-DRIVI-W2.js +408 -0
- package/dist/storybook/assets/ActionItem.stories-5qlgxYNB.js +203 -0
- package/dist/storybook/assets/{Avatar.stories-B26mRkkZ.js → Avatar.stories-B3VkhRhP.js} +2 -2
- package/dist/storybook/assets/{AvatarGroup.stories-J7lVGsMY.js → AvatarGroup.stories-DOfim2NY.js} +5 -5
- package/dist/storybook/assets/{Badge.stories-BpTIV61M.js → Badge.stories-B04VNAcc.js} +2 -2
- package/dist/storybook/assets/{Button-Dg-fIrzT.js → Button-CILTcGRT.js} +1 -1
- package/dist/storybook/assets/{Button.stories-gPKRVbxk.js → Button.stories-CzWAltrX.js} +1 -1
- package/dist/storybook/assets/ButtonGroup.stories-1uAJf79o.js +588 -0
- package/dist/storybook/assets/{Celebrate.stories-DbY-sKEe.js → Celebrate.stories-BEqj0VnW.js} +7 -7
- package/dist/storybook/assets/Checkbox.stories-DXAGFS0M.js +141 -0
- package/dist/storybook/assets/{CircularProgress.stories-DeH5JYX_.js → CircularProgress.stories-D4rftw22.js} +7 -7
- package/dist/storybook/assets/{ClipboardMixin.stories-C-lZ4uuw.js → ClipboardMixin.stories-z2n2HWt1.js} +31 -28
- package/dist/storybook/assets/{Color-6BZIO3FS-Cu6zVIuG.js → Color-6BZIO3FS-C6KyMgZz.js} +1 -1
- package/dist/storybook/assets/{Colors.stories-D6XYMrTD.js → Colors.stories-CX-Ny3B_.js} +1 -1
- package/dist/storybook/assets/{CombinedEffects.stories-jFekKTYg.js → CombinedEffects.stories-BkqtiVHp.js} +33 -33
- package/dist/storybook/assets/{ComponentStatesMixin-g50hRCPT.js → ComponentStatesMixin-DLd0feFg.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin.stories-D3Q5pR38.js → ComponentStatesMixin.stories-D6Yc5Jgl.js} +3 -3
- package/dist/storybook/assets/{CopyToClipboard.stories-COZZ1VC2.js → CopyToClipboard.stories-B-omwDDJ.js} +16 -16
- package/dist/storybook/assets/{Debounce.stories-Dl10LAnx.js → Debounce.stories-B2vE5QIx.js} +9 -9
- package/dist/storybook/assets/{DocsRenderer-LL677BLK-CFLtMbUx.js → DocsRenderer-LL677BLK-DNUlRvMg.js} +3 -3
- package/dist/storybook/assets/{Dropdown.stories-Drwq-0Z2.js → Dropdown.stories-_bx4WDLr.js} +95 -68
- package/dist/storybook/assets/EmptyState.stories-CGMbmo77.js +318 -0
- package/dist/storybook/assets/{Events.stories-dODeR-g-.js → Events.stories-CkQYKcoZ.js} +1 -1
- package/dist/storybook/assets/{Heading.stories-CH7_-_q3.js → Heading.stories-BU5Do_od.js} +1 -1
- package/dist/storybook/assets/{HueRipple.stories-CH1Y739k.js → HueRipple.stories-Di2zmxo3.js} +11 -11
- package/dist/storybook/assets/Icon.stories-Dk4ZXhhJ.js +441 -0
- package/dist/storybook/assets/{IconButton.stories-DuzqvcnN.js → IconButton.stories-BSCiXPXa.js} +126 -146
- package/dist/storybook/assets/{LinearProgress.stories-C7IdnJd3.js → LinearProgress.stories-BGxPZuni.js} +7 -7
- package/dist/storybook/assets/Pagination.stories-z3Zq8b4f.js +252 -0
- package/dist/storybook/assets/{Popover.stories-Ca1F-wrI.js → Popover.stories-C9GxWcax.js} +33 -62
- package/dist/storybook/assets/ReadyMixin-CQw8N6P9.js +1 -0
- package/dist/storybook/assets/RovingTabindexMixin.stories-ByxLBi6m.js +192 -0
- package/dist/storybook/assets/{Rtc.stories-BVJc1vCA.js → Rtc.stories-DQJlCXWR.js} +3 -3
- package/dist/storybook/assets/ScrollShadow.stories-gjTIAbUA.js +17 -0
- package/dist/storybook/assets/{Switch.stories-BEEHP8mD.js → Switch.stories-BEeqPZiP.js} +21 -21
- package/dist/storybook/assets/Tab.stories-DpB3I-WZ.js +218 -0
- package/dist/storybook/assets/Tabs.stories-C6mG6Xi7.js +211 -0
- package/dist/storybook/assets/{Throttle.stories-C4xsYeAb.js → Throttle.stories-x9tpGeQh.js} +10 -10
- package/dist/storybook/assets/{Tooltip.stories-Ccm4AnSv.js → Tooltip.stories-CqcLqdmc.js} +2 -2
- package/dist/storybook/assets/Upload.stories-CMaAbCSH.js +447 -0
- package/dist/storybook/assets/UploadItem.stories-GB98L3JQ.js +167 -0
- package/dist/storybook/assets/{Welcome.stories-Degjk-M0.js → Welcome.stories-6h9cUZ7v.js} +1 -1
- package/dist/storybook/assets/{Widget.stories-OKnZ9sDs.js → Widget.stories-DiA1PR6Y.js} +13 -13
- package/dist/storybook/assets/{WithTooltip-65CFNBJE-CXL3TyJ2.js → WithTooltip-65CFNBJE-DTsHhBb_.js} +2 -2
- package/dist/storybook/assets/{blocks-DLdUKG_W.js → blocks-IXdn9TGW.js} +5 -5
- package/dist/storybook/assets/{formatter-EIJCOSYU-29NCxjfM.js → formatter-EIJCOSYU-Cum4J6N4.js} +1 -1
- package/dist/storybook/assets/if-defined-CgfCxQoV.js +1 -0
- package/dist/storybook/assets/iframe-BgFj0b5u.css +1 -0
- package/dist/storybook/assets/{iframe-BqvwP3or.js → iframe-Sf9RHZFu.js} +200 -200
- package/dist/storybook/assets/{index-BIyTv1BF.js → index-D605PvQH.js} +1 -1
- package/dist/storybook/assets/onFind-C41m8c_a.js +1 -0
- package/dist/storybook/assets/{onFind.stories-D64-QZqf.js → onFind.stories-MOTfGlJd.js} +53 -77
- package/dist/storybook/assets/{onRemove.stories-BICsnIJL.js → onRemove.stories-DX58Bf6f.js} +6 -10
- package/dist/storybook/assets/{onVisible.stories-DpDZP9_5.js → onVisible.stories-NNFeFeD8.js} +3 -3
- package/dist/storybook/assets/style-map-B99QiqCo.js +1 -0
- package/dist/storybook/assets/{syntaxhighlighter-ED5Y7EFY-Bz_DuQj8.js → syntaxhighlighter-ED5Y7EFY-BqQ-o9mS.js} +1 -1
- package/dist/storybook/box-illustration.svg +51 -0
- package/dist/storybook/cloud-illustration.svg +49 -0
- package/dist/storybook/docs-illustration.svg +92 -0
- 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 +5 -6
- package/dist/tailwind-plugin-badge.js.map +1 -1
- package/dist/tailwind-plugin-badge.ts +5 -6
- package/dist/tailwind-plugin-button-group.d.ts +2 -0
- package/dist/tailwind-plugin-button-group.d.ts.map +1 -0
- package/dist/tailwind-plugin-button-group.js +215 -0
- package/dist/tailwind-plugin-button-group.js.map +1 -0
- package/dist/tailwind-plugin-button-group.ts +238 -0
- package/dist/tailwind-plugin-button.js +2 -1
- package/dist/tailwind-plugin-button.js.map +1 -1
- package/dist/tailwind-plugin-button.ts +2 -1
- package/dist/tailwind-plugin-checkbox.d.ts +2 -0
- package/dist/tailwind-plugin-checkbox.d.ts.map +1 -0
- package/dist/tailwind-plugin-checkbox.js +246 -0
- package/dist/tailwind-plugin-checkbox.js.map +1 -0
- package/dist/tailwind-plugin-checkbox.ts +281 -0
- package/dist/tailwind-plugin-empty-state.d.ts +2 -0
- package/dist/tailwind-plugin-empty-state.d.ts.map +1 -0
- package/dist/tailwind-plugin-empty-state.js +113 -0
- package/dist/tailwind-plugin-empty-state.js.map +1 -0
- package/dist/tailwind-plugin-empty-state.ts +124 -0
- package/dist/tailwind-plugin-icon.js +122 -18
- package/dist/tailwind-plugin-icon.js.map +1 -1
- package/dist/tailwind-plugin-icon.ts +131 -18
- package/dist/tailwind-plugin-loader.js +3 -3
- package/dist/tailwind-plugin-loader.ts +3 -3
- 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 +158 -0
- package/dist/tailwind-plugin-tabs.js.map +1 -0
- package/dist/tailwind-plugin-tabs.ts +169 -0
- package/dist/tailwind-plugin-upload.d.ts +2 -0
- package/dist/tailwind-plugin-upload.d.ts.map +1 -0
- package/dist/tailwind-plugin-upload.js +322 -0
- package/dist/tailwind-plugin-upload.js.map +1 -0
- package/dist/tailwind-plugin-upload.ts +362 -0
- package/dist/tailwind.config.d.ts.map +1 -1
- package/dist/tailwind.config.js +1 -0
- package/dist/tailwind.config.js.map +1 -1
- package/dist/tailwind.config.ts +1 -0
- package/dist/util/ClipboardMixin.d.ts +7 -2
- package/dist/util/ClipboardMixin.d.ts.map +1 -1
- package/dist/util/ClipboardMixin.js +15 -13
- package/dist/util/ClipboardMixin.js.map +1 -1
- package/dist/util/ComponentStatesMixin.d.ts +2 -1
- package/dist/util/ComponentStatesMixin.d.ts.map +1 -1
- package/dist/util/ComponentStatesMixin.js +4 -0
- package/dist/util/ComponentStatesMixin.js.map +1 -1
- package/dist/util/EventEmitterMixin.d.ts +58 -4
- package/dist/util/EventEmitterMixin.d.ts.map +1 -1
- package/dist/util/EventEmitterMixin.js +5 -2
- package/dist/util/EventEmitterMixin.js.map +1 -1
- package/dist/util/ProgressMixin.d.ts +9 -2
- package/dist/util/ProgressMixin.d.ts.map +1 -1
- package/dist/util/ProgressMixin.js +22 -18
- package/dist/util/ProgressMixin.js.map +1 -1
- package/dist/util/RovingTabindexMixin.d.ts +46 -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/dist/util/TetherLayout.d.ts.map +1 -1
- package/dist/util/TetherLayout.js +3 -0
- package/dist/util/TetherLayout.js.map +1 -1
- package/dist/util/TooltipMixin.d.ts.map +1 -1
- package/dist/util/TooltipMixin.js +5 -4
- package/dist/util/TooltipMixin.js.map +1 -1
- package/dist/util/upload.d.ts +53 -0
- package/dist/util/upload.d.ts.map +1 -0
- package/dist/util/upload.js +113 -0
- package/dist/util/upload.js.map +1 -0
- package/docs/components/ActionBar.md +77 -0
- package/docs/components/ActionItem.md +101 -0
- package/docs/components/Avatar.md +42 -12
- package/docs/components/AvatarGroup.md +4 -3
- package/docs/components/Badge.md +13 -1
- package/docs/components/ButtonGroup.md +91 -0
- package/docs/components/Checkbox.md +91 -0
- package/docs/components/CircularProgress.md +41 -12
- package/docs/components/CopyToClipboard.md +13 -11
- package/docs/components/Dropdown.md +51 -26
- package/docs/components/DropdownItem.md +44 -27
- package/docs/components/DropdownMenu.md +14 -14
- package/docs/components/EmptyState.md +75 -0
- package/docs/components/Icon.md +22 -14
- package/docs/components/IconButton.md +46 -21
- package/docs/components/LinearProgress.md +43 -4
- package/docs/components/Pagination.md +38 -34
- package/docs/components/Popover.md +16 -0
- package/docs/components/README.md +9 -0
- package/docs/components/Switch.md +21 -16
- package/docs/components/Tab.md +79 -0
- package/docs/components/Tabs.md +85 -0
- package/docs/components/Upload.md +112 -0
- package/docs/components/UploadItem.md +61 -0
- package/docs/components/Widget.md +12 -6
- package/package.json +4 -2
- package/dist/storybook/assets/Icon.stories-CPjM-jTU.js +0 -264
- package/dist/storybook/assets/Pagination.stories-C4cLjS_9.js +0 -272
- package/dist/storybook/assets/ReadyMixin-DNZ5dCsZ.js +0 -1
- 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,103 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import '../circular-progress/CircularProgress.js';
|
|
3
|
+
import '../icon/Icon.js';
|
|
4
|
+
type ActionItemVariant = 'primary' | 'secondary' | 'tertiary' | 'destructive';
|
|
5
|
+
declare const ActionItem_base: (new (...args: any[]) => import("../../util/TooltipMixin.js").TooltipMixinInterface) & (new (...args: any[]) => import("../../util/EventEmitterMixin.js").EventEmitterMixinInterface) & (new (...args: any[]) => import("../../util/ReadyMixin.js").ReadyMixinInterface) & typeof LitElement;
|
|
6
|
+
/**
|
|
7
|
+
* An action item button for use within `btu-action-bar`.
|
|
8
|
+
*
|
|
9
|
+
* Renders a styled button using existing `btu-button-*` classes. Supports
|
|
10
|
+
* primary, secondary, tertiary, and destructive variants. When `iconOnly`
|
|
11
|
+
* is set, the label is hidden and a tooltip is shown instead.
|
|
12
|
+
*
|
|
13
|
+
* **Button styling:** Set `--button-*` CSS custom properties on `<btu-action-item>`
|
|
14
|
+
* or a parent element to customize via CSS inheritance. See
|
|
15
|
+
* `tailwind-plugin-button.ts` for available props.
|
|
16
|
+
*
|
|
17
|
+
* @element btu-action-item
|
|
18
|
+
*
|
|
19
|
+
* @fires {CustomEvent<{label: string}>} btu-action-item-click - Fired when the action item is clicked (not fired when disabled or loading)
|
|
20
|
+
*
|
|
21
|
+
* @cssprop --button-color - Override button background color
|
|
22
|
+
* @cssprop --button-text-color - Override button text color
|
|
23
|
+
* @cssprop --button-border-radius - Override button border radius
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```html
|
|
27
|
+
* <btu-action-item variant="primary" label="Save Changes"></btu-action-item>
|
|
28
|
+
* <btu-action-item variant="destructive" label="Delete" symbol="trash-2"></btu-action-item>
|
|
29
|
+
* <btu-action-item variant="secondary" label="Settings" symbol="settings" icon-only></btu-action-item>
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export default class ActionItem extends ActionItem_base {
|
|
33
|
+
/**
|
|
34
|
+
* Button label text.
|
|
35
|
+
* @attr
|
|
36
|
+
*/
|
|
37
|
+
label: string;
|
|
38
|
+
/**
|
|
39
|
+
* Visual variant: 'primary', 'secondary', 'tertiary', 'destructive'.
|
|
40
|
+
* @attr
|
|
41
|
+
*/
|
|
42
|
+
variant: ActionItemVariant;
|
|
43
|
+
/**
|
|
44
|
+
* Lucide icon symbol for the leading icon.
|
|
45
|
+
* @attr
|
|
46
|
+
*/
|
|
47
|
+
symbol: string;
|
|
48
|
+
/**
|
|
49
|
+
* Show icon only, hiding the label. Tooltip activates automatically with the label text.
|
|
50
|
+
* @attr icon-only
|
|
51
|
+
*/
|
|
52
|
+
iconOnly: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Disables the action item. The button remains focusable for accessibility
|
|
55
|
+
* but click events are suppressed.
|
|
56
|
+
* @attr
|
|
57
|
+
*/
|
|
58
|
+
disabled: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Shows a loading spinner and prevents interaction.
|
|
61
|
+
* @attr
|
|
62
|
+
*/
|
|
63
|
+
loading: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Zone placement: 'start' or 'end'. Used by ActionBar for two-zone layout.
|
|
66
|
+
* If unset, auto-detected from variant (destructive → start, others → end).
|
|
67
|
+
* @attr
|
|
68
|
+
*/
|
|
69
|
+
zone: 'start' | 'end' | '';
|
|
70
|
+
/**
|
|
71
|
+
* Opt-in for progressive label compacting. When the parent bar has `compact`
|
|
72
|
+
* enabled and space shrinks, compactable items with icons have their labels
|
|
73
|
+
* hidden one-by-one (least important first) before overflowing.
|
|
74
|
+
* Items without an icon ignore this attribute and go directly to overflow.
|
|
75
|
+
* @attr
|
|
76
|
+
*/
|
|
77
|
+
compactable: boolean;
|
|
78
|
+
/** @internal - Roving tabindex value set by parent ActionBar */
|
|
79
|
+
private _tabindex;
|
|
80
|
+
/** @internal - Whether the label is compacted by ActionBar's progressive compacting */
|
|
81
|
+
private _collapsed;
|
|
82
|
+
createRenderRoot(): this;
|
|
83
|
+
/** @internal - Called by parent ActionBar to configure roving tabindex and compact state */
|
|
84
|
+
_configure(options: {
|
|
85
|
+
tabindex: number;
|
|
86
|
+
collapsed: boolean;
|
|
87
|
+
}): void;
|
|
88
|
+
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
89
|
+
private _relayTooltipAttrs;
|
|
90
|
+
firstUpdated(): void;
|
|
91
|
+
private _handleClick;
|
|
92
|
+
private _getSpinnerColor;
|
|
93
|
+
private _buildButtonClasses;
|
|
94
|
+
private _getButtonStyles;
|
|
95
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
96
|
+
}
|
|
97
|
+
declare global {
|
|
98
|
+
interface HTMLElementTagNameMap {
|
|
99
|
+
'btu-action-item': ActionItem;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
export {};
|
|
103
|
+
//# sourceMappingURL=ActionItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionItem.d.ts","sourceRoot":"","sources":["../../../src/components/action-bar/ActionItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAiB,MAAM,KAAK,CAAA;AAO/C,OAAO,0CAA0C,CAAA;AACjD,OAAO,iBAAiB,CAAA;AAExB,KAAK,iBAAiB,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,aAAa,CAAA;;AAU7E;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,eAAuD;IAC7F;;;OAGG;IAEH,KAAK,SAAK;IAEV;;;OAGG;IAEH,OAAO,EAAE,iBAAiB,CAAc;IAExC;;;OAGG;IAEH,MAAM,SAAK;IAEX;;;OAGG;IAEH,QAAQ,UAAQ;IAEhB;;;;OAIG;IAEH,QAAQ,UAAQ;IAEhB;;;OAGG;IAEH,OAAO,UAAQ;IAEf;;;;OAIG;IAEH,IAAI,EAAE,OAAO,GAAG,KAAK,GAAG,EAAE,CAAK;IAE/B;;;;;;OAMG;IAEH,WAAW,UAAQ;IAEnB,gEAAgE;IAChE,OAAO,CAAC,SAAS,CAAI;IAErB,uFAAuF;IACvF,OAAO,CAAC,UAAU,CAAQ;IAE1B,gBAAgB;IAIhB,4FAA4F;IAC5F,UAAU,CAAC,OAAO,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI;IAYnE,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAKxE,OAAO,CAAC,kBAAkB;IAmB1B,YAAY,IAAI,IAAI;IAiBpB,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,gBAAgB;IAKxB,OAAO,CAAC,mBAAmB;IAW3B,OAAO,CAAC,gBAAgB;IAWxB,MAAM;CAyBP;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,UAAU,CAAA;KAC9B;CACF"}
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, html, nothing } from 'lit';
|
|
8
|
+
import { property } from 'lit/decorators.js';
|
|
9
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
10
|
+
import { styleMap } from 'lit/directives/style-map.js';
|
|
11
|
+
import { EventEmitterMixin } from '../../util/EventEmitterMixin.js';
|
|
12
|
+
import { ReadyMixin } from '../../util/ReadyMixin.js';
|
|
13
|
+
import { TooltipMixin } from '../../util/TooltipMixin.js';
|
|
14
|
+
import '../circular-progress/CircularProgress.js';
|
|
15
|
+
import '../icon/Icon.js';
|
|
16
|
+
// Tailwind content scanning requires complete class names (no template literals).
|
|
17
|
+
const VARIANT_CLASSES = {
|
|
18
|
+
primary: ['btu-button', 'btu-button-primary', 'btu-button-sm'],
|
|
19
|
+
secondary: ['btu-button', 'btu-button-gray', 'btu-button-sm'],
|
|
20
|
+
tertiary: ['btu-button', 'btu-button-gray', 'btu-button-sm', 'btu-button-fill-none'],
|
|
21
|
+
destructive: ['btu-button', 'btu-button-error', 'btu-button-sm', 'btu-button-fill-none'],
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* An action item button for use within `btu-action-bar`.
|
|
25
|
+
*
|
|
26
|
+
* Renders a styled button using existing `btu-button-*` classes. Supports
|
|
27
|
+
* primary, secondary, tertiary, and destructive variants. When `iconOnly`
|
|
28
|
+
* is set, the label is hidden and a tooltip is shown instead.
|
|
29
|
+
*
|
|
30
|
+
* **Button styling:** Set `--button-*` CSS custom properties on `<btu-action-item>`
|
|
31
|
+
* or a parent element to customize via CSS inheritance. See
|
|
32
|
+
* `tailwind-plugin-button.ts` for available props.
|
|
33
|
+
*
|
|
34
|
+
* @element btu-action-item
|
|
35
|
+
*
|
|
36
|
+
* @fires {CustomEvent<{label: string}>} btu-action-item-click - Fired when the action item is clicked (not fired when disabled or loading)
|
|
37
|
+
*
|
|
38
|
+
* @cssprop --button-color - Override button background color
|
|
39
|
+
* @cssprop --button-text-color - Override button text color
|
|
40
|
+
* @cssprop --button-border-radius - Override button border radius
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```html
|
|
44
|
+
* <btu-action-item variant="primary" label="Save Changes"></btu-action-item>
|
|
45
|
+
* <btu-action-item variant="destructive" label="Delete" symbol="trash-2"></btu-action-item>
|
|
46
|
+
* <btu-action-item variant="secondary" label="Settings" symbol="settings" icon-only></btu-action-item>
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export default class ActionItem extends TooltipMixin(EventEmitterMixin(ReadyMixin(LitElement))) {
|
|
50
|
+
constructor() {
|
|
51
|
+
super(...arguments);
|
|
52
|
+
/**
|
|
53
|
+
* Button label text.
|
|
54
|
+
* @attr
|
|
55
|
+
*/
|
|
56
|
+
this.label = '';
|
|
57
|
+
/**
|
|
58
|
+
* Visual variant: 'primary', 'secondary', 'tertiary', 'destructive'.
|
|
59
|
+
* @attr
|
|
60
|
+
*/
|
|
61
|
+
this.variant = 'secondary';
|
|
62
|
+
/**
|
|
63
|
+
* Lucide icon symbol for the leading icon.
|
|
64
|
+
* @attr
|
|
65
|
+
*/
|
|
66
|
+
this.symbol = '';
|
|
67
|
+
/**
|
|
68
|
+
* Show icon only, hiding the label. Tooltip activates automatically with the label text.
|
|
69
|
+
* @attr icon-only
|
|
70
|
+
*/
|
|
71
|
+
this.iconOnly = false;
|
|
72
|
+
/**
|
|
73
|
+
* Disables the action item. The button remains focusable for accessibility
|
|
74
|
+
* but click events are suppressed.
|
|
75
|
+
* @attr
|
|
76
|
+
*/
|
|
77
|
+
this.disabled = false;
|
|
78
|
+
/**
|
|
79
|
+
* Shows a loading spinner and prevents interaction.
|
|
80
|
+
* @attr
|
|
81
|
+
*/
|
|
82
|
+
this.loading = false;
|
|
83
|
+
/**
|
|
84
|
+
* Zone placement: 'start' or 'end'. Used by ActionBar for two-zone layout.
|
|
85
|
+
* If unset, auto-detected from variant (destructive → start, others → end).
|
|
86
|
+
* @attr
|
|
87
|
+
*/
|
|
88
|
+
this.zone = '';
|
|
89
|
+
/**
|
|
90
|
+
* Opt-in for progressive label compacting. When the parent bar has `compact`
|
|
91
|
+
* enabled and space shrinks, compactable items with icons have their labels
|
|
92
|
+
* hidden one-by-one (least important first) before overflowing.
|
|
93
|
+
* Items without an icon ignore this attribute and go directly to overflow.
|
|
94
|
+
* @attr
|
|
95
|
+
*/
|
|
96
|
+
this.compactable = false;
|
|
97
|
+
/** @internal - Roving tabindex value set by parent ActionBar */
|
|
98
|
+
this._tabindex = 0;
|
|
99
|
+
/** @internal - Whether the label is compacted by ActionBar's progressive compacting */
|
|
100
|
+
this._collapsed = false;
|
|
101
|
+
}
|
|
102
|
+
createRenderRoot() {
|
|
103
|
+
return this;
|
|
104
|
+
}
|
|
105
|
+
/** @internal - Called by parent ActionBar to configure roving tabindex and compact state */
|
|
106
|
+
_configure(options) {
|
|
107
|
+
this._tabindex = options.tabindex;
|
|
108
|
+
this._collapsed = options.collapsed;
|
|
109
|
+
if (this._collapsed && this.symbol) {
|
|
110
|
+
this.tooltip = this.label;
|
|
111
|
+
this.tooltipPosition = 'top';
|
|
112
|
+
}
|
|
113
|
+
else if (!this.iconOnly) {
|
|
114
|
+
this.tooltip = '';
|
|
115
|
+
}
|
|
116
|
+
queueMicrotask(() => this.requestUpdate());
|
|
117
|
+
}
|
|
118
|
+
updated(changedProperties) {
|
|
119
|
+
super.updated(changedProperties);
|
|
120
|
+
this._relayTooltipAttrs();
|
|
121
|
+
}
|
|
122
|
+
_relayTooltipAttrs() {
|
|
123
|
+
const button = this.querySelector('button');
|
|
124
|
+
if (!button)
|
|
125
|
+
return;
|
|
126
|
+
const anchorName = this.style.getPropertyValue('anchor-name');
|
|
127
|
+
if (anchorName) {
|
|
128
|
+
this.style.removeProperty('anchor-name');
|
|
129
|
+
button.style.setProperty('anchor-name', anchorName);
|
|
130
|
+
}
|
|
131
|
+
const tooltipEl = this.querySelector('[data-tooltip-internal]');
|
|
132
|
+
if (tooltipEl) {
|
|
133
|
+
this.removeAttribute('aria-describedby');
|
|
134
|
+
button.setAttribute('aria-describedby', tooltipEl.id);
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
button.removeAttribute('aria-describedby');
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
firstUpdated() {
|
|
141
|
+
if (!this.label && !this.symbol) {
|
|
142
|
+
console.warn('[btu-action-item] No label or icon provided.', this);
|
|
143
|
+
}
|
|
144
|
+
if (this.compactable && !this.symbol) {
|
|
145
|
+
console.warn('[btu-action-item] `compactable` has no effect without an icon.', this);
|
|
146
|
+
}
|
|
147
|
+
if (this.iconOnly && this.symbol) {
|
|
148
|
+
queueMicrotask(() => {
|
|
149
|
+
this.tooltip = this.label;
|
|
150
|
+
this.tooltipPosition = 'top';
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
_handleClick() {
|
|
155
|
+
if (this.disabled || this.loading)
|
|
156
|
+
return;
|
|
157
|
+
this.emit('btu-action-item-click', { label: this.label });
|
|
158
|
+
}
|
|
159
|
+
_getSpinnerColor() {
|
|
160
|
+
if (this.variant === 'primary' || this.variant === 'destructive')
|
|
161
|
+
return 'white';
|
|
162
|
+
return 'gray';
|
|
163
|
+
}
|
|
164
|
+
_buildButtonClasses() {
|
|
165
|
+
const variantClasses = VARIANT_CLASSES[this.variant] ?? VARIANT_CLASSES.secondary;
|
|
166
|
+
const classes = [...variantClasses];
|
|
167
|
+
if (this.iconOnly || this._collapsed) {
|
|
168
|
+
classes.push('btu-button-text-hidden');
|
|
169
|
+
}
|
|
170
|
+
return classes.join(' ');
|
|
171
|
+
}
|
|
172
|
+
_getButtonStyles() {
|
|
173
|
+
const styles = {};
|
|
174
|
+
const color = this.style.getPropertyValue('--button-color').trim();
|
|
175
|
+
if (color)
|
|
176
|
+
styles['--button-color'] = color;
|
|
177
|
+
const textColor = this.style.getPropertyValue('--button-text-color').trim();
|
|
178
|
+
if (textColor)
|
|
179
|
+
styles['--button-text-color'] = textColor;
|
|
180
|
+
const borderRadius = this.style.getPropertyValue('--button-border-radius').trim();
|
|
181
|
+
if (borderRadius)
|
|
182
|
+
styles['--button-border-radius'] = borderRadius;
|
|
183
|
+
return styles;
|
|
184
|
+
}
|
|
185
|
+
render() {
|
|
186
|
+
const isIconOnly = this.iconOnly || this._collapsed;
|
|
187
|
+
const ariaLabel = isIconOnly ? this.label || undefined : undefined;
|
|
188
|
+
const showIcon = this.symbol && !this.loading;
|
|
189
|
+
const showSpinner = this.loading;
|
|
190
|
+
return html `
|
|
191
|
+
<button
|
|
192
|
+
type="button"
|
|
193
|
+
class="${this._buildButtonClasses()}"
|
|
194
|
+
style=${styleMap(this._getButtonStyles())}
|
|
195
|
+
aria-label=${ifDefined(ariaLabel)}
|
|
196
|
+
aria-disabled="${this.disabled ? 'true' : 'false'}"
|
|
197
|
+
aria-busy="${this.loading ? 'true' : 'false'}"
|
|
198
|
+
tabindex="${this._tabindex}"
|
|
199
|
+
@click="${this._handleClick}"
|
|
200
|
+
>
|
|
201
|
+
${showSpinner
|
|
202
|
+
? html `<btu-circular-progress size="sm" color="${this._getSpinnerColor()}"></btu-circular-progress>`
|
|
203
|
+
: nothing}
|
|
204
|
+
${showIcon ? html `<btu-icon symbol="${this.symbol}" size="sm"></btu-icon>` : nothing}
|
|
205
|
+
${isIconOnly ? nothing : this.label}
|
|
206
|
+
</button>
|
|
207
|
+
`;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
__decorate([
|
|
211
|
+
property({ type: String })
|
|
212
|
+
], ActionItem.prototype, "label", void 0);
|
|
213
|
+
__decorate([
|
|
214
|
+
property({ type: String })
|
|
215
|
+
], ActionItem.prototype, "variant", void 0);
|
|
216
|
+
__decorate([
|
|
217
|
+
property({ type: String })
|
|
218
|
+
], ActionItem.prototype, "symbol", void 0);
|
|
219
|
+
__decorate([
|
|
220
|
+
property({ type: Boolean, attribute: 'icon-only' })
|
|
221
|
+
], ActionItem.prototype, "iconOnly", void 0);
|
|
222
|
+
__decorate([
|
|
223
|
+
property({ type: Boolean, reflect: true })
|
|
224
|
+
], ActionItem.prototype, "disabled", void 0);
|
|
225
|
+
__decorate([
|
|
226
|
+
property({ type: Boolean, reflect: true })
|
|
227
|
+
], ActionItem.prototype, "loading", void 0);
|
|
228
|
+
__decorate([
|
|
229
|
+
property({ type: String, reflect: true })
|
|
230
|
+
], ActionItem.prototype, "zone", void 0);
|
|
231
|
+
__decorate([
|
|
232
|
+
property({ type: Boolean, reflect: true })
|
|
233
|
+
], ActionItem.prototype, "compactable", void 0);
|
|
234
|
+
if (!customElements.get('btu-action-item')) {
|
|
235
|
+
customElements.define('btu-action-item', ActionItem);
|
|
236
|
+
}
|
|
237
|
+
//# sourceMappingURL=ActionItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionItem.js","sourceRoot":"","sources":["../../../src/components/action-bar/ActionItem.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,0CAA0C,CAAA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
* Ring styling is inherited from child `btu-avatar` elements. Override via
|
|
18
|
+
* `--avatar-ring-color` and `--avatar-ring-width` on the group or on individual avatars.
|
|
19
|
+
*
|
|
17
20
|
* @fires {CustomEvent} btu-avatar-group-ready - Fired after first render and initialization
|
|
18
21
|
* @fires {CustomEvent<{hidden: number}>} btu-avatar-group-overflow - Fired when avatars are hidden due to max limit
|
|
19
22
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarGroup.d.ts","sourceRoot":"","sources":["../../../src/components/avatar/AvatarGroup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAA;AAMtC,MAAM,WAAW,gBAAgB;IAC/B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;CAC1B;;AAED
|
|
1
|
+
{"version":3,"file":"AvatarGroup.d.ts","sourceRoot":"","sources":["../../../src/components/avatar/AvatarGroup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAA;AAMtC,MAAM,WAAW,gBAAgB;IAC/B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;CAC1B;;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,gBAAyC;IAChF;;;OAGG;IAEH,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ;;;OAGG;IAEH,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAO;IAE/B,gBAAgB;IAChB,OAAO,CAAC,cAAc,CAAe;IAErC,gBAAgB;IAChB,OAAO,CAAC,cAAc,CAAsB;IAE5C,gBAAgB;IAChB,OAAO,CAAC,cAAc,CAAyB;IAE/C,iBAAiB,IAAI,IAAI;IAOzB,gBAAgB;IAIhB,UAAU,IAAI,IAAI;IAclB,YAAY,IAAI,IAAI;IAKpB;;;OAGG;IACH,cAAc,IAAI,IAAI;IA0CtB;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAW5B,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAOlD,MAAM;CAGP;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,WAAW,CAAA;KAChC;CACF"}
|
|
@@ -18,6 +18,9 @@ import { ReadyMixin } from '../../util/ReadyMixin.js';
|
|
|
18
18
|
*
|
|
19
19
|
* @element btu-avatar-group
|
|
20
20
|
*
|
|
21
|
+
* Ring styling is inherited from child `btu-avatar` elements. Override via
|
|
22
|
+
* `--avatar-ring-color` and `--avatar-ring-width` on the group or on individual avatars.
|
|
23
|
+
*
|
|
21
24
|
* @fires {CustomEvent} btu-avatar-group-ready - Fired after first render and initialization
|
|
22
25
|
* @fires {CustomEvent<{hidden: number}>} btu-avatar-group-overflow - Fired when avatars are hidden due to max limit
|
|
23
26
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarGroup.js","sourceRoot":"","sources":["../../../src/components/avatar/AvatarGroup.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAQrD
|
|
1
|
+
{"version":3,"file":"AvatarGroup.js","sourceRoot":"","sources":["../../../src/components/avatar/AvatarGroup.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,mB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CAAC,IAAI,CAAC,2BAA2B,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAA;QACjE,CAAC;IACH,CAAC;IAED;;;OAGG;IACK,oBAAoB,CAAC,KAAa;QACxC,+CAA+C;QAC/C,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,YAAY,CAAW,CAAA;QAC/D,QAAQ,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,KAAK,EAAE,CAAC,CAAA;QAC9C,QAAQ,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;QACxC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAA;QAEnD,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;QAC1B,IAAI,CAAC,cAAc,GAAG,QAAQ,CAAA;IAChC,CAAC;IAED,OAAO,CAAC,iBAAmC;QACzC,2CAA2C;QAC3C,IAAI,iBAAiB,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YAClE,IAAI,CAAC,cAAc,EAAE,CAAA;QACvB,CAAC;IACH,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA,EAAE,CAAA;IACf,CAAC;CACF;AAvHC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wCACf;AAOZ;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCACI;AAkHjC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,kBAAkB,CAAC,EAAE,CAAC;IAC5C,cAAc,CAAC,MAAM,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAA;AACxD,CAAC"}
|
|
@@ -22,6 +22,8 @@ declare const Badge_base: (new (...args: any[]) => import("../../util/EventEmitt
|
|
|
22
22
|
* @cssprop --badge-py - Vertical padding (overrides size default)
|
|
23
23
|
* @cssprop --badge-dot-size - Size of the dot affordance (default: 6px)
|
|
24
24
|
*
|
|
25
|
+
* @slot - Label text or child elements (e.g., btu-icon + text)
|
|
26
|
+
*
|
|
25
27
|
* @example
|
|
26
28
|
* ```html
|
|
27
29
|
* <!-- Badge with dot -->
|
|
@@ -57,7 +59,7 @@ export default class Badge extends Badge_base {
|
|
|
57
59
|
* - 'lg': Large
|
|
58
60
|
* @attr
|
|
59
61
|
*/
|
|
60
|
-
size:
|
|
62
|
+
size: 'sm' | 'md' | 'lg';
|
|
61
63
|
/** @internal */
|
|
62
64
|
private initialClasses;
|
|
63
65
|
connectedCallback(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/badge/Badge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAA;AAKtC,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAA;IAC9D,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;CAC1B;;AAED
|
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/badge/Badge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAA;AAKtC,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAA;IAC9D,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;CAC1B;;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,UAAyC;IAC1E;;;;;;;;OAQG;IAEH,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAS;IAEtE;;;OAGG;IAEH,GAAG,UAAQ;IAEX;;;;;;OAMG;IAEH,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAO;IAE/B,gBAAgB;IAChB,OAAO,CAAC,cAAc,CAAe;IAErC,iBAAiB,IAAI,IAAI;IAQzB,gBAAgB;IAIhB,UAAU,IAAI,IAAI;IAqBlB,YAAY,IAAI,IAAI;IAIpB,MAAM;CAGP;AAQD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,KAAK,CAAA;KACnB;CACF"}
|
|
@@ -25,6 +25,8 @@ import { ReadyMixin } from '../../util/ReadyMixin.js';
|
|
|
25
25
|
* @cssprop --badge-py - Vertical padding (overrides size default)
|
|
26
26
|
* @cssprop --badge-dot-size - Size of the dot affordance (default: 6px)
|
|
27
27
|
*
|
|
28
|
+
* @slot - Label text or child elements (e.g., btu-icon + text)
|
|
29
|
+
*
|
|
28
30
|
* @example
|
|
29
31
|
* ```html
|
|
30
32
|
* <!-- Badge with dot -->
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.js","sourceRoot":"","sources":["../../../src/components/badge/Badge.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAQrD
|
|
1
|
+
{"version":3,"file":"Badge.js","sourceRoot":"","sources":["../../../src/components/badge/Badge.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM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ED,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACpD,CAAC;IAED,YAAY;QACV,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;IAC9B,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA,EAAE,CAAA;IACf,CAAC;CACF;AA9DC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sCAC2C;AAOtE;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;kCACjB;AAUX;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mCACI;AA+CjC,oEAAoE;AACpE,8DAA8D;AAC9D,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;IACrC,cAAc,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,CAAA;AAC3C,CAAC"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export interface ButtonGroupProps {
|
|
3
|
+
label?: string;
|
|
4
|
+
orientation?: 'horizontal' | 'vertical';
|
|
5
|
+
variant?: 'connected' | 'spaced';
|
|
6
|
+
size?: 'sm' | 'md' | 'lg';
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
selection?: 'none' | 'single' | 'multiple';
|
|
9
|
+
value?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const ButtonGroup_base: (new (...args: any[]) => import("../../util/RovingTabindexMixin.js").RovingTabindexInterface) & (new (...args: any[]) => import("../../util/ComponentStatesMixin.js").ComponentStatesMixinInterface) & (new (...args: any[]) => import("../../util/EventEmitterMixin.js").EventEmitterMixinInterface) & (new (...args: any[]) => import("../../util/ReadyMixin.js").ReadyMixinInterface) & typeof LitElement;
|
|
13
|
+
/**
|
|
14
|
+
* A semantic container for grouping related buttons together.
|
|
15
|
+
*
|
|
16
|
+
* Supports connected (joined) and spaced layouts, horizontal and vertical
|
|
17
|
+
* orientation, group-level size and disabled propagation, and optional
|
|
18
|
+
* toggle/selection modes (single-select or multi-select).
|
|
19
|
+
*
|
|
20
|
+
* @element btu-button-group
|
|
21
|
+
*
|
|
22
|
+
* @fires {CustomEvent} btu-button-group-ready - Fired after first render and initialization
|
|
23
|
+
* @fires {CustomEvent<{value: string}>} btu-button-group-change - Fired when selection changes (single/multiple modes only)
|
|
24
|
+
* @fires {CustomEvent<{name: string | undefined}>} btu-icon-button-click - Bubbles from child btu-icon-button elements when clicked
|
|
25
|
+
*
|
|
26
|
+
* @slot - One or more btu-button or btu-icon-button elements to display in the group
|
|
27
|
+
* @slot end - Pushes the child to the end of the group via auto-margin (vertical: bottom, horizontal: right)
|
|
28
|
+
*
|
|
29
|
+
* @cssprop --button-group-gap - Space between buttons when variant="spaced" (default: spacing.sm)
|
|
30
|
+
* @cssprop --button-group-border-radius - Corner radius of outer edges when variant="connected" (default: 0.5rem)
|
|
31
|
+
* @cssprop --button-group-border-color - Internal divider color between connected buttons (default: gray-300)
|
|
32
|
+
* @cssprop --button-group-selection-bg - Background of a toggled/selected child (default: primary-50)
|
|
33
|
+
* @cssprop --button-group-selection-color - Text/icon color of a toggled/selected child (default: primary-700)
|
|
34
|
+
* @cssprop --button-group-shimmer-highlight - Highlight color of the selection shimmer effect (default: primary-200)
|
|
35
|
+
*
|
|
36
|
+
* @cssstate btu-connected - Applied when variant="connected", targetable via :state(btu-connected)
|
|
37
|
+
* @cssstate btu-spaced - Applied when variant="spaced", targetable via :state(btu-spaced)
|
|
38
|
+
* @cssstate btu-horizontal - Applied when orientation="horizontal", targetable via :state(btu-horizontal)
|
|
39
|
+
* @cssstate btu-vertical - Applied when orientation="vertical", targetable via :state(btu-vertical)
|
|
40
|
+
* @cssstate btu-disabled - Applied when the group is disabled, targetable via :state(btu-disabled)
|
|
41
|
+
*/
|
|
42
|
+
export default class ButtonGroup extends ButtonGroup_base {
|
|
43
|
+
static get tagName(): string;
|
|
44
|
+
/**
|
|
45
|
+
* Accessible name for the group, announced by assistive devices via aria-label.
|
|
46
|
+
* @attr
|
|
47
|
+
*/
|
|
48
|
+
label: string;
|
|
49
|
+
/**
|
|
50
|
+
* Layout direction of the buttons.
|
|
51
|
+
* @attr
|
|
52
|
+
*/
|
|
53
|
+
orientation: 'horizontal' | 'vertical';
|
|
54
|
+
/**
|
|
55
|
+
* `connected` collapses shared borders for a joined appearance.
|
|
56
|
+
* `spaced` renders buttons with a gap.
|
|
57
|
+
* @attr
|
|
58
|
+
*/
|
|
59
|
+
variant: 'connected' | 'spaced';
|
|
60
|
+
/**
|
|
61
|
+
* Propagates a uniform size to all child buttons.
|
|
62
|
+
* @attr
|
|
63
|
+
*/
|
|
64
|
+
size: 'sm' | 'md' | 'lg';
|
|
65
|
+
/**
|
|
66
|
+
* When true, disables all child buttons as a group.
|
|
67
|
+
* @attr
|
|
68
|
+
*/
|
|
69
|
+
disabled: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Enables toggle/selection behavior.
|
|
72
|
+
* `single` allows one active button; `multiple` allows many.
|
|
73
|
+
* @attr
|
|
74
|
+
*/
|
|
75
|
+
selection: 'none' | 'single' | 'multiple';
|
|
76
|
+
/**
|
|
77
|
+
* Reflects the currently selected button value(s).
|
|
78
|
+
* For `single`, the value of the active button.
|
|
79
|
+
* For `multiple`, a comma-delimited list of active values.
|
|
80
|
+
* @attr
|
|
81
|
+
*/
|
|
82
|
+
value: string;
|
|
83
|
+
/**
|
|
84
|
+
* When set, creates hidden input(s) for native form participation.
|
|
85
|
+
* @attr
|
|
86
|
+
*/
|
|
87
|
+
name: string;
|
|
88
|
+
/** @internal */
|
|
89
|
+
private initialClasses;
|
|
90
|
+
/** @internal */
|
|
91
|
+
private boundHandleClick;
|
|
92
|
+
/** @internal */
|
|
93
|
+
private boundHandleKeyDown;
|
|
94
|
+
/** @internal */
|
|
95
|
+
_getRovingTargets(): HTMLElement[];
|
|
96
|
+
connectedCallback(): void;
|
|
97
|
+
disconnectedCallback(): void;
|
|
98
|
+
createRenderRoot(): this;
|
|
99
|
+
willUpdate(): void;
|
|
100
|
+
firstUpdated(): void;
|
|
101
|
+
updated(changedProperties: Map<string, unknown>): void;
|
|
102
|
+
/** @internal Sync size, disabled, and selection on a direct child */
|
|
103
|
+
private syncChild;
|
|
104
|
+
/** @internal Set aria-pressed on the interactive button element */
|
|
105
|
+
private syncSelection;
|
|
106
|
+
/** @internal Re-sync all children */
|
|
107
|
+
private syncAllChildren;
|
|
108
|
+
/** @internal Set data-all-selected when every selectable button is pressed */
|
|
109
|
+
private syncAllSelected;
|
|
110
|
+
/** @internal Initialize roving tabindex: selected button gets tabindex=0, others -1 */
|
|
111
|
+
private syncRovingTabindex;
|
|
112
|
+
/** @internal Parsed list of currently selected values, filtering empty segments */
|
|
113
|
+
private get selectedValues();
|
|
114
|
+
/** @internal Resolve value: value attr → textContent fallback */
|
|
115
|
+
private resolveButtonValue;
|
|
116
|
+
/** @internal Resolve the value-holding element from a click target */
|
|
117
|
+
private resolveGroupItem;
|
|
118
|
+
/** @internal Create/update/remove hidden inputs */
|
|
119
|
+
private syncHiddenInputs;
|
|
120
|
+
/** @internal Update value and fire change event */
|
|
121
|
+
private setSelection;
|
|
122
|
+
/** @internal Handle click events for selection */
|
|
123
|
+
private handleClick;
|
|
124
|
+
/** @internal */
|
|
125
|
+
private handleKeyDown;
|
|
126
|
+
/** @internal Activate the currently focused button (single-select arrow nav) */
|
|
127
|
+
private activateFocusedButton;
|
|
128
|
+
/** @internal */
|
|
129
|
+
private syncStates;
|
|
130
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
131
|
+
}
|
|
132
|
+
declare global {
|
|
133
|
+
interface HTMLElementTagNameMap {
|
|
134
|
+
'btu-button-group': ButtonGroup;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
export {};
|
|
138
|
+
//# sourceMappingURL=ButtonGroup.d.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