@brightspot/ui 6.8.1 → 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-BOXYJYXy.js → ActionBar.stories-TlhuCumU.js} +1 -1
- package/dist/storybook/assets/{ActionItem-WoDvowFu.js → ActionItem-CjtyGLd5.js} +1 -1
- package/dist/storybook/assets/{ActionItem.stories-CVFoWP54.js → ActionItem.stories-BVlNQvfP.js} +1 -1
- package/dist/storybook/assets/{AiSparkle.stories-Psv9jNpy.js → AiSparkle.stories-DMzc8JUe.js} +2 -2
- package/dist/storybook/assets/{Avatar-CIQcHS8b.js → Avatar-C6Li1sPI.js} +1 -1
- package/dist/storybook/assets/{Avatar.stories-BE2Xn8fx.js → Avatar.stories-COj6XrPn.js} +1 -1
- package/dist/storybook/assets/{AvatarGroup-Chs0VKPg.js → AvatarGroup-DgxRTZBe.js} +1 -1
- package/dist/storybook/assets/{AvatarGroup.stories-2ar6gCeX.js → AvatarGroup.stories-Dh3e7iN2.js} +1 -1
- package/dist/storybook/assets/{Badge-AV20mCMJ.js → Badge-bWrvpEgX.js} +1 -1
- package/dist/storybook/assets/{Badge.stories-w9LqNw0A.js → Badge.stories-KXpmEXpt.js} +1 -1
- package/dist/storybook/assets/{Banner.stories-Clhh1bBs.js → Banner.stories-Cnhm3dXK.js} +1 -1
- package/dist/storybook/assets/{Button-B7fn_wd5.js → Button-DE0s-gat.js} +1 -1
- package/dist/storybook/assets/{Button.stories-5h4M8nd2.js → Button.stories-Cwg1YZEb.js} +1 -1
- package/dist/storybook/assets/{ButtonGroup-BmndBsBy.js → ButtonGroup-CoLI5nGO.js} +1 -1
- package/dist/storybook/assets/{ButtonGroup.stories-CR1H4H7u.js → ButtonGroup.stories-VhnKPP1n.js} +1 -1
- package/dist/storybook/assets/{Card.stories-Bz5vXq5y.js → Card.stories-BgpL90zB.js} +1 -1
- package/dist/storybook/assets/{Celebrate.stories-Bu3CNw0k.js → Celebrate.stories-D3NJgYcX.js} +1 -1
- package/dist/storybook/assets/{Checkbox-BALsanB1.js → Checkbox-BC1T_KxW.js} +1 -1
- package/dist/storybook/assets/{Checkbox.stories-BdvCht5c.js → Checkbox.stories-AFQNz7dQ.js} +1 -1
- package/dist/storybook/assets/{CircularProgress-BeE2fWON.js → CircularProgress-eqVb2jUD.js} +1 -1
- package/dist/storybook/assets/{CircularProgress.stories-CL8Lc6eU.js → CircularProgress.stories-B6t8VhmJ.js} +1 -1
- package/dist/storybook/assets/{ClipboardMixin-C6wcbXIO.js → ClipboardMixin-DcxrOy5B.js} +1 -1
- package/dist/storybook/assets/{ClipboardMixin.stories-BsjzC7wd.js → ClipboardMixin.stories-BqtQMjmS.js} +1 -1
- package/dist/storybook/assets/{Color-6BZIO3FS-Dsd6EVV9.js → Color-6BZIO3FS-CDluohEc.js} +1 -1
- package/dist/storybook/assets/{Colors.stories-CkCdNN9Y.js → Colors.stories-CqTniDIa.js} +1 -1
- package/dist/storybook/assets/{CombinedEffects.stories-QG78pIiG.js → CombinedEffects.stories-FwW0chy5.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin-CG-Dx_Vk.js → ComponentStatesMixin-hUqOL2aW.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin.stories-B1yuAqua.js → ComponentStatesMixin.stories-CwGoq685.js} +1 -1
- package/dist/storybook/assets/{CopyToClipboard.stories-CyKcumJ9.js → CopyToClipboard.stories-DUGjgtQx.js} +1 -1
- package/dist/storybook/assets/{Debounce.stories-BuNskQ33.js → Debounce.stories-CrWfXhKS.js} +1 -1
- package/dist/storybook/assets/{DocsRenderer-LL677BLK-BrPyc8XX.js → DocsRenderer-LL677BLK-9e51z9Xc.js} +3 -3
- package/dist/storybook/assets/{Dropdown.stories-DHXeP07z.js → Dropdown.stories-BsBxV0wp.js} +1 -1
- package/dist/storybook/assets/{DropdownMenu-WoWnJiQk.js → DropdownMenu-B-LvOIGj.js} +1 -1
- package/dist/storybook/assets/{EmptyState.stories-BRoVusey.js → EmptyState.stories-CJ1w8Tp2.js} +1 -1
- package/dist/storybook/assets/{EscaAvatar.stories-CWAE-4Uz.js → EscaAvatar.stories-BoLLSj9q.js} +2 -2
- package/dist/storybook/assets/{Events.stories-D-npDwlx.js → Events.stories-C3sTBwPJ.js} +1 -1
- package/dist/storybook/assets/{Heading.stories-D7hmvFEN.js → Heading.stories-jmXDRBmM.js} +1 -1
- package/dist/storybook/assets/{HueRipple.stories-Dx3ozdHi.js → HueRipple.stories-BPx5aSYd.js} +1 -1
- package/dist/storybook/assets/{Icon-DPQKiWDz.js → Icon-CWyJRQf7.js} +1 -1
- package/dist/storybook/assets/{Icon.stories-CVsQvcwd.js → Icon.stories-iYBxmv2x.js} +1 -1
- package/dist/storybook/assets/{IconButton-Dp4Z06bL.js → IconButton-Di5Rgs7F.js} +1 -1
- package/dist/storybook/assets/{IconButton.stories-DTbfHfcQ.js → IconButton.stories-DENLoxVk.js} +1 -1
- package/dist/storybook/assets/{LinearProgress-DG3tPlGH.js → LinearProgress-D9ngIVlv.js} +1 -1
- package/dist/storybook/assets/{LinearProgress.stories-VIU6OqYd.js → LinearProgress.stories-u90B_VJR.js} +1 -1
- package/dist/storybook/assets/{Message-BzkpGg8z.js → Message-nFAa55c_.js} +1 -1
- package/dist/storybook/assets/{Message.stories-C9bzoQes.js → Message.stories-B4rpz5rI.js} +1 -1
- package/dist/storybook/assets/{OnFindMixin-CeeYfx9k.js → OnFindMixin-oL1bvTFj.js} +1 -1
- package/dist/storybook/assets/{OnFindMixin.stories-Dq06nuVf.js → OnFindMixin.stories-CdeS5sFA.js} +1 -1
- package/dist/storybook/assets/{Pagination-CnWa6AX5.js → Pagination-CSWcjuDU.js} +1 -1
- package/dist/storybook/assets/{Pagination.stories-BsH2eN2W.js → Pagination.stories-Da2WzJkv.js} +1 -1
- package/dist/storybook/assets/{Popover.stories-CLnzpgEE.js → Popover.stories-CVljlVHc.js} +1 -1
- package/dist/storybook/assets/{ProgressMixin-D1atDw3n.js → ProgressMixin-CeSrn0_P.js} +1 -1
- package/dist/storybook/assets/{Radio-B6Aq6K0V.js → Radio-rvfGhZwK.js} +1 -1
- package/dist/storybook/assets/{Radio.stories-BCVbISmb.js → Radio.stories-B0wHdJuc.js} +1 -1
- package/dist/storybook/assets/{RadioGroup.stories-B-TGP_-v.js → RadioGroup.stories-D8krOSlP.js} +1 -1
- package/dist/storybook/assets/{ReadyMixin-C8HW2nGE.js → ReadyMixin-CvX_eidU.js} +1 -1
- package/dist/storybook/assets/{RovingTabindexMixin-DI5rmyR7.js → RovingTabindexMixin-9z8lwaM9.js} +1 -1
- package/dist/storybook/assets/{RovingTabindexMixin.stories-DVKCC_R7.js → RovingTabindexMixin.stories-Y8vBWjJp.js} +1 -1
- package/dist/storybook/assets/{Rtc.stories-bBYHOszW.js → Rtc.stories-D3Y-z8y_.js} +1 -1
- package/dist/storybook/assets/{ScrollShadow.stories-BIK8YINt.js → ScrollShadow.stories-1KD0lWHX.js} +1 -1
- package/dist/storybook/assets/{Switch.stories-COEk74kM.js → Switch.stories-Bsqvm_HE.js} +1 -1
- package/dist/storybook/assets/{Tab.stories-Dbt9JvSx.js → Tab.stories-CzcTisNs.js} +1 -1
- package/dist/storybook/assets/{Tabs-BIScOPS0.js → Tabs-DdpYNZSW.js} +1 -1
- package/dist/storybook/assets/{Tabs.stories-CodKgVf2.js → Tabs.stories-UOS3V0J4.js} +1 -1
- package/dist/storybook/assets/{Throttle.stories-BhIqWWrQ.js → Throttle.stories-C8jgzh6e.js} +1 -1
- package/dist/storybook/assets/{Tooltip.stories-DKD8nBM1.js → Tooltip.stories-B5BoI0cH.js} +1 -1
- package/dist/storybook/assets/{TooltipMixin-CRNNusJ7.js → TooltipMixin-CVKslCDt.js} +1 -1
- package/dist/storybook/assets/{Upload.stories-WTO15ST1.js → Upload.stories-BsQDCDqo.js} +1 -1
- package/dist/storybook/assets/{UploadItem-DejgZ5A0.js → UploadItem-CYQqNwUF.js} +1 -1
- package/dist/storybook/assets/{UploadItem.stories-Pk3ghOcI.js → UploadItem.stories-_le7XBTV.js} +1 -1
- package/dist/storybook/assets/{Welcome.stories-DrNnxvt9.js → Welcome.stories-rramKkhd.js} +33 -3
- package/dist/storybook/assets/{Widget.stories-CYC5Qdac.js → Widget.stories-DtbAaklk.js} +1 -1
- package/dist/storybook/assets/{WithTooltip-65CFNBJE-DK6PZNaa.js → WithTooltip-65CFNBJE-DK6GcBuR.js} +1 -1
- package/dist/storybook/assets/{blocks-Dzcxb014.js → blocks-DHnzPh43.js} +5 -5
- package/dist/storybook/assets/{formatter-EIJCOSYU-PioIuXjk.js → formatter-EIJCOSYU-qig-qWlG.js} +1 -1
- package/dist/storybook/assets/if-defined-DerKRcyC.js +1 -0
- package/dist/storybook/assets/{iframe-Byo_x5o2.js → iframe-DlBK9Drk.js} +3 -3
- package/dist/storybook/assets/{index-gox-Wle0.js → index-CItQyB37.js} +1 -1
- package/dist/storybook/assets/{lottie_svg-3t2UJxjZ.js → lottie_svg-C3v6xdng.js} +1 -1
- package/dist/storybook/assets/{onFind-BWiaccUj.js → onFind-Ci35eu2y.js} +1 -1
- package/dist/storybook/assets/{onFind.stories-CC_XTN2G.js → onFind.stories-BmbwWWo1.js} +1 -1
- package/dist/storybook/assets/{onRemove.stories-CXxpL4ud.js → onRemove.stories-DFWCIgE4.js} +1 -1
- package/dist/storybook/assets/{onVisible.stories-DKA9cexx.js → onVisible.stories-B-onpgE-.js} +1 -1
- package/dist/storybook/assets/{property-_few0Xe5.js → property-Bmq4RTSP.js} +1 -1
- package/dist/storybook/assets/{ref-BaIdO8Sk.js → ref-BhKk4SDh.js} +1 -1
- package/dist/storybook/assets/state-DVIUS0Gf.js +1 -0
- package/dist/storybook/assets/{style-map-DxZm5Cj7.js → style-map-DE4G47KD.js} +1 -1
- package/dist/storybook/assets/{syntaxhighlighter-ED5Y7EFY-B0_bSGZz.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 +8 -6
- package/dist/storybook/assets/if-defined-DL7cQU7O.js +0 -1
- package/dist/storybook/assets/state-BBcPmYaV.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as S,x as t}from"./iframe-
|
|
1
|
+
import{g as S,x as t}from"./iframe-DlBK9Drk.js";import{o as f}from"./style-map-DE4G47KD.js";import"./DropdownMenu-B-LvOIGj.js";import"./preload-helper-PPVm8Dsz.js";import"./property-Bmq4RTSP.js";import"./aria-D5THOgos.js";import"./ReadyMixin-CvX_eidU.js";import"./TooltipMixin-CVKslCDt.js";import"./Icon-CWyJRQf7.js";import"./Badge-bWrvpEgX.js";import"./RovingTabindexMixin-9z8lwaM9.js";const{events:O,args:A,argTypes:n}=S("btu-dropdown"),F={title:"Components/Dropdown",component:"btu-dropdown",tags:["autodocs"],parameters:{docs:{subtitle:"btu-dropdown",description:{component:`
|
|
2
2
|
A dropdown menu component that renders a trigger button and manages a floating panel
|
|
3
3
|
containing a \`btu-dropdown-menu\` with \`btu-dropdown-item\` children.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{E as r,x as n,i as y}from"./iframe-
|
|
1
|
+
import{E as r,x as n,i as y}from"./iframe-DlBK9Drk.js";import{n as s}from"./property-Bmq4RTSP.js";import{o as w}from"./style-map-DE4G47KD.js";import{a as v}from"./aria-D5THOgos.js";import{E as f,R as _}from"./ReadyMixin-CvX_eidU.js";import{T as k}from"./TooltipMixin-CVKslCDt.js";import"./Icon-CWyJRQf7.js";import"./Badge-bWrvpEgX.js";import{R as $}from"./RovingTabindexMixin-9z8lwaM9.js";var x=Object.defineProperty,d=(l,t,e,o)=>{for(var i=void 0,h=l.length-1,b;h>=0;h--)(b=l[h])&&(i=b(t,e,i)||i);return i&&x(t,e,i),i};const g={"bottom-start":"block-end span-inline-end","bottom-end":"block-end span-inline-start","top-start":"block-start span-inline-end","top-end":"block-start span-inline-start"};class a extends k(f(_(y))){constructor(){super(...arguments),this.label="",this.open=!1,this.placement="bottom-start",this.size="md",this.disabled=!1,this.variant="secondary",this.symbol="",this.iconPosition="leading",this.iconOnly=!1,this.stayOpenOnSelect=!1,this.noChevron=!1,this._triggerAnchorName=`--dropdown-anchor-${crypto.randomUUID().slice(0,8)}`,this._panelId=`dropdown-panel-${crypto.randomUUID().slice(0,8)}`,this._panel=null,this._menu=null,this._triggerEl=null,this._panelVisible=!1,this._boundToggle=this._handlePanelToggle.bind(this),this._boundItemSelect=this._handleItemSelect.bind(this),this._boundKeydown=this._handleTriggerKeydown.bind(this),this._boundPanelKeydown=this._handlePanelKeydown.bind(this),this._boundFocusin=t=>t.stopPropagation()}createRenderRoot(){return this}connectedCallback(){this._menu||(this._menu=this.querySelector("btu-dropdown-menu"),this._menu&&this._menu.remove()),super.connectedCallback(),this._panel&&(this._panel.addEventListener("toggle",this._boundToggle),this._panel.addEventListener("keydown",this._boundPanelKeydown),this._panel.addEventListener("focusin",this._boundFocusin),this.addEventListener("btu-dropdown-item-select",this._boundItemSelect))}firstUpdated(){this._triggerEl=this.querySelector("button"),this._panel=document.createElement("div"),this._panel.id=this._panelId,this._panel.setAttribute("popover","auto"),this._panel.className="btu-dropdown-panel";const t=this._panel.style;t.setProperty("position","fixed"),t.setProperty("inset","unset"),t.setProperty("margin","0"),t.setProperty("position-anchor",this._triggerAnchorName),t.setProperty("position-area",g[this.placement]),t.setProperty("position-try-fallbacks","flip-block"),t.setProperty("position-visibility","anchors-visible"),t.setProperty("min-width","var(--dropdown-panel-min-width, max(12rem, anchor-size(width)))"),this._menu&&this._panel.appendChild(this._menu),this.appendChild(this._panel),this._panel.addEventListener("toggle",this._boundToggle),this._panel.addEventListener("keydown",this._boundPanelKeydown),this._panel.addEventListener("focusin",this._boundFocusin),this.addEventListener("btu-dropdown-item-select",this._boundItemSelect),this.emit("btu-dropdown-ready")}disconnectedCallback(){super.disconnectedCallback(),this._panel&&(this._panel.removeEventListener("toggle",this._boundToggle),this._panel.removeEventListener("keydown",this._boundPanelKeydown),this._panel.removeEventListener("focusin",this._boundFocusin)),this.removeEventListener("btu-dropdown-item-select",this._boundItemSelect)}updated(t){if(super.updated(t),t.has("placement")&&this._panel&&this._panel.style.setProperty("position-area",g[this.placement]),t.has("open")&&this._panel){if(this.open&&!this._panelVisible)try{this._panel.showPopover()}catch(e){if(!(e instanceof DOMException&&e.name==="InvalidStateError"))throw e}else if(!this.open&&this._panelVisible)try{this._panel.hidePopover()}catch(e){if(!(e instanceof DOMException&&e.name==="InvalidStateError"))throw e}}}_getButtonClasses(){const t=this.size,e=["btu-button"];switch(this.variant){case"primary":e.push("btu-button-primary",`btu-button-${t}`);break;case"secondary":e.push("btu-button-gray",`btu-button-${t}`,"btu-button-outline");break;case"tertiary":e.push("btu-button-gray",`btu-button-${t}`,"btu-button-fill-none");break;case"primary-clear":e.push("btu-button-primary",`btu-button-${t}`,"btu-button-container-none");break;case"secondary-clear":e.push("btu-button-gray",`btu-button-${t}`,"btu-button-container-none");break;case"tertiary-clear":e.push("btu-button-gray",`btu-button-${t}`,"btu-button-container-none","btu-button-fill-none");break}return this.iconOnly&&e.push("btu-button-text-hidden"),e.join(" ")}_handlePanelToggle(t){const e=t;if(this._panelVisible=e.newState==="open",this.open=this._panelVisible,this._panelVisible){this.emit("btu-dropdown-show"),v(`${this.label||"Dropdown"} menu expanded`);const o=this.querySelector("[data-tooltip-internal]");if(o)try{o.hidePopover()}catch{}requestAnimationFrame(()=>{this._menu?.focusFirst()})}else this.emit("btu-dropdown-hide"),v(`${this.label||"Dropdown"} menu collapsed`),this._triggerEl?.focus({preventScroll:!0})}_handleItemSelect(){const t=this._menu?.checkbox??!1;!this.stayOpenOnSelect&&!t&&this._hidePanel()}_handleTriggerKeydown(t){if(!this.disabled)switch(t.key){case"ArrowDown":{t.preventDefault(),this._showPanel(),requestAnimationFrame(()=>{this._menu?.focusFirst()});break}case"ArrowUp":{t.preventDefault(),this._showPanel(),requestAnimationFrame(()=>{this._menu?.focusLast()});break}}}_handlePanelKeydown(t){t.key==="Escape"&&(t.preventDefault(),t.stopPropagation(),this._hidePanel(),this._triggerEl?.focus({preventScroll:!0})),t.key==="Tab"&&(this._hidePanel(),this._triggerEl?.focus({preventScroll:!0}))}_showPanel(){this._panel&&!this._panelVisible&&this._panel.showPopover()}_hidePanel(){this._panel&&this._panelVisible&&this._panel.hidePopover()}render(){const t=this._getButtonClasses();return n`<button
|
|
2
2
|
type="button"
|
|
3
3
|
class="${t}"
|
|
4
4
|
style=${w({"anchor-name":this._triggerAnchorName})}
|
package/dist/storybook/assets/{EmptyState.stories-BRoVusey.js → EmptyState.stories-CJ1w8Tp2.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as x,x as s,g as w}from"./iframe-
|
|
1
|
+
import{i as x,x as s,g as w}from"./iframe-DlBK9Drk.js";import{o as S}from"./if-defined-DerKRcyC.js";import{o as $}from"./style-map-DE4G47KD.js";import{n as g}from"./property-Bmq4RTSP.js";import{E as k,R as E}from"./ReadyMixin-CvX_eidU.js";import{O as G}from"./OnFindMixin-oL1bvTFj.js";import"./ButtonGroup-CoLI5nGO.js";import"./Icon-CWyJRQf7.js";import"./preload-helper-PPVm8Dsz.js";import"./onFind-Ci35eu2y.js";import"./ComponentStatesMixin-hUqOL2aW.js";import"./RovingTabindexMixin-9z8lwaM9.js";var T=Object.defineProperty,y=(t,e,i,o)=>{for(var a=void 0,v=t.length-1,f;v>=0;v--)(f=t[v])&&(a=f(e,i,a)||a);return a&&T(e,i,a),a};const C={sm:5,md:4,lg:3},N={sm:"md",md:"lg",lg:"xl"},U=new Set(["btu-empty-state","btu-empty-state-sm","btu-empty-state-md","btu-empty-state-lg"]),z=t=>typeof t=="number"&&Number.isInteger(t)&&t>=1&&t<=6;class r extends k(G(E(x))){constructor(){super(...arguments),this.heading="",this.size="md",this.initialClasses=[]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.className&&(this.initialClasses=this.className.split(" ").filter(e=>e.trim()&&!U.has(e)))}willUpdate(e){super.willUpdate(e);const i=[...this.initialClasses,"btu-empty-state",`btu-empty-state-${this.size}`];this.className=i.filter(Boolean).join(" "),e.has("headingLevel")&&this.headingLevel!=null&&!z(this.headingLevel)&&console.warn(`EmptyState: Invalid heading-level="${this.headingLevel}". Valid values are 1-6. Falling back to size-based default.`)}firstUpdated(e){super.firstUpdated(e),this.emit("btu-empty-state-ready")}onFindRegistration(){const e=this.querySelector(".btu-empty-state-graphic"),i=this.querySelector(".btu-empty-state-actions");return!e||!i?null:{selectors:":scope > :not([data-empty-state-internal])",callback:o=>{const a=o.getAttribute("slot");a==="graphic"?(e.appendChild(o),o.tagName==="BTU-ICON"&&this.syncGraphicIconSize()):a==="actions"?i.appendChild(o):console.warn(a?`EmptyState: Unrecognized slot="${a}". Valid slots are "graphic" and "actions".`:'EmptyState: Child element has no slot attribute. Use slot="graphic" or slot="actions".',o)}}}updated(e){super.updated(e),e.has("size")&&this.syncGraphicIconSize()}syncGraphicIconSize(){const e=this.querySelector(".btu-empty-state-graphic btu-icon");e&&e.setAttribute("size",N[this.size])}resolveHeadingLevel(){return z(this.headingLevel)?this.headingLevel:C[this.size]}renderHeading(e,i){if(!this.heading)return"";switch(e){case 1:return s`<h1 class="${i}" data-empty-state-internal>${this.heading}</h1>`;case 2:return s`<h2 class="${i}" data-empty-state-internal>${this.heading}</h2>`;case 3:return s`<h3 class="${i}" data-empty-state-internal>${this.heading}</h3>`;case 4:return s`<h4 class="${i}" data-empty-state-internal>${this.heading}</h4>`;case 5:return s`<h5 class="${i}" data-empty-state-internal>${this.heading}</h5>`;case 6:return s`<h6 class="${i}" data-empty-state-internal>${this.heading}</h6>`}}render(){const e=this.resolveHeadingLevel(),i=`btu-empty-state-title btu-heading-${e}`;return s`
|
|
2
2
|
<div class="btu-empty-state-graphic" data-empty-state-internal></div>
|
|
3
3
|
<div class="btu-empty-state-content" data-empty-state-internal>
|
|
4
4
|
${this.renderHeading(e,i)}
|
package/dist/storybook/assets/{EscaAvatar.stories-CWAE-4Uz.js → EscaAvatar.stories-BoLLSj9q.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./lottie_svg-
|
|
2
|
-
import{i as A,x as l,g as O}from"./iframe-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./lottie_svg-C3v6xdng.js","./iframe-DlBK9Drk.js","./preload-helper-PPVm8Dsz.js","./iframe-BzrT7trF.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as A,x as l,g as O}from"./iframe-DlBK9Drk.js";import{o as L}from"./style-map-DE4G47KD.js";import{_ as c}from"./preload-helper-PPVm8Dsz.js";import{n as w}from"./property-Bmq4RTSP.js";import{e as R,n as k}from"./ref-BhKk4SDh.js";import{E as M,R as C}from"./ReadyMixin-CvX_eidU.js";var $=Object.defineProperty,z=(e,t,a,o)=>{for(var s=void 0,r=e.length-1,n;r>=0;r--)(n=e[r])&&(s=n(t,a,s)||s);return s&&$(t,a,s),s};const f={idle:{play:!0,loop:!0,hold:"first",comp:619/664,art:{x:.0656,y:.1011,width:.8653,height:.7967}},wave:{play:!0,loop:!1,hold:"last",comp:1500/1400,art:{x:.1411,y:.1202,width:.7144,height:.7571}},search:{play:!0,loop:!0,hold:"first",comp:1500/1400,art:{x:.1411,y:.1214,width:.7144,height:.756}},complete:{play:!0,loop:!1,hold:"last",comp:1500/1400,art:{x:.1322,y:.1262,width:.7233,height:.7512}},glow:{play:!0,loop:!1,hold:"last",comp:1100/1026,art:{x:.2078,y:.1144,width:.7144,height:.7628},frames:[94,146]}},P={idle:()=>c(()=>import("./esca-idle-B-fumiIb.js"),[],import.meta.url).then(e=>e.default),wave:()=>c(()=>import("./esca-wave-Bjs4CUR7.js"),[],import.meta.url).then(e=>e.default),search:()=>c(()=>import("./esca-search-rwNfo19I.js"),[],import.meta.url).then(e=>e.default),complete:()=>c(()=>import("./esca-task-complete-BAJP2dY2.js"),[],import.meta.url).then(e=>e.default),glow:()=>c(()=>import("./esca-glow-BwdhBvIX.js"),[],import.meta.url).then(e=>e.default)};let D;const I=()=>D??=c(()=>import("./lottie_svg-C3v6xdng.js").then(e=>e.l),__vite__mapDeps([0,1,2,3]),import.meta.url),x={xs:"1.5rem",sm:"2.25rem",md:"2.5rem",lg:"3rem",xl:"3.5rem"},N=24;function V({comp:e,art:t}){const a=r=>`${(r*100).toFixed(4)}%`,o=1/t.width,s=o/e;return{position:"absolute",width:a(o),height:a(s),left:a(-t.x*o),top:a((1-t.height*s)/2-t.y*s)}}function g(e){return e!==null&&e!=="idle"&&e in f?e:"idle"}class _ extends M(C(A)){constructor(){super(...arguments),this.state="idle",this.size="md",this._containerRef=R(),this._animation=null,this._rendered=null,this._reduceMotion=!1,this._loadToken=0,this._onMotionChange=t=>{this._reduceMotion=t.matches,this._rendered=null,this._play()}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","img"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Esca"),this.style.display||(this.style.display="inline-block"),getComputedStyle(this).position==="static"&&(this.style.position="relative"),this._applySize(),this._motionQuery=window.matchMedia?.("(prefers-reduced-motion: reduce)"),this._reduceMotion=this._motionQuery?.matches??!1,this._motionQuery?.addEventListener("change",this._onMotionChange),this.hasUpdated&&(this._observe(),this._rendered=null,this._play())}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver?.disconnect(),this._resizeObserver=void 0,this._intersectionObserver?.disconnect(),this._intersectionObserver=void 0,this._motionQuery?.removeEventListener("change",this._onMotionChange),this._destroy()}firstUpdated(t){super.firstUpdated(t),this._observe(),this.emit("btu-esca-avatar-ready")}_observe(){this._resizeObserver=new ResizeObserver(()=>this._animation?.resize()),this._containerRef.value&&this._resizeObserver.observe(this._containerRef.value),this._intersectionObserver=new IntersectionObserver(([t])=>{const a=this._animation;a&&(t.isIntersecting?(a.resize(),!this._reduceMotion&&f[g(this.state)].loop&&a.play()):f[g(this.state)].loop&&a.pause())}),this._intersectionObserver.observe(this)}updated(t){super.updated(t),t.has("state")&&this._play(),t.has("size")&&this._applySize()}render(){return l`<div ${k(this._containerRef)}></div>`}_applySize(){const t=x[this.size]??x.md;this.style.width=`var(--esca-avatar-size, ${t})`,this.style.height=`var(--esca-avatar-size, ${t})`}async _play(){if(!this._containerRef.value)return;const t=g(this.state);if(t===this._rendered&&this._animation)return;const a=++this._loadToken,[{default:o},s]=await Promise.all([I(),P[t]()]),r=this._containerRef.value;if(a!==this._loadToken||!r)return;this._rendered=t,this._destroy();const n=f[t],d=n.play&&!this._reduceMotion;Object.assign(r.style,V(n));const i=o.loadAnimation({container:r,renderer:"svg",loop:n.loop&&!this._reduceMotion,autoplay:d,animationData:structuredClone(s),...n.frames?{initialSegment:n.frames}:{}}),h=s.fr;h&&i.setSpeed(N/h);const p=()=>this.emit("btu-esca-avatar-complete",{state:t});d?n.loop||i.addEventListener("complete",p):i.addEventListener("DOMLoaded",()=>{const S=Math.max(0,i.getDuration(!0)-1);i.goToAndStop(n.hold==="last"?S:0,!0),n.play&&!n.loop&&p()}),this._animation=i,i.addEventListener("DOMLoaded",()=>i.resize())}_destroy(){this._animation?.destroy(),this._animation=null}}z([w({type:String,reflect:!0})],_.prototype,"state");z([w({type:String,reflect:!0})],_.prototype,"size");customElements.get("btu-esca-avatar")||customElements.define("btu-esca-avatar",_);const{events:F,args:U,argTypes:b}=O("btu-esca-avatar"),E=["idle","wave","search","complete","glow"],T=["xs","sm","md","lg","xl"],K={title:"Components/Esca/Avatar",component:"btu-esca-avatar",tags:["autodocs"],parameters:{docs:{subtitle:"The animated avatar for the Esca AI assistant",description:{component:`
|
|
3
3
|
<h3>When to use:</h3>
|
|
4
4
|
<ul>
|
|
5
5
|
<li>Alongside the Esca assistant's messages, in any chat surface</li>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{x as d}from"./iframe-
|
|
1
|
+
import{x as d}from"./iframe-DlBK9Drk.js";import"./Badge-bWrvpEgX.js";import"./preload-helper-PPVm8Dsz.js";import"./property-Bmq4RTSP.js";import"./ReadyMixin-CvX_eidU.js";var n=Object.freeze,r=Object.defineProperty,s=(t,i)=>n(r(t,"raw",{value:n(t.slice())})),o;const b={title:"Mixins/Events",tags:["autodocs"],parameters:{docs:{subtitle:"Events inherited from EventEmitterMixin",description:{component:`
|
|
2
2
|
<h3>EventEmitterMixin Events</h3>
|
|
3
3
|
|
|
4
4
|
<p>All Brightspot UI components that extend EventEmitterMixin emit the following lifecycle events in addition to those inherited from LitElement. These events use CustomEvent and bubble through the DOM with <code>composed: true</code>, meaning they cross shadow DOM boundaries.</p>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{x as s}from"./iframe-
|
|
1
|
+
import{x as s}from"./iframe-DlBK9Drk.js";import"./preload-helper-PPVm8Dsz.js";const r=({size:t})=>s` <div class=${[`btu-heading-${t}`].join(" ")}>Heading</div> `,o={title:"CSS Plugins/Heading",component:"btu-heading",tags:["autodocs"],parameters:{docs:{subtitle:"This Tailwind CSS plugin provides the `.btu-heading` utility class for styling headings. It supports five different sizes, from 1 (largest) to 5 (smallest). Apply the class to `<h1>` through `<h5>` elements to style them accordingly."},controls:{expanded:!0}},render:t=>r(t),argTypes:{size:{control:{type:"range",min:1,max:5,step:1},description:"Heading size from 1 to 5, where 1 is the largest and 5 is the smallest."}},args:{size:1}},e={args:{}};e.parameters={...e.parameters,docs:{...e.parameters?.docs,source:{originalSource:`{
|
|
2
2
|
args: {}
|
|
3
3
|
}`,...e.parameters?.docs?.source}}};const n=["Default"];export{e as Default,n as __namedExportsOrder,o as default};
|
package/dist/storybook/assets/{HueRipple.stories-Dx3ozdHi.js → HueRipple.stories-BPx5aSYd.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{x as i}from"./iframe-
|
|
1
|
+
import{x as i}from"./iframe-DlBK9Drk.js";import"./Avatar-C6Li1sPI.js";import"./Badge-bWrvpEgX.js";import"./Icon-CWyJRQf7.js";import{b as l}from"./ripple-CedcTXtA.js";import{B as e}from"./Button-DE0s-gat.js";import"./preload-helper-PPVm8Dsz.js";import"./property-Bmq4RTSP.js";import"./state-DVIUS0Gf.js";import"./ReadyMixin-CvX_eidU.js";import"./TooltipMixin-CVKslCDt.js";import"./position-CFNQy3J6.js";const x={title:"Effects/Hue Ripple",tags:["autodocs"],parameters:{docs:{subtitle:"Click anywhere to send a hue-shifting ripple across the viewport",description:{component:`
|
|
2
2
|
Uses the **View Transition API** to create an expanding ring that reveals OKLCH-shifted colors as it sweeps past each element, then they return to normal.
|
|
3
3
|
|
|
4
4
|
### Usage
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aj as nt,e as ct,ak as h,x as p,i as st}from"./iframe-
|
|
1
|
+
import{aj as nt,e as ct,ak as h,x as p,i as st}from"./iframe-DlBK9Drk.js";import{n as r}from"./property-Bmq4RTSP.js";import{E as rt,R as dt}from"./ReadyMixin-CvX_eidU.js";class C extends nt{}C.directiveName="unsafeSVG",C.resultType=2;const at=ct(C),lt=/[\r\n%#()<>?[\\\]^`{|}]/g;function N(e){return e.indexOf("http://www.w3.org/2000/svg")<0&&(e=e.replace(/<svg/g,"<svg xmlns='http://www.w3.org/2000/svg'")),e}function B(e){return e=e.replace(/"/g,"'"),e=e.replace(/>\s{1,}</g,"><"),e=e.replace(/\s{2,}/g," "),e.replace(lt,encodeURIComponent)}const ht={facebook:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="100 100 500 500" fill="currentColor"><path d="M600.0,350.0C600.0,211.929 488.071,100.0 350.0,100.0C211.929,100.0 100.0,211.929 100.0,350.0C100.0,467.245 180.715,565.622 289.606,592.638L289.606,426.396L238.054,426.396L238.054,350.0L289.606,350.0L289.606,317.081C289.606,231.989 328.114,192.549 411.654,192.549C427.492,192.549 454.821,195.654 466.001,198.76L466.001,268.014C460.1,267.393 449.852,267.082 437.119,267.082C396.126,267.082 380.287,282.61 380.287,322.982L380.287,350.0L461.946,350.0L447.918,426.396L380.287,426.396L380.287,598.169C504.073,583.218 600.0,477.818 600.0,350.0Z"/></svg>',instagram:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000" fill="currentColor"><path d="M295.42,6c-53.2,2.51-89.53,11-121.29,23.48-32.87,12.81-60.73,30-88.45,57.82S40.89,143,28.17,175.92c-12.31,31.83-20.65,68.19-23,121.42S2.3,367.68,2.56,503.46,3.42,656.26,6,709.6c2.54,53.19,11,89.51,23.48,121.28,12.83,32.87,30,60.72,57.83,88.45S143,964.09,176,976.83c31.8,12.29,68.17,20.67,121.39,23s70.35,2.87,206.09,2.61,152.83-.86,206.16-3.39S799.1,988,830.88,975.58c32.87-12.86,60.74-30,88.45-57.84S964.1,862,976.81,829.06c12.32-31.8,20.69-68.17,23-121.35,2.33-53.37,2.88-70.41,2.62-206.17s-.87-152.78-3.4-206.1-11-89.53-23.47-121.32c-12.85-32.87-30-60.7-57.82-88.45S862,40.87,829.07,28.19c-31.82-12.31-68.17-20.7-121.39-23S637.33,2.3,501.54,2.56,348.75,3.4,295.42,6m5.84,903.88c-48.75-2.12-75.22-10.22-92.86-17-23.36-9-40-19.88-57.58-37.29s-28.38-34.11-37.5-57.42c-6.85-17.64-15.1-44.08-17.38-92.83-2.48-52.69-3-68.51-3.29-202s.22-149.29,2.53-202c2.08-48.71,10.23-75.21,17-92.84,9-23.39,19.84-40,37.29-57.57s34.1-28.39,57.43-37.51c17.62-6.88,44.06-15.06,92.79-17.38,52.73-2.5,68.53-3,202-3.29s149.31.21,202.06,2.53c48.71,2.12,75.22,10.19,92.83,17,23.37,9,40,19.81,57.57,37.29s28.4,34.07,37.52,57.45c6.89,17.57,15.07,44,17.37,92.76,2.51,52.73,3.08,68.54,3.32,202s-.23,149.31-2.54,202c-2.13,48.75-10.21,75.23-17,92.89-9,23.35-19.85,40-37.31,57.56s-34.09,28.38-57.43,37.5c-17.6,6.87-44.07,15.07-92.76,17.39-52.73,2.48-68.53,3-202.05,3.29s-149.27-.25-202-2.53m407.6-674.61a60,60,0,1,0,59.88-60.1,60,60,0,0,0-59.88,60.1M245.77,503c.28,141.8,115.44,256.49,257.21,256.22S759.52,643.8,759.25,502,643.79,245.48,502,245.76,245.5,361.22,245.77,503m90.06-.18a166.67,166.67,0,1,1,167,166.34,166.65,166.65,0,0,1-167-166.34"/></svg>',slack:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="73.6 73.6 122.8 122.8" fill="currentColor"><path d="M99.4,151.2c0,7.1-5.8,12.9-12.9,12.9s-12.9-5.8-12.9-12.9c0-7.1,5.8-12.9,12.9-12.9h12.9V151.2z"/><path d="M105.9,151.2c0-7.1,5.8-12.9,12.9-12.9s12.9,5.8,12.9,12.9v32.3c0,7.1-5.8,12.9-12.9,12.9s-12.9-5.8-12.9-12.9 C105.9,183.5,105.9,151.2,105.9,151.2z"/><path d="M118.8,99.4c-7.1,0-12.9-5.8-12.9-12.9s5.8-12.9,12.9-12.9s12.9,5.8,12.9,12.9v12.9H118.8z"/><path d="M118.8,105.9c7.1,0,12.9,5.8,12.9,12.9s-5.8,12.9-12.9,12.9H86.5c-7.1,0-12.9-5.8-12.9-12.9s5.8-12.9,12.9-12.9 C86.5,105.9,118.8,105.9,118.8,105.9z"/><path d="M170.6,118.8c0-7.1,5.8-12.9,12.9-12.9c7.1,0,12.9,5.8,12.9,12.9s-5.8,12.9-12.9,12.9h-12.9V118.8z"/><path d="M164.1,118.8c0,7.1-5.8,12.9-12.9,12.9c-7.1,0-12.9-5.8-12.9-12.9V86.5c0-7.1,5.8-12.9,12.9-12.9 c7.1,0,12.9,5.8,12.9,12.9V118.8z"/><path d="M151.2,170.6c7.1,0,12.9,5.8,12.9,12.9c0,7.1-5.8,12.9-12.9,12.9c-7.1,0-12.9-5.8-12.9-12.9v-12.9H151.2z"/><path d="M151.2,164.1c-7.1,0-12.9-5.8-12.9-12.9c0-7.1,5.8-12.9,12.9-12.9h32.3c7.1,0,12.9,5.8,12.9,12.9 c0,7.1-5.8,12.9-12.9,12.9H151.2z"/></svg>',x:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 1227" fill="currentColor"><path d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z"/></svg>'},pt={facebook:"facebook",instagram:"instagram",slack:"slack",twitter:"x"};function wt(e){const o=ht[e];return o?{iconSvg:B(N(o))}:void 0}const ut=`
|
|
2
2
|
<svg
|
|
3
3
|
class="lucide lucide-a-arrow-down"
|
|
4
4
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as v,x as s}from"./iframe-
|
|
1
|
+
import{g as v,x as s}from"./iframe-DlBK9Drk.js";import{o as f}from"./if-defined-DerKRcyC.js";import{o as x}from"./style-map-DE4G47KD.js";import{L as g,B as h}from"./Icon-CWyJRQf7.js";import"./preload-helper-PPVm8Dsz.js";import"./property-Bmq4RTSP.js";import"./ReadyMixin-CvX_eidU.js";const{events:y,args:z,argTypes:n}=v("btu-icon"),u=["xs","sm","md","lg","xl"],w=["ai","error","gray","primary","purple","rose","success","teal","warning"],B={title:"Components/Icon",component:"btu-icon",tags:["autodocs"],parameters:{docs:{subtitle:"An icon component using Lucide icons with built-in support for custom colors and sizes.",description:{component:`
|
|
2
2
|
<strong>When to use:</strong>
|
|
3
3
|
<ul>
|
|
4
4
|
<li>To visually reinforce actions, states, or categories</li>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as c,x as d}from"./iframe-
|
|
1
|
+
import{i as c,x as d}from"./iframe-DlBK9Drk.js";import{n as r}from"./property-Bmq4RTSP.js";import{o as l}from"./if-defined-DerKRcyC.js";import{E as y,R as m}from"./ReadyMixin-CvX_eidU.js";import{T as h}from"./TooltipMixin-CVKslCDt.js";import"./Icon-CWyJRQf7.js";var f=Object.defineProperty,n=(a,t,e,s)=>{for(var o=void 0,u=a.length-1,p;u>=0;u--)(p=a[u])&&(o=p(t,e,o)||o);return o&&f(t,e,o),o};const b={primary:["btu-button-primary"],"primary-clear":["btu-button-primary","btu-button-fill-none"],"primary-stroke":["btu-button-primary","btu-button-fill-none","btu-button-outline"],secondary:["btu-button-gray"],"secondary-clear":["btu-button-gray","btu-button-fill-none"],"secondary-stroke":["btu-button-gray","btu-button-fill-none","btu-button-outline"],tertiary:["btu-button-teal"],"tertiary-clear":["btu-button-teal","btu-button-fill-none"],"tertiary-stroke":["btu-button-teal","btu-button-fill-none","btu-button-outline"]},v=new Set(["sm","md","lg"]);class i extends h(y(m(c))){constructor(){super(...arguments),this.type="primary",this.size="md",this.destructive=!1,this.disabled=!1}createRenderRoot(){return this}willUpdate(t){super.willUpdate(t),t.has("type")&&!(this.type in b)&&(console.warn(`[btu-icon-button] Unrecognized type: "${this.type}". Falling back to "primary".`),this.type="primary"),t.has("size")&&!v.has(this.size)&&(console.warn(`[btu-icon-button] Unrecognized size: "${this.size}". Falling back to "md".`),this.size="md")}updated(t){super.updated(t),this._relayTooltipAttrs()}_relayTooltipAttrs(){const t=this.querySelector("button");if(!t)return;const e=this.style.getPropertyValue("anchor-name");e&&(this.style.removeProperty("anchor-name"),t.style.setProperty("anchor-name",e));const s=this.querySelector("[data-tooltip-internal]");s?(this.removeAttribute("aria-describedby"),t.setAttribute("aria-describedby",s.id)):t.removeAttribute("aria-describedby")}firstUpdated(t){super.firstUpdated(t),!this.getAttribute("aria-label")?.trim()&&!this.tooltip?.trim()&&console.warn('[btu-icon-button] No accessible name provided. Set "aria-label" or "tooltip" for screen readers.',this),this.emit("btu-icon-button-ready")}_handleClick(){this.emit("btu-icon-button-click",{name:this.name})}_buildButtonClasses(){const t=b[this.type]??b.primary,e=this.destructive?"btu-button-error":t[0],s=t.slice(1);return["btu-button","btu-button-text-hidden",e,...s,`btu-button-${this.size}`].filter(Boolean).join(" ")}render(){const t=this.getAttribute("aria-label")?.trim()||this.tooltip?.trim()||void 0;return d`
|
|
2
2
|
<button
|
|
3
3
|
type="button"
|
|
4
4
|
class="${this._buildButtonClasses()}"
|
package/dist/storybook/assets/{IconButton.stories-DTbfHfcQ.js → IconButton.stories-DENLoxVk.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as p,x as e}from"./iframe-
|
|
1
|
+
import{g as p,x as e}from"./iframe-DlBK9Drk.js";import{o as b}from"./if-defined-DerKRcyC.js";import"./IconButton-Di5Rgs7F.js";import{L as d}from"./Icon-CWyJRQf7.js";import"./preload-helper-PPVm8Dsz.js";import"./property-Bmq4RTSP.js";import"./ReadyMixin-CvX_eidU.js";import"./TooltipMixin-CVKslCDt.js";const{events:u,args:y,argTypes:o}=p("btu-icon-button"),w={title:"Components/Icon Button",component:"btu-icon-button",tags:["autodocs"],parameters:{docs:{subtitle:"Combines button styles with the icon component along with an opinionated API",description:{component:`
|
|
2
2
|
<h3>When to use:</h3>
|
|
3
3
|
<ul>
|
|
4
4
|
<li>For actions in compact or space-constrained interfaces (toolbars, tables, cards)</li>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as l,E as i,x as a}from"./iframe-
|
|
1
|
+
import{i as l,E as i,x as a}from"./iframe-DlBK9Drk.js";import{E as r,R as n}from"./ReadyMixin-CvX_eidU.js";import{P as o}from"./ProgressMixin-CeSrn0_P.js";class c extends o(r(n(l))){constructor(){super(...arguments),this._initialClasses=[],this._initialClassesCaptured=!1}connectedCallback(){super.connectedCallback(),this._initialClassesCaptured||(this.className&&(this._initialClasses=this.className.split(" ").filter(e=>e.trim())),this._initialClassesCaptured=!0)}createRenderRoot(){return this}willUpdate(){const e=[...this._initialClasses,"inline-flex","items-center","w-full"];this.className=e.join(" ")}firstUpdated(e){super.firstUpdated(e),this._setupInitialAnimation()}disconnectedCallback(){super.disconnectedCallback(),this._cleanupInitialAnimation()}updated(e){super.updated(e),this._trackCompletion()}render(){const e=this.thickness??8,t=this._getProgressColorValue(),s=this._getAnimatedProgress();return a`
|
|
2
2
|
<div class="flex w-full items-center gap-3">
|
|
3
3
|
<span
|
|
4
4
|
class="flex-1 blokk"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as D,E as h,x as T}from"./iframe-
|
|
1
|
+
import{g as D,E as h,x as T}from"./iframe-DlBK9Drk.js";import{o as A}from"./style-map-DE4G47KD.js";import"./LinearProgress-D9ngIVlv.js";import"./preload-helper-PPVm8Dsz.js";import"./ReadyMixin-CvX_eidU.js";import"./ProgressMixin-CeSrn0_P.js";import"./property-Bmq4RTSP.js";import"./aria-D5THOgos.js";const{events:V,args:k,argTypes:g}=D("btu-linear-progress"),R={title:"Components/Linear Progress",component:"btu-linear-progress",tags:["autodocs"],parameters:{docs:{subtitle:"A horizontal progress bar for showing task completion",description:{component:`
|
|
2
2
|
<h3>When to use:</h3>
|
|
3
3
|
<ul>
|
|
4
4
|
<li>To show progress of a specific task with known completion percentage</li>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as u,E as b,x as d}from"./iframe-
|
|
1
|
+
import{i as u,E as b,x as d}from"./iframe-DlBK9Drk.js";import{n as o}from"./property-Bmq4RTSP.js";import{E as p,R as h}from"./ReadyMixin-CvX_eidU.js";import{l as g}from"./i18n-BQ-Uj-0B.js";import{o as f}from"./onFind-Ci35eu2y.js";import"./IconButton-Di5Rgs7F.js";import"./Icon-CWyJRQf7.js";var v=Object.defineProperty,l=(c,e,i,r)=>{for(var s=void 0,t=c.length-1,a;t>=0;t--)(a=c[t])&&(s=a(e,i,s)||s);return s&&v(e,i,s),s};const y={primary:"info",info:"info",warning:"triangle-alert",error:"circle-alert",success:"circle-check"},m={primary:"btu-message-primary",info:"btu-message-info",warning:"btu-message-warning",error:"btu-message-error",success:"btu-message-success"};class n extends p(h(u)){constructor(){super(...arguments),this.variant="info",this.dismissible=!1,this._safeVariant="info"}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("btu-message"),this.setAttribute("aria-atomic","true")}willUpdate(e){if(super.willUpdate(e),e.has("variant")){this._safeVariant=this.variant in m?this.variant:"info",this._safeVariant!==this.variant&&console.warn(`[btu-message] Unrecognized variant: "${this.variant}". Falling back to "info".`,this);const i=this._safeVariant==="error"||this._safeVariant==="primary";this.setAttribute("role",i?"alert":"status"),this.setAttribute("aria-live",i?"assertive":"polite");const r=m[this._safeVariant];for(const s of Object.values(m))s!==r&&this.classList.remove(s);this.classList.add(r)}}firstUpdated(){const e=!!this.querySelector(':scope > [slot="description"]');!this.label?.trim()&&!e&&console.warn("[btu-message] No label or description provided.",this);const i=this.querySelector(".btu-message-badge"),r=this.querySelector(".btu-message-description"),s=this.querySelector(".btu-message-actions");i&&r&&s&&f(this,":scope > :not([data-message-internal])",t=>{const a=t.getAttribute("slot");a==="badge"?i.appendChild(t):a==="description"?(r.appendChild(t),this.classList.add("btu-message-has-description")):a==="actions"?s.appendChild(t):console.warn(a?`[btu-message] Unrecognized slot="${a}". Valid slots are "badge", "description", and "actions".`:'[btu-message] Child element has no slot attribute. Use slot="badge", "description", or "actions".',t)}),this.emit("btu-message-ready")}_handleDismiss(){const e=new CustomEvent("btu-message-dismiss",{bubbles:!0,cancelable:!0,composed:!0});this.dispatchEvent(e)&&(this.hidden=!0)}render(){const e=this.symbol??y[this._safeVariant];return d`
|
|
2
2
|
<btu-icon
|
|
3
3
|
class="btu-message-icon"
|
|
4
4
|
symbol="${e}"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as S,E as v,x as s}from"./iframe-
|
|
1
|
+
import{g as S,E as v,x as s}from"./iframe-DlBK9Drk.js";import{o as f}from"./if-defined-DerKRcyC.js";import{o as w}from"./style-map-DE4G47KD.js";import"./Badge-bWrvpEgX.js";import"./Message-nFAa55c_.js";import"./Pagination-CSWcjuDU.js";import{L as k}from"./Icon-CWyJRQf7.js";import"./preload-helper-PPVm8Dsz.js";import"./property-Bmq4RTSP.js";import"./ReadyMixin-CvX_eidU.js";import"./i18n-BQ-Uj-0B.js";import"./aria-D5THOgos.js";import"./onFind-Ci35eu2y.js";import"./IconButton-Di5Rgs7F.js";import"./TooltipMixin-CVKslCDt.js";import"./CircularProgress-eqVb2jUD.js";import"./ProgressMixin-CeSrn0_P.js";import"./DropdownMenu-B-LvOIGj.js";import"./RovingTabindexMixin-9z8lwaM9.js";const{events:x,args:L,argTypes:o}=S("btu-message"),T=["primary","info","warning","error","success"],C=[{variant:"primary",label:"Scheduled maintenance on Saturday",description:"Expect up to 30 minutes of downtime starting at 02:00 UTC."},{variant:"info",label:"New feature released",description:"The redesigned editor is now available for all workspaces."},{variant:"warning",label:"API rate limits were updated",description:"Review your usage dashboard to make sure your integrations are still within limits."},{variant:"success",label:"Billing anomaly resolved",description:"All affected invoices have been corrected — no action needed."}],$=(e,t)=>{e.setAttribute("variant",t.variant),e.setAttribute("label",t.label);const n=e.querySelector(".btu-message-description");n&&(n.textContent=t.description??"")},j={title:"Components/Message",component:"btu-message",tags:["autodocs"],parameters:{docs:{subtitle:"High-visibility messages and persistent status anchored to a page or container",description:{component:`
|
|
2
2
|
<h3>When to use:</h3>
|
|
3
3
|
<ul>
|
|
4
4
|
<li>Communicate messages or provide feedback that is not tied to the user's current action or task</li>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./iframe-
|
|
1
|
+
import"./iframe-DlBK9Drk.js";import{o as r}from"./onFind-Ci35eu2y.js";const d=n=>{class i extends n{#t=[];onFindRegistration(){return null}#s(){if(this.#t.length)return;const t=this.onFindRegistration();if(!t)return;const e=Array.isArray(t)?t:[t];this.#t=e.map(s=>r(this,s.selectors,s.callback))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&this.#s()}firstUpdated(t){super.firstUpdated(t),this.#s()}disconnectedCallback(){super.disconnectedCallback(),this.#t.forEach(t=>t()),this.#t=[]}}return i};export{d as O};
|
package/dist/storybook/assets/{OnFindMixin.stories-Dq06nuVf.js → OnFindMixin.stories-CdeS5sFA.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{x as h,i as v}from"./iframe-
|
|
1
|
+
import{x as h,i as v}from"./iframe-DlBK9Drk.js";import{O as x}from"./OnFindMixin-oL1bvTFj.js";import"./preload-helper-PPVm8Dsz.js";import"./onFind-Ci35eu2y.js";const{expect:o,userEvent:d,waitFor:a,within:w}=__STORYBOOK_MODULE_TEST__,b="ofm-demo";if(!customElements.get(b)){class e extends x(v){onFindRegistration(){return{selectors:":scope > .ofm-item",callback:t=>t.classList.add("ring-2","ring-success-500")}}render(){return h`<slot></slot>`}}customElements.define(b,e)}const p="ofm-multi";if(!customElements.get(p)){class e extends x(v){onFindRegistration(){return[{selectors:":scope > .ofm-a",callback:t=>t.classList.add("ring-2","ring-success-500")},{selectors:":scope > .ofm-b",callback:t=>t.classList.add("ring-2","ring-primary-500")}]}render(){return h`<slot></slot>`}}customElements.define(p,e)}function g(){return globalThis[Symbol.for("brightspot.onFind")]?.callbacks?.length??0}const M={title:"Mixins/OnFind Mixin",tags:["autodocs"],parameters:{docs:{description:{component:`
|
|
2
2
|
\`OnFindMixin\` registers an \`onFind\` child-redistribution callback and
|
|
3
3
|
**tears it down on disconnect**, so a detached component is garbage-collectable
|
|
4
4
|
and stops being visited on every document mutation.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as d,E as p,x as o}from"./iframe-
|
|
1
|
+
import{i as d,E as p,x as o}from"./iframe-DlBK9Drk.js";import{n}from"./property-Bmq4RTSP.js";import{E as b,R as c}from"./ReadyMixin-CvX_eidU.js";import{l}from"./i18n-BQ-Uj-0B.js";import"./CircularProgress-eqVb2jUD.js";import"./DropdownMenu-B-LvOIGj.js";import"./IconButton-Di5Rgs7F.js";var m=Object.defineProperty,r=(u,t,e,i)=>{for(var a=void 0,g=u.length-1,h;g>=0;g--)(h=u[g])&&(a=h(t,e,a)||a);return a&&m(t,e,a),a};class s extends b(c(d)){constructor(){super(...arguments),this.page=1,this.pageSize=0,this.disabled=!1,this.loading=!1,this.hideOnSinglePage=!0,this.pageSizeChanger=!0,this.pageSizeOptions="10, 20, 50",this.totalItems=0,this.boundaryButtons=!0,this.hideTotalCount=!1,this.pageJumper=!1,this._userInitiated=!1,this.initialClasses=[],this._initialClassesCaptured=!1,this._hideControls=!1}get _parsedPageSizeOptions(){const t=this.pageSizeOptions.split(",").map(e=>parseInt(e.trim(),10)).filter(e=>!isNaN(e)&&e>0);return t.length>0?t:[10]}get _totalPages(){return this.pageSize<=0?1:Math.max(1,Math.ceil(this.totalItems/this.pageSize))}get _startItem(){return this.totalItems===0?0:(this.page-1)*this.pageSize+1}get _endItem(){return this.totalItems===0?0:Math.min(this.page*this.pageSize,this.totalItems)}connectedCallback(){super.connectedCallback(),this._initialClassesCaptured||(this.className&&(this.initialClasses=this.className.split(" ").filter(t=>t.trim())),this._initialClassesCaptured=!0)}createRenderRoot(){return this}willUpdate(){(isNaN(this.totalItems)||this.totalItems<0)&&(this.totalItems=0),this.pageSize<=0&&(this.pageSize=this._parsedPageSizeOptions[0]);const t=this._parsedPageSizeOptions;t.includes(this.pageSize)||(this.pageSize=t[0]);const e=this._totalPages;this.page<1&&(this.page=1),this.page>e&&(this.page=e),this._hideControls=this.hideOnSinglePage&&this._totalPages<=1;const i=this._hideControls&&this.hideTotalCount,a=[...this.initialClasses,"btu-pagination",i?"btu-pagination-hidden":"",this.disabled?"btu-pagination-disabled":"",this.loading?"btu-pagination-loading":""];this.className=a.filter(Boolean).join(" ")}firstUpdated(){this.emit("btu-pagination-ready")}updated(t){super.updated(t),this._setupSlots(),this._userInitiated&&(this._userInitiated=!1,t.has("pageSize")&&this.emit("btu-pagination-page-size-change",{page:this.page,pageSize:this.pageSize}),t.has("page")&&this.emit("btu-pagination-change",{page:this.page,pageSize:this.pageSize}))}_setupSlots(){const t=this.querySelector(':scope > [slot="page-size"]');if(t){const i=this.querySelector(".btu-pagination-size-changer");i&&t.parentElement!==i&&i.appendChild(t)}const e=this.querySelector(':scope > [slot="jumper"]');if(e){const i=this.querySelector(".btu-pagination-jumper");i&&e.parentElement!==i&&i.appendChild(e)}}_goToFirstPage(t){this._userInitiated=!0,this.page=1,this._manageBoundaryFocus(t.currentTarget)}_goToPreviousPage(t){this._userInitiated=!0,this.page=Math.max(1,this.page-1),this._manageBoundaryFocus(t.currentTarget)}_goToNextPage(t){this._userInitiated=!0,this.page=Math.min(this._totalPages,this.page+1),this._manageBoundaryFocus(t.currentTarget)}_goToLastPage(t){this._userInitiated=!0,this.page=this._totalPages,this._manageBoundaryFocus(t.currentTarget)}_manageBoundaryFocus(t){this.updateComplete.then(()=>{if(t.disabled){const e=this.querySelectorAll(".btu-pagination-controls > btu-icon-button:not([disabled]) .btu-button");e.length>0&&e[0].focus()}})}_onBuiltinPageSizeSelect(t){const e=t.detail,i=parseInt(e.value,10);if(isNaN(i)||i<=0)return;this._userInitiated=!0,this.pageSize=i;const a=Math.max(1,Math.ceil(this.totalItems/i));this.page>a&&(this.page=a)}_onBuiltinJumperSelect(t){const e=parseInt(t.detail.value,10);!isNaN(e)&&e>=1&&e<=this._totalPages&&(this._userInitiated=!0,this.page=e)}render(){const t=this.page<=1,e=this.page>=this._totalPages,i=this._parsedPageSizeOptions;return o`
|
|
2
2
|
<nav class="btu-pagination-nav" aria-label="${this.label??l("pagination","navLabel","Pagination")}">
|
|
3
3
|
${this._hideControls?p:o`<div class="btu-pagination-size-changer">
|
|
4
4
|
${this.pageSizeChanger&&!this.querySelector('[slot="page-size"]')?o`
|
package/dist/storybook/assets/{Pagination.stories-BsH2eN2W.js → Pagination.stories-Da2WzJkv.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as m,x as p}from"./iframe-
|
|
1
|
+
import{g as m,x as p}from"./iframe-DlBK9Drk.js";import{o as g}from"./style-map-DE4G47KD.js";import"./Icon-CWyJRQf7.js";import"./Pagination-CSWcjuDU.js";import"./preload-helper-PPVm8Dsz.js";import"./property-Bmq4RTSP.js";import"./ReadyMixin-CvX_eidU.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"./TooltipMixin-CVKslCDt.js";import"./Badge-bWrvpEgX.js";import"./RovingTabindexMixin-9z8lwaM9.js";import"./IconButton-Di5Rgs7F.js";import"./if-defined-DerKRcyC.js";const{events:b,args:h,argTypes:y}=m("btu-pagination"),c=t=>{const e={};return t.customBackgroundColor&&(e["--pagination-color-background"]=t.customBackgroundColor),t.customForegroundColor&&(e["--pagination-color-foreground"]=t.customForegroundColor),e},M={title:"Components/Pagination",component:"btu-pagination",tags:["autodocs"],parameters:{docs:{subtitle:"A component for navigating through paged content",description:{component:`
|
|
2
2
|
<h3>When to use:</h3>
|
|
3
3
|
<ul>
|
|
4
4
|
<li>To navigate through large sets of data</li>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as x,g as E,x as h}from"./iframe-
|
|
1
|
+
import{i as x,g as E,x as h}from"./iframe-DlBK9Drk.js";import{o as T}from"./if-defined-DerKRcyC.js";import{o as k}from"./style-map-DE4G47KD.js";import{n as p}from"./property-Bmq4RTSP.js";import{E as C,R as L}from"./ReadyMixin-CvX_eidU.js";import"./preload-helper-PPVm8Dsz.js";var S=Object.defineProperty,d=(t,e,i,n)=>{for(var o=void 0,r=t.length-1,s;r>=0;r--)(s=t[r])&&(o=s(e,i,o)||o);return o&&S(e,i,o),o};const A={top:"btu-popover-top",bottom:"btu-popover-bottom",left:"btu-popover-left",right:"btu-popover-right"},P={up:"btu-popover-tail-up",down:"btu-popover-tail-down",left:"btu-popover-tail-left",right:"btu-popover-tail-right"},D={top:"down",bottom:"up",left:"right",right:"left"},_={sm:"btu-popover-offset-sm",md:"btu-popover-offset-md",lg:"btu-popover-offset-lg",xl:"btu-popover-offset-xl"};class l extends C(L(x)){constructor(){super(...arguments),this.position="bottom",this.trigger="click",this.delay=300,this.offset=null,this.noArrow=!1,this.inverted=!1,this.open=!1,this.panelLabel="",this._panelEl=null,this._panelId=`btu-popover-${crypto.randomUUID()}`,this._anchorName=`--btu-popover-trigger-${crypto.randomUUID()}`,this._tailDirection=null,this._tailSyncQueued=!1,this._showTimer=null,this._hideTimer=null,this._isVisible=!1,this.initialClasses=[],this._initialClassesCaptured=!1,this._onTriggerMouseEnter=this._handleTriggerMouseEnter.bind(this),this._onTriggerMouseLeave=this._handleTriggerMouseLeave.bind(this),this._onTriggerFocusIn=this._handleTriggerFocusIn.bind(this),this._onTriggerFocusOut=this._handleTriggerFocusOut.bind(this),this._onPanelMouseEnter=this._handlePanelMouseEnter.bind(this),this._onPanelMouseLeave=this._handlePanelMouseLeave.bind(this),this._onNativeToggle=this._handleNativeToggle.bind(this),this._onKeyDown=this._handleKeyDown.bind(this),this._onViewportChange=this._handleViewportChange.bind(this)}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this._initialClassesCaptured||(this.className&&(this.initialClasses=this.className.split(" ").filter(e=>e.trim())),this._initialClassesCaptured=!0)}disconnectedCallback(){if(this._clearTimers(),this._unbindTriggerListeners(),this._unbindPanelListeners(),this._unbindViewportListeners(),document.removeEventListener("keydown",this._onKeyDown),this._panelEl){try{this._panelEl.hidePopover()}catch(e){e instanceof DOMException&&e.name==="InvalidStateError"||console.warn("[btu-popover] Failed to hide popover during disconnect:",e)}this._panelEl.removeEventListener("toggle",this._onNativeToggle),this._panelEl.remove(),this._panelEl=null}this._isVisible=!1,super.disconnectedCallback()}willUpdate(){const e=[...this.initialClasses];this.className=e.filter(Boolean).join(" ")}firstUpdated(){this._setupPanel(),this._bindTriggerListeners(),this.open&&this._show()}updated(e){super.updated(e),e.has("trigger")&&e.get("trigger")!==void 0&&(this._unbindTriggerListeners(),this._bindTriggerListeners(),this._panelEl&&(this._isVisible&&this._hide(),this._panelEl.setAttribute("popover",this.trigger==="click"?"auto":"manual"))),(e.has("position")||e.has("noArrow")||e.has("offset")||e.has("inverted"))&&(e.has("position")&&(this._tailDirection=null),this._panelEl&&(this._panelEl.className=this._buildPanelClasses(),e.has("position")&&requestAnimationFrame(()=>this._syncTailDirection()))),e.has("panelLabel")&&this._panelEl&&(this.panelLabel?this._panelEl.setAttribute("aria-label",this.panelLabel):this._panelEl.removeAttribute("aria-label")),e.has("open")&&e.get("open")!==void 0&&(this.open&&!this._isVisible?this._show():!this.open&&this._isVisible&&this._hide())}_setupPanel(){const e=this.querySelector('[slot="trigger"]'),i=this.querySelector('[slot="content"]');if(!e){console.warn('[btu-popover] Missing required slot="trigger" element.');return}e.style.setProperty("anchor-name",this._anchorName),this._panelEl=document.createElement("div"),this._panelEl.id=this._panelId,this._panelEl.className=this._buildPanelClasses(),this._panelEl.setAttribute("role","dialog"),this.panelLabel&&this._panelEl.setAttribute("aria-label",this.panelLabel),this._panelEl.setAttribute("data-popover-internal",""),this._panelEl.style.setProperty("position-anchor",this._anchorName),this._panelEl.setAttribute("popover",this.trigger==="click"?"auto":"manual"),this._panelEl.addEventListener("toggle",this._onNativeToggle),i&&(i.removeAttribute("slot"),i.style.display="",this._panelEl.appendChild(i)),this.appendChild(this._panelEl),e.setAttribute("aria-expanded","false"),e.setAttribute("aria-controls",this._panelId),this._bindPanelListeners()}_buildPanelClasses(){const e=["btu-popover",A[this.position]];return this.offset&&_[this.offset]&&e.push(_[this.offset]),this.noArrow&&e.push("btu-popover-no-arrow"),this.inverted&&e.push("btu-popover-inverted"),this._tailDirection&&e.push(P[this._tailDirection]),e.join(" ")}_syncTailDirection(){const e=this._panelEl,i=this._getTriggerEl();if(!e||!i||!this._isVisible)return;const n=e.getBoundingClientRect(),o=i.getBoundingClientRect();if(n.width===0||o.width===0)return;const s=this.position==="top"||this.position==="bottom"?n.top+n.height/2>=o.top+o.height/2?"up":"down":n.left+n.width/2>=o.left+o.width/2?"left":"right",a=s===D[this.position]?null:s;a!==this._tailDirection&&(this._tailDirection=a,e.className=this._buildPanelClasses())}_handleViewportChange(){this._tailSyncQueued||(this._tailSyncQueued=!0,requestAnimationFrame(()=>{this._tailSyncQueued=!1,this._syncTailDirection()}))}_bindViewportListeners(){window.addEventListener("scroll",this._onViewportChange,!0),window.addEventListener("resize",this._onViewportChange)}_unbindViewportListeners(){window.removeEventListener("scroll",this._onViewportChange,!0),window.removeEventListener("resize",this._onViewportChange)}_getTriggerEl(){return this.querySelector('[slot="trigger"]')}_bindTriggerListeners(){const e=this._getTriggerEl();e&&(this.trigger==="click"&&e.setAttribute("popovertarget",this._panelId),this.trigger==="hover"&&(e.addEventListener("mouseenter",this._onTriggerMouseEnter),e.addEventListener("mouseleave",this._onTriggerMouseLeave)),this.trigger==="focus"&&(e.addEventListener("focusin",this._onTriggerFocusIn),e.addEventListener("focusout",this._onTriggerFocusOut)),this.trigger!=="click"&&document.addEventListener("keydown",this._onKeyDown))}_unbindTriggerListeners(){const e=this._getTriggerEl();e&&(e.removeAttribute("popovertarget"),e.removeEventListener("mouseenter",this._onTriggerMouseEnter),e.removeEventListener("mouseleave",this._onTriggerMouseLeave),e.removeEventListener("focusin",this._onTriggerFocusIn),e.removeEventListener("focusout",this._onTriggerFocusOut),document.removeEventListener("keydown",this._onKeyDown))}_bindPanelListeners(){this._panelEl&&(this._panelEl.addEventListener("mouseenter",this._onPanelMouseEnter),this._panelEl.addEventListener("mouseleave",this._onPanelMouseLeave))}_unbindPanelListeners(){this._panelEl&&(this._panelEl.removeEventListener("mouseenter",this._onPanelMouseEnter),this._panelEl.removeEventListener("mouseleave",this._onPanelMouseLeave))}_show(){if(this._clearHideTimer(),!(this._isVisible||!this._panelEl))try{this._panelEl.showPopover()}catch(e){e instanceof DOMException&&e.name==="InvalidStateError"||console.warn("[btu-popover] Failed to show popover:",e)}}_hide(){if(this._clearTimers(),!(!this._isVisible||!this._panelEl))try{this._panelEl.hidePopover()}catch(e){e instanceof DOMException&&e.name==="InvalidStateError"||console.warn("[btu-popover] Failed to hide popover:",e)}}_handleNativeToggle(e){const{newState:i}=e;if(i==="open"){this._isVisible=!0,this.open=!0;const n=this._getTriggerEl();n&&n.setAttribute("aria-expanded","true"),requestAnimationFrame(()=>this._syncTailDirection()),this._bindViewportListeners(),this.emit("btu-popover-show")}else{this._isVisible=!1,this.open=!1,this._unbindViewportListeners();const n=this._getTriggerEl();n&&(n.setAttribute("aria-expanded","false"),document.activeElement===document.body&&n.focus()),this.emit("btu-popover-hide")}}_handleKeyDown(e){e.key==="Escape"&&(this._clearTimers(),this._hide())}_clearShowTimer(){this._showTimer!==null&&(clearTimeout(this._showTimer),this._showTimer=null)}_clearHideTimer(){this._hideTimer!==null&&(clearTimeout(this._hideTimer),this._hideTimer=null)}_clearTimers(){this._clearShowTimer(),this._clearHideTimer()}_handleTriggerMouseEnter(){this._clearTimers(),this._showTimer=setTimeout(()=>this._show(),this.delay)}_handleTriggerMouseLeave(){this._clearTimers(),this._hideTimer=setTimeout(()=>this._hide(),100)}_handleTriggerFocusIn(){this._clearTimers(),this._show()}_handleTriggerFocusOut(){this._clearTimers(),this._hide()}_handlePanelMouseEnter(){this.trigger==="hover"&&this._clearTimers()}_handlePanelMouseLeave(){this.trigger==="hover"&&(this._clearTimers(),this._hideTimer=setTimeout(()=>this._hide(),100))}}d([p({attribute:"position"})],l.prototype,"position");d([p({attribute:"trigger"})],l.prototype,"trigger");d([p({attribute:"delay",type:Number})],l.prototype,"delay");d([p({attribute:"offset"})],l.prototype,"offset");d([p({attribute:"no-arrow",type:Boolean})],l.prototype,"noArrow");d([p({attribute:"inverted",type:Boolean})],l.prototype,"inverted");d([p({attribute:"open",type:Boolean,reflect:!0})],l.prototype,"open");d([p({attribute:"panel-label"})],l.prototype,"panelLabel");customElements.get("btu-popover")||customElements.define("btu-popover",l);const{expect:u,waitFor:w}=__STORYBOOK_MODULE_TEST__,{events:F,args:B,argTypes:c}=E("btu-popover"),z={title:"Components/Popover",component:"btu-popover",tags:["autodocs"],parameters:{docs:{subtitle:"Rich interactive content anchored to a trigger element",description:{component:`
|
|
2
2
|
\`btu-popover\` displays rich interactive content anchored to a trigger element using CSS anchor positioning and the native Popover API.
|
|
3
3
|
|
|
4
4
|
<h3>When to use:</h3>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as r}from"./property-
|
|
1
|
+
import{n as r}from"./property-Bmq4RTSP.js";import{a as p}from"./aria-D5THOgos.js";var h=Object.defineProperty,m=Object.getOwnPropertyDescriptor,s=(n,t,o,e)=>{for(var i=e>1?void 0:e?m(t,o):t,a=n.length-1,l;a>=0;a--)(l=n[a])&&(i=(e?l(t,o,i):l(i))||i);return e&&i&&h(t,o,i),i};const _=n=>{class t extends n{constructor(){super(...arguments),this.color="primary",this._progress=0,this.initialAnimation=!0,this.ariaLabel=null,this.ariaLabelledBy=null,this.ariaValueText=null,this._isAnimationInitialized=!1,this._hasCompletedAt100=!1}get progress(){return this._progress}set progress(e){const i=isNaN(e)?0:e;this._progress=Math.min(Math.max(i,0),100)}_getProgressColorValue(){return this.color==="white"||this.color==="black"?`var(--progress-color, var(--btu-theme-${this.color}))`:`var(--progress-color, oklch(var(--btu-theme-${this.color}-600)))`}_getAnimatedProgress(){return this.initialAnimation&&!this._isAnimationInitialized?0:this._progress}_setupInitialAnimation(){if(!this.initialAnimation||this._isAnimationInitialized){this._isAnimationInitialized=!0;return}this._cleanupInitialAnimation(),this._intersectionObserver=new IntersectionObserver(e=>{e.forEach(i=>{i.isIntersecting&&!this._isAnimationInitialized&&(requestAnimationFrame(()=>{this._isAnimationInitialized=!0,this.requestUpdate()}),this._intersectionObserver?.disconnect())})},{threshold:.1}),this._intersectionObserver.observe(this)}_cleanupInitialAnimation(){this._intersectionObserver?.disconnect()}get _hostTag(){return this.tagName.toLowerCase()}firstUpdated(e){super.firstUpdated(e),this.emit(`${this._hostTag}-ready`)}_trackCompletion(){this._progress===100&&!this._hasCompletedAt100?(this._hasCompletedAt100=!0,this.emit(`${this._hostTag}-complete`),this.completionAnnouncement&&p(this.completionAnnouncement)):this._progress<100&&this._hasCompletedAt100&&(this._hasCompletedAt100=!1)}}return s([r({type:String})],t.prototype,"color",2),s([r({type:Number})],t.prototype,"thickness",2),s([r({type:Number})],t.prototype,"progress",1),s([r({type:String})],t.prototype,"label",2),s([r({type:Boolean,attribute:"initial-animation"})],t.prototype,"initialAnimation",2),s([r({type:String,attribute:"aria-label"})],t.prototype,"ariaLabel",2),s([r({type:String,attribute:"aria-labelledby"})],t.prototype,"ariaLabelledBy",2),s([r({type:String,attribute:"aria-valuetext"})],t.prototype,"ariaValueText",2),s([r({type:String,attribute:"completion-announcement"})],t.prototype,"completionAnnouncement",2),t};export{_ as P};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as f,ae as _,af as d,al as m,ag as u,E as c,am as y,i as v,x as l}from"./iframe-
|
|
1
|
+
import{e as f,ae as _,af as d,al as m,ag as u,E as c,am as y,i as v,x as l}from"./iframe-DlBK9Drk.js";import{n as r}from"./property-Bmq4RTSP.js";import{o as h}from"./if-defined-DerKRcyC.js";import{E as g,R as k}from"./ReadyMixin-CvX_eidU.js";import{T as C}from"./TooltipMixin-CVKslCDt.js";const I=f(class extends _{constructor(t){if(super(t),t.type!==d.PROPERTY&&t.type!==d.ATTRIBUTE&&t.type!==d.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!m(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===u||e===c)return e;const i=t.element,o=t.name;if(t.type===d.PROPERTY){if(e===i[o])return u}else if(t.type===d.BOOLEAN_ATTRIBUTE){if(!!e===i.hasAttribute(o))return u}else if(t.type===d.ATTRIBUTE&&i.getAttribute(o)===e+"")return u;return y(t),e}});var E=Object.defineProperty,a=(t,e,i,o)=>{for(var n=void 0,p=t.length-1,b;p>=0;p--)(b=t[p])&&(n=b(e,i,n)||n);return n&&E(e,i,n),n};class s extends C(g(k(v))){constructor(){super(...arguments),this.size="sm",this.checked=!1,this.disabled=!1,this.invalid=!1,this._tabindex=0,this._groupDisabled=!1,this._groupRequired=!1,this._userInitiated=!1,this._initialClasses=[],this._initialClassesCaptured=!1,this._descId=`radio-desc-${crypto.randomUUID()}`,this._errorId=`radio-error-${crypto.randomUUID()}`,this._handleClick=e=>{if(this._isDisabled||e.target.closest(".btu-radio-input"))return;const i=this.renderRoot.querySelector(".btu-radio-input");i?.focus({focusVisible:!1}),i?.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 i=[...this._initialClasses,"btu-radio",this.size==="md"&&"btu-radio-md",(this.invalid||this.error)&&"btu-radio-invalid"];this.className=i.filter(Boolean).join(" ")}firstUpdated(e){super.firstUpdated(e),this.emit("btu-radio-ready")}updated(e){super.updated(e),this._relayAriaDescribedBy(),this._userInitiated&&(this._userInitiated=!1,e.has("checked")&&(this.value==null&&console.warn("btu-radio: selected without a `value`; the parent btu-radio-group cannot track this option.",this),this.emit("btu-radio-change",{checked:this.checked,value:this.value??""})))}_onInputChange(e){const i=e.target;this._userInitiated=!0,this.checked=i.checked}get _isDisabled(){return this.disabled||this._groupDisabled}get _describedBy(){const e=[];return this.description&&e.push(this._descId),this.error&&e.push(this._errorId),e.length?e.join(" "):void 0}_relayAriaDescribedBy(){const e=this.renderRoot.querySelector(".btu-radio-input");if(!e)return;this.removeAttribute("aria-describedby");const i=this.renderRoot.querySelector("[data-tooltip-internal]")?.id,o=[this._describedBy,i].filter(Boolean).join(" ");o?e.setAttribute("aria-describedby",o):e.removeAttribute("aria-describedby")}render(){return l`
|
|
2
2
|
<input
|
|
3
3
|
type="radio"
|
|
4
4
|
class="btu-radio-input"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as h,x as m}from"./iframe-
|
|
1
|
+
import{g as h,x as m}from"./iframe-DlBK9Drk.js";import{o}from"./if-defined-DerKRcyC.js";import{o as g}from"./style-map-DE4G47KD.js";import"./Radio-rvfGhZwK.js";import"./preload-helper-PPVm8Dsz.js";import"./property-Bmq4RTSP.js";import"./ReadyMixin-CvX_eidU.js";import"./TooltipMixin-CVKslCDt.js";const{events:y,args:S,argTypes:u}=h("btu-radio"),f={customColorPrimary:"--radio-color-primary",customColorBorder:"--radio-color-border",customColorError:"--radio-color-error",customLabelSpacing:"--radio-label-spacing"},v=e=>Object.entries(f).reduce((d,[p,b])=>(e[p]&&(d[b]=e[p]),d),{}),T={title:"Components/Radio",component:"btu-radio",tags:["autodocs"],parameters:{docs:{subtitle:"A single option within a radio group",description:{component:"\nA single radio option. Place several inside a `btu-radio-group`, which owns the shared\n`name`, selection state, and keyboard navigation. See the <strong>Radio Group</strong> stories\nfor the full pattern — the stories here show a single option's visual states.\n "}},actions:{handles:y},controls:{expanded:!0}},args:{...S,label:"Pro",checked:!1},argTypes:{...u,"--radio-color-primary":{table:{disable:!0}},"--radio-color-border":{table:{disable:!0}},"--radio-color-error":{table:{disable:!0}},"--radio-label-spacing":{table:{disable:!0}},"--radio-box-size":{table:{disable:!0}},"--radio-dot-size":{table:{disable:!0}},size:{...u.size,control:{type:"select"},options:["sm","md"]},customColorPrimary:{name:"--radio-color-primary",control:{type:"color"},description:"Fill and border color when selected",table:{category:"CSS Properties"}},customColorBorder:{name:"--radio-color-border",control:{type:"color"},description:"Border color in the unselected state",table:{category:"CSS Properties"}},customColorError:{name:"--radio-color-error",control:{type:"color"},description:"Border and text color in the error state",table:{category:"CSS Properties"}},customLabelSpacing:{name:"--radio-label-spacing",control:{type:"text"},description:"Distance between the radio and the label (default: 0.75rem)",table:{category:"CSS Properties"}}},render:e=>m`
|
|
2
2
|
<btu-radio
|
|
3
3
|
size=${o(e.size)}
|
|
4
4
|
label=${o(e.label)}
|
package/dist/storybook/assets/{RadioGroup.stories-B-TGP_-v.js → RadioGroup.stories-D8krOSlP.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as q,x as u,g as S}from"./iframe-
|
|
1
|
+
import{i as q,x as u,g as S}from"./iframe-DlBK9Drk.js";import{o as p}from"./if-defined-DerKRcyC.js";import{o as A}from"./style-map-DE4G47KD.js";import"./Radio-rvfGhZwK.js";import{n as d}from"./property-Bmq4RTSP.js";import{E as R,R as D}from"./ReadyMixin-CvX_eidU.js";import{R as F}from"./RovingTabindexMixin-9z8lwaM9.js";import"./preload-helper-PPVm8Dsz.js";import"./TooltipMixin-CVKslCDt.js";var B=Object.defineProperty,c=(o,e,r,t)=>{for(var a=void 0,s=o.length-1,k;s>=0;s--)(k=o[s])&&(a=k(e,r,a)||a);return a&&B(e,r,a),a};class n extends F(R(D(q))){constructor(){super(...arguments),this.orientation="vertical",this.size="sm",this.required=!1,this.disabled=!1,this._initialClasses=[],this._initialClassesCaptured=!1,this._boundHandleRadioChange=this._handleRadioChange.bind(this),this._boundHandleKeyDown=this._handleKeyDown.bind(this)}connectedCallback(){super.connectedCallback(),this._initialClassesCaptured||(this.className&&(this._initialClasses=this.className.split(" ").filter(e=>e.trim())),this._initialClassesCaptured=!0),this.setAttribute("role","radiogroup"),this.addEventListener("btu-radio-change",this._boundHandleRadioChange),this.addEventListener("keydown",this._boundHandleKeyDown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("btu-radio-change",this._boundHandleRadioChange),this.removeEventListener("keydown",this._boundHandleKeyDown)}createRenderRoot(){return this}willUpdate(e){super.willUpdate(e),this.className=[...this._initialClasses,"btu-radio-group",this.orientation==="horizontal"&&"btu-radio-group-horizontal"].filter(Boolean).join(" "),this.setAttribute("aria-orientation",this.orientation),this.required?this.setAttribute("aria-required","true"):this.removeAttribute("aria-required")}firstUpdated(e){super.firstUpdated(e),this.value==null&&(this.value=this._getRadios().find(t=>t.checked)?.value),this._syncRadios();const r=this._getRovingTargets();if(r.length>0){const t=r.findIndex(a=>a.checked);this._rovingFocus(t>=0?t:0,!1)}this.emit("btu-radio-group-ready")}updated(e){super.updated(e),(e.has("value")||e.has("name")||e.has("size")||e.has("disabled")||e.has("required"))&&this._syncRadios()}_getRovingTargets(){if(this.disabled)return[];const e=[];for(const r of this._getRadios()){if(r.disabled)continue;const t=r.querySelector(".btu-radio-input");t&&e.push(t)}return e}_getRadios(){return Array.from(this.querySelectorAll("btu-radio"))}_syncRadios(){const e=this.value!=null&&this.value!=="";let r=e;this._getRadios().forEach(t=>{t.name=this.name,t.size=this.size,t._groupDisabled=this.disabled,t._groupRequired=this.required,t.checked=e&&t.value===this.value,e?t._tabindex=t.value===this.value?0:-1:!r&&!t.disabled?(t._tabindex=0,r=!0):t._tabindex=-1,t.requestUpdate()})}_selectValue(e){const r=this._getRadios().find(t=>t.value===e);!r||r.disabled||this.disabled||e===this.value||(this.value=e,this._syncRadios(),this.emit("btu-radio-group-change",{value:e}))}_handleRadioChange(e){this._selectValue(e.detail.value)}_selectFocusedRadio(){const e=document.activeElement,r=this._getRadios().find(t=>t.querySelector(".btu-radio-input")===e);r?.value==null||r.value===this.value||(this._selectValue(r.value),r.emit("btu-radio-change",{checked:!0,value:r.value}))}_handleKeyDown(e){if(this.disabled)return;const r=this.orientation==="horizontal"?"ArrowRight":"ArrowDown",t=this.orientation==="horizontal"?"ArrowLeft":"ArrowUp";switch(e.key){case r:e.preventDefault(),this._rovingNext(),this._selectFocusedRadio();break;case t:e.preventDefault(),this._rovingPrev(),this._selectFocusedRadio();break;case"Home":e.preventDefault(),this._rovingFirst(),this._selectFocusedRadio();break;case"End":e.preventDefault(),this._rovingLast(),this._selectFocusedRadio();break}}render(){return u``}}c([d()],n.prototype,"name");c([d()],n.prototype,"value");c([d({reflect:!0})],n.prototype,"orientation");c([d({reflect:!0})],n.prototype,"size");c([d({type:Boolean,reflect:!0})],n.prototype,"required");c([d({type:Boolean,reflect:!0})],n.prototype,"disabled");customElements.get("btu-radio-group")||customElements.define("btu-radio-group",n);const{expect:i,userEvent:x,waitFor:l}=__STORYBOOK_MODULE_TEST__,{events:E,args:C,argTypes:_}=S("btu-radio-group"),z={customColorPrimary:"--radio-color-primary",customColorBorder:"--radio-color-border",customLabelSpacing:"--radio-label-spacing"},T=o=>Object.entries(z).reduce((e,[r,t])=>(o[r]&&(e[t]=o[r]),e),{}),V={title:"Components/Radio Group",component:"btu-radio-group",tags:["autodocs"],parameters:{docs:{subtitle:"A set of mutually exclusive options",description:{component:`
|
|
2
2
|
<h3>When to use:</h3>
|
|
3
3
|
<ul>
|
|
4
4
|
<li>For selecting exactly one option from a small, visible set</li>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./iframe-
|
|
1
|
+
import"./iframe-DlBK9Drk.js";const l=t=>{class n extends t{connectedCallback(){super.connectedCallback(),Promise.resolve().then(()=>this.emit("btu-element-connected",{}),e=>this.emit("btu-element-error",{error:e}))}disconnectedCallback(){super.disconnectedCallback(),this.emit("btu-element-disconnected")}emit(e,c){const a=new CustomEvent(e,{bubbles:!0,cancelable:!1,composed:!0,detail:c});return this.dispatchEvent(a)}}return n},d=t=>{class n extends t{connectedCallback(){const e=()=>{super.connectedCallback()};document.readyState!=="loading"?e():document.addEventListener("DOMContentLoaded",()=>e())}}return n};export{l as E,d as R};
|
package/dist/storybook/assets/{RovingTabindexMixin-DI5rmyR7.js → RovingTabindexMixin-9z8lwaM9.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./iframe-
|
|
1
|
+
import"./iframe-DlBK9Drk.js";const v=i=>{class s extends i{constructor(){super(...arguments),this._rovingIndex=0}_getRovingTargets(){return[]}_rovingFocus(t,n=!0){const e=this._getRovingTargets();if(e.length===0)return;const r=Math.max(0,Math.min(t,e.length-1));e.forEach((g,o)=>g.setAttribute("tabindex",o===r?"0":"-1")),n&&e[r]?.focus(),this._rovingIndex=r}_rovingNext(){const t=this._getRovingTargets();if(t.length===0)return;const n=this._rovingCurrentIndex(),e=n<t.length-1?n+1:0;this._rovingFocus(e)}_rovingPrev(){const t=this._getRovingTargets();if(t.length===0)return;const n=this._rovingCurrentIndex(),e=n>0?n-1:t.length-1;this._rovingFocus(e)}_rovingFirst(){this._rovingFocus(0)}_rovingLast(){const t=this._getRovingTargets();t.length>0&&this._rovingFocus(t.length-1)}_rovingCurrentIndex(){const t=document.activeElement;return this._getRovingTargets().findIndex(n=>n===t||n.contains(t))}}return s};export{v as R};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{x as l,i as u}from"./iframe-
|
|
1
|
+
import{x as l,i as u}from"./iframe-DlBK9Drk.js";import{t as g}from"./custom-element-UsVr97OX.js";import{R as m}from"./RovingTabindexMixin-9z8lwaM9.js";import"./preload-helper-PPVm8Dsz.js";var s=Object.freeze,v=Object.defineProperty,h=Object.getOwnPropertyDescriptor,p=(t,n,b,i)=>{for(var e=i>1?void 0:i?h(n,b):n,r=t.length-1,d;r>=0;r--)(d=t[r])&&(e=d(e)||e);return e},x=(t,n)=>s(v(t,"raw",{value:s(t.slice())})),a;const A={title:"Mixins/Roving Tabindex",tags:["autodocs"],parameters:{docs:{description:{component:`
|
|
2
2
|
\`RovingTabindexMixin\` provides **roving tabindex** navigation primitives for toolbar and menu components following the <a href="https://www.w3.org/WAI/ARIA/apd/practices/keyboard-interface/#kbd_roving_tabindex" target="_blank">WAI-ARIA Keyboard Interface Pattern</a>.
|
|
3
3
|
|
|
4
4
|
In a roving tabindex, only one element in the group has \`tabindex="0"\` (reachable via Tab), while all others have \`tabindex="-1"\`. Arrow keys move focus between items, wrapping at both ends.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{x as o}from"./iframe-
|
|
1
|
+
import{x as o}from"./iframe-DlBK9Drk.js";import"./preload-helper-PPVm8Dsz.js";const r={title:"Utilities/RTC",tags:["autodocs"],parameters:{docs:{subtitle:"The `rtc` module provides real-time communication between browser tabs and the Brightspot CMS server. Uses BroadcastChannel for cross-tab coordination with leader election, and Server-Sent Events for server communication."},controls:{expanded:!0}}},e={render:()=>o`
|
|
2
2
|
<div class="space-y-6 text-sm">
|
|
3
3
|
<div>
|
|
4
4
|
<h3 class="mb-2 font-bold">Overview</h3>
|
package/dist/storybook/assets/{ScrollShadow.stories-BIK8YINt.js → ScrollShadow.stories-1KD0lWHX.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{x as a}from"./iframe-
|
|
1
|
+
import{x as a}from"./iframe-DlBK9Drk.js";import"./preload-helper-PPVm8Dsz.js";const l=({theme:e="btu-scrollshadow-25"})=>{const r=new Array(100).fill(0).map((s,t)=>`Item ${t+1}`);return a`
|
|
2
2
|
<style>
|
|
3
3
|
:root {
|
|
4
4
|
--can-scroll: ;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as z,E as d,x as c,g as I}from"./iframe-
|
|
1
|
+
import{i as z,E as d,x as c,g as I}from"./iframe-DlBK9Drk.js";import{o as a}from"./if-defined-DerKRcyC.js";import{o as y}from"./style-map-DE4G47KD.js";import{n as i}from"./property-Bmq4RTSP.js";import{E,R as _}from"./ReadyMixin-CvX_eidU.js";import{L as C}from"./Icon-CWyJRQf7.js";import"./preload-helper-PPVm8Dsz.js";var T=Object.defineProperty,n=(e,t,s,l)=>{for(var r=void 0,x=e.length-1,$;x>=0;x--)($=e[x])&&(r=$(t,s,r)||r);return r&&T(t,s,r),r};const L={md:"btu-switch-md",lg:"btu-switch-lg"};class o extends E(_(z)){constructor(){super(...arguments),this.size="sm",this.checked=!1,this.disabled=!1,this.labelPosition="end",this._userInitiated=!1,this.initialClasses=[],this._initialClassesCaptured=!1,this._descId=`switch-desc-${crypto.randomUUID()}`}connectedCallback(){super.connectedCallback(),this._initialClassesCaptured||(this.className&&(this.initialClasses=this.className.split(" ").filter(t=>t.trim())),this._initialClassesCaptured=!0)}createRenderRoot(){return this}willUpdate(t){super.willUpdate(t);const s=[...this.initialClasses,"btu-switch",L[this.size],this.labelPosition==="start"&&"btu-switch-label-start"];this.className=s.filter(Boolean).join(" ")}firstUpdated(t){super.firstUpdated(t),this.emit("btu-switch-ready")}updated(t){super.updated(t),this._userInitiated&&(this._userInitiated=!1,t.has("checked")&&this.emit("btu-switch-change",{checked:this.checked}))}_onInputChange(t){const s=t.target;this._userInitiated=!0,this.checked=s.checked}_onFocus(){this.emit("btu-switch-focus")}_toggleInput(){this.disabled||this.renderRoot.querySelector(".btu-switch-input")?.click()}render(){return c`
|
|
2
2
|
<input
|
|
3
3
|
type="checkbox"
|
|
4
4
|
role="switch"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as u,x as e}from"./iframe-
|
|
1
|
+
import{g as u,x as e}from"./iframe-DlBK9Drk.js";import{o as d}from"./style-map-DE4G47KD.js";import"./Tabs-DdpYNZSW.js";import"./preload-helper-PPVm8Dsz.js";import"./property-Bmq4RTSP.js";import"./ReadyMixin-CvX_eidU.js";import"./Badge-bWrvpEgX.js";import"./Icon-CWyJRQf7.js";import"./RovingTabindexMixin-9z8lwaM9.js";import"./DropdownMenu-B-LvOIGj.js";import"./aria-D5THOgos.js";import"./TooltipMixin-CVKslCDt.js";const{events:c,args:m,argTypes:t}=u("btu-tab"),I={title:"Components/Tabs/Tab",component:"btu-tab",tags:["autodocs"],parameters:{docs:{subtitle:"btu-tab",description:{component:`
|
|
2
2
|
An individual tab within a \`btu-tabs\` group.
|
|
3
3
|
|
|
4
4
|
Renders a button with \`role="tab"\` that participates in keyboard navigation and selection state managed by the parent \`btu-tabs\` container.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as c,x as d,E as r}from"./iframe-
|
|
1
|
+
import{i as c,x as d,E as r}from"./iframe-DlBK9Drk.js";import{n as a}from"./property-Bmq4RTSP.js";import{o as y}from"./style-map-DE4G47KD.js";import{E as p,R as f}from"./ReadyMixin-CvX_eidU.js";import"./Badge-bWrvpEgX.js";import"./Icon-CWyJRQf7.js";import{R as g}from"./RovingTabindexMixin-9z8lwaM9.js";import"./DropdownMenu-B-LvOIGj.js";var v=Object.defineProperty,l=(u,t,e,n)=>{for(var i=void 0,s=u.length-1,h;s>=0;s--)(h=u[s])&&(i=h(t,e,i)||i);return i&&v(t,e,i),i};class o extends p(f(c)){constructor(){super(...arguments),this.disabled=!1,this.iconPosition="leading",this.iconOnly=!1,this.error=!1,this._active=!1,this._tabindex=-1,this.size="md",this.initialClasses=[],this._initialClassesCaptured=!1}static get tagName(){return"BTU-TAB"}connectedCallback(){super.connectedCallback(),this._initialClassesCaptured||(this.className&&(this.initialClasses=this.className.split(" ").filter(t=>t.trim())),this._initialClassesCaptured=!0)}createRenderRoot(){return this}willUpdate(){this.className=[...this.initialClasses,"btu-tab"].filter(Boolean).join(" ")}firstUpdated(){this.emit("btu-tab-ready")}handleClick(){this.disabled||!this.name||this.emit("btu-tab-change",{name:this.name})}render(){const t=this.symbol?d`<btu-icon symbol="${this.symbol}" size="${this.size==="lg"?"md":"sm"}"></btu-icon>`:r,e=this.iconOnly&&this.symbol?r:d`<span>${this.label}</span>`,n=this.badge!=null?d`<btu-badge size="sm">${this.badge}</btu-badge>`:r,i=this.error?d`<btu-badge size="sm" variant="error">!</btu-badge>`:r,s=this._active&&!this.disabled?d`<span
|
|
2
2
|
class="btu-tab-indicator"
|
|
3
3
|
style=${y(this.error?{background:"oklch(var(--btu-theme-error-600))"}:{})}
|
|
4
4
|
></span>`:r;return d`<button
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as b,E as i,x as s}from"./iframe-
|
|
1
|
+
import{g as b,E as i,x as s}from"./iframe-DlBK9Drk.js";import{o as c}from"./style-map-DE4G47KD.js";import"./Tabs-DdpYNZSW.js";import"./preload-helper-PPVm8Dsz.js";import"./property-Bmq4RTSP.js";import"./ReadyMixin-CvX_eidU.js";import"./Badge-bWrvpEgX.js";import"./Icon-CWyJRQf7.js";import"./RovingTabindexMixin-9z8lwaM9.js";import"./DropdownMenu-B-LvOIGj.js";import"./aria-D5THOgos.js";import"./TooltipMixin-CVKslCDt.js";const{events:d,args:u,argTypes:a}=b("btu-tabs"),C={title:"Components/Tabs",component:"btu-tabs",tags:["autodocs"],parameters:{docs:{subtitle:"btu-tabs",description:{component:`
|
|
2
2
|
A tab group component that manages selection state across a set of \`btu-tab\` children.
|
|
3
3
|
|
|
4
4
|
<h3>When to use:</h3>
|