@adia-ai/web-components 0.7.6 → 0.7.7

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.
@@ -372,4 +372,4 @@ Correct shape for <chart-ui x="label" y="value">:
372
372
  ${t.description?`<span data-questions-option-desc>${K1(t.description)}</span>`:""}
373
373
  </span>
374
374
  ${n}
375
- `,e.addEventListener("click",()=>this.#c(t)),this.#r.appendChild(e)}this.#a&&(this.#a.disabled=this.#i||this.#e.size===0)}}#c(t){this.#i||(this.multi?(this.#e.has(t.id)?this.#e.delete(t.id):this.#e.add(t.id),this.#l()):(this.#e.clear(),this.#e.add(t.id),this.#i=!0,this.#l(),this.dispatchEvent(new CustomEvent("questions-answer",{bubbles:!0,detail:{selected:[t.id],option:t}}))))}#h=()=>{if(this.#i||this.#e.size===0)return;this.#i=!0,this.#l();let t=[...this.#e],e=this.#t.find(i=>i.id===t[0])||null;this.dispatchEvent(new CustomEvent("questions-answer",{bubbles:!0,detail:{selected:t,option:e}}))}};x("agent-questions-ui",ca);Q();var J1={neutral:"default",accent:"accent",warning:"warning",danger:"danger"},ua=class extends k{static properties={title:{type:String,default:"",reflect:!0},kind:{type:String,default:"",reflect:!0},icon:{type:String,default:"",reflect:!0},collapsed:{type:Boolean,default:!1,reflect:!0},tone:{type:String,default:"neutral",reflect:!0}};static requiredIcons=["caret-right","caret-down"];static template=()=>null;#t=null;#e=null;#i=null;#s=null;#n=null;#r=null;connected(){this.#l()}disconnected(){this.#t?.removeEventListener("click",this.#a),this.#t?.removeEventListener("keydown",this.#o),this.#t=this.#e=this.#i=null,this.#s=this.#n=this.#r=null}#a=t=>{t.target.closest('[slot="primary"], [slot="secondary"]')||(this.collapsed=!this.collapsed,this.dispatchEvent(new CustomEvent("artifact-toggle",{bubbles:!0,detail:{collapsed:this.collapsed}})),this.render())};#o=t=>{if(t.key===" "||t.key==="Enter"){if(t.target.closest('[slot="primary"], [slot="secondary"]'))return;t.preventDefault(),this.#a(t)}};render(){this.#t&&(this.#e&&(this.icon?(this.#e.setAttribute("name",this.icon),this.#e.hidden=!1):this.#e.hidden=!0),this.#i&&(this.#i.textContent=this.title||"",this.#i.hidden=!this.title),this.#s&&(this.#s.setAttribute("text",(this.kind||"").toUpperCase()),this.#s.setAttribute("variant",J1[this.tone]||"default"),this.#s.hidden=!this.kind),this.#n&&this.#n.setAttribute("name",this.collapsed?"caret-right":"caret-down"),this.#r&&(this.#r.hidden=this.collapsed),this.#t&&this.#t.setAttribute("aria-expanded",String(!this.collapsed)))}#l(){let t=Array.from(this.childNodes).filter(r=>{if(r.nodeType===1){let o=r.getAttribute?.("slot")||"";return o!=="primary"&&o!=="secondary"}return!0}),e=this.querySelectorAll(':scope > [slot="primary"]'),i=this.querySelectorAll(':scope > [slot="secondary"]');this.innerHTML="",this.#t=document.createElement("div"),this.#t.setAttribute("data-artifact-header",""),this.#t.setAttribute("role","button"),this.#t.setAttribute("tabindex","0"),this.#t.setAttribute("aria-expanded",String(!this.collapsed)),this.#t.addEventListener("click",this.#a),this.#t.addEventListener("keydown",this.#o),this.#e=document.createElement("icon-ui"),this.#e.setAttribute("data-artifact-icon",""),this.#e.setAttribute("color","muted"),this.icon?this.#e.setAttribute("name",this.icon):this.#e.hidden=!0,this.#i=document.createElement("span"),this.#i.setAttribute("data-artifact-title",""),this.title?this.#i.textContent=this.title:this.#i.hidden=!0,this.#s=document.createElement("badge-ui"),this.#s.setAttribute("data-artifact-kind",""),this.#s.setAttribute("size","sm"),this.#s.setAttribute("variant",J1[this.tone]||"default"),this.kind?this.#s.setAttribute("text",this.kind.toUpperCase()):this.#s.hidden=!0;let n=document.createElement("span");n.setAttribute("data-artifact-actions","");for(let r of i)n.appendChild(r);for(let r of e)n.appendChild(r);this.#n=document.createElement("icon-ui"),this.#n.setAttribute("color","muted"),this.#n.setAttribute("data-artifact-caret",""),this.#n.setAttribute("name",this.collapsed?"caret-right":"caret-down"),this.#t.append(this.#e,this.#i,this.#s,n,this.#n),this.#r=document.createElement("div"),this.#r.setAttribute("data-artifact-body","");for(let r of t)this.#r.appendChild(r);this.collapsed&&(this.#r.hidden=!0),this.append(this.#t,this.#r)}};x("agent-artifact-ui",ua);export{dr as UIAccordion,fr as UIAccordionItem,Lo as UIActionItem,To as UIActionList,ua as UIAgentArtifact,la as UIAgentFeedbackBar,ca as UIAgentQuestions,aa as UIAgentReasoning,ha as UIAgentSuggestions,Ml as UIAgentTrace,Kn as UIAlert,_n as UIAvatar,Wn as UIAvatarGroup,Cn as UIBadge,zo as UIBlock,mr as UIBlockquote,En as UIBreadcrumb,tn as UIButton,Ro as UICalendarGrid,Io as UICalendarPicker,Xu as UICanvas,jn as UICard,hr as UIChart,cr as UIChartLegend,ma as UIChatInput,vn as UIChatThread,rn as UICheck,no as UICode,sr as UICol,Ln as UIColorInput,Tn as UIColorPicker,Eo as UICombobox,Pn as UICommand,fo as UIContextMenu,Do as UIDateRangePicker,No as UIDatetimePicker,Yo as UIDemoToggle,ra as UIDescriptionList,pr as UIDivider,xn as UIDrawer,Bo as UIEmbed,Mo as UIEmptyState,Xe as UIFeed,wn as UIFeedContainer,kn as UIFeedItem,nr as UIField,rr as UIFields,ar as UIGrid,oa as UIHeatmap,Js as UIIcon,$o as UIImage,Oo as UIInlineEdit,Jn as UIInlineMessage,sn as UIInput,ia as UIInspector,ln as UIIntegrationCard,tr as UIKbd,en as UILink,oo as UIList,ao as UIListItem,lo as UIListWindow,Hn as UILoadingOverlay,go as UIMark,ho as UIMenu,uo as UIMenuDivider,co as UIMenuItem,Sn as UIModal,So as UINav,wo as UINavGroup,ko as UINavItem,Mn as UINoodles,Or as UINumberFormat,an as UIOptionCard,Ao as UIOtpInput,bn as UIPage,xr as UIPagination,On as UIPane,br as UIPasswordStrength,sa as UIPipelineStatus,ur as UIPopover,ro as UIPreview,Yn as UIProgress,Qo as UIProgressRow,vr as UIQRCode,on as UIRadio,pn as UIRange,na as UIRating,gr as UIRelativeTime,Fo as UIRichText,or as UIRow,Co as UISearch,dn as UISegment,fn as UISegmented,un as UISelect,Un as UISkeleton,mo as UISkipNav,cn as UISlider,Gn as UISpinner,lr as UIStack,El as UIStat,Fn as UIStepProgress,qn as UIStepper,Nn as UIStepperItem,Uo as UIStream,ir as UISwatch,Bn as UISwiper,hn as UISwitch,ga as UITab,In as UITable,yr as UITableOfContents,Dn as UITableToolbar,An as UITabs,er as UITag,Po as UITagsInput,Vo as UIText,nn as UITextarea,qo as UITimePicker,Xn as UITimeline,Zn as UITimelineItem,os as UIToast,_o as UIToggleGroup,jo as UIToggleOption,Wo as UIToggleScheme,vo as UIToolbar,xo as UIToolbarGroup,$n as UITooltip,bo as UITour,yo as UITourStep,mn as UITree,gn as UITreeItem,zn as UIUpload,po as UIVisuallyHidden};
375
+ `,e.addEventListener("click",()=>this.#c(t)),this.#r.appendChild(e)}this.#a&&(this.#a.disabled=this.#i||this.#e.size===0)}}#c(t){this.#i||(this.multi?(this.#e.has(t.id)?this.#e.delete(t.id):this.#e.add(t.id),this.#l()):(this.#e.clear(),this.#e.add(t.id),this.#i=!0,this.#l(),this.dispatchEvent(new CustomEvent("questions-answer",{bubbles:!0,detail:{selected:[t.id],option:t}}))))}#h=()=>{if(this.#i||this.#e.size===0)return;this.#i=!0,this.#l();let t=[...this.#e],e=this.#t.find(i=>i.id===t[0])||null;this.dispatchEvent(new CustomEvent("questions-answer",{bubbles:!0,detail:{selected:t,option:e}}))}};x("agent-questions-ui",ca);Q();var J1={neutral:"default",accent:"accent",warning:"warning",danger:"danger"},ua=class extends k{static properties={title:{type:String,default:"",reflect:!0},kind:{type:String,default:"",reflect:!0},icon:{type:String,default:"",reflect:!0},collapsed:{type:Boolean,default:!1,reflect:!0},tone:{type:String,default:"neutral",reflect:!0}};static requiredIcons=["caret-right","caret-down"];static template=()=>null;#t=null;#e=null;#i=null;#s=null;#n=null;#r=null;connected(){this.#l()}disconnected(){this.#t?.removeEventListener("click",this.#a),this.#t?.removeEventListener("keydown",this.#o),this.#t=this.#e=this.#i=null,this.#s=this.#n=this.#r=null}#a=t=>{t.target.closest('[slot="primary"], [slot="secondary"]')||(this.collapsed=!this.collapsed,this.dispatchEvent(new CustomEvent("artifact-toggle",{bubbles:!0,detail:{collapsed:this.collapsed}})),this.render())};#o=t=>{if(t.key===" "||t.key==="Enter"){if(t.target.closest('[slot="primary"], [slot="secondary"]'))return;t.preventDefault(),this.#a(t)}};render(){this.#t&&(this.#e&&(this.icon?(this.#e.setAttribute("name",this.icon),this.#e.hidden=!1):this.#e.hidden=!0),this.#i&&(this.#i.textContent=this.title||"",this.#i.hidden=!this.title),this.#s&&(this.#s.setAttribute("text",(this.kind||"").toUpperCase()),this.#s.setAttribute("variant",J1[this.tone]||"default"),this.#s.hidden=!this.kind),this.#n&&this.#n.setAttribute("name",this.collapsed?"caret-right":"caret-down"),this.#r&&(this.#r.hidden=this.collapsed),this.#t&&this.#t.setAttribute("aria-expanded",String(!this.collapsed)))}#l(){let t=[],e=[],i=[],n=a=>a.getAttribute("role")==="presentation"||a.style?.display==="contents",r=a=>{for(let l of a){if(l.nodeType===1){let h=l;if(n(h)){r(h.childNodes);continue}let c=h.getAttribute("slot")||"";if(c==="primary"){t.push(h);continue}if(c==="secondary"){e.push(h);continue}}i.push(l)}};r(Array.from(this.childNodes)),this.innerHTML="",this.#t=document.createElement("div"),this.#t.setAttribute("data-artifact-header",""),this.#t.setAttribute("role","button"),this.#t.setAttribute("tabindex","0"),this.#t.setAttribute("aria-expanded",String(!this.collapsed)),this.#t.addEventListener("click",this.#a),this.#t.addEventListener("keydown",this.#o),this.#e=document.createElement("icon-ui"),this.#e.setAttribute("data-artifact-icon",""),this.#e.setAttribute("color","muted"),this.icon?this.#e.setAttribute("name",this.icon):this.#e.hidden=!0,this.#i=document.createElement("span"),this.#i.setAttribute("data-artifact-title",""),this.title?this.#i.textContent=this.title:this.#i.hidden=!0,this.#s=document.createElement("badge-ui"),this.#s.setAttribute("data-artifact-kind",""),this.#s.setAttribute("size","sm"),this.#s.setAttribute("variant",J1[this.tone]||"default"),this.kind?this.#s.setAttribute("text",this.kind.toUpperCase()):this.#s.hidden=!0;let o=document.createElement("span");o.setAttribute("data-artifact-actions","");for(let a of e)o.appendChild(a);for(let a of t)o.appendChild(a);this.#n=document.createElement("icon-ui"),this.#n.setAttribute("color","muted"),this.#n.setAttribute("data-artifact-caret",""),this.#n.setAttribute("name",this.collapsed?"caret-right":"caret-down"),this.#t.append(this.#e,this.#i,this.#s,o,this.#n),this.#r=document.createElement("div"),this.#r.setAttribute("data-artifact-body","");for(let a of i)this.#r.appendChild(a);this.collapsed&&(this.#r.hidden=!0),this.append(this.#t,this.#r)}};x("agent-artifact-ui",ua);export{dr as UIAccordion,fr as UIAccordionItem,Lo as UIActionItem,To as UIActionList,ua as UIAgentArtifact,la as UIAgentFeedbackBar,ca as UIAgentQuestions,aa as UIAgentReasoning,ha as UIAgentSuggestions,Ml as UIAgentTrace,Kn as UIAlert,_n as UIAvatar,Wn as UIAvatarGroup,Cn as UIBadge,zo as UIBlock,mr as UIBlockquote,En as UIBreadcrumb,tn as UIButton,Ro as UICalendarGrid,Io as UICalendarPicker,Xu as UICanvas,jn as UICard,hr as UIChart,cr as UIChartLegend,ma as UIChatInput,vn as UIChatThread,rn as UICheck,no as UICode,sr as UICol,Ln as UIColorInput,Tn as UIColorPicker,Eo as UICombobox,Pn as UICommand,fo as UIContextMenu,Do as UIDateRangePicker,No as UIDatetimePicker,Yo as UIDemoToggle,ra as UIDescriptionList,pr as UIDivider,xn as UIDrawer,Bo as UIEmbed,Mo as UIEmptyState,Xe as UIFeed,wn as UIFeedContainer,kn as UIFeedItem,nr as UIField,rr as UIFields,ar as UIGrid,oa as UIHeatmap,Js as UIIcon,$o as UIImage,Oo as UIInlineEdit,Jn as UIInlineMessage,sn as UIInput,ia as UIInspector,ln as UIIntegrationCard,tr as UIKbd,en as UILink,oo as UIList,ao as UIListItem,lo as UIListWindow,Hn as UILoadingOverlay,go as UIMark,ho as UIMenu,uo as UIMenuDivider,co as UIMenuItem,Sn as UIModal,So as UINav,wo as UINavGroup,ko as UINavItem,Mn as UINoodles,Or as UINumberFormat,an as UIOptionCard,Ao as UIOtpInput,bn as UIPage,xr as UIPagination,On as UIPane,br as UIPasswordStrength,sa as UIPipelineStatus,ur as UIPopover,ro as UIPreview,Yn as UIProgress,Qo as UIProgressRow,vr as UIQRCode,on as UIRadio,pn as UIRange,na as UIRating,gr as UIRelativeTime,Fo as UIRichText,or as UIRow,Co as UISearch,dn as UISegment,fn as UISegmented,un as UISelect,Un as UISkeleton,mo as UISkipNav,cn as UISlider,Gn as UISpinner,lr as UIStack,El as UIStat,Fn as UIStepProgress,qn as UIStepper,Nn as UIStepperItem,Uo as UIStream,ir as UISwatch,Bn as UISwiper,hn as UISwitch,ga as UITab,In as UITable,yr as UITableOfContents,Dn as UITableToolbar,An as UITabs,er as UITag,Po as UITagsInput,Vo as UIText,nn as UITextarea,qo as UITimePicker,Xn as UITimeline,Zn as UITimelineItem,os as UIToast,_o as UIToggleGroup,jo as UIToggleOption,Wo as UIToggleScheme,vo as UIToolbar,xo as UIToolbarGroup,$n as UITooltip,bo as UITour,yo as UITourStep,mn as UITree,gn as UITreeItem,zn as UIUpload,po as UIVisuallyHidden};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adia-ai/web-components",
3
- "version": "0.7.6",
3
+ "version": "0.7.7",
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/verse.css CHANGED
@@ -73,6 +73,14 @@
73
73
  --a-icon-size: 14px;
74
74
  --a-caret-size: 12px;
75
75
 
76
+ /* ── Toggle (check / radio / switch) chrome — one tier down like inset +
77
+ --a-size, on clean space rungs. Regular toggle is 16/20/24 (size.css:28
78
+ + sizing.css:66/96); verse md = regular-sm = 16. The explicit [size]
79
+ tier rules below are REQUIRED for the same reason --a-size needs them:
80
+ this context-layer base value pins the token, so the lower-layer global
81
+ [size] --a-toggle-size rules can't reach a verse subtree on their own. ── */
82
+ --a-toggle-size: var(--a-space-4); /* 16px @d=1 — regular-sm tier */
83
+
76
84
  /* ── Typography — compact register (deduced; static, no fluid clamps;
77
85
  floored at 10px). VALUES only — pointers live under :not([size]). ── */
78
86
  --a-display-sm: 18px; --a-display-md: 23px; --a-display-lg: 29px;
@@ -124,6 +132,7 @@
124
132
  --a-size: var(--a-size-lg);
125
133
  --a-icon-size: 16px;
126
134
  --a-caret-size: 14px;
135
+ --a-toggle-size: var(--a-space-5); /* 20px @d=1 — regular-md tier */
127
136
  }
128
137
  [verse][size="sm"],
129
138
  [verse] [size="sm"] {
@@ -132,5 +141,6 @@
132
141
  --a-size: var(--a-size-sm);
133
142
  --a-icon-size: 12px;
134
143
  --a-caret-size: 10px;
144
+ --a-toggle-size: var(--a-space-3); /* 12px @d=1 — one below regular-sm */
135
145
  }
136
146
  }