@ngrok/mantle 0.78.0 → 0.79.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent.json +1 -1
- package/dist/alert-dialog.d.ts +85 -46
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.d.ts +24 -16
- package/dist/alert.js +1 -1
- package/dist/button-ClC60Nzg.js +1 -0
- package/dist/{button-Bw9MpShl.d.ts → button-DcXOWUYo.d.ts} +49 -7
- package/dist/button.d.ts +6 -5
- package/dist/button.js +1 -1
- package/dist/calendar.js +1 -1
- package/dist/centered-layout.d.ts +17 -5
- package/dist/code-block.js +1 -1
- package/dist/command.d.ts +12 -12
- package/dist/command.js +1 -1
- package/dist/data-table.d.ts +36 -10
- package/dist/data-table.js +1 -1
- package/dist/{dialog-DVDFVT_-.js → dialog-ZCgG41hx.js} +1 -1
- package/dist/dialog.d.ts +72 -54
- package/dist/dialog.js +1 -1
- package/dist/dropdown-menu-Bt1aKF1g.js +1 -0
- package/dist/{dropdown-menu-DT30TQzL.d.ts → dropdown-menu-DP_Ne9Mr.d.ts} +7 -4
- package/dist/dropdown-menu.d.ts +2 -2
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty.d.ts +12 -12
- package/dist/field.d.ts +19 -2
- package/dist/field.js +1 -1
- package/dist/hover-card.d.ts +9 -7
- package/dist/{icon-button-DuRSCsPh.d.ts → icon-button-B7uEj1qq.d.ts} +68 -5
- package/dist/icon-button-DV2-GZHf.js +1 -0
- package/dist/{index-CDwfBOAA.d.ts → index-BivvYYs-.d.ts} +5 -5
- package/dist/index-g2rfwNCH.d.ts +1 -0
- package/dist/intents-DdSKSj1c.d.ts +28 -0
- package/dist/llms.txt +1 -1
- package/dist/pagination.d.ts +1 -1
- package/dist/pagination.js +1 -1
- package/dist/popover.d.ts +11 -11
- package/dist/{primitive-wm7Wk-gy.js → primitive-M-kZdNIS.js} +1 -1
- package/dist/sheet.d.ts +81 -52
- package/dist/sheet.js +1 -1
- package/dist/{sizes-Dje_rwKc.d.ts → sizes-BCoI4bhP.d.ts} +2 -2
- package/dist/split-button.d.ts +8 -7
- package/dist/split-button.js +1 -1
- package/dist/theme-switcher.d.ts +150 -21
- package/dist/theme-switcher.js +1 -1
- package/dist/toast-D3ntBmn4.js +1 -0
- package/dist/toast.d.ts +19 -13
- package/dist/toast.js +1 -1
- package/dist/tooltip.d.ts +6 -6
- package/package.json +1 -1
- package/dist/button-AS5Ir3DE.js +0 -1
- package/dist/dropdown-menu-ByUQkAvJ.js +0 -1
- package/dist/icon-button-CxVsZ2N1.js +0 -1
- package/dist/index-BnI3OppC.d.ts +0 -1
- package/dist/toast-RkhbliFh.js +0 -1
|
@@ -32,7 +32,10 @@ import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
|
|
|
32
32
|
* </Main>
|
|
33
33
|
* </CenteredLayout.Body>
|
|
34
34
|
* <CenteredLayout.Footer>
|
|
35
|
-
* <ThemeSwitcher
|
|
35
|
+
* <ThemeSwitcher.Root>
|
|
36
|
+
* <ThemeSwitcher.Trigger />
|
|
37
|
+
* <ThemeSwitcher.Content />
|
|
38
|
+
* </ThemeSwitcher.Root>
|
|
36
39
|
* </CenteredLayout.Footer>
|
|
37
40
|
* </CenteredLayout.Root>
|
|
38
41
|
* ```
|
|
@@ -59,7 +62,10 @@ declare const CenteredLayout: {
|
|
|
59
62
|
* </Main>
|
|
60
63
|
* </CenteredLayout.Body>
|
|
61
64
|
* <CenteredLayout.Footer>
|
|
62
|
-
* <ThemeSwitcher
|
|
65
|
+
* <ThemeSwitcher.Root>
|
|
66
|
+
* <ThemeSwitcher.Trigger />
|
|
67
|
+
* <ThemeSwitcher.Content />
|
|
68
|
+
* </ThemeSwitcher.Root>
|
|
63
69
|
* </CenteredLayout.Footer>
|
|
64
70
|
* </CenteredLayout.Root>
|
|
65
71
|
* ```
|
|
@@ -79,7 +85,7 @@ declare const CenteredLayout: {
|
|
|
79
85
|
* <CenteredLayout.Root>
|
|
80
86
|
* <CenteredLayout.Header className="sticky top-0 z-10 justify-between">
|
|
81
87
|
* <AccountChip />
|
|
82
|
-
* <IconButton type="button" label="Close" icon={<XIcon />} />
|
|
88
|
+
* <IconButton appearance="ghost" intent="neutral" type="button" label="Close" icon={<XIcon />} />
|
|
83
89
|
* </CenteredLayout.Header>
|
|
84
90
|
* <CenteredLayout.Body>
|
|
85
91
|
* <div className="w-full max-w-5xl">
|
|
@@ -110,7 +116,10 @@ declare const CenteredLayout: {
|
|
|
110
116
|
* </Main>
|
|
111
117
|
* </CenteredLayout.Body>
|
|
112
118
|
* <CenteredLayout.Footer>
|
|
113
|
-
* <ThemeSwitcher
|
|
119
|
+
* <ThemeSwitcher.Root>
|
|
120
|
+
* <ThemeSwitcher.Trigger />
|
|
121
|
+
* <ThemeSwitcher.Content />
|
|
122
|
+
* </ThemeSwitcher.Root>
|
|
114
123
|
* </CenteredLayout.Footer>
|
|
115
124
|
* </CenteredLayout.Root>
|
|
116
125
|
* ```
|
|
@@ -136,7 +145,10 @@ declare const CenteredLayout: {
|
|
|
136
145
|
* </Main>
|
|
137
146
|
* </CenteredLayout.Body>
|
|
138
147
|
* <CenteredLayout.Footer>
|
|
139
|
-
* <ThemeSwitcher
|
|
148
|
+
* <ThemeSwitcher.Root>
|
|
149
|
+
* <ThemeSwitcher.Trigger />
|
|
150
|
+
* <ThemeSwitcher.Content />
|
|
151
|
+
* </ThemeSwitcher.Root>
|
|
140
152
|
* </CenteredLayout.Footer>
|
|
141
153
|
* </CenteredLayout.Root>
|
|
142
154
|
* ```
|
package/dist/code-block.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./compose-refs-Cjf2gfB8.js";import{t}from"./cx-IiQEAKf5.js";import{t as n}from"./icon-CDtYjF_H.js";import{t as r}from"./slot-DmPrjM7N.js";import{t as i}from"./icon-button-
|
|
1
|
+
import{t as e}from"./compose-refs-Cjf2gfB8.js";import{t}from"./cx-IiQEAKf5.js";import{t as n}from"./icon-CDtYjF_H.js";import{t as r}from"./slot-DmPrjM7N.js";import{t as i}from"./icon-button-DV2-GZHf.js";import{t as a}from"./use-copy-to-clipboard-DqQ0_N3E.js";import{t as o}from"./traffic-policy-file-0g5RXFqu.js";import{S as s,_ as c,a as l,b as u,c as d,d as f,f as p,g as m,h,i as g,l as _,m as v,n as y,o as b,p as x,r as S,s as C,t as w,u as T,v as E,y as D}from"./resolve-pre-rendered-props-C3e5Auo3.js";import{CaretDownIcon as O}from"@phosphor-icons/react/CaretDown";import{createContext as ee,forwardRef as k,useCallback as A,useContext as te,useEffect as j,useId as ne,useLayoutEffect as re,useMemo as M,useRef as N,useState as P}from"react";import F from"tiny-invariant";import{jsx as I,jsxs as ie}from"react/jsx-runtime";import{CheckIcon as ae}from"@phosphor-icons/react/Check";import{CopyIcon as oe}from"@phosphor-icons/react/Copy";import{FileTextIcon as se}from"@phosphor-icons/react/FileText";import{TerminalIcon as ce}from"@phosphor-icons/react/Terminal";import{Content as le,List as ue,Root as de,Trigger as fe}from"@radix-ui/react-tabs";function L(e){let t=-1;for(let n=0;n<e.length;n++){let r=e[n];if(r===`&`||r===`<`||r===`>`||r===`"`||r===`'`){t=n;break}}if(t===-1)return e;let n=e.slice(0,t);for(let r=t;r<e.length;r++){let t=e[r];switch(t){case`&`:n+=`&`;break;case`<`:n+=`<`;break;case`>`:n+=`>`;break;case`"`:n+=`"`;break;case`'`:n+=`'`;break;default:n+=t}}return n}const R=new WeakMap;function z(e){let t=new Set;if(e==null||e===``)return t;for(let n of e.split(` `))n!==``&&t.add(n);return t}function pe(e){let t=R.get(e);if(t!=null&&ge(t))return t;let n=new Map,r=new WeakMap,i=e.querySelectorAll(`[data-fold-regions]`);for(let e=0;e<i.length;e+=1){let t=i[e];if(!(t instanceof HTMLElement))continue;let a=z(t.dataset.foldRegions);if(a.size!==0){r.set(t,a);for(let e of a){let r=n.get(e);r??(r=[],n.set(e,r)),r.push(t)}}}let a={regionToLines:n,lineToRegions:r};return R.set(e,a),a}function me(e){R.delete(e)}function he(e){me(e),e.removeAttribute(`data-folded-regions`)}function ge(e){for(let t of e.regionToLines.values()){if(t.length===0)continue;let e=t[0];if(e!=null)return e.isConnected}return!0}function _e(e,t,n){let r=!1;for(let e of n)if(t.has(e)){r=!0;break}r?e.dataset.foldHidden=`true`:delete e.dataset.foldHidden}function ve(e){let t=e.dataset.foldLine;if(t==null||t===``)return!1;let n=e.closest(`[data-slot='code-block-code']`)?.querySelector(`code`);if(n==null)return!1;let r=z(n.getAttribute(`data-folded-regions`)),i=!r.has(t);i?r.add(t):r.delete(t),r.size===0?n.removeAttribute(`data-folded-regions`):n.setAttribute(`data-folded-regions`,[...r].join(` `)),e.setAttribute(`aria-expanded`,i?`false`:`true`);let{regionToLines:a,lineToRegions:o}=pe(n),s=a.get(t);if(s!=null)for(let e of s){let t=o.get(e);t!=null&&_e(e,r,t)}return!0}function ye(e){let t=e=>{let t=e.target;if(!(t instanceof Element))return;let n=t.closest(`.mantle-code-fold-toggle`);n instanceof HTMLButtonElement&&ve(n)};return e.addEventListener(`click`,t),()=>{e.removeEventListener(`click`,t)}}const B=ee(null);function V(){let e=te(B);return F(e!=null,`CodeBlock subcomponents must be rendered within a <CodeBlock.Root>.`),e}const H=k(({asChild:e=!1,className:n,defaultTab:i,activeTab:a,onActiveTabChange:o,...s},c)=>{let l=N(``),[u,d]=P(!1),[f,p]=P(!1),[m,h]=P(void 0),g=A(e=>{h(t=>(F(t==null,`You can only render a single CodeBlock.Code within a CodeBlock.`),e))},[]),_=A(e=>{h(t=>{F(t===e,`You can only render a single CodeBlock.Code within a CodeBlock.`)})},[]),v=M(()=>({codeId:m,copyTextRef:l,hasCodeExpander:u,isCodeExpanded:f,registerCodeId:g,setHasCodeExpander:d,setIsCodeExpanded:p,unregisterCodeId:_}),[m,u,f,g,_]),y=i!=null||a!=null,b=I(e?r:`div`,{"data-slot":`code-block`,className:t(`text-mono w-full overflow-hidden rounded-md border border-gray-300 bg-card font-mono`,`[&_svg]:shrink-0`,n),ref:c,...s});return I(B.Provider,{value:v,children:y?I(de,{asChild:!0,defaultValue:i,value:a,onValueChange:o,children:b}):b})});H.displayName=`CodeBlock`;const U=k(({asChild:e=!1,className:n,...i},a)=>I(e?r:`div`,{"data-slot":`code-block-body`,className:t(`relative`,n),ref:a,...i}));U.displayName=`CodeBlockBody`;const be=/SHIKI_VAL_(\d+)/g;function xe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}const W=new Map;function Se(e){if(e==null||e.length===0)return be;let t=W.get(e);return t??(W.size>=500&&W.clear(),t=RegExp(`${xe(e)}(\\d+)__`,`g`),W.set(e,t)),t}function G(e,t,n,r){if(n==null){if(!e.includes(`SHIKI_VAL_`))return e}else if(!e.includes(n))return e;return e.replaceAll(Se(n),(e,n)=>{let i=Number.parseInt(n,10);return Number.isNaN(i)||i<0||i>=t.length?e:r(t[i])})}function Ce(e,t,n){return G(e,t,n,e=>L(String(e)))}function we(e,t,n){return G(e,t,n,e=>String(e))}const K=k(({className:n,style:r,value:i,...a},o)=>{let s=ne(),c=N(null),{copyTextRef:l,hasCodeExpander:u,isCodeExpanded:d,registerCodeId:f,unregisterCodeId:p}=V(),{language:m,code:h,"~preValToken":g,"~preVals":_,"~highlightLines":v,"~lineNumberStart":y,"~preHtml":b,"~showLineNumbers":x}=i,S=v,C=y??1,w=x??!1,T=M(()=>_!=null&&_.length>0?we(h,_,g):h,[g,_,h]);re(()=>{l.current=T},[l,T]),j(()=>(f(s),()=>{p(s)}),[s,f,p]);let E=M(()=>{if(b!=null)return _!=null&&_.length>0?Ce(b,_,g):b},[b,g,_]);j(()=>{let e=c.current;if(e==null)return;let t=e.querySelector(`code`);return t!=null&&he(t),ye(e)},[E]);let D=E!=null,O=E??L(T),ee=M(()=>({__html:O}),[O]);return I(`pre`,{"data-slot":`code-block-code`,"aria-expanded":u?d:void 0,className:t(`scrollbar overflow-x-auto overflow-y-hidden py-4`,!D&&`pr-14`,`data-[mantle-line-numbers~='false']:pl-4`,`text-mono m-0 font-mono outline-hidden`,`aria-collapsed:max-h-[13.6rem]`,n),"data-highlighted":D?`true`:`false`,"data-lang":m,"data-mantle-highlight-lines":D&&S!=null&&S.length>0?S.join(`,`):void 0,"data-mantle-line-number-start":D&&w?String(C):`1`,"data-mantle-line-numbers":D&&w?`true`:`false`,id:s,ref:e(c,o),style:{...r,"--mantle-line-number-start":String(C),tabSize:2,MozTabSize:2},...a,children:I(`code`,{className:`text-size-inherit block min-w-full w-max`,dangerouslySetInnerHTML:ee})})});K.displayName=`CodeBlockCode`;const q=k(({asChild:e=!1,className:n,...i},a)=>I(e?r:`div`,{"data-slot":`code-block-header`,className:t(`flex items-center gap-1 border-b border-gray-300 bg-base px-4 py-2 text-gray-700`,n),ref:a,...i}));q.displayName=`CodeBlockHeader`;const J=k(({asChild:e=!1,className:n,...i},a)=>I(e?r:`h3`,{"data-slot":`code-block-title`,ref:a,className:t(`text-mono m-0 font-mono font-normal`,n),...i}));J.displayName=`CodeBlockTitle`;const Y=k(({className:e,label:t=`Copy code`,onCopy:n,onCopyError:r,onClick:o,...s},c)=>{let{copyTextRef:l}=V(),u=a(),[d,f]=P(!1),p=N(void 0);return j(()=>()=>{p.current!=null&&clearTimeout(p.current)},[]),I(`span`,{"data-slot":`code-block-copy-button`,className:`absolute right-3 top-3 z-10 inline-flex size-7 items-center justify-center rounded-[var(--icon-button-border-radius,0.375rem)] bg-card`,children:I(i,{type:`button`,appearance:`ghost`,intent:`neutral`,size:`sm`,label:t,icon:I(d?ae:oe,{}),className:e,ref:c,onClick:async e=>{try{if(o?.(e),e.defaultPrevented){p.current!=null&&clearTimeout(p.current);return}let t=l.current;await u(t),n?.(t),f(!0),p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{f(!1)},2e3)}catch(e){r?.(e)}},...s})})});Y.displayName=`CodeBlockCopyButton`;const X=k(({asChild:e=!1,className:i,onClick:a,...o},s)=>{let{codeId:c,isCodeExpanded:l,setIsCodeExpanded:u,setHasCodeExpander:d}=V();return j(()=>(d(!0),()=>{d(!1)}),[d]),ie(e?r:`button`,{...o,"data-slot":`code-block-expander-button`,"aria-controls":c,"aria-expanded":l,className:t(`flex w-full items-center justify-center gap-0.5 border-t border-gray-300 bg-card px-4 py-2 font-sans text-gray-700 hover:bg-gray-100`,i),ref:s,type:`button`,onClick:e=>{u(e=>!e),a?.(e)},children:[l?`Show less`:`Show more`,` `,I(n,{svg:I(O,{weight:`bold`}),className:t(`size-4`,l&&`rotate-180`,`transition-all duration-150`)})]})});X.displayName=`CodeBlockExpanderButton`;function Z({className:e,preset:t,svg:r,...i}){let a=r;if(t!=null)switch(t){case`file`:a=I(se,{weight:`fill`});break;case`cli`:a=I(ce,{weight:`fill`});break;case`traffic-policy`:a=I(o,{});break}return I(n,{"data-slot":`code-block-icon`,className:e,svg:a,...i})}Z.displayName=`CodeBlockIcon`;const Q=k(({className:e,...n},r)=>I(ue,{"data-slot":`code-block-tab-list`,className:t(`scroll-fade-x flex min-w-0 items-center gap-1 overflow-x-auto overscroll-x-none`,`-m-1 p-1`,e),ref:r,...n}));Q.displayName=`CodeBlockTabList`;const Te=k(({className:e,...n},r)=>I(fe,{"data-slot":`code-block-tab-trigger`,className:t(`shrink-0 cursor-pointer rounded px-1.5 py-0.5 text-xs font-medium whitespace-nowrap`,`text-gray-600 outline-hidden`,`hover:text-gray-900`,`data-[state=active]:bg-neutral-500/15 data-[state=active]:text-strong`,`focus-visible:ring-focus-accent focus-visible:ring-4`,e),ref:r,...n}));Te.displayName=`CodeBlockTabTrigger`;const Ee=k((e,t)=>I(le,{"data-slot":`code-block-tab-content`,ref:t,...e}));Ee.displayName=`CodeBlockTabContent`;const De={Root:H,Body:U,Code:K,CopyButton:Y,ExpanderButton:X,Header:q,Icon:Z,TabContent:Ee,TabList:Q,TabTrigger:Te,Title:J},Oe=`var(--shiki-foreground)`;function ke(e){return e.replace(/[&<]/g,e=>e===`&`?`&`:`<`)}function Ae(e){return e===` `||e===` `||e===`
|
|
2
2
|
`||e===`\r`||e===`{`||e===`}`||e===`[`||e===`]`||e===`:`||e===`,`||e===`"`}function je(e,t,n){let r=e.length,i=[],a=`"`,o=t+1;for(;o<r;){let t=e[o];if(t===`\\`){let t=e[o+1]===`u`&&/^[0-9a-fA-F]{4}$/.test(e.slice(o+2,o+6))?6:2;a!==``&&(i.push({text:a,isEscape:!1}),a=``),i.push({text:e.slice(o,o+t),isEscape:!0}),o+=t;continue}if(t===`"`){a+=`"`,o+=1;break}a+=t,o+=1}a!==``&&i.push({text:a,isEscape:!1});let s=o;for(;s<r;){let t=e[s];if(t===` `||t===` `||t===`
|
|
3
3
|
`||t===`\r`){s+=1;continue}break}let c=e[s]===`:`?`var(--shiki-token-keyword)`:`var(--shiki-token-string-expression)`;for(let e of i)n(e.text,e.isEscape?`var(--shiki-token-escape, var(--shiki-token-constant))`:c);return o}function Me(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(n!=null&&n.color==null){let r=Oe;for(let n=t+1;n<e.length;n+=1){let t=e[n];if(t!=null&&t.color!=null){r=t.color;break}}n.color=r}}let t=``,n=``,r=null,i=()=>{r!=null&&(t+=`<span style="color:${r}">${ke(n)}</span>`),n=``,r=null};for(let t of e)t!=null&&(t.color===r?n+=t.text:(i(),n=t.text,r=t.color));return i(),`<span class="line">${t}</span>`}function $(e){let t=[[]],n=t[0]??[],r=e.length,i=0,a=(e,t)=>{n.push({text:e,color:t})};for(;i<r;){let o=e[i];if(o===`
|
|
4
4
|
`||o===`\r`){o===`\r`&&e[i+1]===`
|
package/dist/command.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ type CommandDialogContentProps = {
|
|
|
58
58
|
* ```tsx
|
|
59
59
|
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
60
60
|
* <Command.DialogTrigger asChild>
|
|
61
|
-
* <Button type="button">Open Command Palette</Button>
|
|
61
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
62
62
|
* </Command.DialogTrigger>
|
|
63
63
|
* <Command.DialogContent>
|
|
64
64
|
* <Command.Input placeholder="Type a command or search..." />
|
|
@@ -109,7 +109,7 @@ declare const CommandDialogContent: {
|
|
|
109
109
|
* ```tsx
|
|
110
110
|
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
111
111
|
* <Command.DialogTrigger asChild>
|
|
112
|
-
* <Button type="button">Open Command Palette</Button>
|
|
112
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
113
113
|
* </Command.DialogTrigger>
|
|
114
114
|
* <Command.DialogContent>
|
|
115
115
|
* <Command.Input placeholder="Type a command or search..." />
|
|
@@ -142,7 +142,7 @@ declare const Command: {
|
|
|
142
142
|
* ```tsx
|
|
143
143
|
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
144
144
|
* <Command.DialogTrigger asChild>
|
|
145
|
-
* <Button type="button">Open Command Palette</Button>
|
|
145
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
146
146
|
* </Command.DialogTrigger>
|
|
147
147
|
* <Command.DialogContent>
|
|
148
148
|
* <Command.Input placeholder="Type a command or search..." />
|
|
@@ -191,7 +191,7 @@ declare const Command: {
|
|
|
191
191
|
* ```tsx
|
|
192
192
|
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
193
193
|
* <Command.DialogTrigger asChild>
|
|
194
|
-
* <Button type="button">Open Command Palette</Button>
|
|
194
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
195
195
|
* </Command.DialogTrigger>
|
|
196
196
|
* <Command.DialogContent>
|
|
197
197
|
* <Command.Input placeholder="Type a command or search..." />
|
|
@@ -211,7 +211,7 @@ declare const Command: {
|
|
|
211
211
|
* @example
|
|
212
212
|
* ```tsx
|
|
213
213
|
* <Command.DialogTrigger asChild>
|
|
214
|
-
* <Button type="button">Open Command Palette</Button>
|
|
214
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
215
215
|
* </Command.DialogTrigger>
|
|
216
216
|
* ```
|
|
217
217
|
*/
|
|
@@ -241,7 +241,7 @@ declare const Command: {
|
|
|
241
241
|
* ```tsx
|
|
242
242
|
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
243
243
|
* <Command.DialogTrigger asChild>
|
|
244
|
-
* <Button type="button">Open Command Palette</Button>
|
|
244
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
245
245
|
* </Command.DialogTrigger>
|
|
246
246
|
* <Command.DialogContent>
|
|
247
247
|
* <Command.Input placeholder="Type a command or search..." />
|
|
@@ -281,7 +281,7 @@ declare const Command: {
|
|
|
281
281
|
* ```tsx
|
|
282
282
|
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
283
283
|
* <Command.DialogTrigger asChild>
|
|
284
|
-
* <Button type="button">Open Command Palette</Button>
|
|
284
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
285
285
|
* </Command.DialogTrigger>
|
|
286
286
|
* <Command.DialogContent>
|
|
287
287
|
* <Command.Input placeholder="Type a command or search..." />
|
|
@@ -322,7 +322,7 @@ declare const Command: {
|
|
|
322
322
|
* ```tsx
|
|
323
323
|
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
324
324
|
* <Command.DialogTrigger asChild>
|
|
325
|
-
* <Button type="button">Open Command Palette</Button>
|
|
325
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
326
326
|
* </Command.DialogTrigger>
|
|
327
327
|
* <Command.DialogContent>
|
|
328
328
|
* <Command.Input placeholder="Type a command or search..." />
|
|
@@ -361,7 +361,7 @@ declare const Command: {
|
|
|
361
361
|
* ```tsx
|
|
362
362
|
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
363
363
|
* <Command.DialogTrigger asChild>
|
|
364
|
-
* <Button type="button">Open Command Palette</Button>
|
|
364
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
365
365
|
* </Command.DialogTrigger>
|
|
366
366
|
* <Command.DialogContent>
|
|
367
367
|
* <Command.Input placeholder="Type a command or search..." />
|
|
@@ -404,7 +404,7 @@ declare const Command: {
|
|
|
404
404
|
* ```tsx
|
|
405
405
|
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
406
406
|
* <Command.DialogTrigger asChild>
|
|
407
|
-
* <Button type="button">Open Command Palette</Button>
|
|
407
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
408
408
|
* </Command.DialogTrigger>
|
|
409
409
|
* <Command.DialogContent>
|
|
410
410
|
* <Command.Input placeholder="Type a command or search..." />
|
|
@@ -449,7 +449,7 @@ declare const Command: {
|
|
|
449
449
|
* ```tsx
|
|
450
450
|
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
451
451
|
* <Command.DialogTrigger asChild>
|
|
452
|
-
* <Button type="button">Open Command Palette</Button>
|
|
452
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
453
453
|
* </Command.DialogTrigger>
|
|
454
454
|
* <Command.DialogContent>
|
|
455
455
|
* <Command.Input placeholder="Type a command or search..." />
|
|
@@ -482,7 +482,7 @@ declare const Command: {
|
|
|
482
482
|
* ```tsx
|
|
483
483
|
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
484
484
|
* <Command.DialogTrigger asChild>
|
|
485
|
-
* <Button type="button">Open Command Palette</Button>
|
|
485
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
486
486
|
* </Command.DialogTrigger>
|
|
487
487
|
* <Command.DialogContent>
|
|
488
488
|
* <Command.Input placeholder="Type a command or search..." />
|
package/dist/command.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{n as t}from"./separator-kBnnv3Cw.js";import{t as n}from"./dialog-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{n as t}from"./separator-kBnnv3Cw.js";import{t as n}from"./dialog-ZCgG41hx.js";import{t as r}from"./kbd-K8iaZ-Ti.js";import{forwardRef as i,useEffect as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{MagnifyingGlassIcon as l}from"@phosphor-icons/react/MagnifyingGlass";import{Command as u,useCommandState as d}from"cmdk";const f=i(({className:t,...n},r)=>s(u,{ref:r,"data-slot":`command`,className:e(`bg-popover flex h-full w-full flex-col overflow-hidden rounded-md`,t),...n}));f.displayName=`Command`;const p=({children:t,className:r,description:i=`Search for a command to run...`,filter:a,shouldFilter:o,showCloseButton:l=!0,title:u=`Command Palette`})=>c(n.Content,{className:e(`overflow-hidden p-0 relative`,r),children:[c(n.Header,{className:`sr-only absolute`,children:[s(n.Title,{children:u}),s(n.Description,{children:i})]}),s(f,{className:`**:data-[slot=command-input-wrapper]:h-12 **:[[cmdk-input]]:h-12 **:data-[slot=command-group]:px-2 **:data-[slot=command-list]:pb-1`,filter:a,shouldFilter:o,children:t}),l&&s(`div`,{className:`absolute top-1.5 right-1.5`,children:s(n.CloseIconButton,{})})]});p.displayName=`CommandDialogContent`;const m=i(({className:t,...n},r)=>c(`div`,{ref:r,"data-slot":`command-input-wrapper`,className:`flex h-9 items-center gap-2 border-b border-popover px-3`,children:[s(l,{className:`size-5 shrink-0 opacity-50`}),s(u.Input,{"data-slot":`command-input`,className:e(`placeholder:text-muted flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,t),...n})]}));m.displayName=`CommandInput`;const h=i(({className:t,...n},r)=>s(u.List,{ref:r,"data-slot":`command-list`,className:e(`max-h-75 scroll-py-1 overflow-x-hidden overflow-y-auto scrollbar`,t),...n}));h.displayName=`CommandList`;const g=i(({className:t,...n},r)=>s(u.Empty,{ref:r,"data-slot":`command-empty`,className:e(`py-6 text-center text-sm`,t),...n}));g.displayName=`CommandEmpty`;const _=i(({className:t,...n},r)=>s(u.Group,{ref:r,"data-slot":`command-group`,className:e(`[&>[cmdk-group-heading]]:text-muted overflow-hidden p-1 [&>[cmdk-group-heading]]:px-2 [&>[cmdk-group-heading]]:py-1.5 [&>[cmdk-group-heading]]:text-xs [&>[cmdk-group-heading]]:font-medium`,t),...n}));_.displayName=`CommandGroup`;const v=i(({className:n,...r},i)=>s(u.Separator,{ref:i,"data-slot":`command-separator`,asChild:!0,...r,children:s(t,{className:e(`-mx-1 my-1 w-auto`,n)})}));v.displayName=`CommandSeparator`;const y=i(({className:t,...n},r)=>s(u.Item,{ref:r,"data-slot":`command-item`,className:e(`data-[selected=true]:bg-active-menu-item [:where(&_svg)]:text-muted relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [:where(&_svg)]:size-5`,t),...n}));y.displayName=`CommandItem`;const b=i(({className:t,...n},r)=>s(`span`,{ref:r,"data-slot":`command-shortcut`,className:e(`text-muted ml-auto text-xs tracking-widest`,t),...n}));b.displayName=`CommandShortcut`;const x={Root:f,DialogRoot:n.Root,DialogTrigger:n.Trigger,DialogContent:p,Input:m,List:h,Empty:g,Group:_,Item:y,Shortcut:b,Separator:v};function S({className:t,...n}){let[i,l]=o(`⌃`);a(()=>{l(w())},[]);let u=i===`⌘`?`Command`:`Control`;return c(r,{...n,suppressHydrationWarning:!0,"data-slot":`meta-key`,className:e(i===`⌃`&&`font-medium`,t),children:[s(`span`,{className:`sr-only`,children:u}),i]})}function C(e){return`userAgentData`in e}function w(){if(typeof navigator>`u`)return`⌃`;let e=``;return C(navigator)&&(e=navigator.userAgentData.platform??``),e||=navigator.platform||navigator.userAgent||``,/mac|iphone|ipad|ipod/i.test(e)?`⌘`:`⌃`}export{x as Command,S as MetaKey,d as useCommandState};
|
package/dist/data-table.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { t as
|
|
1
|
+
import { t as ButtonIntent } from "./intents-DdSKSj1c.js";
|
|
2
|
+
import { n as ButtonAppearance, t as Button } from "./button-DcXOWUYo.js";
|
|
3
|
+
import { n as IconButtonAppearance, t as IconButton } from "./icon-button-B7uEj1qq.js";
|
|
3
4
|
import { s as SortingMode } from "./direction-BjU0bPST.js";
|
|
4
5
|
import { t as Table$1 } from "./table-CwFHXC-G.js";
|
|
5
6
|
import { ComponentProps, ReactNode } from "react";
|
|
@@ -62,7 +63,20 @@ type DataTableProps<TData> = ComponentProps<typeof Table$1.Root> & {
|
|
|
62
63
|
* ```
|
|
63
64
|
*/
|
|
64
65
|
declare function Root<TData>({ children, table, ...props }: DataTableProps<TData>): import("react").JSX.Element;
|
|
65
|
-
type DataTableHeaderSortButtonProps<TData, TValue> = Omit<ComponentProps<typeof Button>, "icon"> & Pick<HeaderContext<TData, TValue>, "column"> &
|
|
66
|
+
type DataTableHeaderSortButtonProps<TData, TValue> = Omit<ComponentProps<typeof Button>, "appearance" | "icon" | "intent"> & Pick<HeaderContext<TData, TValue>, "column"> & {
|
|
67
|
+
/**
|
|
68
|
+
* The visual style of the sort button. Optional — the header sort button's
|
|
69
|
+
* design is a ghost button, so the wrapper defaults it.
|
|
70
|
+
* @default "ghost"
|
|
71
|
+
*/
|
|
72
|
+
appearance?: ButtonAppearance;
|
|
73
|
+
/**
|
|
74
|
+
* The tone of the sort button. Optional — the header sort button's design
|
|
75
|
+
* is neutral-toned, so the wrapper defaults it.
|
|
76
|
+
* @default "neutral"
|
|
77
|
+
*/
|
|
78
|
+
intent?: ButtonIntent;
|
|
79
|
+
} & ({
|
|
66
80
|
/**
|
|
67
81
|
* Disable sorting for this column.
|
|
68
82
|
* It will prevent the sorting direction from being toggled and any icon
|
|
@@ -119,7 +133,7 @@ type DataTableHeaderSortButtonProps<TData, TValue> = Omit<ComponentProps<typeof
|
|
|
119
133
|
* });
|
|
120
134
|
* ```
|
|
121
135
|
*/
|
|
122
|
-
declare function HeaderSortButton<TData, TValue>({ children, className, column, disableSorting, iconPlacement, sortingMode, sortIcon: propSortIcon, onClick, ...props }: DataTableHeaderSortButtonProps<TData, TValue>): import("react").JSX.Element;
|
|
136
|
+
declare function HeaderSortButton<TData, TValue>({ appearance, children, className, column, disableSorting, iconPlacement, intent, sortingMode, sortIcon: propSortIcon, onClick, ...props }: DataTableHeaderSortButtonProps<TData, TValue>): import("react").JSX.Element;
|
|
123
137
|
type DataTableHeaderProps = ComponentProps<typeof Table$1.Header>;
|
|
124
138
|
/**
|
|
125
139
|
* A `<th>` optimized for header actions. Wrap each column's header content in
|
|
@@ -274,7 +288,7 @@ type DataTableEmptyRowProps = ComponentProps<typeof Table$1.Row>;
|
|
|
274
288
|
* <Button
|
|
275
289
|
* type="button"
|
|
276
290
|
* appearance="outlined"
|
|
277
|
-
*
|
|
291
|
+
* intent="neutral"
|
|
278
292
|
* onClick={() => table.setGlobalFilter("")}
|
|
279
293
|
* >
|
|
280
294
|
* Clear filters
|
|
@@ -389,7 +403,19 @@ type DataTableExpandHeaderProps = Omit<ComponentProps<typeof Table$1.Header>, "c
|
|
|
389
403
|
* ```
|
|
390
404
|
*/
|
|
391
405
|
declare function ExpandHeader({ children, className, ...props }: DataTableExpandHeaderProps): import("react").JSX.Element;
|
|
392
|
-
type DataTableRowExpandButtonProps<TData> = Omit<ComponentProps<typeof IconButton>, "aria-controls" | "aria-expanded" | "icon" | "label"> & {
|
|
406
|
+
type DataTableRowExpandButtonProps<TData> = Omit<ComponentProps<typeof IconButton>, "appearance" | "aria-controls" | "aria-expanded" | "icon" | "intent" | "label"> & {
|
|
407
|
+
/**
|
|
408
|
+
* The visual style of the expand toggle. Optional — the row expand button's
|
|
409
|
+
* design is a ghost button, so the wrapper defaults it.
|
|
410
|
+
* @default "ghost"
|
|
411
|
+
*/
|
|
412
|
+
appearance?: IconButtonAppearance;
|
|
413
|
+
/**
|
|
414
|
+
* The tone of the expand toggle. Optional — the row expand button's design
|
|
415
|
+
* is neutral-toned, so the wrapper defaults it.
|
|
416
|
+
* @default "neutral"
|
|
417
|
+
*/
|
|
418
|
+
intent?: ButtonIntent;
|
|
393
419
|
/**
|
|
394
420
|
* The TanStack Table row this button toggles. The table must be configured for
|
|
395
421
|
* expansion (`getExpandedRowModel`, plus `getRowCanExpand: () => true` for
|
|
@@ -440,7 +466,7 @@ type DataTableRowExpandButtonProps<TData> = Omit<ComponentProps<typeof IconButto
|
|
|
440
466
|
* });
|
|
441
467
|
* ```
|
|
442
468
|
*/
|
|
443
|
-
declare function RowExpandButton<TData>({ appearance, className, collapseIcon, expandIcon, label, onClick, row, size, ...props }: DataTableRowExpandButtonProps<TData>): import("react").JSX.Element | null;
|
|
469
|
+
declare function RowExpandButton<TData>({ appearance, className, collapseIcon, expandIcon, intent, label, onClick, row, size, ...props }: DataTableRowExpandButtonProps<TData>): import("react").JSX.Element | null;
|
|
444
470
|
type DataTableExpandedRowProps<TData> = Omit<ComponentProps<typeof Table$1.Row>, "children"> & {
|
|
445
471
|
/** The row whose detail panel this displays. */
|
|
446
472
|
row: Row<TData>;
|
|
@@ -693,7 +719,7 @@ declare function ExpandedRow<TData>({ children, className, colSpan, row, ...prop
|
|
|
693
719
|
* <Button
|
|
694
720
|
* type="button"
|
|
695
721
|
* appearance="outlined"
|
|
696
|
-
*
|
|
722
|
+
* intent="neutral"
|
|
697
723
|
* onClick={() => setGlobalFilter("")}
|
|
698
724
|
* >
|
|
699
725
|
* Clear filters
|
|
@@ -741,7 +767,7 @@ declare function ExpandedRow<TData>({ children, className, colSpan, row, ...prop
|
|
|
741
767
|
* ```tsx
|
|
742
768
|
* import { DataTable, createColumnHelper } from "@ngrok/mantle/data-table";
|
|
743
769
|
* import { DropdownMenu } from "@ngrok/mantle/dropdown-menu";
|
|
744
|
-
* import { IconButton } from "@ngrok/mantle/
|
|
770
|
+
* import { IconButton } from "@ngrok/mantle/button";
|
|
745
771
|
* import { DotsThreeVerticalIcon } from "@phosphor-icons/react/DotsThreeVertical";
|
|
746
772
|
*
|
|
747
773
|
* const columnHelper = createColumnHelper<Payment>();
|
|
@@ -755,7 +781,7 @@ declare function ExpandedRow<TData>({ children, className, colSpan, row, ...prop
|
|
|
755
781
|
* <DataTable.ActionCell onClick={(event) => event.stopPropagation()}>
|
|
756
782
|
* <DropdownMenu.Root>
|
|
757
783
|
* <DropdownMenu.Trigger asChild>
|
|
758
|
-
* <IconButton type="button" label="Actions" icon={<DotsThreeVerticalIcon />} />
|
|
784
|
+
* <IconButton type="button" appearance="outlined" intent="neutral" label="Actions" icon={<DotsThreeVerticalIcon />} />
|
|
759
785
|
* </DropdownMenu.Trigger>
|
|
760
786
|
* <DropdownMenu.Content align="end">
|
|
761
787
|
* <DropdownMenu.Item onSelect={() => copy(props.row.original.id)}>
|
package/dist/data-table.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-button-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-button-DV2-GZHf.js";import{t as n}from"./button-ClC60Nzg.js";import{i as r}from"./direction-Wa9W2F61.js";import{t as i}from"./sort-BPX2Fk9t.js";import{t as a}from"./table-CPH2md2-.js";import{Fragment as o,createContext as s,forwardRef as c,useContext as l,useMemo as u}from"react";import d from"tiny-invariant";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";import{flexRender as h}from"@tanstack/react-table";import{MinusIcon as g}from"@phosphor-icons/react/Minus";import{PlusIcon as _}from"@phosphor-icons/react/Plus";export*from"@tanstack/react-table";const v=[`unsorted`,`asc`,`desc`],y=[`unsorted`,`desc`,`asc`];function b(e,t){return x(t===`alphanumeric`?v:y,e)??`unsorted`}function x(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 S=s(null);function C(){let e=l(S);return d(e,`useDataTableContext should only be used within a DataTable child component`),e}function w({children:e,table:t,...n}){let r=u(()=>({table:t}),[t]);return p(S.Provider,{value:r,children:p(a.Root,{"data-slot":`data-table`,...n,children:p(a.Element,{children:e})})})}function T({appearance:t=`ghost`,children:i,className:a,column:o,disableSorting:s=!1,iconPlacement:c=`end`,intent:l=`neutral`,sortingMode:u,sortIcon:d,onClick:f,...h}){let g=o.getIsSorted(),_=!s&&o.getCanSort(),v=_&&typeof g==`string`?g:`unsorted`,y=d?.(v)??p(V,{mode:u,direction:v});return m(n,{appearance:t,"data-slot":`data-table-header-sort-button`,className:e(`flex justify-start w-full h-full rounded-none not-disabled:active:scale-none`,t===`ghost`&&l===`neutral`&&`text-muted`,a),"data-sort-direction":v,"data-table-header-action":!0,icon:y,iconPlacement:c,onClick:e=>{f?.(e),!e.defaultPrevented&&(!_||s||u===void 0||H(o,u))},intent:l,type:`button`,...h,children:[_&&v!==`unsorted`&&m(`span`,{className:`sr-only`,children:[`Column sorted in`,` `,u===`alphanumeric`?v===`asc`?`ascending`:`descending`:r(v),` `,`order`]}),i]})}function E({children:t,className:n,...r}){return p(a.Header,{"data-slot":`data-table-header`,className:e(`has-data-table-header-action:px-0`,n),...r,children:t})}const D=c((e,t)=>p(a.Body,{ref:t,"data-slot":`data-table-body`,...e}));D.displayName=`DataTableBody`;function O(e){let{table:t}=C();return p(a.Head,{"data-slot":`data-table-head`,...e,children:t.getHeaderGroups().map(e=>p(a.Row,{children:e.headers.map(e=>p(o,{children:e.isPlaceholder?p(a.Header,{},e.id):h(e.column.columnDef.header,e.getContext())},e.id))},e.id))})}function k({className:t,renderExpanded:n,row:r,...i}){let s=p(a.Row,{"data-slot":`data-table-row`,"data-expanded":r.getIsExpanded()||void 0,className:e(i.onClick&&`cursor-pointer`,t),...i,children:r.getVisibleCells().map(e=>p(o,{children:h(e.column.columnDef.cell,e.getContext())},e.id))});return n==null?s:m(f,{children:[s,r.getIsExpanded()&&p(z,{row:r,children:n(r)})]})}function A({children:e,...t}){let{table:n}=C(),r=n.getAllColumns().length;return p(a.Row,{"data-slot":`data-table-empty-row`,...t,children:p(a.Cell,{colSpan:r,children:e})})}function j(){return 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)]`)})}function M({children:t,className:n,...r}){return m(a.Cell,{"data-mantle-table-sticky-right":!0,"data-slot":`data-table-action-cell`,className:e(`sticky z-10 right-0 text-end align-middle bg-inherit p-2`,n),...r,children:[p(j,{}),t]})}function N({children:t,className:n,...r}){let{table:i}=C(),o=i.getRowModel().rows.length>0;return m(a.Header,{...o?{"data-mantle-table-sticky-right":!0}:{},"data-slot":`data-table-action-header`,className:e(o&&`sticky z-10 right-0 bg-inherit`,n),...r,children:[o&&p(j,{}),t]})}function P(e){return`data-table-expanded-row-${encodeURIComponent(e.id)}`}function F({children:t,className:n,...r}){return p(a.Header,{"data-slot":`data-table-expand-header`,className:e(`w-9 px-0 text-center`,n),...r,children:t??p(`span`,{className:`sr-only`,children:`Row details`})})}const I=p(_,{weight:`bold`,className:`size-3.5`}),L=p(g,{weight:`bold`,className:`size-3.5`});function R({appearance:n=`ghost`,className:r,collapseIcon:i=L,expandIcon:a=I,intent:o=`neutral`,label:s,onClick:c,row:l,size:u=`sm`,...d}){if(!l.getCanExpand())return null;let f=l.getIsExpanded(),m=l.getToggleExpandedHandler();return p(t,{type:`button`,"data-slot":`data-table-row-expand-button`,appearance:n,intent:o,size:u,className:e(`rounded`,r),"aria-expanded":f,"aria-controls":f?P(l):void 0,icon:f?i:a,label:`${f?`Hide`:`Show`} details for ${s}`,onClick:e=>{e.stopPropagation(),c?.(e),!e.defaultPrevented&&m()},...d})}function z({children:t,className:n,colSpan:r,row:i,...o}){return p(a.Row,{"data-slot":`data-table-expanded-row`,"data-expanded-content":!0,className:e(`[&>td]:border-t-0`,n),...o,children:p(a.Cell,{id:P(i),colSpan:r??i.getVisibleCells().length,className:`bg-card font-sans text-body`,children:t})})}w.displayName=`DataTable`,M.displayName=`DataTableActionCell`,N.displayName=`DataTableActionHeader`,D.displayName=`DataTableBody`,A.displayName=`DataTableEmptyRow`,F.displayName=`DataTableExpandHeader`,z.displayName=`DataTableExpandedRow`,O.displayName=`DataTableHead`,E.displayName=`DataTableHeader`,T.displayName=`DataTableHeaderSortButton`,k.displayName=`DataTableRow`,R.displayName=`DataTableRowExpandButton`;const B={Root:w,ActionCell:M,ActionHeader:N,Cell:a.Cell,Body:D,EmptyRow:A,Head:O,Header:E,HeaderSortButton:T,Row:k,ExpandHeader:F,RowExpandButton:R,ExpandedRow:z};function V({direction:e,mode:t,...n}){return e===`unsorted`||!t||!e?p(`svg`,{"aria-hidden":!0,...n}):p(i,{mode:t,direction:e,...n})}function H(e,t){if(!e.getCanSort())return;let n=e.getIsSorted();switch(b(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{B as DataTable,P as expandedRowId};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-button-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-button-DV2-GZHf.js";import{a as n,c as r,i,n as a,o,r as s,s as c,t as l}from"./primitive-M-kZdNIS.js";import{forwardRef as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{XIcon as p}from"@phosphor-icons/react/X";const m=o;m.displayName=`Dialog`;const h=u((e,t)=>d(r,{ref:t,"data-slot":`dialog-trigger`,...e}));h.displayName=`DialogTrigger`;const g=n;g.displayName=`DialogPortal`;const _=u((e,t)=>d(l,{ref:t,"data-slot":`dialog-close`,...e}));_.displayName=`DialogClose`;const v=u(({className:t,...n},r)=>d(i,{ref:r,"data-slot":`dialog-overlay`,className:e(`bg-overlay data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:animate-in data-state-open:fade-in-0 fixed inset-0 z-50 backdrop-blur-xs`,t),...n}));v.displayName=`DialogOverlay`;const y=u(({children:t,className:n,preferredWidth:r=`max-w-lg`,...i},o)=>f(g,{children:[d(v,{}),d(`div`,{className:`fixed inset-4 z-50 flex items-center justify-center`,children:d(a,{"data-mantle-modal-content":!0,"data-slot":`dialog-content`,className:e(`flex max-h-full w-full flex-1 flex-col`,`outline-hidden focus-within:outline-hidden`,`border-dialog bg-dialog rounded-xl border shadow-lg transition-transform duration-200`,`data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95`,r,n),ref:o,...i,children:t})})]}));y.displayName=`DialogContent`;const b=({className:t,children:n,...r})=>d(`div`,{"data-slot":`dialog-header`,className:e(`border-dialog-muted text-strong relative flex shrink-0 items-center justify-between gap-2 border-b px-6 py-4`,`has-[.icon-button]:pr-4`,t),...r,children:n});b.displayName=`DialogHeader`;const x=({size:e=`md`,type:n=`button`,label:r=`Close Dialog`,appearance:i=`ghost`,intent:a=`neutral`,...o})=>d(l,{asChild:!0,children:d(t,{appearance:i,"data-slot":`dialog-close-icon-button`,icon:d(p,{}),intent:a,label:r,size:e,type:n,...o})});x.displayName=`DialogCloseIconButton`;const S=({className:t,...n})=>d(`div`,{"data-slot":`dialog-body`,className:e(`scrollbar scrollbar-gutter-stable text-body flex-1 overflow-y-auto p-6`,t),...n});S.displayName=`DialogBody`;const C=({className:t,...n})=>d(`div`,{"data-slot":`dialog-footer`,className:e(`border-dialog-muted flex shrink-0 justify-end gap-2 border-t px-6 py-4`,t),...n});C.displayName=`DialogFooter`;const w=u(({className:t,...n},r)=>d(c,{ref:r,"data-slot":`dialog-title`,className:e(`text-strong truncate text-lg font-medium`,t),...n}));w.displayName=`DialogTitle`;const T=u(({className:t,...n},r)=>d(s,{ref:r,"data-slot":`dialog-description`,className:e(`text-muted`,t),...n}));T.displayName=`DialogDescription`;const E={Root:m,Body:S,Close:_,CloseIconButton:x,Content:y,Description:T,Footer:C,Header:b,Overlay:v,Portal:g,Title:w,Trigger:h};export{E as t};
|