@brightspot/ui 6.8.0 → 6.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +661 -0
- package/README.md +18 -2
- package/dist/storybook/CHANGELOG.md +661 -0
- package/dist/storybook/README.md +195 -0
- package/dist/storybook/assets/{ActionBar.stories-CJBn-mku.js → ActionBar.stories-TlhuCumU.js} +31 -28
- package/dist/storybook/assets/ActionItem-CjtyGLd5.js +16 -0
- package/dist/storybook/assets/{ActionItem.stories-DXzC9C1u.js → ActionItem.stories-BVlNQvfP.js} +2 -2
- package/dist/storybook/assets/AiSparkle.stories-DMzc8JUe.js +73 -0
- package/dist/storybook/assets/Avatar-C6Li1sPI.js +4 -0
- package/dist/storybook/assets/Avatar.stories-COj6XrPn.js +213 -0
- package/dist/storybook/assets/AvatarGroup-DgxRTZBe.js +1 -0
- package/dist/storybook/assets/AvatarGroup.stories-Dh3e7iN2.js +225 -0
- package/dist/storybook/assets/Badge-bWrvpEgX.js +1 -0
- package/dist/storybook/assets/{Badge.stories-DEpoJpUZ.js → Badge.stories-KXpmEXpt.js} +4 -4
- package/dist/storybook/assets/Banner-FSFX1AIb.css +1 -0
- package/dist/storybook/assets/{Banner.stories--jeU6fKq.js → Banner.stories-Cnhm3dXK.js} +14 -14
- package/dist/storybook/assets/Button-DE0s-gat.js +10 -0
- package/dist/storybook/assets/Button.stories-Cwg1YZEb.js +54 -0
- package/dist/storybook/assets/ButtonGroup-CoLI5nGO.js +1 -0
- package/dist/storybook/assets/{ButtonGroup.stories-CerE_0AC.js → ButtonGroup.stories-VhnKPP1n.js} +7 -7
- package/dist/storybook/assets/Card-DyntwdY-.css +1 -0
- package/dist/storybook/assets/{Card.stories-5SxHtU3Y.js → Card.stories-BgpL90zB.js} +60 -29
- package/dist/storybook/assets/{Celebrate.stories-COS789GX.js → Celebrate.stories-D3NJgYcX.js} +5 -5
- package/dist/storybook/assets/Checkbox-BC1T_KxW.js +30 -0
- package/dist/storybook/assets/{Checkbox.stories-DuQu38Gv.js → Checkbox.stories-AFQNz7dQ.js} +10 -10
- package/dist/storybook/assets/CircularProgress-eqVb2jUD.js +42 -0
- package/dist/storybook/assets/{CircularProgress.stories-Lf2Ws46Y.js → CircularProgress.stories-B6t8VhmJ.js} +2 -2
- package/dist/storybook/assets/ClipboardMixin-DcxrOy5B.js +1 -0
- package/dist/storybook/assets/{ClipboardMixin.stories-BT5KfLZ_.js → ClipboardMixin.stories-BqtQMjmS.js} +6 -6
- package/dist/storybook/assets/{Color-6BZIO3FS-BNBxjqrS.js → Color-6BZIO3FS-CDluohEc.js} +1 -1
- package/dist/storybook/assets/{Colors.stories-Ck6bXbd0.js → Colors.stories-CqTniDIa.js} +1 -1
- package/dist/storybook/assets/{CombinedEffects.stories-DLELdAMr.js → CombinedEffects.stories-FwW0chy5.js} +2 -2
- package/dist/storybook/assets/{ComponentStatesMixin-B6uJL_2c.js → ComponentStatesMixin-hUqOL2aW.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin.stories-fiyrALkY.js → ComponentStatesMixin.stories-CwGoq685.js} +1 -1
- package/dist/storybook/assets/{CopyToClipboard.stories-2OfBH19_.js → CopyToClipboard.stories-DUGjgtQx.js} +18 -10
- package/dist/storybook/assets/{Debounce.stories-C9qo3lIN.js → Debounce.stories-CrWfXhKS.js} +1 -1
- package/dist/storybook/assets/{DocsRenderer-LL677BLK-CBVYZYjR.js → DocsRenderer-LL677BLK-9e51z9Xc.js} +3 -3
- package/dist/storybook/assets/{Dropdown.stories-15ZDMkRz.js → Dropdown.stories-BsBxV0wp.js} +2 -2
- package/dist/storybook/assets/DropdownMenu-B-LvOIGj.js +42 -0
- package/dist/storybook/assets/EmptyState-h0A4Qpiu.css +1 -0
- package/dist/storybook/assets/{EmptyState.stories-Bjb8hzYj.js → EmptyState.stories-CJ1w8Tp2.js} +33 -21
- package/dist/storybook/assets/EscaAvatar.stories-BoLLSj9q.js +140 -0
- package/dist/storybook/assets/{Events.stories-BV0vMF2I.js → Events.stories-C3sTBwPJ.js} +2 -2
- package/dist/storybook/assets/{Heading.stories-CEUJqUbQ.js → Heading.stories-jmXDRBmM.js} +1 -1
- package/dist/storybook/assets/{HueRipple.stories-CwvtcOM_.js → HueRipple.stories-BPx5aSYd.js} +2 -2
- package/dist/storybook/assets/Icon-CWyJRQf7.js +34409 -0
- package/dist/storybook/assets/{Icon.stories-AB_v-61c.js → Icon.stories-iYBxmv2x.js} +10 -10
- package/dist/storybook/assets/IconButton-Di5Rgs7F.js +12 -0
- package/dist/storybook/assets/{IconButton.stories-BHuHsM3k.js → IconButton.stories-DENLoxVk.js} +2 -2
- package/dist/storybook/assets/LinearProgress-D9ngIVlv.js +25 -0
- package/dist/storybook/assets/{LinearProgress.stories-BNN5SXe3.js → LinearProgress.stories-u90B_VJR.js} +2 -2
- package/dist/storybook/assets/Message-CM3eexdu.css +1 -0
- package/dist/storybook/assets/Message-nFAa55c_.js +28 -0
- package/dist/storybook/assets/{Message.stories-DdLhMXnb.js → Message.stories-B4rpz5rI.js} +2 -2
- package/dist/storybook/assets/OnFindMixin-oL1bvTFj.js +1 -0
- package/dist/storybook/assets/{OnFindMixin.stories-B-5TeBOF.js → OnFindMixin.stories-CdeS5sFA.js} +9 -9
- package/dist/storybook/assets/Pagination-CSWcjuDU.js +88 -0
- package/dist/storybook/assets/{Pagination.stories-C9zsOdb2.js → Pagination.stories-Da2WzJkv.js} +33 -33
- package/dist/storybook/assets/{Popover.stories-BiqIwebU.js → Popover.stories-CVljlVHc.js} +16 -16
- package/dist/storybook/assets/ProgressMixin-CeSrn0_P.js +1 -0
- package/dist/storybook/assets/Radio-rvfGhZwK.js +25 -0
- package/dist/storybook/assets/{Radio.stories-BmrEdPkm.js → Radio.stories-B0wHdJuc.js} +6 -6
- package/dist/storybook/assets/{RadioGroup.stories-ChARVXs3.js → RadioGroup.stories-D8krOSlP.js} +22 -22
- package/dist/storybook/assets/{ReadyMixin-BbuzH3uO.js → ReadyMixin-CvX_eidU.js} +1 -1
- package/dist/storybook/assets/RovingTabindexMixin-9z8lwaM9.js +1 -0
- package/dist/storybook/assets/{RovingTabindexMixin.stories-xm4b394_.js → RovingTabindexMixin.stories-Y8vBWjJp.js} +5 -5
- package/dist/storybook/assets/{Rtc.stories-DdcMaELA.js → Rtc.stories-D3Y-z8y_.js} +1 -1
- package/dist/storybook/assets/{ScrollShadow.stories-CI67Ougx.js → ScrollShadow.stories-1KD0lWHX.js} +1 -1
- package/dist/storybook/assets/{Switch.stories-DOqrRkxc.js → Switch.stories-Bsqvm_HE.js} +60 -27
- package/dist/storybook/assets/{Tab.stories-DN8o4cf_.js → Tab.stories-CzcTisNs.js} +7 -7
- package/dist/storybook/assets/Tabs-DdpYNZSW.js +17 -0
- package/dist/storybook/assets/{Tabs.stories-BEowfCcl.js → Tabs.stories-UOS3V0J4.js} +6 -6
- package/dist/storybook/assets/{Throttle.stories-BZ_nsuw1.js → Throttle.stories-C8jgzh6e.js} +1 -1
- package/dist/storybook/assets/Tooltip.stories-B5BoI0cH.js +143 -0
- package/dist/storybook/assets/TooltipMixin-CVKslCDt.js +1 -0
- package/dist/storybook/assets/{Upload.stories-sAEiabwq.js → Upload.stories-BsQDCDqo.js} +102 -52
- package/dist/storybook/assets/UploadItem-CYQqNwUF.js +54 -0
- package/dist/storybook/assets/{UploadItem.stories-C19JMfmB.js → UploadItem.stories-_le7XBTV.js} +4 -4
- package/dist/storybook/assets/{Welcome.stories-C30jg0r1.js → Welcome.stories-rramKkhd.js} +38 -8
- package/dist/storybook/assets/Widget-elBzGg8w.css +1 -0
- package/dist/storybook/assets/Widget.stories-DtbAaklk.js +279 -0
- package/dist/storybook/assets/{WithTooltip-65CFNBJE-PFRy5maL.js → WithTooltip-65CFNBJE-DK6GcBuR.js} +1 -1
- package/dist/storybook/assets/ai-sparkle-BZMJJAxY.js +1 -0
- package/dist/storybook/assets/aria-D5THOgos.js +1 -0
- package/dist/storybook/assets/{blocks-DLjjvsFT.js → blocks-DHnzPh43.js} +5 -5
- package/dist/storybook/assets/esca-glow-BwdhBvIX.js +2 -0
- package/dist/storybook/assets/esca-idle-B-fumiIb.js +1 -0
- package/dist/storybook/assets/esca-search-rwNfo19I.js +1 -0
- package/dist/storybook/assets/esca-task-complete-BAJP2dY2.js +1 -0
- package/dist/storybook/assets/esca-wave-Bjs4CUR7.js +1 -0
- package/dist/storybook/assets/{formatter-EIJCOSYU-D39uscG_.js → formatter-EIJCOSYU-qig-qWlG.js} +1 -1
- package/dist/storybook/assets/i18n-BQ-Uj-0B.js +1 -0
- package/dist/storybook/assets/if-defined-DerKRcyC.js +1 -0
- package/dist/storybook/assets/{iframe-B9buZjP7.js → iframe-DlBK9Drk.js} +24 -24
- package/dist/storybook/assets/{index-BdEHup-4.js → index-CItQyB37.js} +1 -1
- package/dist/storybook/assets/lottie_svg-C3v6xdng.js +2 -0
- package/dist/storybook/assets/{onFind-CGzSFqNN.js → onFind-Ci35eu2y.js} +1 -1
- package/dist/storybook/assets/{onFind.stories-Dq71qO14.js → onFind.stories-BmbwWWo1.js} +1 -1
- package/dist/storybook/assets/{onRemove.stories-B1GqLH_U.js → onRemove.stories-DFWCIgE4.js} +1 -1
- package/dist/storybook/assets/{onVisible.stories-BNKxOfLw.js → onVisible.stories-B-onpgE-.js} +1 -1
- package/dist/storybook/assets/property-Bmq4RTSP.js +1 -0
- package/dist/storybook/assets/ref-BhKk4SDh.js +1 -0
- package/dist/storybook/assets/state-DVIUS0Gf.js +1 -0
- package/dist/storybook/assets/{style-map-qCiIYcp5.js → style-map-DE4G47KD.js} +1 -1
- package/dist/storybook/assets/{syntaxhighlighter-ED5Y7EFY-CUM-CaRF.js → syntaxhighlighter-ED5Y7EFY-Dfgnal1d.js} +1 -1
- package/dist/storybook/custom-elements.json +11835 -0
- package/dist/storybook/docs/components/ActionBar.md +55 -0
- package/dist/storybook/docs/components/ActionItem.md +50 -0
- package/dist/storybook/docs/components/AiSparkle.md +33 -0
- package/dist/storybook/docs/components/Avatar.md +45 -0
- package/dist/storybook/docs/components/AvatarGroup.md +34 -0
- package/dist/storybook/docs/components/Badge.md +47 -0
- package/dist/storybook/docs/components/Banner.md +35 -0
- package/dist/storybook/docs/components/ButtonGroup.md +65 -0
- package/dist/storybook/docs/components/Card.md +67 -0
- package/dist/storybook/docs/components/Checkbox.md +49 -0
- package/dist/storybook/docs/components/CircularProgress.md +40 -0
- package/dist/storybook/docs/components/CopyToClipboard.md +51 -0
- package/dist/storybook/docs/components/Dropdown.md +74 -0
- package/dist/storybook/docs/components/DropdownItem.md +45 -0
- package/dist/storybook/docs/components/DropdownMenu.md +41 -0
- package/dist/storybook/docs/components/EmptyState.md +62 -0
- package/dist/storybook/docs/components/EscaAvatar.md +40 -0
- package/dist/storybook/docs/components/Icon.md +40 -0
- package/dist/storybook/docs/components/IconButton.md +36 -0
- package/dist/storybook/docs/components/LinearProgress.md +37 -0
- package/dist/storybook/docs/components/Message.md +50 -0
- package/dist/storybook/docs/components/Pagination.md +70 -0
- package/dist/storybook/docs/components/Popover.md +59 -0
- package/dist/storybook/docs/components/README.md +48 -0
- package/dist/storybook/docs/components/Radio.md +55 -0
- package/dist/storybook/docs/components/RadioGroup.md +34 -0
- package/dist/storybook/docs/components/Switch.md +48 -0
- package/dist/storybook/docs/components/Tab.md +40 -0
- package/dist/storybook/docs/components/Tabs.md +49 -0
- package/dist/storybook/docs/components/Upload.md +63 -0
- package/dist/storybook/docs/components/UploadItem.md +30 -0
- package/dist/storybook/docs/components/Widget.md +88 -0
- package/dist/storybook/docs/dari-elements.md +55 -0
- package/dist/storybook/iframe.html +1 -1
- package/dist/storybook/index.html +29 -2
- package/dist/storybook/llms-full.txt +1721 -0
- package/dist/storybook/llms.txt +65 -0
- package/dist/storybook/project.json +1 -1
- package/dist/storybook/robots.txt +7 -0
- package/dist/storybook/sb-addons/storybook-3/manager-bundle.js +1 -1
- package/dist/storybook/sitemap.xml +90 -0
- package/docs/components/ActionBar.md +41 -64
- package/docs/components/ActionItem.md +50 -96
- package/docs/components/AiSparkle.md +23 -60
- package/docs/components/Avatar.md +45 -88
- package/docs/components/AvatarGroup.md +24 -44
- package/docs/components/Badge.md +34 -62
- package/docs/components/Banner.md +25 -39
- package/docs/components/ButtonGroup.md +65 -99
- package/docs/components/Card.md +67 -83
- package/docs/components/Checkbox.md +49 -91
- package/docs/components/CircularProgress.md +40 -84
- package/docs/components/CopyToClipboard.md +35 -40
- package/docs/components/Dropdown.md +74 -120
- package/docs/components/DropdownItem.md +45 -81
- package/docs/components/DropdownMenu.md +30 -70
- package/docs/components/EmptyState.md +45 -62
- package/docs/components/EscaAvatar.md +30 -61
- package/docs/components/Icon.md +29 -62
- package/docs/components/IconButton.md +36 -83
- package/docs/components/LinearProgress.md +28 -70
- package/docs/components/Message.md +38 -63
- package/docs/components/Pagination.md +70 -100
- package/docs/components/Popover.md +46 -79
- package/docs/components/README.md +34 -40
- package/docs/components/Radio.md +55 -105
- package/docs/components/RadioGroup.md +26 -55
- package/docs/components/Switch.md +48 -84
- package/docs/components/Tab.md +30 -70
- package/docs/components/Tabs.md +49 -86
- package/docs/components/Upload.md +63 -112
- package/docs/components/UploadItem.md +22 -53
- package/docs/components/Widget.md +66 -67
- package/llms.txt +63 -0
- package/package.json +9 -6
- package/dist/storybook/assets/AiSparkle.stories-BfjT5jrJ.js +0 -72
- package/dist/storybook/assets/Avatar.stories-D8lnIZaY.js +0 -213
- package/dist/storybook/assets/AvatarGroup.stories-Cz9oVah0.js +0 -225
- package/dist/storybook/assets/Button-2ucj5lUP.js +0 -10
- package/dist/storybook/assets/Button.stories-ndl1RJd7.js +0 -54
- package/dist/storybook/assets/EscaAvatar.stories-Rc2MSzCX.js +0 -139
- package/dist/storybook/assets/LucideDynamicLoader-BuoNL33C.js +0 -1
- package/dist/storybook/assets/Tooltip.stories-3bar43ZN.js +0 -143
- package/dist/storybook/assets/Widget.stories-9-1XpZNl.js +0 -233
- package/dist/storybook/assets/if-defined-BwWBCoAU.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{i as p,x as t,g as m}from"./iframe-DlBK9Drk.js";import"./Badge-bWrvpEgX.js";import{E as g,R as h}from"./ReadyMixin-CvX_eidU.js";import"./Pagination-CSWcjuDU.js";import"./Message-nFAa55c_.js";import"./preload-helper-PPVm8Dsz.js";import"./property-Bmq4RTSP.js";import"./i18n-BQ-Uj-0B.js";import"./aria-D5THOgos.js";import"./CircularProgress-eqVb2jUD.js";import"./ProgressMixin-CeSrn0_P.js";import"./DropdownMenu-B-LvOIGj.js";import"./style-map-DE4G47KD.js";import"./TooltipMixin-CVKslCDt.js";import"./Icon-CWyJRQf7.js";import"./RovingTabindexMixin-9z8lwaM9.js";import"./IconButton-Di5Rgs7F.js";import"./if-defined-DerKRcyC.js";import"./onFind-Ci35eu2y.js";class f extends g(h(p)){createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("btu-banner")}firstUpdated(){const n=Array.from(this.querySelectorAll(":scope > btu-message"));n.length===0?console.warn("[btu-banner] Expected at least one <btu-message> child.",this):n.length>1&&this._paginate(n),this.emit("btu-banner-ready")}_paginate(n){const e=document.createElement("btu-pagination");e.totalItems=n.length,e.pageSize=1,e.pageSizeOptions="1",e.hideTotalCount=!0,e.pageSizeChanger=!1,e.boundaryButtons=!1;const l=d=>{n.forEach((u,c)=>{u.hidden=c!==d-1})};e.addEventListener("btu-pagination-change",d=>{l(d.detail.page)}),l(1),this.dataset.paginated="",this.append(e)}render(){return t``}}customElements.get("btu-banner")||customElements.define("btu-banner",f);const{events:v,args:w,argTypes:y}=m("btu-banner"),H={title:"Components/Banner",component:"btu-banner",tags:["autodocs"],parameters:{docs:{subtitle:"Full-width wrapper that pins a message to the top of the CMS",description:{component:`
|
|
2
2
|
<h3>When to use:</h3>
|
|
3
3
|
<ul>
|
|
4
4
|
<li>Pin a high-visibility message to the full width of the page — a site-wide alert above the CMS content area or a content edit page</li>
|
|
@@ -6,7 +6,7 @@ import{g as i,x as e}from"./iframe-B9buZjP7.js";import"./preload-helper-PPVm8Dsz
|
|
|
6
6
|
|
|
7
7
|
<h3>Structure:</h3>
|
|
8
8
|
<p>The banner is a thin container with no content API of its own: compose a single <code><btu-message></code> inside it and the banner spans it edge-to-edge with only a bottom border and no corner rounding. Set all content — <code>variant</code>, <code>label</code>, <code>symbol</code>, <code>dismissible</code>, and the <code>badge</code>/<code>description</code>/<code>actions</code> slots — on the <a href="?path=/docs/components-message--docs">Message</a> itself. Because the banner is always full width, the message inside it has no <code>full-width</code> attribute. Use <a href="?path=/docs/components-message--docs">Message</a> directly when you want a contained, rounded card instead.</p>
|
|
9
|
-
`}},actions:{handles:
|
|
9
|
+
`}},actions:{handles:v},controls:{disable:!0}},args:{...w},argTypes:{...y,"default-slot":{table:{disable:!0}}}},a={render:()=>t`
|
|
10
10
|
<btu-banner>
|
|
11
11
|
<btu-message variant="primary" label="Scheduled maintenance on Saturday.">
|
|
12
12
|
<span slot="description">Expect up to 30 minutes of downtime starting at 02:00 UTC.</span>
|
|
@@ -15,7 +15,7 @@ import{g as i,x as e}from"./iframe-B9buZjP7.js";import"./preload-helper-PPVm8Dsz
|
|
|
15
15
|
</button>
|
|
16
16
|
</btu-message>
|
|
17
17
|
</btu-banner>
|
|
18
|
-
`,parameters:{docs:{description:{story:"Compose a single `<btu-message>` inside the banner. The banner spans it to the full width of its host and strips its corner rounding, leaving only a bottom border."}}}},
|
|
18
|
+
`,parameters:{docs:{description:{story:"Compose a single `<btu-message>` inside the banner. The banner spans it to the full width of its host and strips its corner rounding, leaving only a bottom border."}}}},s={render:()=>t`
|
|
19
19
|
<div class="flex flex-col gap-6">
|
|
20
20
|
<btu-banner>
|
|
21
21
|
<btu-message variant="info" label="New feature released">
|
|
@@ -38,11 +38,11 @@ import{g as i,x as e}from"./iframe-B9buZjP7.js";import"./preload-helper-PPVm8Dsz
|
|
|
38
38
|
</btu-message>
|
|
39
39
|
</btu-banner>
|
|
40
40
|
</div>
|
|
41
|
-
`,parameters:{docs:{description:{story:"Each variant renders edge-to-edge with a bottom border in its semantic color."}}}},
|
|
41
|
+
`,parameters:{docs:{description:{story:"Each variant renders edge-to-edge with a bottom border in its semantic color."}}}},o={render:()=>t`
|
|
42
42
|
<btu-banner>
|
|
43
43
|
<btu-message variant="info" label="Heads up — this banner can be dismissed." dismissible></btu-message>
|
|
44
44
|
</btu-banner>
|
|
45
|
-
`,parameters:{docs:{description:{story:"The message keeps its full API inside a banner — set `dismissible` on the `<btu-message>` to add a close button (it emits `btu-message-dismiss`)."}}}},
|
|
45
|
+
`,parameters:{docs:{description:{story:"The message keeps its full API inside a banner — set `dismissible` on the `<btu-message>` to add a close button (it emits `btu-message-dismiss`)."}}}},r={render:()=>t`
|
|
46
46
|
<btu-banner>
|
|
47
47
|
<btu-message variant="info" label="New feature released" dismissible>
|
|
48
48
|
<btu-badge slot="badge" variant="info" size="sm">v2.4</btu-badge>
|
|
@@ -52,7 +52,7 @@ import{g as i,x as e}from"./iframe-B9buZjP7.js";import"./preload-helper-PPVm8Dsz
|
|
|
52
52
|
</button>
|
|
53
53
|
</btu-message>
|
|
54
54
|
</btu-banner>
|
|
55
|
-
`,parameters:{docs:{description:{story:"All of the message’s slots work inside a banner — `badge`, `description`, and `actions` — alongside `dismissible`."}}}},
|
|
55
|
+
`,parameters:{docs:{description:{story:"All of the message’s slots work inside a banner — `badge`, `description`, and `actions` — alongside `dismissible`."}}}},i={render:()=>t`
|
|
56
56
|
<btu-banner>
|
|
57
57
|
<btu-message variant="primary" label="Scheduled maintenance on Saturday">
|
|
58
58
|
<span slot="description">Expect up to 30 minutes of downtime starting at 02:00 UTC.</span>
|
|
@@ -64,7 +64,7 @@ import{g as i,x as e}from"./iframe-B9buZjP7.js";import"./preload-helper-PPVm8Dsz
|
|
|
64
64
|
<span slot="description">Review your usage dashboard to stay within the new limits.</span>
|
|
65
65
|
</btu-message>
|
|
66
66
|
</btu-banner>
|
|
67
|
-
`,parameters:{docs:{description:{story:"Drop multiple `<btu-message>` children into a banner and it automatically creates a `<btu-pagination>`, shows one message at a time, and wires the navigation — no pagination markup or event handling required."}}}},
|
|
67
|
+
`,parameters:{docs:{description:{story:"Drop multiple `<btu-message>` children into a banner and it automatically creates a `<btu-pagination>`, shows one message at a time, and wires the navigation — no pagination markup or event handling required."}}}},b={render:()=>t`
|
|
68
68
|
<div class="flex flex-col">
|
|
69
69
|
<btu-banner>
|
|
70
70
|
<btu-message variant="warning" label="Read-only mode">
|
|
@@ -76,7 +76,7 @@ import{g as i,x as e}from"./iframe-B9buZjP7.js";import"./preload-helper-PPVm8Dsz
|
|
|
76
76
|
</btu-banner>
|
|
77
77
|
<div class="p-6 text-sm text-gray-500">Page content sits below the full-width banner.</div>
|
|
78
78
|
</div>
|
|
79
|
-
`,parameters:{docs:{description:{story:"A banner pinned above page content — the typical placement at the top of a CMS content edit page."}}}};
|
|
79
|
+
`,parameters:{docs:{description:{story:"A banner pinned above page content — the typical placement at the top of a CMS content edit page."}}}};a.parameters={...a.parameters,docs:{...a.parameters?.docs,source:{originalSource:`{
|
|
80
80
|
render: () => html\`
|
|
81
81
|
<btu-banner>
|
|
82
82
|
<btu-message variant="primary" label="Scheduled maintenance on Saturday.">
|
|
@@ -94,7 +94,7 @@ import{g as i,x as e}from"./iframe-B9buZjP7.js";import"./preload-helper-PPVm8Dsz
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
}`,...
|
|
97
|
+
}`,...a.parameters?.docs?.source}}};s.parameters={...s.parameters,docs:{...s.parameters?.docs,source:{originalSource:`{
|
|
98
98
|
render: () => html\`
|
|
99
99
|
<div class="flex flex-col gap-6">
|
|
100
100
|
<btu-banner>
|
|
@@ -126,7 +126,7 @@ import{g as i,x as e}from"./iframe-B9buZjP7.js";import"./preload-helper-PPVm8Dsz
|
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
-
}`,...
|
|
129
|
+
}`,...s.parameters?.docs?.source}}};o.parameters={...o.parameters,docs:{...o.parameters?.docs,source:{originalSource:`{
|
|
130
130
|
render: () => html\`
|
|
131
131
|
<btu-banner>
|
|
132
132
|
<btu-message variant="info" label="Heads up — this banner can be dismissed." dismissible></btu-message>
|
|
@@ -139,7 +139,7 @@ import{g as i,x as e}from"./iframe-B9buZjP7.js";import"./preload-helper-PPVm8Dsz
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
}`,...
|
|
142
|
+
}`,...o.parameters?.docs?.source}}};r.parameters={...r.parameters,docs:{...r.parameters?.docs,source:{originalSource:`{
|
|
143
143
|
render: () => html\`
|
|
144
144
|
<btu-banner>
|
|
145
145
|
<btu-message variant="info" label="New feature released" dismissible>
|
|
@@ -158,7 +158,7 @@ import{g as i,x as e}from"./iframe-B9buZjP7.js";import"./preload-helper-PPVm8Dsz
|
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
|
-
}`,...
|
|
161
|
+
}`,...r.parameters?.docs?.source}}};i.parameters={...i.parameters,docs:{...i.parameters?.docs,source:{originalSource:`{
|
|
162
162
|
render: () => html\`
|
|
163
163
|
<btu-banner>
|
|
164
164
|
<btu-message variant="primary" label="Scheduled maintenance on Saturday">
|
|
@@ -179,7 +179,7 @@ import{g as i,x as e}from"./iframe-B9buZjP7.js";import"./preload-helper-PPVm8Dsz
|
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
|
-
}`,...
|
|
182
|
+
}`,...i.parameters?.docs?.source}}};b.parameters={...b.parameters,docs:{...b.parameters?.docs,source:{originalSource:`{
|
|
183
183
|
render: () => html\`
|
|
184
184
|
<div class="flex flex-col">
|
|
185
185
|
<btu-banner>
|
|
@@ -200,4 +200,4 @@ import{g as i,x as e}from"./iframe-B9buZjP7.js";import"./preload-helper-PPVm8Dsz
|
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
|
-
}`,...
|
|
203
|
+
}`,...b.parameters?.docs?.source}}};const W=["Default","Variants","Dismissible","AllSlots","Paginated","InContext"];export{r as AllSlots,a as Default,o as Dismissible,b as InContext,i as Paginated,s as Variants,W as __namedExportsOrder,H as default};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{x as o}from"./iframe-DlBK9Drk.js";import"./Icon-CWyJRQf7.js";const x=({color:u="primary",pressed:b,fill:e,contained:i,outlined:s,size:t="sm",label:r,icon:n,hideText:l,disabled:a})=>{const c=e?"":"btu-button-fill-none",$=i?"":"btu-button-container-none",d=s?"btu-button-outline":"",m=l?"btu-button-text-hidden":"";return o`
|
|
2
|
+
<button
|
|
3
|
+
type="button"
|
|
4
|
+
class=${["btu-button",`btu-button-${u}`,`btu-button-${t}`,c,$,d,m].join(" ")}
|
|
5
|
+
?disabled=${a}
|
|
6
|
+
aria-pressed=${b?"true":"false"}
|
|
7
|
+
>
|
|
8
|
+
${n?o`<btu-icon symbol=${n} size=${t}></btu-icon>`:""} ${r}
|
|
9
|
+
</button>
|
|
10
|
+
`};export{x as B};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import{B as a}from"./Button-DE0s-gat.js";import"./iframe-DlBK9Drk.js";import"./preload-helper-PPVm8Dsz.js";import"./Icon-CWyJRQf7.js";import"./property-Bmq4RTSP.js";import"./ReadyMixin-CvX_eidU.js";const i=["ai","black","white","primary","teal","gray","purple","rose","error","warning","success"],m={title:"CSS Plugins/Button",component:"btu-button",tags:["autodocs"],parameters:{docs:{subtitle:"This Tailwind CSS plugin provides the `.btu-button` utility class for styling buttons. Use it on `<button>` elements preferably, but it can also be used on `<a>` or other clickable elements. The plugin includes variants for different colors, sizes, and styles such as filled, outlined, and contained buttons."},controls:{expanded:!0}},render:r=>a(r),argTypes:{color:{control:{type:"select"},options:i},contained:{control:{type:"boolean"},description:"Does the button have a container?"},disabled:{control:{type:"boolean"},description:"Is the button disabled?"},fill:{control:{type:"boolean"},description:"Is the button filled?"},hideText:{control:{type:"boolean"},description:"Icon only mode (hides label)"},icon:{control:{type:"text"},description:'Lucide icon name (e.g., "search", "smile", "check")'},label:{control:{type:"text"},description:"Button label text"},outlined:{control:{type:"boolean"},description:"Is the button outlined?"},pressed:{control:{type:"boolean"},description:"Is the button pressed?"},size:{control:{type:"select"},options:["sm","md","lg","xl","2xl"]}},args:{color:"primary",contained:!0,disabled:!1,fill:!0,hideText:!1,icon:"",label:"Button",outlined:!1,pressed:!1,size:"md"}},e={args:{}},t={args:{label:"Search",icon:"search"},parameters:{docs:{description:{story:"Button with an icon alongside text. Uses the `<btu-icon>` component."}}}},s={args:{icon:"smile",hideText:!0},parameters:{docs:{description:{story:"Icon-only button. Uses `btu-button-text-hidden` to hide the label and `<btu-icon>` for the icon."}}}},o={args:{label:"Disabled Button",disabled:!0},parameters:{docs:{description:{story:"Disabled button state. Uses the `[disabled]` attribute to trigger disabled styling with reduced opacity and pointer events disabled."}}}},n={args:{label:"Active Button",pressed:!0,fill:!1,icon:"check",hideText:!0},parameters:{docs:{description:{story:'Active/pressed button state. Uses `[aria-pressed="true"]` attribute to trigger the pressed styling, typically used for toggle buttons or to show an active state.'}}}};e.parameters={...e.parameters,docs:{...e.parameters?.docs,source:{originalSource:`{
|
|
2
|
+
args: {}
|
|
3
|
+
}`,...e.parameters?.docs?.source}}};t.parameters={...t.parameters,docs:{...t.parameters?.docs,source:{originalSource:`{
|
|
4
|
+
args: {
|
|
5
|
+
label: 'Search',
|
|
6
|
+
icon: 'search'
|
|
7
|
+
},
|
|
8
|
+
parameters: {
|
|
9
|
+
docs: {
|
|
10
|
+
description: {
|
|
11
|
+
story: \`Button with an icon alongside text. Uses the \\\`<btu-icon>\\\` component.\`
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}`,...t.parameters?.docs?.source}}};s.parameters={...s.parameters,docs:{...s.parameters?.docs,source:{originalSource:`{
|
|
16
|
+
args: {
|
|
17
|
+
icon: 'smile',
|
|
18
|
+
hideText: true
|
|
19
|
+
},
|
|
20
|
+
parameters: {
|
|
21
|
+
docs: {
|
|
22
|
+
description: {
|
|
23
|
+
story: \`Icon-only button. Uses \\\`btu-button-text-hidden\\\` to hide the label and \\\`<btu-icon>\\\` for the icon.\`
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}`,...s.parameters?.docs?.source}}};o.parameters={...o.parameters,docs:{...o.parameters?.docs,source:{originalSource:`{
|
|
28
|
+
args: {
|
|
29
|
+
label: 'Disabled Button',
|
|
30
|
+
disabled: true
|
|
31
|
+
},
|
|
32
|
+
parameters: {
|
|
33
|
+
docs: {
|
|
34
|
+
description: {
|
|
35
|
+
story: \`Disabled button state. Uses the \\\`[disabled]\\\` attribute to trigger disabled styling with reduced opacity and pointer events disabled.\`
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}`,...o.parameters?.docs?.source}}};n.parameters={...n.parameters,docs:{...n.parameters?.docs,source:{originalSource:`{
|
|
40
|
+
args: {
|
|
41
|
+
label: 'Active Button',
|
|
42
|
+
pressed: true,
|
|
43
|
+
fill: false,
|
|
44
|
+
icon: 'check',
|
|
45
|
+
hideText: true
|
|
46
|
+
},
|
|
47
|
+
parameters: {
|
|
48
|
+
docs: {
|
|
49
|
+
description: {
|
|
50
|
+
story: \`Active/pressed button state. Uses \\\`[aria-pressed="true"]\\\` attribute to trigger the pressed styling, typically used for toggle buttons or to show an active state.\`
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}`,...n.parameters?.docs?.source}}};const h=["Default","WithIcon","IconOnly","Disabled","ActivePressed"];export{n as ActivePressed,e as Default,o as Disabled,s as IconOnly,t as WithIcon,h as __namedExportsOrder,m as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{x as h,i as d}from"./iframe-DlBK9Drk.js";import{n as o}from"./property-Bmq4RTSP.js";import{C as b}from"./ComponentStatesMixin-hUqOL2aW.js";import{E as f,R as v}from"./ReadyMixin-CvX_eidU.js";import{O as p}from"./OnFindMixin-oL1bvTFj.js";import{R as m}from"./RovingTabindexMixin-9z8lwaM9.js";var y=Object.defineProperty,a=(u,t,e,i)=>{for(var s=void 0,n=u.length-1,l;n>=0;n--)(l=u[n])&&(s=l(t,e,s)||s);return s&&y(t,e,s),s};const g=new Set(["BTU-ICON-BUTTON","BTU-DROPDOWN"]),c=new Set(["BTU-ICON-BUTTON"]);class r extends m(b(f(p(v(d))))){constructor(){super(...arguments),this.label="",this.orientation="horizontal",this.variant="connected",this.size="md",this.disabled=!1,this.selection="none",this.value="",this.name="",this.initialClasses=[],this._initialClassesCaptured=!1,this.boundHandleClick=this.handleClick.bind(this),this.boundHandleKeyDown=this.handleKeyDown.bind(this)}static get tagName(){return"BTU-BUTTON-GROUP"}_getRovingTargets(){if(this.selection==="none")return[];const t=[];for(const e of Array.from(this.children))if(e instanceof HTMLElement&&!(e.hasAttribute("hidden")||e.getAttribute("type")==="hidden"))if(c.has(e.tagName)){const i=e.querySelector("button");i&&t.push(i)}else(e.matches(".btu-button")||e.matches("button")||e.tabIndex>=0)&&t.push(e);return t}connectedCallback(){super.connectedCallback(),this._initialClassesCaptured||(this.className&&(this.initialClasses=this.className.split(" ").filter(t=>t.trim())),this._initialClassesCaptured=!0),this.setAttribute("role","group"),this.addEventListener("click",this.boundHandleClick),this.addEventListener("keydown",this.boundHandleKeyDown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.boundHandleClick),this.removeEventListener("keydown",this.boundHandleKeyDown)}createRenderRoot(){return this}willUpdate(){this.className=[...this.initialClasses,"btu-button-group"].filter(Boolean).join(" "),this.syncStates(),this.label?this.setAttribute("aria-label",this.label):this.removeAttribute("aria-label"),this.orientation==="vertical"?this.setAttribute("aria-orientation","vertical"):this.removeAttribute("aria-orientation")}firstUpdated(t){super.firstUpdated(t),this.emit("btu-button-group-ready")}onFindRegistration(){return{selectors:".btu-button",callback:t=>{const e=t;if(!this.contains(e))return;const i=e.closest("btu-icon-button, btu-dropdown");i&&this.contains(i)?this.syncChild(i):this.syncChild(e),this.syncRovingTabindex()}}}updated(t){(t.has("size")||t.has("disabled")||t.has("selection")||t.has("value"))&&this.syncAllChildren(),(t.has("name")||t.has("value")||t.has("selection"))&&this.syncHiddenInputs(),t.has("selection")&&this.syncRovingTabindex()}syncChild(t){g.has(t.tagName)?(t.setAttribute("size",this.size),this.disabled?t.setAttribute("disabled",""):t.removeAttribute("disabled"),c.has(t.tagName)&&this.syncSelection(t)):t.classList.contains("btu-button")&&(t.setAttribute("type","button"),this.disabled?(t.setAttribute("disabled",""),t.setAttribute("aria-disabled","true")):(t.removeAttribute("disabled"),t.removeAttribute("aria-disabled")),this.syncSelection(t))}syncSelection(t){const e=c.has(t.tagName)?t.querySelector("button"):t;if(!e)return;if(this.selection==="none"){e.removeAttribute("aria-pressed");return}const i=this.resolveButtonValue(t),s=i!==""&&this.selectedValues.includes(i);e.setAttribute("aria-pressed",String(s))}syncAllChildren(){for(const t of Array.from(this.children))t instanceof HTMLElement&&this.syncChild(t);this.syncAllSelected()}syncAllSelected(){if(this.selection==="none"||!this.value){this.removeAttribute("data-all-selected");return}const t=Array.from(this.querySelectorAll(".btu-button[aria-pressed]"));if(t.length===0){this.removeAttribute("data-all-selected");return}t.every(i=>i.getAttribute("aria-pressed")==="true")?this.setAttribute("data-all-selected",""):this.removeAttribute("data-all-selected")}syncRovingTabindex(){const t=this._getRovingTargets();if(t.length===0)return;let e=0;if(this.selection==="single"&&this.value){const i=t.findIndex(s=>{const n=s.closest("btu-icon-button")??s;return this.resolveButtonValue(n)===this.value});i>=0&&(e=i)}this._rovingFocus(e,!1)}get selectedValues(){return this.value?this.value.split(",").filter(Boolean):[]}resolveButtonValue(t){if(t.hasAttribute("value"))return t.getAttribute("value")??"";const e=t.textContent?.trim()??"";return!e&&this.selection!=="none"&&console.warn("[btu-button-group] Button has no resolvable value. Add a value attribute.",t),e}resolveGroupItem(t){const e=t.closest("btu-icon-button");if(e&&this.contains(e))return e;const i=t.closest(".btu-button");return i&&this.contains(i)?i:null}syncHiddenInputs(){for(const t of Array.from(this.querySelectorAll('input[type="hidden"][data-btu-form]')))t.remove();if(!(!this.name||this.selection==="none"||!this.value))for(const t of this.selectedValues){const e=document.createElement("input");e.type="hidden",e.name=this.name,e.value=t,e.setAttribute("data-btu-form",""),this.appendChild(e)}}setSelection(t){this.value=t,this.emit("btu-button-group-change",{value:this.value})}handleClick(t){if(this.selection==="none"||this.disabled)return;const e=t.target;if(!(e instanceof Element))return;const i=this.resolveGroupItem(e);if(!i||i.hasAttribute("disabled"))return;const s=this.resolveButtonValue(i);if(s)if(this.selection==="single")this.setSelection(this.value===s?"":s);else{const n=this.selectedValues,l=n.indexOf(s);l>=0?n.splice(l,1):n.push(s),this.setSelection(n.join(","))}}handleKeyDown(t){if(this.selection==="none")return;const e=i=>{t.preventDefault(),i(),this.selection==="single"&&this.activateFocusedButton()};switch(t.key){case"ArrowRight":case"ArrowDown":e(()=>this._rovingNext());break;case"ArrowLeft":case"ArrowUp":e(()=>this._rovingPrev());break;case"Home":e(()=>this._rovingFirst());break;case"End":e(()=>this._rovingLast());break;case" ":case"Enter":this.selection==="multiple"&&(t.preventDefault(),this._getRovingTargets()[this._rovingCurrentIndex()]?.click());break}}activateFocusedButton(){const t=this._getRovingTargets()[this._rovingCurrentIndex()];if(!t)return;const e=t.closest("btu-icon-button")??t;if(e.hasAttribute("disabled"))return;const i=this.resolveButtonValue(e);i&&this.setSelection(i)}syncStates(){const t={"btu-connected":this.variant==="connected","btu-spaced":this.variant==="spaced","btu-horizontal":this.orientation==="horizontal","btu-vertical":this.orientation==="vertical","btu-disabled":this.disabled};for(const[e,i]of Object.entries(t))i?this.states.add(e):this.states.delete(e)}render(){return h``}}a([o({type:String})],r.prototype,"label");a([o({type:String,reflect:!0})],r.prototype,"orientation");a([o({type:String,reflect:!0})],r.prototype,"variant");a([o({type:String,reflect:!0})],r.prototype,"size");a([o({type:Boolean})],r.prototype,"disabled");a([o({type:String,reflect:!0})],r.prototype,"selection");a([o({type:String,reflect:!0})],r.prototype,"value");a([o({type:String})],r.prototype,"name");customElements.get("btu-button-group")||customElements.define("btu-button-group",r);
|
package/dist/storybook/assets/{ButtonGroup.stories-CerE_0AC.js → ButtonGroup.stories-VhnKPP1n.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as k,x as e}from"./iframe-
|
|
1
|
+
import{g as k,x as e}from"./iframe-DlBK9Drk.js";import{o}from"./style-map-DE4G47KD.js";import"./ButtonGroup-CoLI5nGO.js";import"./DropdownMenu-B-LvOIGj.js";import"./IconButton-Di5Rgs7F.js";import"./Icon-CWyJRQf7.js";import"./preload-helper-PPVm8Dsz.js";import"./property-Bmq4RTSP.js";import"./ComponentStatesMixin-hUqOL2aW.js";import"./ReadyMixin-CvX_eidU.js";import"./OnFindMixin-oL1bvTFj.js";import"./onFind-Ci35eu2y.js";import"./RovingTabindexMixin-9z8lwaM9.js";import"./aria-D5THOgos.js";import"./TooltipMixin-CVKslCDt.js";import"./Badge-bWrvpEgX.js";import"./if-defined-DerKRcyC.js";const{events:w,args:f,argTypes:n}=k("btu-button-group");function u(t){const a={};return t.customGap&&(a["--button-group-gap"]=t.customGap),t.customBorderRadius&&(a["--button-group-border-radius"]=t.customBorderRadius),t.customBorderColor&&(a["--button-group-border-color"]=t.customBorderColor),a}const G={title:"Components/Button Group",component:"btu-button-group",tags:["autodocs"],parameters:{docs:{subtitle:"btu-button-group",description:{component:`
|
|
2
2
|
A semantic container for grouping related buttons together.
|
|
3
3
|
|
|
4
4
|
<h3>When to use:</h3>
|
|
@@ -97,7 +97,7 @@ A semantic container for grouping related buttons together.
|
|
|
97
97
|
<button class="btu-button btu-button-outline btu-button-gray" value="grid">Grid</button>
|
|
98
98
|
<button class="btu-button btu-button-outline btu-button-gray" value="table">Table</button>
|
|
99
99
|
</btu-button-group>
|
|
100
|
-
`,parameters:{docs:{description:{story:"The `value` attribute can be set declaratively in HTML to pre-select a button on first render."}}}},
|
|
100
|
+
`,parameters:{docs:{description:{story:"The `value` attribute can be set declaratively in HTML to pre-select a button on first render."}}}},m={args:{label:"Toolbar",selection:"multiple",value:""},render:t=>e`
|
|
101
101
|
<btu-button-group
|
|
102
102
|
label=${t.label}
|
|
103
103
|
selection=${t.selection}
|
|
@@ -121,7 +121,7 @@ A semantic container for grouping related buttons together.
|
|
|
121
121
|
aria-label="Strikethrough"
|
|
122
122
|
></btu-icon-button>
|
|
123
123
|
</btu-button-group>
|
|
124
|
-
`,parameters:{docs:{description:{story:"Icon-only buttons using `btu-icon-button`. Accessible labels are provided via `aria-label`."}}}},
|
|
124
|
+
`,parameters:{docs:{description:{story:"Icon-only buttons using `btu-icon-button`. Accessible labels are provided via `aria-label`."}}}},y={render:()=>e`
|
|
125
125
|
<btu-button-group label="Actions" variant="connected">
|
|
126
126
|
<button class="btu-button btu-button-outline btu-button-success" value="save">Save</button>
|
|
127
127
|
<button class="btu-button-secondary btu-button btu-button-outline" value="preview">Preview</button>
|
|
@@ -399,7 +399,7 @@ A semantic container for grouping related buttons together.
|
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
401
|
}
|
|
402
|
-
}`,...g.parameters?.docs?.source}}};
|
|
402
|
+
}`,...g.parameters?.docs?.source}}};m.parameters={...m.parameters,docs:{...m.parameters?.docs,source:{originalSource:`{
|
|
403
403
|
args: {
|
|
404
404
|
label: 'Toolbar',
|
|
405
405
|
selection: 'multiple',
|
|
@@ -437,7 +437,7 @@ A semantic container for grouping related buttons together.
|
|
|
437
437
|
}
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
}`,...
|
|
440
|
+
}`,...m.parameters?.docs?.source}}};y.parameters={...y.parameters,docs:{...y.parameters?.docs,source:{originalSource:`{
|
|
441
441
|
render: () => html\`
|
|
442
442
|
<btu-button-group label="Actions" variant="connected">
|
|
443
443
|
<button class="btu-button btu-button-outline btu-button-success" value="save">Save</button>
|
|
@@ -458,7 +458,7 @@ A semantic container for grouping related buttons together.
|
|
|
458
458
|
}
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
}`,...
|
|
461
|
+
}`,...y.parameters?.docs?.source}}};v.parameters={...v.parameters,docs:{...v.parameters?.docs,source:{originalSource:`{
|
|
462
462
|
render: () => html\`
|
|
463
463
|
<div
|
|
464
464
|
style="display: flex; flex-direction: column; height: 400px; width: min-content; border: 1px solid oklch(var(--btu-theme-gray-200)); border-radius: 0.5rem; padding: 0.25rem;"
|
|
@@ -585,4 +585,4 @@ A semantic container for grouping related buttons together.
|
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
587
|
}
|
|
588
|
-
}`,...h.parameters?.docs?.source}}};const
|
|
588
|
+
}`,...h.parameters?.docs?.source}}};const H=["Default","Spaced","VerticalConnected","VerticalSpaced","Sizes","Disabled","SingleSelection","MultipleSelection","PreSelectedValue","WithIcons","MixedContent","VerticalSidebar","RTEToolbar"];export{r as Default,c as Disabled,y as MixedContent,p as MultipleSelection,g as PreSelectedValue,h as RTEToolbar,d as SingleSelection,i as Sizes,b as Spaced,l as VerticalConnected,v as VerticalSidebar,s as VerticalSpaced,m as WithIcons,H as __namedExportsOrder,G as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
btu-card:not(:defined)>[slot],btu-card:not(:defined)>img,btu-card:not(:defined)>btu-badge,btu-card:not(:defined)>btu-icon{display:none}
|
|
@@ -1,4 +1,35 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{E as s,x as a,i as w,g as C}from"./iframe-DlBK9Drk.js";import{o as S}from"./style-map-DE4G47KD.js";import"./Avatar-C6Li1sPI.js";import"./AvatarGroup-DgxRTZBe.js";import"./Badge-bWrvpEgX.js";import{n as c}from"./property-Bmq4RTSP.js";import{r as k}from"./state-DVIUS0Gf.js";import{E as _,R as A}from"./ReadyMixin-CvX_eidU.js";import{O as z}from"./OnFindMixin-oL1bvTFj.js";import"./Checkbox-BC1T_KxW.js";import"./Icon-CWyJRQf7.js";import"./IconButton-Di5Rgs7F.js";import"./preload-helper-PPVm8Dsz.js";import"./TooltipMixin-CVKslCDt.js";import"./onFind-Ci35eu2y.js";import"./if-defined-DerKRcyC.js";var F=Object.defineProperty,o=(e,t,i,d)=>{for(var r=void 0,v=e.length-1,f;v>=0;v--)(f=e[v])&&(r=f(t,i,r)||r);return r&&F(t,i,r),r};const x=e=>typeof e=="number"&&Number.isInteger(e)&&e>=1&&e<=6;class n extends _(z(A(w))){constructor(){super(...arguments),this.heading="",this.headingLevel=2,this.compact=!1,this.disabled=!1,this._initialClasses=[],this._initialClassesCaptured=!1,this._checked=!1,this._dropped=!1,this._draggable=!1,this._hasImage=!1,this._imageFailed=!1,this._hasBadge=!1,this._hasIcon=!1,this._hasAction=!1,this._hasSecondaryAction=!1,this._hasFields=!1,this._linkFocused=!1,this.handleCheckboxChange=t=>{t.target?.closest(".btu-card-action, .btu-card-secondary-action")&&(this._checked=t.detail.checked,this.requestUpdate())},this.handleLinkFocus=t=>{const i=t.target.matches(":focus-visible");i!==this._linkFocused&&(this._linkFocused=i,this.requestUpdate())},this.handleLinkBlur=()=>{this._linkFocused&&(this._linkFocused=!1,this.requestUpdate())},this.handleImageError=t=>{t.target?.remove(),this._imageFailed=!0,this.requestUpdate()}}get mode(){return this.compact?"compact":this._hasImage||this._hasIcon?"media":"text"}get _showTopRow(){return this.mode==="compact"?!1:this.mode==="text"?this._hasBadge:this._hasBadge||this._hasAction}connectedCallback(){super.connectedCallback(),this._initialClassesCaptured||(this.className&&(this._initialClasses=this.className.split(" ").filter(t=>t.trim())),this._initialClassesCaptured=!0),this.hasUpdated||(this._hasImage=!!this.querySelector(":scope > img"),this._hasBadge=!!this.querySelector(":scope > btu-badge"),this._hasIcon=!!this.querySelector(":scope > btu-icon"),this._hasAction=!!this.querySelector(':scope > [slot="action"]'),this._hasSecondaryAction=!!this.querySelector(':scope > [slot="secondary-action"]'),this._hasFields=!!this.querySelector(':scope > [slot="fields"]'),this._checked=!!this.querySelector(":scope > btu-checkbox[checked]")),this.addEventListener("btu-checkbox-change",this.handleCheckboxChange)}createRenderRoot(){return this}willUpdate(t){t.has("headingLevel")&&!x(this.headingLevel)&&console.warn(`[btu-card] Invalid heading-level="${this.headingLevel}". Valid values are 1-6. Falling back to default (2).`),this.href&&!this.disabled&&!this.heading&&!this.description&&console.warn("[btu-card] href is set without a heading or description — the link will have no accessible name.");const i=this.mode,d=!!(this.href&&!this.disabled),r=[...this._initialClasses,"btu-card",i==="media"&&"btu-card-media",i==="text"&&"btu-card-text",i==="compact"&&"btu-card-compact",this._checked&&"btu-card-selected",this._dropped&&"btu-card-dropped",this.disabled&&"btu-card-disabled",this._draggable&&"btu-card-draggable",d&&"btu-card-linked",d&&this._linkFocused&&"btu-card-link-focused",this._showTopRow&&"btu-card-has-top",i!=="compact"&&this._hasFields&&"btu-card-has-fields",i!=="compact"&&this._hasSecondaryAction&&"btu-card-has-secondary-action"];this.className=r.filter(Boolean).join(" ")}firstUpdated(t){super.firstUpdated(t),this.emit("btu-card-ready")}onFindRegistration(){return{selectors:":scope > [slot], :scope > img, :scope > btu-badge, :scope > btu-icon",callback:t=>this.redistributeChild(t)}}updated(){this.placeMovableChildren()}redistributeChild(t){const i=t.getAttribute("slot");if(i==="action"){this._actionEl=t,this.wireSelectionCheckbox(t),this._hasAction||(this._hasAction=!0,this.requestUpdate()),this.placeMovableChildren();return}if(i==="secondary-action"){this._secondaryActionEl=t,this.wireSelectionCheckbox(t),this._hasSecondaryAction||(this._hasSecondaryAction=!0,this.requestUpdate()),this.placeMovableChildren();return}if(i==="fields"){this.querySelector(".btu-card-fields")?.appendChild(t),this._hasFields||(this._hasFields=!0,this.requestUpdate());return}if(t.tagName==="IMG"){this._hasImage=!0,this._imageFailed=!1,t.addEventListener("error",this.handleImageError,{once:!0}),this.querySelector(".btu-card-image")?.appendChild(t),this.requestUpdate();return}if(t.tagName==="BTU-ICON"){this._iconEl=t,this._hasIcon||(this._hasIcon=!0,this.requestUpdate()),this.placeMovableChildren();return}t.tagName==="BTU-BADGE"&&(this._badgeEl=t,this._hasBadge||(this._hasBadge=!0,this.requestUpdate()),this.placeMovableChildren())}wireSelectionCheckbox(t){t.tagName==="BTU-CHECKBOX"&&(this._checked=t.hasAttribute("checked"),!t.hasAttribute("label")&&this.heading&&t.setAttribute("label",this.heading),this.requestUpdate())}placeMovableChildren(){this.placeChild(this._badgeEl,".btu-card-badge"),this.placeChild(this._iconEl,this.mode==="compact"?".btu-card-icon-container":".btu-card-image-fallback"),this.placeChild(this._actionEl,".btu-card-action"),this.placeChild(this._secondaryActionEl,".btu-card-secondary-action")}placeChild(t,i){if(!t)return;const d=this.querySelector(i);d&&t.parentElement!==d&&d.appendChild(t)}renderTop(){return this._showTopRow?a`
|
|
2
|
+
<div class="btu-card-top">
|
|
3
|
+
<div class="btu-card-badge"></div>
|
|
4
|
+
${this.renderAction()}
|
|
5
|
+
</div>
|
|
6
|
+
`:s}renderImage(){if(this.mode!=="media")return s;const t=!this._hasImage||this._imageFailed;return a`
|
|
7
|
+
<div class="btu-card-image">
|
|
8
|
+
${t?a`<div class="btu-card-image-fallback">
|
|
9
|
+
${this._hasIcon?s:a`<btu-icon symbol="file-text"></btu-icon>`}
|
|
10
|
+
</div>`:s}
|
|
11
|
+
</div>
|
|
12
|
+
`}renderIconContainer(){return this.mode!=="compact"||!this._hasIcon?s:a`<div class="btu-card-icon-container"></div>`}renderAction(){return a`<div class="btu-card-action"></div>`}renderSecondaryAction(){return a`<div class="btu-card-secondary-action"></div>`}renderFields(){return a`<div class="btu-card-fields"></div>`}renderHeading(){if(!this.heading)return s;switch(x(this.headingLevel)?this.headingLevel:2){case 1:return a`<h1 class="btu-card-title">${this.heading}</h1>`;case 2:return a`<h2 class="btu-card-title">${this.heading}</h2>`;case 3:return a`<h3 class="btu-card-title">${this.heading}</h3>`;case 4:return a`<h4 class="btu-card-title">${this.heading}</h4>`;case 5:return a`<h5 class="btu-card-title">${this.heading}</h5>`;case 6:return a`<h6 class="btu-card-title">${this.heading}</h6>`}}renderContent(){return a`
|
|
13
|
+
<div class="btu-card-content">
|
|
14
|
+
${this.mode==="compact"?this.renderIconContainer():s}
|
|
15
|
+
${this.mode==="compact"?this.renderAction():s}
|
|
16
|
+
${this.heading?a`<div class="btu-card-title-row">
|
|
17
|
+
${this.renderHeading()} ${this.mode==="compact"?s:this.renderSecondaryAction()}
|
|
18
|
+
${this.mode==="text"&&!this._hasBadge?this.renderAction():s}
|
|
19
|
+
</div>`:s}
|
|
20
|
+
${this.description?a`<div class="btu-card-description">${this.description}</div>`:s}
|
|
21
|
+
${this.mode==="compact"?s:this.renderFields()}
|
|
22
|
+
</div>
|
|
23
|
+
`}render(){return a`
|
|
24
|
+
${this.href&&!this.disabled?a`<a
|
|
25
|
+
href=${this.href}
|
|
26
|
+
class="btu-card-link"
|
|
27
|
+
aria-label=${this.heading||this.description||s}
|
|
28
|
+
@focus=${this.handleLinkFocus}
|
|
29
|
+
@blur=${this.handleLinkBlur}
|
|
30
|
+
></a>`:s}
|
|
31
|
+
${this.renderImage()} ${this.renderTop()} ${this.renderContent()}
|
|
32
|
+
`}}o([c({type:String})],n.prototype,"heading");o([c({type:Number,attribute:"heading-level"})],n.prototype,"headingLevel");o([c({type:String})],n.prototype,"description");o([c({type:Boolean})],n.prototype,"compact");o([c({type:Boolean})],n.prototype,"disabled");o([c({type:String})],n.prototype,"href");o([k()],n.prototype,"_dropped");o([k()],n.prototype,"_draggable");customElements.get("btu-card")||customElements.define("btu-card",n);const{events:T,args:$,argTypes:y}=C("btu-card"),I=[1,2,3,4,5,6],G={title:"Components/Card",component:"btu-card",tags:["autodocs"],parameters:{docs:{subtitle:"A flexible content container for presenting and organizing information",description:{component:`
|
|
2
33
|
<h3>When to use:</h3>
|
|
3
34
|
<ul>
|
|
4
35
|
<li>To present content items in a browsable grid or list — search results, board views, quick start cards</li>
|
|
@@ -9,20 +40,20 @@ import{g as u,x as e}from"./iframe-B9buZjP7.js";import{o as p}from"./style-map-q
|
|
|
9
40
|
<ul>
|
|
10
41
|
<li>Cards are focusable when they have an href set (unless disabled)</li>
|
|
11
42
|
</ul>
|
|
12
|
-
`}},actions:{handles:
|
|
43
|
+
`}},actions:{handles:T},controls:{expanded:!0}},args:{...$,compact:!1,heading:"Content heading",description:"Content Type · Summary Field · Summary Field","heading-level":2},argTypes:{...y,"--card-min-width":{table:{disable:!0}},"--card-background":{table:{disable:!0}},"--card-border":{table:{disable:!0}},"--card-radius":{table:{disable:!0}},"--card-img-ratio":{table:{disable:!0}},"--card-img-fit":{table:{disable:!0}},"--card-icon-background":{table:{disable:!0}},compact:{...y.compact,control:{type:"boolean"}},"heading-level":{...y["heading-level"],control:{type:"select"},options:I,description:"Heading level (1-6) for the card heading element. Drives the semantic h1–h6 tag (default: 2)."},customMinWidth:{name:"--card-min-width",control:{type:"text"},description:"Minimum width of the card (default: 160px)",table:{category:"CSS Properties"}},customBg:{name:"--card-background",control:{type:"color"},description:"Background color",table:{category:"CSS Properties"}},customBorder:{name:"--card-border",control:{type:"text"},description:"Border shorthand (default: 1px solid gray-200)",table:{category:"CSS Properties"}},customRadius:{name:"--card-radius",control:{type:"text"},description:"Corner rounding (default: 8px)",table:{category:"CSS Properties"}},customImgRatio:{name:"--card-img-ratio",control:{type:"text"},description:"Fixed aspect ratio for the thumbnail when an `<img>` child is present (default: 16 / 9)",table:{category:"CSS Properties"}},customImgFit:{name:"--card-img-fit",control:{type:"select"},options:["contain","cover"],description:"Object-fit mode for the `<img>` child thumbnail (default: contain)",table:{category:"CSS Properties"}},customIconBg:{name:"--card-icon-background",control:{type:"color"},description:"Background color behind the `<btu-icon>` child (compact card and media-image fallback) (default: gray-100)",table:{category:"CSS Properties"}}},render:e=>{const t={};return e.customMinWidth&&(t["--card-min-width"]=e.customMinWidth),e.customBg&&(t["--card-background"]=e.customBg),e.customBorder&&(t["--card-border"]=e.customBorder),e.customRadius&&(t["--card-radius"]=e.customRadius),e.customImgRatio&&(t["--card-img-ratio"]=e.customImgRatio),e.customImgFit&&(t["--card-img-fit"]=e.customImgFit),e.customIconBg&&(t["--card-icon-background"]=e.customIconBg),a`
|
|
13
44
|
<div style="max-width: 262px;">
|
|
14
45
|
<btu-card
|
|
15
|
-
?compact="${
|
|
16
|
-
heading="${
|
|
17
|
-
heading-level="${
|
|
18
|
-
description="${
|
|
19
|
-
?disabled="${
|
|
20
|
-
href="${
|
|
21
|
-
style=${
|
|
46
|
+
?compact="${e.compact}"
|
|
47
|
+
heading="${e.heading}"
|
|
48
|
+
heading-level="${e["heading-level"]}"
|
|
49
|
+
description="${e.description}"
|
|
50
|
+
?disabled="${e.disabled}"
|
|
51
|
+
href="${e.href}"
|
|
52
|
+
style=${S(t)}
|
|
22
53
|
>
|
|
23
54
|
</btu-card>
|
|
24
55
|
</div>
|
|
25
|
-
`}},
|
|
56
|
+
`}},l={args:{}},u={render:()=>a`
|
|
26
57
|
<div style="display: flex; gap: 1rem; flex-wrap: wrap; align-items: start;">
|
|
27
58
|
<div style="width: 262px;">
|
|
28
59
|
<btu-card heading="Media Card" description="Content Type · Summary Field · Summary Field">
|
|
@@ -49,7 +80,7 @@ import{g as u,x as e}from"./iframe-B9buZjP7.js";import{o as p}from"./style-map-q
|
|
|
49
80
|
</btu-card>
|
|
50
81
|
</div>
|
|
51
82
|
</div>
|
|
52
|
-
`,parameters:{docs:{description:{story:'The layout is driven by composition. This way the implementer has control over the inner components, such as badge.\n\n- A card with an `<img>` direct child renders the image above the text content.\n- A `<btu-icon>` direct child shows in the image area — as the fallback when an image fails to load, or as the only media when no `<img>` is provided (see "Icon only"). Without a composed icon, a failed image defaults to a `file-text` icon.\n- A `<btu-badge>` direct child renders a status badge in the top-left corner.\n'}}}},
|
|
83
|
+
`,parameters:{docs:{description:{story:'The layout is driven by composition. This way the implementer has control over the inner components, such as badge.\n\n- A card with an `<img>` direct child renders the image above the text content.\n- A `<btu-icon>` direct child shows in the image area — as the fallback when an image fails to load, or as the only media when no `<img>` is provided (see "Icon only"). Without a composed icon, a failed image defaults to a `file-text` icon.\n- A `<btu-badge>` direct child renders a status badge in the top-left corner.\n'}}}},h={render:()=>{const e=t=>{t.stopPropagation(),alert("Action clicked — navigation prevented")};return a`
|
|
53
84
|
<div style="display: flex; gap: 1rem; flex-wrap: wrap; align-items: start;">
|
|
54
85
|
<div style="width: 262px;">
|
|
55
86
|
<btu-card
|
|
@@ -66,7 +97,7 @@ import{g as u,x as e}from"./iframe-B9buZjP7.js";import{o as p}from"./style-map-q
|
|
|
66
97
|
size="sm"
|
|
67
98
|
type="secondary-clear"
|
|
68
99
|
aria-label="Quick view"
|
|
69
|
-
@click=${
|
|
100
|
+
@click=${e}
|
|
70
101
|
></btu-icon-button>
|
|
71
102
|
</btu-card>
|
|
72
103
|
</div>
|
|
@@ -83,7 +114,7 @@ import{g as u,x as e}from"./iframe-B9buZjP7.js";import{o as p}from"./style-map-q
|
|
|
83
114
|
size="sm"
|
|
84
115
|
type="secondary-clear"
|
|
85
116
|
aria-label="Favorite"
|
|
86
|
-
@click=${
|
|
117
|
+
@click=${e}
|
|
87
118
|
></btu-icon-button>
|
|
88
119
|
<btu-icon-button
|
|
89
120
|
slot="secondary-action"
|
|
@@ -91,7 +122,7 @@ import{g as u,x as e}from"./iframe-B9buZjP7.js";import{o as p}from"./style-map-q
|
|
|
91
122
|
size="sm"
|
|
92
123
|
type="secondary-clear"
|
|
93
124
|
aria-label="Quick view"
|
|
94
|
-
@click=${
|
|
125
|
+
@click=${e}
|
|
95
126
|
></btu-icon-button>
|
|
96
127
|
</btu-card>
|
|
97
128
|
</div>
|
|
@@ -108,12 +139,12 @@ import{g as u,x as e}from"./iframe-B9buZjP7.js";import{o as p}from"./style-map-q
|
|
|
108
139
|
size="sm"
|
|
109
140
|
type="secondary-clear"
|
|
110
141
|
aria-label="Quick view"
|
|
111
|
-
@click=${
|
|
142
|
+
@click=${e}
|
|
112
143
|
></btu-icon-button>
|
|
113
144
|
</btu-card>
|
|
114
145
|
</div>
|
|
115
146
|
</div>
|
|
116
|
-
`},parameters:{docs:{description:{story:'Cards expose two action positions, both pseudo-slots:\n\n- `slot="action"` — the top-right corner.\n- `slot="secondary-action"` — next to the title.\n\nA `<btu-checkbox>` action stays visible, while a `<btu-icon-button>` action is revealed on hover/focus.\n\nThese cards also have `href` set to demonstrate that clicking anywhere on the card navigates to the link, while clicking an action triggers its own handler without navigating. Tabbing focuses the card first, then the actions.'}}}},
|
|
147
|
+
`},parameters:{docs:{description:{story:'Cards expose two action positions, both pseudo-slots:\n\n- `slot="action"` — the top-right corner.\n- `slot="secondary-action"` — next to the title.\n\nA `<btu-checkbox>` action stays visible, while a `<btu-icon-button>` action is revealed on hover/focus.\n\nThese cards also have `href` set to demonstrate that clicking anywhere on the card navigates to the link, while clicking an action triggers its own handler without navigating. Tabbing focuses the card first, then the actions.'}}}},p={render:()=>a`
|
|
117
148
|
<div style="display: flex; gap: 1rem; flex-wrap: wrap; align-items: start;">
|
|
118
149
|
<div style="width: 262px;">
|
|
119
150
|
<btu-card heading="Content title" description="Content Type · Summary Field · Summary Field">
|
|
@@ -174,7 +205,7 @@ import{g as u,x as e}from"./iframe-B9buZjP7.js";import{o as p}from"./style-map-q
|
|
|
174
205
|
</btu-card>
|
|
175
206
|
</div>
|
|
176
207
|
</div>
|
|
177
|
-
`,parameters:{docs:{description:{story:'Cards support a `slot="fields"` pseudo-slot for structured metadata. These cards show content type, last updated date, and a viewers section with an avatar group.'}}}},
|
|
208
|
+
`,parameters:{docs:{description:{story:'Cards support a `slot="fields"` pseudo-slot for structured metadata. These cards show content type, last updated date, and a viewers section with an avatar group.'}}}},b={render:()=>a`
|
|
178
209
|
<div style="display: flex; gap: 1rem; flex-wrap: wrap; align-items: start;">
|
|
179
210
|
<div style="width: 262px;">
|
|
180
211
|
<btu-card compact heading="Quick Action" description="Quick start tile">
|
|
@@ -191,7 +222,7 @@ import{g as u,x as e}from"./iframe-B9buZjP7.js";import{o as p}from"./style-map-q
|
|
|
191
222
|
</btu-card>
|
|
192
223
|
</div>
|
|
193
224
|
</div>
|
|
194
|
-
`,parameters:{docs:{description:{story:"Set the `compact` attribute for a quick-start tile with a featured icon. Provide the featured icon as a `<btu-icon>` direct child. Badge, image, fields, and secondary-action slots are ignored in this case. Only the top-right `action` slot is available."}}}},
|
|
225
|
+
`,parameters:{docs:{description:{story:"Set the `compact` attribute for a quick-start tile with a featured icon. Provide the featured icon as a `<btu-icon>` direct child. Badge, image, fields, and secondary-action slots are ignored in this case. Only the top-right `action` slot is available."}}}},m={render:()=>a`
|
|
195
226
|
<div style="display: flex; flex-direction: column; gap: 1.5rem;">
|
|
196
227
|
<div>
|
|
197
228
|
<p
|
|
@@ -242,17 +273,17 @@ import{g as u,x as e}from"./iframe-B9buZjP7.js";import{o as p}from"./style-map-q
|
|
|
242
273
|
</div>
|
|
243
274
|
</div>
|
|
244
275
|
</div>
|
|
245
|
-
`,parameters:{docs:{description:{story:"By default images use `object-fit: contain` so the full image is always visible. Set `--card-img-fit: cover` to fill the thumbnail area by cropping instead."}}}},
|
|
276
|
+
`,parameters:{docs:{description:{story:"By default images use `object-fit: contain` so the full image is always visible. Set `--card-img-fit: cover` to fill the thumbnail area by cropping instead."}}}},g={render:()=>a`
|
|
246
277
|
<div style="display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));">
|
|
247
|
-
${[1,2,3,4,5].map(
|
|
248
|
-
<btu-card heading="Card ${
|
|
278
|
+
${[1,2,3,4,5].map(e=>a`
|
|
279
|
+
<btu-card heading="Card ${e}" description="Content Type · Summary Field">
|
|
249
280
|
<btu-badge variant="info" size="sm">Content Status</btu-badge>
|
|
250
281
|
</btu-card>
|
|
251
282
|
`)}
|
|
252
283
|
</div>
|
|
253
|
-
`,parameters:{docs:{description:{story:"Cards are `width: 100%` by default and rely on the parent layout to control their size. A CSS grid with `repeat(auto-fill, minmax(220px, 1fr))` is a common responsive pattern."}}}};
|
|
284
|
+
`,parameters:{docs:{description:{story:"Cards are `width: 100%` by default and rely on the parent layout to control their size. A CSS grid with `repeat(auto-fill, minmax(220px, 1fr))` is a common responsive pattern."}}}};l.parameters={...l.parameters,docs:{...l.parameters?.docs,source:{originalSource:`{
|
|
254
285
|
args: {}
|
|
255
|
-
}`,...
|
|
286
|
+
}`,...l.parameters?.docs?.source}}};u.parameters={...u.parameters,docs:{...u.parameters?.docs,source:{originalSource:`{
|
|
256
287
|
render: () => html\`
|
|
257
288
|
<div style="display: flex; gap: 1rem; flex-wrap: wrap; align-items: start;">
|
|
258
289
|
<div style="width: 262px;">
|
|
@@ -293,7 +324,7 @@ import{g as u,x as e}from"./iframe-B9buZjP7.js";import{o as p}from"./style-map-q
|
|
|
293
324
|
}
|
|
294
325
|
}
|
|
295
326
|
}
|
|
296
|
-
}`,...
|
|
327
|
+
}`,...u.parameters?.docs?.source}}};h.parameters={...h.parameters,docs:{...h.parameters?.docs,source:{originalSource:`{
|
|
297
328
|
render: () => {
|
|
298
329
|
const handleActionClick = (e: Event) => {
|
|
299
330
|
e.stopPropagation();
|
|
@@ -380,7 +411,7 @@ These cards also have \\\`href\\\` set to demonstrate that clicking anywhere on
|
|
|
380
411
|
}
|
|
381
412
|
}
|
|
382
413
|
}
|
|
383
|
-
}`,...
|
|
414
|
+
}`,...h.parameters?.docs?.source}}};p.parameters={...p.parameters,docs:{...p.parameters?.docs,source:{originalSource:`{
|
|
384
415
|
render: () => html\`
|
|
385
416
|
<div style="display: flex; gap: 1rem; flex-wrap: wrap; align-items: start;">
|
|
386
417
|
<div style="width: 262px;">
|
|
@@ -450,7 +481,7 @@ These cards also have \\\`href\\\` set to demonstrate that clicking anywhere on
|
|
|
450
481
|
}
|
|
451
482
|
}
|
|
452
483
|
}
|
|
453
|
-
}`,...
|
|
484
|
+
}`,...p.parameters?.docs?.source}}};b.parameters={...b.parameters,docs:{...b.parameters?.docs,source:{originalSource:`{
|
|
454
485
|
render: () => html\`
|
|
455
486
|
<div style="display: flex; gap: 1rem; flex-wrap: wrap; align-items: start;">
|
|
456
487
|
<div style="width: 262px;">
|
|
@@ -476,7 +507,7 @@ These cards also have \\\`href\\\` set to demonstrate that clicking anywhere on
|
|
|
476
507
|
}
|
|
477
508
|
}
|
|
478
509
|
}
|
|
479
|
-
}`,...
|
|
510
|
+
}`,...b.parameters?.docs?.source}}};m.parameters={...m.parameters,docs:{...m.parameters?.docs,source:{originalSource:`{
|
|
480
511
|
render: () => html\`
|
|
481
512
|
<div style="display: flex; flex-direction: column; gap: 1.5rem;">
|
|
482
513
|
<div>
|
|
@@ -536,7 +567,7 @@ These cards also have \\\`href\\\` set to demonstrate that clicking anywhere on
|
|
|
536
567
|
}
|
|
537
568
|
}
|
|
538
569
|
}
|
|
539
|
-
}`,...
|
|
570
|
+
}`,...m.parameters?.docs?.source}}};g.parameters={...g.parameters,docs:{...g.parameters?.docs,source:{originalSource:`{
|
|
540
571
|
render: () => html\`
|
|
541
572
|
<div style="display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));">
|
|
542
573
|
\${[1, 2, 3, 4, 5].map(i => html\`
|
|
@@ -553,4 +584,4 @@ These cards also have \\\`href\\\` set to demonstrate that clicking anywhere on
|
|
|
553
584
|
}
|
|
554
585
|
}
|
|
555
586
|
}
|
|
556
|
-
}`,...
|
|
587
|
+
}`,...g.parameters?.docs?.source}}};const H=["Default","Composition","ActionSlots","FieldsSlot","Compact","ImageCropping","Sizing"];export{h as ActionSlots,b as Compact,u as Composition,l as Default,p as FieldsSlot,m as ImageCropping,g as Sizing,H as __namedExportsOrder,G as default};
|
package/dist/storybook/assets/{Celebrate.stories-COS789GX.js → Celebrate.stories-D3NJgYcX.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{x as
|
|
1
|
+
import{x as i}from"./iframe-DlBK9Drk.js";import"./Icon-CWyJRQf7.js";import{b as a}from"./celebrate-KwPoF1K3.js";import{B as r}from"./Button-DE0s-gat.js";import"./preload-helper-PPVm8Dsz.js";import"./property-Bmq4RTSP.js";import"./ReadyMixin-CvX_eidU.js";import"./position-CFNQy3J6.js";const h={title:"Effects/Celebrate",tags:["autodocs"],parameters:{docs:{subtitle:"A sparkle burst effect for delightful micro-interactions",description:{component:`
|
|
2
2
|
A celebratory sparkle animation that fires from a given position. Colored circles, ellipses, and sparkle particles burst outward using CSS offset-path animations.
|
|
3
3
|
|
|
4
4
|
### Usage
|
|
@@ -16,8 +16,8 @@ el.dispatchEvent(new CustomEvent('btu-effect-celebrate', {
|
|
|
16
16
|
bubbles: true, composed: true,
|
|
17
17
|
}))
|
|
18
18
|
\`\`\`
|
|
19
|
-
`}},controls:{expanded:!0}},argTypes:{duration:{control:{type:"range",min:500,max:5e3,step:100},description:"Animation duration (ms)"},size:{control:{type:"range",min:100,max:600,step:50},description:"Size of the sparkle burst area (px)"}},args:{duration:2e3,size:300}},n={render:s=>
|
|
20
|
-
<div @click=${t=>
|
|
19
|
+
`}},controls:{expanded:!0}},argTypes:{duration:{control:{type:"range",min:500,max:5e3,step:100},description:"Animation duration (ms)"},size:{control:{type:"range",min:100,max:600,step:50},description:"Size of the sparkle burst area (px)"}},args:{duration:2e3,size:300}},n={render:s=>i`
|
|
20
|
+
<div @click=${t=>a({position:t,...s})} class="bg-gray-50" style="min-height: 100vh;">
|
|
21
21
|
<div class="flex flex-col gap-8 p-6">
|
|
22
22
|
<div class="flex flex-col gap-2">
|
|
23
23
|
<h2 class="text-2xl font-semibold text-gray-900">Celebrate</h2>
|
|
@@ -34,7 +34,7 @@ el.dispatchEvent(new CustomEvent('btu-effect-celebrate', {
|
|
|
34
34
|
</div>
|
|
35
35
|
</div>
|
|
36
36
|
</div>
|
|
37
|
-
`,parameters:{docs:{description:{story:"Click anywhere to trigger the default sparkle burst animation."}}}},o={args:{duration:2e3,size:300},render:s=>{const e=t=>{t.stopPropagation();const l=t.currentTarget??t.target;
|
|
37
|
+
`,parameters:{docs:{description:{story:"Click anywhere to trigger the default sparkle burst animation."}}}},o={args:{duration:2e3,size:300},render:s=>{const e=t=>{t.stopPropagation();const l=t.currentTarget??t.target;a({position:l,...s})};return i`
|
|
38
38
|
<div class="bg-gray-50" style="min-height: 40vh;">
|
|
39
39
|
<div class="flex flex-col gap-6 p-6">
|
|
40
40
|
<div class="flex flex-col gap-2">
|
|
@@ -181,4 +181,4 @@ el.dispatchEvent(new CustomEvent('btu-effect-celebrate', {
|
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
|
-
}`,...o.parameters?.docs?.source}}};const
|
|
184
|
+
}`,...o.parameters?.docs?.source}}};const x=["Default","OnElement"];export{n as Default,o as OnElement,x as __namedExportsOrder,h as default};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import{i as p,E as o,x as a}from"./iframe-DlBK9Drk.js";import{n as i}from"./property-Bmq4RTSP.js";import{o as n}from"./if-defined-DerKRcyC.js";import{E as u,R as b}from"./ReadyMixin-CvX_eidU.js";import"./Icon-CWyJRQf7.js";var k=Object.defineProperty,s=(h,e,r,m)=>{for(var c=void 0,l=h.length-1,d;l>=0;l--)(d=h[l])&&(c=d(e,r,c)||c);return c&&k(e,r,c),c};class t extends u(b(p)){constructor(){super(...arguments),this.size="sm",this.checked=!1,this.indeterminate=!1,this.disabled=!1,this.invalid=!1,this.required=!1,this.value="on",this._userInitiated=!1,this._initialClasses=[],this._initialClassesCaptured=!1,this._descId=`checkbox-desc-${crypto.randomUUID()}`,this._errorId=`checkbox-error-${crypto.randomUUID()}`,this._handleClick=e=>{this.disabled||e.target.closest(".btu-checkbox-input")||this.renderRoot.querySelector(".btu-checkbox-input")?.click()}}connectedCallback(){super.connectedCallback(),this._initialClassesCaptured||(this.className&&(this._initialClasses=this.className.split(" ").filter(e=>e.trim())),this._initialClassesCaptured=!0),this.addEventListener("click",this._handleClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this._handleClick)}createRenderRoot(){return this}willUpdate(e){super.willUpdate(e);const r=[...this._initialClasses,"btu-checkbox",this.size==="md"&&"btu-checkbox-md",(this.invalid||this.error)&&"btu-checkbox-invalid"];this.className=r.filter(Boolean).join(" ")}firstUpdated(e){super.firstUpdated(e),this.emit("btu-checkbox-ready")}updated(e){super.updated(e);const r=this.renderRoot.querySelector(".btu-checkbox-input");r&&(r.indeterminate=this.indeterminate),this._userInitiated&&(this._userInitiated=!1,e.has("checked")&&this.emit("btu-checkbox-change",{checked:this.checked}))}_onInputChange(e){const r=e.target;this._userInitiated=!0,this.checked=r.checked,this.indeterminate&&(this.indeterminate=!1)}get _describedBy(){const e=[];return this.description&&e.push(this._descId),this.error&&e.push(this._errorId),e.length?e.join(" "):void 0}get _iconSymbol(){return this.indeterminate?"minus":"check"}render(){return a`
|
|
2
|
+
<input
|
|
3
|
+
type="checkbox"
|
|
4
|
+
class="btu-checkbox-input"
|
|
5
|
+
.checked=${this.checked}
|
|
6
|
+
?disabled=${this.disabled}
|
|
7
|
+
?required=${this.required}
|
|
8
|
+
name=${n(this.name)}
|
|
9
|
+
value=${this.value}
|
|
10
|
+
aria-checked=${n(this.indeterminate?"mixed":void 0)}
|
|
11
|
+
aria-label=${n(this.label)}
|
|
12
|
+
aria-describedby=${n(this._describedBy)}
|
|
13
|
+
aria-invalid=${n(this.invalid||this.error?"true":void 0)}
|
|
14
|
+
@change=${this._onInputChange}
|
|
15
|
+
/>
|
|
16
|
+
<span class="btu-checkbox-box">
|
|
17
|
+
<btu-icon
|
|
18
|
+
class="btu-checkbox-icon"
|
|
19
|
+
symbol=${this._iconSymbol}
|
|
20
|
+
style="--icon-size: var(--checkbox-icon-size)"
|
|
21
|
+
></btu-icon>
|
|
22
|
+
</span>
|
|
23
|
+
${this.label||this.description||this.error?a`
|
|
24
|
+
<span class="btu-checkbox-text">
|
|
25
|
+
${this.label?a`<span class="btu-checkbox-label">${this.label}</span>`:o}
|
|
26
|
+
${this.description?a`<span id=${this._descId} class="btu-checkbox-description">${this.description}</span>`:o}
|
|
27
|
+
${this.error?a`<span id=${this._errorId} class="btu-checkbox-error">${this.error}</span>`:o}
|
|
28
|
+
</span>
|
|
29
|
+
`:o}
|
|
30
|
+
`}}s([i()],t.prototype,"label");s([i()],t.prototype,"description");s([i({reflect:!0})],t.prototype,"size");s([i({type:Boolean,reflect:!0})],t.prototype,"checked");s([i({type:Boolean,reflect:!0})],t.prototype,"indeterminate");s([i({type:Boolean,reflect:!0})],t.prototype,"disabled");s([i({type:Boolean,reflect:!0})],t.prototype,"invalid");s([i()],t.prototype,"error");s([i({type:Boolean,reflect:!0})],t.prototype,"required");s([i()],t.prototype,"name");s([i()],t.prototype,"value");customElements.get("btu-checkbox")||customElements.define("btu-checkbox",t);
|