@ngrok/mantle 0.93.2 → 0.93.4

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/dist/accordion.js CHANGED
@@ -1 +1 @@
1
- import{n as e}from"./browser-only-BTSrYWLj.js";import{t}from"./use-isomorphic-layout-effect-CLSmHzo4.js";import{n}from"./compose-refs-sFdxsL7k.js";import{t as r}from"./cx-CK7o_rVv.js";import{t as i}from"./data-slot-EM6s2WEU.js";import{t as a}from"./icon-kK0c-POG.js";import{t as o}from"./slot-DdYN1L1C.js";import{c as s}from"react/compiler-runtime";import{CaretDownIcon as c}from"@phosphor-icons/react/CaretDown";import{createContext as l,useContext as u,useEffect as d,useId as f,useRef as p,useState as m}from"react";import h from"tiny-invariant";import{jsx as g}from"react/jsx-runtime";function _(e,t){return e.includes(t)}function v({openValues:e,value:t,open:n,type:r}){let i=e.includes(t);return n?r===`single`?i&&e.length===1?e:[t]:i?e:[...e,t]:i?e.filter(e=>e!==t):e}function y(e){return e==null?[]:typeof e==`string`?e===``?[]:[e]:e}function b(e,t){e.type===`single`?e.onValueChange?.(t[0]??``):e.onValueChange?.([...t])}function x(){return e()&&document.body!=null&&`onbeforematch`in document.body}const S=l(null);function C(e){let t=u(S);return h(t,`\`${e}\` must be rendered within \`Accordion.Root\`.`),t}const w=l(null);function T(e){let t=u(w);return h(t,`\`${e}\` must be rendered within \`Accordion.Item\`.`),t}const E=e=>{let n=s(42),a,c,l,u,d,f,h,_,x;if(n[0]!==e){let{type:t,value:r,defaultValue:i,onValueChange:o,"data-slot":s,asChild:p,children:m,className:g,ref:v,...y}=e;_=t,x=r,d=i,u=s,a=p,c=m,l=g,h=v,f=y,n[0]=e,n[1]=a,n[2]=c,n[3]=l,n[4]=u,n[5]=d,n[6]=f,n[7]=h,n[8]=_,n[9]=x}else a=n[1],c=n[2],l=n[3],u=n[4],d=n[5],f=n[6],h=n[7],_=n[8],x=n[9];let C=_===void 0?`multiple`:_,w=x!=null,T;n[10]===d?T=n[11]:(T=()=>y(d),n[10]=d,n[11]=T);let[E,D]=m(T),O;n[12]!==E||n[13]!==w||n[14]!==x?(O=w?y(x):E,n[12]=E,n[13]=w,n[14]=x,n[15]=O):O=n[15];let k=O,A=p(e),j;n[16]===e?j=n[17]:(j=()=>{A.current=e},n[16]=e,n[17]=j),t(j);let M;n[18]!==w||n[19]!==k||n[20]!==C?(M=e=>{let{itemValue:t,open:n}=e,r=v({openValues:k,value:t,open:n,type:C});r!==k&&(w||D(r),b(A.current,r))},n[18]=w,n[19]=k,n[20]=C,n[21]=M):M=n[21];let N=M,P;n[22]!==k||n[23]!==N||n[24]!==C?(P={type:C,openValues:k,setItemOpen:N},n[22]=k,n[23]=N,n[24]=C,n[25]=P):P=n[25];let F=P,I;n[26]===u?I=n[27]:(I=i(u,`accordion`),n[26]=u,n[27]=I);let L;n[28]===l?L=n[29]:(L=r(`w-full divide-y divide-separator`,l),n[28]=l,n[29]=L);let R;n[30]!==f||n[31]!==I||n[32]!==L?(R={...f,"data-slot":I,className:L},n[30]=f,n[31]=I,n[32]=L,n[33]=R):R=n[33];let z=R,B;n[34]!==a||n[35]!==c||n[36]!==z||n[37]!==h?(B=g(a?o:`div`,{ref:h,...z,children:c}),n[34]=a,n[35]=c,n[36]=z,n[37]=h,n[38]=B):B=n[38];let V;return n[39]!==F||n[40]!==B?(V=/* @__PURE__ */ g(S.Provider,{value:F,children:B}),n[39]=F,n[40]=B,n[41]=V):V=n[41],V},D=e=>{let t=s(27),n,r,a,o,c;t[0]===e?(n=t[1],r=t[2],a=t[3],o=t[4],c=t[5]):({"data-slot":r,children:n,value:c,ref:o,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a,t[4]=o,t[5]=c);let{openValues:l,setItemOpen:u}=C(`Accordion.Item`),d;t[6]!==l||t[7]!==c?(d=_(l,c),t[6]=l,t[7]=c,t[8]=d):d=t[8];let p=d,m=f(),h;t[9]!==u||t[10]!==c?(h=e=>{u({itemValue:c,open:e})},t[9]=u,t[10]=c,t[11]=h):h=t[11];let v=h,y;t[12]!==m||t[13]!==p||t[14]!==v?(y={open:p,setOpen:v,contentId:m},t[12]=m,t[13]=p,t[14]=v,t[15]=y):y=t[15];let b=y,x;t[16]===r?x=t[17]:(x=i(r,`accordion-item`),t[16]=r,t[17]=x);let S=p?`open`:`closed`,T;t[18]!==n||t[19]!==a||t[20]!==o||t[21]!==x||t[22]!==S?(T=/* @__PURE__ */ g(`div`,{ref:o,...a,role:`group`,"data-slot":x,"data-state":S,children:n}),t[18]=n,t[19]=a,t[20]=o,t[21]=x,t[22]=S,t[23]=T):T=t[23];let E;return t[24]!==b||t[25]!==T?(E=/* @__PURE__ */ g(w.Provider,{value:b,children:T}),t[24]=b,t[25]=T,t[26]=E):E=t[26],E},O=e=>{let t=s(25),n,a,o,c,l,u;t[0]===e?(n=t[1],a=t[2],o=t[3],c=t[4],l=t[5],u=t[6]):({"data-slot":o,className:a,children:n,onClick:c,ref:u,...l}=e,t[0]=e,t[1]=n,t[2]=a,t[3]=o,t[4]=c,t[5]=l,t[6]=u);let{open:d,setOpen:f,contentId:p}=T(`Accordion.Trigger`),m;t[7]===o?m=t[8]:(m=i(o,`accordion-trigger`),t[7]=o,t[8]=m);let h=d?`open`:`closed`,_;t[9]===a?_=t[10]:(_=r(`group flex w-full cursor-pointer items-center justify-between gap-4 py-4 text-left font-medium outline-none`,`-mx-2 rounded-md px-2`,`focus:outline-hidden focus-visible:ring-4 focus-visible:ring-focus-accent`,a),t[9]=a,t[10]=_);let v;t[11]!==c||t[12]!==d||t[13]!==f?(v=e=>{c?.(e),f(!d)},t[11]=c,t[12]=d,t[13]=f,t[14]=v):v=t[14];let y;return t[15]!==n||t[16]!==p||t[17]!==d||t[18]!==l||t[19]!==u||t[20]!==m||t[21]!==h||t[22]!==_||t[23]!==v?(y=/* @__PURE__ */ g(`button`,{ref:u,type:`button`,...l,"data-slot":m,"data-state":h,"aria-expanded":d,"aria-controls":p,className:_,onClick:v,children:n}),t[15]=n,t[16]=p,t[17]=d,t[18]=l,t[19]=u,t[20]=m,t[21]=h,t[22]=_,t[23]=v,t[24]=y):y=t[24],y},k=/* @__PURE__ */ g(c,{weight:`bold`}),A={Root:E,Item:D,Trigger:O,TriggerIcon:e=>{let t=s(14),n,o,c,l;t[0]===e?(n=t[1],o=t[2],c=t[3],l=t[4]):({"data-slot":o,className:n,svg:l,...c}=e,t[0]=e,t[1]=n,t[2]=o,t[3]=c,t[4]=l);let u=l===void 0?k:l,d;t[5]===o?d=t[6]:(d=i(o,`accordion-trigger-icon`),t[5]=o,t[6]=d);let f;t[7]===n?f=t[8]:(f=r(`h-lh w-4 shrink-0 self-start text-muted transition-transform duration-200 ease-out-strong group-data-state-open:rotate-180 motion-reduce:transition-none`,n),t[7]=n,t[8]=f);let p;return t[9]!==c||t[10]!==u||t[11]!==d||t[12]!==f?(p=/* @__PURE__ */ g(a,{...c,"data-slot":d,svg:u,className:f}),t[9]=c,t[10]=u,t[11]=d,t[12]=f,t[13]=p):p=t[13],p},Content:e=>{let a=s(25),o,c,l,u,f;a[0]===e?(o=a[1],c=a[2],l=a[3],u=a[4],f=a[5]):({"data-slot":l,className:c,children:o,ref:f,...u}=e,a[0]=e,a[1]=o,a[2]=c,a[3]=l,a[4]=u,a[5]=f);let{open:m,setOpen:h,contentId:_}=T(`Accordion.Content`),v=p(null),y=n(v,f),b,S;a[6]===h?(b=a[7],S=a[8]):(b=()=>{let e=v.current;if(!e||!x())return;let t=()=>{e.removeAttribute(`hidden`),e.style.height=`auto`,e.style.opacity=`1`,h(!0)};return e.addEventListener(`beforematch`,t),()=>{e.removeEventListener(`beforematch`,t)}},S=[h],a[6]=h,a[7]=b,a[8]=S),d(b,S);let C,w;a[9]===m?(C=a[10],w=a[11]):(C=()=>{let e=v.current;e&&x()&&(e.removeAttribute(`inert`),m?e.removeAttribute(`hidden`):(e.setAttribute(`hidden`,`until-found`),e.style.height=``,e.style.opacity=``))},w=[m],a[9]=m,a[10]=C,a[11]=w),t(C,w);let E=!m,D;a[12]===l?D=a[13]:(D=i(l,`accordion-content`),a[12]=l,a[13]=D);let O=m?`open`:`closed`,k;a[14]===c?k=a[15]:(k=r(`h-0 overflow-hidden opacity-0 transition-[height,opacity,content-visibility] duration-200 ease-out-strong [interpolate-size:allow-keywords] transition-discrete data-state-open:h-auto data-state-open:opacity-100 motion-reduce:transition-none`,c),a[14]=c,a[15]=k);let A;return a[16]!==o||a[17]!==y||a[18]!==_||a[19]!==u||a[20]!==E||a[21]!==D||a[22]!==O||a[23]!==k?(A=/* @__PURE__ */ g(`div`,{ref:y,...u,id:_,inert:E,"data-slot":D,"data-state":O,className:k,children:o}),a[16]=o,a[17]=y,a[18]=_,a[19]=u,a[20]=E,a[21]=D,a[22]=O,a[23]=k,a[24]=A):A=a[24],A},Body:e=>{let t=s(14),n,a,o,c;t[0]===e?(n=t[1],a=t[2],o=t[3],c=t[4]):({"data-slot":a,className:n,ref:c,...o}=e,t[0]=e,t[1]=n,t[2]=a,t[3]=o,t[4]=c);let l;t[5]===a?l=t[6]:(l=i(a,`accordion-body`),t[5]=a,t[6]=l);let u;t[7]===n?u=t[8]:(u=r(`pt-1 pb-4`,n),t[7]=n,t[8]=u);let d;return t[9]!==o||t[10]!==c||t[11]!==l||t[12]!==u?(d=/* @__PURE__ */ g(`div`,{ref:c,...o,"data-slot":l,className:u}),t[9]=o,t[10]=c,t[11]=l,t[12]=u,t[13]=d):d=t[13],d}};export{A as Accordion};
1
+ import{n as e}from"./browser-only-BTSrYWLj.js";import{t}from"./use-isomorphic-layout-effect-CLSmHzo4.js";import{n}from"./compose-refs-sFdxsL7k.js";import{t as r}from"./cx-CK7o_rVv.js";import{t as i}from"./data-slot-EM6s2WEU.js";import{t as a}from"./icon-kK0c-POG.js";import{t as o}from"./slot-DdYN1L1C.js";import{c as s}from"react/compiler-runtime";import{CaretDownIcon as c}from"@phosphor-icons/react/CaretDown";import{createContext as l,useContext as u,useEffect as d,useId as f,useRef as p,useState as m}from"react";import h from"tiny-invariant";import{jsx as g}from"react/jsx-runtime";function _(e,t){return e.includes(t)}function v({openValues:e,value:t,open:n,type:r}){let i=e.includes(t);return n?r===`single`?i&&e.length===1?e:[t]:i?e:[...e,t]:i?e.filter(e=>e!==t):e}function y(e){return e==null?[]:typeof e==`string`?e===``?[]:[e]:e}function b(e,t){e.type===`single`?e.onValueChange?.(t[0]??``):e.onValueChange?.([...t])}function x(){return e()&&document.body!=null&&`onbeforematch`in document.body}const S=l(null);function C(e){let t=u(S);return h(t,`\`${e}\` must be rendered within \`Accordion.Root\`.`),t}const w=l(null);function T(e){let t=u(w);return h(t,`\`${e}\` must be rendered within \`Accordion.Item\`.`),t}const E=e=>{let n=s(42),a,c,l,u,d,f,h,_,x;if(n[0]!==e){let{type:t,value:r,defaultValue:i,onValueChange:o,"data-slot":s,asChild:p,children:m,className:g,ref:v,...y}=e;_=t,x=r,d=i,u=s,a=p,c=m,l=g,h=v,f=y,n[0]=e,n[1]=a,n[2]=c,n[3]=l,n[4]=u,n[5]=d,n[6]=f,n[7]=h,n[8]=_,n[9]=x}else a=n[1],c=n[2],l=n[3],u=n[4],d=n[5],f=n[6],h=n[7],_=n[8],x=n[9];let C=_===void 0?`multiple`:_,w=x!=null,T;n[10]===d?T=n[11]:(T=()=>y(d),n[10]=d,n[11]=T);let[E,D]=m(T),O;n[12]!==E||n[13]!==w||n[14]!==x?(O=w?y(x):E,n[12]=E,n[13]=w,n[14]=x,n[15]=O):O=n[15];let k=O,A=p(e),j;n[16]===e?j=n[17]:(j=()=>{A.current=e},n[16]=e,n[17]=j),t(j);let M;n[18]!==w||n[19]!==k||n[20]!==C?(M=e=>{let{itemValue:t,open:n}=e,r=v({openValues:k,value:t,open:n,type:C});r!==k&&(w||D(r),b(A.current,r))},n[18]=w,n[19]=k,n[20]=C,n[21]=M):M=n[21];let N=M,P;n[22]!==k||n[23]!==N||n[24]!==C?(P={type:C,openValues:k,setItemOpen:N},n[22]=k,n[23]=N,n[24]=C,n[25]=P):P=n[25];let F=P,I;n[26]===u?I=n[27]:(I=i(u,`accordion`),n[26]=u,n[27]=I);let L;n[28]===l?L=n[29]:(L=r(`w-full divide-y divide-separator`,l),n[28]=l,n[29]=L);let R;n[30]!==f||n[31]!==I||n[32]!==L?(R={...f,"data-slot":I,className:L},n[30]=f,n[31]=I,n[32]=L,n[33]=R):R=n[33];let z=R,B;n[34]!==a||n[35]!==c||n[36]!==z||n[37]!==h?(B=g(a?o:`div`,{ref:h,...z,children:c}),n[34]=a,n[35]=c,n[36]=z,n[37]=h,n[38]=B):B=n[38];let V;return n[39]!==F||n[40]!==B?(V=/* @__PURE__ */ g(S.Provider,{value:F,children:B}),n[39]=F,n[40]=B,n[41]=V):V=n[41],V},D=e=>{let t=s(27),n,r,a,o,c;t[0]===e?(n=t[1],r=t[2],a=t[3],o=t[4],c=t[5]):({"data-slot":r,children:n,value:c,ref:o,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a,t[4]=o,t[5]=c);let{openValues:l,setItemOpen:u}=C(`Accordion.Item`),d;t[6]!==l||t[7]!==c?(d=_(l,c),t[6]=l,t[7]=c,t[8]=d):d=t[8];let p=d,m=f(),h;t[9]!==u||t[10]!==c?(h=e=>{u({itemValue:c,open:e})},t[9]=u,t[10]=c,t[11]=h):h=t[11];let v=h,y;t[12]!==m||t[13]!==p||t[14]!==v?(y={open:p,setOpen:v,contentId:m},t[12]=m,t[13]=p,t[14]=v,t[15]=y):y=t[15];let b=y,x;t[16]===r?x=t[17]:(x=i(r,`accordion-item`),t[16]=r,t[17]=x);let S=p?`open`:`closed`,T;t[18]!==n||t[19]!==a||t[20]!==o||t[21]!==x||t[22]!==S?(T=/* @__PURE__ */ g(`div`,{ref:o,...a,role:`group`,"data-slot":x,"data-state":S,children:n}),t[18]=n,t[19]=a,t[20]=o,t[21]=x,t[22]=S,t[23]=T):T=t[23];let E;return t[24]!==b||t[25]!==T?(E=/* @__PURE__ */ g(w.Provider,{value:b,children:T}),t[24]=b,t[25]=T,t[26]=E):E=t[26],E},O=e=>{let t=s(25),n,a,o,c,l,u;t[0]===e?(n=t[1],a=t[2],o=t[3],c=t[4],l=t[5],u=t[6]):({"data-slot":o,className:a,children:n,onClick:c,ref:u,...l}=e,t[0]=e,t[1]=n,t[2]=a,t[3]=o,t[4]=c,t[5]=l,t[6]=u);let{open:d,setOpen:f,contentId:p}=T(`Accordion.Trigger`),m;t[7]===o?m=t[8]:(m=i(o,`accordion-trigger`),t[7]=o,t[8]=m);let h=d?`open`:`closed`,_;t[9]===a?_=t[10]:(_=r(`group flex w-full cursor-pointer items-center justify-between gap-4 py-4 text-left font-medium outline-none`,`-mx-2 rounded-md px-2`,`focus:outline-hidden focus-visible:ring-4 focus-visible:ring-focus-accent`,a),t[9]=a,t[10]=_);let v;t[11]!==c||t[12]!==d||t[13]!==f?(v=e=>{c?.(e),f(!d)},t[11]=c,t[12]=d,t[13]=f,t[14]=v):v=t[14];let y;return t[15]!==n||t[16]!==p||t[17]!==d||t[18]!==l||t[19]!==u||t[20]!==m||t[21]!==h||t[22]!==_||t[23]!==v?(y=/* @__PURE__ */ g(`button`,{ref:u,type:`button`,...l,"data-slot":m,"data-state":h,"aria-expanded":d,"aria-controls":p,className:_,onClick:v,children:n}),t[15]=n,t[16]=p,t[17]=d,t[18]=l,t[19]=u,t[20]=m,t[21]=h,t[22]=_,t[23]=v,t[24]=y):y=t[24],y},k=/* @__PURE__ */ g(c,{weight:`bold`}),A={Root:E,Item:D,Trigger:O,TriggerIcon:e=>{let t=s(14),n,o,c,l;t[0]===e?(n=t[1],o=t[2],c=t[3],l=t[4]):({"data-slot":o,className:n,svg:l,...c}=e,t[0]=e,t[1]=n,t[2]=o,t[3]=c,t[4]=l);let u=l===void 0?k:l,d;t[5]===o?d=t[6]:(d=i(o,`accordion-trigger-icon`),t[5]=o,t[6]=d);let f;t[7]===n?f=t[8]:(f=r(`h-lh w-4 shrink-0 self-start text-muted transition-transform duration-200 ease-out-strong group-data-state-open:rotate-180 motion-reduce:transition-none`,n),t[7]=n,t[8]=f);let p;return t[9]!==c||t[10]!==u||t[11]!==d||t[12]!==f?(p=/* @__PURE__ */ g(a,{...c,"data-slot":d,svg:u,className:f}),t[9]=c,t[10]=u,t[11]=d,t[12]=f,t[13]=p):p=t[13],p},Content:e=>{let a=s(25),o,c,l,u,f;a[0]===e?(o=a[1],c=a[2],l=a[3],u=a[4],f=a[5]):({"data-slot":l,className:c,children:o,ref:f,...u}=e,a[0]=e,a[1]=o,a[2]=c,a[3]=l,a[4]=u,a[5]=f);let{open:m,setOpen:h,contentId:_}=T(`Accordion.Content`),v=p(null),y=n(v,f),b,S;a[6]===h?(b=a[7],S=a[8]):(b=()=>{let e=v.current;if(!e||!x())return;let t=()=>{e.removeAttribute(`hidden`),e.style.transition=`none`,e.style.height=`auto`,e.style.opacity=`1`,h(!0)};return e.addEventListener(`beforematch`,t),()=>{e.removeEventListener(`beforematch`,t)}},S=[h],a[6]=h,a[7]=b,a[8]=S),d(b,S);let C,w;a[9]===m?(C=a[10],w=a[11]):(C=()=>{let e=v.current;e&&x()&&(e.removeAttribute(`inert`),m?e.removeAttribute(`hidden`):(e.setAttribute(`hidden`,`until-found`),e.style.transition=``,e.style.height=``,e.style.opacity=``))},w=[m],a[9]=m,a[10]=C,a[11]=w),t(C,w);let E=!m,D;a[12]===l?D=a[13]:(D=i(l,`accordion-content`),a[12]=l,a[13]=D);let O=m?`open`:`closed`,k;a[14]===c?k=a[15]:(k=r(`h-0 overflow-hidden opacity-0 transition-[height,opacity,content-visibility] duration-200 ease-out-strong [interpolate-size:allow-keywords] transition-discrete data-state-open:h-auto data-state-open:opacity-100 motion-reduce:transition-none`,c),a[14]=c,a[15]=k);let A;return a[16]!==o||a[17]!==y||a[18]!==_||a[19]!==u||a[20]!==E||a[21]!==D||a[22]!==O||a[23]!==k?(A=/* @__PURE__ */ g(`div`,{ref:y,...u,id:_,inert:E,"data-slot":D,"data-state":O,className:k,children:o}),a[16]=o,a[17]=y,a[18]=_,a[19]=u,a[20]=E,a[21]=D,a[22]=O,a[23]=k,a[24]=A):A=a[24],A},Body:e=>{let t=s(14),n,a,o,c;t[0]===e?(n=t[1],a=t[2],o=t[3],c=t[4]):({"data-slot":a,className:n,ref:c,...o}=e,t[0]=e,t[1]=n,t[2]=a,t[3]=o,t[4]=c);let l;t[5]===a?l=t[6]:(l=i(a,`accordion-body`),t[5]=a,t[6]=l);let u;t[7]===n?u=t[8]:(u=r(`pt-1 pb-4`,n),t[7]=n,t[8]=u);let d;return t[9]!==o||t[10]!==c||t[11]!==l||t[12]!==u?(d=/* @__PURE__ */ g(`div`,{ref:c,...o,"data-slot":l,className:u}),t[9]=o,t[10]=c,t[11]=l,t[12]=u,t[13]=d):d=t[13],d}};export{A as Accordion};
package/dist/agent.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngrok/mantle",
3
- "version": "0.93.2",
3
+ "version": "0.93.4",
4
4
  "origin": "https://mantle.ngrok.com",
5
5
  "endpoints": {
6
6
  "docs": "https://mantle.ngrok.com/",
@@ -1345,8 +1345,19 @@
1345
1345
  "summary": "Renders one long opaque value on a single line and keeps its tail visible when it overflows.",
1346
1346
  "jsdoc": "Renders one long opaque value (a URL, a resource ID, an image reference, a token) on a single line.",
1347
1347
  "examples": [
1348
- "```tsx\nimport { TruncatedText } from \"@ngrok/mantle/truncated-text\";\n\n// A URL whose last path segment tells it apart from its neighbors.\n<TruncatedText\n className=\"font-mono text-sm\"\n value=\"https://example.ngrok.app/api/items?filter=%7B%22name%22%3A%22x%22%7D&limit=200\"\n/>\n\n// Keep the six characters that tell two IDs apart.\n<TruncatedText className=\"font-mono text-sm\" tail={6} value=\"ep_2abcdEFGhijKL123456\" />\n\n// As a <code> element.\n<TruncatedText asChild tail={12} value=\"ghcr.io/ngrok/ngrok-operator:0.14.0\">\n <code />\n</TruncatedText>\n```"
1349
- ]
1348
+ "```tsx\nimport { TruncatedText } from \"@ngrok/mantle/truncated-text\";\n\n// A URL whose last path segment tells it apart from its neighbors.\n<TruncatedText\n className=\"font-mono text-sm\"\n value=\"https://example.ngrok.app/api/items?filter=%7B%22name%22%3A%22x%22%7D&limit=200\"\n/>\n\n// Keep the six characters that tell two IDs apart.\n<TruncatedText className=\"font-mono text-sm\" tail={6} value=\"ep_2abcdEFGhijKL123456\" />\n\n// Show an ID as its type prefix, an ellipsis, and its last eight characters.\n<TruncatedText className=\"font-mono text-sm\" head={4} value=\"mem_21h80N9qQuAmhSB8nlTA8KImPbQ\" />\n\n// As a <code> element.\n<TruncatedText asChild tail={12} value=\"ghcr.io/ngrok/ngrok-operator:0.14.0\">\n <code />\n</TruncatedText>\n```"
1349
+ ],
1350
+ "siblings": [
1351
+ {
1352
+ "name": "Code",
1353
+ "boundary": "a short fragment of inline code that never overflows."
1354
+ },
1355
+ {
1356
+ "name": "CodeBlock",
1357
+ "boundary": "a value that may wrap over several lines."
1358
+ }
1359
+ ],
1360
+ "useWhen": "Show one long opaque value on one line, and keep its end visible when it clips."
1350
1361
  },
1351
1362
  {
1352
1363
  "name": "Visually Hidden",
package/dist/llms.txt CHANGED
@@ -1,4 +1,4 @@
1
- # @ngrok/mantle (0.93.2)
1
+ # @ngrok/mantle (0.93.4)
2
2
 
3
3
  > Offline index shipped inside the @ngrok/mantle npm package. The full records, with examples and sibling boundaries, are in agent.json beside this file. Neither file lists props: read the bundled type declarations (`<subpath>.d.ts` beside this file) for every prop and its JSDoc. Live docs: https://mantle.ngrok.com/for-ai-agents.
4
4
 
@@ -6,6 +6,14 @@ import { ComponentProps } from "react";
6
6
  * and `asChild` takes the single element to render it in.
7
7
  */
8
8
  type TruncatedTextProps = Omit<ComponentProps<"span">, "children" | "translate"> & SelfClosingWithAsChild & WithDataSlot & {
9
+ /**
10
+ * The most graphemes the head shows before the ellipsis. When set, a value
11
+ * longer than `head + tail` graphemes always clips to that shape, such as
12
+ * `ep_…KL123456`, even when its container holds more. A narrower container
13
+ * clips the head further. Counts grapheme clusters, like `tail`. Must be a
14
+ * non-negative integer. When omitted, the head fills its container.
15
+ */
16
+ head?: number;
9
17
  /**
10
18
  * How many graphemes stay visible at the end of the value. Counts grapheme
11
19
  * clusters, so an emoji or a letter with a combining mark counts once. Must
@@ -73,13 +81,23 @@ type TruncatedTextProps = Omit<ComponentProps<"span">, "children" | "translate">
73
81
  * over-reserve of narrow glyphs can clip. The layout effect after mount
74
82
  * replaces the estimate with the measured width.
75
83
  *
84
+ * **Head length.** Pass `head` to show at most that many graphemes before the
85
+ * ellipsis. A value longer than `head + tail` graphemes then always clips to
86
+ * that shape, even when its container holds more, and the root shrinks to it.
87
+ * For an ngrok resource ID, `head={id.indexOf("_") + 1}` keeps the type prefix:
88
+ * `mem_…A8KImPbQ`. The head rounds up to whole `ch`, so a proportional font can
89
+ * show one more narrow glyph before the ellipsis.
90
+ *
76
91
  * **Selection.** The root carries `user-select: all`, so one click selects the
77
92
  * whole value across both segments, and a copy yields the full string. Pass
78
93
  * `className="select-text"` to opt out.
79
94
  *
80
95
  * **Tooltip.** The tooltip shows the full value and opens only while the value
81
- * overflows. It needs a `TooltipProvider` ancestor, like every mantle tooltip,
82
- * and throws without one. The server render and the first client render assume
96
+ * overflows. The tooltip is up to 24rem wide, so a resource ID fits on one
97
+ * line. A longer value breaks into lines of near-equal length, and the tooltip
98
+ * narrows to the longest line. It
99
+ * needs a `TooltipProvider` ancestor, like every mantle tooltip, and throws
100
+ * without one. The server render and the first client render assume
83
101
  * no overflow; the measurement after mount adds the tooltip and `data-truncated`.
84
102
  * While the value overflows, the root is focusable, so Tab reaches it, a screen
85
103
  * reader announces the whole value, and the tooltip opens. A value that fits is
@@ -119,6 +137,12 @@ type TruncatedTextProps = Omit<ComponentProps<"span">, "children" | "translate">
119
137
  * | `data-truncated` | present while the value overflows | Presence-only. Style with `data-truncated:`. Absent on the server render. |
120
138
  * | `data-state` | `"closed"` \| `"delayed-open"` \| `"instant-open"` | The tooltip state Radix stamps on the root. Absent inside a control. |
121
139
  *
140
+ * @useWhen Show one long opaque value on one line, and keep its end visible when it clips.
141
+ *
142
+ * @siblings
143
+ * - `Code`: a short fragment of inline code that never overflows.
144
+ * - `CodeBlock`: a value that may wrap over several lines.
145
+ *
122
146
  * @see https://mantle.ngrok.com/components/data-display/truncated-text
123
147
  *
124
148
  * @example
@@ -134,11 +158,14 @@ type TruncatedTextProps = Omit<ComponentProps<"span">, "children" | "translate">
134
158
  * // Keep the six characters that tell two IDs apart.
135
159
  * <TruncatedText className="font-mono text-sm" tail={6} value="ep_2abcdEFGhijKL123456" />
136
160
  *
161
+ * // Show an ID as its type prefix, an ellipsis, and its last eight characters.
162
+ * <TruncatedText className="font-mono text-sm" head={4} value="mem_21h80N9qQuAmhSB8nlTA8KImPbQ" />
163
+ *
137
164
  * // As a <code> element.
138
165
  * <TruncatedText asChild tail={12} value="ghcr.io/ngrok/ngrok-operator:0.14.0">
139
166
  * <code />
140
167
  * </TruncatedText>
141
168
  * ```
142
169
  */
143
- declare const TruncatedText: ({ "aria-describedby": describedBy, asChild, children, className, "data-slot": dataSlot, onFocus, onPointerMove, ref, style, tabIndex, tail, translate, value, ...props }: TruncatedTextProps) => import("react").JSX.Element;
170
+ declare const TruncatedText: ({ "aria-describedby": describedBy, asChild, children, className, "data-slot": dataSlot, onFocus, onPointerMove, ref, head, style, tabIndex, tail, translate, value, ...props }: TruncatedTextProps) => import("react").JSX.Element;
144
171
  export { TruncatedText, type TruncatedTextProps };
@@ -1 +1 @@
1
- import{t as e}from"./use-isomorphic-layout-effect-CLSmHzo4.js";import{n as t}from"./compose-refs-sFdxsL7k.js";import{t as n}from"./cx-CK7o_rVv.js";import{t as r}from"./data-slot-EM6s2WEU.js";import{t as i}from"./slot-DdYN1L1C.js";import{t as a}from"./css-properties-D85fCNV3.js";import{t as o}from"./tooltip-b6oiTaWq.js";import{c as ee}from"react/compiler-runtime";import{Children as s,cloneElement as te,isValidElement as ne,useRef as re,useState as c}from"react";import ie from"tiny-invariant";import{Fragment as ae,jsx as l,jsxs as oe}from"react/jsx-runtime";import{Root as se,Trigger as ce}from"@radix-ui/react-tooltip";let u;function le(e,t){ie(Number.isInteger(t)&&t>=0,`TruncatedText: \`tail\` must be a non-negative integer, received ${String(t)}.`),u??=new Intl.Segmenter(void 0,{granularity:`grapheme`});let n=Array.from(u.segment(e),e=>e.segment);if(n.length<=t)return{head:``,tail:e,tailGraphemes:n.length};let r=n.length-t;return{head:n.slice(0,r).join(``),tail:n.slice(r).join(``),tailGraphemes:t}}function d(e){let t=document.createRange();return t.selectNodeContents(e),t.getBoundingClientRect().width}function f(e){let t=getComputedStyle(e),n=[t.paddingLeft,t.paddingRight,t.borderLeftWidth,t.borderRightWidth].reduce((e,t)=>e+(Number.parseFloat(t)||0),0);return e.getBoundingClientRect().width-n}function ue(e,t,n){let r=d(n);return{tailWidth:r,truncated:d(t)+r>f(e)+.5}}function de(e){return e.parentElement?.closest(`a[href], button, input, select, textarea, summary, [contenteditable=""], [contenteditable="true"], [role="button"], [role="checkbox"], [role="link"], [role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], [role="option"], [role="radio"], [role="switch"], [role="tab"], [role="treeitem"]`)!=null}const fe=String.raw`inline-block overflow-hidden text-ellipsis whitespace-nowrap align-bottom before:content-['\200B'] max-w-[calc(100%_-_var(--_tail-width)_+_0.5px)] [[data-truncated]>&]:max-w-[max(1ch_+_0.5px,calc(round(down,100%_-_var(--_tail-width),1ch)_+_0.5px))]`,pe=e=>{let t=ee(8),n,r,a;if(t[0]!==e){let{"aria-describedby":i,asChild:o,describedBy:ee,...s}=e;a=o,n=ee,r=s,t[0]=e,t[1]=n,t[2]=r,t[3]=a}else n=t[1],r=t[2],a=t[3];let o=a!==void 0&&a?i:`span`,s;return t[4]!==o||t[5]!==n||t[6]!==r?(s=/* @__PURE__ */ l(o,{"aria-describedby":n,...r}),t[4]=o,t[5]=n,t[6]=r,t[7]=s):s=t[7],s},p=i=>{let u=ee(83),d,f,p,m,h,g,_,v,y,b,x,S,C,w;u[0]===i?(d=u[1],f=u[2],p=u[3],m=u[4],h=u[5],g=u[6],_=u[7],v=u[8],y=u[9],b=u[10],x=u[11],S=u[12],C=u[13],w=u[14]):({"aria-describedby":m,asChild:b,children:d,className:f,"data-slot":p,onFocus:h,onPointerMove:g,ref:v,style:y,tabIndex:C,tail:x,translate:S,value:w,..._}=i,u[0]=i,u[1]=d,u[2]=f,u[3]=p,u[4]=m,u[5]=h,u[6]=g,u[7]=_,u[8]=v,u[9]=y,u[10]=b,u[11]=x,u[12]=S,u[13]=C,u[14]=w);let me=b!==void 0&&b,T=x===void 0?8:x,E=S===void 0?`no`:S,D;u[15]!==T||u[16]!==w?(D=le(w,T),u[15]=T,u[16]=w,u[17]=D):D=u[17];let{head:O,tail:k,tailGraphemes:he}=D,[A,ge]=c(null),_e=re(null),ve=re(null),ye=t(v,ge),[be,xe]=c(null),[Se,Ce]=c(!1),[j,we]=c(!1),M=be?.truncated===!0,N;u[18]===A?N=u[19]:(N=()=>{A?.isConnected&&we(de(A))},u[18]=A,u[19]=N),e(N);let P;u[20]===A?P=u[21]:(P=()=>{let e=_e.current,t=ve.current;if(A==null||e==null||t==null)return;let n=()=>{let n=ue(A,e,t);xe(e=>e!=null&&e.tailWidth===n.tailWidth&&e.truncated===n.truncated?e:n),n.truncated||Ce(!1)};n();let r=new ResizeObserver(n);return r.observe(A),r.observe(t),()=>{r.disconnect()}},u[20]=A,u[21]=P);let F;u[22]!==A||u[23]!==T||u[24]!==w?(F=[A,w,T],u[22]=A,u[23]=T,u[24]=w,u[25]=F):F=u[25],e(P,F);let Te=be==null?`${he}ch`:`${be.tailWidth}px`,I;u[26]===w?I=u[27]:(I=/* @__PURE__ */ l(`span`,{"data-slot":`truncated-text-value`,className:`sr-only select-none`,children:w}),u[26]=w,u[27]=I);let L;u[28]===O?L=u[29]:(L=/* @__PURE__ */ l(`span`,{ref:_e,"aria-hidden":!0,"data-slot":`truncated-text-head`,className:fe,children:O}),u[28]=O,u[29]=L);let R;u[30]===k?R=u[31]:(R=/* @__PURE__ */ l(`span`,{ref:ve,"aria-hidden":!0,"data-slot":`truncated-text-tail`,dir:`rtl`,className:`inline-block overflow-hidden whitespace-nowrap text-left align-bottom min-w-(--_tail-width) [[data-truncated]>&]:min-w-0 [[data-truncated]>&]:max-w-[calc(round(down,100%_-_1ch_-_var(--_tail-width),1ch)_+_var(--_tail-width))] [[data-truncated]>:empty+&]:max-w-[calc(round(down,100%_-_var(--_tail-width),1ch)_+_var(--_tail-width)_+_0.5px)] [[data-truncated]>:empty+&]:text-ellipsis`,children:/* @__PURE__ */ l(`span`,{dir:`ltr`,children:k})}),u[30]=k,u[31]=R);let z;u[32]!==R||u[33]!==I||u[34]!==L?(z=/* @__PURE__ */ oe(ae,{children:[I,L,R]}),u[32]=R,u[33]=I,u[34]=L,u[35]=z):z=u[35];let B=z,V;u[36]===p?V=u[37]:(V=r(p,`truncated-text`),u[36]=p,u[37]=V);let Ee=M?``:void 0,H;u[38]===f?H=u[39]:(H=n(`inline-block min-w-0 max-w-full rounded whitespace-nowrap select-all [font-variant-ligatures:none] focus:outline-hidden focus-visible:ring-3 focus-visible:ring-focus-accent data-truncated:cursor-help`,f),u[38]=f,u[39]=H);let U;u[40]!==y||u[41]!==Te?(U=a({"--_tail-width":Te,...y}),u[40]=y,u[41]=Te,u[42]=U):U=u[42];let De=M&&!j?C??0:C,W;u[43]!==j||u[44]!==M||u[45]!==g?(W=e=>{g?.(e),!M&&!j&&e.preventDefault()},u[43]=j,u[44]=M,u[45]=g,u[46]=W):W=u[46];let G;u[47]!==j||u[48]!==M||u[49]!==h?(G=e=>{h?.(e),!M&&!j&&e.preventDefault()},u[47]=j,u[48]=M,u[49]=h,u[50]=G):G=u[50];let K;u[51]!==ye||u[52]!==_||u[53]!==V||u[54]!==Ee||u[55]!==H||u[56]!==U||u[57]!==De||u[58]!==W||u[59]!==G||u[60]!==E?(K={ref:ye,"data-slot":V,"data-truncated":Ee,dir:`ltr`,className:H,style:U,tabIndex:De,onPointerMove:W,onFocus:G,translate:E,..._},u[51]=ye,u[52]=_,u[53]=V,u[54]=Ee,u[55]=H,u[56]=U,u[57]=De,u[58]=W,u[59]=G,u[60]=E,u[61]=K):K=u[61];let q=K,J;if(me){let e;if(u[62]!==d||u[63]!==m||u[64]!==q||u[65]!==B){let t=s.only(d);ie(ne(t),"When using `asChild`, TruncatedText must be passed a single child as a JSX tag."),ie(t.props.children==null,"When using `asChild`, the child of TruncatedText must have no children of its own. `value` is the content."),e=/* @__PURE__ */ l(pe,{asChild:!0,describedBy:m,...q,children:te(t,{},B)}),u[62]=d,u[63]=m,u[64]=q,u[65]=B,u[66]=e}else e=u[66];J=e}else{let e;u[67]!==m||u[68]!==q||u[69]!==B?(e=/* @__PURE__ */ l(pe,{describedBy:m,...q,children:B}),u[67]=m,u[68]=q,u[69]=B,u[70]=e):e=u[70],J=e}if(j)return J;let Y=M&&Se,X;u[71]===M?X=u[72]:(X=e=>Ce(M&&e),u[71]=M,u[72]=X);let Z;u[73]===J?Z=u[74]:(Z=/* @__PURE__ */ l(ce,{asChild:!0,children:J}),u[73]=J,u[74]=Z);let Q;u[75]!==E||u[76]!==w?(Q=/* @__PURE__ */ l(o.Content,{className:`break-all`,translate:E,children:w}),u[75]=E,u[76]=w,u[77]=Q):Q=u[77];let $;return u[78]!==Y||u[79]!==X||u[80]!==Z||u[81]!==Q?($=/* @__PURE__ */ oe(se,{open:Y,onOpenChange:X,children:[Z,Q]}),u[78]=Y,u[79]=X,u[80]=Z,u[81]=Q,u[82]=$):$=u[82],$};export{p as TruncatedText};
1
+ import{t as e}from"./use-isomorphic-layout-effect-CLSmHzo4.js";import{n as t}from"./compose-refs-sFdxsL7k.js";import{t as n}from"./cx-CK7o_rVv.js";import{t as r}from"./data-slot-EM6s2WEU.js";import{t as i}from"./slot-DdYN1L1C.js";import{t as a}from"./css-properties-D85fCNV3.js";import{t as o}from"./tooltip-b6oiTaWq.js";import{c as s}from"react/compiler-runtime";import{Children as c,cloneElement as ee,isValidElement as te,useRef as ne,useState as l}from"react";import u from"tiny-invariant";import{Fragment as re,jsx as d,jsxs as ie}from"react/jsx-runtime";import{Root as ae,Trigger as oe}from"@radix-ui/react-tooltip";let f;function se(e,{head:t,tail:n}){u(Number.isInteger(n)&&n>=0,`TruncatedText: \`tail\` must be a non-negative integer, received ${String(n)}.`),u(t==null||Number.isInteger(t)&&t>=0,`TruncatedText: \`head\` must be a non-negative integer, received ${String(t)}.`),f??=new Intl.Segmenter(void 0,{granularity:`grapheme`});let r=Array.from(f.segment(e),e=>e.segment);if(r.length<=n)return{head:``,lead:null,tail:e,tailGraphemes:r.length};let i=r.length-n,a=t!=null&&r.length>t+n;return{head:r.slice(0,i).join(``),lead:a?r.slice(0,t).join(``):null,tail:r.slice(i).join(``),tailGraphemes:n}}function p(e){let t=document.createRange();return t.selectNodeContents(e),t.getBoundingClientRect().width}function m(e){let t=getComputedStyle(e),n=[t.paddingLeft,t.paddingRight,t.borderLeftWidth,t.borderRightWidth].reduce((e,t)=>e+(Number.parseFloat(t)||0),0);return e.getBoundingClientRect().width-n}function ce({root:e,head:t,tail:n,lead:r}){let i=p(t),a=p(n),o=i+a>m(e)+.5,s=t.firstChild;if(r==null||!(s instanceof Text))return{headCap:null,tailWidth:a,truncated:o};let c=document.createRange();return c.setStart(s,0),c.setEnd(s,Math.min(r.length,s.length)),{headCap:Math.min(c.getBoundingClientRect().width+p(r.ellipsis),i),tailWidth:a,truncated:o}}function le(e){if(e==null)return;e.style.width=``;let t=document.createRange();t.selectNodeContents(e);let n=Math.max(...Array.from(t.getClientRects(),e=>e.width)),r=e.getBoundingClientRect().width/Number.parseFloat(getComputedStyle(e).width);Number.isFinite(n)&&r>0&&(e.style.width=`${Math.ceil(n/r)}px`)}function ue(e){return e.parentElement?.closest(`a[href], button, input, select, textarea, summary, [contenteditable=""], [contenteditable="true"], [role="button"], [role="checkbox"], [role="link"], [role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], [role="option"], [role="radio"], [role="switch"], [role="tab"], [role="treeitem"]`)!=null}const de=String.raw`inline-block overflow-hidden text-ellipsis whitespace-nowrap align-bottom before:content-['\200B'] max-w-[calc(100%_-_var(--_tail-width)_+_0.5px)] [[data-truncated]>&]:max-w-[max(1ch_+_0.5px,calc(round(down,100%_-_var(--_tail-width),1ch)_+_0.5px))]`,fe=e=>{let t=s(8),n,r,a;if(t[0]!==e){let{"aria-describedby":i,asChild:o,describedBy:s,...c}=e;a=o,n=s,r=c,t[0]=e,t[1]=n,t[2]=r,t[3]=a}else n=t[1],r=t[2],a=t[3];let o=a!==void 0&&a?i:`span`,c;return t[4]!==o||t[5]!==n||t[6]!==r?(c=/* @__PURE__ */ d(o,{"aria-describedby":n,...r}),t[4]=o,t[5]=n,t[6]=r,t[7]=c):c=t[7],c},h=i=>{let f=s(97),p,m,h,g,_,v,y,b,x,S,C,w,T,E,D;f[0]===i?(p=f[1],m=f[2],h=f[3],g=f[4],_=f[5],v=f[6],y=f[7],b=f[8],x=f[9],S=f[10],C=f[11],w=f[12],T=f[13],E=f[14],D=f[15]):({"aria-describedby":g,asChild:C,children:p,className:m,"data-slot":h,onFocus:v,onPointerMove:y,ref:x,head:_,style:S,tabIndex:E,tail:w,translate:T,value:D,...b}=i,f[0]=i,f[1]=p,f[2]=m,f[3]=h,f[4]=g,f[5]=_,f[6]=v,f[7]=y,f[8]=b,f[9]=x,f[10]=S,f[11]=C,f[12]=w,f[13]=T,f[14]=E,f[15]=D);let pe=C!==void 0&&C,O=w===void 0?8:w,k=T===void 0?`no`:T,me;f[16]!==_||f[17]!==O||f[18]!==D?(me=se(D,{head:_,tail:O}),f[16]=_,f[17]=O,f[18]=D,f[19]=me):me=f[19];let{head:he,lead:A,tail:ge,tailGraphemes:_e}=me,[j,ve]=l(null),ye=ne(null),be=ne(null),xe=ne(null),Se=t(x,ve),[M,Ce]=l(null),[we,Te]=l(!1),[N,Ee]=l(!1),P=M?.truncated===!0,De;f[20]===j?De=f[21]:(De=()=>{j?.isConnected&&Ee(ue(j))},f[20]=j,f[21]=De),e(De);let F;f[22]!==A||f[23]!==j?(F=()=>{let e=ye.current,t=be.current;if(j==null||e==null||t==null)return;let n=xe.current,r=()=>{let r=ce({root:j,head:e,tail:t,lead:A==null||n==null?null:{ellipsis:n,length:A.length}});Ce(e=>e!=null&&e.headCap===r.headCap&&e.tailWidth===r.tailWidth&&e.truncated===r.truncated?e:r),r.truncated||Te(!1)};r();let i=new ResizeObserver(r);return i.observe(j),i.observe(t),()=>{i.disconnect()}},f[22]=A,f[23]=j,f[24]=F):F=f[24];let Oe;f[25]!==A||f[26]!==j||f[27]!==O||f[28]!==D?(Oe=[j,A,D,O],f[25]=A,f[26]=j,f[27]=O,f[28]=D,f[29]=Oe):Oe=f[29],e(F,Oe);let ke=M==null?`${_e}ch`:`${M.tailWidth}px`,Ae=M?.headCap==null?`${(_??0)+1}ch`:`${M.headCap}px`,I;f[30]===D?I=f[31]:(I=/* @__PURE__ */ d(`span`,{"data-slot":`truncated-text-value`,className:`sr-only select-none`,children:D}),f[30]=D,f[31]=I);let L;f[32]===A?L=f[33]:(L=A!=null&&/* @__PURE__ */ d(`span`,{ref:xe,"aria-hidden":!0,className:`invisible absolute select-none`,children:`…`}),f[32]=A,f[33]=L);let je=A!=null&&`w-[calc(round(up,var(--_head-cap)-0.5px,1ch)+0.5px)]`,R;f[34]===je?R=f[35]:(R=n(de,je),f[34]=je,f[35]=R);let z;f[36]!==he||f[37]!==R?(z=/* @__PURE__ */ d(`span`,{ref:ye,"aria-hidden":!0,"data-slot":`truncated-text-head`,className:R,children:he}),f[36]=he,f[37]=R,f[38]=z):z=f[38];let B;f[39]===ge?B=f[40]:(B=/* @__PURE__ */ d(`span`,{ref:be,"aria-hidden":!0,"data-slot":`truncated-text-tail`,dir:`rtl`,className:`inline-block overflow-hidden whitespace-nowrap text-left align-bottom min-w-(--_tail-width) [[data-truncated]>&]:min-w-0 [[data-truncated]>&]:max-w-[calc(round(down,100%_-_1ch_-_var(--_tail-width),1ch)_+_var(--_tail-width))] [[data-truncated]>:empty+&]:max-w-[calc(round(down,100%_-_var(--_tail-width),1ch)_+_var(--_tail-width)_+_0.5px)] [[data-truncated]>:empty+&]:text-ellipsis`,children:/* @__PURE__ */ d(`span`,{dir:`ltr`,children:ge})}),f[39]=ge,f[40]=B);let V;f[41]!==z||f[42]!==B||f[43]!==I||f[44]!==L?(V=/* @__PURE__ */ ie(re,{children:[I,L,z,B]}),f[41]=z,f[42]=B,f[43]=I,f[44]=L,f[45]=V):V=f[45];let H=V,U;f[46]===h?U=f[47]:(U=r(h,`truncated-text`),f[46]=h,f[47]=U);let Me=P?``:void 0,W;f[48]===m?W=f[49]:(W=n(`inline-block min-w-0 max-w-full rounded whitespace-nowrap select-all [font-variant-ligatures:none] focus:outline-hidden focus-visible:ring-3 focus-visible:ring-focus-accent`,m),f[48]=m,f[49]=W);let G;f[50]!==Ae||f[51]!==A||f[52]!==S||f[53]!==ke?(G=a({"--_tail-width":ke,...A!=null&&{"--_head-cap":Ae},...S}),f[50]=Ae,f[51]=A,f[52]=S,f[53]=ke,f[54]=G):G=f[54];let Ne=P&&!N?E??0:E,K;f[55]!==N||f[56]!==P||f[57]!==y?(K=e=>{y?.(e),!P&&!N&&e.preventDefault()},f[55]=N,f[56]=P,f[57]=y,f[58]=K):K=f[58];let q;f[59]!==N||f[60]!==P||f[61]!==v?(q=e=>{v?.(e),!P&&!N&&e.preventDefault()},f[59]=N,f[60]=P,f[61]=v,f[62]=q):q=f[62];let Pe;f[63]!==Se||f[64]!==b||f[65]!==U||f[66]!==Me||f[67]!==W||f[68]!==G||f[69]!==Ne||f[70]!==K||f[71]!==q||f[72]!==k?(Pe={ref:Se,"data-slot":U,"data-truncated":Me,dir:`ltr`,className:W,style:G,tabIndex:Ne,onPointerMove:K,onFocus:q,translate:k,...b},f[63]=Se,f[64]=b,f[65]=U,f[66]=Me,f[67]=W,f[68]=G,f[69]=Ne,f[70]=K,f[71]=q,f[72]=k,f[73]=Pe):Pe=f[73];let J=Pe,Y;if(pe){let e;if(f[74]!==p||f[75]!==g||f[76]!==J||f[77]!==H){let t=c.only(p);u(te(t),"When using `asChild`, TruncatedText must be passed a single child as a JSX tag."),u(t.props.children==null,"When using `asChild`, the child of TruncatedText must have no children of its own. `value` is the content."),e=/* @__PURE__ */ d(fe,{asChild:!0,describedBy:g,...J,children:ee(t,{},H)}),f[74]=p,f[75]=g,f[76]=J,f[77]=H,f[78]=e}else e=f[78];Y=e}else{let e;f[79]!==g||f[80]!==J||f[81]!==H?(e=/* @__PURE__ */ d(fe,{describedBy:g,...J,children:H}),f[79]=g,f[80]=J,f[81]=H,f[82]=e):e=f[82],Y=e}if(N)return Y;let Fe=P&&we,X;f[83]===P?X=f[84]:(X=e=>Te(P&&e),f[83]=P,f[84]=X);let Z;f[85]===Y?Z=f[86]:(Z=/* @__PURE__ */ d(oe,{asChild:!0,children:Y}),f[85]=Y,f[86]=Z);let Q;f[87]===D?Q=f[88]:(Q=/* @__PURE__ */ d(`span`,{ref:le,className:`block`,children:D},D),f[87]=D,f[88]=Q);let $;f[89]!==Q||f[90]!==k?($=/* @__PURE__ */ d(o.Content,{className:`max-w-[min(24rem,calc(100vw-2rem))] break-all text-balance`,translate:k,children:Q}),f[89]=Q,f[90]=k,f[91]=$):$=f[91];let Ie;return f[92]!==Fe||f[93]!==X||f[94]!==Z||f[95]!==$?(Ie=/* @__PURE__ */ ie(ae,{open:Fe,onOpenChange:X,children:[Z,$]}),f[92]=Fe,f[93]=X,f[94]=Z,f[95]=$,f[96]=Ie):Ie=f[96],Ie};export{h as TruncatedText};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngrok/mantle",
3
- "version": "0.93.2",
3
+ "version": "0.93.4",
4
4
  "description": "mantle is ngrok's UI library and design system.",
5
5
  "homepage": "https://mantle.ngrok.com",
6
6
  "license": "MIT",