@ngrok/mantle 0.93.4 → 0.93.6
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 +1 -1
- package/dist/agent.json +2 -2
- package/dist/llms.txt +1 -1
- package/dist/truncated-text.d.ts +15 -0
- package/package.json +1 -1
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.
|
|
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=()=>{let{transitionProperty:t}=e.style;e.removeAttribute(`hidden`),e.style.transitionProperty=`none`,e.style.height=`auto`,e.style.opacity=`1`,e.getBoundingClientRect(),e.style.transitionProperty=t,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};
|
package/dist/agent.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngrok/mantle",
|
|
3
|
-
"version": "0.93.
|
|
3
|
+
"version": "0.93.6",
|
|
4
4
|
"origin": "https://mantle.ngrok.com",
|
|
5
5
|
"endpoints": {
|
|
6
6
|
"docs": "https://mantle.ngrok.com/",
|
|
@@ -1345,7 +1345,7 @@
|
|
|
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// 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```"
|
|
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// Mute the type prefix and the ellipsis, and keep the tail at body color.\n<TruncatedText\n className=\"font-mono text-sm *:data-[slot=truncated-text-head]:text-muted *:data-[slot=truncated-text-tail]:text-body\"\n head={4}\n value=\"mem_21h80N9qQuAmhSB8nlTA8KImPbQ\"\n/>\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
1349
|
],
|
|
1350
1350
|
"siblings": [
|
|
1351
1351
|
{
|
package/dist/llms.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @ngrok/mantle (0.93.
|
|
1
|
+
# @ngrok/mantle (0.93.6)
|
|
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
|
|
package/dist/truncated-text.d.ts
CHANGED
|
@@ -88,6 +88,14 @@ type TruncatedTextProps = Omit<ComponentProps<"span">, "children" | "translate">
|
|
|
88
88
|
* `mem_…A8KImPbQ`. The head rounds up to whole `ch`, so a proportional font can
|
|
89
89
|
* show one more narrow glyph before the ellipsis.
|
|
90
90
|
*
|
|
91
|
+
* **Segment styles.** Style the head and the tail from the root with
|
|
92
|
+
* `*:data-[slot=truncated-text-head]:` and `*:data-[slot=truncated-text-tail]:`
|
|
93
|
+
* classes. CSS draws the ellipsis at the end of the head, so the ellipsis takes
|
|
94
|
+
* the head's color. A value no longer than `tail` has an empty head, so its
|
|
95
|
+
* tail draws the ellipsis in the tail's color. The two segments render when the
|
|
96
|
+
* value fits too. To color them only while the value overflows, add the
|
|
97
|
+
* `data-truncated:` variant first.
|
|
98
|
+
*
|
|
91
99
|
* **Selection.** The root carries `user-select: all`, so one click selects the
|
|
92
100
|
* whole value across both segments, and a copy yields the full string. Pass
|
|
93
101
|
* `className="select-text"` to opt out.
|
|
@@ -161,6 +169,13 @@ type TruncatedTextProps = Omit<ComponentProps<"span">, "children" | "translate">
|
|
|
161
169
|
* // Show an ID as its type prefix, an ellipsis, and its last eight characters.
|
|
162
170
|
* <TruncatedText className="font-mono text-sm" head={4} value="mem_21h80N9qQuAmhSB8nlTA8KImPbQ" />
|
|
163
171
|
*
|
|
172
|
+
* // Mute the type prefix and the ellipsis, and keep the tail at body color.
|
|
173
|
+
* <TruncatedText
|
|
174
|
+
* className="font-mono text-sm *:data-[slot=truncated-text-head]:text-muted *:data-[slot=truncated-text-tail]:text-body"
|
|
175
|
+
* head={4}
|
|
176
|
+
* value="mem_21h80N9qQuAmhSB8nlTA8KImPbQ"
|
|
177
|
+
* />
|
|
178
|
+
*
|
|
164
179
|
* // As a <code> element.
|
|
165
180
|
* <TruncatedText asChild tail={12} value="ghcr.io/ngrok/ngrok-operator:0.14.0">
|
|
166
181
|
* <code />
|