@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,143 +0,0 @@
|
|
|
1
|
-
import{ah as v,ai as x,x as c,i as w}from"./iframe-B9buZjP7.js";import{t as E}from"./custom-element-UsVr97OX.js";import{o as T}from"./if-defined-BwWBCoAU.js";import{o as k}from"./style-map-qCiIYcp5.js";import{E as C,R as L}from"./ReadyMixin-BbuzH3uO.js";import"./preload-helper-PPVm8Dsz.js";const D={attribute:!0,type:String,converter:x,reflect:!1,hasChanged:v},S=(o=D,i,l)=>{const{kind:t,metadata:e}=l;let s=globalThis.litPropertyMetadata.get(e);if(s===void 0&&globalThis.litPropertyMetadata.set(e,s=new Map),t==="setter"&&((o=Object.create(o)).wrapped=!0),s.set(l.name,o),t==="accessor"){const{name:r}=l;return{set(n){const g=i.get.call(this);i.set.call(this,n),this.requestUpdate(r,g,o)},init(n){return n!==void 0&&this.C(r,void 0,o,n),n}}}if(t==="setter"){const{name:r}=l;return function(n){const g=this[r];i.call(this,n),this.requestUpdate(r,g,o)}}throw Error("Unsupported decorator location: "+t)};function p(o){return(i,l)=>typeof l=="object"?S(o,i,l):((t,e,s)=>{const r=e.hasOwnProperty(s);return e.constructor.createProperty(s,t),r?Object.getOwnPropertyDescriptor(e,s):void 0})(o,i,l)}var A=Object.defineProperty,a=(o,i,l,t)=>{for(var e=void 0,s=o.length-1,r;s>=0;s--)(r=o[s])&&(e=r(i,l,e)||e);return e&&A(i,l,e),e};const M={top:"btu-tooltip-top",bottom:"btu-tooltip-bottom",left:"btu-tooltip-left",right:"btu-tooltip-right"},_={sm:"btu-tooltip-offset-sm",md:"btu-tooltip-offset-md",lg:"btu-tooltip-offset-lg",xl:"btu-tooltip-offset-xl"},O=o=>{class i extends o{constructor(){super(...arguments),this.tooltip="",this.tooltipPosition="top",this.tooltipDelay=300,this.tooltipOffset=null,this.tooltipNoArrow=!1,this.tooltipTrigger="hover focus",this._tooltipEl=null,this._tooltipId=`btu-tooltip-${crypto.randomUUID()}`,this._anchorName=`--btu-trigger-${crypto.randomUUID()}`,this._showTimer=null,this._isVisible=!1,this._activeTriggers=new Set,this._onMouseEnter=this._handleMouseEnter.bind(this),this._onMouseLeave=this._handleMouseLeave.bind(this),this._onFocusIn=this._handleFocusIn.bind(this),this._onFocusOut=this._handleFocusOut.bind(this),this._onClick=this._handleClick.bind(this),this._onNativeToggle=this._handleNativeToggle.bind(this),this._onKeyDown=this._handleKeyDown.bind(this),this._onDocumentClick=null}connectedCallback(){super.connectedCallback(),this._bindTriggerListeners()}disconnectedCallback(){if(this._clearShowTimer(),this._removeDocumentClickListener(),this._unbindTriggerListeners(),this._tooltipEl){try{this._tooltipEl.hidePopover()}catch(t){t instanceof DOMException&&t.name==="InvalidStateError"||console.warn("[btu-tooltip] Failed to hide tooltip during disconnect:",t)}this._tooltipEl.removeEventListener("toggle",this._onNativeToggle),this._tooltipEl.remove(),this._tooltipEl=null}this._removeAriaDescribedBy(),this.style.removeProperty("anchor-name"),this._isVisible=!1,super.disconnectedCallback()}updated(t){super.updated(t),t.has("tooltipTrigger")&&(this._unbindTriggerListeners(),this._bindTriggerListeners(),this._tooltipEl&&(this._isVisible&&this._hide(),this._tooltipEl.setAttribute("popover",this._getPopoverMode()))),(t.has("tooltip")||t.has("tooltipPosition")||t.has("tooltipDelay")||t.has("tooltipOffset")||t.has("tooltipNoArrow"))&&this._syncTooltipElement()}_getPopoverMode(){return"manual"}_syncTooltipElement(){if(!this.tooltip){this._tooltipEl&&(this._hide(),this._tooltipEl.removeEventListener("toggle",this._onNativeToggle),this._tooltipEl.remove(),this._tooltipEl=null,this._removeAriaDescribedBy(),this.style.removeProperty("anchor-name"),document.removeEventListener("keydown",this._onKeyDown));return}this.style.setProperty("anchor-name",this._anchorName),this._tooltipEl||(this._tooltipEl=this._createTooltipElement(),this.appendChild(this._tooltipEl),this._appendAriaDescribedBy(),document.addEventListener("keydown",this._onKeyDown)),this._tooltipEl.textContent=this.tooltip,this._tooltipEl.className=this._buildTooltipClasses()}_createTooltipElement(){const t=document.createElement("div");return t.id=this._tooltipId,t.className=this._buildTooltipClasses(),t.setAttribute("role","tooltip"),t.setAttribute("data-tooltip-internal",""),t.setAttribute("popover",this._getPopoverMode()),t.style.setProperty("position-anchor",this._anchorName),t.textContent=this.tooltip,t.addEventListener("toggle",this._onNativeToggle),t}_buildTooltipClasses(){const t=["btu-tooltip",M[this.tooltipPosition]];return this.tooltipOffset&&_[this.tooltipOffset]&&t.push(_[this.tooltipOffset]),this.tooltipNoArrow&&t.push("btu-tooltip-no-arrow"),t.join(" ")}_hasTrigger(t){return this._activeTriggers.has(t)}_bindTriggerListeners(){const t=new Set(["hover","focus","click"]);this._activeTriggers=new Set(this.tooltipTrigger.trim().split(/\s+/));for(const e of this._activeTriggers)t.has(e)||console.warn(`[btu-tooltip] Unrecognized tooltip-trigger value: "${e}". Valid values: hover, focus, click.`);this._hasTrigger("hover")&&(this.addEventListener("mouseenter",this._onMouseEnter),this.addEventListener("mouseleave",this._onMouseLeave)),this._hasTrigger("focus")&&(this.addEventListener("focusin",this._onFocusIn),this.addEventListener("focusout",this._onFocusOut)),this._hasTrigger("click")&&this.addEventListener("click",this._onClick)}_unbindTriggerListeners(){this.removeEventListener("mouseenter",this._onMouseEnter),this.removeEventListener("mouseleave",this._onMouseLeave),this.removeEventListener("focusin",this._onFocusIn),this.removeEventListener("focusout",this._onFocusOut),this.removeEventListener("click",this._onClick),document.removeEventListener("keydown",this._onKeyDown)}_show(){if(!(this._isVisible||!this._tooltipEl)){try{this._tooltipEl.showPopover()}catch(t){t instanceof DOMException&&t.name==="InvalidStateError"||console.warn("[btu-tooltip] Failed to show tooltip:",t)}this._hasTrigger("click")&&setTimeout(()=>{this._removeDocumentClickListener(),this._onDocumentClick=t=>{const e=t.composedPath();!e.includes(this)&&(!this._tooltipEl||!e.includes(this._tooltipEl))&&this._hide()},document.addEventListener("click",this._onDocumentClick)},0)}}_hide(){if(this._clearShowTimer(),this._removeDocumentClickListener(),!(!this._isVisible||!this._tooltipEl))try{this._tooltipEl.hidePopover()}catch(t){t instanceof DOMException&&t.name==="InvalidStateError"||console.warn("[btu-tooltip] Failed to hide tooltip:",t)}}_removeDocumentClickListener(){this._onDocumentClick&&(document.removeEventListener("click",this._onDocumentClick),this._onDocumentClick=null)}_handleNativeToggle(t){const{newState:e}=t;this._isVisible=e==="open";const s=this._isVisible?"btu-tooltip-show":"btu-tooltip-hide",r=new CustomEvent(s,{bubbles:!0,composed:!0});this.dispatchEvent(r)}_handleKeyDown(t){t.key==="Escape"&&(this._clearShowTimer(),this._hide())}_clearShowTimer(){this._showTimer!==null&&(clearTimeout(this._showTimer),this._showTimer=null)}_handleMouseEnter(){this._clearShowTimer(),this._showTimer=setTimeout(()=>{this._show()},this.tooltipDelay)}_handleMouseLeave(){this._clearShowTimer(),this._hide()}_handleFocusIn(){this._clearShowTimer(),this._show()}_handleFocusOut(){this._clearShowTimer(),this._hide()}_handleClick(){this._clearShowTimer(),this._isVisible?this._hide():this._show()}_appendAriaDescribedBy(){const t=this.getAttribute("aria-describedby");t?t.includes(this._tooltipId)||this.setAttribute("aria-describedby",`${t} ${this._tooltipId}`):this.setAttribute("aria-describedby",this._tooltipId)}_removeAriaDescribedBy(){const t=this.getAttribute("aria-describedby");if(!t)return;const e=t.split(/\s+/).filter(s=>s!==this._tooltipId).join(" ").trim();e?this.setAttribute("aria-describedby",e):this.removeAttribute("aria-describedby")}}return a([p({attribute:"tooltip"})],i.prototype,"tooltip"),a([p({attribute:"tooltip-position"})],i.prototype,"tooltipPosition"),a([p({attribute:"tooltip-delay",type:Number})],i.prototype,"tooltipDelay"),a([p({attribute:"tooltip-offset"})],i.prototype,"tooltipOffset"),a([p({attribute:"tooltip-no-arrow",type:Boolean})],i.prototype,"tooltipNoArrow"),a([p({attribute:"tooltip-trigger"})],i.prototype,"tooltipTrigger"),i};var P=Object.defineProperty,$=Object.getOwnPropertyDescriptor,y=(o,i,l,t)=>{for(var e=t>1?void 0:t?$(i,l):i,s=o.length-1,r;s>=0;s--)(r=o[s])&&(e=(t?r(i,l,e):r(e))||e);return t&&e&&P(i,l,e),e};let b=class extends O(C(L(w))){constructor(){super(...arguments),this.label="Hover me",this.initialClasses=[]}connectedCallback(){super.connectedCallback(),this.className&&(this.initialClasses=this.className.split(" ").filter(o=>o.trim()))}createRenderRoot(){return this}willUpdate(){const o=[...this.initialClasses,"tooltip-demo"];this.className=o.filter(Boolean).join(" ")}render(){return c`${this.label}`}};y([p({type:String})],b.prototype,"label",2);b=y([E("tooltip-demo")],b);const f=`
|
|
2
|
-
.tooltip-demo {
|
|
3
|
-
display: inline-flex;
|
|
4
|
-
align-items: center;
|
|
5
|
-
justify-content: center;
|
|
6
|
-
padding: 0.5rem 1rem;
|
|
7
|
-
border-radius: 0.375rem;
|
|
8
|
-
background-color: oklch(var(--btu-theme-gray-100));
|
|
9
|
-
color: oklch(var(--btu-theme-gray-700));
|
|
10
|
-
font-weight: 500;
|
|
11
|
-
font-size: 0.875rem;
|
|
12
|
-
cursor: default;
|
|
13
|
-
user-select: none;
|
|
14
|
-
}
|
|
15
|
-
`,V={title:"Mixins/Tooltip",tags:["autodocs"],parameters:{docs:{subtitle:"Declarative tooltip support for any LitElement component",description:{component:`
|
|
16
|
-
\`TooltipMixin\` adds declarative tooltip support to any LitElement component using CSS anchor positioning and the Popover API.
|
|
17
|
-
|
|
18
|
-
<h3>Opt-in Pattern</h3>
|
|
19
|
-
|
|
20
|
-
\`\`\`typescript
|
|
21
|
-
class MyComponent extends TooltipMixin(EventEmitterMixin(ReadyMixin(LitElement))) {
|
|
22
|
-
// Component now supports tooltip attributes
|
|
23
|
-
}
|
|
24
|
-
\`\`\`
|
|
25
|
-
|
|
26
|
-
\`\`\`html
|
|
27
|
-
<my-component tooltip="Hello!" tooltip-position="bottom"></my-component>
|
|
28
|
-
\`\`\`
|
|
29
|
-
|
|
30
|
-
<h3>Appearance</h3>
|
|
31
|
-
|
|
32
|
-
The tooltip surface is inverted by default — a dark chip on light pages and a light chip on dark pages — using the mode-flipping black/white tokens. Recolor a specific tooltip via <code>--tooltip-color-background</code> / <code>--tooltip-color-text</code>.
|
|
33
|
-
|
|
34
|
-
<h3>Accessibility</h3>
|
|
35
|
-
<ul>
|
|
36
|
-
<li><code>role="tooltip"</code> on tooltip element</li>
|
|
37
|
-
<li><code>aria-describedby</code> on host links to tooltip (appends to existing value)</li>
|
|
38
|
-
<li>Shows on <code>focusin</code>, hides on <code>focusout</code> and <code>Escape</code></li>
|
|
39
|
-
<li><code>prefers-reduced-motion: reduce</code> disables slide animation</li>
|
|
40
|
-
</ul>
|
|
41
|
-
`}},controls:{expanded:!0}},args:{tooltip:"This is a tooltip","tooltip-position":"top","tooltip-delay":300,"tooltip-no-arrow":!1,"tooltip-trigger":"hover focus",label:"Hover me"},argTypes:{tooltip:{control:{type:"text"},description:"Tooltip text. No tooltip rendered when empty.",table:{category:"Attributes"}},"tooltip-position":{control:{type:"select"},options:["top","bottom","left","right"],description:"Preferred placement (auto-flips if viewport constrained)",table:{category:"Attributes"}},"tooltip-delay":{control:{type:"number"},description:"Delay before showing tooltip on hover (ms)",table:{category:"Attributes"}},"tooltip-offset":{control:{type:"select"},options:["sm","md","lg","xl"],description:"Gap between trigger and tooltip (sm=4px, md=8px, lg=12px, xl=16px)",table:{category:"Attributes"}},"tooltip-no-arrow":{control:{type:"boolean"},description:"Hide the arrow pseudo-element",table:{category:"Attributes"}},"tooltip-trigger":{control:{type:"select"},options:["hover focus","hover","focus","click","hover click"],description:"How the tooltip is activated (combinable triggers)",table:{category:"Attributes"}},label:{control:{type:"text"},description:"Demo button label text",table:{category:"Demo"}},customBg:{name:"--tooltip-color-background",control:{type:"color"},description:"Background color (default: inverted surface)",table:{category:"css properties",defaultValue:{summary:"var(--btu-theme-black)"}}},customTextColor:{name:"--tooltip-color-text",control:{type:"color"},description:"Text color (default: inverted surface)",table:{category:"css properties",defaultValue:{summary:"var(--btu-theme-white)"}}},customRadius:{name:"--tooltip-border-radius",control:{type:"select"},options:["0px","0.125rem","0.25rem","0.375rem","0.5rem","0.75rem","1rem","1.5rem","9999px"],labels:{"0px":"none (0px)","0.125rem":"sm (0.125rem)","0.25rem":"DEFAULT (0.25rem)","0.375rem":"md (0.375rem)","0.5rem":"lg (0.5rem)","0.75rem":"xl (0.75rem)","1rem":"2xl (1rem)","1.5rem":"3xl (1.5rem)","9999px":"full (9999px)"},description:"Border radius",table:{category:"css properties",defaultValue:{summary:"0.5rem (lg)"}}}},render:o=>{const i={};return o.customBg&&(i["--tooltip-color-background"]=o.customBg),o.customTextColor&&(i["--tooltip-color-text"]=o.customTextColor),o.customRadius&&(i["--tooltip-border-radius"]=o.customRadius),c`
|
|
42
|
-
<style>
|
|
43
|
-
${f}
|
|
44
|
-
</style>
|
|
45
|
-
<div style="display: flex; justify-content: center; padding: 6rem 2rem;">
|
|
46
|
-
<div style=${k(i)}>
|
|
47
|
-
<tooltip-demo
|
|
48
|
-
tooltip="${o.tooltip}"
|
|
49
|
-
tooltip-position="${o["tooltip-position"]}"
|
|
50
|
-
tooltip-delay="${o["tooltip-delay"]}"
|
|
51
|
-
tooltip-offset="${T(o["tooltip-offset"])}"
|
|
52
|
-
?tooltip-no-arrow="${o["tooltip-no-arrow"]}"
|
|
53
|
-
tooltip-trigger="${o["tooltip-trigger"]}"
|
|
54
|
-
label="${o.label}"
|
|
55
|
-
></tooltip-demo>
|
|
56
|
-
</div>
|
|
57
|
-
</div>
|
|
58
|
-
`}},d={args:{}},h={render:()=>c`
|
|
59
|
-
<style>
|
|
60
|
-
${f}
|
|
61
|
-
</style>
|
|
62
|
-
<div style="display: flex; gap: 2rem; justify-content: center; padding: 6rem 2rem; flex-wrap: wrap;">
|
|
63
|
-
<tooltip-demo tooltip="Top tooltip" tooltip-position="top" label="Top"></tooltip-demo>
|
|
64
|
-
<tooltip-demo tooltip="Bottom tooltip" tooltip-position="bottom" label="Bottom"></tooltip-demo>
|
|
65
|
-
<tooltip-demo tooltip="Left tooltip" tooltip-position="left" label="Left"></tooltip-demo>
|
|
66
|
-
<tooltip-demo tooltip="Right tooltip" tooltip-position="right" label="Right"></tooltip-demo>
|
|
67
|
-
</div>
|
|
68
|
-
`,parameters:{docs:{description:{story:"Tooltips support four positions: `top`, `bottom`, `left`, and `right`. Each position auto-flips to the opposite side if constrained by the viewport."}}}},m={render:()=>c`
|
|
69
|
-
<style>
|
|
70
|
-
${f}
|
|
71
|
-
</style>
|
|
72
|
-
<div style="display: flex; gap: 2rem; justify-content: center; padding: 4rem 2rem; flex-wrap: wrap;">
|
|
73
|
-
<tooltip-demo tooltip="Small offset (4px)" tooltip-offset="sm" label="sm"></tooltip-demo>
|
|
74
|
-
<tooltip-demo tooltip="Medium offset (8px)" tooltip-offset="md" label="md"></tooltip-demo>
|
|
75
|
-
<tooltip-demo tooltip="Large offset (12px)" tooltip-offset="lg" label="lg"></tooltip-demo>
|
|
76
|
-
<tooltip-demo tooltip="Extra large offset (16px)" tooltip-offset="xl" label="xl"></tooltip-demo>
|
|
77
|
-
</div>
|
|
78
|
-
`,parameters:{docs:{description:{story:"The `tooltip-offset` attribute controls the gap between trigger and tooltip using named sizes: `sm` (4px), `md` (8px), `lg` (12px), `xl` (16px)."}}}},u={render:()=>c`
|
|
79
|
-
<style>
|
|
80
|
-
${f}
|
|
81
|
-
</style>
|
|
82
|
-
<div style="display: flex; gap: 2rem; justify-content: center; padding: 4rem 2rem; flex-wrap: wrap;">
|
|
83
|
-
<tooltip-demo tooltip="Click-triggered tooltip" tooltip-trigger="click" label="Click me"></tooltip-demo>
|
|
84
|
-
<tooltip-demo tooltip="Hover or click" tooltip-trigger="hover click" label="Hover or click"></tooltip-demo>
|
|
85
|
-
</div>
|
|
86
|
-
`,parameters:{docs:{description:{story:"The `tooltip-trigger` attribute controls how the tooltip is activated. `click` toggles on click and dismisses on Escape. Triggers can be combined with spaces."}}}};d.parameters={...d.parameters,docs:{...d.parameters?.docs,source:{originalSource:`{
|
|
87
|
-
args: {}
|
|
88
|
-
}`,...d.parameters?.docs?.source}}};h.parameters={...h.parameters,docs:{...h.parameters?.docs,source:{originalSource:`{
|
|
89
|
-
render: () => html\`
|
|
90
|
-
<style>
|
|
91
|
-
\${demoStyle}
|
|
92
|
-
</style>
|
|
93
|
-
<div style="display: flex; gap: 2rem; justify-content: center; padding: 6rem 2rem; flex-wrap: wrap;">
|
|
94
|
-
<tooltip-demo tooltip="Top tooltip" tooltip-position="top" label="Top"></tooltip-demo>
|
|
95
|
-
<tooltip-demo tooltip="Bottom tooltip" tooltip-position="bottom" label="Bottom"></tooltip-demo>
|
|
96
|
-
<tooltip-demo tooltip="Left tooltip" tooltip-position="left" label="Left"></tooltip-demo>
|
|
97
|
-
<tooltip-demo tooltip="Right tooltip" tooltip-position="right" label="Right"></tooltip-demo>
|
|
98
|
-
</div>
|
|
99
|
-
\`,
|
|
100
|
-
parameters: {
|
|
101
|
-
docs: {
|
|
102
|
-
description: {
|
|
103
|
-
story: 'Tooltips support four positions: \`top\`, \`bottom\`, \`left\`, and \`right\`. Each position auto-flips to the opposite side if constrained by the viewport.'
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}`,...h.parameters?.docs?.source}}};m.parameters={...m.parameters,docs:{...m.parameters?.docs,source:{originalSource:`{
|
|
108
|
-
render: () => html\`
|
|
109
|
-
<style>
|
|
110
|
-
\${demoStyle}
|
|
111
|
-
</style>
|
|
112
|
-
<div style="display: flex; gap: 2rem; justify-content: center; padding: 4rem 2rem; flex-wrap: wrap;">
|
|
113
|
-
<tooltip-demo tooltip="Small offset (4px)" tooltip-offset="sm" label="sm"></tooltip-demo>
|
|
114
|
-
<tooltip-demo tooltip="Medium offset (8px)" tooltip-offset="md" label="md"></tooltip-demo>
|
|
115
|
-
<tooltip-demo tooltip="Large offset (12px)" tooltip-offset="lg" label="lg"></tooltip-demo>
|
|
116
|
-
<tooltip-demo tooltip="Extra large offset (16px)" tooltip-offset="xl" label="xl"></tooltip-demo>
|
|
117
|
-
</div>
|
|
118
|
-
\`,
|
|
119
|
-
parameters: {
|
|
120
|
-
docs: {
|
|
121
|
-
description: {
|
|
122
|
-
story: 'The \`tooltip-offset\` attribute controls the gap between trigger and tooltip using named sizes: \`sm\` (4px), \`md\` (8px), \`lg\` (12px), \`xl\` (16px).'
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}`,...m.parameters?.docs?.source}}};u.parameters={...u.parameters,docs:{...u.parameters?.docs,source:{originalSource:`{
|
|
127
|
-
render: () => html\`
|
|
128
|
-
<style>
|
|
129
|
-
\${demoStyle}
|
|
130
|
-
</style>
|
|
131
|
-
<div style="display: flex; gap: 2rem; justify-content: center; padding: 4rem 2rem; flex-wrap: wrap;">
|
|
132
|
-
<tooltip-demo tooltip="Click-triggered tooltip" tooltip-trigger="click" label="Click me"></tooltip-demo>
|
|
133
|
-
<tooltip-demo tooltip="Hover or click" tooltip-trigger="hover click" label="Hover or click"></tooltip-demo>
|
|
134
|
-
</div>
|
|
135
|
-
\`,
|
|
136
|
-
parameters: {
|
|
137
|
-
docs: {
|
|
138
|
-
description: {
|
|
139
|
-
story: 'The \`tooltip-trigger\` attribute controls how the tooltip is activated. \`click\` toggles on click and dismisses on Escape. Triggers can be combined with spaces.'
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}`,...u.parameters?.docs?.source}}};const U=["Default","Positions","Offset","ClickTrigger"];export{u as ClickTrigger,d as Default,m as Offset,h as Positions,U as __namedExportsOrder,V as default};
|
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
import{g as h,x as l}from"./iframe-B9buZjP7.js";import{o as m}from"./style-map-qCiIYcp5.js";import"./preload-helper-PPVm8Dsz.js";const{events:y,args:w,argTypes:a}=h("btu-widget"),$={title:"Components/Widget",component:"btu-widget",tags:["autodocs"],parameters:{docs:{subtitle:"btu-widget",description:{component:`
|
|
2
|
-
<h3>When to use:</h3>
|
|
3
|
-
<ul>
|
|
4
|
-
<li>To display content in a structured widget layout</li>
|
|
5
|
-
<li>When you need separate header, body, and footer regions</li>
|
|
6
|
-
<li>For component composition that requires semantic HTML authoring</li>
|
|
7
|
-
</ul>
|
|
8
|
-
<h3>Use Cases in the CMS:</h3>
|
|
9
|
-
<ul>
|
|
10
|
-
<li>Dashboard Widgets</li>
|
|
11
|
-
<li>Dashboard Quick Start</li>
|
|
12
|
-
<li>Content Edit History Panel</li>
|
|
13
|
-
<li>Global search filters</li>
|
|
14
|
-
</ul>
|
|
15
|
-
`}},actions:{handles:y},controls:{expanded:!0}},args:{...w,heading:"Widget Title",collapsible:!0},argTypes:{...a,"--header-background":{table:{disable:!0}},"--widget-background":{table:{disable:!0}},"--widget-border":{table:{disable:!0}},isFullscreen:{table:{disable:!0}},heading:{...a.heading,control:{type:"text"},description:"Heading text displayed in the header."},collapsible:{...a.collapsible,control:{type:"boolean"},description:"Whether the widget can be collapsed/expanded. Adds chevron toggle button."},collapsed:{...a.collapsed,control:{type:"boolean"},description:"Whether the widget is currently collapsed (body and footer hidden)."},fullscreenable:{...a.fullscreenable,control:{type:"boolean"},description:"Whether the widget can enter fullscreen mode. Adds fullscreen toggle button."},customWidgetBackground:{name:"--widget-background",control:{type:"color"},description:"Widget background color (default: #ffffff)",table:{category:"css properties"}},customWidgetBorder:{name:"--widget-border",control:{type:"text"},description:'Widget border (e.g., "2px solid #ccc", default: "1px solid #e0e0e0")',table:{category:"css properties"}},customHeaderBackground:{name:"--header-background",control:{type:"color"},description:"Header background color (default: transparent)",table:{category:"css properties"}}},render:e=>{const t={};return e.customWidgetBackground&&(t["--widget-background"]=e.customWidgetBackground),e.customWidgetBorder&&(t["--widget-border"]=e.customWidgetBorder),e.customHeaderBackground&&(t["--header-background"]=e.customHeaderBackground),l`
|
|
16
|
-
<btu-widget
|
|
17
|
-
.heading=${e.heading??""}
|
|
18
|
-
?collapsible=${e.collapsible}
|
|
19
|
-
?collapsed=${e.collapsed}
|
|
20
|
-
?fullscreenable=${e.fullscreenable}
|
|
21
|
-
style=${m(t)}
|
|
22
|
-
>
|
|
23
|
-
<button
|
|
24
|
-
class="btu-button btu-button-text-hidden btu-button-fill-none btu-button-gray btu-button-xs"
|
|
25
|
-
slot="controls"
|
|
26
|
-
>
|
|
27
|
-
<btu-icon symbol="ellipsis"></btu-icon>
|
|
28
|
-
</button>
|
|
29
|
-
<div>This is the main body content of the widget.</div>
|
|
30
|
-
</btu-widget>
|
|
31
|
-
`}},i={args:{fullscreenable:!0}},d={render:e=>l`
|
|
32
|
-
<btu-widget
|
|
33
|
-
.heading=${e.heading??"Widget with Controls"}
|
|
34
|
-
?collapsible=${e.collapsible??!0}
|
|
35
|
-
?collapsed=${e.collapsed}
|
|
36
|
-
?fullscreenable=${e.fullscreenable}
|
|
37
|
-
>
|
|
38
|
-
<div class="action-bar flex justify-between" slot="footer">
|
|
39
|
-
<button class="btu-button btu-button-error">Delete</button>
|
|
40
|
-
<button class="btu-button btu-button-success">Save</button>
|
|
41
|
-
</div>
|
|
42
|
-
<div>Body content with heading and an action bar in the footer.</div>
|
|
43
|
-
</btu-widget>
|
|
44
|
-
`,parameters:{docs:{description:{story:"Widget demonstrating how easy it is to add an action bar component to the footer of a widget."}}}},c={render:e=>l`
|
|
45
|
-
<btu-widget
|
|
46
|
-
.heading=${e.heading??"Fully Themed Widget"}
|
|
47
|
-
?collapsible=${e.collapsible}
|
|
48
|
-
?collapsed=${e.collapsed}
|
|
49
|
-
?fullscreenable=${e.fullscreenable}
|
|
50
|
-
style="--widget-background: oklch(var(--btu-theme-purple-100)); --widget-border: 1px solid oklch(var(--btu-theme-purple-800)); --header-background: oklch(var(--btu-theme-purple-300));"
|
|
51
|
-
>
|
|
52
|
-
<button class="btu-button btu-button-purple" slot="controls">Action</button>
|
|
53
|
-
<div>
|
|
54
|
-
<p>Customized!</p>
|
|
55
|
-
</div>
|
|
56
|
-
<div slot="footer">
|
|
57
|
-
<small>Footer content (hidden when collapsed)</small>
|
|
58
|
-
</div>
|
|
59
|
-
</btu-widget>
|
|
60
|
-
`,parameters:{docs:{description:{story:"Widget with complete theming using all available CSS variables. Demonstrates full control over widget and header appearance."}}}},u={args:{collapsible:!0,collapsed:!0},render:e=>l`
|
|
61
|
-
<btu-widget
|
|
62
|
-
.heading=${e.heading??"Initially Collapsed"}
|
|
63
|
-
?collapsible=${e.collapsible??!0}
|
|
64
|
-
?collapsed=${e.collapsed??!0}
|
|
65
|
-
?fullscreenable=${e.fullscreenable}
|
|
66
|
-
>
|
|
67
|
-
<div style="padding: 1rem;">
|
|
68
|
-
<p>This widget starts in a collapsed state.</p>
|
|
69
|
-
<p>Click the chevron to expand and see this content.</p>
|
|
70
|
-
</div>
|
|
71
|
-
</btu-widget>
|
|
72
|
-
`,parameters:{docs:{description:{story:"Widget that starts in a collapsed state."}}}},b={render:e=>{const t=["pencil","gear","trash","star","heart","bell"];let p=0;const g=n=>{const o=document.createElement("btu-icon");o.setAttribute("symbol",t[p%t.length]),o.setAttribute("slot","controls"),p++,n.appendChild(o);const r=document.createElement("p");r.textContent="This paragraph was added dynamically and automatically redistributed to the body!",r.style.color="#16a34a",r.style.fontWeight="600",n.appendChild(r);const s=document.createElement("button");s.className="btu-button btu-button-purple",s.textContent="Button",s.setAttribute("slot","footer"),n.appendChild(s)};return l`
|
|
73
|
-
<div style="display: flex; flex-direction: column; gap: 1rem;">
|
|
74
|
-
<button
|
|
75
|
-
class="btu-button btu-button-primary"
|
|
76
|
-
@click="${n=>{const o=n.target.parentElement?.querySelector("btu-widget");o&&g(o)}}"
|
|
77
|
-
>
|
|
78
|
-
Add Dynamic Content
|
|
79
|
-
</button>
|
|
80
|
-
<btu-widget
|
|
81
|
-
.heading=${e.heading??"Dynamic Content Demo"}
|
|
82
|
-
?collapsible=${e.collapsible??!0}
|
|
83
|
-
?collapsed=${e.collapsed}
|
|
84
|
-
?fullscreenable=${e.fullscreenable}
|
|
85
|
-
>
|
|
86
|
-
<button class="btu-button btu-button-primary" slot="controls">Initial Button</button>
|
|
87
|
-
<div style="padding: 1rem;">
|
|
88
|
-
<p>Click the "Add Dynamic Content" button above to demonstrate:</p>
|
|
89
|
-
<ul>
|
|
90
|
-
<li>MutationObserver detects new child elements</li>
|
|
91
|
-
<li>New <code>slot="controls"</code> icon is redistributed to header actions</li>
|
|
92
|
-
<li>New paragraph (no slot) is redistributed to body</li>
|
|
93
|
-
<li>New <code>slot="footer"</code> button is redistributed to footer</li>
|
|
94
|
-
</ul>
|
|
95
|
-
</div>
|
|
96
|
-
</btu-widget>
|
|
97
|
-
</div>
|
|
98
|
-
`},parameters:{docs:{description:{story:"Demonstrates the Manager Pattern's MutationObserver: Content added dynamically is automatically redistributed to the correct containers based on slot attributes."}}}};i.parameters={...i.parameters,docs:{...i.parameters?.docs,source:{originalSource:`{
|
|
99
|
-
args: {
|
|
100
|
-
fullscreenable: true
|
|
101
|
-
}
|
|
102
|
-
}`,...i.parameters?.docs?.source}}};d.parameters={...d.parameters,docs:{...d.parameters?.docs,source:{originalSource:`{
|
|
103
|
-
render: args => html\`
|
|
104
|
-
<btu-widget
|
|
105
|
-
.heading=\${args.heading ?? 'Widget with Controls'}
|
|
106
|
-
?collapsible=\${args.collapsible ?? true}
|
|
107
|
-
?collapsed=\${args.collapsed}
|
|
108
|
-
?fullscreenable=\${args.fullscreenable}
|
|
109
|
-
>
|
|
110
|
-
<div class="action-bar flex justify-between" slot="footer">
|
|
111
|
-
<button class="btu-button btu-button-error">Delete</button>
|
|
112
|
-
<button class="btu-button btu-button-success">Save</button>
|
|
113
|
-
</div>
|
|
114
|
-
<div>Body content with heading and an action bar in the footer.</div>
|
|
115
|
-
</btu-widget>
|
|
116
|
-
\`,
|
|
117
|
-
parameters: {
|
|
118
|
-
docs: {
|
|
119
|
-
description: {
|
|
120
|
-
story: 'Widget demonstrating how easy it is to add an action bar component to the footer of a widget.'
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}`,...d.parameters?.docs?.source}}};c.parameters={...c.parameters,docs:{...c.parameters?.docs,source:{originalSource:`{
|
|
125
|
-
render: args => html\`
|
|
126
|
-
<btu-widget
|
|
127
|
-
.heading=\${args.heading ?? 'Fully Themed Widget'}
|
|
128
|
-
?collapsible=\${args.collapsible}
|
|
129
|
-
?collapsed=\${args.collapsed}
|
|
130
|
-
?fullscreenable=\${args.fullscreenable}
|
|
131
|
-
style="--widget-background: oklch(var(--btu-theme-purple-100)); --widget-border: 1px solid oklch(var(--btu-theme-purple-800)); --header-background: oklch(var(--btu-theme-purple-300));"
|
|
132
|
-
>
|
|
133
|
-
<button class="btu-button btu-button-purple" slot="controls">Action</button>
|
|
134
|
-
<div>
|
|
135
|
-
<p>Customized!</p>
|
|
136
|
-
</div>
|
|
137
|
-
<div slot="footer">
|
|
138
|
-
<small>Footer content (hidden when collapsed)</small>
|
|
139
|
-
</div>
|
|
140
|
-
</btu-widget>
|
|
141
|
-
\`,
|
|
142
|
-
parameters: {
|
|
143
|
-
docs: {
|
|
144
|
-
description: {
|
|
145
|
-
story: 'Widget with complete theming using all available CSS variables. Demonstrates full control over widget and header appearance.'
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}`,...c.parameters?.docs?.source}}};u.parameters={...u.parameters,docs:{...u.parameters?.docs,source:{originalSource:`{
|
|
150
|
-
args: {
|
|
151
|
-
collapsible: true,
|
|
152
|
-
collapsed: true
|
|
153
|
-
},
|
|
154
|
-
render: args => html\`
|
|
155
|
-
<btu-widget
|
|
156
|
-
.heading=\${args.heading ?? 'Initially Collapsed'}
|
|
157
|
-
?collapsible=\${args.collapsible ?? true}
|
|
158
|
-
?collapsed=\${args.collapsed ?? true}
|
|
159
|
-
?fullscreenable=\${args.fullscreenable}
|
|
160
|
-
>
|
|
161
|
-
<div style="padding: 1rem;">
|
|
162
|
-
<p>This widget starts in a collapsed state.</p>
|
|
163
|
-
<p>Click the chevron to expand and see this content.</p>
|
|
164
|
-
</div>
|
|
165
|
-
</btu-widget>
|
|
166
|
-
\`,
|
|
167
|
-
parameters: {
|
|
168
|
-
docs: {
|
|
169
|
-
description: {
|
|
170
|
-
story: 'Widget that starts in a collapsed state.'
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}`,...u.parameters?.docs?.source}}};b.parameters={...b.parameters,docs:{...b.parameters?.docs,source:{originalSource:`{
|
|
175
|
-
render: args => {
|
|
176
|
-
const icons = ['pencil', 'gear', 'trash', 'star', 'heart', 'bell'];
|
|
177
|
-
let iconIndex = 0;
|
|
178
|
-
const addContent = (widgetEl: HTMLElement) => {
|
|
179
|
-
const icon = document.createElement('btu-icon');
|
|
180
|
-
icon.setAttribute('symbol', icons[iconIndex % icons.length]);
|
|
181
|
-
icon.setAttribute('slot', 'controls');
|
|
182
|
-
iconIndex++;
|
|
183
|
-
widgetEl.appendChild(icon);
|
|
184
|
-
const newParagraph = document.createElement('p');
|
|
185
|
-
newParagraph.textContent = 'This paragraph was added dynamically and automatically redistributed to the body!';
|
|
186
|
-
newParagraph.style.color = '#16a34a';
|
|
187
|
-
newParagraph.style.fontWeight = '600';
|
|
188
|
-
widgetEl.appendChild(newParagraph);
|
|
189
|
-
const newButton = document.createElement('button');
|
|
190
|
-
newButton.className = 'btu-button btu-button-purple';
|
|
191
|
-
newButton.textContent = 'Button';
|
|
192
|
-
newButton.setAttribute('slot', 'footer');
|
|
193
|
-
widgetEl.appendChild(newButton);
|
|
194
|
-
};
|
|
195
|
-
return html\`
|
|
196
|
-
<div style="display: flex; flex-direction: column; gap: 1rem;">
|
|
197
|
-
<button
|
|
198
|
-
class="btu-button btu-button-primary"
|
|
199
|
-
@click="\${(e: Event) => {
|
|
200
|
-
const widget = (e.target as HTMLElement).parentElement?.querySelector('btu-widget');
|
|
201
|
-
if (widget) addContent(widget);
|
|
202
|
-
}}"
|
|
203
|
-
>
|
|
204
|
-
Add Dynamic Content
|
|
205
|
-
</button>
|
|
206
|
-
<btu-widget
|
|
207
|
-
.heading=\${args.heading ?? 'Dynamic Content Demo'}
|
|
208
|
-
?collapsible=\${args.collapsible ?? true}
|
|
209
|
-
?collapsed=\${args.collapsed}
|
|
210
|
-
?fullscreenable=\${args.fullscreenable}
|
|
211
|
-
>
|
|
212
|
-
<button class="btu-button btu-button-primary" slot="controls">Initial Button</button>
|
|
213
|
-
<div style="padding: 1rem;">
|
|
214
|
-
<p>Click the "Add Dynamic Content" button above to demonstrate:</p>
|
|
215
|
-
<ul>
|
|
216
|
-
<li>MutationObserver detects new child elements</li>
|
|
217
|
-
<li>New <code>slot="controls"</code> icon is redistributed to header actions</li>
|
|
218
|
-
<li>New paragraph (no slot) is redistributed to body</li>
|
|
219
|
-
<li>New <code>slot="footer"</code> button is redistributed to footer</li>
|
|
220
|
-
</ul>
|
|
221
|
-
</div>
|
|
222
|
-
</btu-widget>
|
|
223
|
-
</div>
|
|
224
|
-
\`;
|
|
225
|
-
},
|
|
226
|
-
parameters: {
|
|
227
|
-
docs: {
|
|
228
|
-
description: {
|
|
229
|
-
story: "Demonstrates the Manager Pattern's MutationObserver: Content added dynamically is automatically redistributed to the correct containers based on slot attributes."
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
}`,...b.parameters?.docs?.source}}};const k=["Default","WithFooter","CustomizedWithCSSVariables","CollapsedByDefault","DynamicContentRedistribution"];export{u as CollapsedByDefault,c as CustomizedWithCSSVariables,i as Default,b as DynamicContentRedistribution,d as WithFooter,k as __namedExportsOrder,$ as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{E as r}from"./iframe-B9buZjP7.js";const m=o=>o??r;export{m as o};
|