@ngrok/mantle 0.90.0 → 0.90.1
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/agent.json +1 -1
- package/dist/llms.txt +1 -1
- package/dist/strata.d.ts +11 -7
- package/dist/strata.js +1 -1
- package/dist/tabs.d.ts +11 -1
- package/dist/tabs.js +1 -1
- package/dist/truncated-text.d.ts +9 -1
- package/dist/truncated-text.js +1 -1
- package/package.json +1 -1
package/dist/agent.json
CHANGED
package/dist/llms.txt
CHANGED
package/dist/strata.d.ts
CHANGED
|
@@ -45,9 +45,11 @@ declare const Root: ({ asChild, children, className, "data-slot": dataSlot, ...p
|
|
|
45
45
|
/**
|
|
46
46
|
* One titled band of the page. Renders a `<section>` that stacks
|
|
47
47
|
* `Strata.Header` above `Strata.Body` below the `md` breakpoint, then splits
|
|
48
|
-
* the two into a
|
|
48
|
+
* the two into a one-to-two grid at `md` and up. It carries its own vertical
|
|
49
49
|
* rhythm (`py-8 first:pt-0`), so it reads correctly as the only child of a
|
|
50
|
-
* `Root` and as one of many.
|
|
50
|
+
* `Root` and as one of many. Both layouts size their tracks `minmax(0, …)`,
|
|
51
|
+
* so a nowrap value in `Strata.Body` clips or wraps instead of widening the
|
|
52
|
+
* section.
|
|
51
53
|
*
|
|
52
54
|
* The `<section>` takes no accessible name, which keeps it generic in the
|
|
53
55
|
* accessibility tree instead of adding one `region` landmark per band — the
|
|
@@ -61,7 +63,7 @@ declare const Root: ({ asChild, children, className, "data-slot": dataSlot, ...p
|
|
|
61
63
|
*
|
|
62
64
|
* | CSS Variable | Default | Description |
|
|
63
65
|
* | ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------- |
|
|
64
|
-
* | `--strata-columns` | `1fr 2fr` | The `grid-template-columns` value at `md` and up. Set it on `Strata.Root` to re-split every section, or here for this section alone. |
|
|
66
|
+
* | `--strata-columns` | `minmax(0, 1fr) minmax(0, 2fr)` | The `grid-template-columns` value at `md` and up. Set it on `Strata.Root` to re-split every section, or here for this section alone. |
|
|
65
67
|
*
|
|
66
68
|
* | Data Attribute | Value | Description |
|
|
67
69
|
* | -------------- | ------------------- | ------------------------------------------------------------------ |
|
|
@@ -345,9 +347,11 @@ declare const Strata: {
|
|
|
345
347
|
/**
|
|
346
348
|
* One titled band of the page. Renders a `<section>` that stacks `Header`
|
|
347
349
|
* above `Body` below the `md` breakpoint, then splits the two into a
|
|
348
|
-
*
|
|
349
|
-
* (`py-8 first:pt-0`).
|
|
350
|
-
*
|
|
350
|
+
* one-to-two grid at `md` and up, and carries its own vertical rhythm
|
|
351
|
+
* (`py-8 first:pt-0`). Both layouts size their tracks `minmax(0, …)`, so a
|
|
352
|
+
* nowrap value in `Body` clips or wraps instead of widening the section. It
|
|
353
|
+
* takes no accessible name, which keeps it generic in the accessibility tree
|
|
354
|
+
* instead of adding one `region` landmark per band —
|
|
351
355
|
* the `Title` headings already carry the page outline. Set `aria-labelledby`
|
|
352
356
|
* to the `Title`'s `id` only when the section is a destination a reader jumps
|
|
353
357
|
* back to, not merely a division of the page. To tell apart controls that read
|
|
@@ -356,7 +360,7 @@ declare const Strata: {
|
|
|
356
360
|
*
|
|
357
361
|
* | CSS Variable | Default | Description |
|
|
358
362
|
* | ------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------- |
|
|
359
|
-
* | `--strata-columns` | `1fr 2fr` | The `grid-template-columns` value at `md` and up. Set it on `Root` to re-split every section, or here for this section alone. |
|
|
363
|
+
* | `--strata-columns` | `minmax(0, 1fr) minmax(0, 2fr)` | The `grid-template-columns` value at `md` and up. Set it on `Root` to re-split every section, or here for this section alone. |
|
|
360
364
|
*
|
|
361
365
|
* | Data Attribute | Value | Description |
|
|
362
366
|
* | -------------- | ------------------- | ------------------------------------------------------------------ |
|
package/dist/strata.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-DdYN1L1C.js";import{c as r}from"react/compiler-runtime";import{jsx as i}from"react/jsx-runtime";const a={Root:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`div`,p;o[6]===u?p=o[7]:(p=t(u,`strata`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`divide-card-muted divide-y`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Section:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`section`,p;o[6]===u?p=o[7]:(p=t(u,`strata-section`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`grid gap-6 py-8 first:pt-0`,`md:grid-cols-(--strata-columns,
|
|
1
|
+
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-DdYN1L1C.js";import{c as r}from"react/compiler-runtime";import{jsx as i}from"react/jsx-runtime";const a={Root:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`div`,p;o[6]===u?p=o[7]:(p=t(u,`strata`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`divide-card-muted divide-y`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Section:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`section`,p;o[6]===u?p=o[7]:(p=t(u,`strata-section`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`grid grid-cols-1 gap-6 py-8 first:pt-0`,`md:grid-cols-(--strata-columns,minmax(0,1fr)_minmax(0,2fr)) md:gap-12`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Header:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`header`,p;o[6]===u?p=o[7]:(p=t(u,`strata-header`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`flex flex-col gap-2`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Title:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`h2`,p;o[6]===u?p=o[7]:(p=t(u,`strata-title`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`text-strong text-base font-medium`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Description:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`p`,p;o[6]===u?p=o[7]:(p=t(u,`strata-description`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`text-body text-sm`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Body:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`div`,p;o[6]===u?p=o[7]:(p=t(u,`strata-body`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`flex flex-col gap-4`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h}};export{a as Strata};
|
package/dist/tabs.d.ts
CHANGED
|
@@ -9,6 +9,11 @@ import { Content, List, Root, Trigger } from "@radix-ui/react-tabs";
|
|
|
9
9
|
* The outermost part; it owns `orientation` and `appearance`. It stamps both as
|
|
10
10
|
* `data-orientation` and `data-appearance` for the parts below to style against.
|
|
11
11
|
*
|
|
12
|
+
* `onValueChange` fires once per activation. Radix activates a trigger on
|
|
13
|
+
* mousedown and again on the focus it moves there, before a controlled root
|
|
14
|
+
* re-renders, so the root passes the second call through only when its value
|
|
15
|
+
* differs from the first.
|
|
16
|
+
*
|
|
12
17
|
* **Data attributes:**
|
|
13
18
|
*
|
|
14
19
|
* | Data Attribute | Value | Description |
|
|
@@ -42,7 +47,7 @@ import { Content, List, Root, Trigger } from "@radix-ui/react-tabs";
|
|
|
42
47
|
* </Tabs.Root>
|
|
43
48
|
* ```
|
|
44
49
|
*/
|
|
45
|
-
declare const Root$1: ({ className, children, "data-slot": dataSlot, orientation, appearance, ...props }: ComponentProps<typeof Root> & WithDataSlot & {
|
|
50
|
+
declare const Root$1: ({ className, children, "data-slot": dataSlot, onValueChange, orientation, appearance, ...props }: ComponentProps<typeof Root> & WithDataSlot & {
|
|
46
51
|
/**
|
|
47
52
|
* The appearance of the tabs. Classic appearance shows the tab
|
|
48
53
|
* list with an underline; pill appearance shows each tab as a pill.
|
|
@@ -264,6 +269,11 @@ declare const Tabs: {
|
|
|
264
269
|
* The outermost part; it owns `orientation` and `appearance`. It stamps both as
|
|
265
270
|
* `data-orientation` and `data-appearance` for the parts below to style against.
|
|
266
271
|
*
|
|
272
|
+
* `onValueChange` fires once per activation. Radix activates a trigger on
|
|
273
|
+
* mousedown and again on the focus it moves there, before a controlled root
|
|
274
|
+
* re-renders, so the root passes the second call through only when its value
|
|
275
|
+
* differs from the first.
|
|
276
|
+
*
|
|
267
277
|
* **Data attributes:**
|
|
268
278
|
*
|
|
269
279
|
* | Data Attribute | Value | Description |
|
package/dist/tabs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./compose-refs-sFdxsL7k.js";import{t}from"./cx-CK7o_rVv.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{t as r}from"./booleanish-BfvnW6vy.js";import{t as i}from"./clsx-DUGZgXfJ.js";import{n as a}from"./separator-DvPe27fH.js";import{t as o}from"./use-prefers-reduced-motion-DimzRx-M.js";import{c as s}from"react/compiler-runtime";import{Children as c,cloneElement as l,createContext as u,isValidElement as d,useContext as f,useEffect as p,useRef as m}from"react";import h from"tiny-invariant";import{Fragment as g,jsx as _,jsxs as v}from"react/jsx-runtime";import{cva as y}from"class-variance-authority";import{Content as b,List as x,Root as S,Trigger as C}from"@radix-ui/react-tabs";const w=u(null);function T(e){let t=f(w);return h(t!=null,`${e} must be rendered inside Tabs.Root.`),t}const E=e=>{let r=s(
|
|
1
|
+
import{n as e}from"./compose-refs-sFdxsL7k.js";import{t}from"./cx-CK7o_rVv.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{t as r}from"./booleanish-BfvnW6vy.js";import{t as i}from"./clsx-DUGZgXfJ.js";import{n as a}from"./separator-DvPe27fH.js";import{t as o}from"./use-prefers-reduced-motion-DimzRx-M.js";import{c as s}from"react/compiler-runtime";import{Children as c,cloneElement as l,createContext as u,isValidElement as d,useContext as f,useEffect as p,useRef as m}from"react";import h from"tiny-invariant";import{Fragment as g,jsx as _,jsxs as v}from"react/jsx-runtime";import{cva as y}from"class-variance-authority";import{Content as b,List as x,Root as S,Trigger as C}from"@radix-ui/react-tabs";const w=u(null);function T(e){let t=f(w);return h(t!=null,`${e} must be rendered inside Tabs.Root.`),t}const E=e=>{let r=s(29),i,a,o,c,l,u,d;r[0]===e?(i=r[1],a=r[2],o=r[3],c=r[4],l=r[5],u=r[6],d=r[7]):({className:a,children:i,"data-slot":o,onValueChange:c,orientation:u,appearance:d,...l}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=c,r[5]=l,r[6]=u,r[7]=d);let f=u===void 0?`horizontal`:u,p=d===void 0?`classic`:d,h;r[8]!==p||r[9]!==f?(h={orientation:f,appearance:p},r[8]=p,r[9]=f,r[10]=h):h=r[10];let g=h,v=m(null),y;r[11]===c?y=r[12]:(y=e=>{e!==v.current&&(v.current=e,queueMicrotask(()=>{v.current=null}),c?.(e))},r[11]=c,r[12]=y);let b=y,x;r[13]===o?x=r[14]:(x=n(o,`tabs`),r[13]=o,r[14]=x);let C=f===`horizontal`?`flex-col`:`flex-row`,T;r[15]!==a||r[16]!==C?(T=t(`flex [--tabs-gap:--spacing(4)] gap-(--tabs-gap)`,C,a),r[15]=a,r[16]=C,r[17]=T):T=r[17];let E;r[18]!==p||r[19]!==i||r[20]!==b||r[21]!==f||r[22]!==l||r[23]!==x||r[24]!==T?(E=/* @__PURE__ */ _(S,{"data-slot":x,"data-appearance":p,className:T,orientation:f,onValueChange:b,...l,children:i}),r[18]=p,r[19]=i,r[20]=b,r[21]=f,r[22]=l,r[23]=x,r[24]=T,r[25]=E):E=r[25];let D;return r[26]!==g||r[27]!==E?(D=/* @__PURE__ */ _(w.Provider,{value:g,children:E}),r[26]=g,r[27]=E,r[28]=D):D=r[28],D},D=y(`flex`,{variants:{orientation:{horizontal:`scroll-fade-x flex-row items-center overflow-x-auto overscroll-x-none self-stretch min-w-0 pt-1 -mt-1 px-1 -mx-1`,vertical:`flex-col items-end gap-3.5 self-stretch`},appearance:{classic:``,pill:``}},compoundVariants:[{orientation:`horizontal`,appearance:`pill`,className:`gap-1 pb-1 -mb-1`},{orientation:`horizontal`,appearance:`classic`,className:`gap-6`}]}),O=r=>{let i=s(20),a,c,l,u;i[0]===r?(a=i[1],c=i[2],l=i[3],u=i[4]):({className:a,"data-slot":c,ref:u,...l}=r,i[0]=r,i[1]=a,i[2]=c,i[3]=l,i[4]=u);let{orientation:d,appearance:f}=T(`Tabs.List`),h=m(null),g=e(h,u),v,y;i[5]===d?(v=i[6],y=i[7]):(v=()=>{let e=h.current;if(!e||d!==`horizontal`)return;let t=new AbortController,{signal:n}=t,r=!1;e.addEventListener(`pointerdown`,()=>{r=!0},{signal:n});let i=()=>{r=!1};return e.addEventListener(`pointerup`,i,{signal:n}),e.addEventListener(`pointercancel`,i,{signal:n}),e.addEventListener(`keydown`,i,{signal:n}),e.addEventListener(`focusin`,t=>{if(!r&&t.target instanceof Element&&t.target!==e){let e=o()?`auto`:`smooth`;t.target.scrollIntoView({behavior:e,inline:`center`,block:`nearest`})}},{signal:n}),()=>{t.abort()}},y=[d],i[5]=d,i[6]=v,i[7]=y),p(v,y);let b;i[8]===c?b=i[9]:(b=n(c,`tabs-list`),i[8]=c,i[9]=b);let S;i[10]!==f||i[11]!==a||i[12]!==d?(S=t(D({orientation:d,appearance:f}),a),i[10]=f,i[11]=a,i[12]=d,i[13]=S):S=i[13];let C;return i[14]!==g||i[15]!==d||i[16]!==l||i[17]!==b||i[18]!==S?(C=/* @__PURE__ */ _(x,{"aria-orientation":d,"data-slot":b,className:S,ref:g,...l}),i[14]=g,i[15]=d,i[16]=l,i[17]=b,i[18]=S,i[19]=C):C=i[19],C},k=e=>{let r=s(14),i,o,c;r[0]===e?(i=r[1],o=r[2],c=r[3]):({className:i,"data-slot":o,...c}=e,r[0]=e,r[1]=i,r[2]=o,r[3]=c);let{orientation:l}=T(`Tabs.Separator`),u=l===`horizontal`?`[[data-slot~=tabs]>&]:-mt-(--tabs-gap)`:`h-auto self-stretch [[data-slot~=tabs]>&]:-ml-(--tabs-gap)`,d;r[4]===o?d=r[5]:(d=n(o,`tabs-separator`),r[4]=o,r[5]=d);let f;r[6]!==i||r[7]!==u?(f=t(u,i),r[6]=i,r[7]=u,r[8]=f):f=r[8];let p;return r[9]!==l||r[10]!==c||r[11]!==d||r[12]!==f?(p=/* @__PURE__ */ _(a,{"data-slot":d,orientation:l,className:f,...c}),r[9]=l,r[10]=c,r[11]=d,r[12]=f,r[13]=p):p=r[13],p},A=y(`absolute z-0`,{variants:{orientation:{horizontal:`bottom-0 left-0 right-0 h-0.75`,vertical:`-right-px bottom-0 top-0 w-0.75`},appearance:{classic:`group-data-state-active/tab-trigger:bg-neutral-950`,pill:`hidden`}}}),j=()=>{let e=s(5),{orientation:t,appearance:n}=T(`Tabs.Trigger`),r;e[0]!==n||e[1]!==t?(r=i(A({orientation:t,appearance:n})),e[0]=n,e[1]=t,e[2]=r):r=e[2];let a;return e[3]===r?a=e[4]:(a=/* @__PURE__ */ _(`span`,{"aria-hidden":!0,className:r}),e[3]=r,e[4]=a),a},M=y(t(`group/tab-trigger relative flex cursor-pointer items-center gap-1 whitespace-nowrap py-3 text-sm font-medium text-gray-600`,`ring-focus-accent outline-hidden`,`aria-disabled:cursor-default aria-disabled:opacity-50`,`focus-visible:ring-4`,`[&>[data-slot=tabs-trigger-label]>svg]:shrink-0 [&>[data-slot=tabs-trigger-label]>svg]:size-5`,`not-aria-disabled:hover:text-gray-900`),{variants:{orientation:{horizontal:`rounded-tl-md rounded-tr-md`,vertical:`rounded-bl-md rounded-tl-md pr-3`},appearance:{classic:t(`not-aria-disabled:hover:data-state-active:text-strong`,`data-state-active:text-strong`),pill:t(`not-aria-disabled:hover:data-state-active:text-strong`,`not-aria-disabled:hover:data-state-active:bg-neutral-500/15`,`data-state-active:text-strong`,`data-state-active:bg-neutral-500/15`,`rounded-full py-2 px-3`)}}}),N={Root:E,Content:e=>{let r=s(12),i,a,o;r[0]===e?(i=r[1],a=r[2],o=r[3]):({className:i,"data-slot":a,...o}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o);let c;r[4]===a?c=r[5]:(c=n(a,`tabs-content`),r[4]=a,r[5]=c);let l;r[6]===i?l=r[7]:(l=t(`focus-visible:ring-focus-accent outline-hidden focus-visible:ring-4`,i),r[6]=i,r[7]=l);let u;return r[8]!==o||r[9]!==c||r[10]!==l?(u=/* @__PURE__ */ _(b,{"data-slot":c,className:l,...o}),r[8]=o,r[9]=c,r[10]=l,r[11]=u):u=r[11],u},List:O,Separator:k,Trigger:e=>{let i=s(44),a,o,u,f,p,m,y,b;i[0]===e?(a=i[1],o=i[2],u=i[3],f=i[4],p=i[5],m=i[6],y=i[7],b=i[8]):({"aria-disabled":a,asChild:b,children:u,className:f,"data-slot":p,disabled:o,ref:y,...m}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=u,i[4]=f,i[5]=p,i[6]=m,i[7]=y,i[8]=b);let x=b!==void 0&&b,{orientation:S,appearance:w}=T(`Tabs.Trigger`),E=a??o,D;i[9]===E?D=i[10]:(D=r(E),i[9]=E,i[10]=D);let O=D,k=a??o,A;i[11]!==w||i[12]!==f||i[13]!==S?(A=t(M({orientation:S,appearance:w}),f),i[11]=w,i[12]=f,i[13]=S,i[14]=A):A=i[14];let N;i[15]===p?N=i[16]:(N=n(p,`tabs-trigger`),i[15]=p,i[16]=N);let P;i[17]!==O||i[18]!==m||i[19]!==k||i[20]!==A||i[21]!==N?(P={"aria-disabled":k,className:A,"data-slot":N,disabled:O,...m},i[17]=O,i[18]=m,i[19]=k,i[20]=A,i[21]=N,i[22]=P):P=i[22];let F=P;if(x){let e;i[23]===u?e=i[24]:(e=c.only(u),h(d(e),"When using `asChild`, TabsTrigger must be passed a single child as a JSX tag."),i[23]=u,i[24]=e);let t=e.props?.children,n;if(i[25]!==O||i[26]!==t||i[27]!==y||i[28]!==e||i[29]!==F){let r=O?{href:void 0,to:void 0}:{},a;i[31]!==O||i[32]!==e?(a=O?/* @__PURE__ */ _(`button`,{type:`button`}):e,i[31]=O,i[32]=e,i[33]=a):a=i[33];let o;i[34]===Symbol.for(`react.memo_cache_sentinel`)?(o=/* @__PURE__ */ _(j,{}),i[34]=o):o=i[34];let s;i[35]===t?s=i[36]:(s=/* @__PURE__ */ v(g,{children:[o,/* @__PURE__ */ _(`span`,{"data-slot":`tabs-trigger-label`,className:`contents`,children:t})]}),i[35]=t,i[36]=s),n=/* @__PURE__ */ _(C,{asChild:!0,...F,ref:y,children:l(a,r,s)}),i[25]=O,i[26]=t,i[27]=y,i[28]=e,i[29]=F,i[30]=n}else n=i[30];return n}let I;i[37]===Symbol.for(`react.memo_cache_sentinel`)?(I=/* @__PURE__ */ _(j,{}),i[37]=I):I=i[37];let L;i[38]===u?L=i[39]:(L=/* @__PURE__ */ _(`span`,{"data-slot":`tabs-trigger-label`,className:`contents`,children:u}),i[38]=u,i[39]=L);let R;return i[40]!==y||i[41]!==L||i[42]!==F?(R=/* @__PURE__ */ v(C,{ref:y,...F,children:[I,L]}),i[40]=y,i[41]=L,i[42]=F,i[43]=R):R=i[43],R},Badge:e=>{let r=s(14),i,a,o,c;r[0]===e?(i=r[1],a=r[2],o=r[3],c=r[4]):({className:a,children:i,"data-slot":o,...c}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=c);let l;r[5]===o?l=r[6]:(l=n(o,`tabs-badge`),r[5]=o,r[6]=l);let u;r[7]===a?u=r[8]:(u=t(`rounded-full bg-neutral-500/20 px-1.5 text-xs font-medium text-gray-600`,`group-data-state-active/tab-trigger:bg-neutral-950/10 group-data-state-active/tab-trigger:text-strong group-hover/tab-trigger:group-enabled/tab-trigger:group-data-state-active/tab-trigger:text-strong`,`group-hover/tab-trigger:group-enabled/tab-trigger:text-gray-700`,a),r[7]=a,r[8]=u);let d;return r[9]!==i||r[10]!==c||r[11]!==l||r[12]!==u?(d=/* @__PURE__ */ _(`span`,{"data-slot":l,className:u,...c,children:i}),r[9]=i,r[10]=c,r[11]=l,r[12]=u,r[13]=d):d=r[13],d}};export{N as Tabs};
|
package/dist/truncated-text.d.ts
CHANGED
|
@@ -86,6 +86,14 @@ type TruncatedTextProps = Omit<ComponentProps<"span">, "children" | "translate">
|
|
|
86
86
|
* reader announces the whole value, and the tooltip opens. A value that fits is
|
|
87
87
|
* not a tab stop. A `tabIndex` prop wins in both states.
|
|
88
88
|
*
|
|
89
|
+
* Inside a control (a `<button>`, an `<a href>`, a radio, a menu item, a tab)
|
|
90
|
+
* the root takes no tab stop and opens no tooltip, because a control cannot
|
|
91
|
+
* hold a second one. The segments still clip, `data-truncated` still lands,
|
|
92
|
+
* and the hidden copy gives the control's accessible name the whole value.
|
|
93
|
+
* Wrap the control in `Tooltip` when a sighted reader needs the full value.
|
|
94
|
+
* The server render and the first client render assume no control, like they
|
|
95
|
+
* assume no overflow; each commit after that reads the DOM again.
|
|
96
|
+
*
|
|
89
97
|
* **Accessibility.** The two visible segments are `aria-hidden`, because
|
|
90
98
|
* Chromium puts a space between two inline-block boxes in an accessible name.
|
|
91
99
|
* A visually hidden `<span data-slot="truncated-text-value">` holds the whole
|
|
@@ -110,7 +118,7 @@ type TruncatedTextProps = Omit<ComponentProps<"span">, "children" | "translate">
|
|
|
110
118
|
* | `data-slot` | `"truncated-text-tail"` | On the `<span>` that stays visible. Holds the last `tail` graphemes. |
|
|
111
119
|
* | `data-slot` | `"truncated-text-value"` | On the visually hidden `<span>` that holds the whole value for assistive technology. |
|
|
112
120
|
* | `data-truncated` | present while the value overflows | Presence-only. Style with `data-truncated:`. Absent on the server render. |
|
|
113
|
-
* | `data-state` | `"closed"` \| `"delayed-open"` \| `"instant-open"` | The tooltip state Radix stamps on the root.
|
|
121
|
+
* | `data-state` | `"closed"` \| `"delayed-open"` \| `"instant-open"` | The tooltip state Radix stamps on the root. Absent inside a control. |
|
|
114
122
|
*
|
|
115
123
|
* @see https://mantle.ngrok.com/components/data-display/truncated-text
|
|
116
124
|
*
|
package/dist/truncated-text.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.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-NhYXqStK.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
|
|
1
|
+
import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.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-NhYXqStK.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};
|