@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,113 @@
|
|
|
1
|
+
import { l10n } from './i18n.js';
|
|
2
|
+
/**
|
|
3
|
+
* Validate a File against an `accept` attribute string, matching the HTML
|
|
4
|
+
* `<input accept>` attribute format. Client-side filter only — server-side
|
|
5
|
+
* validation is still required.
|
|
6
|
+
*
|
|
7
|
+
* Supported forms (comma-separated, any combination):
|
|
8
|
+
* - `image/*` — MIME wildcard (any image)
|
|
9
|
+
* - `application/pdf` — exact MIME type
|
|
10
|
+
* - `.pdf`, `.docx` — file extension (case-insensitive)
|
|
11
|
+
*
|
|
12
|
+
* Examples:
|
|
13
|
+
* - `matchesAccept(file, "image/*")` — any image
|
|
14
|
+
* - `matchesAccept(file, "image/*,application/pdf")` — images and PDFs
|
|
15
|
+
* - `matchesAccept(file, ".jpg,.jpeg,.png,.heic")` — specific extensions
|
|
16
|
+
* - `matchesAccept(file, "")` — allow all (returns true)
|
|
17
|
+
*
|
|
18
|
+
* Note: users can bypass the file picker's filter (most browsers offer an
|
|
19
|
+
* "All Files" option), so this function is a UX filter, not a security
|
|
20
|
+
* boundary.
|
|
21
|
+
*/
|
|
22
|
+
export function matchesAccept(file, accept) {
|
|
23
|
+
if (!accept || !accept.trim())
|
|
24
|
+
return true;
|
|
25
|
+
const types = accept
|
|
26
|
+
.split(',')
|
|
27
|
+
.map(t => t.trim().toLowerCase())
|
|
28
|
+
.filter(Boolean);
|
|
29
|
+
const fileMime = file.type.toLowerCase();
|
|
30
|
+
const fileName = file.name.toLowerCase();
|
|
31
|
+
return types.some(type => {
|
|
32
|
+
if (type.startsWith('.')) {
|
|
33
|
+
return fileName.endsWith(type);
|
|
34
|
+
}
|
|
35
|
+
if (type.endsWith('/*')) {
|
|
36
|
+
const category = type.slice(0, type.indexOf('/'));
|
|
37
|
+
return fileMime.startsWith(category + '/');
|
|
38
|
+
}
|
|
39
|
+
return fileMime === type;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Validate a File's size against a maximum byte limit.
|
|
44
|
+
* Returns false if file exceeds `maxSize` bytes.
|
|
45
|
+
* Returns true if `maxSize` is 0 (unlimited).
|
|
46
|
+
*/
|
|
47
|
+
export function validateFileSize(file, maxSize) {
|
|
48
|
+
if (maxSize <= 0)
|
|
49
|
+
return true;
|
|
50
|
+
return file.size <= maxSize;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Resolve a MIME type to a Lucide icon symbol name.
|
|
54
|
+
*
|
|
55
|
+
* Mappings:
|
|
56
|
+
* - `image/*` → `'image'`
|
|
57
|
+
* - `video/*` → `'film'`
|
|
58
|
+
* - `audio/*` → `'music'`
|
|
59
|
+
* - document types → `'file'`
|
|
60
|
+
* - everything else → `'upload-cloud'`
|
|
61
|
+
*/
|
|
62
|
+
export function resolveFileSymbol(mimeType) {
|
|
63
|
+
if (!mimeType)
|
|
64
|
+
return 'upload-cloud';
|
|
65
|
+
const mime = mimeType.toLowerCase();
|
|
66
|
+
if (mime.startsWith('image/'))
|
|
67
|
+
return 'image';
|
|
68
|
+
if (mime.startsWith('video/'))
|
|
69
|
+
return 'film';
|
|
70
|
+
if (mime.startsWith('audio/'))
|
|
71
|
+
return 'music';
|
|
72
|
+
if (mime.startsWith('text/') ||
|
|
73
|
+
mime === 'application/pdf' ||
|
|
74
|
+
mime === 'application/msword' ||
|
|
75
|
+
mime.startsWith('application/vnd.openxmlformats')) {
|
|
76
|
+
return 'file';
|
|
77
|
+
}
|
|
78
|
+
return 'upload-cloud';
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Format a byte count to a human-readable file size string.
|
|
82
|
+
*
|
|
83
|
+
* Output format: `"200 KB"`, `"4.2 MB"`, `"16 MB"`, `"1.3 GB"`
|
|
84
|
+
* Uses `l10n()` for unit labels.
|
|
85
|
+
*
|
|
86
|
+
* Thresholds:
|
|
87
|
+
* - 0 bytes → `"< 1 KB"`
|
|
88
|
+
* - < 1 KB → `"< 1 KB"` (sub-KB files render the same)
|
|
89
|
+
* - < 1 MB → whole number KB
|
|
90
|
+
* - < 1 GB → one decimal MB
|
|
91
|
+
* - >= 1 GB → one decimal GB
|
|
92
|
+
*/
|
|
93
|
+
export function formatFileSize(bytes) {
|
|
94
|
+
const KB = 1024;
|
|
95
|
+
const MB = KB * 1024;
|
|
96
|
+
const GB = MB * 1024;
|
|
97
|
+
if (bytes < KB) {
|
|
98
|
+
return l10n('upload', 'sizeSubKB', '< 1 KB');
|
|
99
|
+
}
|
|
100
|
+
if (bytes < MB) {
|
|
101
|
+
const kb = Math.round(bytes / KB);
|
|
102
|
+
return `${kb} ${l10n('upload', 'unitKB', 'KB')}`;
|
|
103
|
+
}
|
|
104
|
+
if (bytes < GB) {
|
|
105
|
+
const mb = bytes / MB;
|
|
106
|
+
const formatted = mb >= 10 ? Math.round(mb).toString() : mb.toFixed(1);
|
|
107
|
+
return `${formatted} ${l10n('upload', 'unitMB', 'MB')}`;
|
|
108
|
+
}
|
|
109
|
+
const gb = bytes / GB;
|
|
110
|
+
const formatted = gb >= 10 ? Math.round(gb).toString() : gb.toFixed(1);
|
|
111
|
+
return `${formatted} ${l10n('upload', 'unitGB', 'GB')}`;
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=upload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload.js","sourceRoot":"","sources":["../../src/util/upload.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,77 @@
|
|
|
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
|
+
### Methods
|
|
31
|
+
|
|
32
|
+
| Name | Privacy | Description | Parameters | Return | Inherited From |
|
|
33
|
+
| ------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- | --------- | ----------------- |
|
|
34
|
+
| `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 |
|
|
35
|
+
|
|
36
|
+
### Events
|
|
37
|
+
|
|
38
|
+
| Name | Type | Description | Inherited From |
|
|
39
|
+
| ----------------------- | ------------------------------ | ------------------------------------------------------------------- | -------------- |
|
|
40
|
+
| `btu-action-bar-ready` | `CustomEvent` | Fired after first render and initialization | |
|
|
41
|
+
| `btu-action-item-click` | `CustomEvent<{label: string}>` | Fired when an action item is clicked (bubbles from btu-action-item) | |
|
|
42
|
+
|
|
43
|
+
### Attributes
|
|
44
|
+
|
|
45
|
+
| Name | Field | Inherited From |
|
|
46
|
+
| ---------------- | --------- | -------------- |
|
|
47
|
+
| `position` | position | |
|
|
48
|
+
| `sticky` | sticky | |
|
|
49
|
+
| `item-alignment` | alignment | |
|
|
50
|
+
| `shadow` | shadow | |
|
|
51
|
+
| `label` | label | |
|
|
52
|
+
| `compact` | compact | |
|
|
53
|
+
|
|
54
|
+
### CSS Properties
|
|
55
|
+
|
|
56
|
+
| Name | Default | Description |
|
|
57
|
+
| --------------------------- | ------- | ------------------------------------ |
|
|
58
|
+
| `--action-bar-gap` | | Gap between items (default: 0.75rem) |
|
|
59
|
+
| `--action-bar-padding` | | Bar padding (default: 1.5rem) |
|
|
60
|
+
| `--action-bar-background` | | Background color (default: white) |
|
|
61
|
+
| `--action-bar-border-color` | | Border color (default: gray-200) |
|
|
62
|
+
| `--action-bar-z-index` | | Z-index (default: 100) |
|
|
63
|
+
|
|
64
|
+
### Slots
|
|
65
|
+
|
|
66
|
+
| Name | Description |
|
|
67
|
+
| ---- | ---------------------------------------- |
|
|
68
|
+
| | One or more \`btu-action-item\` elements |
|
|
69
|
+
|
|
70
|
+
<hr/>
|
|
71
|
+
|
|
72
|
+
## Exports
|
|
73
|
+
|
|
74
|
+
| Kind | Name | Declaration | Module | Package |
|
|
75
|
+
| --------------------------- | ---------------- | ----------- | -------------------------------------- | ------- |
|
|
76
|
+
| `js` | `default` | ActionBar | src/components/action-bar/ActionBar.ts | |
|
|
77
|
+
| `custom-element-definition` | `btu-action-bar` | ActionBar | src/components/action-bar/ActionBar.ts | |
|
|
@@ -0,0 +1,101 @@
|
|
|
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
|
+
| `symbol` | | `string` | `''` | Lucide icon symbol 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
|
+
| `tooltip` | | `string` | `''` | Tooltip text content. Set to empty string to remove the tooltip. | TooltipMixin |
|
|
32
|
+
| `tooltipPosition` | | `'top' \| 'bottom' \| 'left' \| 'right'` | `'top'` | Position relative to the host element. Auto-flips when constrained by the viewport. | TooltipMixin |
|
|
33
|
+
| `tooltipDelay` | | `number` | `300` | Show delay in milliseconds (hover trigger only). | TooltipMixin |
|
|
34
|
+
| `tooltipOffset` | | `TooltipOffset \| null` | `null` | Gap between host and tooltip (sm=4px, md=8px, lg=12px, xl=16px). | TooltipMixin |
|
|
35
|
+
| `tooltipNoArrow` | | `boolean` | `false` | Hide the arrow pseudo-element. | TooltipMixin |
|
|
36
|
+
| `tooltipTrigger` | | `string` | `'hover focus'` | Space-separated trigger types: 'hover', 'focus', 'click'. | TooltipMixin |
|
|
37
|
+
| `_onMouseLeave` | private | | | | TooltipMixin |
|
|
38
|
+
| `_onFocusIn` | private | | | | TooltipMixin |
|
|
39
|
+
| `_onFocusOut` | private | | | | TooltipMixin |
|
|
40
|
+
| `_onClick` | private | | | | TooltipMixin |
|
|
41
|
+
| `_onNativeToggle` | private | | | | TooltipMixin |
|
|
42
|
+
| `_onKeyDown` | private | | | | TooltipMixin |
|
|
43
|
+
| `_onDocumentClick` | private | `((e: MouseEvent) => void) \| null` | `null` | | TooltipMixin |
|
|
44
|
+
|
|
45
|
+
### Methods
|
|
46
|
+
|
|
47
|
+
| Name | Privacy | Description | Parameters | Return | Inherited From |
|
|
48
|
+
| --------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- | ------------------------ | ----------------- |
|
|
49
|
+
| `_relayTooltipAttrs` | private | | | `void` | |
|
|
50
|
+
| `_handleClick` | private | | | `void` | |
|
|
51
|
+
| `_getSpinnerColor` | private | | | `string` | |
|
|
52
|
+
| `_buildButtonClasses` | private | | | `string` | |
|
|
53
|
+
| `_getButtonStyles` | private | | | `Record<string, string>` | |
|
|
54
|
+
| `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 |
|
|
55
|
+
|
|
56
|
+
### Events
|
|
57
|
+
|
|
58
|
+
| Name | Type | Description | Inherited From |
|
|
59
|
+
| ----------------------- | ------------------------------ | -------------------------------------------------------------------------- | -------------- |
|
|
60
|
+
| `btu-action-item-click` | `CustomEvent<{label: string}>` | Fired when the action item is clicked (not fired when disabled or loading) | |
|
|
61
|
+
|
|
62
|
+
### Attributes
|
|
63
|
+
|
|
64
|
+
| Name | Field | Inherited From |
|
|
65
|
+
| ------------------ | --------------- | -------------- |
|
|
66
|
+
| `label` | label | |
|
|
67
|
+
| `variant` | variant | |
|
|
68
|
+
| `symbol` | symbol | |
|
|
69
|
+
| `icon-only` | iconOnly | |
|
|
70
|
+
| `disabled` | disabled | |
|
|
71
|
+
| `loading` | loading | |
|
|
72
|
+
| `zone` | zone | |
|
|
73
|
+
| `compactable` | compactable | |
|
|
74
|
+
| `tooltip` | tooltip | TooltipMixin |
|
|
75
|
+
| `tooltipPosition` | tooltipPosition | TooltipMixin |
|
|
76
|
+
| `tooltipDelay` | tooltipDelay | TooltipMixin |
|
|
77
|
+
| `tooltipOffset` | tooltipOffset | TooltipMixin |
|
|
78
|
+
| `tooltipNoArrow` | tooltipNoArrow | TooltipMixin |
|
|
79
|
+
| `tooltipTrigger` | tooltipTrigger | TooltipMixin |
|
|
80
|
+
| `tooltip-position` | tooltipPosition | TooltipMixin |
|
|
81
|
+
| `tooltip-delay` | tooltipDelay | TooltipMixin |
|
|
82
|
+
| `tooltip-offset` | tooltipOffset | TooltipMixin |
|
|
83
|
+
| `tooltip-no-arrow` | tooltipNoArrow | TooltipMixin |
|
|
84
|
+
| `tooltip-trigger` | tooltipTrigger | TooltipMixin |
|
|
85
|
+
|
|
86
|
+
### CSS Properties
|
|
87
|
+
|
|
88
|
+
| Name | Default | Description |
|
|
89
|
+
| ------------------------ | ------- | -------------------------------- |
|
|
90
|
+
| `--button-color` | | Override button background color |
|
|
91
|
+
| `--button-text-color` | | Override button text color |
|
|
92
|
+
| `--button-border-radius` | | Override button border radius |
|
|
93
|
+
|
|
94
|
+
<hr/>
|
|
95
|
+
|
|
96
|
+
## Exports
|
|
97
|
+
|
|
98
|
+
| Kind | Name | Declaration | Module | Package |
|
|
99
|
+
| --------------------------- | ----------------- | ----------- | --------------------------------------- | ------- |
|
|
100
|
+
| `js` | `default` | ActionItem | src/components/action-bar/ActionItem.ts | |
|
|
101
|
+
| `custom-element-definition` | `btu-action-item` | ActionItem | src/components/action-bar/ActionItem.ts | |
|
|
@@ -18,12 +18,31 @@
|
|
|
18
18
|
|
|
19
19
|
### Fields
|
|
20
20
|
|
|
21
|
-
| Name
|
|
22
|
-
|
|
|
23
|
-
| `src`
|
|
24
|
-
| `alt`
|
|
25
|
-
| `fallback`
|
|
26
|
-
| `size`
|
|
21
|
+
| Name | Privacy | Type | Default | Description | Inherited From |
|
|
22
|
+
| ------------------ | ------- | ----------------------------------------------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
|
|
23
|
+
| `src` | | `string` | `''` | Image source URL | |
|
|
24
|
+
| `alt` | | `string` | `''` | Alt text for the image | |
|
|
25
|
+
| `fallback` | | `string` | `''` | Fallback text (typically user initials) | |
|
|
26
|
+
| `size` | | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'xxl'` | `'md'` | Size variant.
- 'xs': Extra small (1.5rem)
- 'sm': Small (2.25rem)
- 'md': Medium (2.5rem) - default
- 'lg': Large (3rem)
- 'xl': Extra large (3.5rem)
- 'xxl': Extra extra large (4rem) | |
|
|
27
|
+
| `tooltip` | | `string` | `''` | Tooltip text content. Set to empty string to remove the tooltip. | TooltipMixin |
|
|
28
|
+
| `tooltipPosition` | | `'top' \| 'bottom' \| 'left' \| 'right'` | `'top'` | Position relative to the host element. Auto-flips when constrained by the viewport. | TooltipMixin |
|
|
29
|
+
| `tooltipDelay` | | `number` | `300` | Show delay in milliseconds (hover trigger only). | TooltipMixin |
|
|
30
|
+
| `tooltipOffset` | | `TooltipOffset \| null` | `null` | Gap between host and tooltip (sm=4px, md=8px, lg=12px, xl=16px). | TooltipMixin |
|
|
31
|
+
| `tooltipNoArrow` | | `boolean` | `false` | Hide the arrow pseudo-element. | TooltipMixin |
|
|
32
|
+
| `tooltipTrigger` | | `string` | `'hover focus'` | Space-separated trigger types: 'hover', 'focus', 'click'. | TooltipMixin |
|
|
33
|
+
| `_onMouseLeave` | private | | | | TooltipMixin |
|
|
34
|
+
| `_onFocusIn` | private | | | | TooltipMixin |
|
|
35
|
+
| `_onFocusOut` | private | | | | TooltipMixin |
|
|
36
|
+
| `_onClick` | private | | | | TooltipMixin |
|
|
37
|
+
| `_onNativeToggle` | private | | | | TooltipMixin |
|
|
38
|
+
| `_onKeyDown` | private | | | | TooltipMixin |
|
|
39
|
+
| `_onDocumentClick` | private | `((e: MouseEvent) => void) \| null` | `null` | | TooltipMixin |
|
|
40
|
+
|
|
41
|
+
### Methods
|
|
42
|
+
|
|
43
|
+
| Name | Privacy | Description | Parameters | Return | Inherited From |
|
|
44
|
+
| ------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- | --------- | ----------------- |
|
|
45
|
+
| `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 |
|
|
27
46
|
|
|
28
47
|
### Events
|
|
29
48
|
|
|
@@ -35,12 +54,23 @@
|
|
|
35
54
|
|
|
36
55
|
### Attributes
|
|
37
56
|
|
|
38
|
-
| Name
|
|
39
|
-
|
|
|
40
|
-
| `src`
|
|
41
|
-
| `alt`
|
|
42
|
-
| `fallback`
|
|
43
|
-
| `size`
|
|
57
|
+
| Name | Field | Inherited From |
|
|
58
|
+
| ------------------ | --------------- | -------------- |
|
|
59
|
+
| `src` | src | |
|
|
60
|
+
| `alt` | alt | |
|
|
61
|
+
| `fallback` | fallback | |
|
|
62
|
+
| `size` | size | |
|
|
63
|
+
| `tooltip` | tooltip | TooltipMixin |
|
|
64
|
+
| `tooltipPosition` | tooltipPosition | TooltipMixin |
|
|
65
|
+
| `tooltipDelay` | tooltipDelay | TooltipMixin |
|
|
66
|
+
| `tooltipOffset` | tooltipOffset | TooltipMixin |
|
|
67
|
+
| `tooltipNoArrow` | tooltipNoArrow | TooltipMixin |
|
|
68
|
+
| `tooltipTrigger` | tooltipTrigger | TooltipMixin |
|
|
69
|
+
| `tooltip-position` | tooltipPosition | TooltipMixin |
|
|
70
|
+
| `tooltip-delay` | tooltipDelay | TooltipMixin |
|
|
71
|
+
| `tooltip-offset` | tooltipOffset | TooltipMixin |
|
|
72
|
+
| `tooltip-no-arrow` | tooltipNoArrow | TooltipMixin |
|
|
73
|
+
| `tooltip-trigger` | tooltipTrigger | TooltipMixin |
|
|
44
74
|
|
|
45
75
|
### CSS Properties
|
|
46
76
|
|
|
@@ -24,9 +24,10 @@
|
|
|
24
24
|
|
|
25
25
|
### Methods
|
|
26
26
|
|
|
27
|
-
| Name | Privacy | Description
|
|
28
|
-
| ---------------- | ------- |
|
|
29
|
-
| `processAvatars` | | Process all avatar children: apply size, handle overflow
Call this method when avatars are dynamically added or removed
|
|
27
|
+
| Name | Privacy | Description | Parameters | Return | Inherited From |
|
|
28
|
+
| ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- | --------- | ----------------- |
|
|
29
|
+
| `processAvatars` | | Process all avatar children: apply size, handle overflow
Call this method when avatars are dynamically added or removed | | `void` | |
|
|
30
|
+
| `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 |
|
|
30
31
|
|
|
31
32
|
### Events
|
|
32
33
|
|
package/docs/components/Badge.md
CHANGED
|
@@ -21,7 +21,13 @@
|
|
|
21
21
|
| --------- | ------- | ---------------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
|
|
22
22
|
| `variant` | | `'info' \| 'primary' \| 'error' \| 'success' \| 'warning'` | `'info'` | Style of the badge.
- 'info': Informational (default)
- 'primary': Primary action or emphasis
- 'error': Error or danger state
- 'success': Success or completion state
- 'warning': Warning or caution state | |
|
|
23
23
|
| `dot` | | `boolean` | `false` | Should a dot be displayed before the label? | |
|
|
24
|
-
| `size` | | `
|
|
24
|
+
| `size` | | `'sm' \| 'md' \| 'lg'` | `'sm'` | Size variant.
- 'sm': Small (default)
- 'md': Medium
- 'lg': Large | |
|
|
25
|
+
|
|
26
|
+
### Methods
|
|
27
|
+
|
|
28
|
+
| Name | Privacy | Description | Parameters | Return | Inherited From |
|
|
29
|
+
| ------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- | --------- | ----------------- |
|
|
30
|
+
| `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 |
|
|
25
31
|
|
|
26
32
|
### Events
|
|
27
33
|
|
|
@@ -48,6 +54,12 @@
|
|
|
48
54
|
| `--badge-py` | | Vertical padding (overrides size default) |
|
|
49
55
|
| `--badge-dot-size` | | Size of the dot affordance (default: 6px) |
|
|
50
56
|
|
|
57
|
+
### Slots
|
|
58
|
+
|
|
59
|
+
| Name | Description |
|
|
60
|
+
| ---- | ---------------------------------------------------- |
|
|
61
|
+
| | Label text or child elements (e.g., btu-icon + text) |
|
|
62
|
+
|
|
51
63
|
<hr/>
|
|
52
64
|
|
|
53
65
|
## Exports
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# `src/components/button-group/ButtonGroup.ts`:
|
|
2
|
+
|
|
3
|
+
## class: `ButtonGroup`, `btu-button-group`
|
|
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
|
+
| `ComponentStatesMixin` | /src/util/ComponentStatesMixin.js | |
|
|
17
|
+
| `EventEmitterMixin` | /src/util/EventEmitterMixin.js | |
|
|
18
|
+
| `ReadyMixin` | /src/util/ReadyMixin.js | |
|
|
19
|
+
|
|
20
|
+
### Static Fields
|
|
21
|
+
|
|
22
|
+
| Name | Privacy | Type | Default | Description | Inherited From |
|
|
23
|
+
| --------- | ------- | ---- | ------- | ----------- | -------------- |
|
|
24
|
+
| `tagName` | | | | | |
|
|
25
|
+
|
|
26
|
+
### Fields
|
|
27
|
+
|
|
28
|
+
| Name | Privacy | Type | Default | Description | Inherited From |
|
|
29
|
+
| ------------- | ------- | ---------------------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
|
|
30
|
+
| `label` | | `string` | `''` | Accessible name for the group, announced by assistive devices via aria-label. | |
|
|
31
|
+
| `orientation` | | `'horizontal' \| 'vertical'` | `'horizontal'` | Layout direction of the buttons. | |
|
|
32
|
+
| `variant` | | `'connected' \| 'spaced'` | `'connected'` | \`connected\` collapses shared borders for a joined appearance.
\`spaced\` renders buttons with a gap. | |
|
|
33
|
+
| `size` | | `'sm' \| 'md' \| 'lg'` | `'md'` | Propagates a uniform size to all child buttons. | |
|
|
34
|
+
| `disabled` | | `boolean` | `false` | When true, disables all child buttons as a group. | |
|
|
35
|
+
| `selection` | | `'none' \| 'single' \| 'multiple'` | `'none'` | Enables toggle/selection behavior.
\`single\` allows one active button; \`multiple\` allows many. | |
|
|
36
|
+
| `value` | | `string` | `''` | Reflects the currently selected button value(s).
For \`single\`, the value of the active button.
For \`multiple\`, a comma-delimited list of active values. | |
|
|
37
|
+
| `name` | | `string` | `''` | When set, creates hidden input(s) for native form participation. | |
|
|
38
|
+
|
|
39
|
+
### Methods
|
|
40
|
+
|
|
41
|
+
| Name | Privacy | Description | Parameters | Return | Inherited From |
|
|
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-button-group-ready` | `CustomEvent` | Fired after first render and initialization | |
|
|
50
|
+
| `btu-button-group-change` | `CustomEvent<{value: string}>` | Fired when selection changes (single/multiple modes only) | |
|
|
51
|
+
| `btu-icon-button-click` | `CustomEvent<{name: string \| undefined}>` | Bubbles from child btu-icon-button elements when clicked | |
|
|
52
|
+
|
|
53
|
+
### Attributes
|
|
54
|
+
|
|
55
|
+
| Name | Field | Inherited From |
|
|
56
|
+
| ------------- | ----------- | -------------- |
|
|
57
|
+
| `label` | label | |
|
|
58
|
+
| `orientation` | orientation | |
|
|
59
|
+
| `variant` | variant | |
|
|
60
|
+
| `size` | size | |
|
|
61
|
+
| `disabled` | disabled | |
|
|
62
|
+
| `selection` | selection | |
|
|
63
|
+
| `value` | value | |
|
|
64
|
+
| `name` | name | |
|
|
65
|
+
|
|
66
|
+
### CSS Properties
|
|
67
|
+
|
|
68
|
+
| Name | Default | Description |
|
|
69
|
+
| ---------------------------------- | ------- | ----------------------------------------------------------------------- |
|
|
70
|
+
| `--button-group-gap` | | Space between buttons when variant="spaced" (default: spacing.sm) |
|
|
71
|
+
| `--button-group-border-radius` | | Corner radius of outer edges when variant="connected" (default: 0.5rem) |
|
|
72
|
+
| `--button-group-border-color` | | Internal divider color between connected buttons (default: gray-300) |
|
|
73
|
+
| `--button-group-selection-bg` | | Background of a toggled/selected child (default: primary-50) |
|
|
74
|
+
| `--button-group-selection-color` | | Text/icon color of a toggled/selected child (default: primary-700) |
|
|
75
|
+
| `--button-group-shimmer-highlight` | | Highlight color of the selection shimmer effect (default: primary-200) |
|
|
76
|
+
|
|
77
|
+
### Slots
|
|
78
|
+
|
|
79
|
+
| Name | Description |
|
|
80
|
+
| ----- | ---------------------------------------------------------------------------------------------- |
|
|
81
|
+
| | One or more btu-button or btu-icon-button elements to display in the group |
|
|
82
|
+
| `end` | Pushes the child to the end of the group via auto-margin (vertical: bottom, horizontal: right) |
|
|
83
|
+
|
|
84
|
+
<hr/>
|
|
85
|
+
|
|
86
|
+
## Exports
|
|
87
|
+
|
|
88
|
+
| Kind | Name | Declaration | Module | Package |
|
|
89
|
+
| --------------------------- | ------------------ | ----------- | ------------------------------------------ | ------- |
|
|
90
|
+
| `js` | `default` | ButtonGroup | src/components/button-group/ButtonGroup.ts | |
|
|
91
|
+
| `custom-element-definition` | `btu-button-group` | ButtonGroup | src/components/button-group/ButtonGroup.ts | |
|