@ngrok/mantle 0.90.2 → 0.90.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.d.ts +3 -4
- package/dist/accordion.js +1 -1
- package/dist/agent.json +2 -2
- package/dist/app-layout.d.ts +3 -1
- package/dist/app-layout.js +1 -1
- package/dist/data-table.d.ts +224 -42
- package/dist/data-table.js +1 -1
- package/dist/input.js +1 -1
- package/dist/llms.txt +1 -1
- package/package.json +1 -1
package/dist/accordion.d.ts
CHANGED
|
@@ -223,10 +223,9 @@ declare const Content: ({ "data-slot": dataSlot, className, children, ref, ...pr
|
|
|
223
223
|
* section's body content lives. Owns the body's padding so {@link Content} can
|
|
224
224
|
* stay a zero-padding animation viewport: a padded `h-0` border-box can't
|
|
225
225
|
* collapse below its padding, so keeping the padding here lets the closed slide
|
|
226
|
-
* reach zero height. The `pt-
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
* ring off the body's first line (see {@link Trigger}). Text inherits the ambient
|
|
226
|
+
* reach zero height. The `pt-1` is the focus ring's vertical clearance: the
|
|
227
|
+
* trigger keeps its `py-4` when open, and its `ring-4` paints 4px below the
|
|
228
|
+
* button, so the ring stays off the body's first line (see {@link Trigger}). Text inherits the ambient
|
|
230
229
|
* size — it isn't forced — so set a size on the content where you need one.
|
|
231
230
|
* Override `className` to retune the padding (e.g. `pb-0`, `px-6`); `cx` resolves
|
|
232
231
|
* last-wins.
|
package/dist/accordion.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"./icon-kK0c-POG.js";import{t as a}from"./slot-DdYN1L1C.js";import{c as o}from"react/compiler-runtime";import{CaretDownIcon as s}from"@phosphor-icons/react/CaretDown";import{createContext as c,useContext as l,useEffect as u,useId as d,useRef as f,useState as p}from"react";import m from"tiny-invariant";import{jsx as h}from"react/jsx-runtime";function g(e,t){return e.includes(t)}function _(e,t,n,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 v(e){return e==null?[]:typeof e==`string`?e===``?[]:[e]:e}function y(e,t){e.type===`single`?e.onValueChange?.(t[0]??``):e.onValueChange?.([...t])}function b(){return typeof document<`u`&&document.body!=null&&`onbeforematch`in document.body}const x=c(null);function S(e){let t=l(x);return m(t,`\`${e}\` must be rendered within \`Accordion.Root\`.`),t}const C=c(null);function w(e){let t=l(C);return m(t,`\`${e}\` must be rendered within \`Accordion.Item\`.`),t}const T=t=>{let i=o(42),s,c,l,u,d,m,g,b,S;if(i[0]!==t){let{type:e,value:n,defaultValue:r,onValueChange:a,"data-slot":o,asChild:f,children:p,className:h,ref:_,...v}=t;b=e,S=n,d=r,u=o,s=f,c=p,l=h,g=_,m=v,i[0]=t,i[1]=s,i[2]=c,i[3]=l,i[4]=u,i[5]=d,i[6]=m,i[7]=g,i[8]=b,i[9]=S}else s=i[1],c=i[2],l=i[3],u=i[4],d=i[5],m=i[6],g=i[7],b=i[8],S=i[9];let C=b===void 0?`multiple`:b,w=S!=null,T;i[10]===d?T=i[11]:(T=()=>v(d),i[10]=d,i[11]=T);let[E,D]=p(T),O;i[12]!==E||i[13]!==w||i[14]!==S?(O=w?v(S):E,i[12]=E,i[13]=w,i[14]=S,i[15]=O):O=i[15];let k=O,A=f(t),j;i[16]===t?j=i[17]:(j=()=>{A.current=t},i[16]=t,i[17]=j),e(j);let M;i[18]!==w||i[19]!==k||i[20]!==C?(M=(e,t)=>{let n=_(k,e,t,C);n!==k&&(w||D(n),y(A.current,n))},i[18]=w,i[19]=k,i[20]=C,i[21]=M):M=i[21];let N=M,P;i[22]!==k||i[23]!==N||i[24]!==C?(P={type:C,openValues:k,setItemOpen:N},i[22]=k,i[23]=N,i[24]=C,i[25]=P):P=i[25];let F=P,I;i[26]===u?I=i[27]:(I=r(u,`accordion`),i[26]=u,i[27]=I);let L;i[28]===l?L=i[29]:(L=n(`w-full divide-y divide-separator`,l),i[28]=l,i[29]=L);let R;i[30]!==m||i[31]!==I||i[32]!==L?(R={...m,"data-slot":I,className:L},i[30]=m,i[31]=I,i[32]=L,i[33]=R):R=i[33];let z=R,B;i[34]!==s||i[35]!==c||i[36]!==z||i[37]!==g?(B=h(s?a:`div`,{ref:g,...z,children:c}),i[34]=s,i[35]=c,i[36]=z,i[37]=g,i[38]=B):B=i[38];let V;return i[39]!==F||i[40]!==B?(V=/* @__PURE__ */ h(x.Provider,{value:F,children:B}),i[39]=F,i[40]=B,i[41]=V):V=i[41],V},E=e=>{let t=o(27),n,i,a,s,c;t[0]===e?(n=t[1],i=t[2],a=t[3],s=t[4],c=t[5]):({"data-slot":i,children:n,value:c,ref:s,...a}=e,t[0]=e,t[1]=n,t[2]=i,t[3]=a,t[4]=s,t[5]=c);let{openValues:l,setItemOpen:u}=S(`Accordion.Item`),f;t[6]!==l||t[7]!==c?(f=g(l,c),t[6]=l,t[7]=c,t[8]=f):f=t[8];let p=f,m=d(),_;t[9]!==u||t[10]!==c?(_=e=>{u(c,e)},t[9]=u,t[10]=c,t[11]=_):_=t[11];let v=_,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]===i?x=t[17]:(x=r(i,`accordion-item`),t[16]=i,t[17]=x);let w=p?`open`:`closed`,T;t[18]!==n||t[19]!==a||t[20]!==s||t[21]!==x||t[22]!==w?(T=/* @__PURE__ */ h(`div`,{ref:s,...a,role:`group`,"data-slot":x,"data-state":w,children:n}),t[18]=n,t[19]=a,t[20]=s,t[21]=x,t[22]=w,t[23]=T):T=t[23];let E;return t[24]!==b||t[25]!==T?(E=/* @__PURE__ */ h(C.Provider,{value:b,children:T}),t[24]=b,t[25]=T,t[26]=E):E=t[26],E},D=e=>{let t=o(25),i,a,s,c,l,u;t[0]===e?(i=t[1],a=t[2],s=t[3],c=t[4],l=t[5],u=t[6]):({"data-slot":s,className:a,children:i,onClick:c,ref:u,...l}=e,t[0]=e,t[1]=i,t[2]=a,t[3]=s,t[4]=c,t[5]=l,t[6]=u);let{open:d,setOpen:f,contentId:p}=w(`Accordion.Trigger`),m;t[7]===s?m=t[8]:(m=r(s,`accordion-trigger`),t[7]=s,t[8]=m);let g=d?`open`:`closed`,_;t[9]===a?_=t[10]:(_=n(`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`,`
|
|
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"./icon-kK0c-POG.js";import{t as a}from"./slot-DdYN1L1C.js";import{c as o}from"react/compiler-runtime";import{CaretDownIcon as s}from"@phosphor-icons/react/CaretDown";import{createContext as c,useContext as l,useEffect as u,useId as d,useRef as f,useState as p}from"react";import m from"tiny-invariant";import{jsx as h}from"react/jsx-runtime";function g(e,t){return e.includes(t)}function _(e,t,n,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 v(e){return e==null?[]:typeof e==`string`?e===``?[]:[e]:e}function y(e,t){e.type===`single`?e.onValueChange?.(t[0]??``):e.onValueChange?.([...t])}function b(){return typeof document<`u`&&document.body!=null&&`onbeforematch`in document.body}const x=c(null);function S(e){let t=l(x);return m(t,`\`${e}\` must be rendered within \`Accordion.Root\`.`),t}const C=c(null);function w(e){let t=l(C);return m(t,`\`${e}\` must be rendered within \`Accordion.Item\`.`),t}const T=t=>{let i=o(42),s,c,l,u,d,m,g,b,S;if(i[0]!==t){let{type:e,value:n,defaultValue:r,onValueChange:a,"data-slot":o,asChild:f,children:p,className:h,ref:_,...v}=t;b=e,S=n,d=r,u=o,s=f,c=p,l=h,g=_,m=v,i[0]=t,i[1]=s,i[2]=c,i[3]=l,i[4]=u,i[5]=d,i[6]=m,i[7]=g,i[8]=b,i[9]=S}else s=i[1],c=i[2],l=i[3],u=i[4],d=i[5],m=i[6],g=i[7],b=i[8],S=i[9];let C=b===void 0?`multiple`:b,w=S!=null,T;i[10]===d?T=i[11]:(T=()=>v(d),i[10]=d,i[11]=T);let[E,D]=p(T),O;i[12]!==E||i[13]!==w||i[14]!==S?(O=w?v(S):E,i[12]=E,i[13]=w,i[14]=S,i[15]=O):O=i[15];let k=O,A=f(t),j;i[16]===t?j=i[17]:(j=()=>{A.current=t},i[16]=t,i[17]=j),e(j);let M;i[18]!==w||i[19]!==k||i[20]!==C?(M=(e,t)=>{let n=_(k,e,t,C);n!==k&&(w||D(n),y(A.current,n))},i[18]=w,i[19]=k,i[20]=C,i[21]=M):M=i[21];let N=M,P;i[22]!==k||i[23]!==N||i[24]!==C?(P={type:C,openValues:k,setItemOpen:N},i[22]=k,i[23]=N,i[24]=C,i[25]=P):P=i[25];let F=P,I;i[26]===u?I=i[27]:(I=r(u,`accordion`),i[26]=u,i[27]=I);let L;i[28]===l?L=i[29]:(L=n(`w-full divide-y divide-separator`,l),i[28]=l,i[29]=L);let R;i[30]!==m||i[31]!==I||i[32]!==L?(R={...m,"data-slot":I,className:L},i[30]=m,i[31]=I,i[32]=L,i[33]=R):R=i[33];let z=R,B;i[34]!==s||i[35]!==c||i[36]!==z||i[37]!==g?(B=h(s?a:`div`,{ref:g,...z,children:c}),i[34]=s,i[35]=c,i[36]=z,i[37]=g,i[38]=B):B=i[38];let V;return i[39]!==F||i[40]!==B?(V=/* @__PURE__ */ h(x.Provider,{value:F,children:B}),i[39]=F,i[40]=B,i[41]=V):V=i[41],V},E=e=>{let t=o(27),n,i,a,s,c;t[0]===e?(n=t[1],i=t[2],a=t[3],s=t[4],c=t[5]):({"data-slot":i,children:n,value:c,ref:s,...a}=e,t[0]=e,t[1]=n,t[2]=i,t[3]=a,t[4]=s,t[5]=c);let{openValues:l,setItemOpen:u}=S(`Accordion.Item`),f;t[6]!==l||t[7]!==c?(f=g(l,c),t[6]=l,t[7]=c,t[8]=f):f=t[8];let p=f,m=d(),_;t[9]!==u||t[10]!==c?(_=e=>{u(c,e)},t[9]=u,t[10]=c,t[11]=_):_=t[11];let v=_,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]===i?x=t[17]:(x=r(i,`accordion-item`),t[16]=i,t[17]=x);let w=p?`open`:`closed`,T;t[18]!==n||t[19]!==a||t[20]!==s||t[21]!==x||t[22]!==w?(T=/* @__PURE__ */ h(`div`,{ref:s,...a,role:`group`,"data-slot":x,"data-state":w,children:n}),t[18]=n,t[19]=a,t[20]=s,t[21]=x,t[22]=w,t[23]=T):T=t[23];let E;return t[24]!==b||t[25]!==T?(E=/* @__PURE__ */ h(C.Provider,{value:b,children:T}),t[24]=b,t[25]=T,t[26]=E):E=t[26],E},D=e=>{let t=o(25),i,a,s,c,l,u;t[0]===e?(i=t[1],a=t[2],s=t[3],c=t[4],l=t[5],u=t[6]):({"data-slot":s,className:a,children:i,onClick:c,ref:u,...l}=e,t[0]=e,t[1]=i,t[2]=a,t[3]=s,t[4]=c,t[5]=l,t[6]=u);let{open:d,setOpen:f,contentId:p}=w(`Accordion.Trigger`),m;t[7]===s?m=t[8]:(m=r(s,`accordion-trigger`),t[7]=s,t[8]=m);let g=d?`open`:`closed`,_;t[9]===a?_=t[10]:(_=n(`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]!==i||t[16]!==p||t[17]!==d||t[18]!==l||t[19]!==u||t[20]!==m||t[21]!==g||t[22]!==_||t[23]!==v?(y=/* @__PURE__ */ h(`button`,{ref:u,type:`button`,...l,"data-slot":m,"data-state":g,"aria-expanded":d,"aria-controls":p,className:_,onClick:v,children:i}),t[15]=i,t[16]=p,t[17]=d,t[18]=l,t[19]=u,t[20]=m,t[21]=g,t[22]=_,t[23]=v,t[24]=y):y=t[24],y},O=/* @__PURE__ */ h(s,{weight:`bold`}),k={Root:T,Item:E,Trigger:D,TriggerIcon:e=>{let t=o(14),a,s,c,l;t[0]===e?(a=t[1],s=t[2],c=t[3],l=t[4]):({"data-slot":s,className:a,svg:l,...c}=e,t[0]=e,t[1]=a,t[2]=s,t[3]=c,t[4]=l);let u=l===void 0?O:l,d;t[5]===s?d=t[6]:(d=r(s,`accordion-trigger-icon`),t[5]=s,t[6]=d);let f;t[7]===a?f=t[8]:(f=n(`size-4 shrink-0 text-muted transition-transform duration-200 ease-out-strong group-data-state-open:rotate-180 motion-reduce:transition-none`,a),t[7]=a,t[8]=f);let p;return t[9]!==c||t[10]!==u||t[11]!==d||t[12]!==f?(p=/* @__PURE__ */ h(i,{...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:i=>{let a=o(25),s,c,l,d,p;a[0]===i?(s=a[1],c=a[2],l=a[3],d=a[4],p=a[5]):({"data-slot":l,className:c,children:s,ref:p,...d}=i,a[0]=i,a[1]=s,a[2]=c,a[3]=l,a[4]=d,a[5]=p);let{open:m,setOpen:g,contentId:_}=w(`Accordion.Content`),v=f(null),y=t(v,p),x,S;a[6]===g?(x=a[7],S=a[8]):(x=()=>{let e=v.current;if(!e||!b())return;let t=()=>{e.removeAttribute(`hidden`),e.style.height=`auto`,e.style.opacity=`1`,g(!0)};return e.addEventListener(`beforematch`,t),()=>{e.removeEventListener(`beforematch`,t)}},S=[g],a[6]=g,a[7]=x,a[8]=S),u(x,S);let C,T;a[9]===m?(C=a[10],T=a[11]):(C=()=>{let e=v.current;e&&b()&&(e.removeAttribute(`inert`),m?e.removeAttribute(`hidden`):(e.setAttribute(`hidden`,`until-found`),e.style.height=``,e.style.opacity=``))},T=[m],a[9]=m,a[10]=C,a[11]=T),e(C,T);let E=!m,D;a[12]===l?D=a[13]:(D=r(l,`accordion-content`),a[12]=l,a[13]=D);let O=m?`open`:`closed`,k;a[14]===c?k=a[15]:(k=n(`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]!==s||a[17]!==y||a[18]!==_||a[19]!==d||a[20]!==E||a[21]!==D||a[22]!==O||a[23]!==k?(A=/* @__PURE__ */ h(`div`,{ref:y,...d,id:_,inert:E,"data-slot":D,"data-state":O,className:k,children:s}),a[16]=s,a[17]=y,a[18]=_,a[19]=d,a[20]=E,a[21]=D,a[22]=O,a[23]=k,a[24]=A):A=a[24],A},Body:e=>{let t=o(14),i,a,s,c;t[0]===e?(i=t[1],a=t[2],s=t[3],c=t[4]):({"data-slot":a,className:i,ref:c,...s}=e,t[0]=e,t[1]=i,t[2]=a,t[3]=s,t[4]=c);let l;t[5]===a?l=t[6]:(l=r(a,`accordion-body`),t[5]=a,t[6]=l);let u;t[7]===i?u=t[8]:(u=n(`pt-1 pb-4`,i),t[7]=i,t[8]=u);let d;return t[9]!==s||t[10]!==c||t[11]!==l||t[12]!==u?(d=/* @__PURE__ */ h(`div`,{ref:c,...s,"data-slot":l,className:u}),t[9]=s,t[10]=c,t[11]=l,t[12]=u,t[13]=d):d=t[13],d}};export{k as Accordion};
|
package/dist/agent.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngrok/mantle",
|
|
3
|
-
"version": "0.90.
|
|
3
|
+
"version": "0.90.4",
|
|
4
4
|
"origin": "https://mantle.ngrok.com",
|
|
5
5
|
"endpoints": {
|
|
6
6
|
"docs": "https://mantle.ngrok.com/",
|
|
@@ -472,7 +472,7 @@
|
|
|
472
472
|
"summary": "Tables purposefully designed for dynamic, application data with features like sorting, filtering, and pagination.",
|
|
473
473
|
"jsdoc": "Use `DataTable` for INTERACTIVE tabular data — sorting, filtering, pagination, row selection, and server-side or client-side data.",
|
|
474
474
|
"examples": [
|
|
475
|
-
"Composition:\n```\nDataTable.Root\n├── DataTable.Head\n│ └── DataTable.Row\n│ ├── DataTable.ExpandHeader\n│ ├── DataTable.Header\n│ │ └── DataTable.HeaderSortButton\n│ └── DataTable.ActionHeader\n└── DataTable.Body\n ├── DataTable.Row\n │ ├── DataTable.
|
|
475
|
+
"Composition:\n```\nDataTable.Root\n├── DataTable.Head\n│ └── DataTable.Row\n│ ├── DataTable.ExpandHeader\n│ ├── DataTable.Header\n│ │ └── DataTable.HeaderSortButton\n│ └── DataTable.ActionHeader\n└── DataTable.Body\n ├── DataTable.Row\n │ ├── DataTable.ControlCell\n │ │ └── DataTable.RowExpandButton\n │ ├── DataTable.Cell\n │ └── DataTable.ActionCell\n ├── DataTable.ExpandedRow\n └── DataTable.EmptyRow\n```",
|
|
476
476
|
"Minimal — read-only table with a single sortable column:\n```tsx\nimport {\n DataTable,\n createColumnHelper,\n createSortedRowModel,\n rowSortingFeature,\n sortFn_alphanumeric,\n sortFn_datetime,\n sortFn_text,\n tableFeatures,\n useTable,\n} from \"@ngrok/mantle/data-table\";\n\ntype Row = { id: string; name: string };\n\n// Register only the features the table uses. Auto-sort resolves the\n// `alphanumeric`, `text`, and `datetime` comparators by name, so register those three.\nconst features = tableFeatures({\n rowSortingFeature,\n sortedRowModel: createSortedRowModel(),\n sortFns: {\n alphanumeric: sortFn_alphanumeric,\n datetime: sortFn_datetime,\n text: sortFn_text,\n },\n});\n\nconst columnHelper = createColumnHelper<typeof features, Row>();\nconst columns = columnHelper.columns([\n columnHelper.accessor(\"name\", {\n id: \"name\",\n header: (props) => (\n <DataTable.Header column={props.column}>\n <DataTable.HeaderSortButton column={props.column} sortingMode=\"alphanumeric\">\n Name\n </DataTable.HeaderSortButton>\n </DataTable.Header>\n ),\n cell: (props) => <DataTable.Cell>{props.getValue()}</DataTable.Cell>,\n }),\n]);\n\nfunction MyTable({ data }: { data: Row[] }) {\n const table = useTable({ features, data, columns });\n const rows = table.getRowModel().rows;\n\n return (\n <DataTable.Root table={table}>\n <DataTable.Head />\n <DataTable.Body>\n {rows.length > 0\n ? rows.map((row) => <DataTable.Row key={row.id} row={row} />)\n : <DataTable.EmptyRow>No results.</DataTable.EmptyRow>}\n </DataTable.Body>\n </DataTable.Root>\n );\n}\n```",
|
|
477
477
|
"Sortable, filterable, paginated, with both empty states — a global text\nfilter, the no-data vs. no-results-for-filter empty states (an `Empty`\ndropped into `DataTable.EmptyRow`), and `CursorPagination` with a page-size\ndropdown:\n```tsx\nimport {\n DataTable,\n columnFilteringFeature,\n createColumnHelper,\n createFilteredRowModel,\n createPaginatedRowModel,\n createSortedRowModel,\n globalFilteringFeature,\n rowPaginationFeature,\n rowSortingFeature,\n sortFn_alphanumeric,\n sortFn_datetime,\n sortFn_text,\n tableFeatures,\n useTable,\n} from \"@ngrok/mantle/data-table\";\nimport { Button } from \"@ngrok/mantle/button\";\nimport { CursorPagination } from \"@ngrok/mantle/pagination\";\nimport { Empty } from \"@ngrok/mantle/empty\";\nimport { Input } from \"@ngrok/mantle/input\";\nimport { MagnifyingGlassIcon } from \"@phosphor-icons/react/MagnifyingGlass\";\nimport { TrayIcon } from \"@phosphor-icons/react/Tray\";\nimport { useState } from \"react\";\n\ntype Payment = { id: string; amount: number; status: \"pending\" | \"succeeded\" | \"failed\"; email: string };\n\n// The table's initial page size. It must be one of PageSizeSelect's pageSizes\n// (default 5 | 10 | 20 | 50 | 100).\nconst DEFAULT_PAGE_SIZE = 10;\n\n// `globalFilteringFeature` builds on `columnFilteringFeature`, so register both.\nconst features = tableFeatures({\n columnFilteringFeature,\n globalFilteringFeature,\n rowPaginationFeature,\n rowSortingFeature,\n filteredRowModel: createFilteredRowModel(),\n paginatedRowModel: createPaginatedRowModel(),\n sortedRowModel: createSortedRowModel(),\n sortFns: {\n alphanumeric: sortFn_alphanumeric,\n datetime: sortFn_datetime,\n text: sortFn_text,\n },\n});\n\nconst columnHelper = createColumnHelper<typeof features, Payment>();\nconst columns = columnHelper.columns([\n columnHelper.accessor(\"status\", {\n id: \"status\",\n header: (props) => (\n <DataTable.Header column={props.column}>\n <DataTable.HeaderSortButton column={props.column} sortingMode=\"alphanumeric\">\n Status\n </DataTable.HeaderSortButton>\n </DataTable.Header>\n ),\n cell: (props) => <DataTable.Cell>{props.getValue()}</DataTable.Cell>,\n }),\n columnHelper.accessor(\"email\", {\n id: \"email\",\n header: (props) => (\n <DataTable.Header column={props.column}>\n <DataTable.HeaderSortButton column={props.column} sortingMode=\"alphanumeric\">\n Email\n </DataTable.HeaderSortButton>\n </DataTable.Header>\n ),\n cell: (props) => <DataTable.Cell>{props.getValue()}</DataTable.Cell>,\n }),\n columnHelper.accessor(\"amount\", {\n id: \"amount\",\n header: (props) => (\n <DataTable.Header className=\"text-right\">\n <DataTable.HeaderSortButton\n column={props.column}\n sortingMode=\"alphanumeric\"\n className=\"justify-end\"\n iconPlacement=\"start\"\n >\n Amount\n </DataTable.HeaderSortButton>\n </DataTable.Header>\n ),\n cell: (props) => (\n <DataTable.Cell className=\"text-right tabular-nums\">\n {new Intl.NumberFormat(\"en-US\", { style: \"currency\", currency: \"USD\" }).format(props.getValue())}\n </DataTable.Cell>\n ),\n }),\n]);\n\nfunction PaymentsTable({ data }: { data: Payment[] }) {\n const [globalFilter, setGlobalFilter] = useState(\"\");\n\n const table = useTable({\n features,\n data,\n columns,\n state: { globalFilter },\n onGlobalFilterChange: setGlobalFilter,\n initialState: { pagination: { pageIndex: 0, pageSize: DEFAULT_PAGE_SIZE } },\n });\n const rows = table.getRowModel().rows;\n const isFiltered = globalFilter.trim() !== \"\";\n\n return (\n <div className=\"space-y-4\">\n <Input\n placeholder=\"Filter payments…\"\n value={globalFilter}\n onChange={(event) => setGlobalFilter(event.target.value)}\n />\n <DataTable.Root table={table}>\n <DataTable.Head />\n <DataTable.Body>\n {rows.length > 0 ? (\n rows.map((row) => <DataTable.Row key={row.id} row={row} />)\n ) : isFiltered ? (\n // No results for the active filter — give the user a way out.\n <DataTable.EmptyRow>\n <Empty.Root>\n <Empty.Icon svg={<MagnifyingGlassIcon />} />\n <Empty.Title>No payments match your filter</Empty.Title>\n <Empty.Description>\n <p>Try a different search, or clear the filter to see everything.</p>\n </Empty.Description>\n <Empty.Actions>\n <Button\n type=\"button\"\n appearance=\"outlined\"\n intent=\"neutral\"\n onClick={() => setGlobalFilter(\"\")}\n >\n Clear filters\n </Button>\n </Empty.Actions>\n </Empty.Root>\n </DataTable.EmptyRow>\n ) : (\n // No data yet — informational, optionally a primary \"create\" action.\n <DataTable.EmptyRow>\n <Empty.Root>\n <Empty.Icon svg={<TrayIcon />} />\n <Empty.Title>No payments yet</Empty.Title>\n <Empty.Description>\n <p>Payments you receive will appear here.</p>\n </Empty.Description>\n </Empty.Root>\n </DataTable.EmptyRow>\n )}\n </DataTable.Body>\n </DataTable.Root>\n <CursorPagination.Root\n className=\"flex justify-end\"\n pageSize={table.state.pagination.pageSize}\n onChangePageSize={(size) => {\n table.setPageSize(size);\n table.setPageIndex(0); // reset to the first page when the size changes\n }}\n >\n <CursorPagination.PageSizeSelect />\n <CursorPagination.Buttons\n hasPreviousPage={table.getCanPreviousPage()}\n hasNextPage={table.getCanNextPage()}\n onPreviousPage={() => table.previousPage()}\n onNextPage={() => table.nextPage()}\n />\n </CursorPagination.Root>\n </div>\n );\n}\n```",
|
|
478
478
|
"Row action column — a sticky right-edge cell with a dropdown menu of actions.\nThe cell stops its own clicks, so the menu opens without a clickable row\nnavigating:\n```tsx\nimport { DataTable, createColumnHelper } from \"@ngrok/mantle/data-table\";\nimport { DropdownMenu } from \"@ngrok/mantle/dropdown-menu\";\nimport { IconButton } from \"@ngrok/mantle/button\";\nimport { DotsThreeVerticalIcon } from \"@phosphor-icons/react/DotsThreeVertical\";\n\nconst columnHelper = createColumnHelper<typeof features, Payment>();\n\nconst columns = columnHelper.columns([\n // …other columns…\n columnHelper.display({\n id: \"actions\",\n header: () => <DataTable.ActionHeader />,\n cell: (props) => (\n <DataTable.ActionCell>\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <IconButton type=\"button\" appearance=\"outlined\" intent=\"neutral\" label=\"Actions\" icon={<DotsThreeVerticalIcon />} />\n </DropdownMenu.Trigger>\n <DropdownMenu.Content align=\"end\">\n <DropdownMenu.Item onSelect={() => copy(props.row.original.id)}>\n Copy ID\n </DropdownMenu.Item>\n <DropdownMenu.Item onSelect={() => refund(props.row.original.id)}>\n Refund\n </DropdownMenu.Item>\n </DropdownMenu.Content>\n </DropdownMenu.Root>\n </DataTable.ActionCell>\n ),\n }),\n]);\n```",
|
package/dist/app-layout.d.ts
CHANGED
|
@@ -736,7 +736,9 @@ type AppLayoutSidePanelProps = Omit<ComponentProps<"aside">, "id"> & WithDataSlo
|
|
|
736
736
|
* turns the panel around. `motion-reduce:transition-none` turns the slide into
|
|
737
737
|
* a cut. `not-data-hydrated:transition-none` holds the transition until one
|
|
738
738
|
* frame after hydration, so a state the client corrects after the server
|
|
739
|
-
* render snaps instead of sliding on page load.
|
|
739
|
+
* render snaps instead of sliding on page load. When a close ends, the
|
|
740
|
+
* transition stays off until the next open, so a closed panel snaps when the
|
|
741
|
+
* viewport crosses `mobileBreakpoint` or the rail changes. The `transition-*` and
|
|
740
742
|
* `duration-*` utilities are bare, so a merged `transition-none` or
|
|
741
743
|
* `duration-*` replaces them through tailwind-merge.
|
|
742
744
|
*
|
package/dist/app-layout.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"./slot-DdYN1L1C.js";import{t as i}from"./button-Bkl_QYpp.js";import{r as a}from"./alert-DO00UiQe.js";import{u as o}from"./primitive-AGoxSJBI.js";import{n as s,r as c,t as l}from"./use-swipe-to-dismiss-Cj-AayFd.js";import{t as u}from"./use-is-hydrated-after-paint-r9Cl2mGp.js";import{t as d}from"./use-matches-media-query-m860lols.js";import{t as f}from"./main-CC1L9IsH.js";import{t as p}from"./tooltip-NhYXqStK.js";import{n as m}from"./cookie-ca4g5CKp.js";import{c as h}from"react/compiler-runtime";import{createContext as g,useContext as _,useEffect as v,useId as y,useLayoutEffect as b,useRef as x,useState as S}from"react";import C from"tiny-invariant";import{jsx as w,jsxs as T}from"react/jsx-runtime";import{SidebarSimpleIcon as E}from"@phosphor-icons/react/SidebarSimple";const D=e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===c?d=i[7]:(d=n(c,`app-layout`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=t(`group/app-layout bg-base relative isolate flex h-full w-full flex-col`,`overflow-clip`,s),i[8]=s,i[9]=f);let p;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ w(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},O=e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===c?d=i[7]:(d=n(c,`app-layout-notice`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=t(`flex w-full shrink-0 flex-col`,s),i[8]=s,i[9]=f);let p;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ w(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},k=e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===c?d=i[7]:(d=n(c,`app-layout-workspace`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=t(`flex min-h-0 flex-1`,`min-w-0`,`relative`,`@container/app-layout-workspace`,`mx-auto w-full max-w-(--app-layout-max-width,128rem)`,s),i[8]=s,i[9]=f);let p;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ w(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},A=e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===c?d=i[7]:(d=n(c,`app-layout-content`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=t(`bg-card border-card-muted relative flex min-w-0 flex-1 flex-col rounded-xl border shadow-sm`,`m-(--app-layout-card-gutter,0.5rem)`,`overflow-clip`,s),i[8]=s,i[9]=f);let p;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ w(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},j=`h-14 group-has-data-[slot~=sidebar-header]/app-layout:h-[calc(var(--sidebar-header-height,4.5rem)-2*var(--app-layout-card-gutter,0.5rem)-2px)]`,M=e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===c?d=i[7]:(d=n(c,`app-layout-header`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=t(`border-card-muted flex shrink-0 items-center gap-2 border-b px-4`,j,s),i[8]=s,i[9]=f);let p;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ w(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},N=e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===c?d=i[7]:(d=n(c,`app-layout-header-start`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=t(`flex shrink-0 items-center gap-2`,s),i[8]=s,i[9]=f);let p;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ w(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},P=e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===c?d=i[7]:(d=n(c,`app-layout-header-content`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=t(`flex min-w-0 flex-1 items-center gap-2`,s),i[8]=s,i[9]=f);let p;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ w(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},F=e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===c?d=i[7]:(d=n(c,`app-layout-header-actions`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=t(`ml-auto flex shrink-0 items-center gap-2`,s),i[8]=s,i[9]=f);let p;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ w(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},I=e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:f,d;i[6]===c?d=i[7]:(d=n(c,`app-layout-body`),i[6]=c,i[7]=d);let p;i[8]===s?p=i[9]:(p=t(`scrollbar relative min-h-0 w-full flex-1 overflow-y-auto overscroll-none`,s),i[8]=s,i[9]=p);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==p?(m=/* @__PURE__ */ w(u,{"data-slot":d,className:p,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=p,i[15]=m):m=i[15],m},ee={sm:`sm:@min-side-panel-lane/app-layout-workspace:data-state-closed:basis-0 sm:[[data-slot~=app-layout-workspace]:not(:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed])))_&]:@min-side-panel-lane-icon-rail/app-layout-workspace:data-state-closed:basis-0 max-sm:absolute max-sm:inset-y-(--app-layout-card-gutter,0.5rem) max-sm:left-(--app-layout-card-gutter,0.5rem) max-sm:right-(--app-layout-card-gutter,0.5rem) max-sm:z-20 max-sm:my-0 max-sm:rounded-xl max-sm:shadow-lg max-sm:[--_side-panel-content-width:100%] max-sm:[--_side-panel-content-inset:0px] max-sm:data-state-closed:translate-x-[calc(100%+var(--app-layout-card-gutter,0.5rem))] max-sm:data-state-closed:invisible`,md:`md:@min-side-panel-lane/app-layout-workspace:data-state-closed:basis-0 md:[[data-slot~=app-layout-workspace]:not(:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed])))_&]:@min-side-panel-lane-icon-rail/app-layout-workspace:data-state-closed:basis-0 max-md:absolute max-md:inset-y-(--app-layout-card-gutter,0.5rem) max-md:right-(--app-layout-card-gutter,0.5rem) max-md:z-20 max-md:my-0 max-md:w-[min(24rem,calc(100cqw-5rem))] max-md:rounded-xl max-md:shadow-lg max-md:[--_side-panel-content-width:100%] max-md:[--_side-panel-content-inset:0px] max-md:data-state-closed:translate-x-[calc(100%+var(--app-layout-card-gutter,0.5rem))] max-md:data-state-closed:invisible max-sm:left-(--app-layout-card-gutter,0.5rem) max-sm:w-auto`,lg:`lg:@min-side-panel-lane/app-layout-workspace:data-state-closed:basis-0 lg:[[data-slot~=app-layout-workspace]:not(:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed])))_&]:@min-side-panel-lane-icon-rail/app-layout-workspace:data-state-closed:basis-0 max-lg:absolute max-lg:inset-y-(--app-layout-card-gutter,0.5rem) max-lg:right-(--app-layout-card-gutter,0.5rem) max-lg:z-20 max-lg:my-0 max-lg:w-[min(24rem,calc(100cqw-5rem))] max-lg:rounded-xl max-lg:shadow-lg max-lg:[--_side-panel-content-width:100%] max-lg:[--_side-panel-content-inset:0px] max-lg:data-state-closed:translate-x-[calc(100%+var(--app-layout-card-gutter,0.5rem))] max-lg:data-state-closed:invisible max-md:left-(--app-layout-card-gutter,0.5rem) max-md:w-auto`},te={sm:`sm:@max-side-panel-lane-icon-rail/app-layout-workspace:w-[min(24rem,calc(100cqw-5rem))] sm:[[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:w-[min(24rem,calc(100cqw-5rem))]`,md:`sm:@max-side-panel-lane-icon-rail/app-layout-workspace:w-[min(24rem,calc(100cqw-5rem))] sm:[[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:w-[min(24rem,calc(100cqw-5rem))]`,lg:`md:@max-side-panel-lane-icon-rail/app-layout-workspace:w-[min(24rem,calc(100cqw-5rem))] md:[[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:w-[min(24rem,calc(100cqw-5rem))]`},ne={sm:`(width < 40rem)`,md:`(width < 40rem)`,lg:`(width < 48rem)`};function L(e){return e!=null&&getComputedStyle(e).position===`absolute`}const R=g(null);function z(){let e=_(R);return C(e,`useSidePanel must be used within AppLayout.SidePanelRoot.`),e.state}function B(e){let t=_(R);return C(t,`AppLayout.${e} must be rendered inside AppLayout.SidePanelRoot.`),t}const V=e=>{let t=h(19),{children:n,defaultOpen:r,onOpenChange:i,open:o}=e,s=r!==void 0&&r,c=y(),l=o!=null,[u,d]=S(s),f=l?o:u,p=x(i),m;t[0]===i?m=t[1]:(m=()=>{p.current=i},t[0]=i,t[1]=m),b(m);let g=x(null),_=x(null),v;t[2]===l?v=t[3]:(v=e=>{l||d(e),p.current?.(e)},t[2]=l,t[3]=v);let C=v,T;t[4]!==f||t[5]!==C?(T=()=>{C(!f)},t[4]=f,t[5]=C,t[6]=T):T=t[6];let E=T,D,O;t[7]!==f||t[8]!==c?(D=()=>{if(f)return;let e=g.current;if(g.current=null,e==null)return;let t=document.getElementById(c),n=document.activeElement,r=t!=null&&t.contains(n),i=n===document.body;if(!r&&!i)return;let o=document.querySelectorAll(`[aria-controls="${c}"]`);for(let e of o)if(!(t!=null&&t.contains(e)||!a(e))&&(e.focus(),document.activeElement===e))return},O=[f,c],t[7]=f,t[8]=c,t[9]=D,t[10]=O):(D=t[9],O=t[10]),b(D,O);let k;t[11]!==f||t[12]!==c||t[13]!==C||t[14]!==E?(k={lastFocusedInsideRef:g,panelRef:_,state:{open:f,panelId:c,setOpen:C,toggle:E}},t[11]=f,t[12]=c,t[13]=C,t[14]=E,t[15]=k):k=t[15];let A=k,j;return t[16]!==n||t[17]!==A?(j=/* @__PURE__ */ w(R.Provider,{value:A,children:n}),t[16]=n,t[17]=A,t[18]=j):j=t[18],j},H=r=>{let i=h(48),a,l,f,p,m,g,_,y,b;i[0]===r?(a=i[1],l=i[2],f=i[3],p=i[4],m=i[5],g=i[6],_=i[7],y=i[8],b=i[9]):({children:a,className:l,"data-slot":f,mobileBreakpoint:b,onBlur:p,onFocus:m,onKeyDown:g,ref:y,..._}=r,i[0]=r,i[1]=a,i[2]=l,i[3]=f,i[4]=p,i[5]=m,i[6]=g,i[7]=_,i[8]=y,i[9]=b);let S=b===void 0?`lg`:b,{lastFocusedInsideRef:C,panelRef:T,state:E}=B(`SidePanel`),{open:D,panelId:O,setOpen:k}=E,A=u(),j=e(y,T),M=d(ne[S]),N=D&&M,P;i[10]===N?P=i[11]:(P={active:N},i[10]=N,i[11]=P),s(T,P);let F;i[12]===N?F=i[13]:(F={active:N},i[12]=N,i[13]=F),c(T,F);let I=x(!1),R,z;i[14]===T?(R=i[15],z=i[16]):(R=()=>{let e=T.current;if(e==null)return;let t=t=>{t.key===`Escape`&&(I.current=o(e,t.target))};return document.addEventListener(`keydown`,t,!0),()=>{document.removeEventListener(`keydown`,t,!0)}},z=[T],i[14]=T,i[15]=R,i[16]=z),v(R,z);let V;i[17]===f?V=i[18]:(V=n(f,`app-layout-side-panel`),i[17]=f,i[18]=V);let H=ee[S],U=te[S],W;i[19]!==l||i[20]!==H||i[21]!==U?(W=t(`relative min-w-0`,`isolate`,`overflow-x-clip`,`[--_side-panel-content-width:var(--app-layout-side-panel-width,clamp(21rem,24cqw,27rem))] [--_side-panel-content-inset:var(--app-layout-card-gutter,0.5rem)] [--_side-panel-box-width:calc(var(--app-layout-side-panel-width,clamp(21rem,24cqw,27rem))+var(--app-layout-card-gutter,0.5rem))]`,`grow-0 shrink-0 basis-(--_side-panel-box-width)`,`my-(--app-layout-card-gutter,0.5rem) mr-0 ml-0`,`transition-[flex-basis,translate,visibility] duration-200 ease-out-strong motion-reduce:transition-none not-data-hydrated:transition-none`,`data-state-closed:pointer-events-none`,H,`@max-side-panel-lane-icon-rail/app-layout-workspace:absolute @max-side-panel-lane-icon-rail/app-layout-workspace:inset-y-(--app-layout-card-gutter,0.5rem) @max-side-panel-lane-icon-rail/app-layout-workspace:right-(--app-layout-card-gutter,0.5rem) @max-side-panel-lane-icon-rail/app-layout-workspace:z-20 @max-side-panel-lane-icon-rail/app-layout-workspace:my-0 @max-side-panel-lane-icon-rail/app-layout-workspace:rounded-xl @max-side-panel-lane-icon-rail/app-layout-workspace:shadow-lg @max-side-panel-lane-icon-rail/app-layout-workspace:[--_side-panel-content-width:100%] @max-side-panel-lane-icon-rail/app-layout-workspace:[--_side-panel-content-inset:0px] @max-side-panel-lane-icon-rail/app-layout-workspace:data-state-closed:translate-x-[calc(100%+var(--app-layout-card-gutter,0.5rem))] @max-side-panel-lane-icon-rail/app-layout-workspace:data-state-closed:invisible`,`[[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:absolute [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:inset-y-(--app-layout-card-gutter,0.5rem) [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:right-(--app-layout-card-gutter,0.5rem) [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:z-20 [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:my-0 [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:rounded-xl [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:shadow-lg [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:[--_side-panel-content-width:100%] [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:[--_side-panel-content-inset:0px] [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:data-state-closed:translate-x-[calc(100%+var(--app-layout-card-gutter,0.5rem))] [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:data-state-closed:invisible`,U,l),i[19]=l,i[20]=H,i[21]=U,i[22]=W):W=i[22];let G;i[23]!==C||i[24]!==m?(G=e=>{m?.(e),C.current=e.target},i[23]=C,i[24]=m,i[25]=G):G=i[25];let K;i[26]!==C||i[27]!==p?(K=e=>{p?.(e),e.relatedTarget!=null&&!e.currentTarget.contains(e.relatedTarget)&&(C.current=null)},i[26]=C,i[27]=p,i[28]=K):K=i[28];let q;i[29]!==g||i[30]!==k?(q=e=>{g?.(e),!(e.defaultPrevented||e.key!==`Escape`)&&L(e.currentTarget)&&(I.current?I.current=!1:(e.preventDefault(),k(!1)))},i[29]=g,i[30]=k,i[31]=q):q=i[31];let J=D?`open`:`closed`,Y=A?``:void 0,X=!D,Z;i[32]===Symbol.for(`react.memo_cache_sentinel`)?(Z=t(`bg-card border-card-muted absolute inset-y-0 flex flex-col rounded-xl border shadow-sm`,`right-(--_side-panel-content-inset) w-(--_side-panel-content-width)`,`overflow-clip`),i[32]=Z):Z=i[32];let Q;i[33]===a?Q=i[34]:(Q=/* @__PURE__ */ w(`div`,{className:Z,children:a}),i[33]=a,i[34]=Q);let $;return i[35]!==j||i[36]!==O||i[37]!==_||i[38]!==W||i[39]!==G||i[40]!==K||i[41]!==q||i[42]!==J||i[43]!==Y||i[44]!==X||i[45]!==Q||i[46]!==V?($=/* @__PURE__ */ w(`aside`,{ref:j,"data-slot":V,className:W,onFocus:G,onBlur:K,onKeyDown:q,..._,id:O,"data-state":J,"data-hydrated":Y,inert:X,children:Q}),i[35]=j,i[36]=O,i[37]=_,i[38]=W,i[39]=G,i[40]=K,i[41]=q,i[42]=J,i[43]=Y,i[44]=X,i[45]=Q,i[46]=V,i[47]=$):$=i[47],$},U=/* @__PURE__ */ w(E,{mirrored:!0}),W={Root:D,Notice:O,Workspace:k,Content:A,Header:M,HeaderStart:N,HeaderContent:P,HeaderActions:F,Body:I,SidePanelRoot:V,SidePanel:H,SidePanelTrigger:e=>{let t=h(31),r,a,o,s,c,l,u,d;t[0]===e?(r=t[1],a=t[2],o=t[3],s=t[4],c=t[5],l=t[6],u=t[7],d=t[8]):({appearance:s,"data-slot":r,icon:c,intent:l,label:u,onClick:a,size:d,...o}=e,t[0]=e,t[1]=r,t[2]=a,t[3]=o,t[4]=s,t[5]=c,t[6]=l,t[7]=u,t[8]=d);let f=s===void 0?`ghost`:s,m=c===void 0?U:c,g=l===void 0?`neutral`:l,_=u===void 0?`Toggle side panel`:u,v=d===void 0?`sm`:d,{open:y,panelId:b,toggle:x}=B(`SidePanelTrigger`).state,S;t[9]===r?S=t[10]:(S=n(r,`app-layout-side-panel-trigger`),t[9]=r,t[10]=S);let C=y?`open`:`closed`,E;t[11]!==a||t[12]!==x?(E=e=>{a?.(e),e.defaultPrevented||x()},t[11]=a,t[12]=x,t[13]=E):E=t[13];let D;t[14]!==f||t[15]!==m||t[16]!==g||t[17]!==_||t[18]!==y||t[19]!==b||t[20]!==o||t[21]!==v||t[22]!==S||t[23]!==C||t[24]!==E?(D=/* @__PURE__ */ w(p.Trigger,{asChild:!0,children:/* @__PURE__ */ w(i,{appearance:f,"aria-controls":b,"aria-expanded":y,"data-slot":S,"data-state":C,icon:m,intent:g,label:_,onClick:E,size:v,...o})}),t[14]=f,t[15]=m,t[16]=g,t[17]=_,t[18]=y,t[19]=b,t[20]=o,t[21]=v,t[22]=S,t[23]=C,t[24]=E,t[25]=D):D=t[25];let O;t[26]===_?O=t[27]:(O=/* @__PURE__ */ w(p.Content,{"data-slot":`app-layout-side-panel-trigger-tooltip`,children:_}),t[26]=_,t[27]=O);let k;return t[28]!==O||t[29]!==D?(k=/* @__PURE__ */ T(p.Root,{children:[D,O]}),t[28]=O,t[29]=D,t[30]=k):k=t[30],k},SidePanelHeader:i=>{let a=h(27),o,s,c,u,d,f;a[0]===i?(o=a[1],s=a[2],c=a[3],u=a[4],d=a[5],f=a[6]):({asChild:o,children:s,className:c,"data-slot":u,ref:f,...d}=i,a[0]=i,a[1]=o,a[2]=s,a[3]=c,a[4]=u,a[5]=d,a[6]=f);let p=o?r:`div`,m=_(R),g=x(null),v=e(f,g),y=m?.panelRef,b=m?.state.setOpen,S=m!=null,C;a[7]===y?.current?C=a[8]:(C=()=>L(y?.current??null)?`translate`:`flex-basis`,a[7]=y?.current,a[8]=C);let T;a[9]===b?T=a[10]:(T=()=>{b?.(!1)},a[9]=b,a[10]=T);let E;a[11]!==y||a[12]!==S||a[13]!==C||a[14]!==T?(E={target:y,active:S,property:C,onDismiss:T},a[11]=y,a[12]=S,a[13]=C,a[14]=T,a[15]=E):E=a[15],l(g,E);let D;a[16]===u?D=a[17]:(D=n(u,`app-layout-side-panel-header`),a[16]=u,a[17]=D);let O;a[18]===c?O=a[19]:(O=t(`border-card-muted flex shrink-0 items-center gap-2 border-b px-4`,`touch-pan-y`,j,c),a[18]=c,a[19]=O);let k;return a[20]!==p||a[21]!==s||a[22]!==v||a[23]!==d||a[24]!==D||a[25]!==O?(k=/* @__PURE__ */ w(p,{ref:v,"data-slot":D,className:O,...d,children:s}),a[20]=p,a[21]=s,a[22]=v,a[23]=d,a[24]=D,a[25]=O,a[26]=k):k=a[26],k},SidePanelBody:e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===c?d=i[7]:(d=n(c,`app-layout-side-panel-body`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=t(`scrollbar relative min-h-0 w-full flex-1 overflow-y-auto overscroll-none`,s),i[8]=s,i[9]=f);let p;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ w(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},SidePanelFooter:e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===c?d=i[7]:(d=n(c,`app-layout-side-panel-footer`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=t(`flex shrink-0 flex-col gap-2 px-3 pb-3`,s),i[8]=s,i[9]=f);let p;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ w(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p}},G=`mantle-side-panel-state`,K={closed:`closed`,open:`open`};function q(e){let t=m(e,G);if(t===K.open)return!0;if(t===K.closed)return!1}function J(e,t={}){let{domain:n,maxAge:r=31536e3,path:i=`/`,sameSite:a=`Lax`,secure:o=!1}=t,s=e?K.open:K.closed,c=[`${G}=${s}`,`Max-Age=${r}`,`Path=${i}`];return n!=null&&c.push(`Domain=${n}`),c.push(`SameSite=${a}`),o&&c.push(`Secure`),c.join(`; `)}export{W as AppLayout,G as SIDE_PANEL_STATE_COOKIE_NAME,q as extractSidePanelStateCookie,J as serializeSidePanelStateCookie,z as useSidePanel};
|
|
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"./slot-DdYN1L1C.js";import{t as i}from"./button-Bkl_QYpp.js";import{r as a}from"./alert-DO00UiQe.js";import{u as o}from"./primitive-AGoxSJBI.js";import{n as s,r as c,t as l}from"./use-swipe-to-dismiss-Cj-AayFd.js";import{t as u}from"./use-is-hydrated-after-paint-r9Cl2mGp.js";import{t as d}from"./use-matches-media-query-m860lols.js";import{t as f}from"./main-CC1L9IsH.js";import{t as p}from"./tooltip-NhYXqStK.js";import{n as m}from"./cookie-ca4g5CKp.js";import{c as h}from"react/compiler-runtime";import{createContext as g,useContext as _,useEffect as v,useId as y,useLayoutEffect as b,useRef as x,useState as S}from"react";import C from"tiny-invariant";import{jsx as w,jsxs as T}from"react/jsx-runtime";import{SidebarSimpleIcon as E}from"@phosphor-icons/react/SidebarSimple";const D=e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===c?d=i[7]:(d=n(c,`app-layout`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=t(`group/app-layout bg-base relative isolate flex h-full w-full flex-col`,`overflow-clip`,s),i[8]=s,i[9]=f);let p;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ w(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},O=e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===c?d=i[7]:(d=n(c,`app-layout-notice`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=t(`flex w-full shrink-0 flex-col`,s),i[8]=s,i[9]=f);let p;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ w(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},k=e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===c?d=i[7]:(d=n(c,`app-layout-workspace`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=t(`flex min-h-0 flex-1`,`min-w-0`,`relative`,`@container/app-layout-workspace`,`mx-auto w-full max-w-(--app-layout-max-width,128rem)`,s),i[8]=s,i[9]=f);let p;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ w(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},A=e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===c?d=i[7]:(d=n(c,`app-layout-content`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=t(`bg-card border-card-muted relative flex min-w-0 flex-1 flex-col rounded-xl border shadow-sm`,`m-(--app-layout-card-gutter,0.5rem)`,`overflow-clip`,s),i[8]=s,i[9]=f);let p;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ w(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},j=`h-14 group-has-data-[slot~=sidebar-header]/app-layout:h-[calc(var(--sidebar-header-height,4.5rem)-2*var(--app-layout-card-gutter,0.5rem)-2px)]`,M=e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===c?d=i[7]:(d=n(c,`app-layout-header`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=t(`border-card-muted flex shrink-0 items-center gap-2 border-b px-4`,j,s),i[8]=s,i[9]=f);let p;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ w(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},ee=e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===c?d=i[7]:(d=n(c,`app-layout-header-start`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=t(`flex shrink-0 items-center gap-2`,s),i[8]=s,i[9]=f);let p;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ w(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},N=e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===c?d=i[7]:(d=n(c,`app-layout-header-content`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=t(`flex min-w-0 flex-1 items-center gap-2`,s),i[8]=s,i[9]=f);let p;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ w(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},P=e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===c?d=i[7]:(d=n(c,`app-layout-header-actions`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=t(`ml-auto flex shrink-0 items-center gap-2`,s),i[8]=s,i[9]=f);let p;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ w(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},F=e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:f,d;i[6]===c?d=i[7]:(d=n(c,`app-layout-body`),i[6]=c,i[7]=d);let p;i[8]===s?p=i[9]:(p=t(`scrollbar relative min-h-0 w-full flex-1 overflow-y-auto overscroll-none`,s),i[8]=s,i[9]=p);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==p?(m=/* @__PURE__ */ w(u,{"data-slot":d,className:p,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=p,i[15]=m):m=i[15],m},te={sm:`sm:@min-side-panel-lane/app-layout-workspace:data-state-closed:basis-0 sm:[[data-slot~=app-layout-workspace]:not(:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed])))_&]:@min-side-panel-lane-icon-rail/app-layout-workspace:data-state-closed:basis-0 max-sm:absolute max-sm:inset-y-(--app-layout-card-gutter,0.5rem) max-sm:left-(--app-layout-card-gutter,0.5rem) max-sm:right-(--app-layout-card-gutter,0.5rem) max-sm:z-20 max-sm:my-0 max-sm:rounded-xl max-sm:shadow-lg max-sm:[--_side-panel-content-width:100%] max-sm:[--_side-panel-content-inset:0px] max-sm:data-state-closed:translate-x-[calc(100%+var(--app-layout-card-gutter,0.5rem))] max-sm:data-state-closed:invisible`,md:`md:@min-side-panel-lane/app-layout-workspace:data-state-closed:basis-0 md:[[data-slot~=app-layout-workspace]:not(:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed])))_&]:@min-side-panel-lane-icon-rail/app-layout-workspace:data-state-closed:basis-0 max-md:absolute max-md:inset-y-(--app-layout-card-gutter,0.5rem) max-md:right-(--app-layout-card-gutter,0.5rem) max-md:z-20 max-md:my-0 max-md:w-[min(24rem,calc(100cqw-5rem))] max-md:rounded-xl max-md:shadow-lg max-md:[--_side-panel-content-width:100%] max-md:[--_side-panel-content-inset:0px] max-md:data-state-closed:translate-x-[calc(100%+var(--app-layout-card-gutter,0.5rem))] max-md:data-state-closed:invisible max-sm:left-(--app-layout-card-gutter,0.5rem) max-sm:w-auto`,lg:`lg:@min-side-panel-lane/app-layout-workspace:data-state-closed:basis-0 lg:[[data-slot~=app-layout-workspace]:not(:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed])))_&]:@min-side-panel-lane-icon-rail/app-layout-workspace:data-state-closed:basis-0 max-lg:absolute max-lg:inset-y-(--app-layout-card-gutter,0.5rem) max-lg:right-(--app-layout-card-gutter,0.5rem) max-lg:z-20 max-lg:my-0 max-lg:w-[min(24rem,calc(100cqw-5rem))] max-lg:rounded-xl max-lg:shadow-lg max-lg:[--_side-panel-content-width:100%] max-lg:[--_side-panel-content-inset:0px] max-lg:data-state-closed:translate-x-[calc(100%+var(--app-layout-card-gutter,0.5rem))] max-lg:data-state-closed:invisible max-md:left-(--app-layout-card-gutter,0.5rem) max-md:w-auto`},ne={sm:`sm:@max-side-panel-lane-icon-rail/app-layout-workspace:w-[min(24rem,calc(100cqw-5rem))] sm:[[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:w-[min(24rem,calc(100cqw-5rem))]`,md:`sm:@max-side-panel-lane-icon-rail/app-layout-workspace:w-[min(24rem,calc(100cqw-5rem))] sm:[[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:w-[min(24rem,calc(100cqw-5rem))]`,lg:`md:@max-side-panel-lane-icon-rail/app-layout-workspace:w-[min(24rem,calc(100cqw-5rem))] md:[[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:w-[min(24rem,calc(100cqw-5rem))]`},re={sm:`(width < 40rem)`,md:`(width < 40rem)`,lg:`(width < 48rem)`};function ie(e){return e!=null&&getComputedStyle(e).position===`absolute`}function ae(e){let t=getComputedStyle(e),n=e=>e.split(`,`).map(e=>Number.parseFloat(e)||0),r=n(t.transitionDuration),i=n(t.transitionDelay),a=t.transitionProperty.split(`,`).map((e,t)=>(r[t%r.length]??0)+(i[t%i.length]??0));return Math.max(0,...a)*1e3}const I=g(null);function L(){let e=_(I);return C(e,`useSidePanel must be used within AppLayout.SidePanelRoot.`),e.state}function oe(e){let t=_(I);return C(t,`AppLayout.${e} must be rendered inside AppLayout.SidePanelRoot.`),t}const R=e=>{let t=h(19),{children:n,defaultOpen:r,onOpenChange:i,open:o}=e,s=r!==void 0&&r,c=y(),l=o!=null,[u,d]=S(s),f=l?o:u,p=x(i),m;t[0]===i?m=t[1]:(m=()=>{p.current=i},t[0]=i,t[1]=m),b(m);let g=x(null),_=x(null),v;t[2]===l?v=t[3]:(v=e=>{l||d(e),p.current?.(e)},t[2]=l,t[3]=v);let C=v,T;t[4]!==f||t[5]!==C?(T=()=>{C(!f)},t[4]=f,t[5]=C,t[6]=T):T=t[6];let E=T,D,O;t[7]!==f||t[8]!==c?(D=()=>{if(f)return;let e=g.current;if(g.current=null,e==null)return;let t=document.getElementById(c),n=document.activeElement,r=t!=null&&t.contains(n),i=n===document.body;if(!r&&!i)return;let o=document.querySelectorAll(`[aria-controls="${c}"]`);for(let e of o)if(!(t!=null&&t.contains(e)||!a(e))&&(e.focus(),document.activeElement===e))return},O=[f,c],t[7]=f,t[8]=c,t[9]=D,t[10]=O):(D=t[9],O=t[10]),b(D,O);let k;t[11]!==f||t[12]!==c||t[13]!==C||t[14]!==E?(k={lastFocusedInsideRef:g,panelRef:_,state:{open:f,panelId:c,setOpen:C,toggle:E}},t[11]=f,t[12]=c,t[13]=C,t[14]=E,t[15]=k):k=t[15];let A=k,j;return t[16]!==n||t[17]!==A?(j=/* @__PURE__ */ w(I.Provider,{value:A,children:n}),t[16]=n,t[17]=A,t[18]=j):j=t[18],j},z=r=>{let i=h(53),a,l,f,p,m,g,_,y,b;i[0]===r?(a=i[1],l=i[2],f=i[3],p=i[4],m=i[5],g=i[6],_=i[7],y=i[8],b=i[9]):({children:a,className:l,"data-slot":f,mobileBreakpoint:b,onBlur:p,onFocus:m,onKeyDown:g,ref:y,..._}=r,i[0]=r,i[1]=a,i[2]=l,i[3]=f,i[4]=p,i[5]=m,i[6]=g,i[7]=_,i[8]=y,i[9]=b);let C=b===void 0?`lg`:b,{lastFocusedInsideRef:T,panelRef:E,state:D}=oe(`SidePanel`),{open:O,panelId:k,setOpen:A}=D,j=u(),M=e(y,E),[ee,N]=S(!O),P,F;i[10]!==O||i[11]!==E?(P=()=>{if(O){N(!1);return}let e=E.current;if(e==null)return;let t=setTimeout(()=>N(!0),ae(e));return()=>clearTimeout(t)},F=[O,E],i[10]=O,i[11]=E,i[12]=P,i[13]=F):(P=i[12],F=i[13]),v(P,F);let I=d(re[C]),L=O&&I,R;i[14]===L?R=i[15]:(R={active:L},i[14]=L,i[15]=R),s(E,R);let z;i[16]===L?z=i[17]:(z={active:L},i[16]=L,i[17]=z),c(E,z);let B=x(!1),V,H;i[18]===E?(V=i[19],H=i[20]):(V=()=>{let e=E.current;if(e==null)return;let t=t=>{t.key===`Escape`&&(B.current=o(e,t.target))};return document.addEventListener(`keydown`,t,!0),()=>{document.removeEventListener(`keydown`,t,!0)}},H=[E],i[18]=E,i[19]=V,i[20]=H),v(V,H);let U;i[21]===f?U=i[22]:(U=n(f,`app-layout-side-panel`),i[21]=f,i[22]=U);let W=!O&&ee&&`transition-none`,G=te[C],K=ne[C],q;i[23]!==l||i[24]!==W||i[25]!==G||i[26]!==K?(q=t(`relative min-w-0`,`isolate`,`overflow-x-clip`,`[--_side-panel-content-width:var(--app-layout-side-panel-width,clamp(21rem,24cqw,27rem))] [--_side-panel-content-inset:var(--app-layout-card-gutter,0.5rem)] [--_side-panel-box-width:calc(var(--app-layout-side-panel-width,clamp(21rem,24cqw,27rem))+var(--app-layout-card-gutter,0.5rem))]`,`grow-0 shrink-0 basis-(--_side-panel-box-width)`,`my-(--app-layout-card-gutter,0.5rem) mr-0 ml-0`,`transition-[flex-basis,translate,visibility] duration-200 ease-out-strong motion-reduce:transition-none not-data-hydrated:transition-none`,W,`data-state-closed:pointer-events-none`,G,`@max-side-panel-lane-icon-rail/app-layout-workspace:absolute @max-side-panel-lane-icon-rail/app-layout-workspace:inset-y-(--app-layout-card-gutter,0.5rem) @max-side-panel-lane-icon-rail/app-layout-workspace:right-(--app-layout-card-gutter,0.5rem) @max-side-panel-lane-icon-rail/app-layout-workspace:z-20 @max-side-panel-lane-icon-rail/app-layout-workspace:my-0 @max-side-panel-lane-icon-rail/app-layout-workspace:rounded-xl @max-side-panel-lane-icon-rail/app-layout-workspace:shadow-lg @max-side-panel-lane-icon-rail/app-layout-workspace:[--_side-panel-content-width:100%] @max-side-panel-lane-icon-rail/app-layout-workspace:[--_side-panel-content-inset:0px] @max-side-panel-lane-icon-rail/app-layout-workspace:data-state-closed:translate-x-[calc(100%+var(--app-layout-card-gutter,0.5rem))] @max-side-panel-lane-icon-rail/app-layout-workspace:data-state-closed:invisible`,`[[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:absolute [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:inset-y-(--app-layout-card-gutter,0.5rem) [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:right-(--app-layout-card-gutter,0.5rem) [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:z-20 [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:my-0 [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:rounded-xl [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:shadow-lg [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:[--_side-panel-content-width:100%] [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:[--_side-panel-content-inset:0px] [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:data-state-closed:translate-x-[calc(100%+var(--app-layout-card-gutter,0.5rem))] [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:data-state-closed:invisible`,K,l),i[23]=l,i[24]=W,i[25]=G,i[26]=K,i[27]=q):q=i[27];let J;i[28]!==T||i[29]!==m?(J=e=>{m?.(e),T.current=e.target},i[28]=T,i[29]=m,i[30]=J):J=i[30];let Y;i[31]!==T||i[32]!==p?(Y=e=>{p?.(e),e.relatedTarget!=null&&!e.currentTarget.contains(e.relatedTarget)&&(T.current=null)},i[31]=T,i[32]=p,i[33]=Y):Y=i[33];let X;i[34]!==g||i[35]!==A?(X=e=>{g?.(e),!(e.defaultPrevented||e.key!==`Escape`)&&ie(e.currentTarget)&&(B.current?B.current=!1:(e.preventDefault(),A(!1)))},i[34]=g,i[35]=A,i[36]=X):X=i[36];let se=O?`open`:`closed`,ce=j?``:void 0,le=!O,Z;i[37]===Symbol.for(`react.memo_cache_sentinel`)?(Z=t(`bg-card border-card-muted absolute inset-y-0 flex flex-col rounded-xl border shadow-sm`,`right-(--_side-panel-content-inset) w-(--_side-panel-content-width)`,`overflow-clip`),i[37]=Z):Z=i[37];let Q;i[38]===a?Q=i[39]:(Q=/* @__PURE__ */ w(`div`,{className:Z,children:a}),i[38]=a,i[39]=Q);let $;return i[40]!==M||i[41]!==k||i[42]!==_||i[43]!==q||i[44]!==J||i[45]!==Y||i[46]!==X||i[47]!==se||i[48]!==ce||i[49]!==le||i[50]!==Q||i[51]!==U?($=/* @__PURE__ */ w(`aside`,{ref:M,"data-slot":U,className:q,onFocus:J,onBlur:Y,onKeyDown:X,..._,id:k,"data-state":se,"data-hydrated":ce,inert:le,children:Q}),i[40]=M,i[41]=k,i[42]=_,i[43]=q,i[44]=J,i[45]=Y,i[46]=X,i[47]=se,i[48]=ce,i[49]=le,i[50]=Q,i[51]=U,i[52]=$):$=i[52],$},B=/* @__PURE__ */ w(E,{mirrored:!0}),V={Root:D,Notice:O,Workspace:k,Content:A,Header:M,HeaderStart:ee,HeaderContent:N,HeaderActions:P,Body:F,SidePanelRoot:R,SidePanel:z,SidePanelTrigger:e=>{let t=h(31),r,a,o,s,c,l,u,d;t[0]===e?(r=t[1],a=t[2],o=t[3],s=t[4],c=t[5],l=t[6],u=t[7],d=t[8]):({appearance:s,"data-slot":r,icon:c,intent:l,label:u,onClick:a,size:d,...o}=e,t[0]=e,t[1]=r,t[2]=a,t[3]=o,t[4]=s,t[5]=c,t[6]=l,t[7]=u,t[8]=d);let f=s===void 0?`ghost`:s,m=c===void 0?B:c,g=l===void 0?`neutral`:l,_=u===void 0?`Toggle side panel`:u,v=d===void 0?`sm`:d,{open:y,panelId:b,toggle:x}=oe(`SidePanelTrigger`).state,S;t[9]===r?S=t[10]:(S=n(r,`app-layout-side-panel-trigger`),t[9]=r,t[10]=S);let C=y?`open`:`closed`,E;t[11]!==a||t[12]!==x?(E=e=>{a?.(e),e.defaultPrevented||x()},t[11]=a,t[12]=x,t[13]=E):E=t[13];let D;t[14]!==f||t[15]!==m||t[16]!==g||t[17]!==_||t[18]!==y||t[19]!==b||t[20]!==o||t[21]!==v||t[22]!==S||t[23]!==C||t[24]!==E?(D=/* @__PURE__ */ w(p.Trigger,{asChild:!0,children:/* @__PURE__ */ w(i,{appearance:f,"aria-controls":b,"aria-expanded":y,"data-slot":S,"data-state":C,icon:m,intent:g,label:_,onClick:E,size:v,...o})}),t[14]=f,t[15]=m,t[16]=g,t[17]=_,t[18]=y,t[19]=b,t[20]=o,t[21]=v,t[22]=S,t[23]=C,t[24]=E,t[25]=D):D=t[25];let O;t[26]===_?O=t[27]:(O=/* @__PURE__ */ w(p.Content,{"data-slot":`app-layout-side-panel-trigger-tooltip`,children:_}),t[26]=_,t[27]=O);let k;return t[28]!==O||t[29]!==D?(k=/* @__PURE__ */ T(p.Root,{children:[D,O]}),t[28]=O,t[29]=D,t[30]=k):k=t[30],k},SidePanelHeader:i=>{let a=h(27),o,s,c,u,d,f;a[0]===i?(o=a[1],s=a[2],c=a[3],u=a[4],d=a[5],f=a[6]):({asChild:o,children:s,className:c,"data-slot":u,ref:f,...d}=i,a[0]=i,a[1]=o,a[2]=s,a[3]=c,a[4]=u,a[5]=d,a[6]=f);let p=o?r:`div`,m=_(I),g=x(null),v=e(f,g),y=m?.panelRef,b=m?.state.setOpen,S=m!=null,C;a[7]===y?.current?C=a[8]:(C=()=>ie(y?.current??null)?`translate`:`flex-basis`,a[7]=y?.current,a[8]=C);let T;a[9]===b?T=a[10]:(T=()=>{b?.(!1)},a[9]=b,a[10]=T);let E;a[11]!==y||a[12]!==S||a[13]!==C||a[14]!==T?(E={target:y,active:S,property:C,onDismiss:T},a[11]=y,a[12]=S,a[13]=C,a[14]=T,a[15]=E):E=a[15],l(g,E);let D;a[16]===u?D=a[17]:(D=n(u,`app-layout-side-panel-header`),a[16]=u,a[17]=D);let O;a[18]===c?O=a[19]:(O=t(`border-card-muted flex shrink-0 items-center gap-2 border-b px-4`,`touch-pan-y`,j,c),a[18]=c,a[19]=O);let k;return a[20]!==p||a[21]!==s||a[22]!==v||a[23]!==d||a[24]!==D||a[25]!==O?(k=/* @__PURE__ */ w(p,{ref:v,"data-slot":D,className:O,...d,children:s}),a[20]=p,a[21]=s,a[22]=v,a[23]=d,a[24]=D,a[25]=O,a[26]=k):k=a[26],k},SidePanelBody:e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===c?d=i[7]:(d=n(c,`app-layout-side-panel-body`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=t(`scrollbar relative min-h-0 w-full flex-1 overflow-y-auto overscroll-none`,s),i[8]=s,i[9]=f);let p;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ w(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},SidePanelFooter:e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===c?d=i[7]:(d=n(c,`app-layout-side-panel-footer`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=t(`flex shrink-0 flex-col gap-2 px-3 pb-3`,s),i[8]=s,i[9]=f);let p;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ w(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p}},H=`mantle-side-panel-state`,U={closed:`closed`,open:`open`};function W(e){let t=m(e,H);if(t===U.open)return!0;if(t===U.closed)return!1}function G(e,t={}){let{domain:n,maxAge:r=31536e3,path:i=`/`,sameSite:a=`Lax`,secure:o=!1}=t,s=e?U.open:U.closed,c=[`${H}=${s}`,`Max-Age=${r}`,`Path=${i}`];return n!=null&&c.push(`Domain=${n}`),c.push(`SameSite=${a}`),o&&c.push(`Secure`),c.join(`; `)}export{V as AppLayout,H as SIDE_PANEL_STATE_COOKIE_NAME,W as extractSidePanelStateCookie,G as serializeSidePanelStateCookie,L as useSidePanel};
|
package/dist/data-table.d.ts
CHANGED
|
@@ -9,6 +9,40 @@ export * from "@tanstack/react-table";
|
|
|
9
9
|
//#region src/components/data-table/types.d.ts
|
|
10
10
|
declare const sortDirections: readonly ["asc", "desc", "unsorted"];
|
|
11
11
|
type SortDirection = (typeof sortDirections)[number];
|
|
12
|
+
/**
|
|
13
|
+
* How wide a `DataTable` column renders. `"fit"` makes the column only as wide
|
|
14
|
+
* as its widest content, on one line, and gives the spare width to the other
|
|
15
|
+
* columns.
|
|
16
|
+
*/
|
|
17
|
+
type ColumnWidth = "fit";
|
|
18
|
+
/**
|
|
19
|
+
* The column `meta` fields that `DataTable.Header` and `DataTable.Cell` read
|
|
20
|
+
* through their `column` prop. Tables with no `columnMeta` slot get these
|
|
21
|
+
* fields from the global `ColumnMeta` interface. A table with a `columnMeta`
|
|
22
|
+
* slot must add them to the slot type, because the slot replaces the global
|
|
23
|
+
* interface.
|
|
24
|
+
*
|
|
25
|
+
* @see https://mantle.ngrok.com/components/data-display/data-table#sizing-a-column-to-its-content
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* type PaymentsColumnMeta = DataTableColumnMeta & { align?: "start" | "end" };
|
|
30
|
+
*
|
|
31
|
+
* const features = tableFeatures({
|
|
32
|
+
* columnMeta: metaHelper<PaymentsColumnMeta>(),
|
|
33
|
+
* });
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
type DataTableColumnMeta = {
|
|
37
|
+
/**
|
|
38
|
+
* How wide the column renders. When omitted, the browser shares the
|
|
39
|
+
* table's spare width across every column.
|
|
40
|
+
*/
|
|
41
|
+
width?: ColumnWidth;
|
|
42
|
+
};
|
|
43
|
+
declare module "@tanstack/react-table" {
|
|
44
|
+
interface ColumnMeta<in out TFeatures extends TableFeatures, in out TData extends RowData, TValue extends CellData = CellData> extends DataTableColumnMeta {}
|
|
45
|
+
}
|
|
12
46
|
//#endregion
|
|
13
47
|
//#region src/components/data-table/data-table.d.ts
|
|
14
48
|
/**
|
|
@@ -191,7 +225,8 @@ declare function HeaderSortButton<TFeatures extends SortableTableFeatures, TData
|
|
|
191
225
|
type DataTableHeaderProps<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData> = ComponentProps<typeof Table$1.Header> & {
|
|
192
226
|
/**
|
|
193
227
|
* The TanStack Table column this cell heads (`props.column` in `header`).
|
|
194
|
-
* When the column is sorted, the cell carries `aria-sort`.
|
|
228
|
+
* When the column is sorted, the cell carries `aria-sort`. When the
|
|
229
|
+
* column's `meta.width` is `"fit"`, the cell carries `data-column-width="fit"`.
|
|
195
230
|
*/
|
|
196
231
|
column?: Column<TFeatures, TData, TValue>;
|
|
197
232
|
} & WithDataSlot;
|
|
@@ -199,7 +234,15 @@ type DataTableHeaderProps<TFeatures extends TableFeatures, TData extends RowData
|
|
|
199
234
|
* A `<th>` optimized for header actions. Wrap each column's header content in
|
|
200
235
|
* this; for sortable columns, nest a `DataTable.HeaderSortButton` inside and
|
|
201
236
|
* pass the same `column` here, so the cell carries `aria-sort` while the column
|
|
202
|
-
* is sorted. Non-sortable columns can render plain text.
|
|
237
|
+
* is sorted. Non-sortable columns can render plain text. The `column` prop
|
|
238
|
+
* also applies the column's `meta.width`.
|
|
239
|
+
*
|
|
240
|
+
* **Data attributes:**
|
|
241
|
+
*
|
|
242
|
+
* | Data Attribute | Value | Description |
|
|
243
|
+
* | --- | --- | --- |
|
|
244
|
+
* | `data-slot` | `"data-table-header table-header"` | On the `<th>`, joined ahead of `Table.Header`'s own slot. |
|
|
245
|
+
* | `data-column-width` | `"fit"` | Present when the `column` prop's `meta.width` is `"fit"`. The header does not wrap its content, and the column shrinks to fit it. |
|
|
203
246
|
*
|
|
204
247
|
* @see https://mantle.ngrok.com/components/data-display/data-table#datatableheader
|
|
205
248
|
*
|
|
@@ -219,6 +262,40 @@ type DataTableHeaderProps<TFeatures extends TableFeatures, TData extends RowData
|
|
|
219
262
|
* ```
|
|
220
263
|
*/
|
|
221
264
|
declare function Header<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData>({ "data-slot": dataSlot, children, className, column, ...props }: DataTableHeaderProps<TFeatures, TData, TValue>): import("react").JSX.Element;
|
|
265
|
+
type DataTableCellProps<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData> = ComponentProps<typeof Table$1.Cell> & {
|
|
266
|
+
/**
|
|
267
|
+
* The TanStack Table column this cell belongs to (`props.column` in `cell`).
|
|
268
|
+
* When the column's `meta.width` is `"fit"`, the cell carries
|
|
269
|
+
* `data-column-width="fit"`.
|
|
270
|
+
*/
|
|
271
|
+
column?: Column<TFeatures, TData, TValue>;
|
|
272
|
+
} & WithDataSlot;
|
|
273
|
+
/**
|
|
274
|
+
* A `<td>` for one data cell. Wrap the output of each column's `cell`
|
|
275
|
+
* function in this; a raw `<td>` skips mantle typography and padding. Pass
|
|
276
|
+
* `column` to apply the column's `meta.width`, and pass the same `column` to
|
|
277
|
+
* the column's `DataTable.Header`, so the header and every cell agree.
|
|
278
|
+
*
|
|
279
|
+
* **Data attributes:**
|
|
280
|
+
*
|
|
281
|
+
* | Data Attribute | Value | Description |
|
|
282
|
+
* | --- | --- | --- |
|
|
283
|
+
* | `data-slot` | `"data-table-cell table-cell"` | On the `<td>`, joined ahead of `Table.Cell`'s own slot. |
|
|
284
|
+
* | `data-column-width` | `"fit"` | Present when the `column` prop's `meta.width` is `"fit"`. The cell does not wrap its content, and the column shrinks to fit it. |
|
|
285
|
+
*
|
|
286
|
+
* @see https://mantle.ngrok.com/components/data-display/data-table#datatablecell
|
|
287
|
+
*
|
|
288
|
+
* @example
|
|
289
|
+
* ```tsx
|
|
290
|
+
* columnHelper.accessor("createdAt", {
|
|
291
|
+
* id: "createdAt",
|
|
292
|
+
* meta: { width: "fit" },
|
|
293
|
+
* header: (props) => <DataTable.Header column={props.column}>Created</DataTable.Header>,
|
|
294
|
+
* cell: (props) => <DataTable.Cell column={props.column}>{props.getValue()}</DataTable.Cell>,
|
|
295
|
+
* });
|
|
296
|
+
* ```
|
|
297
|
+
*/
|
|
298
|
+
declare function Cell<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData>({ "data-slot": dataSlot, className, column, ...props }: DataTableCellProps<TFeatures, TData, TValue>): import("react").JSX.Element;
|
|
222
299
|
/**
|
|
223
300
|
* The `<tbody>` container for rows of data. Typically wraps a map of
|
|
224
301
|
* `DataTable.Row`, with a `DataTable.EmptyRow` fallback when there is no data.
|
|
@@ -303,13 +380,19 @@ type DataTableRowProps<TFeatures extends TableFeatures, TData extends RowData> =
|
|
|
303
380
|
* Never reach for `role="grid"`, because it commits the table to roving focus
|
|
304
381
|
* and arrow-key navigation. Wrap the link in
|
|
305
382
|
* `<SandboxedOnClick asChild allowClickEventDefault>` so its click does not
|
|
306
|
-
* also run the row handler. `DataTable.ActionCell`
|
|
307
|
-
* `DataTable.RowExpandButton` stop their own clicks.
|
|
383
|
+
* also run the row handler. `DataTable.ActionCell`, `DataTable.ControlCell`,
|
|
384
|
+
* and `DataTable.RowExpandButton` stop their own clicks. Put a selection
|
|
385
|
+
* checkbox in a `DataTable.ControlCell`.
|
|
308
386
|
*
|
|
309
387
|
* Pass `renderExpanded` to give the row an inline detail panel: when the row is
|
|
310
388
|
* expanded the row renders its data `<tr>` plus a sibling `DataTable.ExpandedRow`
|
|
311
|
-
* holding the returned content. Pair it with a `DataTable.RowExpandButton`
|
|
312
|
-
* and register `rowExpandingFeature` and `getRowCanExpand` on the
|
|
389
|
+
* holding the returned content. Pair it with a `DataTable.RowExpandButton`
|
|
390
|
+
* toggle and register `rowExpandingFeature` and `getRowCanExpand` on the
|
|
391
|
+
* table.
|
|
392
|
+
*
|
|
393
|
+
* A sub-row (`row.depth > 0`) fades in when `DataTable.RowExpandButton`
|
|
394
|
+
* expands its parent and fades out when it collapses it, unless the user
|
|
395
|
+
* prefers reduced motion.
|
|
313
396
|
*
|
|
314
397
|
* The row subscribes to the whole table state and to the table options. It
|
|
315
398
|
* re-renders its cells when any state slice changes or when `useTable` receives
|
|
@@ -492,6 +575,57 @@ type DataTableActionHeaderProps = ComponentProps<typeof Table$1.Header> & WithDa
|
|
|
492
575
|
* ```
|
|
493
576
|
*/
|
|
494
577
|
declare function ActionHeader({ "data-slot": dataSlot, children, className, ...props }: DataTableActionHeaderProps): import("react").JSX.Element;
|
|
578
|
+
type DataTableControlCellProps = ComponentProps<typeof Table$1.Cell> & WithDataSlot;
|
|
579
|
+
/**
|
|
580
|
+
* A `<td>` for a row's own control: a `DataTable.RowExpandButton` or a
|
|
581
|
+
* selection `Checkbox`. The whole cell is the control's pointer target, and a
|
|
582
|
+
* click anywhere in it never runs a clickable row's `onClick`.
|
|
583
|
+
*
|
|
584
|
+
* - A click on the cell's padding focuses and clicks the control, so a click
|
|
585
|
+
* that misses a small control still toggles it instead of navigating.
|
|
586
|
+
* - When the cell holds no enabled control (a leaf row's `RowExpandButton`
|
|
587
|
+
* renders nothing, or the checkbox is disabled), the click reaches the row
|
|
588
|
+
* as usual.
|
|
589
|
+
* - The cell shows a pointer cursor only while it holds an enabled control.
|
|
590
|
+
* An empty cell keeps the row's cursor.
|
|
591
|
+
* - The control aligns with the first line of text, so it stays beside a
|
|
592
|
+
* two-line primary cell. On a one-line row, it is centered.
|
|
593
|
+
*
|
|
594
|
+
* The padding click is a pointer convenience only. The cell keeps its
|
|
595
|
+
* `role="cell"` and gets no `tabIndex`, so keyboard and screen-reader users
|
|
596
|
+
* reach the control itself. Never add a role or `tabIndex` to the cell.
|
|
597
|
+
*
|
|
598
|
+
* Your own `onClick` runs first, once for each click. Call
|
|
599
|
+
* `event.preventDefault()` in it to stop the padding click from reaching the
|
|
600
|
+
* control.
|
|
601
|
+
*
|
|
602
|
+
* **Structure.** `children` render inside a
|
|
603
|
+
* `<span data-slot="data-table-control-cell-label">` that is one line of text
|
|
604
|
+
* tall and centers the control in it.
|
|
605
|
+
*
|
|
606
|
+
* **Data attributes:**
|
|
607
|
+
*
|
|
608
|
+
* | Data Attribute | Value | Description |
|
|
609
|
+
* | --- | --- | --- |
|
|
610
|
+
* | `data-slot` | `"data-table-control-cell table-cell"` | On the cell element, joined ahead of `Table.Cell`'s own slot. |
|
|
611
|
+
* | `data-slot` | `"data-table-control-cell-label"` | On the `<span>` wrapping `children`. |
|
|
612
|
+
*
|
|
613
|
+
* @see https://mantle.ngrok.com/components/data-display/data-table#datatablecontrolcell
|
|
614
|
+
*
|
|
615
|
+
* @example
|
|
616
|
+
* ```tsx
|
|
617
|
+
* columnHelper.display({
|
|
618
|
+
* id: "expander",
|
|
619
|
+
* header: () => <DataTable.ExpandHeader />,
|
|
620
|
+
* cell: (props) => (
|
|
621
|
+
* <DataTable.ControlCell>
|
|
622
|
+
* <DataTable.RowExpandButton row={props.row} label={props.row.original.name} />
|
|
623
|
+
* </DataTable.ControlCell>
|
|
624
|
+
* ),
|
|
625
|
+
* });
|
|
626
|
+
* ```
|
|
627
|
+
*/
|
|
628
|
+
declare function ControlCell({ "data-slot": dataSlot, children, className, onClick, ...props }: DataTableControlCellProps): import("react").JSX.Element;
|
|
495
629
|
/**
|
|
496
630
|
* Compute the stable DOM `id` for a row's expanded detail row. Shared by
|
|
497
631
|
* `DataTable.RowExpandButton` (as its `aria-controls` target) and
|
|
@@ -536,9 +670,9 @@ type DataTableExpandHeaderProps = Omit<ComponentProps<typeof Table$1.Header>, "c
|
|
|
536
670
|
* id: "expander",
|
|
537
671
|
* header: () => <DataTable.ExpandHeader />,
|
|
538
672
|
* cell: (props) => (
|
|
539
|
-
* <DataTable.
|
|
673
|
+
* <DataTable.ControlCell>
|
|
540
674
|
* <DataTable.RowExpandButton row={props.row} label={props.row.original.name} />
|
|
541
|
-
* </DataTable.
|
|
675
|
+
* </DataTable.ControlCell>
|
|
542
676
|
* ),
|
|
543
677
|
* });
|
|
544
678
|
* ```
|
|
@@ -566,7 +700,8 @@ type DataTableRowExpandButtonProps<TFeatures extends ExpandableTableFeatures, TD
|
|
|
566
700
|
row: ExpandableRow<TFeatures, TData>;
|
|
567
701
|
/**
|
|
568
702
|
* A human-readable name for the row, woven into the accessible label:
|
|
569
|
-
* `Show details for {label}` / `Hide details for {label}
|
|
703
|
+
* `Show details for {label}` / `Hide details for {label}` for a detail panel,
|
|
704
|
+
* and `Expand {label}` / `Collapse {label}` for a row with sub-rows.
|
|
570
705
|
*/
|
|
571
706
|
label: string;
|
|
572
707
|
/**
|
|
@@ -581,17 +716,21 @@ type DataTableRowExpandButtonProps<TFeatures extends ExpandableTableFeatures, TD
|
|
|
581
716
|
collapseIcon?: ReactNode;
|
|
582
717
|
} & WithDataSlot;
|
|
583
718
|
/**
|
|
584
|
-
* An accessible +/- toggle that expands or collapses a row's detail panel
|
|
585
|
-
* it inside a `DataTable.
|
|
586
|
-
* pair it with
|
|
719
|
+
* An accessible +/- toggle that expands or collapses a row's detail panel or
|
|
720
|
+
* its sub-rows. Drop it inside a `DataTable.ControlCell` in a leading
|
|
721
|
+
* `columnHelper.display` column. For a detail panel, pair it with
|
|
722
|
+
* `DataTable.ExpandedRow`. For sub-rows (`getSubRows` on `useTable`), the
|
|
723
|
+
* expanded row model puts each child in `table.getRowModel().rows` after its
|
|
724
|
+
* parent, so `DataTable.Row` renders it.
|
|
587
725
|
*
|
|
588
726
|
* Renders a real `<button>` (keyboard operable) that sets `aria-expanded` and,
|
|
589
|
-
* while
|
|
590
|
-
*
|
|
591
|
-
*
|
|
592
|
-
* `
|
|
593
|
-
*
|
|
594
|
-
*
|
|
727
|
+
* while a detail panel is open, `aria-controls` pointing at the
|
|
728
|
+
* `DataTable.ExpandedRow`. A row with sub-rows has no panel, so it gets no
|
|
729
|
+
* `aria-controls`. It stops click propagation so it never triggers a row-level
|
|
730
|
+
* `onClick` (e.g. row navigation), and renders nothing when
|
|
731
|
+
* `row.getCanExpand()` is false so a `getRowCanExpand` predicate cleanly hides
|
|
732
|
+
* it. Forwards `IconButton` props, so pass `onClick` to run side effects before
|
|
733
|
+
* the toggle (call `event.preventDefault()` to veto it).
|
|
595
734
|
*
|
|
596
735
|
* The table must register `rowExpandingFeature`; the `row` prop's type rejects a row
|
|
597
736
|
* from a table without it. Add `expandedRowModel: createExpandedRowModel()` when rows
|
|
@@ -611,9 +750,9 @@ type DataTableRowExpandButtonProps<TFeatures extends ExpandableTableFeatures, TD
|
|
|
611
750
|
* id: "expander",
|
|
612
751
|
* header: () => <DataTable.ExpandHeader />,
|
|
613
752
|
* cell: (props) => (
|
|
614
|
-
* <DataTable.
|
|
753
|
+
* <DataTable.ControlCell>
|
|
615
754
|
* <DataTable.RowExpandButton row={props.row} label={props.row.original.name} />
|
|
616
|
-
* </DataTable.
|
|
755
|
+
* </DataTable.ControlCell>
|
|
617
756
|
* ),
|
|
618
757
|
* });
|
|
619
758
|
* ```
|
|
@@ -644,8 +783,9 @@ type DataTableExpandedRowProps<TFeatures extends TableFeatures, TData extends Ro
|
|
|
644
783
|
* sits on an opaque card surface so horizontally-scrolled content never shows
|
|
645
784
|
* through a sticky action column. Its top divider is suppressed so it reads as
|
|
646
785
|
* one block with its parent row; the panel itself does not change on hover (only
|
|
647
|
-
* the parent data row reacts to hover).
|
|
648
|
-
*
|
|
786
|
+
* the parent data row reacts to hover). It fades in on mount and fades out
|
|
787
|
+
* when `DataTable.RowExpandButton` collapses its row, unless the user prefers
|
|
788
|
+
* reduced motion. Exposes `data-expanded-content` for styling hooks.
|
|
649
789
|
*
|
|
650
790
|
* @see https://mantle.ngrok.com/components/data-display/data-table#datatableexpandedrow
|
|
651
791
|
*
|
|
@@ -703,8 +843,9 @@ declare function ExpandedRow<TFeatures extends TableFeatures, TData extends RowD
|
|
|
703
843
|
* │ └── DataTable.ActionHeader
|
|
704
844
|
* └── DataTable.Body
|
|
705
845
|
* ├── DataTable.Row
|
|
706
|
-
* │ ├── DataTable.
|
|
846
|
+
* │ ├── DataTable.ControlCell
|
|
707
847
|
* │ │ └── DataTable.RowExpandButton
|
|
848
|
+
* │ ├── DataTable.Cell
|
|
708
849
|
* │ └── DataTable.ActionCell
|
|
709
850
|
* ├── DataTable.ExpandedRow
|
|
710
851
|
* └── DataTable.EmptyRow
|
|
@@ -1136,22 +1277,31 @@ declare const DataTable: {
|
|
|
1136
1277
|
*/
|
|
1137
1278
|
readonly ActionHeader: typeof ActionHeader;
|
|
1138
1279
|
/**
|
|
1139
|
-
* A `<td>` for
|
|
1140
|
-
*
|
|
1141
|
-
*
|
|
1280
|
+
* A `<td>` for one data cell. Wrap the output of each column's `cell`
|
|
1281
|
+
* function in this; a raw `<td>` skips mantle typography and padding. Pass
|
|
1282
|
+
* `column` to apply the column's `meta.width`, and pass the same `column` to
|
|
1283
|
+
* the column's `DataTable.Header`, so the header and every cell agree.
|
|
1284
|
+
*
|
|
1285
|
+
* **Data attributes:**
|
|
1286
|
+
*
|
|
1287
|
+
* | Data Attribute | Value | Description |
|
|
1288
|
+
* | --- | --- | --- |
|
|
1289
|
+
* | `data-slot` | `"data-table-cell table-cell"` | On the `<td>`, joined ahead of `Table.Cell`'s own slot. |
|
|
1290
|
+
* | `data-column-width` | `"fit"` | Present when the `column` prop's `meta.width` is `"fit"`. The cell does not wrap its content, and the column shrinks to fit it. |
|
|
1142
1291
|
*
|
|
1143
1292
|
* @see https://mantle.ngrok.com/components/data-display/data-table#datatablecell
|
|
1144
1293
|
*
|
|
1145
1294
|
* @example
|
|
1146
1295
|
* ```tsx
|
|
1147
|
-
* columnHelper.accessor("
|
|
1148
|
-
* id: "
|
|
1149
|
-
*
|
|
1150
|
-
*
|
|
1296
|
+
* columnHelper.accessor("createdAt", {
|
|
1297
|
+
* id: "createdAt",
|
|
1298
|
+
* meta: { width: "fit" },
|
|
1299
|
+
* header: (props) => <DataTable.Header column={props.column}>Created</DataTable.Header>,
|
|
1300
|
+
* cell: (props) => <DataTable.Cell column={props.column}>{props.getValue()}</DataTable.Cell>,
|
|
1151
1301
|
* });
|
|
1152
1302
|
* ```
|
|
1153
1303
|
*/
|
|
1154
|
-
readonly Cell:
|
|
1304
|
+
readonly Cell: typeof Cell;
|
|
1155
1305
|
/**
|
|
1156
1306
|
* The `<tbody>` container for rows of data. Typically wraps a map of
|
|
1157
1307
|
* `DataTable.Row`, with a `DataTable.EmptyRow` fallback when there is
|
|
@@ -1216,7 +1366,15 @@ declare const DataTable: {
|
|
|
1216
1366
|
* A `<th>` optimized for header actions. Wrap each column's header content in
|
|
1217
1367
|
* this; for sortable columns, nest a `DataTable.HeaderSortButton` inside and
|
|
1218
1368
|
* pass the same `column` here, so the cell carries `aria-sort` while the column
|
|
1219
|
-
* is sorted. Non-sortable columns can render plain text.
|
|
1369
|
+
* is sorted. Non-sortable columns can render plain text. The `column` prop
|
|
1370
|
+
* also applies the column's `meta.width`.
|
|
1371
|
+
*
|
|
1372
|
+
* **Data attributes:**
|
|
1373
|
+
*
|
|
1374
|
+
* | Data Attribute | Value | Description |
|
|
1375
|
+
* | --- | --- | --- |
|
|
1376
|
+
* | `data-slot` | `"data-table-header table-header"` | On the `<th>`, joined ahead of `Table.Header`'s own slot. |
|
|
1377
|
+
* | `data-column-width` | `"fit"` | Present when the `column` prop's `meta.width` is `"fit"`. The header does not wrap its content, and the column shrinks to fit it. |
|
|
1220
1378
|
*
|
|
1221
1379
|
* @see https://mantle.ngrok.com/components/data-display/data-table#datatableheader
|
|
1222
1380
|
*
|
|
@@ -1343,20 +1501,44 @@ declare const DataTable: {
|
|
|
1343
1501
|
* id: "expander",
|
|
1344
1502
|
* header: () => <DataTable.ExpandHeader />,
|
|
1345
1503
|
* cell: (props) => (
|
|
1346
|
-
* <DataTable.
|
|
1504
|
+
* <DataTable.ControlCell>
|
|
1347
1505
|
* <DataTable.RowExpandButton row={props.row} label={props.row.original.name} />
|
|
1348
|
-
* </DataTable.
|
|
1506
|
+
* </DataTable.ControlCell>
|
|
1349
1507
|
* ),
|
|
1350
1508
|
* });
|
|
1351
1509
|
* ```
|
|
1352
1510
|
*/
|
|
1353
1511
|
readonly ExpandHeader: typeof ExpandHeader;
|
|
1354
1512
|
/**
|
|
1355
|
-
*
|
|
1356
|
-
*
|
|
1357
|
-
*
|
|
1358
|
-
*
|
|
1359
|
-
*
|
|
1513
|
+
* A `<td>` for a row's own control: a `DataTable.RowExpandButton` or a
|
|
1514
|
+
* selection `Checkbox`. A click on its padding focuses and clicks the
|
|
1515
|
+
* control, a click anywhere in it never runs a clickable row's `onClick`,
|
|
1516
|
+
* and the control aligns with the first line of text. The cell keeps its
|
|
1517
|
+
* `role="cell"`; keyboard users reach the control itself.
|
|
1518
|
+
*
|
|
1519
|
+
* @see https://mantle.ngrok.com/components/data-display/data-table#datatablecontrolcell
|
|
1520
|
+
*
|
|
1521
|
+
* @example
|
|
1522
|
+
* ```tsx
|
|
1523
|
+
* columnHelper.display({
|
|
1524
|
+
* id: "expander",
|
|
1525
|
+
* header: () => <DataTable.ExpandHeader />,
|
|
1526
|
+
* cell: (props) => (
|
|
1527
|
+
* <DataTable.ControlCell>
|
|
1528
|
+
* <DataTable.RowExpandButton row={props.row} label={props.row.original.name} />
|
|
1529
|
+
* </DataTable.ControlCell>
|
|
1530
|
+
* ),
|
|
1531
|
+
* });
|
|
1532
|
+
* ```
|
|
1533
|
+
*/
|
|
1534
|
+
readonly ControlCell: typeof ControlCell;
|
|
1535
|
+
/**
|
|
1536
|
+
* An accessible +/- toggle that expands or collapses a row's detail panel or
|
|
1537
|
+
* its sub-rows. Place it inside a `DataTable.ControlCell` in a leading
|
|
1538
|
+
* `columnHelper.display` column. Sets `aria-expanded`, and `aria-controls`
|
|
1539
|
+
* while a detail panel is open. A row with only sub-rows has no panel, so it
|
|
1540
|
+
* gets no `aria-controls`. Stops click propagation so it never fires a
|
|
1541
|
+
* row-level `onClick`, and renders nothing when `row.getCanExpand()` is
|
|
1360
1542
|
* false. The table must register `rowExpandingFeature`; the `row` prop's
|
|
1361
1543
|
* type rejects a row from a table without it.
|
|
1362
1544
|
*
|
|
@@ -1364,9 +1546,9 @@ declare const DataTable: {
|
|
|
1364
1546
|
*
|
|
1365
1547
|
* @example
|
|
1366
1548
|
* ```tsx
|
|
1367
|
-
* <DataTable.
|
|
1549
|
+
* <DataTable.ControlCell>
|
|
1368
1550
|
* <DataTable.RowExpandButton row={props.row} label={props.row.original.name} />
|
|
1369
|
-
* </DataTable.
|
|
1551
|
+
* </DataTable.ControlCell>
|
|
1370
1552
|
* ```
|
|
1371
1553
|
*/
|
|
1372
1554
|
readonly RowExpandButton: typeof RowExpandButton;
|
|
@@ -1405,4 +1587,4 @@ declare const DataTable: {
|
|
|
1405
1587
|
readonly ExpandedRow: typeof ExpandedRow;
|
|
1406
1588
|
};
|
|
1407
1589
|
//#endregion
|
|
1408
|
-
export { DataTable, expandedRowId };
|
|
1590
|
+
export { DataTable, type DataTableColumnMeta, expandedRowId };
|
package/dist/data-table.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"./button-b2HKEIE2.js";import{t as r}from"./button-Bkl_QYpp.js";import{t as i}from"./icons-CDLz5lpI.js";import{n as a}from"./sandboxed-on-click-C7pPu-2M.js";import{t as o}from"./table-DBbKqOVq.js";import{c as s}from"react/compiler-runtime";import{Fragment as c,createContext as l,useContext as u}from"react";import d from"tiny-invariant";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";import{Subscribe as h,callMemoOrStaticFn as g,flexRender as _}from"@tanstack/react-table";import{MinusIcon as v}from"@phosphor-icons/react/Minus";import{PlusIcon as y}from"@phosphor-icons/react/Plus";import{column_getIsSorted as b,row_getIsExpanded as x,row_getVisibleCells as S,table_getVisibleLeafColumns as C}from"@tanstack/react-table/static-functions";export*from"@tanstack/react-table";const w=[`unsorted`,`asc`,`desc`],T=[`unsorted`,`desc`,`asc`];function E(e,t){return D(t===`alphanumeric`?w:T,e)??`unsorted`}function D(e,t,n){if(e.length===0)return n;let r=e.findIndex(e=>e===t);if(r===-1)return n;let i=(r+1)%e.length;return e.at(i)??n}const O=l(null);function k(){return u(O)?.table.options}function A(){let e=u(O);return d(e,`useDataTableContext should only be used within a DataTable child component`),e}function j(e){let n=s(18),r,i,a,c;n[0]===e?(r=n[1],i=n[2],a=n[3],c=n[4]):({"data-slot":i,children:r,table:c,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=c);let l;n[5]===c?l=n[6]:(l={table:c},n[5]=c,n[6]=l);let u=l,d;n[7]===i?d=n[8]:(d=t(i,`data-table`),n[7]=i,n[8]=d);let f;n[9]===r?f=n[10]:(f=/* @__PURE__ */ p(o.Element,{children:r}),n[9]=r,n[10]=f);let m;n[11]!==a||n[12]!==d||n[13]!==f?(m=/* @__PURE__ */ p(o.Root,{"data-slot":d,...a,children:f}),n[11]=a,n[12]=d,n[13]=f,n[14]=m):m=n[14];let h;return n[15]!==u||n[16]!==m?(h=/* @__PURE__ */ p(O.Provider,{value:u,children:m}),n[15]=u,n[16]=m,n[17]=h):h=n[17],h}function M(r){let i=s(33),a,o,c,l,u,d,f,m,g,_,v,y;i[0]===r?(a=i[1],o=i[2],c=i[3],l=i[4],u=i[5],d=i[6],f=i[7],m=i[8],g=i[9],_=i[10],v=i[11],y=i[12]):({"data-slot":l,appearance:g,children:a,className:o,column:c,disableSorting:_,iconPlacement:v,intent:y,sortingMode:m,sortIcon:d,onClick:u,...f}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=c,i[4]=l,i[5]=u,i[6]=d,i[7]=f,i[8]=m,i[9]=g,i[10]=_,i[11]=v,i[12]=y);let b=g===void 0?`ghost`:g,x=_!==void 0&&_,S=v===void 0?`end`:v,C=y===void 0?`neutral`:y,w;i[13]!==b||i[14]!==a||i[15]!==o||i[16]!==c||i[17]!==l||i[18]!==x||i[19]!==S||i[20]!==C||i[21]!==u||i[22]!==d||i[23]!==f||i[24]!==m?(w=()=>{let r=c.getIsSorted(),i=!x&&c.getCanSort(),s=i&&typeof r==`string`?r:`unsorted`;if(!i)return/* @__PURE__ */ p(`span`,{"data-slot":t(l,`data-table-header-sort-button`),"data-sort-direction":`unsorted`,className:e(`flex w-full items-center justify-start`,b===`ghost`&&C===`neutral`&&`text-muted`,o),...f,children:a});let h=d?.(s)??/* @__PURE__ */ p($,{mode:m,direction:s});return/* @__PURE__ */ p(n,{appearance:b,"data-slot":t(l,`data-table-header-sort-button`),className:e(`flex justify-start w-full h-full rounded-none not-disabled:active:scale-none`,b===`ghost`&&C===`neutral`&&`text-muted`,o),"data-sort-direction":s,"data-table-header-action":!0,icon:h,iconPlacement:S,onClick:e=>{u?.(e),!e.defaultPrevented&&m!==void 0&&ee(c,m)},intent:C,type:`button`,...f,children:a})},i[13]=b,i[14]=a,i[15]=o,i[16]=c,i[17]=l,i[18]=x,i[19]=S,i[20]=C,i[21]=u,i[22]=d,i[23]=f,i[24]=m,i[25]=w):w=i[25];let T=w,E=k(),D;i[26]!==c||i[27]!==E?(D=()=>({sorted:c.getIsSorted(),options:E}),i[26]=c,i[27]=E,i[28]=D):D=i[28];let O;return i[29]!==c.table.store||i[30]!==T||i[31]!==D?(O=/* @__PURE__ */ p(h,{source:c.table.store,selector:D,children:T}),i[29]=c.table.store,i[30]=T,i[31]=D,i[32]=O):O=i[32],O}function N(e){if(e==null)return;let t=g(e,`getIsSorted`,b);if(t===`asc`)return`ascending`;if(t===`desc`)return`descending`}function P(n){let r=s(21),i,a,c,l,u;r[0]===n?(i=r[1],a=r[2],c=r[3],l=r[4],u=r[5]):({"data-slot":l,children:i,className:a,column:c,...u}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=c,r[4]=l,r[5]=u);let d;r[6]!==i||r[7]!==a||r[8]!==c||r[9]!==l||r[10]!==u?(d=()=>/* @__PURE__ */ p(o.Header,{"aria-sort":N(c),"data-slot":t(l,`data-table-header`),className:e(`has-data-table-header-action:px-0`,a),...u,children:i}),r[6]=i,r[7]=a,r[8]=c,r[9]=l,r[10]=u,r[11]=d):d=r[11];let f=d,m=k();if(c==null){let e;return r[12]===f?e=r[13]:(e=f(),r[12]=f,r[13]=e),e}let g;r[14]!==c||r[15]!==m?(g=()=>({ariaSort:N(c),options:m}),r[14]=c,r[15]=m,r[16]=g):g=r[16];let _;return r[17]!==c.table.store||r[18]!==f||r[19]!==g?(_=/* @__PURE__ */ p(h,{source:c.table.store,selector:g,children:f}),r[17]=c.table.store,r[18]=f,r[19]=g,r[20]=_):_=r[20],_}const F=e=>{let n=s(8),r,i;n[0]===e?(r=n[1],i=n[2]):({"data-slot":r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=t(r,`data-table-body`),n[3]=r,n[4]=a);let c;return n[5]!==i||n[6]!==a?(c=/* @__PURE__ */ p(o.Body,{"data-slot":a,...i}),n[5]=i,n[6]=a,n[7]=c):c=n[7],c};function I(e){let n=s(11),r,i;n[0]===e?(r=n[1],i=n[2]):({"data-slot":r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let{table:a}=A(),c;n[3]===r?c=n[4]:(c=t(r,`data-table-head`),n[3]=r,n[4]=c);let l;n[5]===a?l=n[6]:(l=a.getHeaderGroups().map(L),n[5]=a,n[6]=l);let u;return n[7]!==i||n[8]!==c||n[9]!==l?(u=/* @__PURE__ */ p(o.Head,{"data-slot":c,...i,children:l}),n[7]=i,n[8]=c,n[9]=l,n[10]=u):u=n[10],u}function L(e){return/* @__PURE__ */ p(o.Row,{children:e.headers.map(R)},e.id)}function R(e){return/* @__PURE__ */ p(c,{children:e.isPlaceholder?/* @__PURE__ */ p(o.Header,{}):_(e.column.columnDef.header,e.getContext())},e.id)}function z(e){if(e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return!1;let t=e.currentTarget.ownerDocument.getSelection();return t==null||t.isCollapsed?!0:!e.currentTarget.contains(t.anchorNode)}function B(n){let r=s(9),i,a;if(r[0]!==n){let{"data-slot":s,className:c,onClick:l,renderExpanded:u,row:d,...h}=n;i=d,a=()=>{let n=g(i,`getIsExpanded`,x),r=g(i,`getVisibleCells`,S),a=/* @__PURE__ */ p(o.Row,{"data-slot":t(s,`data-table-row`),"data-expanded":n||void 0,"data-clickable":l==null?void 0:``,className:e(l!=null&&`cursor-pointer`,c),onClick:l&&(e=>{z(e)&&l(e)}),...h,children:r.map(V)});return u==null?a:/* @__PURE__ */ m(f,{children:[a,n&&/* @__PURE__ */ p(Z,{row:i,children:u(i)})]})},r[0]=n,r[1]=i,r[2]=a}else i=r[1],a=r[2];let c=a,l=k(),u;r[3]===l?u=r[4]:(u=e=>({state:e,options:l}),r[3]=l,r[4]=u);let d;return r[5]!==c||r[6]!==i.table.store||r[7]!==u?(d=/* @__PURE__ */ p(h,{source:i.table.store,selector:u,children:c}),r[5]=c,r[6]=i.table.store,r[7]=u,r[8]=d):d=r[8],d}function V(e){return/* @__PURE__ */ p(c,{children:_(e.column.columnDef.cell,e.getContext())},e.id)}function H(e){let n=s(15),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({"data-slot":i,children:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let{table:c}=A(),l;n[4]===c?l=n[5]:(l=g(c,`getVisibleLeafColumns`,C),n[4]=c,n[5]=l);let u=l.length,d;n[6]===i?d=n[7]:(d=t(i,`data-table-empty-row`),n[6]=i,n[7]=d);let f;n[8]!==r||n[9]!==u?(f=/* @__PURE__ */ p(o.Cell,{colSpan:u,children:r}),n[8]=r,n[9]=u,n[10]=f):f=n[10];let m;return n[11]!==a||n[12]!==d||n[13]!==f?(m=/* @__PURE__ */ p(o.Row,{"data-slot":d,...a,children:f}),n[11]=a,n[12]=d,n[13]=f,n[14]=m):m=n[14],m}function U(){let t=s(1),n;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=/* @__PURE__ */ p(`span`,{"aria-hidden":!0,className:e(`pointer-events-none absolute -inset-y-px -left-1.5 w-1.5`,`opacity-0 transition-opacity group-data-sticky-active/table:opacity-100`,`shadow-[1px_0_0_0_var(--border-color-card-muted)]`,`bg-linear-to-l to-transparent`,`from-[color-mix(in_oklab,var(--shadow-color)_var(--shadow-second-opacity),transparent)]`)}),t[0]=n):n=t[0],n}function W(n){let r=s(21),i,c,l,u,d;r[0]===n?(i=r[1],c=r[2],l=r[3],u=r[4],d=r[5]):({"data-slot":l,children:i,className:c,onClick:u,...d}=n,r[0]=n,r[1]=i,r[2]=c,r[3]=l,r[4]=u,r[5]=d);let f;r[6]===u?f=r[7]:(f=a({allowClickEventDefault:!0,onClick:u}),r[6]=u,r[7]=f);let{onClick:h}=f,g;r[8]===l?g=r[9]:(g=t(l,`data-table-action-cell`),r[8]=l,r[9]=g);let _;r[10]===c?_=r[11]:(_=e(`sticky z-10 right-0 text-end align-middle bg-inherit p-2`,c),r[10]=c,r[11]=_);let v;r[12]===Symbol.for(`react.memo_cache_sentinel`)?(v=/* @__PURE__ */ p(U,{}),r[12]=v):v=r[12];let y;r[13]===i?y=r[14]:(y=/* @__PURE__ */ p(`span`,{"data-slot":`data-table-action-cell-label`,className:`contents`,children:i}),r[13]=i,r[14]=y);let b;return r[15]!==d||r[16]!==h||r[17]!==g||r[18]!==_||r[19]!==y?(b=/* @__PURE__ */ m(o.Cell,{"data-mantle-table-sticky-right":!0,"data-slot":g,className:_,onClick:h,...d,children:[v,y]}),r[15]=d,r[16]=h,r[17]=g,r[18]=_,r[19]=y,r[20]=b):b=r[20],b}function G(n){let r=s(27),i,a,c,l;r[0]===n?(i=r[1],a=r[2],c=r[3],l=r[4]):({"data-slot":c,children:i,className:a,...l}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=c,r[4]=l);let{table:u}=A(),d;r[5]===u?d=r[6]:(d=u.getRowModel(),r[5]=u,r[6]=d);let f=d.rows.length>0,h;r[7]===f?h=r[8]:(h=f?{"data-mantle-table-sticky-right":!0}:{},r[7]=f,r[8]=h);let g;r[9]===c?g=r[10]:(g=t(c,`data-table-action-header`),r[9]=c,r[10]=g);let _=f&&`sticky z-10 right-0 bg-inherit`,v;r[11]!==a||r[12]!==_?(v=e(_,a),r[11]=a,r[12]=_,r[13]=v):v=r[13];let y;r[14]===i?y=r[15]:(y=i??/* @__PURE__ */ p(`span`,{className:`sr-only`,children:`Actions`}),r[14]=i,r[15]=y);let b;r[16]===y?b=r[17]:(b=/* @__PURE__ */ p(`span`,{"data-slot":`data-table-action-header-label`,className:`contents`,children:y}),r[16]=y,r[17]=b);let x;r[18]===f?x=r[19]:(x=f&&/* @__PURE__ */ p(U,{}),r[18]=f,r[19]=x);let S;return r[20]!==l||r[21]!==h||r[22]!==g||r[23]!==v||r[24]!==b||r[25]!==x?(S=/* @__PURE__ */ m(o.Header,{...h,"data-slot":g,className:v,...l,children:[b,x]}),r[20]=l,r[21]=h,r[22]=g,r[23]=v,r[24]=b,r[25]=x,r[26]=S):S=r[26],S}function K(e){return`data-table-expanded-row-${encodeURIComponent(e.id)}`}function q(n){let r=s(16),i,a,c,l;r[0]===n?(i=r[1],a=r[2],c=r[3],l=r[4]):({"data-slot":c,children:i,className:a,...l}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=c,r[4]=l);let u;r[5]===c?u=r[6]:(u=t(c,`data-table-expand-header`),r[5]=c,r[6]=u);let d;r[7]===a?d=r[8]:(d=e(`w-9 px-0 text-center`,a),r[7]=a,r[8]=d);let f;r[9]===i?f=r[10]:(f=i??/* @__PURE__ */ p(`span`,{className:`sr-only`,children:`Row details`}),r[9]=i,r[10]=f);let m;return r[11]!==l||r[12]!==u||r[13]!==d||r[14]!==f?(m=/* @__PURE__ */ p(o.Header,{"data-slot":u,className:d,...l,children:f}),r[11]=l,r[12]=u,r[13]=d,r[14]=f,r[15]=m):m=r[15],m}const J=/* @__PURE__ */ p(y,{weight:`bold`,className:`size-3.5`}),Y=/* @__PURE__ */ p(v,{weight:`bold`,className:`size-3.5`});function X(n){let i=s(31),a,o,c,l,u,d,f,m,g,_,v;i[0]===n?(a=i[1],o=i[2],c=i[3],l=i[4],u=i[5],d=i[6],f=i[7],m=i[8],g=i[9],_=i[10],v=i[11]):({"data-slot":o,appearance:f,className:a,collapseIcon:m,expandIcon:g,intent:_,label:c,onClick:l,row:d,size:v,...u}=n,i[0]=n,i[1]=a,i[2]=o,i[3]=c,i[4]=l,i[5]=u,i[6]=d,i[7]=f,i[8]=m,i[9]=g,i[10]=_,i[11]=v);let y=f===void 0?`ghost`:f,b=m===void 0?Y:m,x=g===void 0?J:g,S=_===void 0?`neutral`:_,C=v===void 0?`sm`:v,w;i[12]!==y||i[13]!==a||i[14]!==b||i[15]!==o||i[16]!==x||i[17]!==S||i[18]!==c||i[19]!==l||i[20]!==u||i[21]!==d||i[22]!==C?(w=()=>{if(!d.getCanExpand())return null;let n=d.getIsExpanded(),i=d.getToggleExpandedHandler();return/* @__PURE__ */ p(r,{type:`button`,"data-slot":t(o,`data-table-row-expand-button`),appearance:y,intent:S,size:C,className:e(`rounded`,a),"aria-expanded":n,"aria-controls":n?K(d):void 0,icon:n?b:x,label:`${n?`Hide`:`Show`} details for ${c}`,onClick:e=>{e.stopPropagation(),l?.(e),!e.defaultPrevented&&i()},...u})},i[12]=y,i[13]=a,i[14]=b,i[15]=o,i[16]=x,i[17]=S,i[18]=c,i[19]=l,i[20]=u,i[21]=d,i[22]=C,i[23]=w):w=i[23];let T=w,E=k(),D;i[24]!==E||i[25]!==d?(D=()=>({isExpanded:d.getIsExpanded(),options:E}),i[24]=E,i[25]=d,i[26]=D):D=i[26];let O;return i[27]!==T||i[28]!==d.table.store||i[29]!==D?(O=/* @__PURE__ */ p(h,{source:d.table.store,selector:D,children:T}),i[27]=T,i[28]=d.table.store,i[29]=D,i[30]=O):O=i[30],O}function Z(n){let r=s(25),i,a,c,l,u,d;r[0]===n?(i=r[1],a=r[2],c=r[3],l=r[4],u=r[5],d=r[6]):({"data-slot":l,children:i,className:a,colSpan:c,row:d,...u}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=c,r[4]=l,r[5]=u,r[6]=d);let f;r[7]===d?f=r[8]:(f=()=>g(d,`getVisibleCells`,S).length,r[7]=d,r[8]=f);let m=f,_;r[9]!==i||r[10]!==a||r[11]!==l||r[12]!==u||r[13]!==d?(_=n=>{let{numberOfColumns:r}=n;return/* @__PURE__ */ p(o.Row,{"data-slot":t(l,`data-table-expanded-row`),"data-expanded-content":!0,className:e(`[&>td]:border-t-0`,a),...u,children:/* @__PURE__ */ p(o.Cell,{id:K(d),colSpan:r,className:`bg-card font-sans text-body`,children:i})})},r[9]=i,r[10]=a,r[11]=l,r[12]=u,r[13]=d,r[14]=_):_=r[14];let v=_,y=k();if(c!=null){let e;return r[15]!==c||r[16]!==v?(e=v({numberOfColumns:c}),r[15]=c,r[16]=v,r[17]=e):e=r[17],e}let b;r[18]!==m||r[19]!==y?(b=()=>({numberOfColumns:m(),options:y}),r[18]=m,r[19]=y,r[20]=b):b=r[20];let x;return r[21]!==v||r[22]!==d.table.store||r[23]!==b?(x=/* @__PURE__ */ p(h,{source:d.table.store,selector:b,children:v}),r[21]=v,r[22]=d.table.store,r[23]=b,r[24]=x):x=r[24],x}const Q={Root:j,ActionCell:W,ActionHeader:G,Cell:o.Cell,Body:F,EmptyRow:H,Head:I,Header:P,HeaderSortButton:M,Row:B,ExpandHeader:q,RowExpandButton:X,ExpandedRow:Z};function $(e){let t=s(10),n,r,a;if(t[0]===e?(n=t[1],r=t[2],a=t[3]):({direction:n,mode:r,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a),n===`unsorted`||!r||!n){let e;return t[4]===a?e=t[5]:(e=/* @__PURE__ */ p(`svg`,{"aria-hidden":!0,...a}),t[4]=a,t[5]=e),e}let o;return t[6]!==n||t[7]!==r||t[8]!==a?(o=/* @__PURE__ */ p(i,{mode:r,direction:n,...a}),t[6]=n,t[7]=r,t[8]=a,t[9]=o):o=t[9],o}function ee(e,t){if(!e.getCanSort())return;let n=e.getIsSorted();switch(E(typeof n==`string`?n:`unsorted`,t)){case`unsorted`:e.clearSorting();return;case`asc`:e.toggleSorting(!1);return;case`desc`:e.toggleSorting(!0);return;default:return}}export{Q as DataTable,K as expandedRowId};
|
|
1
|
+
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./button-b2HKEIE2.js";import{t as r}from"./button-Bkl_QYpp.js";import{t as i}from"./use-prefers-reduced-motion-DimzRx-M.js";import{t as a}from"./icons-CDLz5lpI.js";import{n as o}from"./sandboxed-on-click-C7pPu-2M.js";import{t as s}from"./table-DBbKqOVq.js";import{c}from"react/compiler-runtime";import{Fragment as l,createContext as u,useContext as d,useEffect as f,useRef as p,useState as m}from"react";import h from"tiny-invariant";import{Fragment as g,jsx as _,jsxs as v}from"react/jsx-runtime";import{Subscribe as y,callMemoOrStaticFn as b,flexRender as x}from"@tanstack/react-table";import{MinusIcon as S}from"@phosphor-icons/react/Minus";import{PlusIcon as C}from"@phosphor-icons/react/Plus";import{column_getIsSorted as w,row_getIsExpanded as T,row_getVisibleCells as E,table_getVisibleLeafColumns as D}from"@tanstack/react-table/static-functions";export*from"@tanstack/react-table";const O=[`unsorted`,`asc`,`desc`],k=[`unsorted`,`desc`,`asc`];function A(e,t){return j(t===`alphanumeric`?O:k,e)??`unsorted`}function j(e,t,n){if(e.length===0)return n;let r=e.findIndex(e=>e===t);if(r===-1)return n;let i=(r+1)%e.length;return e.at(i)??n}function M(e){if(typeof e==`object`&&e&&`width`in e)return e.width===`fit`?`fit`:void 0}const N=u(null);function P(){return d(N)?.table.options}function F(){let e=d(N);return h(e,`useDataTableContext should only be used within a DataTable child component`),e}const I=u(null),L=/* @__PURE__ */ new Set;function R(e){return[...e.querySelectorAll(`:scope > tr`)]}function ee(e){let[,t=`0px`]=getComputedStyle(e).translate.split(` `);return e.offsetTop+(Number.parseFloat(t)||0)}function te(e,t,n){let r=/* @__PURE__ */ new Map,i=0,a=0;for(let o of R(e)){o.hasAttribute(`data-closing`)?a+=o.offsetHeight:(i+=a,a=0);let e=-i,s=t.get(o),c=s==null||Math.abs(s-o.offsetTop-e)<.5?e:s-o.offsetTop;r.set(o,o.offsetTop+e);let l=n.get(o);if(c!==e||(l?.to??0)!==e){if(n.delete(o),c!==e||e!==0){let t=o.animate([{translate:`0 ${c}px`},{translate:`0 ${e}px`}],{duration:c===e?0:200,easing:`cubic-bezier(0.23, 1, 0.32, 1)`,fill:e===0?`none`:`forwards`});n.set(o,{animation:t,to:e})}l?.animation.cancel()}}return r}function ne(){let e=c(14),[t,n]=m(L),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=/* @__PURE__ */ new Map,e[0]=r):r=e[0];let a=p(r),o;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=/* @__PURE__ */ new Map,e[1]=o):o=e[1];let s=p(o),l;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=/* @__PURE__ */ new WeakMap,e[2]=l):l=e[2];let u=p(l),d,h;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{let e=a.current,t=s.current;return()=>{for(let{timer:t}of e.values())clearTimeout(t);for(let{observer:e}of t.values())e.disconnect()}},h=[],e[3]=d,e[4]=h):(d=e[3],h=e[4]),f(d,h);let g;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(g=e=>{n(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n})},e[5]=g):g=e[5];let _=g,v;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(v=e=>{let t=s.current.get(e);if(t!=null&&t.before==null){for(let t of a.current.values())if(t.body===e)return;t.observer.disconnect(),s.current.delete(e)}},e[6]=v):v=e[6];let y=v,b;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(b=(e,t)=>{let n=s.current.get(e),r=t.filter(t=>t.type===`childList`?t.target===e:t.target.parentNode===e);if(n==null||r.length===0)return;let i=n.awaiting==null?null:a.current.get(n.awaiting);for(let e of r){let{target:t}=e;i!=null&&e.type===`attributes`&&t instanceof Element&&t.hasAttribute(`data-closing`)&&i.rows.add(t)}i!=null&&i.rows.size>0&&(n.awaiting=null);for(let[t,n]of a.current)n.body===e&&n.rows.size>0&&![...n.rows].some(ie)&&(clearTimeout(n.timer),a.current.delete(t),_(t));let o=n.before??n.rest;n.before=null,n.rest=te(e,o,u.current),y(e)},e[7]=b):b=e[7];let x=b,S;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>{let t=s.current.get(e);if(t==null){let n=new MutationObserver(t=>x(e,t));n.observe(e,{attributeFilter:[`data-closing`],childList:!0,subtree:!0}),t={observer:n,before:null,rest:/* @__PURE__ */ new Map,awaiting:null},s.current.set(e,t)}if(t.before==null){let n=new Map(R(e).map(re));t.before=n;let r=t;requestAnimationFrame(()=>{r.before===n&&(r.before=null,y(e))})}return t},e[8]=S):S=e[8];let C=S,w;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(w=(e,t)=>{e!=null&&!i()&&C(e),t()},e[9]=w):w=e[9];let T=w,E;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(E=e=>{let t=a.current.get(e);t!=null&&(clearTimeout(t.timer),a.current.delete(e),C(t.body)),_(e)},e[10]=E):E=e[10];let D=E,O;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(O=(e,t,r)=>{t==null||i()?r():(D(e),C(t).awaiting=e,a.current.set(e,{body:t,rows:/* @__PURE__ */ new Set,timer:setTimeout(()=>{a.current.delete(e),C(t),_(e),r()},200)}),n(t=>new Set(t).add(e)))},e[11]=O):O=e[11];let k=O,A;return e[12]===t?A=e[13]:(A={closingRowIds:t,startExpand:T,startCollapse:k,cancelCollapse:D},e[12]=t,e[13]=A),A}function re(e){return[e,ee(e)]}function ie(e){return e.isConnected}function ae(e){let n=c(21),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({"data-slot":i,children:r,table:o,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let l;n[5]===o?l=n[6]:(l={table:o},n[5]=o,n[6]=l);let u=l,d=ne(),f;n[7]===i?f=n[8]:(f=t(i,`data-table`),n[7]=i,n[8]=f);let p;n[9]===r?p=n[10]:(p=/* @__PURE__ */ _(s.Element,{children:r}),n[9]=r,n[10]=p);let m;n[11]!==a||n[12]!==f||n[13]!==p?(m=/* @__PURE__ */ _(s.Root,{"data-slot":f,...a,children:p}),n[11]=a,n[12]=f,n[13]=p,n[14]=m):m=n[14];let h;n[15]!==d||n[16]!==m?(h=/* @__PURE__ */ _(I.Provider,{value:d,children:m}),n[15]=d,n[16]=m,n[17]=h):h=n[17];let g;return n[18]!==u||n[19]!==h?(g=/* @__PURE__ */ _(N.Provider,{value:u,children:h}),n[18]=u,n[19]=h,n[20]=g):g=n[20],g}function oe(r){let i=c(33),a,o,s,l,u,d,f,p,m,h,g,v;i[0]===r?(a=i[1],o=i[2],s=i[3],l=i[4],u=i[5],d=i[6],f=i[7],p=i[8],m=i[9],h=i[10],g=i[11],v=i[12]):({"data-slot":l,appearance:m,children:a,className:o,column:s,disableSorting:h,iconPlacement:g,intent:v,sortingMode:p,sortIcon:d,onClick:u,...f}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=l,i[5]=u,i[6]=d,i[7]=f,i[8]=p,i[9]=m,i[10]=h,i[11]=g,i[12]=v);let b=m===void 0?`ghost`:m,x=h!==void 0&&h,S=g===void 0?`end`:g,C=v===void 0?`neutral`:v,w;i[13]!==b||i[14]!==a||i[15]!==o||i[16]!==s||i[17]!==l||i[18]!==x||i[19]!==S||i[20]!==C||i[21]!==u||i[22]!==d||i[23]!==f||i[24]!==p?(w=()=>{let r=s.getIsSorted(),i=!x&&s.getCanSort(),c=i&&typeof r==`string`?r:`unsorted`;if(!i)return/* @__PURE__ */ _(`span`,{"data-slot":t(l,`data-table-header-sort-button`),"data-sort-direction":`unsorted`,className:e(`flex w-full items-center justify-start`,b===`ghost`&&C===`neutral`&&`text-muted`,o),...f,children:a});let m=d?.(c)??/* @__PURE__ */ _(ye,{mode:p,direction:c});return/* @__PURE__ */ _(n,{appearance:b,"data-slot":t(l,`data-table-header-sort-button`),className:e(`flex justify-start w-full h-full rounded-none not-disabled:active:scale-none`,b===`ghost`&&C===`neutral`&&`text-muted`,o),"data-sort-direction":c,"data-table-header-action":!0,icon:m,iconPlacement:S,onClick:e=>{u?.(e),!e.defaultPrevented&&p!==void 0&&be(s,p)},intent:C,type:`button`,...f,children:a})},i[13]=b,i[14]=a,i[15]=o,i[16]=s,i[17]=l,i[18]=x,i[19]=S,i[20]=C,i[21]=u,i[22]=d,i[23]=f,i[24]=p,i[25]=w):w=i[25];let T=w,E=P(),D;i[26]!==s||i[27]!==E?(D=()=>({sorted:s.getIsSorted(),options:E}),i[26]=s,i[27]=E,i[28]=D):D=i[28];let O;return i[29]!==s.table.store||i[30]!==T||i[31]!==D?(O=/* @__PURE__ */ _(y,{source:s.table.store,selector:D,children:T}),i[29]=s.table.store,i[30]=T,i[31]=D,i[32]=O):O=i[32],O}const z=`w-px whitespace-nowrap`;function B(e){if(e==null)return;let t=b(e,`getIsSorted`,w);if(t===`asc`)return`ascending`;if(t===`desc`)return`descending`}function V(n){let r=c(21),i,a,o,l,u;r[0]===n?(i=r[1],a=r[2],o=r[3],l=r[4],u=r[5]):({"data-slot":l,children:i,className:a,column:o,...u}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=l,r[5]=u);let d;r[6]!==i||r[7]!==a||r[8]!==o||r[9]!==l||r[10]!==u?(d=()=>{let n=M(o?.columnDef.meta);return/* @__PURE__ */ _(s.Header,{"aria-sort":B(o),"data-column-width":n,"data-slot":t(l,`data-table-header`),className:e(`has-data-table-header-action:px-0`,n===`fit`&&z,a),...u,children:i})},r[6]=i,r[7]=a,r[8]=o,r[9]=l,r[10]=u,r[11]=d):d=r[11];let f=d,p=P();if(o==null){let e;return r[12]===f?e=r[13]:(e=f(),r[12]=f,r[13]=e),e}let m;r[14]!==o||r[15]!==p?(m=()=>({ariaSort:B(o),options:p}),r[14]=o,r[15]=p,r[16]=m):m=r[16];let h;return r[17]!==o.table.store||r[18]!==f||r[19]!==m?(h=/* @__PURE__ */ _(y,{source:o.table.store,selector:m,children:f}),r[17]=o.table.store,r[18]=f,r[19]=m,r[20]=h):h=r[20],h}function H(n){let r=c(17),i,a,o,l;r[0]===n?(i=r[1],a=r[2],o=r[3],l=r[4]):({"data-slot":o,className:i,column:a,...l}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=l);let u=a?.columnDef.meta,d;r[5]===u?d=r[6]:(d=M(u),r[5]=u,r[6]=d);let f=d,p;r[7]===o?p=r[8]:(p=t(o,`data-table-cell`),r[7]=o,r[8]=p);let m=f===`fit`&&z,h;r[9]!==i||r[10]!==m?(h=e(m,i),r[9]=i,r[10]=m,r[11]=h):h=r[11];let g;return r[12]!==l||r[13]!==p||r[14]!==h||r[15]!==f?(g=/* @__PURE__ */ _(s.Cell,{"data-column-width":f,"data-slot":p,className:h,...l}),r[12]=l,r[13]=p,r[14]=h,r[15]=f,r[16]=g):g=r[16],g}const U=e=>{let n=c(8),r,i;n[0]===e?(r=n[1],i=n[2]):({"data-slot":r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=t(r,`data-table-body`),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==a?(o=/* @__PURE__ */ _(s.Body,{"data-slot":a,...i}),n[5]=i,n[6]=a,n[7]=o):o=n[7],o};function W(e){let n=c(11),r,i;n[0]===e?(r=n[1],i=n[2]):({"data-slot":r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let{table:a}=F(),o;n[3]===r?o=n[4]:(o=t(r,`data-table-head`),n[3]=r,n[4]=o);let l;n[5]===a?l=n[6]:(l=a.getHeaderGroups().map(G),n[5]=a,n[6]=l);let u;return n[7]!==i||n[8]!==o||n[9]!==l?(u=/* @__PURE__ */ _(s.Head,{"data-slot":o,...i,children:l}),n[7]=i,n[8]=o,n[9]=l,n[10]=u):u=n[10],u}function G(e){return/* @__PURE__ */ _(s.Row,{children:e.headers.map(K)},e.id)}function K(e){return/* @__PURE__ */ _(l,{children:e.isPlaceholder?/* @__PURE__ */ _(s.Header,{}):x(e.column.columnDef.header,e.getContext())},e.id)}const q=e(`starting:-translate-y-1 starting:opacity-0`,`motion-safe:transition-[opacity,translate] motion-safe:duration-200 motion-safe:ease-out-strong`,`data-closing:pointer-events-none data-closing:opacity-0 motion-safe:data-closing:duration-150`);function J(e,t){return t.size===0||e.depth===0?!1:e.getParentRows().some(e=>t.has(e.id))}const Y=u(!1);function se(e){if(e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return!1;let t=e.currentTarget.ownerDocument.getSelection();return t==null||t.isCollapsed?!0:!e.currentTarget.contains(t.anchorNode)}function ce(n){let r=c(21),i,a,o,l,u,f;r[0]===n?(i=r[1],a=r[2],o=r[3],l=r[4],u=r[5],f=r[6]):({"data-slot":a,className:i,onClick:o,renderExpanded:u,row:f,...l}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=l,r[5]=u,r[6]=f);let p=d(I)?.closingRowIds??L,m;r[7]!==i||r[8]!==p||r[9]!==a||r[10]!==o||r[11]!==l||r[12]!==u||r[13]!==f?(m=()=>{let n=J(f,p),r=b(f,`getIsExpanded`,T),c=b(f,`getVisibleCells`,E),d=/* @__PURE__ */ _(s.Row,{"data-slot":t(a,`data-table-row`),"data-expanded":r||void 0,"data-closing":n||void 0,inert:n||void 0,"data-clickable":o==null?void 0:``,className:e(f.depth>0&&q,o!=null&&`cursor-pointer`,i),onClick:o&&(e=>{se(e)&&o(e)}),...l,children:/* @__PURE__ */ _(Y.Provider,{value:u!=null,children:c.map(le)})});return u==null?d:/* @__PURE__ */ v(g,{children:[d,r&&/* @__PURE__ */ _($,{row:f,children:u(f)})]})},r[7]=i,r[8]=p,r[9]=a,r[10]=o,r[11]=l,r[12]=u,r[13]=f,r[14]=m):m=r[14];let h=m,x=P(),S;r[15]===x?S=r[16]:(S=e=>({state:e,options:x}),r[15]=x,r[16]=S);let C;return r[17]!==h||r[18]!==f.table.store||r[19]!==S?(C=/* @__PURE__ */ _(y,{source:f.table.store,selector:S,children:h}),r[17]=h,r[18]=f.table.store,r[19]=S,r[20]=C):C=r[20],C}function le(e){return/* @__PURE__ */ _(l,{children:x(e.column.columnDef.cell,e.getContext())},e.id)}function ue(e){let n=c(15),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({"data-slot":i,children:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let{table:o}=F(),l;n[4]===o?l=n[5]:(l=b(o,`getVisibleLeafColumns`,D),n[4]=o,n[5]=l);let u=l.length,d;n[6]===i?d=n[7]:(d=t(i,`data-table-empty-row`),n[6]=i,n[7]=d);let f;n[8]!==r||n[9]!==u?(f=/* @__PURE__ */ _(s.Cell,{colSpan:u,children:r}),n[8]=r,n[9]=u,n[10]=f):f=n[10];let p;return n[11]!==a||n[12]!==d||n[13]!==f?(p=/* @__PURE__ */ _(s.Row,{"data-slot":d,...a,children:f}),n[11]=a,n[12]=d,n[13]=f,n[14]=p):p=n[14],p}function X(){let t=c(1),n;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=/* @__PURE__ */ _(`span`,{"aria-hidden":!0,className:e(`pointer-events-none absolute -inset-y-px -left-1.5 w-1.5`,`opacity-0 transition-opacity group-data-sticky-active/table:opacity-100`,`shadow-[1px_0_0_0_var(--border-color-card-muted)]`,`bg-linear-to-l to-transparent`,`from-[color-mix(in_oklab,var(--shadow-color)_var(--shadow-second-opacity),transparent)]`)}),t[0]=n):n=t[0],n}function de(n){let r=c(21),i,a,l,u,d;r[0]===n?(i=r[1],a=r[2],l=r[3],u=r[4],d=r[5]):({"data-slot":l,children:i,className:a,onClick:u,...d}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=l,r[4]=u,r[5]=d);let f;r[6]===u?f=r[7]:(f=o({allowClickEventDefault:!0,onClick:u}),r[6]=u,r[7]=f);let{onClick:p}=f,m;r[8]===l?m=r[9]:(m=t(l,`data-table-action-cell`),r[8]=l,r[9]=m);let h;r[10]===a?h=r[11]:(h=e(`sticky z-10 right-0 text-end align-middle bg-inherit p-2`,a),r[10]=a,r[11]=h);let g;r[12]===Symbol.for(`react.memo_cache_sentinel`)?(g=/* @__PURE__ */ _(X,{}),r[12]=g):g=r[12];let y;r[13]===i?y=r[14]:(y=/* @__PURE__ */ _(`span`,{"data-slot":`data-table-action-cell-label`,className:`contents`,children:i}),r[13]=i,r[14]=y);let b;return r[15]!==d||r[16]!==p||r[17]!==m||r[18]!==h||r[19]!==y?(b=/* @__PURE__ */ v(s.Cell,{"data-mantle-table-sticky-right":!0,"data-slot":m,className:h,onClick:p,...d,children:[g,y]}),r[15]=d,r[16]=p,r[17]=m,r[18]=h,r[19]=y,r[20]=b):b=r[20],b}function fe(n){let r=c(27),i,a,o,l;r[0]===n?(i=r[1],a=r[2],o=r[3],l=r[4]):({"data-slot":o,children:i,className:a,...l}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=l);let{table:u}=F(),d;r[5]===u?d=r[6]:(d=u.getRowModel(),r[5]=u,r[6]=d);let f=d.rows.length>0,p;r[7]===f?p=r[8]:(p=f?{"data-mantle-table-sticky-right":!0}:{},r[7]=f,r[8]=p);let m;r[9]===o?m=r[10]:(m=t(o,`data-table-action-header`),r[9]=o,r[10]=m);let h=f&&`sticky z-10 right-0 bg-inherit`,g;r[11]!==a||r[12]!==h?(g=e(h,a),r[11]=a,r[12]=h,r[13]=g):g=r[13];let y;r[14]===i?y=r[15]:(y=i??/* @__PURE__ */ _(`span`,{className:`sr-only`,children:`Actions`}),r[14]=i,r[15]=y);let b;r[16]===y?b=r[17]:(b=/* @__PURE__ */ _(`span`,{"data-slot":`data-table-action-header-label`,className:`contents`,children:y}),r[16]=y,r[17]=b);let x;r[18]===f?x=r[19]:(x=f&&/* @__PURE__ */ _(X,{}),r[18]=f,r[19]=x);let S;return r[20]!==l||r[21]!==p||r[22]!==m||r[23]!==g||r[24]!==b||r[25]!==x?(S=/* @__PURE__ */ v(s.Header,{...p,"data-slot":m,className:g,...l,children:[b,x]}),r[20]=l,r[21]=p,r[22]=m,r[23]=g,r[24]=b,r[25]=x,r[26]=S):S=r[26],S}function pe(e){return e!=null&&`nodeType`in e}function me({"data-slot":n,children:r,className:i,onClick:a,...o}){let c=p(!1);return/* @__PURE__ */ _(s.Cell,{"data-slot":t(n,`data-table-control-cell`),className:e(`w-9 px-0 align-top has-[button:enabled,input:enabled]:cursor-pointer`,i),onClick:e=>{if(c.current){e.stopPropagation();return}a?.(e);let t=e.currentTarget.querySelector(`button:not(:disabled), input:not(:disabled)`);if(t!=null&&(e.stopPropagation(),!e.defaultPrevented&&pe(e.target)&&!t.contains(e.target))){t.focus({preventScroll:!0}),c.current=!0;try{t.click()}finally{c.current=!1}}},...o,children:/* @__PURE__ */ _(`span`,{"data-slot":`data-table-control-cell-label`,className:`flex h-lh items-center justify-center`,children:r})})}function Z(e){return`data-table-expanded-row-${encodeURIComponent(e.id)}`}function Q(n){let r=c(16),i,a,o,l;r[0]===n?(i=r[1],a=r[2],o=r[3],l=r[4]):({"data-slot":o,children:i,className:a,...l}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=l);let u;r[5]===o?u=r[6]:(u=t(o,`data-table-expand-header`),r[5]=o,r[6]=u);let d;r[7]===a?d=r[8]:(d=e(`w-9 px-0 text-center`,a),r[7]=a,r[8]=d);let f;r[9]===i?f=r[10]:(f=i??/* @__PURE__ */ _(`span`,{className:`sr-only`,children:`Row details`}),r[9]=i,r[10]=f);let p;return r[11]!==l||r[12]!==u||r[13]!==d||r[14]!==f?(p=/* @__PURE__ */ _(s.Header,{"data-slot":u,className:d,...l,children:f}),r[11]=l,r[12]=u,r[13]=d,r[14]=f,r[15]=p):p=r[15],p}const he=/* @__PURE__ */ _(C,{weight:`bold`,className:`size-3.5`}),ge=/* @__PURE__ */ _(S,{weight:`bold`,className:`size-3.5`});function _e(n){let i=c(21),a,o,s,l,u,f,p,m,h,g,v;i[0]===n?(a=i[1],o=i[2],s=i[3],l=i[4],u=i[5],f=i[6],p=i[7],m=i[8],h=i[9],g=i[10],v=i[11]):({"data-slot":o,appearance:p,className:a,collapseIcon:m,expandIcon:h,intent:g,label:s,onClick:l,row:f,size:v,...u}=n,i[0]=n,i[1]=a,i[2]=o,i[3]=s,i[4]=l,i[5]=u,i[6]=f,i[7]=p,i[8]=m,i[9]=h,i[10]=g,i[11]=v);let b=p===void 0?`ghost`:p,x=m===void 0?ge:m,S=h===void 0?he:h,C=g===void 0?`neutral`:g,w=v===void 0?`sm`:v,T=()=>{if(!f.getCanExpand())return null;let n=f.getIsExpanded()&&!k,i=f.getToggleExpandedHandler(),c=f.subRows.length>0,d=D||!c;return/* @__PURE__ */ _(r,{type:`button`,"data-slot":t(o,`data-table-row-expand-button`),appearance:b,intent:C,size:w,className:e(`rounded`,a),"aria-expanded":n,"aria-controls":n&&d?Z(f):void 0,icon:n?x:S,label:c?`${n?`Collapse`:`Expand`} ${s}`:`${n?`Hide`:`Show`} details for ${s}`,onClick:e=>{if(e.stopPropagation(),l?.(e),e.defaultPrevented)return;let t=e.currentTarget.closest(`tbody`);O==null?i():k?O.cancelCollapse(f.id):n?O.startCollapse(f.id,t,()=>f.toggleExpanded(!1)):O.startExpand(t,i)},...u})},E=P(),D=d(Y),O=d(I),k=O?.closingRowIds.has(f.id)??!1,A;i[12]!==D||i[13]!==k||i[14]!==E||i[15]!==f?(A=()=>({isExpanded:f.getIsExpanded(),hasDetailPanel:D,isClosing:k,options:E}),i[12]=D,i[13]=k,i[14]=E,i[15]=f,i[16]=A):A=i[16];let j;return i[17]!==T||i[18]!==f.table.store||i[19]!==A?(j=/* @__PURE__ */ _(y,{source:f.table.store,selector:A,children:T}),i[17]=T,i[18]=f.table.store,i[19]=A,i[20]=j):j=i[20],j}function $(n){let r=c(29),i,a,o,l,u,f;r[0]===n?(i=r[1],a=r[2],o=r[3],l=r[4],u=r[5],f=r[6]):({"data-slot":l,children:i,className:a,colSpan:o,row:f,...u}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=l,r[5]=u,r[6]=f);let p;r[7]===f?p=r[8]:(p=()=>b(f,`getVisibleCells`,E).length,r[7]=f,r[8]=p);let m=p,h=d(I)?.closingRowIds??L,g;r[9]!==h||r[10]!==f?(g=h.has(f.id)||J(f,h),r[9]=h,r[10]=f,r[11]=g):g=r[11];let v=g,x;r[12]!==i||r[13]!==a||r[14]!==l||r[15]!==v||r[16]!==u||r[17]!==f?(x=n=>{let{numberOfColumns:r}=n;return/* @__PURE__ */ _(s.Row,{"data-slot":t(l,`data-table-expanded-row`),"data-expanded-content":!0,"data-closing":v||void 0,inert:v||void 0,className:e(`[&>td]:border-t-0`,q,a),...u,children:/* @__PURE__ */ _(s.Cell,{id:Z(f),colSpan:r,className:`bg-card font-sans text-body`,children:i})})},r[12]=i,r[13]=a,r[14]=l,r[15]=v,r[16]=u,r[17]=f,r[18]=x):x=r[18];let S=x,C=P();if(o!=null){let e;return r[19]!==o||r[20]!==S?(e=S({numberOfColumns:o}),r[19]=o,r[20]=S,r[21]=e):e=r[21],e}let w;r[22]!==m||r[23]!==C?(w=()=>({numberOfColumns:m(),options:C}),r[22]=m,r[23]=C,r[24]=w):w=r[24];let T;return r[25]!==S||r[26]!==f.table.store||r[27]!==w?(T=/* @__PURE__ */ _(y,{source:f.table.store,selector:w,children:S}),r[25]=S,r[26]=f.table.store,r[27]=w,r[28]=T):T=r[28],T}const ve={Root:ae,ActionCell:de,ActionHeader:fe,Cell:H,Body:U,EmptyRow:ue,Head:W,Header:V,HeaderSortButton:oe,Row:ce,ExpandHeader:Q,ControlCell:me,RowExpandButton:_e,ExpandedRow:$};function ye(e){let t=c(10),n,r,i;if(t[0]===e?(n=t[1],r=t[2],i=t[3]):({direction:n,mode:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i),n===`unsorted`||!r||!n){let e;return t[4]===i?e=t[5]:(e=/* @__PURE__ */ _(`svg`,{"aria-hidden":!0,...i}),t[4]=i,t[5]=e),e}let o;return t[6]!==n||t[7]!==r||t[8]!==i?(o=/* @__PURE__ */ _(a,{mode:r,direction:n,...i}),t[6]=n,t[7]=r,t[8]=i,t[9]=o):o=t[9],o}function be(e,t){if(!e.getCanSort())return;let n=e.getIsSorted();switch(A(typeof n==`string`?n:`unsorted`,t)){case`unsorted`:e.clearSorting();return;case`asc`:e.toggleSorting(!1);return;case`desc`:e.toggleSorting(!0);return;default:return}}export{ve as DataTable,Z as expandedRowId};
|
package/dist/input.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./icon-kK0c-POG.js";import{
|
|
1
|
+
import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./icon-kK0c-POG.js";import{t as r}from"./use-prefers-reduced-motion-DimzRx-M.js";import{n as i,t as a}from"./input-eEKzP3cE.js";import{t as o}from"./input-DQyN6gN0.js";import{c as s}from"react/compiler-runtime";import{useId as c,useRef as l,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{EyeIcon as p}from"@phosphor-icons/react/Eye";import{EyeClosedIcon as m}from"@phosphor-icons/react/EyeClosed";const h=o=>{let h=s(34),g,_,v,y,b,x,S;h[0]===o?(g=h[1],_=h[2],v=h[3],y=h[4],b=h[5],x=h[6],S=h[7]):({"data-slot":g,disabled:_,id:v,onValueVisibilityChange:y,ref:x,showValue:S,...b}=o,h[0]=o,h[1]=g,h[2]=_,h[3]=v,h[4]=y,h[5]=b,h[6]=x,h[7]=S);let C=c(),w=v??C,T=S!=null,[E,D]=u(!1),O=T?S:E,k=O?`text`:`password`,A=O?p:m,j=l(null),M=l(O),N,P;h[8]===O?(N=h[9],P=h[10]):(N=()=>{if(M.current===O)return;M.current=O;let e=j.current;e==null||r()||e.animate([{transform:`scaleY(0)`},{transform:`scaleY(1)`}],{duration:200,easing:`ease-out`})},P=[O],h[8]=O,h[9]=N,h[10]=P),e(N,P);let F;h[11]===g?F=h[12]:(F=t(g,`password-input`),h[11]=g,h[12]=F);let I;h[13]===Symbol.for(`react.memo_cache_sentinel`)?(I=/* @__PURE__ */ d(i,{}),h[13]=I):I=h[13];let L;h[14]!==T||h[15]!==y||h[16]!==O?(L=()=>{let e=!O;T||D(e),y?.(e)},h[14]=T,h[15]=y,h[16]=O,h[17]=L):L=h[17];let R;h[18]===A?R=h[19]:(R=/* @__PURE__ */ d(n,{ref:j,svg:/* @__PURE__ */ d(A,{"aria-hidden":!0})}),h[18]=A,h[19]=R);let z;h[20]!==_||h[21]!==w||h[22]!==O||h[23]!==L||h[24]!==R?(z=/* @__PURE__ */ d(`button`,{type:`button`,disabled:_,"data-slot":`password-input-toggle`,"aria-label":`Show value`,"aria-pressed":O,"aria-controls":w,className:`text-body hover:text-strong focus-visible:ring-focus-accent ml-1 cursor-pointer rounded-xs bg-inherit p-0 focus-visible:ring-2 focus-visible:outline-hidden`,onClick:L,children:R}),h[20]=_,h[21]=w,h[22]=O,h[23]=L,h[24]=R,h[25]=z):z=h[25];let B;return h[26]!==_||h[27]!==w||h[28]!==b||h[29]!==x||h[30]!==F||h[31]!==z||h[32]!==k?(B=/* @__PURE__ */ f(a,{"data-slot":F,disabled:_,id:w,type:k,ref:x,...b,children:[I,z]}),h[26]=_,h[27]=w,h[28]=b,h[29]=x,h[30]=F,h[31]=z,h[32]=k,h[33]=B):B=h[33],B};export{a as Input,i as InputCapture,h as PasswordInput,o as isInput};
|
package/dist/llms.txt
CHANGED