@adia-ai/web-components 0.7.3 → 0.7.5
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 +31 -0
- package/components/accordion/accordion.css +2 -2
- package/components/action-list/action-list.css +2 -2
- package/components/agent-artifact/agent-artifact.css +31 -31
- package/components/agent-feedback-bar/agent-feedback-bar.css +10 -10
- package/components/agent-questions/agent-questions.css +59 -57
- package/components/agent-reasoning/agent-reasoning.css +54 -54
- package/components/agent-suggestions/agent-suggestions.css +4 -4
- package/components/agent-trace/agent-trace.css +53 -53
- package/components/alert/alert.css +53 -53
- package/components/avatar/avatar.css +27 -27
- package/components/badge/badge.css +56 -53
- package/components/block/block.css +16 -16
- package/components/blockquote/blockquote.css +16 -16
- package/components/breadcrumb/breadcrumb.css +23 -23
- package/components/button/button.css +123 -101
- package/components/calendar-grid/calendar-grid.css +95 -92
- package/components/calendar-picker/calendar-picker.css +141 -139
- package/components/canvas/canvas.css +12 -12
- package/components/card/card.css +83 -83
- package/components/chart/chart.css +218 -218
- package/components/chart-legend/chart-legend.css +26 -26
- package/components/check/check.css +40 -40
- package/components/code/code.css +125 -125
- package/components/col/col.css +15 -15
- package/components/color-picker/color-picker.css +55 -55
- package/components/combobox/combobox.css +64 -62
- package/components/command/command.css +91 -91
- package/components/context-menu/context-menu.css +1 -1
- package/components/date-range-picker/date-range-picker.css +59 -59
- package/components/datetime-picker/datetime-picker.css +25 -25
- package/components/demo-toggle/demo-toggle.css +27 -27
- package/components/description-list/description-list.css +18 -18
- package/components/divider/divider.css +24 -24
- package/components/embed/embed.css +6 -6
- package/components/empty-state/empty-state.css +29 -29
- package/components/feed/feed.css +12 -12
- package/components/field/field.css +28 -28
- package/components/field/field.test.js +2 -2
- package/components/fields/fields.css +5 -5
- package/components/grid/grid.a2ui.json +10 -0
- package/components/grid/grid.css +23 -5
- package/components/grid/grid.d.ts +4 -0
- package/components/grid/grid.yaml +13 -0
- package/components/heatmap/heatmap.css +61 -61
- package/components/icon/icon.css +12 -12
- package/components/image/image.css +14 -14
- package/components/inline-edit/inline-edit.css +16 -16
- package/components/inline-message/inline-message.css +16 -16
- package/components/input/input.css +69 -66
- package/components/inspector/inspector.css +6 -6
- package/components/integration-card/integration-card.css +41 -41
- package/components/integration-card/integration-card.test.js +4 -4
- package/components/kbd/kbd.css +47 -40
- package/components/link/link.css +12 -12
- package/components/list/list.css +8 -8
- package/components/list-window/list-window.css +10 -10
- package/components/loading-overlay/loading-overlay.css +17 -18
- package/components/loading-overlay/loading-overlay.test.js +8 -8
- package/components/mark/mark.css +16 -16
- package/components/menu/menu.css +9 -9
- package/components/modal/modal.class.js +5 -9
- package/components/modal/modal.css +43 -43
- package/components/nav/nav.css +40 -40
- package/components/nav-group/nav-group.css +54 -54
- package/components/nav-item/nav-item.css +44 -44
- package/components/noodles/noodles.css +31 -31
- package/components/number-format/number-format.css +4 -4
- package/components/option-card/option-card.css +70 -70
- package/components/otp-input/otp-input.css +29 -29
- package/components/page/page.a2ui.json +1 -1
- package/components/page/page.css +27 -27
- package/components/page/page.d.ts +1 -1
- package/components/page/page.yaml +1 -1
- package/components/pagination/pagination.css +6 -6
- package/components/pane/pane.css +57 -57
- package/components/password-strength/password-strength.css +32 -32
- package/components/pipeline-status/pipeline-status.css +67 -67
- package/components/popover/popover.css +11 -11
- package/components/preview/preview.css +21 -21
- package/components/progress/progress.css +23 -23
- package/components/progress-row/progress-row.css +17 -17
- package/components/qr-code/qr-code.css +4 -4
- package/components/radio/radio.css +39 -39
- package/components/range/range.css +58 -55
- package/components/rating/rating.css +28 -28
- package/components/relative-time/relative-time.css +6 -6
- package/components/richtext/richtext.css +133 -133
- package/components/row/row.css +19 -19
- package/components/search/search.css +5 -5
- package/components/segment/segment.css +29 -24
- package/components/segmented/segmented.css +30 -25
- package/components/select/select.css +95 -93
- package/components/skeleton/skeleton.css +14 -14
- package/components/skip-nav/skip-nav.css +4 -4
- package/components/slider/slider.css +61 -61
- package/components/spinner/spinner.css +40 -40
- package/components/spinner/spinner.test.js +10 -12
- package/components/stack/stack.css +11 -11
- package/components/stat/stat.css +27 -27
- package/components/step-progress/step-progress.css +20 -20
- package/components/stepper/stepper.css +29 -29
- package/components/stream/stream.css +12 -12
- package/components/swatch/swatch.css +68 -68
- package/components/swiper/swiper.class.js +5 -12
- package/components/swiper/swiper.css +57 -57
- package/components/switch/switch.css +53 -53
- package/components/table/table.css +166 -163
- package/components/table-toolbar/table-toolbar.css +33 -33
- package/components/tabs/tabs.css +54 -51
- package/components/tag/tag.css +74 -71
- package/components/tag/tag.test.js +14 -14
- package/components/tags-input/tags-input.css +51 -49
- package/components/text/text.css +44 -44
- package/components/textarea/textarea.css +49 -46
- package/components/time-picker/time-picker.css +47 -47
- package/components/timeline/timeline.css +54 -54
- package/components/toast/toast.css +58 -58
- package/components/toc/toc.css +28 -28
- package/components/toggle-group/toggle-group.css +9 -6
- package/components/toggle-scheme/toggle-scheme.css +2 -2
- package/components/toolbar/toolbar.css +18 -18
- package/components/tooltip/tooltip.css +2 -2
- package/components/tour/tour.css +4 -4
- package/components/tree/tree.css +37 -37
- package/components/upload/upload.css +49 -49
- package/dist/host.min.css +1 -0
- package/dist/web-components.min.css +1 -1
- package/dist/web-components.min.js +2 -2
- package/package.json +1 -1
- package/styles/api/text.css +9 -2
- package/styles/foundation/space.css +19 -18
- package/styles/host.css +48 -0
- package/styles/prose.css +187 -173
- package/styles/type/scale.css +6 -0
- package/styles/typography.css +10 -5
- package/styles/verse.css +122 -0
|
@@ -154,7 +154,7 @@ parent-template-re-read pattern that works across frameworks.`);return}if(this.d
|
|
|
154
154
|
`),this.#e=this.querySelector("section"),this.#i=this.querySelector("chat-input-ui"),this.#i?.addEventListener("submit",this.#n)}disconnected(){this.#s!=null&&(cancelAnimationFrame(this.#s),this.#s=null),this.#i?.removeEventListener("submit",this.#n),this.#e=null,this.#i=null}#n=t=>{if(this.streaming)return;let{text:e,model:i}=t.detail||{};e&&(this.#i.clear(),this.dispatchEvent(new CustomEvent("submit",{bubbles:!0,detail:{text:e,model:i}})))};appendMessage({role:t,content:e="",render:i=!1}){this.#t.push({role:t,content:e});let n=document.createElement("div");n.setAttribute("data-role",t);let r=i?yn(e):TA(e);if(t==="user")n.innerHTML=`<div slot="bubble">${r}</div>`;else{let o=i?"":'<span slot="cursor"></span>';n.innerHTML=`
|
|
155
155
|
<span slot="avatar">${t==="assistant"?"AI":t[0].toUpperCase()}</span>
|
|
156
156
|
<div slot="bubble">${r}${o}</div>
|
|
157
|
-
`}return this.#e?.appendChild(n),this.#r(),n}appendChunk(t){let e=this.#t[this.#t.length-1];if(!e||e.role==="user")return;e.content+=t;let i=this.#e?.querySelector('[data-role]:last-child [slot="bubble"]');if(i){let n=i.querySelector('[slot="cursor"]');n&&n.remove(),i.insertAdjacentText("beforeend",t),i.insertAdjacentHTML("beforeend",'<span slot="cursor"></span>')}this.#r()}startStreaming(){this.streaming=!0,this.#i&&(this.#i.disabled=!0)}stopStreaming(){this.streaming=!1,this.#i&&(this.#i.disabled=!1),this.#e?.querySelector('[data-role]:last-child [slot="cursor"]')?.remove();let t=this.#t[this.#t.length-1];if(t&&t.role==="assistant"&&t.content){let e=this.#e?.querySelector('[data-role]:last-child [slot="bubble"]');e&&(e.innerHTML=yn(t.content))}this.#i?.focus()}clear(){this.#t.length=0,this.#e&&(this.#e.innerHTML="")}#r(){let t=this.#e;t&&(this.#s!=null&&cancelAnimationFrame(this.#s),this.#s=requestAnimationFrame(()=>{this.#s=null,this.isConnected&&(t.scrollTop=t.scrollHeight)}))}};x("chat-thread-ui",vn);Q();var xn=class extends k{#t=!1;#e=!1;#i=null;#s=null;#n=null;#r=null;#a="programmatic";static properties={text:{type:String,default:"",reflect:!0},side:{type:String,default:"right",reflect:!0},size:{type:String,default:"md",reflect:!0},permanent:{type:Boolean,default:!1,reflect:!0},open:{type:Boolean,default:!1,reflect:!0}};static parts={dialog:'<dialog slot="dialog"></dialog>',panel:'<div slot="panel"></div>',header:'<header slot="header"></header>',close:'<button-ui slot="close" icon="x" variant="ghost" size="sm" aria-label="Close"></button-ui>',body:'<section slot="body"></section>',footer:'<footer slot="footer"></footer>'};constructor(){super();let t=Object.getOwnPropertyDescriptor(this,"open");if(t?.set){let e=t.set;Object.defineProperty(this,"open",{get:t.get,set:i=>{e.call(this,i),this.#f()},configurable:!0})}}#o=t=>{t.target.closest('[slot="close"]')&&(this.#a="close-button",this.open=!1)};#l=t=>{t.preventDefault(),this.#a="escape",this.permanent||(this.open=!1)};#c=()=>{this.open=!1,this.#i?.focus(),this.#i=null;let t=this.#a;this.#a="programmatic",this.dispatchEvent(new CustomEvent("close",{detail:{reason:t},bubbles:!0}))};#h=t=>{t.target===this.#r&&!this.permanent&&(this.#a="backdrop",this.open=!1)};connected(){this.addEventListener("press",this.#o);let t=this.ensure("dialog");t&&!this.#t&&(this.#t=!0,this.#r=t,t.addEventListener("cancel",this.#l),t.addEventListener("close",this.#c),t.addEventListener("click",this.#h))}disconnected(){this.removeEventListener("press",this.#o),this.#r&&(this.#r.removeEventListener("cancel",this.#l),this.#r.removeEventListener("close",this.#c),this.#r.removeEventListener("click",this.#h)),this.#s!=null&&(clearTimeout(this.#s),this.#s=null),this.#n!=null&&(clearTimeout(this.#n),this.#n=null),this.#t=!1,this.#r=null}#u(){let t=getComputedStyle(this).getPropertyValue("--drawer-duration").trim();return parseFloat(t)||200}#d(t,e,i="append"){let n={header:"header",body:"section",footer:"footer"}[t],r=h=>h.getAttribute("slot")===t||n&&!h.getAttribute("slot")&&h.localName===n,o=[...this.children].find(r),a=[...e.children].find(h=>h.getAttribute("slot")===t);o&&a&&o!==a&&a.remove();let l=o||a||(()=>{let h=this.constructor._pp?.[t];if(!h)return null;let c=h.cloneNode(!0);return c.setAttribute("data-stamped",""),c})();return l?(l.getAttribute("slot")!==t&&l.setAttribute("slot",t),l.parentElement!==e&&(i==="prepend"?e.prepend(l):e.appendChild(l)),l):null}render(){let t=this.ensure("dialog");t!==this.#r&&(this.#r&&(this.#r.removeEventListener("cancel",this.#l),this.#r.removeEventListener("close",this.#c),this.#r.removeEventListener("click",this.#h)),this.#r=t,t.addEventListener("cancel",this.#l),t.addEventListener("close",this.#c),t.addEventListener("click",this.#h)),this.text?(t.setAttribute("aria-label",this.text),this.setAttribute("aria-label",this.text)):(t.removeAttribute("aria-label"),this.removeAttribute("aria-label"));let e=this.ensure("panel");e.parentElement!==t&&t.appendChild(e);let i=this.#d("header",e,"prepend");if(i){let o=i.querySelector(':scope > [slot="heading"][data-stamped]'),a=[...i.children].some(l=>!l.hasAttribute("data-stamped")&&(l.getAttribute("slot")==="heading"||/^h[1-6]$/.test(l.localName)));this.text&&!a?(o||(o=document.createElement("span"),o.setAttribute("slot","heading"),o.setAttribute("data-stamped",""),i.prepend(o)),o.textContent!==this.text&&(o.textContent=this.text)):o&&o.remove()}if(this.permanent)this.drop("close");else{let o=this.ensure("close");i&&o.parentElement!==i&&i.appendChild(o)}let n=[...this.children].filter(o=>o.getAttribute("slot")==="body"||o.localName==="section"&&!o.getAttribute("slot"));if(n.length===0)this.#d("body",e,"append");else for(let o of n)o.getAttribute("slot")!=="body"&&o.setAttribute("slot","body"),o.parentElement!==e&&e.appendChild(o);let r=[...this.children].find(o=>o.getAttribute("slot")==="footer"||!o.getAttribute("slot")&&o.localName==="footer");r&&(r.getAttribute("slot")!=="footer"&&r.setAttribute("slot","footer"),r.parentElement!==e&&e.appendChild(r)),this.#f()}#f(){let t=this.#r;if(t&&t.isConnected)if(this.open&&!t.open){this.#e=!1,this.#i=document.activeElement;try{t.showModal()}catch(e){console.error("[drawer-ui] showModal() failed \u2014 dialog may be detached:",e)}t.offsetHeight,t.setAttribute("data-open",""),this.#n!=null&&clearTimeout(this.#n),this.#n=setTimeout(()=>{this.#n=null,this.dispatchEvent(new CustomEvent("opened",{bubbles:!0}))},this.#u())}else!this.open&&t.open&&!this.#e&&this.#p(t)}#p(t){this.#e=!0,this.#n!=null&&(clearTimeout(this.#n),this.#n=null),t.setAttribute("data-closing",""),t.offsetHeight,t.removeAttribute("data-open"),this.#s=setTimeout(()=>{this.#s=null,this.#e=!1,t.removeAttribute("data-closing"),t.open&&t.close()},this.#u())}show(){this.open=!0}hide(){this.open=!1}};x("drawer-ui",xn);Q();var Sn=class extends k{#t=!1;#e=!1;#i=null;#s=null;#n=null;static properties={text:{type:String,default:"",reflect:!0},size:{type:String,default:"md",reflect:!0},permanent:{type:Boolean,default:!1,reflect:!0},open:{type:Boolean,default:!1,reflect:!0}};static parts={dialog:'<dialog slot="dialog"></dialog>',panel:'<div slot="panel"></div>',header:'<header slot="header"></header>',close:'<button-ui slot="close" icon="x" variant="ghost" size="sm" aria-label="Close"></button-ui>',body:'<section slot="body"></section>',footer:'<footer slot="footer"></footer>'};#r=t=>{t.target.closest('[slot="close"]')&&(this.open=!1)};#a=t=>{t.preventDefault(),this.permanent||(this.open=!1)};#o=()=>{this.open=!1,this.#i?.focus(),this.#i=null,this.dispatchEvent(new Event("close",{bubbles:!0}))};#l=t=>{t.target===this.#n&&!this.permanent&&(this.open=!1)};connected(){this.addEventListener("press",this.#r);let t=this.ensure("dialog");t&&!this.#t&&(this.#t=!0,this.#n=t,t.addEventListener("cancel",this.#a),t.addEventListener("close",this.#o),t.addEventListener("click",this.#l))}disconnected(){this.removeEventListener("press",this.#r),this.#n&&(this.#n.removeEventListener("cancel",this.#a),this.#n.removeEventListener("close",this.#o),this.#n.removeEventListener("click",this.#l)),this.#s!=null&&(clearTimeout(this.#s),this.#s=null),this.#t=!1,this.#n=null}#c(){let t=getComputedStyle(this),e=t.getPropertyValue("--modal-duration").trim()||t.getPropertyValue("--modal-duration-default").trim();return parseFloat(e)||200}render(){let t=this.ensure("dialog");this.text?(t.setAttribute("aria-label",this.text),this.setAttribute("aria-label",this.text)):(t.removeAttribute("aria-label"),this.removeAttribute("aria-label"));let e=this.ensure("panel");e.parentElement!==t&&t.appendChild(e);let i=this.ensure("header");if(i.parentElement!==e&&e.prepend(i),this.text?i.setAttribute("text",this.text):i.removeAttribute("text"),this.permanent)this.drop("close");else{let l=this.ensure("close");l.parentElement!==i&&i.appendChild(l)}let n=[...this.children].find(l=>l.getAttribute("slot")==="body"||!l.getAttribute("slot")&&l.localName==="section"),r=[...this.children].filter(l=>!l.getAttribute("slot")&&l.localName!=="section"&&l.localName!=="dialog"&&l.localName!=="footer"),o;n?(n.getAttribute("slot")!=="body"&&n.setAttribute("slot","body"),n.parentElement!==e&&e.appendChild(n),e.querySelector(':scope > [slot="body"][data-stamped]')?.remove(),o=n):(o=this.ensure("body"),o.setAttribute("data-stamped",""),o.parentElement!==e&&e.appendChild(o));for(let l of r)l!==o&&o.appendChild(l);let a=[...this.children].find(l=>l.getAttribute("slot")==="footer"||!l.getAttribute("slot")&&l.localName==="footer");if(a)a.getAttribute("slot")!=="footer"&&a.setAttribute("slot","footer"),a.parentElement!==e&&e.appendChild(a),e.querySelector(':scope > [slot="footer"][data-stamped]')?.remove();else{let l=this.ensure("footer");l.setAttribute("data-stamped",""),l.parentElement!==e&&e.appendChild(l)}this.open&&!t.open?(this.#e=!1,this.#i=document.activeElement,t.showModal(),t.offsetHeight,t.setAttribute("data-open","")):!this.open&&t.open&&!this.#e&&this.#h(t)}#h(t){this.#e=!0,t.setAttribute("data-closing",""),t.offsetHeight,t.removeAttribute("data-open"),this.#s=setTimeout(()=>{this.#s=null,this.#e=!1,t.removeAttribute("data-closing"),t.open&&t.close()},this.#c())}show(){this.open=!0}hide(){this.open=!1}};x("modal-ui",Sn);Q();var wn=class extends k{static properties={position:{type:String,default:"bottom-right",reflect:!0},max:{type:Number,default:5,reflect:!0}};static template=()=>It``;connected(){this.hasAttribute("role")||this.setAttribute("role","region"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Feed")}},kn=class s extends k{#t=null;#e=!1;#i=null;#s=null;static properties={text:{type:String,default:"",reflect:!0},heading:{type:String,default:"",reflect:!0},icon:{type:String,default:"",reflect:!0},variant:{type:String,default:"default",reflect:!0},duration:{type:Number,default:4e3,reflect:!0},dismissible:{type:Boolean,default:!1,reflect:!0},action:{type:String,default:"",reflect:!0}};static parts={body:'<div slot="body"></div>'};static template=()=>It``;#n=t=>{if(t.target.closest("[data-feed-close]")){this.dismiss();return}if(t.target.closest("[data-feed-action]")){try{this.#r?.()}catch(e){console.warn("[feed-item] action handler threw:",e)}this.dismiss()}};#r=null;#a=null;#o=null;connected(){this.addEventListener("press",this.#n)}#l(){let t=getComputedStyle(this).getPropertyValue("--feed-item-duration").trim();return parseFloat(t)||200}render(){let t=this.ensure("body");if(t.textContent="",this.heading){let h=document.createElement("strong");h.textContent=this.heading,h.style.display="block",t.appendChild(h)}if(this.text){let h=document.createElement("span");h.textContent=this.text,t.appendChild(h)}let e=!this.duration||this.duration<=0,i=this.variant==="danger"||this.variant==="warning",n=e&&!!this.action,r="status";n?r="alertdialog":e&&i&&(r="alert"),this.setAttribute("role",r),this.setAttribute("aria-live",r==="alert"||r==="alertdialog"?"assertive":"polite"),n&&this.setAttribute("aria-modal","false");let o=this.dismissible||e,a=this.querySelector(":scope > [data-feed-close]");o&&!a?(a=document.createElement("button-ui"),a.setAttribute("data-feed-close",""),a.setAttribute("icon","x"),a.setAttribute("variant","ghost"),a.setAttribute("size","sm"),a.setAttribute("aria-label","Dismiss"),this.appendChild(a)):!o&&a&&a.remove();let l=this.querySelector(":scope > [data-feed-action]");this.action?(l||(l=document.createElement("button-ui"),l.setAttribute("data-feed-action",""),l.setAttribute("variant","ghost"),l.setAttribute("size","sm"),a&&a.parentElement===this?this.insertBefore(l,a):this.appendChild(l)),l.setAttribute("text",this.action)):l&&l.remove(),n?this.#h():this.#u(),!this.hasAttribute("data-open")&&!this.#e&&(this.#s=requestAnimationFrame(()=>{this.#s=null,this.setAttribute("data-open","")})),this.#c()}#c(){this.#t&&clearTimeout(this.#t),this.duration&&this.duration>0&&(this.#t=setTimeout(()=>this.dismiss(),this.duration))}dismiss(){this.#e||(this.#e=!0,this.#t&&(clearTimeout(this.#t),this.#t=null),this.removeAttribute("data-open"),this.setAttribute("data-closing",""),this.#i=setTimeout(()=>{this.#i=null;let t=this.parentElement;this.dispatchEvent(new Event("close",{bubbles:!0})),this.remove(),t?.matches?.("feed-ui")&&Xe.releaseContainerIfEmpty(t)},this.#l()))}update(t){if(!(!t||typeof t!="object")){for(let e of Object.keys(t))e in s.properties&&(this[e]=t[e]);typeof t.onAction=="function"&&(this.#r=t.onAction),this.#c()}}#h(){if(this.#o)return;this.#a=document.activeElement;let t=()=>[...this.querySelectorAll('button, button-ui, [tabindex]:not([tabindex="-1"]), input, [data-feed-action], [data-feed-close]')].filter(e=>!e.hasAttribute("disabled")&&e.offsetParent!==null);this.#o=e=>{if(e.key==="Escape"){e.stopPropagation(),this.dismiss();return}if(e.key!=="Tab")return;let i=t();if(!i.length)return;let n=i[0],r=i[i.length-1],o=document.activeElement;e.shiftKey&&o===n?(e.preventDefault(),r.focus()):!e.shiftKey&&o===r&&(e.preventDefault(),n.focus())},this.addEventListener("keydown",this.#o,!0),queueMicrotask(()=>{let e=t();(this.querySelector("[data-feed-action]")||e[0])?.focus?.()})}#u(){if(this.#o){this.removeEventListener("keydown",this.#o,!0),this.#o=null;try{this.#a?.focus?.()}catch{}this.#a=null}}disconnected(){this.removeEventListener("press",this.#n),this.#t&&(clearTimeout(this.#t),this.#t=null),this.#i&&(clearTimeout(this.#i),this.#i=null),this.#s!=null&&(cancelAnimationFrame(this.#s),this.#s=null),this.#u()}},Xe=class s{static#t=new Map;static get(t="bottom-right"){let e=s.#t.get(t);if(e&&e.isConnected)return e;e=document.createElement("feed-ui"),e.setAttribute("position",t),"popover"in HTMLElement.prototype&&e.setAttribute("popover","manual"),document.body.appendChild(e);try{e.showPopover?.()}catch{}return s.#t.set(t,e),e}static post(t={}){let{text:e="",heading:i="",icon:n="",variant:r="default",duration:o=4e3,position:a="bottom-right",dismissible:l,id:h,action:c="",onAction:u}=t,d=r==="error"?"danger":r,f=s.get(a),p=parseInt(f.getAttribute("max")||"5",10),m=[...f.children].filter(y=>y.tagName==="FEED-ITEM-UI"&&!y.hasAttribute("data-queued")).length,O=document.createElement("feed-item-ui");h&&O.setAttribute("data-id",h),O.text=e,O.heading=i,O.icon=n,O.variant=d;let g="duration"in t;return O.duration=c&&!g?0:o,l!=null&&(O.dismissible=!!l),c&&(O.action=c),m>=p&&O.setAttribute("data-queued",""),f.appendChild(O),typeof u=="function"&&O.update({onAction:u}),{id:h??null,dismiss:()=>O.dismiss(),update:y=>O.update(y)}}static clear(t="bottom-right"){let e=s.#t.get(t);if(e)for(let i of[...e.children])i.tagName==="FEED-ITEM-UI"&&i.dismiss?.()}static purge(){for(let t of s.#t.values()){try{t.hidePopover?.()}catch{}t.remove()}s.#t.clear()}static releaseContainerIfEmpty(t){if(!t)return;let e=t.querySelector("feed-item-ui[data-queued]");if(e&&e.removeAttribute("data-queued"),!(t.children.length>0)){try{t.hidePopover?.()}catch{}t.remove();for(let[i,n]of s.#t)n===t&&s.#t.delete(i)}}};x("feed-ui",wn),x("feed-item-ui",kn),typeof window<"u"&&!window.__adiaFeedListenerInstalled&&(window.__adiaFeedListenerInstalled=!0,window.addEventListener("feed",s=>{s?.detail&&typeof s.detail=="object"&&Xe.post(s.detail)}));Q();var os=class extends k{static properties={text:{type:String,default:"",reflect:!0},variant:{type:String,default:"info",reflect:!0},duration:{type:Number,default:4e3,reflect:!0},position:{type:String,default:"bottom-right",reflect:!0}};static template=()=>It``;connected(){this.__routedToFeed||(this.__routedToFeed=!0,Xe.post({text:this.text,variant:this.variant==="error"?"danger":this.variant,duration:this.duration,position:this.position}),queueMicrotask(()=>{try{this.remove()}catch{}}))}static show(t={}){let{text:e,variant:i="info",position:n="bottom-right",action:r,onAction:o}=t,a=Xe.get(n);a&&!a.hasAttribute("data-spawned-by")&&a.setAttribute("data-spawned-by","toast");let l={text:e,variant:i==="error"?"danger":i,position:n};return"duration"in t&&(l.duration=t.duration),"dismissible"in t&&(l.dismissible=!!t.dismissible),r&&(l.action=r),typeof o=="function"&&(l.onAction=o),Xe.post(l)}};x("toast-ui",os),typeof window<"u"&&!window.__adiaToastListenerInstalled&&(window.__adiaToastListenerInstalled=!0,window.addEventListener("toast",s=>{s?.detail&&typeof s.detail=="object"&&os.show(s.detail)}));Q();var ga=class extends k{static properties={text:{type:String,default:"",reflect:!0},value:{type:String,default:"",reflect:!0},icon:{type:String,default:"",reflect:!0},disabled:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;connected(){this.setAttribute("role","tabpanel")}render(){this.text&&this.setAttribute("aria-label",this.text),this.disabled?this.setAttribute("aria-disabled","true"):this.removeAttribute("aria-disabled")}};customElements.define("tab-ui",ga);Q();var An=class extends k{static properties={value:{type:String,default:"",reflect:!0},orientation:{type:String,default:"",reflect:!0}};static template=()=>null;#t=null;#e=null;#i=null;connected(){if(this.setAttribute("role","tablist"),this.addEventListener("click",this.#o),this.addEventListener("keydown",this.#l),!this.value){let t=this.querySelector("tab-ui:not([disabled])");t&&(this.value=t.value||t.getAttribute("value")||"")}}disconnected(){this.#i!=null&&(cancelAnimationFrame(this.#i),this.#i=null),this.removeEventListener("click",this.#o),this.removeEventListener("keydown",this.#l),this.#t=null,this.#e=null}get#s(){return[...this.querySelectorAll("tab-ui")]}get#n(){return this.#s.filter(t=>!t.disabled)}render(){let t=this.#s;if(t.length){this.#t||(this.#t=document.createElement("div"),this.#t.setAttribute("slot","strip"),this.#t.setAttribute("role","presentation")),this.#t.parentElement!==this&&this.prepend(this.#t),this.reconcile(this.#t,t,e=>e.value||e.getAttribute("value")||"",(e,i,n)=>{let r=e.value||e.getAttribute("value")||"",o=e.text||e.getAttribute("text")||"",a=e.icon||e.getAttribute("icon")||"",l=r===this.value,h=e.disabled||e.hasAttribute("disabled");if(n){if(n.textContent="",a){let u=document.createElement("icon-ui");u.setAttribute("name",a),n.appendChild(u)}return o&&n.appendChild(document.createTextNode(o)),n.setAttribute("aria-selected",String(l)),n.setAttribute("tabindex",l?"0":"-1"),h?n.setAttribute("disabled",""):n.removeAttribute("disabled"),l?n.setAttribute("data-active",""):n.removeAttribute("data-active"),n.dataset.value=r,n}let c=document.createElement("div");if(c.setAttribute("role","tab"),c.setAttribute("slot","tab-button"),c.dataset.value=r,c.setAttribute("aria-selected",String(l)),c.setAttribute("tabindex",l?"0":"-1"),h&&c.setAttribute("disabled",""),l&&c.setAttribute("data-active",""),a){let u=document.createElement("icon-ui");u.setAttribute("name",a),c.appendChild(u)}return o&&c.appendChild(document.createTextNode(o)),c}),this.#r();for(let e of t)(e.value||e.getAttribute("value")||"")===this.value?(e.removeAttribute("hidden"),e.setAttribute("role","tabpanel")):e.setAttribute("hidden","")}}#r(){let t=this.#t?.querySelector('[slot="tab-button"][data-active]');if(!t){this.#e&&(this.#e.style.opacity="0");return}let e=!this.#e;e&&(this.#e=document.createElement("span"),this.#e.setAttribute("slot","indicator"),this.#t.appendChild(this.#e));let i=this.#t.getBoundingClientRect(),n=t.getBoundingClientRect(),r=this.orientation==="vertical",o=()=>{if(r){let a=n.top-i.top;this.#e.style.transform=`translateY(${a}px)`,this.#e.style.height=`${n.height}px`,this.#e.style.width=""}else{let a=n.left-i.left;this.#e.style.transform=`translateX(${a}px)`,this.#e.style.width=`${n.width}px`,this.#e.style.height=""}this.#e.style.opacity="1"};e?(this.#e.style.transition="none",o(),this.#i=requestAnimationFrame(()=>{this.#i=null,this.#e&&(this.#e.style.transition="")})):o()}#a(t){t!==this.value&&(this.value=t,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{value:this.value}})))}#o=t=>{let e=t.target.closest('[slot="tab-button"]');!e||!this.contains(e)||e.hasAttribute("disabled")||this.#a(e.dataset.value)};#l=t=>{let e=t.target.closest('[slot="tab-button"]');if(!e||!this.contains(e))return;let i=[...this.#t.querySelectorAll('[slot="tab-button"]:not([disabled])')],n=i.indexOf(e);if(n<0)return;let r=this.orientation==="vertical",o=r?"ArrowDown":"ArrowRight",a=r?"ArrowUp":"ArrowLeft",l;switch(t.key){case o:l=n<i.length-1?n+1:0;break;case a:l=n>0?n-1:i.length-1;break;case"Home":l=0;break;case"End":l=i.length-1;break;default:return}t.preventDefault(),i[l].focus(),this.#a(i[l].dataset.value)}};x("tabs-ui",An);Q();var $n=class s extends k{static properties={text:{type:String,default:"",reflect:!0},placement:{type:String,default:"top",reflect:!0},delay:{type:Number,default:400,reflect:!0},follows:{type:String,default:"trigger",reflect:!0},for:{type:String,default:"",reflect:!0},indicator:{type:String,default:"none",reflect:!0}};static template=()=>null;#t=null;#e=null;#i=null;#s=null;#n=null;connected(){this.follows==="pointer"?this.#c():(this.addEventListener("mouseenter",this.#r),this.addEventListener("focusin",this.#r),this.addEventListener("mouseleave",this.#a),this.addEventListener("focusout",this.#a))}disconnected(){this.removeEventListener("mouseenter",this.#r),this.removeEventListener("focusin",this.#r),this.removeEventListener("mouseleave",this.#a),this.removeEventListener("focusout",this.#a),this.#h(),this.#l()}render(){this.#t&&this.follows!=="pointer"&&(this.#t.textContent=this.text),this.#t&&this.follows==="pointer"&&this.#n&&this.#m(this.#n)}#r=()=>{this.text&&(this.#e&&clearTimeout(this.#e),this.#e=setTimeout(()=>this.#o(),this.delay))};#a=()=>{this.#e&&(clearTimeout(this.#e),this.#e=null),this.#l()};#o(){if(this.#t)return;let t=document.createElement("div"),e=`tooltip-${Date.now()}`;t.id=e,t.setAttribute("popover","manual"),t.setAttribute("role","tooltip"),t.classList.add("tooltip-popup"),t.textContent=this.text,document.body.appendChild(t),this.setAttribute("aria-describedby",e);try{t.showPopover()}catch{}this.#t=t,this.#i=at(this,t,{placement:this.placement,gap:6})}#l(){if(this.#e&&(clearTimeout(this.#e),this.#e=null),!!this.#t){this.removeAttribute("aria-describedby"),this.#i?.(),this.#i=null;try{this.#t.hidePopover()}catch{}this.#t.remove(),this.#t=null,this.#n=null}}#c(){if(this.#h(),!this.for)return;let t=this.getRootNode();if(this.#s=t&&t.getElementById?t.getElementById(this.for):document.getElementById(this.for),!this.#s){s._warnedMissing||(s._warnedMissing=new WeakSet),s._warnedMissing.has(this)||(console.warn(`[tooltip-ui] follows="pointer" [for="${this.for}"] did not resolve to an element.`),s._warnedMissing.add(this));return}this.#s.addEventListener("chart-hover",this.#d),this.#s.addEventListener("chart-leave",this.#u)}#h(){this.#s&&(this.#s.removeEventListener("chart-hover",this.#d),this.#s.removeEventListener("chart-leave",this.#u)),this.#s=null}#u=()=>this.#l();#d=t=>{let e=t.detail;if(e){if(this.#n=e,!this.#t){this.#t=this.#f(),this.#p();try{this.#t.showPopover()}catch{}}this.#m(e),this.#O(e.pointerX,e.pointerY)}};#f(){let t=document.createElement("div");return t.setAttribute("popover","manual"),t.setAttribute("role","tooltip"),t.setAttribute("data-follows","pointer"),t.setAttribute("data-indicator",this.indicator||"none"),t.classList.add("tooltip-popup"),document.body.appendChild(t),t}#p(){if(!this.#s||!this.#t)return;let t=this.#s.style;for(let i=0;i<t.length;i++){let n=t[i];n.startsWith("--color-")&&this.#t.style.setProperty(n,t.getPropertyValue(n))}let e=getComputedStyle(this.#s);for(let i=0;i<10;i++){let n=e.getPropertyValue(`--chart-${i}`).trim();n&&this.#t.style.setProperty(`--chart-${i}`,n)}}#m(t){if(!this.#t)return;let{label:e,value:i,pct:n,series:r,slot:o,payload:a}=t,l=this.indicator||"none",h=Array.isArray(a)&&a.length>0?a:[{series:r,label:e,value:i,pct:n,slot:o,hovered:!0}],c=[];e!=null&&c.push(`<span data-tip-role="label">${this.#g(String(e))}</span>`);for(let u of h){let d=u.series??null,f=u.value,p=u.pct,m=u.slot!=null?u.slot:0,O=d?`var(--color-${d}, var(--chart-${m}))`:`var(--chart-${m})`;if(f==null&&p==null)continue;let g=f!=null?this.#g(String(f)):"",y=p!=null?`<span data-tip-role="pct"> (${p}%)</span>`:"",v=l!=="none"?`<span data-indicator style="--tooltip-indicator-color: ${O}"></span>`:"",S=d?`<span data-tip-role="name">${this.#g(d)}</span>`:"",w=u.hovered?" data-hovered":"";c.push(`<span data-tip-row${w}>${v}${S}<span data-tip-role="value">${g}${y}</span></span>`)}this.#t.setAttribute("data-indicator",l),this.#t.setAttribute("aria-live","polite"),this.#t.innerHTML=c.join("")}#O(t,e){if(!this.#t||t==null||e==null)return;let i=12,n=8,r=this.#t;r.style.position="fixed",r.style.left="0",r.style.top="0";let o=r.offsetWidth||0,a=r.offsetHeight||0,l=t-o/2,h=e-a-i;l<n&&(l=n),l+o>window.innerWidth-n&&(l=window.innerWidth-o-n),h<n&&(h=e+i),r.style.left=`${l}px`,r.style.top=`${h}px`}#g(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}};x("tooltip-ui",$n);Q();var LA={new:{variant:"success",text:"New"},updated:{variant:"info",text:"Updated"},deprecated:{variant:"warning",text:"Deprecated"},removed:{variant:"danger",text:"Removed"},beta:{variant:"accent",text:"Beta"}},Cn=class extends k{static properties={text:{type:String,default:"",reflect:!0},variant:{type:String,default:"default",reflect:!0},size:{type:String,default:"md",reflect:!0},icon:{type:String,default:"",reflect:!0},status:{type:String,default:"",reflect:!0}};static template=()=>null;connected(){this.hasAttribute("role")||this.setAttribute("role","status")}render(){if(this.status){let t=LA[this.status];t&&(this.variant!==t.variant&&(this.variant=t.variant),this.text!==t.text&&(this.text=t.text))}if(this.text&&this.setAttribute("aria-label",this.text),this.icon){let t=this.querySelector(":scope > icon-ui");if(!t||t.getAttribute("name")!==this.icon){t&&t.remove();let e=document.createElement("icon-ui");e.setAttribute("name",this.icon),e.setAttribute("size","sm"),this.prepend(e)}}else this.querySelector(":scope > icon-ui")?.remove()}};x("badge-ui",Cn);Q();var En=class extends k{static properties={separator:{type:String,default:"/",reflect:!0},collapse:{type:Boolean,default:!1,reflect:!0},collapseKeepLeading:{type:Number,default:1,attribute:"collapse-keep-leading",reflect:!0},collapseKeepTrailing:{type:Number,default:2,attribute:"collapse-keep-trailing",reflect:!0}};static template=()=>null;connected(){this.setAttribute("role","navigation"),this.setAttribute("aria-label","Breadcrumb")}render(){this.querySelectorAll("[data-sep], [data-overflow]").forEach(l=>l.remove());let t=Array.from(this.children).filter(l=>!l.hasAttribute("data-sep")&&!l.hasAttribute("data-overflow")),e=t.length-1;t.forEach((l,h)=>{l.setAttribute("data-item",""),l.removeAttribute("data-collapsed"),h===e?l.setAttribute("aria-current","page"):l.removeAttribute("aria-current")});let i=Math.max(0,this.collapseKeepLeading|0),n=Math.max(0,this.collapseKeepTrailing|0),r=i+n+1;if(this.collapse&&t.length>=Math.max(r,4)){let l=t.slice(i,t.length-n);l.forEach(c=>c.setAttribute("data-collapsed",""));let h=this.#t(l);i>0?t[i-1].after(h):this.prepend(h)}let a=Array.from(this.children).filter(l=>!l.hasAttribute("data-sep")&&!l.hasAttribute("data-collapsed"));for(let l=0;l<a.length-1;l++){let h=document.createElement("span");h.setAttribute("data-sep",""),h.setAttribute("aria-hidden","true"),h.textContent=this.separator,a[l].after(h)}}#t(t){let e=document.createElement("menu-ui");e.setAttribute("data-overflow",""),e.setAttribute("data-item",""),e.setAttribute("placement","bottom-start");let i=document.createElement("button-ui");i.setAttribute("slot","trigger"),i.setAttribute("text","\u2026"),i.setAttribute("variant","ghost"),i.setAttribute("size","sm"),i.setAttribute("aria-label","Show collapsed crumbs"),e.appendChild(i);for(let n of t){let r=document.createElement("menu-item-ui");r.setAttribute("text",n.textContent.trim()),n.tagName==="A"&&n.hasAttribute("href")&&r.setAttribute("value",n.getAttribute("href")),e.appendChild(r)}return e.addEventListener("action",n=>{let r=n.detail?.value;r&&r!=="#"&&(window.location.href=r)}),e}};x("breadcrumb-ui",En);Q();var Pn=class s extends k{static requiredIcons=["magnifying-glass"];static properties={placeholder:{type:String,default:"Type a command...",reflect:!0},open:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;#t=[];#e=[];#i=-1;#s=null;#n=null;#r=null;#a=null;#o=!1;#l=new WeakMap;static#c=3;#h=t=>{let e=t.target instanceof Element?t.target.closest('[role="option"]:not([aria-disabled])'):null;if(!e)return;let i=this.#l.get(e);i&&this.#v(i)};#u=t=>{let e=t.target instanceof Element?t.target.closest('[role="option"]:not([aria-disabled])'):null;if(!e)return;let i=parseInt(e.dataset.idx);Number.isFinite(i)&&i!==this.#i&&this.#b(i)};connected(){this.#o||(this.#o=!0,this.addEventListener("keydown",this.#w))}render(){this.#s||(this.#d(),this.innerHTML=`
|
|
157
|
+
`}return this.#e?.appendChild(n),this.#r(),n}appendChunk(t){let e=this.#t[this.#t.length-1];if(!e||e.role==="user")return;e.content+=t;let i=this.#e?.querySelector('[data-role]:last-child [slot="bubble"]');if(i){let n=i.querySelector('[slot="cursor"]');n&&n.remove(),i.insertAdjacentText("beforeend",t),i.insertAdjacentHTML("beforeend",'<span slot="cursor"></span>')}this.#r()}startStreaming(){this.streaming=!0,this.#i&&(this.#i.disabled=!0)}stopStreaming(){this.streaming=!1,this.#i&&(this.#i.disabled=!1),this.#e?.querySelector('[data-role]:last-child [slot="cursor"]')?.remove();let t=this.#t[this.#t.length-1];if(t&&t.role==="assistant"&&t.content){let e=this.#e?.querySelector('[data-role]:last-child [slot="bubble"]');e&&(e.innerHTML=yn(t.content))}this.#i?.focus()}clear(){this.#t.length=0,this.#e&&(this.#e.innerHTML="")}#r(){let t=this.#e;t&&(this.#s!=null&&cancelAnimationFrame(this.#s),this.#s=requestAnimationFrame(()=>{this.#s=null,this.isConnected&&(t.scrollTop=t.scrollHeight)}))}};x("chat-thread-ui",vn);Q();var xn=class extends k{#t=!1;#e=!1;#i=null;#s=null;#n=null;#r=null;#a="programmatic";static properties={text:{type:String,default:"",reflect:!0},side:{type:String,default:"right",reflect:!0},size:{type:String,default:"md",reflect:!0},permanent:{type:Boolean,default:!1,reflect:!0},open:{type:Boolean,default:!1,reflect:!0}};static parts={dialog:'<dialog slot="dialog"></dialog>',panel:'<div slot="panel"></div>',header:'<header slot="header"></header>',close:'<button-ui slot="close" icon="x" variant="ghost" size="sm" aria-label="Close"></button-ui>',body:'<section slot="body"></section>',footer:'<footer slot="footer"></footer>'};constructor(){super();let t=Object.getOwnPropertyDescriptor(this,"open");if(t?.set){let e=t.set;Object.defineProperty(this,"open",{get:t.get,set:i=>{e.call(this,i),this.#f()},configurable:!0})}}#o=t=>{t.target.closest('[slot="close"]')&&(this.#a="close-button",this.open=!1)};#l=t=>{t.preventDefault(),this.#a="escape",this.permanent||(this.open=!1)};#c=()=>{this.open=!1,this.#i?.focus(),this.#i=null;let t=this.#a;this.#a="programmatic",this.dispatchEvent(new CustomEvent("close",{detail:{reason:t},bubbles:!0}))};#h=t=>{t.target===this.#r&&!this.permanent&&(this.#a="backdrop",this.open=!1)};connected(){this.addEventListener("press",this.#o);let t=this.ensure("dialog");t&&!this.#t&&(this.#t=!0,this.#r=t,t.addEventListener("cancel",this.#l),t.addEventListener("close",this.#c),t.addEventListener("click",this.#h))}disconnected(){this.removeEventListener("press",this.#o),this.#r&&(this.#r.removeEventListener("cancel",this.#l),this.#r.removeEventListener("close",this.#c),this.#r.removeEventListener("click",this.#h)),this.#s!=null&&(clearTimeout(this.#s),this.#s=null),this.#n!=null&&(clearTimeout(this.#n),this.#n=null),this.#t=!1,this.#r=null}#u(){let t=getComputedStyle(this).getPropertyValue("--drawer-duration").trim();return parseFloat(t)||200}#d(t,e,i="append"){let n={header:"header",body:"section",footer:"footer"}[t],r=h=>h.getAttribute("slot")===t||n&&!h.getAttribute("slot")&&h.localName===n,o=[...this.children].find(r),a=[...e.children].find(h=>h.getAttribute("slot")===t);o&&a&&o!==a&&a.remove();let l=o||a||(()=>{let h=this.constructor._pp?.[t];if(!h)return null;let c=h.cloneNode(!0);return c.setAttribute("data-stamped",""),c})();return l?(l.getAttribute("slot")!==t&&l.setAttribute("slot",t),l.parentElement!==e&&(i==="prepend"?e.prepend(l):e.appendChild(l)),l):null}render(){let t=this.ensure("dialog");t!==this.#r&&(this.#r&&(this.#r.removeEventListener("cancel",this.#l),this.#r.removeEventListener("close",this.#c),this.#r.removeEventListener("click",this.#h)),this.#r=t,t.addEventListener("cancel",this.#l),t.addEventListener("close",this.#c),t.addEventListener("click",this.#h)),this.text?(t.setAttribute("aria-label",this.text),this.setAttribute("aria-label",this.text)):(t.removeAttribute("aria-label"),this.removeAttribute("aria-label"));let e=this.ensure("panel");e.parentElement!==t&&t.appendChild(e);let i=this.#d("header",e,"prepend");if(i){let o=i.querySelector(':scope > [slot="heading"][data-stamped]'),a=[...i.children].some(l=>!l.hasAttribute("data-stamped")&&(l.getAttribute("slot")==="heading"||/^h[1-6]$/.test(l.localName)));this.text&&!a?(o||(o=document.createElement("span"),o.setAttribute("slot","heading"),o.setAttribute("data-stamped",""),i.prepend(o)),o.textContent!==this.text&&(o.textContent=this.text)):o&&o.remove()}if(this.permanent)this.drop("close");else{let o=this.ensure("close");i&&o.parentElement!==i&&i.appendChild(o)}let n=[...this.children].filter(o=>o.getAttribute("slot")==="body"||o.localName==="section"&&!o.getAttribute("slot"));if(n.length===0)this.#d("body",e,"append");else for(let o of n)o.getAttribute("slot")!=="body"&&o.setAttribute("slot","body"),o.parentElement!==e&&e.appendChild(o);let r=[...this.children].find(o=>o.getAttribute("slot")==="footer"||!o.getAttribute("slot")&&o.localName==="footer");r&&(r.getAttribute("slot")!=="footer"&&r.setAttribute("slot","footer"),r.parentElement!==e&&e.appendChild(r)),this.#f()}#f(){let t=this.#r;if(t&&t.isConnected)if(this.open&&!t.open){this.#e=!1,this.#i=document.activeElement;try{t.showModal()}catch(e){console.error("[drawer-ui] showModal() failed \u2014 dialog may be detached:",e)}t.offsetHeight,t.setAttribute("data-open",""),this.#n!=null&&clearTimeout(this.#n),this.#n=setTimeout(()=>{this.#n=null,this.dispatchEvent(new CustomEvent("opened",{bubbles:!0}))},this.#u())}else!this.open&&t.open&&!this.#e&&this.#p(t)}#p(t){this.#e=!0,this.#n!=null&&(clearTimeout(this.#n),this.#n=null),t.setAttribute("data-closing",""),t.offsetHeight,t.removeAttribute("data-open"),this.#s=setTimeout(()=>{this.#s=null,this.#e=!1,t.removeAttribute("data-closing"),t.open&&t.close()},this.#u())}show(){this.open=!0}hide(){this.open=!1}};x("drawer-ui",xn);Q();var Sn=class extends k{#t=!1;#e=!1;#i=null;#s=null;#n=null;static properties={text:{type:String,default:"",reflect:!0},size:{type:String,default:"md",reflect:!0},permanent:{type:Boolean,default:!1,reflect:!0},open:{type:Boolean,default:!1,reflect:!0}};static parts={dialog:'<dialog slot="dialog"></dialog>',panel:'<div slot="panel"></div>',header:'<header slot="header"></header>',close:'<button-ui slot="close" icon="x" variant="ghost" size="sm" aria-label="Close"></button-ui>',body:'<section slot="body"></section>',footer:'<footer slot="footer"></footer>'};#r=t=>{t.target.closest('[slot="close"]')&&(this.open=!1)};#a=t=>{t.preventDefault(),this.permanent||(this.open=!1)};#o=()=>{this.open=!1,this.#i?.focus(),this.#i=null,this.dispatchEvent(new Event("close",{bubbles:!0}))};#l=t=>{t.target===this.#n&&!this.permanent&&(this.open=!1)};connected(){this.addEventListener("press",this.#r);let t=this.ensure("dialog");t&&!this.#t&&(this.#t=!0,this.#n=t,t.addEventListener("cancel",this.#a),t.addEventListener("close",this.#o),t.addEventListener("click",this.#l))}disconnected(){this.removeEventListener("press",this.#r),this.#n&&(this.#n.removeEventListener("cancel",this.#a),this.#n.removeEventListener("close",this.#o),this.#n.removeEventListener("click",this.#l)),this.#s!=null&&(clearTimeout(this.#s),this.#s=null),this.#t=!1,this.#n=null}#c(){let e=getComputedStyle(this).getPropertyValue("--modal-duration").trim();return parseFloat(e)||200}render(){let t=this.ensure("dialog");this.text?(t.setAttribute("aria-label",this.text),this.setAttribute("aria-label",this.text)):(t.removeAttribute("aria-label"),this.removeAttribute("aria-label"));let e=this.ensure("panel");e.parentElement!==t&&t.appendChild(e);let i=this.ensure("header");if(i.parentElement!==e&&e.prepend(i),this.text?i.setAttribute("text",this.text):i.removeAttribute("text"),this.permanent)this.drop("close");else{let l=this.ensure("close");l.parentElement!==i&&i.appendChild(l)}let n=[...this.children].find(l=>l.getAttribute("slot")==="body"||!l.getAttribute("slot")&&l.localName==="section"),r=[...this.children].filter(l=>!l.getAttribute("slot")&&l.localName!=="section"&&l.localName!=="dialog"&&l.localName!=="footer"),o;n?(n.getAttribute("slot")!=="body"&&n.setAttribute("slot","body"),n.parentElement!==e&&e.appendChild(n),e.querySelector(':scope > [slot="body"][data-stamped]')?.remove(),o=n):(o=this.ensure("body"),o.setAttribute("data-stamped",""),o.parentElement!==e&&e.appendChild(o));for(let l of r)l!==o&&o.appendChild(l);let a=[...this.children].find(l=>l.getAttribute("slot")==="footer"||!l.getAttribute("slot")&&l.localName==="footer");if(a)a.getAttribute("slot")!=="footer"&&a.setAttribute("slot","footer"),a.parentElement!==e&&e.appendChild(a),e.querySelector(':scope > [slot="footer"][data-stamped]')?.remove();else{let l=this.ensure("footer");l.setAttribute("data-stamped",""),l.parentElement!==e&&e.appendChild(l)}this.open&&!t.open?(this.#e=!1,this.#i=document.activeElement,t.showModal(),t.offsetHeight,t.setAttribute("data-open","")):!this.open&&t.open&&!this.#e&&this.#h(t)}#h(t){this.#e=!0,t.setAttribute("data-closing",""),t.offsetHeight,t.removeAttribute("data-open"),this.#s=setTimeout(()=>{this.#s=null,this.#e=!1,t.removeAttribute("data-closing"),t.open&&t.close()},this.#c())}show(){this.open=!0}hide(){this.open=!1}};x("modal-ui",Sn);Q();var wn=class extends k{static properties={position:{type:String,default:"bottom-right",reflect:!0},max:{type:Number,default:5,reflect:!0}};static template=()=>It``;connected(){this.hasAttribute("role")||this.setAttribute("role","region"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Feed")}},kn=class s extends k{#t=null;#e=!1;#i=null;#s=null;static properties={text:{type:String,default:"",reflect:!0},heading:{type:String,default:"",reflect:!0},icon:{type:String,default:"",reflect:!0},variant:{type:String,default:"default",reflect:!0},duration:{type:Number,default:4e3,reflect:!0},dismissible:{type:Boolean,default:!1,reflect:!0},action:{type:String,default:"",reflect:!0}};static parts={body:'<div slot="body"></div>'};static template=()=>It``;#n=t=>{if(t.target.closest("[data-feed-close]")){this.dismiss();return}if(t.target.closest("[data-feed-action]")){try{this.#r?.()}catch(e){console.warn("[feed-item] action handler threw:",e)}this.dismiss()}};#r=null;#a=null;#o=null;connected(){this.addEventListener("press",this.#n)}#l(){let t=getComputedStyle(this).getPropertyValue("--feed-item-duration").trim();return parseFloat(t)||200}render(){let t=this.ensure("body");if(t.textContent="",this.heading){let h=document.createElement("strong");h.textContent=this.heading,h.style.display="block",t.appendChild(h)}if(this.text){let h=document.createElement("span");h.textContent=this.text,t.appendChild(h)}let e=!this.duration||this.duration<=0,i=this.variant==="danger"||this.variant==="warning",n=e&&!!this.action,r="status";n?r="alertdialog":e&&i&&(r="alert"),this.setAttribute("role",r),this.setAttribute("aria-live",r==="alert"||r==="alertdialog"?"assertive":"polite"),n&&this.setAttribute("aria-modal","false");let o=this.dismissible||e,a=this.querySelector(":scope > [data-feed-close]");o&&!a?(a=document.createElement("button-ui"),a.setAttribute("data-feed-close",""),a.setAttribute("icon","x"),a.setAttribute("variant","ghost"),a.setAttribute("size","sm"),a.setAttribute("aria-label","Dismiss"),this.appendChild(a)):!o&&a&&a.remove();let l=this.querySelector(":scope > [data-feed-action]");this.action?(l||(l=document.createElement("button-ui"),l.setAttribute("data-feed-action",""),l.setAttribute("variant","ghost"),l.setAttribute("size","sm"),a&&a.parentElement===this?this.insertBefore(l,a):this.appendChild(l)),l.setAttribute("text",this.action)):l&&l.remove(),n?this.#h():this.#u(),!this.hasAttribute("data-open")&&!this.#e&&(this.#s=requestAnimationFrame(()=>{this.#s=null,this.setAttribute("data-open","")})),this.#c()}#c(){this.#t&&clearTimeout(this.#t),this.duration&&this.duration>0&&(this.#t=setTimeout(()=>this.dismiss(),this.duration))}dismiss(){this.#e||(this.#e=!0,this.#t&&(clearTimeout(this.#t),this.#t=null),this.removeAttribute("data-open"),this.setAttribute("data-closing",""),this.#i=setTimeout(()=>{this.#i=null;let t=this.parentElement;this.dispatchEvent(new Event("close",{bubbles:!0})),this.remove(),t?.matches?.("feed-ui")&&Xe.releaseContainerIfEmpty(t)},this.#l()))}update(t){if(!(!t||typeof t!="object")){for(let e of Object.keys(t))e in s.properties&&(this[e]=t[e]);typeof t.onAction=="function"&&(this.#r=t.onAction),this.#c()}}#h(){if(this.#o)return;this.#a=document.activeElement;let t=()=>[...this.querySelectorAll('button, button-ui, [tabindex]:not([tabindex="-1"]), input, [data-feed-action], [data-feed-close]')].filter(e=>!e.hasAttribute("disabled")&&e.offsetParent!==null);this.#o=e=>{if(e.key==="Escape"){e.stopPropagation(),this.dismiss();return}if(e.key!=="Tab")return;let i=t();if(!i.length)return;let n=i[0],r=i[i.length-1],o=document.activeElement;e.shiftKey&&o===n?(e.preventDefault(),r.focus()):!e.shiftKey&&o===r&&(e.preventDefault(),n.focus())},this.addEventListener("keydown",this.#o,!0),queueMicrotask(()=>{let e=t();(this.querySelector("[data-feed-action]")||e[0])?.focus?.()})}#u(){if(this.#o){this.removeEventListener("keydown",this.#o,!0),this.#o=null;try{this.#a?.focus?.()}catch{}this.#a=null}}disconnected(){this.removeEventListener("press",this.#n),this.#t&&(clearTimeout(this.#t),this.#t=null),this.#i&&(clearTimeout(this.#i),this.#i=null),this.#s!=null&&(cancelAnimationFrame(this.#s),this.#s=null),this.#u()}},Xe=class s{static#t=new Map;static get(t="bottom-right"){let e=s.#t.get(t);if(e&&e.isConnected)return e;e=document.createElement("feed-ui"),e.setAttribute("position",t),"popover"in HTMLElement.prototype&&e.setAttribute("popover","manual"),document.body.appendChild(e);try{e.showPopover?.()}catch{}return s.#t.set(t,e),e}static post(t={}){let{text:e="",heading:i="",icon:n="",variant:r="default",duration:o=4e3,position:a="bottom-right",dismissible:l,id:h,action:c="",onAction:u}=t,d=r==="error"?"danger":r,f=s.get(a),p=parseInt(f.getAttribute("max")||"5",10),m=[...f.children].filter(y=>y.tagName==="FEED-ITEM-UI"&&!y.hasAttribute("data-queued")).length,O=document.createElement("feed-item-ui");h&&O.setAttribute("data-id",h),O.text=e,O.heading=i,O.icon=n,O.variant=d;let g="duration"in t;return O.duration=c&&!g?0:o,l!=null&&(O.dismissible=!!l),c&&(O.action=c),m>=p&&O.setAttribute("data-queued",""),f.appendChild(O),typeof u=="function"&&O.update({onAction:u}),{id:h??null,dismiss:()=>O.dismiss(),update:y=>O.update(y)}}static clear(t="bottom-right"){let e=s.#t.get(t);if(e)for(let i of[...e.children])i.tagName==="FEED-ITEM-UI"&&i.dismiss?.()}static purge(){for(let t of s.#t.values()){try{t.hidePopover?.()}catch{}t.remove()}s.#t.clear()}static releaseContainerIfEmpty(t){if(!t)return;let e=t.querySelector("feed-item-ui[data-queued]");if(e&&e.removeAttribute("data-queued"),!(t.children.length>0)){try{t.hidePopover?.()}catch{}t.remove();for(let[i,n]of s.#t)n===t&&s.#t.delete(i)}}};x("feed-ui",wn),x("feed-item-ui",kn),typeof window<"u"&&!window.__adiaFeedListenerInstalled&&(window.__adiaFeedListenerInstalled=!0,window.addEventListener("feed",s=>{s?.detail&&typeof s.detail=="object"&&Xe.post(s.detail)}));Q();var os=class extends k{static properties={text:{type:String,default:"",reflect:!0},variant:{type:String,default:"info",reflect:!0},duration:{type:Number,default:4e3,reflect:!0},position:{type:String,default:"bottom-right",reflect:!0}};static template=()=>It``;connected(){this.__routedToFeed||(this.__routedToFeed=!0,Xe.post({text:this.text,variant:this.variant==="error"?"danger":this.variant,duration:this.duration,position:this.position}),queueMicrotask(()=>{try{this.remove()}catch{}}))}static show(t={}){let{text:e,variant:i="info",position:n="bottom-right",action:r,onAction:o}=t,a=Xe.get(n);a&&!a.hasAttribute("data-spawned-by")&&a.setAttribute("data-spawned-by","toast");let l={text:e,variant:i==="error"?"danger":i,position:n};return"duration"in t&&(l.duration=t.duration),"dismissible"in t&&(l.dismissible=!!t.dismissible),r&&(l.action=r),typeof o=="function"&&(l.onAction=o),Xe.post(l)}};x("toast-ui",os),typeof window<"u"&&!window.__adiaToastListenerInstalled&&(window.__adiaToastListenerInstalled=!0,window.addEventListener("toast",s=>{s?.detail&&typeof s.detail=="object"&&os.show(s.detail)}));Q();var ga=class extends k{static properties={text:{type:String,default:"",reflect:!0},value:{type:String,default:"",reflect:!0},icon:{type:String,default:"",reflect:!0},disabled:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;connected(){this.setAttribute("role","tabpanel")}render(){this.text&&this.setAttribute("aria-label",this.text),this.disabled?this.setAttribute("aria-disabled","true"):this.removeAttribute("aria-disabled")}};customElements.define("tab-ui",ga);Q();var An=class extends k{static properties={value:{type:String,default:"",reflect:!0},orientation:{type:String,default:"",reflect:!0}};static template=()=>null;#t=null;#e=null;#i=null;connected(){if(this.setAttribute("role","tablist"),this.addEventListener("click",this.#o),this.addEventListener("keydown",this.#l),!this.value){let t=this.querySelector("tab-ui:not([disabled])");t&&(this.value=t.value||t.getAttribute("value")||"")}}disconnected(){this.#i!=null&&(cancelAnimationFrame(this.#i),this.#i=null),this.removeEventListener("click",this.#o),this.removeEventListener("keydown",this.#l),this.#t=null,this.#e=null}get#s(){return[...this.querySelectorAll("tab-ui")]}get#n(){return this.#s.filter(t=>!t.disabled)}render(){let t=this.#s;if(t.length){this.#t||(this.#t=document.createElement("div"),this.#t.setAttribute("slot","strip"),this.#t.setAttribute("role","presentation")),this.#t.parentElement!==this&&this.prepend(this.#t),this.reconcile(this.#t,t,e=>e.value||e.getAttribute("value")||"",(e,i,n)=>{let r=e.value||e.getAttribute("value")||"",o=e.text||e.getAttribute("text")||"",a=e.icon||e.getAttribute("icon")||"",l=r===this.value,h=e.disabled||e.hasAttribute("disabled");if(n){if(n.textContent="",a){let u=document.createElement("icon-ui");u.setAttribute("name",a),n.appendChild(u)}return o&&n.appendChild(document.createTextNode(o)),n.setAttribute("aria-selected",String(l)),n.setAttribute("tabindex",l?"0":"-1"),h?n.setAttribute("disabled",""):n.removeAttribute("disabled"),l?n.setAttribute("data-active",""):n.removeAttribute("data-active"),n.dataset.value=r,n}let c=document.createElement("div");if(c.setAttribute("role","tab"),c.setAttribute("slot","tab-button"),c.dataset.value=r,c.setAttribute("aria-selected",String(l)),c.setAttribute("tabindex",l?"0":"-1"),h&&c.setAttribute("disabled",""),l&&c.setAttribute("data-active",""),a){let u=document.createElement("icon-ui");u.setAttribute("name",a),c.appendChild(u)}return o&&c.appendChild(document.createTextNode(o)),c}),this.#r();for(let e of t)(e.value||e.getAttribute("value")||"")===this.value?(e.removeAttribute("hidden"),e.setAttribute("role","tabpanel")):e.setAttribute("hidden","")}}#r(){let t=this.#t?.querySelector('[slot="tab-button"][data-active]');if(!t){this.#e&&(this.#e.style.opacity="0");return}let e=!this.#e;e&&(this.#e=document.createElement("span"),this.#e.setAttribute("slot","indicator"),this.#t.appendChild(this.#e));let i=this.#t.getBoundingClientRect(),n=t.getBoundingClientRect(),r=this.orientation==="vertical",o=()=>{if(r){let a=n.top-i.top;this.#e.style.transform=`translateY(${a}px)`,this.#e.style.height=`${n.height}px`,this.#e.style.width=""}else{let a=n.left-i.left;this.#e.style.transform=`translateX(${a}px)`,this.#e.style.width=`${n.width}px`,this.#e.style.height=""}this.#e.style.opacity="1"};e?(this.#e.style.transition="none",o(),this.#i=requestAnimationFrame(()=>{this.#i=null,this.#e&&(this.#e.style.transition="")})):o()}#a(t){t!==this.value&&(this.value=t,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{value:this.value}})))}#o=t=>{let e=t.target.closest('[slot="tab-button"]');!e||!this.contains(e)||e.hasAttribute("disabled")||this.#a(e.dataset.value)};#l=t=>{let e=t.target.closest('[slot="tab-button"]');if(!e||!this.contains(e))return;let i=[...this.#t.querySelectorAll('[slot="tab-button"]:not([disabled])')],n=i.indexOf(e);if(n<0)return;let r=this.orientation==="vertical",o=r?"ArrowDown":"ArrowRight",a=r?"ArrowUp":"ArrowLeft",l;switch(t.key){case o:l=n<i.length-1?n+1:0;break;case a:l=n>0?n-1:i.length-1;break;case"Home":l=0;break;case"End":l=i.length-1;break;default:return}t.preventDefault(),i[l].focus(),this.#a(i[l].dataset.value)}};x("tabs-ui",An);Q();var $n=class s extends k{static properties={text:{type:String,default:"",reflect:!0},placement:{type:String,default:"top",reflect:!0},delay:{type:Number,default:400,reflect:!0},follows:{type:String,default:"trigger",reflect:!0},for:{type:String,default:"",reflect:!0},indicator:{type:String,default:"none",reflect:!0}};static template=()=>null;#t=null;#e=null;#i=null;#s=null;#n=null;connected(){this.follows==="pointer"?this.#c():(this.addEventListener("mouseenter",this.#r),this.addEventListener("focusin",this.#r),this.addEventListener("mouseleave",this.#a),this.addEventListener("focusout",this.#a))}disconnected(){this.removeEventListener("mouseenter",this.#r),this.removeEventListener("focusin",this.#r),this.removeEventListener("mouseleave",this.#a),this.removeEventListener("focusout",this.#a),this.#h(),this.#l()}render(){this.#t&&this.follows!=="pointer"&&(this.#t.textContent=this.text),this.#t&&this.follows==="pointer"&&this.#n&&this.#m(this.#n)}#r=()=>{this.text&&(this.#e&&clearTimeout(this.#e),this.#e=setTimeout(()=>this.#o(),this.delay))};#a=()=>{this.#e&&(clearTimeout(this.#e),this.#e=null),this.#l()};#o(){if(this.#t)return;let t=document.createElement("div"),e=`tooltip-${Date.now()}`;t.id=e,t.setAttribute("popover","manual"),t.setAttribute("role","tooltip"),t.classList.add("tooltip-popup"),t.textContent=this.text,document.body.appendChild(t),this.setAttribute("aria-describedby",e);try{t.showPopover()}catch{}this.#t=t,this.#i=at(this,t,{placement:this.placement,gap:6})}#l(){if(this.#e&&(clearTimeout(this.#e),this.#e=null),!!this.#t){this.removeAttribute("aria-describedby"),this.#i?.(),this.#i=null;try{this.#t.hidePopover()}catch{}this.#t.remove(),this.#t=null,this.#n=null}}#c(){if(this.#h(),!this.for)return;let t=this.getRootNode();if(this.#s=t&&t.getElementById?t.getElementById(this.for):document.getElementById(this.for),!this.#s){s._warnedMissing||(s._warnedMissing=new WeakSet),s._warnedMissing.has(this)||(console.warn(`[tooltip-ui] follows="pointer" [for="${this.for}"] did not resolve to an element.`),s._warnedMissing.add(this));return}this.#s.addEventListener("chart-hover",this.#d),this.#s.addEventListener("chart-leave",this.#u)}#h(){this.#s&&(this.#s.removeEventListener("chart-hover",this.#d),this.#s.removeEventListener("chart-leave",this.#u)),this.#s=null}#u=()=>this.#l();#d=t=>{let e=t.detail;if(e){if(this.#n=e,!this.#t){this.#t=this.#f(),this.#p();try{this.#t.showPopover()}catch{}}this.#m(e),this.#O(e.pointerX,e.pointerY)}};#f(){let t=document.createElement("div");return t.setAttribute("popover","manual"),t.setAttribute("role","tooltip"),t.setAttribute("data-follows","pointer"),t.setAttribute("data-indicator",this.indicator||"none"),t.classList.add("tooltip-popup"),document.body.appendChild(t),t}#p(){if(!this.#s||!this.#t)return;let t=this.#s.style;for(let i=0;i<t.length;i++){let n=t[i];n.startsWith("--color-")&&this.#t.style.setProperty(n,t.getPropertyValue(n))}let e=getComputedStyle(this.#s);for(let i=0;i<10;i++){let n=e.getPropertyValue(`--chart-${i}`).trim();n&&this.#t.style.setProperty(`--chart-${i}`,n)}}#m(t){if(!this.#t)return;let{label:e,value:i,pct:n,series:r,slot:o,payload:a}=t,l=this.indicator||"none",h=Array.isArray(a)&&a.length>0?a:[{series:r,label:e,value:i,pct:n,slot:o,hovered:!0}],c=[];e!=null&&c.push(`<span data-tip-role="label">${this.#g(String(e))}</span>`);for(let u of h){let d=u.series??null,f=u.value,p=u.pct,m=u.slot!=null?u.slot:0,O=d?`var(--color-${d}, var(--chart-${m}))`:`var(--chart-${m})`;if(f==null&&p==null)continue;let g=f!=null?this.#g(String(f)):"",y=p!=null?`<span data-tip-role="pct"> (${p}%)</span>`:"",v=l!=="none"?`<span data-indicator style="--tooltip-indicator-color: ${O}"></span>`:"",S=d?`<span data-tip-role="name">${this.#g(d)}</span>`:"",w=u.hovered?" data-hovered":"";c.push(`<span data-tip-row${w}>${v}${S}<span data-tip-role="value">${g}${y}</span></span>`)}this.#t.setAttribute("data-indicator",l),this.#t.setAttribute("aria-live","polite"),this.#t.innerHTML=c.join("")}#O(t,e){if(!this.#t||t==null||e==null)return;let i=12,n=8,r=this.#t;r.style.position="fixed",r.style.left="0",r.style.top="0";let o=r.offsetWidth||0,a=r.offsetHeight||0,l=t-o/2,h=e-a-i;l<n&&(l=n),l+o>window.innerWidth-n&&(l=window.innerWidth-o-n),h<n&&(h=e+i),r.style.left=`${l}px`,r.style.top=`${h}px`}#g(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}};x("tooltip-ui",$n);Q();var LA={new:{variant:"success",text:"New"},updated:{variant:"info",text:"Updated"},deprecated:{variant:"warning",text:"Deprecated"},removed:{variant:"danger",text:"Removed"},beta:{variant:"accent",text:"Beta"}},Cn=class extends k{static properties={text:{type:String,default:"",reflect:!0},variant:{type:String,default:"default",reflect:!0},size:{type:String,default:"md",reflect:!0},icon:{type:String,default:"",reflect:!0},status:{type:String,default:"",reflect:!0}};static template=()=>null;connected(){this.hasAttribute("role")||this.setAttribute("role","status")}render(){if(this.status){let t=LA[this.status];t&&(this.variant!==t.variant&&(this.variant=t.variant),this.text!==t.text&&(this.text=t.text))}if(this.text&&this.setAttribute("aria-label",this.text),this.icon){let t=this.querySelector(":scope > icon-ui");if(!t||t.getAttribute("name")!==this.icon){t&&t.remove();let e=document.createElement("icon-ui");e.setAttribute("name",this.icon),e.setAttribute("size","sm"),this.prepend(e)}}else this.querySelector(":scope > icon-ui")?.remove()}};x("badge-ui",Cn);Q();var En=class extends k{static properties={separator:{type:String,default:"/",reflect:!0},collapse:{type:Boolean,default:!1,reflect:!0},collapseKeepLeading:{type:Number,default:1,attribute:"collapse-keep-leading",reflect:!0},collapseKeepTrailing:{type:Number,default:2,attribute:"collapse-keep-trailing",reflect:!0}};static template=()=>null;connected(){this.setAttribute("role","navigation"),this.setAttribute("aria-label","Breadcrumb")}render(){this.querySelectorAll("[data-sep], [data-overflow]").forEach(l=>l.remove());let t=Array.from(this.children).filter(l=>!l.hasAttribute("data-sep")&&!l.hasAttribute("data-overflow")),e=t.length-1;t.forEach((l,h)=>{l.setAttribute("data-item",""),l.removeAttribute("data-collapsed"),h===e?l.setAttribute("aria-current","page"):l.removeAttribute("aria-current")});let i=Math.max(0,this.collapseKeepLeading|0),n=Math.max(0,this.collapseKeepTrailing|0),r=i+n+1;if(this.collapse&&t.length>=Math.max(r,4)){let l=t.slice(i,t.length-n);l.forEach(c=>c.setAttribute("data-collapsed",""));let h=this.#t(l);i>0?t[i-1].after(h):this.prepend(h)}let a=Array.from(this.children).filter(l=>!l.hasAttribute("data-sep")&&!l.hasAttribute("data-collapsed"));for(let l=0;l<a.length-1;l++){let h=document.createElement("span");h.setAttribute("data-sep",""),h.setAttribute("aria-hidden","true"),h.textContent=this.separator,a[l].after(h)}}#t(t){let e=document.createElement("menu-ui");e.setAttribute("data-overflow",""),e.setAttribute("data-item",""),e.setAttribute("placement","bottom-start");let i=document.createElement("button-ui");i.setAttribute("slot","trigger"),i.setAttribute("text","\u2026"),i.setAttribute("variant","ghost"),i.setAttribute("size","sm"),i.setAttribute("aria-label","Show collapsed crumbs"),e.appendChild(i);for(let n of t){let r=document.createElement("menu-item-ui");r.setAttribute("text",n.textContent.trim()),n.tagName==="A"&&n.hasAttribute("href")&&r.setAttribute("value",n.getAttribute("href")),e.appendChild(r)}return e.addEventListener("action",n=>{let r=n.detail?.value;r&&r!=="#"&&(window.location.href=r)}),e}};x("breadcrumb-ui",En);Q();var Pn=class s extends k{static requiredIcons=["magnifying-glass"];static properties={placeholder:{type:String,default:"Type a command...",reflect:!0},open:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;#t=[];#e=[];#i=-1;#s=null;#n=null;#r=null;#a=null;#o=!1;#l=new WeakMap;static#c=3;#h=t=>{let e=t.target instanceof Element?t.target.closest('[role="option"]:not([aria-disabled])'):null;if(!e)return;let i=this.#l.get(e);i&&this.#v(i)};#u=t=>{let e=t.target instanceof Element?t.target.closest('[role="option"]:not([aria-disabled])'):null;if(!e)return;let i=parseInt(e.dataset.idx);Number.isFinite(i)&&i!==this.#i&&this.#b(i)};connected(){this.#o||(this.#o=!0,this.addEventListener("keydown",this.#w))}render(){this.#s||(this.#d(),this.innerHTML=`
|
|
158
158
|
<header>
|
|
159
159
|
<icon-ui name="magnifying-glass" slot="icon"></icon-ui>
|
|
160
160
|
<input type="text" placeholder="${this.placeholder}" slot="input" />
|
|
@@ -178,7 +178,7 @@ parent-template-re-read pattern that works across frameworks.`);return}if(this.d
|
|
|
178
178
|
`)}render(){let t=this.querySelector(':scope > [slot="label"]'),e=this.querySelector(':scope > [slot="description"]'),i=this.querySelector(':scope > [slot="time"]');if(t&&(t.textContent=this.text),e&&(e.textContent=this.description),i&&(i.textContent=this.duration||this.time),this.icon){let r=this.querySelector(':scope > [slot="icon"]');r||(r=document.createElement("icon-ui"),r.setAttribute("slot","icon"),this.prepend(r)),r.setAttribute("name",this.icon)}else this.querySelector(':scope > [slot="icon"]')?.remove();let n=this.querySelector(':scope > [slot="outcomes"]');if(this.#t.length>0){n||(n=document.createElement("ul"),n.setAttribute("slot","outcomes"),this.appendChild(n)),n.innerHTML="";for(let a of this.#t){let l=document.createElement("li");l.textContent=a,n.appendChild(l)}n.hidden=!this.#e;let r=this.querySelector(":scope > [data-timeline-toggle]");r||(r=document.createElement("button"),r.type="button",r.setAttribute("data-timeline-toggle",""),r.setAttribute("aria-label","Toggle details"),r.addEventListener("click",a=>{a.stopPropagation(),this.#e=!this.#e,this.render(),this.dispatchEvent(new CustomEvent("timeline-toggle",{bubbles:!0,detail:{expanded:this.#e}}))}),this.appendChild(r)),r.innerHTML="";let o=document.createElement("icon-ui");o.setAttribute("name",this.#e?"caret-down":"caret-right"),o.setAttribute("color","muted"),o.setAttribute("size","sm"),r.appendChild(o)}else this.querySelector(":scope > [data-timeline-toggle]")?.remove(),n?.remove()}};x("timeline-ui",Xn),x("timeline-item-ui",Zn);Q();var qn=class extends k{static properties={step:{type:Number,default:0,reflect:!0},orientation:{type:String,default:"horizontal",reflect:!0}};static template=()=>null;render(){let t=[...this.querySelectorAll("stepper-item-ui")];for(let i of t)i.removeAttribute("data-last");let e=t[t.length-1];e&&e.setAttribute("data-last",""),t.forEach((i,n)=>{i.setAttribute("data-index",n),n<this.step?i.setAttribute("status","completed"):n===this.step?i.setAttribute("status","active"):i.setAttribute("status","idle")})}next(){let t=this.querySelectorAll("stepper-item-ui").length;this.step<t-1&&this.step++}prev(){this.step>0&&this.step--}goTo(t){let e=this.querySelectorAll("stepper-item-ui").length-1;this.step=Math.max(0,Math.min(t,e))}},Nn=class extends k{static properties={text:{type:String,default:"",reflect:!0},description:{type:String,default:"",reflect:!0},icon:{type:String,default:"",reflect:!0},status:{type:String,default:"idle",reflect:!0}};static template=()=>null;connected(){this.querySelector('[slot="label"]')||(this.innerHTML=`
|
|
179
179
|
<span slot="label"></span>
|
|
180
180
|
<span slot="description"></span>
|
|
181
|
-
`)}render(){let t=this.querySelector('[slot="label"]'),e=this.querySelector('[slot="description"]');if(t&&(t.textContent=this.text),e&&(e.textContent=this.description),this.icon){let i=this.querySelector('[slot="icon"]');i||(i=document.createElement("icon-ui"),i.setAttribute("slot","icon"),this.prepend(i)),i.setAttribute("name",this.icon)}else this.querySelector('[slot="icon"]')?.remove()}};x("stepper-ui",qn),x("stepper-item-ui",Nn);Q();var Bn=class extends k{static properties={autoplay:{type:Boolean,default:!1,reflect:!0},interval:{type:Number,default:5e3,reflect:!0},noPauseOnHover:{type:Boolean,default:!1,reflect:!0,attribute:"no-pause-on-hover"},loop:{type:Boolean,default:!1,reflect:!0},peek:{type:Boolean,default:!1,reflect:!0},snap:{type:String,default:"start",reflect:!0},gap:{type:String,default:"",reflect:!0},slidesPerView:{type:String,default:"",reflect:!0,attribute:"slides-per-view"},chrome:{type:String,default:"default",reflect:!0},label:{type:String,default:""},counter:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;#t=null;#e=null;#i=null;#s=null;#n=0;#r=!1;#a=!1;#o=null;get slides(){return this.#t?[...this.#t.children]:[]}get activeIndex(){return this.#n}connected(){if(!this.#t){for(this.#t=document.createElement("div"),this.#t.setAttribute("data-swiper-track","");this.firstChild;)this.#t.appendChild(this.firstChild);this.appendChild(this.#t)}this.setAttribute("role","region"),this.setAttribute("aria-roledescription","carousel"),this.getAttribute("aria-label")||this.setAttribute("aria-label","Carousel"),this.#l(),this.#c(),this.#O(),this.#r||(this.#r=!0,this.noPauseOnHover||(this.addEventListener("pointerenter",this.#x),this.addEventListener("pointerleave",this.#S),this.addEventListener("focusin",this.#w),this.addEventListener("focusout",this.#A)),this.addEventListener("keydown",this.#P),this.#t.addEventListener("pointerdown",this.#M),this.#t.addEventListener("pointermove",this.#Q),this.#t.addEventListener("pointerup",this.#E),this.#t.addEventListener("pointercancel",this.#E),this.#t.addEventListener("click",this.#R,!0),this.#t.addEventListener("dragstart",this.#C)),this.autoplay&&this.play()}render(){if(this.gap&&this.#t){let e=/^[0-9]+$/.test(this.gap)?`var(--a-space-${this.gap})`:this.gap;this.style.setProperty("--swiper-gap",e)}}disconnected(){this.pause(),this.#i?.disconnect(),this.#i=null,this.#t&&this.#s&&this.#t.removeEventListener("scroll",this.#s),this.#s=null,this.removeEventListener("pointerenter",this.#x),this.removeEventListener("pointerleave",this.#S),this.removeEventListener("focusin",this.#w),this.removeEventListener("focusout",this.#A),this.removeEventListener("keydown",this.#P),this.#t&&(this.#t.removeEventListener("pointerdown",this.#M),this.#t.removeEventListener("pointermove",this.#Q),this.#t.removeEventListener("pointerup",this.#E),this.#t.removeEventListener("pointercancel",this.#E),this.#t.removeEventListener("click",this.#R,!0),this.#t.removeEventListener("dragstart",this.#C)),this.#o=null,this.#t=null,this.#r=!1}next(){let t=this.#u()-1,e=this.#m(this.#n),i=Math.min(e+1,t);if(i!==e||this.loop){let n=this.loop&&i===e?0:i;this.goTo(this.#p(n))}}prev(){let t=this.#u()-1,e=this.#m(this.#n),i=Math.max(e-1,0);if(i!==e||this.loop){let n=this.loop&&i===e?t:i;this.goTo(this.#p(n))}}goTo(t){let e=this.slides[t];if(!e||!this.#t)return;let i=Math.max(0,this.#d(e));this.#t.scrollTo({left:i,behavior:"smooth"})}play(){this.pause(),!window.matchMedia("(prefers-reduced-motion: reduce)").matches&&(this.#e=setInterval(()=>{let t=this.#u()-1,i=this.#m(this.#n)>=t;i&&this.loop?this.goTo(this.#p(0)):i?this.pause():this.next()},this.interval||5e3))}pause(){this.#e&&(clearInterval(this.#e),this.#e=null)}#l(){let t=this.slides;t.forEach((e,i)=>{e.setAttribute("role","group"),e.setAttribute("aria-roledescription","slide"),e.getAttribute("aria-label")||e.setAttribute("aria-label",`${i+1} of ${t.length}`)})}#c(){this.#s=()=>{let t=this.#f();t!==this.#n&&(this.#n=t,this.#v(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{index:t,slide:this.slides[t]}})))},this.#t.addEventListener("scroll",this.#s,{passive:!0}),this.#n=this.#f()}#h(){if(!this.#t)return 1;let
|
|
181
|
+
`)}render(){let t=this.querySelector('[slot="label"]'),e=this.querySelector('[slot="description"]');if(t&&(t.textContent=this.text),e&&(e.textContent=this.description),this.icon){let i=this.querySelector('[slot="icon"]');i||(i=document.createElement("icon-ui"),i.setAttribute("slot","icon"),this.prepend(i)),i.setAttribute("name",this.icon)}else this.querySelector('[slot="icon"]')?.remove()}};x("stepper-ui",qn),x("stepper-item-ui",Nn);Q();var Bn=class extends k{static properties={autoplay:{type:Boolean,default:!1,reflect:!0},interval:{type:Number,default:5e3,reflect:!0},noPauseOnHover:{type:Boolean,default:!1,reflect:!0,attribute:"no-pause-on-hover"},loop:{type:Boolean,default:!1,reflect:!0},peek:{type:Boolean,default:!1,reflect:!0},snap:{type:String,default:"start",reflect:!0},gap:{type:String,default:"",reflect:!0},slidesPerView:{type:String,default:"",reflect:!0,attribute:"slides-per-view"},chrome:{type:String,default:"default",reflect:!0},label:{type:String,default:""},counter:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;#t=null;#e=null;#i=null;#s=null;#n=0;#r=!1;#a=!1;#o=null;get slides(){return this.#t?[...this.#t.children]:[]}get activeIndex(){return this.#n}connected(){if(!this.#t){for(this.#t=document.createElement("div"),this.#t.setAttribute("data-swiper-track","");this.firstChild;)this.#t.appendChild(this.firstChild);this.appendChild(this.#t)}this.setAttribute("role","region"),this.setAttribute("aria-roledescription","carousel"),this.getAttribute("aria-label")||this.setAttribute("aria-label","Carousel"),this.#l(),this.#c(),this.#O(),this.#r||(this.#r=!0,this.noPauseOnHover||(this.addEventListener("pointerenter",this.#x),this.addEventListener("pointerleave",this.#S),this.addEventListener("focusin",this.#w),this.addEventListener("focusout",this.#A)),this.addEventListener("keydown",this.#P),this.#t.addEventListener("pointerdown",this.#M),this.#t.addEventListener("pointermove",this.#Q),this.#t.addEventListener("pointerup",this.#E),this.#t.addEventListener("pointercancel",this.#E),this.#t.addEventListener("click",this.#R,!0),this.#t.addEventListener("dragstart",this.#C)),this.autoplay&&this.play()}render(){if(this.gap&&this.#t){let e=/^[0-9]+$/.test(this.gap)?`var(--a-space-${this.gap})`:this.gap;this.style.setProperty("--swiper-gap",e)}}disconnected(){this.pause(),this.#i?.disconnect(),this.#i=null,this.#t&&this.#s&&this.#t.removeEventListener("scroll",this.#s),this.#s=null,this.removeEventListener("pointerenter",this.#x),this.removeEventListener("pointerleave",this.#S),this.removeEventListener("focusin",this.#w),this.removeEventListener("focusout",this.#A),this.removeEventListener("keydown",this.#P),this.#t&&(this.#t.removeEventListener("pointerdown",this.#M),this.#t.removeEventListener("pointermove",this.#Q),this.#t.removeEventListener("pointerup",this.#E),this.#t.removeEventListener("pointercancel",this.#E),this.#t.removeEventListener("click",this.#R,!0),this.#t.removeEventListener("dragstart",this.#C)),this.#o=null,this.#t=null,this.#r=!1}next(){let t=this.#u()-1,e=this.#m(this.#n),i=Math.min(e+1,t);if(i!==e||this.loop){let n=this.loop&&i===e?0:i;this.goTo(this.#p(n))}}prev(){let t=this.#u()-1,e=this.#m(this.#n),i=Math.max(e-1,0);if(i!==e||this.loop){let n=this.loop&&i===e?t:i;this.goTo(this.#p(n))}}goTo(t){let e=this.slides[t];if(!e||!this.#t)return;let i=Math.max(0,this.#d(e));this.#t.scrollTo({left:i,behavior:"smooth"})}play(){this.pause(),!window.matchMedia("(prefers-reduced-motion: reduce)").matches&&(this.#e=setInterval(()=>{let t=this.#u()-1,i=this.#m(this.#n)>=t;i&&this.loop?this.goTo(this.#p(0)):i?this.pause():this.next()},this.interval||5e3))}pause(){this.#e&&(clearInterval(this.#e),this.#e=null)}#l(){let t=this.slides;t.forEach((e,i)=>{e.setAttribute("role","group"),e.setAttribute("aria-roledescription","slide"),e.getAttribute("aria-label")||e.setAttribute("aria-label",`${i+1} of ${t.length}`)})}#c(){this.#s=()=>{let t=this.#f();t!==this.#n&&(this.#n=t,this.#v(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{index:t,slide:this.slides[t]}})))},this.#t.addEventListener("scroll",this.#s,{passive:!0}),this.#n=this.#f()}#h(){if(!this.#t)return 1;let e=getComputedStyle(this.#t).getPropertyValue("--swiper-columns").trim(),i=parseInt(e,10);return Number.isFinite(i)&&i>0?i:1}#u(){let t=this.slides.length;return t===0?0:this.snap==="center"?t:Math.max(1,t-this.#h()+1)}#d(t){let e=this.#t.clientWidth,i=t.offsetLeft-this.#t.offsetLeft,n=t.offsetWidth;return this.snap==="center"?i+n/2-e/2:this.snap==="end"?i+n-e:i}#f(){if(!this.#t)return 0;let t=this.slides;if(t.length===0)return 0;let e=this.#t.scrollLeft,i=Math.max(0,this.#t.scrollWidth-this.#t.clientWidth),n=0,r=1/0;for(let o=0;o<t.length;o++){let a=Math.max(0,Math.min(i,this.#d(t[o]))),l=Math.abs(e-a);l<r&&(r=l,n=o)}return n}#p(t){if(this.snap!=="end")return t;let e=this.#h();return Math.min(this.slides.length-1,t+e-1)}#m(t){if(this.snap!=="end")return t;let e=this.#h();return Math.max(0,t-e+1)}#O(){this.#a||(this.#a=!0,this.chrome==="toolbar"?this.#y():this.#g(),this.#k(),typeof ResizeObserver<"u"&&(this.#i=new ResizeObserver(()=>this.#k()),this.#i.observe(this)))}#g(){let t=document.createElement("button-ui");t.setAttribute("data-swiper-btn",""),t.setAttribute("data-swiper-prev",""),t.setAttribute("icon","caret-left"),t.setAttribute("variant","ghost"),t.setAttribute("aria-label","Previous slide"),t.addEventListener("press",()=>this.prev());let e=document.createElement("button-ui");e.setAttribute("data-swiper-btn",""),e.setAttribute("data-swiper-next",""),e.setAttribute("icon","caret-right"),e.setAttribute("variant","ghost"),e.setAttribute("aria-label","Next slide"),e.addEventListener("press",()=>this.next()),this.appendChild(t),this.appendChild(e);let i=document.createElement("div");i.setAttribute("data-swiper-dots",""),i.setAttribute("role","tablist"),i.setAttribute("aria-label","Slide indicators"),this.appendChild(i)}#y(){let t=document.createElement("div");t.setAttribute("data-swiper-head","");let e=document.createElement("span");e.setAttribute("data-swiper-label",""),e.textContent=this.label||"",t.appendChild(e);let i=document.createElement("div");i.setAttribute("data-swiper-paddles","");let n=document.createElement("button-ui");n.setAttribute("icon","caret-left"),n.setAttribute("variant","ghost"),n.setAttribute("size","sm"),n.setAttribute("aria-label","Previous slide"),n.addEventListener("press",()=>this.prev());let r=document.createElement("button-ui");r.setAttribute("icon","caret-right"),r.setAttribute("variant","ghost"),r.setAttribute("size","sm"),r.setAttribute("aria-label","Next slide"),r.addEventListener("press",()=>this.next()),i.appendChild(n),i.appendChild(r),t.appendChild(i),this.insertBefore(t,this.#t);let o=document.createElement("div");o.setAttribute("data-swiper-foot","");let a=document.createElement("span");a.setAttribute("data-swiper-counter",""),o.appendChild(a);let l=document.createElement("div");l.setAttribute("data-swiper-dots",""),l.setAttribute("role","tablist"),l.setAttribute("aria-label","Slide indicators"),o.appendChild(l),this.appendChild(o),this.#b()}#b(){let t=this.querySelector("[data-swiper-counter]");if(!t)return;if(!this.counter){t.textContent="";return}let e=this.#m(this.#n)+1,i=this.#u();t.textContent=`${e} / ${i}`}#k(){let t=this.querySelector("[data-swiper-dots]");if(!t)return;let e=this.#u();if(t.children.length!==e){for(;t.firstChild;)t.removeChild(t.firstChild);for(let i=0;i<e;i++){let n=document.createElement("button");n.setAttribute("role","tab"),n.setAttribute("aria-label",`Page ${i+1}`),n.addEventListener("click",()=>this.goTo(this.#p(i))),t.appendChild(n)}}this.#v()}#v(){if(!this.#a)return;let t=this.querySelector("[data-swiper-dots]");if(t){let e=this.#u()-1,i=Math.min(Math.max(this.#m(this.#n),0),e);[...t.children].forEach((n,r)=>{n.setAttribute("aria-current",r===i?"true":"false")})}this.#b()}#x=()=>{this.#e&&(this.pause(),this.dispatchEvent(new CustomEvent("autoplay-pause",{bubbles:!0,detail:{reason:"hover"}})))};#S=()=>{this.autoplay&&!this.#e&&(this.play(),this.dispatchEvent(new CustomEvent("autoplay-resume",{bubbles:!0})))};#w=()=>{this.#e&&(this.pause(),this.dispatchEvent(new CustomEvent("autoplay-pause",{bubbles:!0,detail:{reason:"focus"}})))};#A=t=>{this.autoplay&&!this.contains(t.relatedTarget)&&(this.play(),this.dispatchEvent(new CustomEvent("autoplay-resume",{bubbles:!0})))};#P=t=>{t.key==="ArrowRight"&&(t.preventDefault(),this.next()),t.key==="ArrowLeft"&&(t.preventDefault(),this.prev())};#$=5;#M=t=>{t.pointerType!=="touch"&&t.button===0&&(t.target.closest("button, button-ui, a, input, select, textarea")||(this.#o={pointerId:t.pointerId,startX:t.clientX,startScrollLeft:this.#t.scrollLeft,hasMoved:!1},this.#t.style.scrollBehavior="auto",this.#t.setAttribute("data-dragging","")))};#Q=t=>{if(!this.#o||t.pointerId!==this.#o.pointerId)return;let e=t.clientX-this.#o.startX;if(Math.abs(e)>=this.#$){if(!this.#o.hasMoved){this.#o.hasMoved=!0;try{this.#t.setPointerCapture(t.pointerId)}catch{}}this.#t.scrollLeft=this.#o.startScrollLeft-e,t.preventDefault()}};#E=t=>{if(!this.#o||t.pointerId!==this.#o.pointerId)return;let e=this.#o.hasMoved;if(e)try{this.#t.releasePointerCapture(t.pointerId)}catch{}this.#o=null,this.#t.style.scrollBehavior="",this.#t.removeAttribute("data-dragging"),e&&(this.#t.setAttribute("data-just-dragged",""),requestAnimationFrame(()=>this.#t?.removeAttribute("data-just-dragged")))};#R=t=>{this.#t?.hasAttribute("data-just-dragged")&&(t.preventDefault(),t.stopPropagation())};#C=t=>{this.#o&&t.preventDefault()}};x("swiper-ui",Bn);var zn=class extends Z{static labelDeprecated=!1;static properties={...Z.properties,label:{type:String,default:"",reflect:!0},accept:{type:String,default:"",reflect:!0},multiple:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;#t=[];#e=null;connected(){super.connected(),this.querySelector("[data-dropzone]")||(this.innerHTML=`
|
|
182
182
|
<div data-dropzone tabindex="0" role="button">Drop files here or click to browse</div>
|
|
183
183
|
<span hint="${this.hint||""}"></span>
|
|
184
184
|
<div data-filelist></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adia-ai/web-components",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.5",
|
|
4
4
|
"description": "AdiaUI web components \u2014 vanilla custom elements. A2UI runtime (renderer, registry, streams, wiring) lives in @adia-ai/a2ui-runtime.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./index.d.ts",
|
package/styles/api/text.css
CHANGED
|
@@ -55,8 +55,15 @@
|
|
|
55
55
|
font-weight: var(--a-weight);
|
|
56
56
|
} /* 700 */
|
|
57
57
|
|
|
58
|
-
/* Text color
|
|
59
|
-
|
|
58
|
+
/* Text color. button-ui is EXCLUDED: it re-purposes [color] as a semantic
|
|
59
|
+
FILL (color="danger|info|success|warning" → colored background + contrasting
|
|
60
|
+
label via its own --button-fg, since the variant="danger"→color="danger"
|
|
61
|
+
migration). Without the exclusion this utility (utilities layer > components)
|
|
62
|
+
overrides the button's label color to the fill hue → invisible text on the
|
|
63
|
+
fill. button-ui is the only filled control that does this and is NOT among
|
|
64
|
+
the color honorings (cascade-component-attr-sweep.mjs). `:where(button-ui)`
|
|
65
|
+
keeps specificity at (0,1,0) so the real text honorings are unaffected. */
|
|
66
|
+
[color]:not(:where(button-ui)) {
|
|
60
67
|
color: var(--a-fg);
|
|
61
68
|
}
|
|
62
69
|
[color="text"] {
|
|
@@ -11,10 +11,12 @@
|
|
|
11
11
|
initial-value: 1;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
/* Gap-scale knob —
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
/* Gap-scale knob — multiplies every named gap (--a-gap-{xs,sm,md,lg,xl}).
|
|
15
|
+
k=1 (default) = the base value; <1 tightens, >1 loosens (k=0 → 0). Inherits,
|
|
16
|
+
so set it at a provider boundary (e.g. style="--a-gap-k:1.5") to retune all
|
|
17
|
+
named gaps — but note custom props compute at their declaration site, so a
|
|
18
|
+
subtree override only re-scales gaps re-declared in that scope (same as
|
|
19
|
+
--a-density). */
|
|
18
20
|
@property --a-gap-k {
|
|
19
21
|
syntax: "<number>";
|
|
20
22
|
inherits: true;
|
|
@@ -43,21 +45,20 @@
|
|
|
43
45
|
--a-space-12: calc(var(--a-density) * 3rem); /* 48px at d=1 */
|
|
44
46
|
--a-space-16: calc(var(--a-density) * 4rem); /* 64px at d=1 */
|
|
45
47
|
|
|
46
|
-
/* ── Inset ── */
|
|
47
|
-
--a-inset-sm: var(--a-space-
|
|
48
|
-
--a-inset-md: var(--a-space-4);
|
|
49
|
-
--a-inset-lg: var(--a-space-
|
|
48
|
+
/* ── Inset — regular register (compressed range; sm/md/lg = 14/16/18). ── */
|
|
49
|
+
--a-inset-sm: var(--a-space-3-5); /* 14px */
|
|
50
|
+
--a-inset-md: var(--a-space-4); /* 16px */
|
|
51
|
+
--a-inset-lg: var(--a-space-4-5); /* 18px */
|
|
50
52
|
--a-inset: var(--a-inset-md);
|
|
51
53
|
|
|
52
|
-
/* ── Gaps — parametric named scale (
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
--a-gap-
|
|
58
|
-
--a-gap-
|
|
59
|
-
--a-gap-
|
|
60
|
-
--a-gap-
|
|
61
|
-
--a-gap-xl: calc(var(--a-space-2-5) + var(--a-space-2-5) * var(--a-gap-k)); /* 20px @k=1 */
|
|
54
|
+
/* ── Gaps — parametric named scale (value × --a-gap-k). k=1 (default) is the
|
|
55
|
+
base value; k scales linearly (k=0 → 0, k=2 → 2×). At k=1: 8/10/12/14/16px.
|
|
56
|
+
Verse shares this gap scale (only inset differs); prose runs one rung up.
|
|
57
|
+
Composes on --a-density (baked into --a-space-*). See spec §5.2. ── */
|
|
58
|
+
--a-gap-xs: calc(var(--a-space-2) * var(--a-gap-k)); /* 8px @k=1 */
|
|
59
|
+
--a-gap-sm: calc(var(--a-space-2-5) * var(--a-gap-k)); /* 10px @k=1 */
|
|
60
|
+
--a-gap-md: calc(var(--a-space-3) * var(--a-gap-k)); /* 12px @k=1 */
|
|
61
|
+
--a-gap-lg: calc(var(--a-space-3-5) * var(--a-gap-k)); /* 14px @k=1 */
|
|
62
|
+
--a-gap-xl: calc(var(--a-space-4) * var(--a-gap-k)); /* 16px @k=1 */
|
|
62
63
|
--a-gap: var(--a-gap-md);
|
|
63
64
|
}
|
package/styles/host.css
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/* adia:barrel/host — the host-page drop-in foundation.
|
|
2
|
+
|
|
3
|
+
One <link> turns a bare HTML document into an AdiaUI host:
|
|
4
|
+
|
|
5
|
+
<link rel="stylesheet" href="@adia-ai/web-components/styles/host.css" />
|
|
6
|
+
|
|
7
|
+
It bundles the full library foundation in cascade order — design tokens +
|
|
8
|
+
every component's styles + global resets (via the canonical barrel
|
|
9
|
+
`index.css`) — and adds the PAGE-FRAME: the document-root setup
|
|
10
|
+
(background, foreground, font-family anchor, viewport min-height) that
|
|
11
|
+
every host page needs. This is the setup demo scaffolds used to hand-roll
|
|
12
|
+
as `:where(html, body){ … font-family: var(--a-font) }` — a pattern that
|
|
13
|
+
was both redundant with resets.css and silently broken (the dead `--a-font`
|
|
14
|
+
token resolved to UA serif). Loading host.css means a host page declares
|
|
15
|
+
ZERO of that boilerplate.
|
|
16
|
+
|
|
17
|
+
── Layer YOUR surface's chrome OVER it ──────────────────────────────
|
|
18
|
+
<link rel="stylesheet" href="@adia-ai/web-components/styles/host.css" />
|
|
19
|
+
<link rel="stylesheet" href="/site/site.css" /> ← docs site, or
|
|
20
|
+
<style> main { max-inline-size: 60rem; … } </style> ← a demo's own CSS
|
|
21
|
+
|
|
22
|
+
Consumer rules sit ABOVE the `reset`/`components` layers below, so they win
|
|
23
|
+
without a specificity fight.
|
|
24
|
+
|
|
25
|
+
── NOT included (opt-in — link separately when wanted) ──────────────
|
|
26
|
+
styles/themes.css the [data-theme] preset switcher (@layer context)
|
|
27
|
+
styles/prose.css the [prose] content context (@layer context)
|
|
28
|
+
web-modules/**.css per-module explicit-import policy (FB-53 §CSSPolicy)
|
|
29
|
+
|
|
30
|
+
See ADR-0035 (foundation reorg) + ADR-0038 (cascade layers). The canonical
|
|
31
|
+
published entry `@adia-ai/web-components/css` (index.css) stays byte-stable;
|
|
32
|
+
host.css composes it and adds the page-frame on top. */
|
|
33
|
+
|
|
34
|
+
@import "./index.css"; /* tokens + components + resets — @layer order intact */
|
|
35
|
+
|
|
36
|
+
@layer reset {
|
|
37
|
+
/* Page-frame. resets.css already floors `body` (margin, font-family, bg, fg,
|
|
38
|
+
min-block-size); this extends the same defaults up to the document root so
|
|
39
|
+
overscroll / rubber-band areas + color-scheme match, and anchors the host
|
|
40
|
+
font-family at :root so it holds even before `body` inherits. Token-only;
|
|
41
|
+
:where() keeps specificity at (0,0,0) so any consumer html/body rule wins. */
|
|
42
|
+
:where(html) {
|
|
43
|
+
background: var(--a-bg);
|
|
44
|
+
color: var(--a-fg);
|
|
45
|
+
font-family: var(--a-font-family);
|
|
46
|
+
min-block-size: 100dvb;
|
|
47
|
+
}
|
|
48
|
+
}
|