@ngrok/mantle 0.76.3 → 0.76.5
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/README.md +8 -8
- package/dist/accordion.d.ts +1 -2
- package/dist/accordion.js +1 -2
- package/dist/agent.json +1 -1
- package/dist/alert-dialog.d.ts +4 -45
- package/dist/alert-dialog.js +1 -2
- package/dist/alert.d.ts +2 -3
- package/dist/alert.js +1 -2
- package/dist/anchor-CcTY5SIz.js +1 -2
- package/dist/anchor.d.ts +1 -2
- package/dist/as-child-uN_018tj.d.ts +1 -2
- package/dist/badge.d.ts +1 -2
- package/dist/badge.js +1 -2
- package/dist/booleanish-BfvnW6vy.js +1 -2
- package/dist/browser-only-BSl_hruR.js +1 -2
- package/dist/browser-only.d.ts +1 -2
- package/dist/button-BAxneEMu.js +1 -2
- package/dist/{button-uMIZVKit.js → button-BfMn3PgP.js} +1 -2
- package/dist/button-mfYak6Rx.d.ts +71 -0
- package/dist/button.d.ts +3 -3
- package/dist/button.js +1 -1
- package/dist/calendar.d.ts +2 -3
- package/dist/calendar.js +1 -2
- package/dist/card.d.ts +1 -2
- package/dist/card.js +1 -2
- package/dist/checkbox.d.ts +1 -2
- package/dist/checkbox.js +1 -2
- package/dist/code-block.d.ts +76 -2
- package/dist/code-block.js +7 -3
- package/dist/code-block_highlight-utils.js +1 -1
- package/dist/code.d.ts +1 -2
- package/dist/code.js +1 -2
- package/dist/color.js +1 -2
- package/dist/combobox.d.ts +1 -2
- package/dist/combobox.js +1 -2
- package/dist/command.d.ts +2 -3
- package/dist/command.js +1 -2
- package/dist/compose-refs-Cjf2gfB8.js +1 -2
- package/dist/copy-to-clipboard-Baw30q9O.js +1 -2
- package/dist/cx-CBSnSC36.js +1 -2
- package/dist/cx.d.ts +1 -2
- package/dist/data-table.d.ts +319 -5
- package/dist/data-table.js +1 -2
- package/dist/description-list.d.ts +1 -2
- package/dist/description-list.js +1 -2
- package/dist/{dialog-DR2V7zsR.js → dialog-ebkUwitP.js} +1 -2
- package/dist/dialog.d.ts +2 -3
- package/dist/dialog.js +1 -1
- package/dist/direction-CcTY0FmA.d.ts +1 -2
- package/dist/direction-Wa9W2F61.js +1 -2
- package/dist/{dropdown-menu-C3YZJBkV.js → dropdown-menu-BHyYWtrH.js} +1 -2
- package/dist/dropdown-menu-BqdyTFLu.d.ts +1 -2
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty.d.ts +1 -2
- package/dist/empty.js +1 -2
- package/dist/field-context-4k1kI7Bo.js +1 -2
- package/dist/field.d.ts +2 -3
- package/dist/field.js +1 -2
- package/dist/flag.d.ts +1 -2
- package/dist/flag.js +1 -2
- package/dist/hooks.d.ts +1 -2
- package/dist/hooks.js +1 -2
- package/dist/hover-card.d.ts +1 -2
- package/dist/hover-card.js +1 -2
- package/dist/icon-C8bYBIHW.js +1 -2
- package/dist/{icon-button-ntupABbM.d.ts → icon-button-D7hs6bX2.d.ts} +52 -44
- package/dist/{icon-button-C_Ht_g1C.js → icon-button-DUNHVWpb.js} +1 -2
- package/dist/icon-n49kOh4_.d.ts +1 -2
- package/dist/icons.d.ts +1 -2
- package/dist/icons.js +1 -2
- package/dist/in-view-BC3wmz-a.d.ts +1 -2
- package/dist/in-view-C2DpZ6s0.js +1 -2
- package/dist/{index-L3NmbHi5.d.ts → index-Bed_XLWa.d.ts} +16 -2
- package/dist/index-CJbKEKr2.d.ts +1 -2
- package/dist/{index-DBZ3eRsl.d.ts → index-CTU6apE6.d.ts} +2 -3
- package/dist/index-DorCusfG.d.ts +1 -2
- package/dist/input.d.ts +4 -5
- package/dist/input.js +1 -2
- package/dist/is-input-CXmS0OFN.js +1 -2
- package/dist/kbd-Bv6tefdB.js +1 -2
- package/dist/kbd.d.ts +1 -2
- package/dist/label-DhIUmTN2.js +1 -2
- package/dist/label.d.ts +1 -2
- package/dist/llms.txt +1 -1
- package/dist/main.d.ts +1 -2
- package/dist/main.js +1 -2
- package/dist/mantle.css +13 -6
- package/dist/media-object.d.ts +1 -2
- package/dist/media-object.js +1 -2
- package/dist/multi-select.d.ts +1 -2
- package/dist/multi-select.js +1 -2
- package/dist/otp-input.d.ts +1 -2
- package/dist/otp-input.js +1 -2
- package/dist/pagination.d.ts +2 -3
- package/dist/pagination.js +1 -2
- package/dist/popover-DponNBot.js +1 -2
- package/dist/popover.d.ts +1 -2
- package/dist/primitive-Cn3h4DJg.js +1 -2
- package/dist/primitive-FoWela9a.d.ts +1 -2
- package/dist/progress.d.ts +1 -2
- package/dist/progress.js +1 -2
- package/dist/qr-code.d.ts +1 -2
- package/dist/qr-code.js +1 -2
- package/dist/radio-group.d.ts +1 -2
- package/dist/radio-group.js +1 -2
- package/dist/resolve-pre-rendered-props-CF9-Qy2H.js +12 -0
- package/dist/resolve-pre-rendered-props-DxJ9-DAl.d.ts +1 -2
- package/dist/sandboxed-on-click.d.ts +1 -2
- package/dist/sandboxed-on-click.js +1 -2
- package/dist/select-C15-XvRT.d.ts +1 -2
- package/dist/{select-Cxc9VmP8.js → select-g0E_TsXr.js} +1 -2
- package/dist/select.js +1 -1
- package/dist/{separator-Bqjy77rG.js → separator-BXFUCWFa.js} +1 -2
- package/dist/separator.d.ts +1 -2
- package/dist/separator.js +1 -1
- package/dist/sheet.d.ts +2 -3
- package/dist/sheet.js +1 -2
- package/dist/skeleton.d.ts +1 -2
- package/dist/skeleton.js +1 -2
- package/dist/skip-to-main-link.d.ts +1 -2
- package/dist/skip-to-main-link.js +1 -2
- package/dist/slider.d.ts +1 -2
- package/dist/slider.js +1 -2
- package/dist/slot-CV5fmqFr.js +1 -2
- package/dist/sort-BPX2Fk9t.js +1 -2
- package/dist/split-button.d.ts +5 -6
- package/dist/split-button.js +1 -2
- package/dist/svg-only-Cz1cby8y.js +1 -2
- package/dist/svg-only-f6ToFLH0.d.ts +1 -2
- package/dist/switch.d.ts +1 -2
- package/dist/switch.js +1 -2
- package/dist/table-BWD9IlIN.d.ts +1 -2
- package/dist/table-DWy_oNta.js +1 -2
- package/dist/tabs.d.ts +1 -2
- package/dist/tabs.js +1 -2
- package/dist/text-area.d.ts +1 -2
- package/dist/text-area.js +1 -2
- package/dist/theme-provider-MMwxHEfw.js +1 -2
- package/dist/theme.d.ts +4 -5
- package/dist/theme.js +1 -2
- package/dist/themes-CYNpplwN.d.ts +1 -2
- package/dist/toast-CR3MVChj.js +1 -2
- package/dist/toast.d.ts +1 -2
- package/dist/tooltip.d.ts +1 -2
- package/dist/tooltip.js +1 -2
- package/dist/traffic-policy-file-0g5RXFqu.js +1 -2
- package/dist/types-BvUzforF.d.ts +1 -2
- package/dist/types-D85fCNV3.js +1 -2
- package/dist/types.d.ts +1 -3
- package/dist/use-copy-to-clipboard-BLpquU9d.js +1 -2
- package/dist/use-isomorphic-layout-effect-DdTRtMY-.js +1 -2
- package/dist/use-matches-media-query-CMSxHR9n.js +1 -2
- package/dist/use-prefers-reduced-motion-CWIoFA6W.js +1 -2
- package/dist/utils.d.ts +1 -2
- package/dist/utils.js +1 -2
- package/dist/validation-DCyx-ceH.js +1 -2
- package/dist/validation-xyX_6kph.d.ts +1 -2
- package/dist/well.d.ts +1 -2
- package/dist/well.js +1 -2
- package/dist/with-style-props-CyImx7vd.d.ts +1 -2
- package/package.json +5 -5
- package/dist/accordion.js.map +0 -1
- package/dist/alert-dialog.js.map +0 -1
- package/dist/alert.js.map +0 -1
- package/dist/anchor-CcTY5SIz.js.map +0 -1
- package/dist/badge.js.map +0 -1
- package/dist/booleanish-BfvnW6vy.js.map +0 -1
- package/dist/browser-only-BSl_hruR.js.map +0 -1
- package/dist/button-BAxneEMu.js.map +0 -1
- package/dist/button-BXZ_JTu_.d.ts +0 -172
- package/dist/button-uMIZVKit.js.map +0 -1
- package/dist/calendar.js.map +0 -1
- package/dist/card.js.map +0 -1
- package/dist/checkbox.js.map +0 -1
- package/dist/code-block.js.map +0 -1
- package/dist/code.js.map +0 -1
- package/dist/color.js.map +0 -1
- package/dist/combobox.js.map +0 -1
- package/dist/command.js.map +0 -1
- package/dist/compose-refs-Cjf2gfB8.js.map +0 -1
- package/dist/copy-to-clipboard-Baw30q9O.js.map +0 -1
- package/dist/cx-CBSnSC36.js.map +0 -1
- package/dist/data-table.js.map +0 -1
- package/dist/deep-non-nullable-BxRoySYR.d.ts +0 -8
- package/dist/description-list.js.map +0 -1
- package/dist/dialog-DR2V7zsR.js.map +0 -1
- package/dist/direction-Wa9W2F61.js.map +0 -1
- package/dist/dropdown-menu-C3YZJBkV.js.map +0 -1
- package/dist/empty.js.map +0 -1
- package/dist/field-context-4k1kI7Bo.js.map +0 -1
- package/dist/field.js.map +0 -1
- package/dist/flag.js.map +0 -1
- package/dist/hooks.js.map +0 -1
- package/dist/hover-card.js.map +0 -1
- package/dist/icon-C8bYBIHW.js.map +0 -1
- package/dist/icon-button-C_Ht_g1C.js.map +0 -1
- package/dist/icons.js.map +0 -1
- package/dist/in-view-C2DpZ6s0.js.map +0 -1
- package/dist/input.js.map +0 -1
- package/dist/is-input-CXmS0OFN.js.map +0 -1
- package/dist/kbd-Bv6tefdB.js.map +0 -1
- package/dist/label-DhIUmTN2.js.map +0 -1
- package/dist/main.js.map +0 -1
- package/dist/media-object.js.map +0 -1
- package/dist/multi-select.js.map +0 -1
- package/dist/otp-input.js.map +0 -1
- package/dist/pagination.js.map +0 -1
- package/dist/popover-DponNBot.js.map +0 -1
- package/dist/primitive-Cn3h4DJg.js.map +0 -1
- package/dist/progress.js.map +0 -1
- package/dist/qr-code.js.map +0 -1
- package/dist/radio-group.js.map +0 -1
- package/dist/resolve-pre-rendered-props-C-vrNxH1.js +0 -13
- package/dist/resolve-pre-rendered-props-C-vrNxH1.js.map +0 -1
- package/dist/sandboxed-on-click.js.map +0 -1
- package/dist/select-Cxc9VmP8.js.map +0 -1
- package/dist/separator-Bqjy77rG.js.map +0 -1
- package/dist/sheet.js.map +0 -1
- package/dist/skeleton.js.map +0 -1
- package/dist/skip-to-main-link.js.map +0 -1
- package/dist/slider.js.map +0 -1
- package/dist/slot-CV5fmqFr.js.map +0 -1
- package/dist/sort-BPX2Fk9t.js.map +0 -1
- package/dist/split-button.js.map +0 -1
- package/dist/svg-only-Cz1cby8y.js.map +0 -1
- package/dist/switch.js.map +0 -1
- package/dist/table-DWy_oNta.js.map +0 -1
- package/dist/tabs.js.map +0 -1
- package/dist/text-area.js.map +0 -1
- package/dist/theme-provider-MMwxHEfw.js.map +0 -1
- package/dist/theme.js.map +0 -1
- package/dist/toast-CR3MVChj.js.map +0 -1
- package/dist/tooltip.js.map +0 -1
- package/dist/traffic-policy-file-0g5RXFqu.js.map +0 -1
- package/dist/types-D85fCNV3.js.map +0 -1
- package/dist/use-copy-to-clipboard-BLpquU9d.js.map +0 -1
- package/dist/use-isomorphic-layout-effect-DdTRtMY-.js.map +0 -1
- package/dist/use-matches-media-query-CMSxHR9n.js.map +0 -1
- package/dist/use-prefers-reduced-motion-CWIoFA6W.js.map +0 -1
- package/dist/utils.js.map +0 -1
- package/dist/validation-DCyx-ceH.js.map +0 -1
- package/dist/variant-props-CVymuSfa.d.ts +0 -13
- package/dist/well.js.map +0 -1
package/dist/code-block.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import{t as e}from"./cx-CBSnSC36.js";import{t}from"./icon-C8bYBIHW.js";import{t as n}from"./slot-CV5fmqFr.js";import{t as r}from"./icon-button-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import{t as e}from"./cx-CBSnSC36.js";import{t}from"./icon-C8bYBIHW.js";import{t as n}from"./slot-CV5fmqFr.js";import{t as r}from"./icon-button-DUNHVWpb.js";import{t as i}from"./compose-refs-Cjf2gfB8.js";import{t as a}from"./use-copy-to-clipboard-BLpquU9d.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-CF9-Qy2H.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:t=!1,className:r,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(t?n:`div`,{"data-slot":`code-block`,className:e(`text-mono w-full overflow-hidden rounded-md border border-gray-300 bg-card font-mono`,`[&_svg]:shrink-0`,r),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:t=!1,className:r,...i},a)=>I(t?n:`div`,{"data-slot":`code-block-body`,className:e(`relative`,r),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:t,style:n,value:r,...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}=r,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:e(`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]`,t),"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:i(c,o),style:{...n,"--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:t=!1,className:r,...i},a)=>I(t?n:`div`,{"data-slot":`code-block-header`,className:e(`flex items-center gap-1 border-b border-gray-300 bg-base px-4 py-2 text-gray-700`,r),ref:a,...i}));q.displayName=`CodeBlockHeader`;const J=k(({asChild:t=!1,className:r,...i},a)=>I(t?n:`h3`,{"data-slot":`code-block-title`,ref:a,className:e(`text-mono m-0 font-mono font-normal`,r),...i}));J.displayName=`CodeBlockTitle`;const Y=k(({className:e,label:t=`Copy code`,onCopy:n,onCopyError:i,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(r,{type:`button`,appearance:`ghost`,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){i?.(e)}},...s})})});Y.displayName=`CodeBlockCopyButton`;const X=k(({asChild:r=!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(r?n:`button`,{...o,"data-slot":`code-block-expander-button`,"aria-controls":c,"aria-expanded":l,className:e(`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(t,{svg:I(O,{weight:`bold`}),className:e(`size-4`,l&&`rotate-180`,`transition-all duration-150`)})]})});X.displayName=`CodeBlockExpanderButton`;function Z({className:e,preset:n,svg:r,...i}){let a=r;if(n!=null)switch(n){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(t,{"data-slot":`code-block-icon`,className:e,svg:a,...i})}Z.displayName=`CodeBlockIcon`;const Q=k(({className:t,...n},r)=>I(ue,{"data-slot":`code-block-tab-list`,className:e(`flex items-center gap-1`,t),ref:r,...n}));Q.displayName=`CodeBlockTabList`;const Te=k(({className:t,...n},r)=>I(fe,{"data-slot":`code-block-tab-trigger`,className:e(`cursor-pointer rounded px-1.5 py-0.5 text-xs font-medium`,`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`,t),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
|
+
`||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
|
+
`||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
|
+
`||o===`\r`){o===`\r`&&e[i+1]===`
|
|
5
|
+
`&&(i+=1);let r=[];t.push(r),n=r,i+=1;continue}if(o===` `||o===` `){let t=i+1;for(;t<r;){let n=e[t];if(n!==` `&&n!==` `)break;t+=1}a(e.slice(i,t),null),i=t;continue}if(o===`{`||o===`}`||o===`[`||o===`]`){a(o,Oe),i+=1;continue}if(o===`:`||o===`,`){a(o,`var(--shiki-token-punctuation)`),i+=1;continue}if(o===`"`){i=je(e,i,a);continue}let s=i+1;for(;s<r&&!Ae(e[s]??``);)s+=1;a(e.slice(i,s),`var(--shiki-token-constant)`),i=s}return t.map(Me).join(`
|
|
6
|
+
`)}function Ne(e){let t=new WeakSet;try{return JSON.stringify(e,(e,n)=>{if(typeof n==`bigint`)return n.toString();if(typeof n==`object`&&n){if(t.has(n))return`[Circular]`;t.add(n)}return n},2)??``}catch{try{return String(e)}catch{return``}}}function Pe(e,{showLineNumbers:t=!1,foldable:n=!0}={}){let r=Ne(e);return u({language:`json`,code:r,preHtml:c({html:$(r),foldableRanges:n?E(r):void 0,showLineNumbers:t}),showLineNumbers:t})}function Fe(e,t){let n=1;if(n>t)return!0;for(let r=0;r<e.length;r++)if(e[r]===`
|
|
7
|
+
`&&(n+=1,n>t))return!0;return!1}export{De as CodeBlock,h as computeFoldRanges,E as computeJsonFoldRanges,u as createMantleCodeBlockValue,c as decorateHighlightedHtml,w as defaultMeta,L as escapeHtml,D as finalizeFoldRanges,m as foldStrategyFor,Fe as hasMoreThanNLines,x as inferIndentation,v as isIndentation,_ as isSupportedLanguage,Pe as jsonCodeBlockValue,$ as jsonToShikiHtml,s as mantleCode,p as normalizeIndentation,y as normalizeValue,b as parseCodeBlockHighlightLines,C as parseCodeBlockLineNumberStart,d as parseCodeBlockShowLineNumbers,T as parseLanguage,S as parseMetastring,g as resolvePreRenderedCodeBlockProps,f as supportedLanguages,l as tokenizeMetastring};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,a as t,c as n,d as r,f as i,g as a,h as o,l as s,m as c,n as l,o as u,p as d,s as f,u as p,v as m,x as h,y as g}from"./resolve-pre-rendered-props-
|
|
1
|
+
import{_ as e,a as t,c as n,d as r,f as i,g as a,h as o,l as s,m as c,n as l,o as u,p as d,s as f,u as p,v as m,x as h,y as g}from"./resolve-pre-rendered-props-CF9-Qy2H.js";export{o as computeFoldRanges,m as computeJsonFoldRanges,e as decorateHighlightedHtml,h as defaultShowLineNumbers,g as finalizeFoldRanges,a as foldStrategyFor,d as inferIndentation,c as isIndentation,s as isSupportedLanguage,i as normalizeIndentation,l as normalizeValue,u as parseCodeBlockHighlightLines,f as parseCodeBlockLineNumberStart,n as parseCodeBlockShowLineNumbers,p as parseLanguage,r as supportedLanguages,t as tokenizeMetastring};
|
package/dist/code.d.ts
CHANGED
|
@@ -36,5 +36,4 @@ import { t as WithAsChild } from "./as-child-uN_018tj.js";
|
|
|
36
36
|
*/
|
|
37
37
|
declare const Code: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLElement> & import("react").HTMLAttributes<HTMLElement> & WithAsChild, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
38
38
|
//#endregion
|
|
39
|
-
export { Code };
|
|
40
|
-
//# sourceMappingURL=code.d.ts.map
|
|
39
|
+
export { Code };
|
package/dist/code.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-CBSnSC36.js";import{t}from"./slot-CV5fmqFr.js";import{forwardRef as n}from"react";import{jsx as r}from"react/jsx-runtime";const i=n(({asChild:n,className:i,...a},o)=>r(n?t:`code`,{ref:o,"data-slot":`code`,className:e(`border-gray-500/15 rounded-md border bg-gray-500/5 px-1 font-mono text-[0.8em]`,i),...a}));i.displayName=`Code`;export{i as Code};
|
|
2
|
-
//# sourceMappingURL=code.js.map
|
|
1
|
+
import{t as e}from"./cx-CBSnSC36.js";import{t}from"./slot-CV5fmqFr.js";import{forwardRef as n}from"react";import{jsx as r}from"react/jsx-runtime";const i=n(({asChild:n,className:i,...a},o)=>r(n?t:`code`,{ref:o,"data-slot":`code`,className:e(`border-gray-500/15 rounded-md border bg-gray-500/5 px-1 font-mono text-[0.8em]`,i),...a}));i.displayName=`Code`;export{i as Code};
|
package/dist/color.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
const e=[`amber`,`blue`,`cyan`,`emerald`,`fuchsia`,`gray`,`green`,`indigo`,`lime`,`orange`,`pink`,`purple`,`red`,`rose`,`sky`,`teal`,`violet`,`yellow`],t=t=>typeof t==`string`&&e.includes(t),n=[`important`,`info`,`accent`,`danger`,`neutral`,`success`,`warning`],r=e=>typeof e==`string`&&n.includes(e),i=[...e,...n],a=e=>typeof e==`string`&&i.includes(e);export{i as colors,n as functionalColors,a as isColor,r as isFunctionalColor,t as isNamedColor,e as namedColors};
|
|
2
|
-
//# sourceMappingURL=color.js.map
|
|
1
|
+
const e=[`amber`,`blue`,`cyan`,`emerald`,`fuchsia`,`gray`,`green`,`indigo`,`lime`,`orange`,`pink`,`purple`,`red`,`rose`,`sky`,`teal`,`violet`,`yellow`],t=t=>typeof t==`string`&&e.includes(t),n=[`important`,`info`,`accent`,`danger`,`neutral`,`success`,`warning`],r=e=>typeof e==`string`&&n.includes(e),i=[...e,...n],a=e=>typeof e==`string`&&i.includes(e);export{i as colors,n as functionalColors,a as isColor,r as isFunctionalColor,t as isNamedColor,e as namedColors};
|
package/dist/combobox.d.ts
CHANGED
|
@@ -220,5 +220,4 @@ declare const Combobox: {
|
|
|
220
220
|
}, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
221
221
|
};
|
|
222
222
|
//#endregion
|
|
223
|
-
export { Combobox };
|
|
224
|
-
//# sourceMappingURL=combobox.d.ts.map
|
|
223
|
+
export { Combobox };
|
package/dist/combobox.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-CBSnSC36.js";import{t}from"./slot-CV5fmqFr.js";import{a as n,r}from"./validation-DCyx-ceH.js";import{n as i}from"./separator-
|
|
2
|
-
//# sourceMappingURL=combobox.js.map
|
|
1
|
+
import{t as e}from"./cx-CBSnSC36.js";import{t}from"./slot-CV5fmqFr.js";import{a as n,r}from"./validation-DCyx-ceH.js";import{n as i}from"./separator-BXFUCWFa.js";import{createContext as a,forwardRef as o}from"react";import{jsx as s}from"react/jsx-runtime";import*as c from"@ariakit/react";const l=({children:e,...t})=>s(c.ComboboxProvider,{...t,children:e});l.displayName=`Combobox`;const u=o(({"aria-invalid":t,autoComplete:i=`list`,autoSelect:a=`always`,className:o,validation:l,...u},d)=>{let f=n(),{ariaInvalid:p,validation:m}=r({"aria-invalid":t,validation:l??f});return s(c.Combobox,{"aria-invalid":p,autoComplete:i,autoSelect:a,"data-slot":`combobox-input`,className:e(`pointer-coarse:text-base h-9 text-sm`,`bg-form relative block w-full rounded-md border px-3 py-2 border-form text-strong font-sans`,`placeholder:text-placeholder`,`aria-disabled:opacity-50`,`hover:border-neutral-400`,`focus:outline-hidden focus:ring-4 aria-expanded:ring-4`,`focus:border-accent-600 focus:ring-focus-accent aria-expanded:border-accent-600 aria-expanded:ring-focus-accent`,`data-validation-success:border-success-600 data-validation-success:focus:border-success-600 data-validation-success:focus:ring-focus-success data-validation-success:aria-expanded:border-success-600 data-validation-success:aria-expanded:ring-focus-success`,`data-validation-warning:border-warning-600 data-validation-warning:focus:border-warning-600 data-validation-warning:focus:ring-focus-warning data-validation-warning:aria-expanded:border-warning-600 data-validation-warning:aria-expanded:ring-focus-warning`,`data-validation-error:border-danger-600 data-validation-error:focus:border-danger-600 data-validation-error:focus:ring-focus-danger data-validation-error:aria-expanded:border-danger-600 data-validation-error:aria-expanded:ring-focus-danger`,`autofill:shadow-(--color-blue-50) autofill:bg-blue-50 autofill:[-webkit-text-fill-color:var(--text-color-strong)]`,o),"data-validation":m||void 0,ref:d,...u})});u.displayName=`ComboboxInput`;const d=o(({asChild:n=!1,children:r,className:i,sameWidth:a=!0,unmountOnHide:o=!0,...l},u)=>s(c.ComboboxPopover,{"data-slot":`combobox-content`,className:e(`border-popover bg-popover relative z-50 max-h-96 min-w-32 scrollbar overflow-y-scroll overflow-x-hidden rounded-md border shadow-md p-1 my-2 space-y-px font-sans focus:outline-hidden`,i),ref:u,render:n?({ref:e,...n})=>s(t,{ref:e,...n}):void 0,sameWidth:a,unmountOnHide:o,...l,children:r}));d.displayName=`ComboboxContent`;const f=a(void 0),p=o(({asChild:n=!1,children:r,className:i,focusOnHover:a=!0,value:o,...l},u)=>s(f.Provider,{value:o,children:s(c.ComboboxItem,{"data-slot":`combobox-item`,className:e(`cursor-pointer rounded-md px-2 py-1.5 text-strong text-sm flex min-w-0 gap-2 items-center [&>svg]:size-5 [&_svg]:shrink-0`,`data-active-item:bg-active-menu-item`,`aria-disabled:opacity-50`,i),focusOnHover:a,ref:u,render:n?({ref:e,...n})=>s(t,{ref:e,...n}):void 0,value:o,...l,children:r})}));p.displayName=`ComboboxItem`;const m=o(({asChild:n=!1,children:r,className:i,...a},o)=>s(c.ComboboxGroup,{"data-slot":`combobox-group`,className:e(`space-y-px`,i),ref:o,render:n?({ref:e,...n})=>s(t,{ref:e,...n}):void 0,...a,children:r}));m.displayName=`ComboboxGroup`;const h=o(({asChild:n=!1,children:r,className:i,...a},o)=>s(c.ComboboxGroupLabel,{"data-slot":`combobox-group-label`,className:e(`text-muted px-2 py-1 text-xs font-medium`,i),ref:o,render:n?({ref:e,...n})=>s(t,{ref:e,...n}):void 0,...a,children:r}));h.displayName=`ComboboxGroupLabel`;const g=o(({asChild:n=!1,className:r,...i},a)=>s(c.ComboboxItemValue,{"data-slot":`combobox-item-value`,className:e(`*:data-user-value:font-medium flex-1 shrink-0 text-strong font-normal`,r),ref:a,render:n?({ref:e,...n})=>s(t,{ref:e,...n}):void 0,...i}));g.displayName=`ComboboxItemValue`;const _=o(({className:t,...n},r)=>s(i,{ref:r,"data-slot":`combobox-separator`,className:e(`-mx-1.25 my-1 w-auto`,t),...n}));_.displayName=`ComboboxSeparator`;const v={Root:l,Content:d,Group:m,GroupLabel:h,Input:u,Item:p,ItemValue:g,Separator:_};export{v as Combobox};
|
package/dist/command.d.ts
CHANGED
|
@@ -243,7 +243,7 @@ declare const Command: {
|
|
|
243
243
|
ref?: React.Ref<HTMLInputElement>;
|
|
244
244
|
} & {
|
|
245
245
|
asChild?: boolean;
|
|
246
|
-
}, "key" | "asChild" | keyof import("react").InputHTMLAttributes<HTMLInputElement>>, "onChange" | "
|
|
246
|
+
}, "key" | "asChild" | keyof import("react").InputHTMLAttributes<HTMLInputElement>>, "onChange" | "type" | "value"> & {
|
|
247
247
|
value?: string;
|
|
248
248
|
onValueChange?: (search: string) => void;
|
|
249
249
|
} & import("react").RefAttributes<HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -502,5 +502,4 @@ declare function MetaKey({
|
|
|
502
502
|
...props
|
|
503
503
|
}: Props): import("react").JSX.Element;
|
|
504
504
|
//#endregion
|
|
505
|
-
export { Command, MetaKey, useCommandState };
|
|
506
|
-
//# sourceMappingURL=command.d.ts.map
|
|
505
|
+
export { Command, MetaKey, useCommandState };
|
package/dist/command.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-CBSnSC36.js";import{n as t}from"./separator-
|
|
2
|
-
//# sourceMappingURL=command.js.map
|
|
1
|
+
import{t as e}from"./cx-CBSnSC36.js";import{n as t}from"./separator-BXFUCWFa.js";import{t as n}from"./dialog-ebkUwitP.js";import{t as r}from"./kbd-Bv6tefdB.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};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{useCallback as e,useRef as t}from"react";function n(...e){return t=>{for(let n of e)typeof n==`function`?n(t):n!=null&&(n.current=t)}}function r(...n){let r=t(n);return r.current=n,e(e=>{for(let t of r.current)typeof t==`function`?t(e):t!=null&&(t.current=e)},[])}export{r as n,n as t};
|
|
2
|
-
//# sourceMappingURL=compose-refs-Cjf2gfB8.js.map
|
|
1
|
+
import{useCallback as e,useRef as t}from"react";function n(...e){return t=>{for(let n of e)typeof n==`function`?n(t):n!=null&&(n.current=t)}}function r(...n){let r=t(n);return r.current=n,e(e=>{for(let t of r.current)typeof t==`function`?t(e):t!=null&&(t.current=e)},[])}export{r as n,n as t};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{n as e}from"./browser-only-BSl_hruR.js";async function t(t){if(!e())throw Error(`copyToClipboard requires a DOM environment`);try{if(typeof navigator.clipboard?.writeText==`function`)await navigator.clipboard.writeText(t);else throw Error(`writeText not supported`)}catch(e){try{n(t)}catch{throw e}}}function n(e){let t=document.createElement(`textarea`);t.value=e,document.body.appendChild(t);try{if(t.select(),!document.execCommand(`copy`))throw Error(`document.execCommand("copy") failed`)}finally{document.body.removeChild(t)}}export{t};
|
|
2
|
-
//# sourceMappingURL=copy-to-clipboard-Baw30q9O.js.map
|
|
1
|
+
import{n as e}from"./browser-only-BSl_hruR.js";async function t(t){if(!e())throw Error(`copyToClipboard requires a DOM environment`);try{if(typeof navigator.clipboard?.writeText==`function`)await navigator.clipboard.writeText(t);else throw Error(`writeText not supported`)}catch(e){try{n(t)}catch{throw e}}}function n(e){let t=document.createElement(`textarea`);t.value=e,document.body.appendChild(t);try{if(t.select(),!document.execCommand(`copy`))throw Error(`document.execCommand("copy") failed`)}finally{document.body.removeChild(t)}}export{t};
|
package/dist/cx-CBSnSC36.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{clsx as e}from"clsx";import{extendTailwindMerge as t}from"tailwind-merge";const n=t({extend:{classGroups:{"font-size":[`text-mono`,`text-size-inherit`]},theme:{spacing:[`em`]}}});function r(...t){return n(e(t))}export{r as t};
|
|
2
|
-
//# sourceMappingURL=cx-CBSnSC36.js.map
|
|
1
|
+
import{clsx as e}from"clsx";import{extendTailwindMerge as t}from"tailwind-merge";const n=t({extend:{classGroups:{"font-size":[`text-mono`,`text-size-inherit`]},theme:{spacing:[`em`]}}});function r(...t){return n(e(t))}export{r as t};
|
package/dist/cx.d.ts
CHANGED
package/dist/data-table.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { t as Button } from "./button-
|
|
1
|
+
import { t as Button } from "./button-mfYak6Rx.js";
|
|
2
|
+
import { t as IconButton } from "./icon-button-D7hs6bX2.js";
|
|
2
3
|
import { s as SortingMode } from "./direction-CcTY0FmA.js";
|
|
3
4
|
import { t as Table$1 } from "./table-BWD9IlIN.js";
|
|
4
5
|
import { ComponentProps, ReactNode } from "react";
|
|
@@ -200,6 +201,18 @@ declare namespace Head {
|
|
|
200
201
|
}
|
|
201
202
|
type DataTableRowProps<TData> = Omit<ComponentProps<typeof Table$1.Row>, "children"> & {
|
|
202
203
|
row: Row<TData>;
|
|
204
|
+
/**
|
|
205
|
+
* Renders an inline detail panel beneath the row. Called only while the row is
|
|
206
|
+
* expanded (`row.getIsExpanded()`), so the panel — and any expensive work it
|
|
207
|
+
* does — stays lazy. Mantle wraps the returned content in a sibling
|
|
208
|
+
* `DataTable.ExpandedRow` spanning every visible column, so return just the
|
|
209
|
+
* panel content (not a `<tr>`). Requires the table to be configured for
|
|
210
|
+
* expansion (`getExpandedRowModel`, plus `getRowCanExpand` for detail panels);
|
|
211
|
+
* pair it with a `DataTable.RowExpandButton` toggle in a leading column. For
|
|
212
|
+
* full control over the detail row (custom `colSpan`, multiple panels), omit
|
|
213
|
+
* this and render `DataTable.ExpandedRow` yourself.
|
|
214
|
+
*/
|
|
215
|
+
renderExpanded?: (row: Row<TData>) => ReactNode;
|
|
203
216
|
};
|
|
204
217
|
/**
|
|
205
218
|
* A single data table body row rendered from a TanStack Table row instance.
|
|
@@ -210,9 +223,15 @@ type DataTableRowProps<TData> = Omit<ComponentProps<typeof Table$1.Row>, "childr
|
|
|
210
223
|
* `cursor-wait`) to override. For keyboard and screen-reader access, also
|
|
211
224
|
* render a `<Link>` inside the primary cell — a `<tr>` is not focusable.
|
|
212
225
|
*
|
|
226
|
+
* Pass `renderExpanded` to give the row an inline detail panel: when the row is
|
|
227
|
+
* expanded the row renders its data `<tr>` plus a sibling `DataTable.ExpandedRow`
|
|
228
|
+
* holding the returned content. Pair it with a `DataTable.RowExpandButton` toggle
|
|
229
|
+
* and configure the table for expansion (`getExpandedRowModel`, `getRowCanExpand`).
|
|
230
|
+
*
|
|
213
231
|
* @see https://mantle.ngrok.com/components/data-table#datatablerow
|
|
214
232
|
*
|
|
215
233
|
* @example
|
|
234
|
+
* Clickable row navigating to a detail page:
|
|
216
235
|
* ```tsx
|
|
217
236
|
* const navigate = useNavigate();
|
|
218
237
|
*
|
|
@@ -224,9 +243,31 @@ type DataTableRowProps<TData> = Omit<ComponentProps<typeof Table$1.Row>, "childr
|
|
|
224
243
|
* />
|
|
225
244
|
* ))}
|
|
226
245
|
* ```
|
|
246
|
+
*
|
|
247
|
+
* @example
|
|
248
|
+
* Expandable row with an inline JSON detail panel (lazy — only built when open):
|
|
249
|
+
* ```tsx
|
|
250
|
+
* import { CodeBlock, jsonCodeBlockValue } from "@ngrok/mantle/code-block";
|
|
251
|
+
*
|
|
252
|
+
* {rows.map((row) => (
|
|
253
|
+
* <DataTable.Row
|
|
254
|
+
* key={row.id}
|
|
255
|
+
* row={row}
|
|
256
|
+
* renderExpanded={(row) => (
|
|
257
|
+
* <CodeBlock.Root>
|
|
258
|
+
* <CodeBlock.Body>
|
|
259
|
+
* <CodeBlock.CopyButton />
|
|
260
|
+
* <CodeBlock.Code value={jsonCodeBlockValue(row.original)} />
|
|
261
|
+
* </CodeBlock.Body>
|
|
262
|
+
* </CodeBlock.Root>
|
|
263
|
+
* )}
|
|
264
|
+
* />
|
|
265
|
+
* ))}
|
|
266
|
+
* ```
|
|
227
267
|
*/
|
|
228
268
|
declare function Row$1<TData>({
|
|
229
269
|
className,
|
|
270
|
+
renderExpanded,
|
|
230
271
|
row,
|
|
231
272
|
...props
|
|
232
273
|
}: DataTableRowProps<TData>): import("react").JSX.Element;
|
|
@@ -355,6 +396,194 @@ declare function ActionHeader({
|
|
|
355
396
|
declare namespace ActionHeader {
|
|
356
397
|
var displayName: string;
|
|
357
398
|
}
|
|
399
|
+
/**
|
|
400
|
+
* Compute the stable DOM `id` for a row's expanded detail row. Shared by
|
|
401
|
+
* `DataTable.RowExpandButton` (as its `aria-controls` target) and
|
|
402
|
+
* `DataTable.ExpandedRow` (as its `id`) so the accessibility association is
|
|
403
|
+
* _derived_ from the row — never synchronized state — and stays correct whether
|
|
404
|
+
* or not the detail panel is currently rendered.
|
|
405
|
+
*
|
|
406
|
+
* REQUIRED: configure the table with a stable `getRowId` so `row.id` (and thus
|
|
407
|
+
* this id) is stable across sorting/filtering/pagination. Any `row.id` value is
|
|
408
|
+
* safe — it is URL-encoded into a valid, whitespace-free HTML id token (and thus
|
|
409
|
+
* a valid `aria-controls` IDREF), so display names with spaces, URLs, and emails
|
|
410
|
+
* all work; `getRowId` controls the value.
|
|
411
|
+
*
|
|
412
|
+
* @example
|
|
413
|
+
* ```tsx
|
|
414
|
+
* <DataTable.RowExpandButton row={row} label={row.original.name} />
|
|
415
|
+
* // ...renders aria-controls={expandedRowId(row)} while expanded, and
|
|
416
|
+
* <DataTable.ExpandedRow row={row}>...</DataTable.ExpandedRow>
|
|
417
|
+
* // ...renders id={expandedRowId(row)} — the same value, so they stay associated.
|
|
418
|
+
* ```
|
|
419
|
+
*/
|
|
420
|
+
declare function expandedRowId<TData>(row: Row<TData>): string;
|
|
421
|
+
type DataTableExpandHeaderProps = Omit<ComponentProps<typeof Table$1.Header>, "children"> & {
|
|
422
|
+
/**
|
|
423
|
+
* Optional header content — e.g. an "expand all" toggle wired to
|
|
424
|
+
* `table.getToggleAllRowsExpandedHandler()`. Defaults to a screen-reader-only
|
|
425
|
+
* label so the column is announced while staying visually empty.
|
|
426
|
+
*/
|
|
427
|
+
children?: ReactNode;
|
|
428
|
+
};
|
|
429
|
+
/**
|
|
430
|
+
* A narrow `<th>` for the leading expand-toggle column, mirroring
|
|
431
|
+
* `DataTable.ActionHeader`. Renders a screen-reader-only label by default so the
|
|
432
|
+
* column is announced to assistive tech while staying visually empty; pass
|
|
433
|
+
* `children` to render an "expand all" control instead.
|
|
434
|
+
*
|
|
435
|
+
* @see https://mantle.ngrok.com/components/data-table#datatableexpandheader
|
|
436
|
+
*
|
|
437
|
+
* @example
|
|
438
|
+
* ```tsx
|
|
439
|
+
* columnHelper.display({
|
|
440
|
+
* id: "expander",
|
|
441
|
+
* header: () => <DataTable.ExpandHeader />,
|
|
442
|
+
* cell: (props) => (
|
|
443
|
+
* <DataTable.Cell className="w-9 px-0 text-center">
|
|
444
|
+
* <DataTable.RowExpandButton row={props.row} label={props.row.original.name} />
|
|
445
|
+
* </DataTable.Cell>
|
|
446
|
+
* ),
|
|
447
|
+
* });
|
|
448
|
+
* ```
|
|
449
|
+
*/
|
|
450
|
+
declare function ExpandHeader({
|
|
451
|
+
children,
|
|
452
|
+
className,
|
|
453
|
+
...props
|
|
454
|
+
}: DataTableExpandHeaderProps): import("react").JSX.Element;
|
|
455
|
+
declare namespace ExpandHeader {
|
|
456
|
+
var displayName: string;
|
|
457
|
+
}
|
|
458
|
+
type DataTableRowExpandButtonProps<TData> = Omit<ComponentProps<typeof IconButton>, "aria-controls" | "aria-expanded" | "icon" | "label"> & {
|
|
459
|
+
/**
|
|
460
|
+
* The TanStack Table row this button toggles. The table must be configured for
|
|
461
|
+
* expansion (`getExpandedRowModel`, plus `getRowCanExpand: () => true` for
|
|
462
|
+
* custom detail panels, which have no sub-rows).
|
|
463
|
+
*/
|
|
464
|
+
row: Row<TData>;
|
|
465
|
+
/**
|
|
466
|
+
* A human-readable name for the row, woven into the accessible label:
|
|
467
|
+
* `Show details for {label}` / `Hide details for {label}`.
|
|
468
|
+
*/
|
|
469
|
+
label: string;
|
|
470
|
+
/**
|
|
471
|
+
* Icon shown while the row is collapsed (activating it expands the row).
|
|
472
|
+
* @default <PlusIcon weight="bold" />
|
|
473
|
+
*/
|
|
474
|
+
expandIcon?: ReactNode;
|
|
475
|
+
/**
|
|
476
|
+
* Icon shown while the row is expanded (activating it collapses the row).
|
|
477
|
+
* @default <MinusIcon weight="bold" />
|
|
478
|
+
*/
|
|
479
|
+
collapseIcon?: ReactNode;
|
|
480
|
+
};
|
|
481
|
+
/**
|
|
482
|
+
* An accessible +/- toggle that expands or collapses a row's detail panel. Drop
|
|
483
|
+
* it inside a `DataTable.Cell` in a leading `columnHelper.display` column and
|
|
484
|
+
* pair it with `DataTable.ExpandedRow`.
|
|
485
|
+
*
|
|
486
|
+
* Renders a real `<button>` (keyboard operable) that sets `aria-expanded` and,
|
|
487
|
+
* while expanded, `aria-controls` pointing at the `DataTable.ExpandedRow`. It
|
|
488
|
+
* stops click propagation so it never triggers a row-level `onClick` (e.g. row
|
|
489
|
+
* navigation), and renders nothing when `row.getCanExpand()` is false so a
|
|
490
|
+
* `getRowCanExpand` predicate cleanly hides it. Forwards `IconButton` props, so
|
|
491
|
+
* pass `onClick` to run side effects before the toggle (call
|
|
492
|
+
* `event.preventDefault()` to veto it).
|
|
493
|
+
*
|
|
494
|
+
* @see https://mantle.ngrok.com/components/data-table#datatablerowexpandbutton
|
|
495
|
+
*
|
|
496
|
+
* @example
|
|
497
|
+
* ```tsx
|
|
498
|
+
* columnHelper.display({
|
|
499
|
+
* id: "expander",
|
|
500
|
+
* header: () => <DataTable.ExpandHeader />,
|
|
501
|
+
* cell: (props) => (
|
|
502
|
+
* <DataTable.Cell className="w-9 px-0 text-center">
|
|
503
|
+
* <DataTable.RowExpandButton row={props.row} label={props.row.original.name} />
|
|
504
|
+
* </DataTable.Cell>
|
|
505
|
+
* ),
|
|
506
|
+
* });
|
|
507
|
+
* ```
|
|
508
|
+
*/
|
|
509
|
+
declare function RowExpandButton<TData>({
|
|
510
|
+
appearance,
|
|
511
|
+
className,
|
|
512
|
+
collapseIcon,
|
|
513
|
+
expandIcon,
|
|
514
|
+
label,
|
|
515
|
+
onClick,
|
|
516
|
+
row,
|
|
517
|
+
size,
|
|
518
|
+
...props
|
|
519
|
+
}: DataTableRowExpandButtonProps<TData>): import("react").JSX.Element | null;
|
|
520
|
+
declare namespace RowExpandButton {
|
|
521
|
+
var displayName: string;
|
|
522
|
+
}
|
|
523
|
+
type DataTableExpandedRowProps<TData> = Omit<ComponentProps<typeof Table$1.Row>, "children"> & {
|
|
524
|
+
/** The row whose detail panel this displays. */row: Row<TData>;
|
|
525
|
+
/**
|
|
526
|
+
* Override the cell's `colSpan`. Defaults to the row's visible-cell count so
|
|
527
|
+
* the panel spans every visible column (visibility- and pinning-aware).
|
|
528
|
+
*/
|
|
529
|
+
colSpan?: number; /** The detail content rendered inside the full-width panel. */
|
|
530
|
+
children: ReactNode;
|
|
531
|
+
};
|
|
532
|
+
/**
|
|
533
|
+
* The sibling `<tr>` that renders a row's expanded detail panel. For the common
|
|
534
|
+
* case, prefer `DataTable.Row`'s `renderExpanded` prop, which renders this for
|
|
535
|
+
* you. Reach for `ExpandedRow` directly when you need full control — a custom
|
|
536
|
+
* `colSpan`, multiple panels, or bespoke markup. Render it directly after the
|
|
537
|
+
* parent `DataTable.Row` — wrapped in a `Fragment`, never a DOM element (a node
|
|
538
|
+
* between `<tbody>` and `<tr>` is invalid HTML) — and only when
|
|
539
|
+
* `row.getIsExpanded()` is true.
|
|
540
|
+
*
|
|
541
|
+
* The single cell spans every visible column (override with `colSpan`), carries
|
|
542
|
+
* the `id` that `DataTable.RowExpandButton` targets via `aria-controls`, and
|
|
543
|
+
* sits on an opaque card surface so horizontally-scrolled content never shows
|
|
544
|
+
* through a sticky action column. Its top divider is suppressed so it reads as
|
|
545
|
+
* one block with its parent row; the panel itself does not change on hover (only
|
|
546
|
+
* the parent data row reacts to hover). Exposes `data-expanded-content` for
|
|
547
|
+
* styling hooks.
|
|
548
|
+
*
|
|
549
|
+
* @see https://mantle.ngrok.com/components/data-table#datatableexpandedrow
|
|
550
|
+
*
|
|
551
|
+
* @example
|
|
552
|
+
* Render the row's underlying object as JSON (a common detail-panel use case).
|
|
553
|
+
* `jsonCodeBlockValue` highlights the JSON entirely on the client — no Shiki
|
|
554
|
+
* runtime, no build-time plugin, no server roundtrip — so it works for runtime
|
|
555
|
+
* data and matches server/build-time highlighting:
|
|
556
|
+
* ```tsx
|
|
557
|
+
* import { CodeBlock, jsonCodeBlockValue } from "@ngrok/mantle/code-block";
|
|
558
|
+
* import { Fragment } from "react";
|
|
559
|
+
*
|
|
560
|
+
* {table.getRowModel().rows.map((row) => (
|
|
561
|
+
* <Fragment key={row.id}>
|
|
562
|
+
* <DataTable.Row row={row} />
|
|
563
|
+
* {row.getIsExpanded() && (
|
|
564
|
+
* <DataTable.ExpandedRow row={row}>
|
|
565
|
+
* <CodeBlock.Root>
|
|
566
|
+
* <CodeBlock.Body>
|
|
567
|
+
* <CodeBlock.CopyButton />
|
|
568
|
+
* <CodeBlock.Code value={jsonCodeBlockValue(row.original)} />
|
|
569
|
+
* </CodeBlock.Body>
|
|
570
|
+
* </CodeBlock.Root>
|
|
571
|
+
* </DataTable.ExpandedRow>
|
|
572
|
+
* )}
|
|
573
|
+
* </Fragment>
|
|
574
|
+
* ))}
|
|
575
|
+
* ```
|
|
576
|
+
*/
|
|
577
|
+
declare function ExpandedRow<TData>({
|
|
578
|
+
children,
|
|
579
|
+
className,
|
|
580
|
+
colSpan,
|
|
581
|
+
row,
|
|
582
|
+
...props
|
|
583
|
+
}: DataTableExpandedRowProps<TData>): import("react").JSX.Element;
|
|
584
|
+
declare namespace ExpandedRow {
|
|
585
|
+
var displayName: string;
|
|
586
|
+
}
|
|
358
587
|
/**
|
|
359
588
|
* Use `DataTable` for INTERACTIVE tabular data — sorting, filtering, pagination,
|
|
360
589
|
* row selection, and server-side or client-side data. Built on TanStack Table;
|
|
@@ -376,13 +605,16 @@ declare namespace ActionHeader {
|
|
|
376
605
|
* DataTable.Root
|
|
377
606
|
* ├── DataTable.Head
|
|
378
607
|
* │ └── DataTable.Row
|
|
608
|
+
* │ ├── DataTable.ExpandHeader
|
|
379
609
|
* │ ├── DataTable.Header
|
|
380
610
|
* │ │ └── DataTable.HeaderSortButton
|
|
381
611
|
* │ └── DataTable.ActionHeader
|
|
382
612
|
* └── DataTable.Body
|
|
383
613
|
* ├── DataTable.Row
|
|
384
614
|
* │ ├── DataTable.Cell
|
|
615
|
+
* │ │ └── DataTable.RowExpandButton
|
|
385
616
|
* │ └── DataTable.ActionCell
|
|
617
|
+
* ├── DataTable.ExpandedRow
|
|
386
618
|
* └── DataTable.EmptyRow
|
|
387
619
|
* ```
|
|
388
620
|
*
|
|
@@ -871,23 +1103,105 @@ declare const DataTable: {
|
|
|
871
1103
|
* Pass a different `cursor-*` class via `className` to override. For keyboard
|
|
872
1104
|
* and screen-reader access, also render a `<Link>` inside the primary cell.
|
|
873
1105
|
*
|
|
1106
|
+
* Pass `renderExpanded` to give the row an inline detail panel — the row then
|
|
1107
|
+
* renders a sibling `DataTable.ExpandedRow` (only while expanded) holding the
|
|
1108
|
+
* returned content. Pair with `DataTable.RowExpandButton`.
|
|
1109
|
+
*
|
|
874
1110
|
* @see https://mantle.ngrok.com/components/data-table#datatablerow
|
|
875
1111
|
*
|
|
876
1112
|
* @example
|
|
877
1113
|
* ```tsx
|
|
878
|
-
*
|
|
1114
|
+
* import { CodeBlock, jsonCodeBlockValue } from "@ngrok/mantle/code-block";
|
|
879
1115
|
*
|
|
880
1116
|
* {rows.map((row) => (
|
|
881
1117
|
* <DataTable.Row
|
|
882
1118
|
* key={row.id}
|
|
883
1119
|
* row={row}
|
|
884
|
-
*
|
|
1120
|
+
* renderExpanded={(row) => (
|
|
1121
|
+
* <CodeBlock.Root>
|
|
1122
|
+
* <CodeBlock.Body>
|
|
1123
|
+
* <CodeBlock.CopyButton />
|
|
1124
|
+
* <CodeBlock.Code value={jsonCodeBlockValue(row.original)} />
|
|
1125
|
+
* </CodeBlock.Body>
|
|
1126
|
+
* </CodeBlock.Root>
|
|
1127
|
+
* )}
|
|
885
1128
|
* />
|
|
886
1129
|
* ))}
|
|
887
1130
|
* ```
|
|
888
1131
|
*/
|
|
889
1132
|
readonly Row: typeof Row$1;
|
|
1133
|
+
/**
|
|
1134
|
+
* A narrow `<th>` for the leading expand-toggle column, mirroring
|
|
1135
|
+
* `DataTable.ActionHeader`. Renders a screen-reader-only label by default so
|
|
1136
|
+
* the column is announced while staying visually empty.
|
|
1137
|
+
*
|
|
1138
|
+
* @see https://mantle.ngrok.com/components/data-table#datatableexpandheader
|
|
1139
|
+
*
|
|
1140
|
+
* @example
|
|
1141
|
+
* ```tsx
|
|
1142
|
+
* columnHelper.display({
|
|
1143
|
+
* id: "expander",
|
|
1144
|
+
* header: () => <DataTable.ExpandHeader />,
|
|
1145
|
+
* cell: (props) => (
|
|
1146
|
+
* <DataTable.Cell className="w-9 px-0 text-center">
|
|
1147
|
+
* <DataTable.RowExpandButton row={props.row} label={props.row.original.name} />
|
|
1148
|
+
* </DataTable.Cell>
|
|
1149
|
+
* ),
|
|
1150
|
+
* });
|
|
1151
|
+
* ```
|
|
1152
|
+
*/
|
|
1153
|
+
readonly ExpandHeader: typeof ExpandHeader;
|
|
1154
|
+
/**
|
|
1155
|
+
* An accessible +/- toggle that expands or collapses a row's detail panel.
|
|
1156
|
+
* Place it inside a `DataTable.Cell` in a leading `columnHelper.display`
|
|
1157
|
+
* column and pair it with `DataTable.ExpandedRow`. Sets `aria-expanded` and
|
|
1158
|
+
* (while expanded) `aria-controls`, stops click propagation so it never fires
|
|
1159
|
+
* a row-level `onClick`, and renders nothing when `row.getCanExpand()` is
|
|
1160
|
+
* false.
|
|
1161
|
+
*
|
|
1162
|
+
* @see https://mantle.ngrok.com/components/data-table#datatablerowexpandbutton
|
|
1163
|
+
*
|
|
1164
|
+
* @example
|
|
1165
|
+
* ```tsx
|
|
1166
|
+
* <DataTable.Cell className="w-9 px-0 text-center">
|
|
1167
|
+
* <DataTable.RowExpandButton row={props.row} label={props.row.original.name} />
|
|
1168
|
+
* </DataTable.Cell>
|
|
1169
|
+
* ```
|
|
1170
|
+
*/
|
|
1171
|
+
readonly RowExpandButton: typeof RowExpandButton;
|
|
1172
|
+
/**
|
|
1173
|
+
* The sibling `<tr>` that renders a row's expanded detail panel. Render it
|
|
1174
|
+
* directly after the parent `DataTable.Row` (wrapped in a `Fragment`, never a
|
|
1175
|
+
* DOM element) and only when `row.getIsExpanded()` is true. Spans every
|
|
1176
|
+
* visible column, carries the `id` that `DataTable.RowExpandButton` targets,
|
|
1177
|
+
* and sits on an opaque card surface so it coexists with a sticky action
|
|
1178
|
+
* column.
|
|
1179
|
+
*
|
|
1180
|
+
* @see https://mantle.ngrok.com/components/data-table#datatableexpandedrow
|
|
1181
|
+
*
|
|
1182
|
+
* @example
|
|
1183
|
+
* ```tsx
|
|
1184
|
+
* import { CodeBlock, jsonCodeBlockValue } from "@ngrok/mantle/code-block";
|
|
1185
|
+
* import { Fragment } from "react";
|
|
1186
|
+
*
|
|
1187
|
+
* {table.getRowModel().rows.map((row) => (
|
|
1188
|
+
* <Fragment key={row.id}>
|
|
1189
|
+
* <DataTable.Row row={row} />
|
|
1190
|
+
* {row.getIsExpanded() && (
|
|
1191
|
+
* <DataTable.ExpandedRow row={row}>
|
|
1192
|
+
* <CodeBlock.Root>
|
|
1193
|
+
* <CodeBlock.Body>
|
|
1194
|
+
* <CodeBlock.CopyButton />
|
|
1195
|
+
* <CodeBlock.Code value={jsonCodeBlockValue(row.original)} />
|
|
1196
|
+
* </CodeBlock.Body>
|
|
1197
|
+
* </CodeBlock.Root>
|
|
1198
|
+
* </DataTable.ExpandedRow>
|
|
1199
|
+
* )}
|
|
1200
|
+
* </Fragment>
|
|
1201
|
+
* ))}
|
|
1202
|
+
* ```
|
|
1203
|
+
*/
|
|
1204
|
+
readonly ExpandedRow: typeof ExpandedRow;
|
|
890
1205
|
};
|
|
891
1206
|
//#endregion
|
|
892
|
-
export { DataTable };
|
|
893
|
-
//# sourceMappingURL=data-table.d.ts.map
|
|
1207
|
+
export { DataTable, expandedRowId };
|
package/dist/data-table.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-CBSnSC36.js";import{t}from"./button-
|
|
2
|
-
//# sourceMappingURL=data-table.js.map
|
|
1
|
+
import{t as e}from"./cx-CBSnSC36.js";import{t}from"./icon-button-DUNHVWpb.js";import{t as n}from"./button-BfMn3PgP.js";import{i as r}from"./direction-Wa9W2F61.js";import{t as i}from"./sort-BPX2Fk9t.js";import{t as a}from"./table-DWy_oNta.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({children:t,className:i,column:a,disableSorting:o=!1,iconPlacement:s=`end`,sortingMode:c,sortIcon:l,onClick:u,...d}){let f=a.getIsSorted(),h=!o&&a.getCanSort(),g=h&&typeof f==`string`?f:`unsorted`,_=l?.(g)??p(V,{mode:c,direction:g});return m(n,{appearance:`ghost`,"data-slot":`data-table-header-sort-button`,className:e(`flex justify-start w-full h-full rounded-none not-disabled:active:scale-none text-muted`,i),"data-sort-direction":g,"data-table-header-action":!0,icon:_,iconPlacement:s,onClick:e=>{u?.(e),!e.defaultPrevented&&(!h||o||c===void 0||H(a,c))},priority:`neutral`,type:`button`,...d,children:[h&&g!==`unsorted`&&m(`span`,{className:`sr-only`,children:[`Column sorted in`,` `,c===`alphanumeric`?g===`asc`?`ascending`:`descending`:r(g),` `,`order`]}),t]})}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,label:o,onClick:s,row:c,size:l=`sm`,...u}){if(!c.getCanExpand())return null;let d=c.getIsExpanded(),f=c.getToggleExpandedHandler();return p(t,{type:`button`,"data-slot":`data-table-row-expand-button`,appearance:n,size:l,className:e(`rounded`,r),"aria-expanded":d,"aria-controls":d?P(c):void 0,icon:d?i:a,label:`${d?`Hide`:`Show`} details for ${o}`,onClick:e=>{e.stopPropagation(),s?.(e),!e.defaultPrevented&&f()},...u})}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};
|
|
@@ -101,5 +101,4 @@ declare const DescriptionList: {
|
|
|
101
101
|
readonly Value: import("react").ForwardRefExoticComponent<Omit<DescriptionListValueProps, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
102
102
|
};
|
|
103
103
|
//#endregion
|
|
104
|
-
export { DescriptionList, type DescriptionListProps };
|
|
105
|
-
//# sourceMappingURL=description-list.d.ts.map
|
|
104
|
+
export { DescriptionList, type DescriptionListProps };
|