@ngrok/mantle 0.77.0 → 0.79.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion.d.ts +63 -21
- package/dist/accordion.js +1 -1
- package/dist/agent.json +4 -1
- package/dist/alert-dialog.d.ts +102 -70
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.d.ts +39 -39
- package/dist/alert.js +1 -1
- package/dist/{anchor-BtgEJoPN.js → anchor-C_tjSVy6.js} +1 -1
- package/dist/anchor.d.ts +3 -4
- package/dist/anchor.js +1 -1
- package/dist/{as-child-uN_018tj.d.ts → as-child-CYEVu1WY.d.ts} +0 -7
- package/dist/badge.d.ts +5 -56
- package/dist/badge.js +1 -1
- package/dist/breadcrumb.d.ts +212 -0
- package/dist/breadcrumb.js +1 -0
- package/dist/browser-only.d.ts +2 -6
- package/dist/{button-CERx95KE.js → button-5t6-JS_I.js} +1 -1
- package/dist/button-ClC60Nzg.js +1 -0
- package/dist/button-DcXOWUYo.d.ts +131 -0
- package/dist/button.d.ts +6 -4
- package/dist/button.js +1 -1
- package/dist/calendar.d.ts +2 -8
- package/dist/calendar.js +1 -1
- package/dist/card.d.ts +8 -8
- package/dist/card.js +1 -1
- package/dist/centered-layout.d.ts +147 -0
- package/dist/centered-layout.js +1 -0
- package/dist/checkbox-DJ2xl7Rc.js +1 -0
- package/dist/checkbox.d.ts +9 -11
- package/dist/checkbox.js +1 -1
- package/dist/{choice-D6S38dPs.js → choice-DOdyNzFC.js} +1 -1
- package/dist/choice.d.ts +16 -14
- package/dist/choice.js +1 -1
- package/dist/code-block.d.ts +5 -17
- package/dist/code-block.js +1 -1
- package/dist/code-block_highlight-utils.d.ts +1 -1
- package/dist/code-block_highlight-utils.js +1 -1
- package/dist/code.d.ts +4 -5
- package/dist/code.js +1 -1
- package/dist/combobox.d.ts +40 -19
- package/dist/combobox.js +1 -1
- package/dist/command.d.ts +71 -49
- package/dist/command.js +1 -1
- package/dist/cx-IiQEAKf5.js +1 -0
- package/dist/cx.js +1 -1
- package/dist/data-slot-CChfb_cv.d.ts +17 -0
- package/dist/data-table.d.ts +77 -137
- package/dist/data-table.js +1 -1
- package/dist/description-list.d.ts +7 -7
- package/dist/description-list.js +1 -1
- package/dist/{dialog-uyJcNks7.js → dialog-ZCgG41hx.js} +1 -1
- package/dist/dialog.d.ts +213 -88
- package/dist/dialog.js +1 -1
- package/dist/{direction-CcTY0FmA.d.ts → direction-BjU0bPST.d.ts} +1 -1
- package/dist/{dropdown-menu-OEuW4GLp.js → dropdown-menu-ByUQkAvJ.js} +1 -1
- package/dist/{dropdown-menu-CADgs9gz.d.ts → dropdown-menu-DMNw8ItM.d.ts} +26 -27
- package/dist/dropdown-menu.d.ts +2 -1
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty.d.ts +139 -59
- package/dist/empty.js +1 -1
- package/dist/{field-context-4k1kI7Bo.js → field-context-BR01g789.js} +1 -1
- package/dist/field.d.ts +41 -36
- package/dist/field.js +1 -1
- package/dist/flag.d.ts +2 -9
- package/dist/flag.js +1 -1
- package/dist/hooks.d.ts +13 -15
- package/dist/hooks.js +1 -1
- package/dist/hover-card.d.ts +42 -20
- package/dist/hover-card.js +1 -1
- package/dist/icon-CDtYjF_H.js +1 -0
- package/dist/{icon-n49kOh4_.d.ts → icon-Cevjo93X.d.ts} +2 -3
- package/dist/{icon-button-D7hs6bX2.d.ts → icon-button-B7uEj1qq.d.ts} +73 -11
- package/dist/icon-button-DV2-GZHf.js +1 -0
- package/dist/icon.d.ts +3 -3
- package/dist/icon.js +1 -1
- package/dist/icons.d.ts +7 -19
- package/dist/icons.js +1 -1
- package/dist/{in-view-bItE1fkG.d.ts → in-view-nkSOdED2.d.ts} +1 -6
- package/dist/{index-CTU6apE6.d.ts → index-BivvYYs-.d.ts} +8 -7
- package/dist/{index-Bed_XLWa.d.ts → index-D47aqlpz.d.ts} +3 -2
- package/dist/index-DZRbVkZa.d.ts +1 -0
- package/dist/index-Rv8RL7xy.d.ts +25 -0
- package/dist/{input-B3TS9yAP.js → input-Ct1YOqSy.js} +1 -1
- package/dist/input.d.ts +10 -11
- package/dist/input.js +1 -1
- package/dist/intents-DdSKSj1c.d.ts +28 -0
- package/dist/{kbd-D6k4Dnrf.js → kbd-K8iaZ-Ti.js} +1 -1
- package/dist/kbd.d.ts +3 -8
- package/dist/kbd.js +1 -1
- package/dist/{label-BLXfnQmn.js → label-BMlHW_2D.js} +1 -1
- package/dist/{label-PY0qM0G5.d.ts → label-v2-bv98k.d.ts} +1 -1
- package/dist/label.d.ts +1 -1
- package/dist/label.js +1 -1
- package/dist/list.d.ts +18 -60
- package/dist/list.js +1 -1
- package/dist/llms.txt +4 -1
- package/dist/main.d.ts +4 -27
- package/dist/main.js +1 -1
- package/dist/mantle.css +6 -6
- package/dist/media-object.d.ts +6 -7
- package/dist/media-object.js +1 -1
- package/dist/multi-select.d.ts +80 -33
- package/dist/multi-select.js +1 -1
- package/dist/otp-input.d.ts +7 -8
- package/dist/otp-input.js +1 -1
- package/dist/pagination.d.ts +11 -22
- package/dist/pagination.js +1 -1
- package/dist/{popover-Bq52EC7X.js → popover-D5WxxnBY.js} +1 -1
- package/dist/popover.d.ts +17 -18
- package/dist/popover.js +1 -1
- package/dist/{primitive-FoWela9a.d.ts → primitive-C64-m48O.d.ts} +0 -1
- package/dist/{primitive-BuVqb6zf.js → primitive-M-kZdNIS.js} +1 -1
- package/dist/progress.d.ts +55 -46
- package/dist/progress.js +1 -1
- package/dist/qr-code.d.ts +10 -9
- package/dist/qr-code.js +1 -1
- package/dist/radio-group.d.ts +71 -60
- package/dist/radio-group.js +1 -1
- package/dist/{resolve-pre-rendered-props-DxJ9-DAl.d.ts → resolve-pre-rendered-props-B6OlZrSI.d.ts} +13 -26
- package/dist/{resolve-pre-rendered-props-DwIF_M_K.js → resolve-pre-rendered-props-C3e5Auo3.js} +1 -1
- package/dist/sandboxed-on-click.d.ts +4 -8
- package/dist/sandboxed-on-click.js +1 -1
- package/dist/{select-BUGOJMER.d.ts → select-Bwt2YduR.d.ts} +11 -12
- package/dist/{select-Bxq_N-_o.js → select-D-5u0Blc.js} +1 -1
- package/dist/select.d.ts +1 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list.d.ts +160 -146
- package/dist/selectable-list.js +1 -1
- package/dist/{separator-CqohKk4z.js → separator-kBnnv3Cw.js} +1 -1
- package/dist/separator.d.ts +6 -37
- package/dist/separator.js +1 -1
- package/dist/sheet.d.ts +302 -89
- package/dist/sheet.js +1 -1
- package/dist/sizes-BCoI4bhP.d.ts +29 -0
- package/dist/skeleton-Bu3tgNcW.js +1 -0
- package/dist/skeleton.d.ts +2 -2
- package/dist/skeleton.js +1 -1
- package/dist/skip-to-main-link.d.ts +4 -34
- package/dist/skip-to-main-link.js +1 -1
- package/dist/slider.d.ts +2 -21
- package/dist/slider.js +1 -1
- package/dist/slot-DmPrjM7N.js +1 -0
- package/dist/slot.d.ts +1 -1
- package/dist/slot.js +1 -1
- package/dist/split-button.d.ts +21 -13
- package/dist/split-button.js +1 -1
- package/dist/{svg-only-f6ToFLH0.d.ts → svg-only-BFeFS1aa.d.ts} +2 -3
- package/dist/{svg-only-CSOaF1tL.js → svg-only-DDx6FtJd.js} +1 -1
- package/dist/switch.d.ts +4 -5
- package/dist/switch.js +1 -1
- package/dist/{table-CAitdL78.js → table-CPH2md2-.js} +1 -1
- package/dist/{table-BWD9IlIN.d.ts → table-CwFHXC-G.d.ts} +10 -10
- package/dist/table.d.ts +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.d.ts +29 -15
- package/dist/tabs.js +1 -1
- package/dist/text-area.d.ts +2 -3
- package/dist/text-area.js +1 -1
- package/dist/theme-D8kZCOzM.js +1 -0
- package/dist/theme-provider-Djj_jBo6.js +1 -0
- package/dist/theme-switcher.d.ts +53 -0
- package/dist/theme-switcher.js +1 -0
- package/dist/theme.d.ts +15 -101
- package/dist/theme.js +1 -1
- package/dist/toast-D3ntBmn4.js +1 -0
- package/dist/toast.d.ts +32 -50
- package/dist/toast.js +1 -1
- package/dist/tooltip.d.ts +16 -50
- package/dist/tooltip.js +1 -1
- package/dist/{types-CTam1uIW.d.ts → types-C19IR7jf.d.ts} +1 -0
- package/dist/{types-BvUzforF.d.ts → types-D1RY5Tcj.d.ts} +0 -1
- package/dist/types.d.ts +3 -3
- package/dist/use-prefers-reduced-motion-CagaNRgm.js +1 -0
- package/dist/utils.d.ts +2 -3
- package/dist/{validation-xyX_6kph.d.ts → validation-7QeiTFwl.d.ts} +3 -12
- package/dist/{validation-DCyx-ceH.js → validation-Bpptk_9t.js} +1 -1
- package/dist/{virtual-PBNiHjMK.js → virtual-DZMBu7Ch.js} +1 -1
- package/dist/well.d.ts +3 -3
- package/dist/well.js +1 -1
- package/dist/{with-style-props-CyImx7vd.d.ts → with-style-props-Dq5Vntqy.d.ts} +0 -1
- package/package.json +17 -14
- package/dist/button-C9GW9nAr.js +0 -1
- package/dist/button-mfYak6Rx.d.ts +0 -71
- package/dist/checkbox-Apow0ipK.js +0 -1
- package/dist/cx-C1UYP5We.js +0 -1
- package/dist/icon-SUx16Sl3.js +0 -1
- package/dist/icon-button-DiX9iZ9n.js +0 -1
- package/dist/index-CJbKEKr2.d.ts +0 -20
- package/dist/slot-DT_E5BQx.js +0 -1
- package/dist/theme-provider-C5XYi2-H.js +0 -1
- package/dist/toast-CZBWjXcP.js +0 -1
- package/dist/use-prefers-reduced-motion-DBqNw1wB.js +0 -1
package/dist/code-block.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./compose-refs-Cjf2gfB8.js";import{t}from"./cx-
|
|
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]===`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as FoldStrategy, B as computeJsonFoldRanges, C as Indentation, D as FoldExplanation, E as ComputeFoldRangesInput, F as isSupportedLanguage, H as finalizeFoldRanges, I as parseLanguage, L as supportedLanguages, M as computeFoldRanges, N as foldStrategyFor, O as FoldLine, P as SupportedLanguage, R as DecorateHighlightedHtmlInput, S as normalizeIndentation, T as isIndentation, U as LineRange, V as FoldableRange, b as defaultShowLineNumbers, g as parseCodeBlockShowLineNumbers, h as parseCodeBlockLineNumberStart, j as FoldToken, k as FoldScope, m as parseCodeBlockHighlightLines, p as tokenizeMetastring, u as normalizeValue, w as inferIndentation, z as decorateHighlightedHtml } from "./resolve-pre-rendered-props-
|
|
1
|
+
import { A as FoldStrategy, B as computeJsonFoldRanges, C as Indentation, D as FoldExplanation, E as ComputeFoldRangesInput, F as isSupportedLanguage, H as finalizeFoldRanges, I as parseLanguage, L as supportedLanguages, M as computeFoldRanges, N as foldStrategyFor, O as FoldLine, P as SupportedLanguage, R as DecorateHighlightedHtmlInput, S as normalizeIndentation, T as isIndentation, U as LineRange, V as FoldableRange, b as defaultShowLineNumbers, g as parseCodeBlockShowLineNumbers, h as parseCodeBlockLineNumberStart, j as FoldToken, k as FoldScope, m as parseCodeBlockHighlightLines, p as tokenizeMetastring, u as normalizeValue, w as inferIndentation, z as decorateHighlightedHtml } from "./resolve-pre-rendered-props-B6OlZrSI.js";
|
|
2
2
|
export { type ComputeFoldRangesInput, type DecorateHighlightedHtmlInput, type FoldExplanation, type FoldLine, type FoldScope, type FoldStrategy, type FoldToken, type FoldableRange, type Indentation, type LineRange, type SupportedLanguage, computeFoldRanges, computeJsonFoldRanges, decorateHighlightedHtml, defaultShowLineNumbers, finalizeFoldRanges, foldStrategyFor, inferIndentation, isIndentation, isSupportedLanguage, normalizeIndentation, normalizeValue, parseCodeBlockHighlightLines, parseCodeBlockLineNumberStart, parseCodeBlockShowLineNumbers, parseLanguage, supportedLanguages, 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-C3e5Auo3.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
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { t as WithAsChild } from "./as-child-
|
|
2
|
-
|
|
1
|
+
import { t as WithAsChild } from "./as-child-CYEVu1WY.js";
|
|
3
2
|
//#region src/components/code/code.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Marks a short fragment of inline computer code — a function name, a
|
|
@@ -11,14 +10,14 @@ import { t as WithAsChild } from "./as-child-uN_018tj.js";
|
|
|
11
10
|
* - Wrap technical terms that should visually stand apart from running text.
|
|
12
11
|
*
|
|
13
12
|
* **When not to use**
|
|
14
|
-
* - For multi-line or syntax-highlighted blocks. Use {@link https://mantle.ngrok.com/components/code-block CodeBlock} instead.
|
|
15
|
-
* - For keyboard shortcuts. Use {@link https://mantle.ngrok.com/components/kbd Kbd}.
|
|
13
|
+
* - For multi-line or syntax-highlighted blocks. Use {@link https://mantle.ngrok.com/components/data-display/code-block CodeBlock} instead.
|
|
14
|
+
* - For keyboard shortcuts. Use {@link https://mantle.ngrok.com/components/data-display/kbd Kbd}.
|
|
16
15
|
* - For arbitrary monospace text that isn't code (use a plain monospace utility class).
|
|
17
16
|
*
|
|
18
17
|
* **Polymorphism.** Pass `asChild` to render `Code` styling on a different
|
|
19
18
|
* element (e.g. a link wrapping a code-styled label).
|
|
20
19
|
*
|
|
21
|
-
* @see https://mantle.ngrok.com/components/code
|
|
20
|
+
* @see https://mantle.ngrok.com/components/data-display/code
|
|
22
21
|
*
|
|
23
22
|
* @example
|
|
24
23
|
* ```tsx
|
package/dist/code.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-DmPrjM7N.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/combobox.d.ts
CHANGED
|
@@ -1,9 +1,36 @@
|
|
|
1
|
-
import { t as WithAsChild } from "./as-child-
|
|
2
|
-
import { o as WithValidation } from "./validation-
|
|
1
|
+
import { t as WithAsChild } from "./as-child-CYEVu1WY.js";
|
|
2
|
+
import { o as WithValidation } from "./validation-7QeiTFwl.js";
|
|
3
3
|
import * as Primitive from "@ariakit/react";
|
|
4
|
-
|
|
5
4
|
//#region src/components/combobox/combobox.d.ts
|
|
6
5
|
type ComboboxProps = Primitive.ComboboxProviderProps;
|
|
6
|
+
/**
|
|
7
|
+
* Root component for a combobox. Provides a combobox store that controls the state of Combobox components.
|
|
8
|
+
*
|
|
9
|
+
* Use Combobox for a list of options where the user types to filter — large static lists,
|
|
10
|
+
* async/server-side data, or any single-select where search is helpful. For very small
|
|
11
|
+
* finite lists with no filtering, prefer Select. For multi-selection, prefer MultiSelect.
|
|
12
|
+
*
|
|
13
|
+
* `Combobox.Content` renders at Tailwind `z-50`, Mantle's shared floating
|
|
14
|
+
* z-index. When multiple shared layers are open, the most recently mounted
|
|
15
|
+
* layer renders on top.
|
|
16
|
+
*
|
|
17
|
+
* @see https://mantle.ngrok.com/components/forms/combobox#comboboxroot
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <Combobox.Root>
|
|
22
|
+
* <Combobox.Input />
|
|
23
|
+
* <Combobox.Content>
|
|
24
|
+
* <Combobox.Item value="Apple" />
|
|
25
|
+
* <Combobox.Item value="Banana" />
|
|
26
|
+
* </Combobox.Content>
|
|
27
|
+
* </Combobox.Root>
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
declare const Root: {
|
|
31
|
+
({ children, ...props }: ComboboxProps): import("react").JSX.Element;
|
|
32
|
+
displayName: string;
|
|
33
|
+
};
|
|
7
34
|
type ComboboxInputProps = Omit<Primitive.ComboboxProps, "render"> & WithValidation;
|
|
8
35
|
type ComboboxContentProps = Omit<Primitive.ComboboxPopoverProps, "render"> & WithAsChild;
|
|
9
36
|
type ComboboxItemProps = Omit<Primitive.ComboboxItemProps, "render"> & WithAsChild;
|
|
@@ -27,7 +54,7 @@ type ComboboxItemValueProps = Omit<Primitive.ComboboxItemValueProps<"span">, "re
|
|
|
27
54
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/combobox/
|
|
28
55
|
* @see https://ariakit.org/components/combobox
|
|
29
56
|
*
|
|
30
|
-
* @see https://mantle.ngrok.com/components/combobox
|
|
57
|
+
* @see https://mantle.ngrok.com/components/forms/combobox
|
|
31
58
|
*
|
|
32
59
|
* @example
|
|
33
60
|
* Composition:
|
|
@@ -65,7 +92,7 @@ declare const Combobox: {
|
|
|
65
92
|
* z-index. When multiple shared layers are open, the most recently mounted
|
|
66
93
|
* layer renders on top.
|
|
67
94
|
*
|
|
68
|
-
* @see https://mantle.ngrok.com/components/combobox#comboboxroot
|
|
95
|
+
* @see https://mantle.ngrok.com/components/forms/combobox#comboboxroot
|
|
69
96
|
*
|
|
70
97
|
* @example
|
|
71
98
|
* ```tsx
|
|
@@ -78,13 +105,7 @@ declare const Combobox: {
|
|
|
78
105
|
* </Combobox.Root>
|
|
79
106
|
* ```
|
|
80
107
|
*/
|
|
81
|
-
readonly Root:
|
|
82
|
-
({
|
|
83
|
-
children,
|
|
84
|
-
...props
|
|
85
|
-
}: ComboboxProps): import("react").JSX.Element;
|
|
86
|
-
displayName: string;
|
|
87
|
-
};
|
|
108
|
+
readonly Root: typeof Root;
|
|
88
109
|
/**
|
|
89
110
|
* Renders a popover that contains combobox content, e.g. Combobox.Items, Combobox.Groups, and Combobox.Separators.
|
|
90
111
|
*
|
|
@@ -92,7 +113,7 @@ declare const Combobox: {
|
|
|
92
113
|
* z-index. When multiple shared layers are open, the most recently mounted
|
|
93
114
|
* layer renders on top.
|
|
94
115
|
*
|
|
95
|
-
* @see https://mantle.ngrok.com/components/combobox#comboboxcontent
|
|
116
|
+
* @see https://mantle.ngrok.com/components/forms/combobox#comboboxcontent
|
|
96
117
|
*
|
|
97
118
|
* @example
|
|
98
119
|
* ```tsx
|
|
@@ -109,7 +130,7 @@ declare const Combobox: {
|
|
|
109
130
|
/**
|
|
110
131
|
* Renders a group for Combobox.Item elements.
|
|
111
132
|
*
|
|
112
|
-
* @see https://mantle.ngrok.com/components/combobox#comboboxgroup
|
|
133
|
+
* @see https://mantle.ngrok.com/components/forms/combobox#comboboxgroup
|
|
113
134
|
*
|
|
114
135
|
* @example
|
|
115
136
|
* ```tsx
|
|
@@ -129,7 +150,7 @@ declare const Combobox: {
|
|
|
129
150
|
/**
|
|
130
151
|
* Renders a label in a combobox group.
|
|
131
152
|
*
|
|
132
|
-
* @see https://mantle.ngrok.com/components/combobox#comboboxgrouplabel
|
|
153
|
+
* @see https://mantle.ngrok.com/components/forms/combobox#comboboxgrouplabel
|
|
133
154
|
*
|
|
134
155
|
* @example
|
|
135
156
|
* ```tsx
|
|
@@ -149,7 +170,7 @@ declare const Combobox: {
|
|
|
149
170
|
/**
|
|
150
171
|
* Renders a combobox input element that can be used to filter a list of items.
|
|
151
172
|
*
|
|
152
|
-
* @see https://mantle.ngrok.com/components/combobox#comboboxinput
|
|
173
|
+
* @see https://mantle.ngrok.com/components/forms/combobox#comboboxinput
|
|
153
174
|
*
|
|
154
175
|
* @example
|
|
155
176
|
* ```tsx
|
|
@@ -166,7 +187,7 @@ declare const Combobox: {
|
|
|
166
187
|
/**
|
|
167
188
|
* Renders a combobox item inside a Combobox.Content component.
|
|
168
189
|
*
|
|
169
|
-
* @see https://mantle.ngrok.com/components/combobox#comboboxitem
|
|
190
|
+
* @see https://mantle.ngrok.com/components/forms/combobox#comboboxitem
|
|
170
191
|
*
|
|
171
192
|
* @example
|
|
172
193
|
* ```tsx
|
|
@@ -184,7 +205,7 @@ declare const Combobox: {
|
|
|
184
205
|
/**
|
|
185
206
|
* Highlights the match between the current Combobox.Input value and parent Combobox.Item value.
|
|
186
207
|
*
|
|
187
|
-
* @see https://mantle.ngrok.com/components/combobox#comboboxitemvalue
|
|
208
|
+
* @see https://mantle.ngrok.com/components/forms/combobox#comboboxitemvalue
|
|
188
209
|
*
|
|
189
210
|
* @example
|
|
190
211
|
* ```tsx
|
|
@@ -207,7 +228,7 @@ declare const Combobox: {
|
|
|
207
228
|
/**
|
|
208
229
|
* Renders a separator between Combobox.Items or Combobox.Groups.
|
|
209
230
|
*
|
|
210
|
-
* @see https://mantle.ngrok.com/components/combobox#comboboxseparator
|
|
231
|
+
* @see https://mantle.ngrok.com/components/forms/combobox#comboboxseparator
|
|
211
232
|
*
|
|
212
233
|
* @example
|
|
213
234
|
* ```tsx
|
package/dist/combobox.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-DmPrjM7N.js";import{a as n,r}from"./validation-Bpptk_9t.js";import{n as i}from"./separator-kBnnv3Cw.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
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { t as Root } from "./primitive-
|
|
1
|
+
import { t as Root } from "./primitive-C64-m48O.js";
|
|
2
2
|
import { ComponentProps, ComponentPropsWithoutRef, ReactNode } from "react";
|
|
3
3
|
import { Command as Command$1, useCommandState } from "cmdk";
|
|
4
|
-
|
|
5
4
|
//#region src/components/command/command.d.ts
|
|
6
5
|
type CommandRootProps = ComponentPropsWithoutRef<typeof Command$1>;
|
|
7
6
|
/**
|
|
8
7
|
* The props for the CommandDialog.Content component.
|
|
9
8
|
*
|
|
10
|
-
* @see https://mantle.ngrok.com/components/command#commanddialogcontent
|
|
9
|
+
* @see https://mantle.ngrok.com/components/navigation/command#commanddialogcontent
|
|
11
10
|
*/
|
|
12
11
|
type CommandDialogContentProps = {
|
|
13
12
|
/**
|
|
@@ -49,10 +48,47 @@ type CommandDialogContentProps = {
|
|
|
49
48
|
*/
|
|
50
49
|
shouldFilter?: CommandRootProps["shouldFilter"];
|
|
51
50
|
};
|
|
51
|
+
/**
|
|
52
|
+
* The content of the CommandDialog. Renders the accessible title/description,
|
|
53
|
+
* the command palette UI, and an optional close button.
|
|
54
|
+
*
|
|
55
|
+
* @see https://mantle.ngrok.com/components/navigation/command#commanddialogcontent
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```tsx
|
|
59
|
+
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
60
|
+
* <Command.DialogTrigger asChild>
|
|
61
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
62
|
+
* </Command.DialogTrigger>
|
|
63
|
+
* <Command.DialogContent>
|
|
64
|
+
* <Command.Input placeholder="Type a command or search..." />
|
|
65
|
+
* <Command.List>
|
|
66
|
+
* <Command.Empty>No results found.</Command.Empty>
|
|
67
|
+
* <Command.Group heading="Suggestions">
|
|
68
|
+
* <Command.Item>
|
|
69
|
+
* <span>Calendar</span>
|
|
70
|
+
* </Command.Item>
|
|
71
|
+
* </Command.Group>
|
|
72
|
+
* <Command.Separator />
|
|
73
|
+
* <Command.Group heading="Settings">
|
|
74
|
+
* <Command.Item>
|
|
75
|
+
* <span>Profile</span>
|
|
76
|
+
* <Command.Shortcut>⌘,</Command.Shortcut>
|
|
77
|
+
* </Command.Item>
|
|
78
|
+
* </Command.Group>
|
|
79
|
+
* </Command.List>
|
|
80
|
+
* </Command.DialogContent>
|
|
81
|
+
* </Command.DialogRoot>
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
declare const CommandDialogContent: {
|
|
85
|
+
({ children, className, description, filter, shouldFilter, showCloseButton, title }: CommandDialogContentProps): import("react").JSX.Element;
|
|
86
|
+
displayName: string;
|
|
87
|
+
};
|
|
52
88
|
/**
|
|
53
89
|
* The command component for the Command. It provides the command for the command palette.
|
|
54
90
|
*
|
|
55
|
-
* @see https://mantle.ngrok.com/components/command
|
|
91
|
+
* @see https://mantle.ngrok.com/components/navigation/command
|
|
56
92
|
*
|
|
57
93
|
* @example
|
|
58
94
|
* Composition:
|
|
@@ -73,7 +109,7 @@ type CommandDialogContentProps = {
|
|
|
73
109
|
* ```tsx
|
|
74
110
|
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
75
111
|
* <Command.DialogTrigger asChild>
|
|
76
|
-
* <Button type="button">Open Command Palette</Button>
|
|
112
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
77
113
|
* </Command.DialogTrigger>
|
|
78
114
|
* <Command.DialogContent>
|
|
79
115
|
* <Command.Input placeholder="Type a command or search..." />
|
|
@@ -100,13 +136,13 @@ declare const Command: {
|
|
|
100
136
|
/**
|
|
101
137
|
* The root component for the Command component.
|
|
102
138
|
*
|
|
103
|
-
* @see https://mantle.ngrok.com/components/command#commandroot
|
|
139
|
+
* @see https://mantle.ngrok.com/components/navigation/command#commandroot
|
|
104
140
|
*
|
|
105
141
|
* @example
|
|
106
142
|
* ```tsx
|
|
107
143
|
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
108
144
|
* <Command.DialogTrigger asChild>
|
|
109
|
-
* <Button type="button">Open Command Palette</Button>
|
|
145
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
110
146
|
* </Command.DialogTrigger>
|
|
111
147
|
* <Command.DialogContent>
|
|
112
148
|
* <Command.Input placeholder="Type a command or search..." />
|
|
@@ -135,7 +171,7 @@ declare const Command: {
|
|
|
135
171
|
ref?: React.Ref<HTMLDivElement>;
|
|
136
172
|
} & {
|
|
137
173
|
asChild?: boolean;
|
|
138
|
-
}, "key" | keyof import("react").HTMLAttributes<HTMLDivElement
|
|
174
|
+
}, "asChild" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
139
175
|
label?: string;
|
|
140
176
|
shouldFilter?: boolean;
|
|
141
177
|
filter?: (value: string, search: string, keywords?: string[]) => number;
|
|
@@ -149,13 +185,13 @@ declare const Command: {
|
|
|
149
185
|
/**
|
|
150
186
|
* The root stateful component for the Command dialog. Manages open/closed state.
|
|
151
187
|
*
|
|
152
|
-
* @see https://mantle.ngrok.com/components/command#commanddialogroot
|
|
188
|
+
* @see https://mantle.ngrok.com/components/navigation/command#commanddialogroot
|
|
153
189
|
*
|
|
154
190
|
* @example
|
|
155
191
|
* ```tsx
|
|
156
192
|
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
157
193
|
* <Command.DialogTrigger asChild>
|
|
158
|
-
* <Button type="button">Open Command Palette</Button>
|
|
194
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
159
195
|
* </Command.DialogTrigger>
|
|
160
196
|
* <Command.DialogContent>
|
|
161
197
|
* <Command.Input placeholder="Type a command or search..." />
|
|
@@ -170,12 +206,12 @@ declare const Command: {
|
|
|
170
206
|
/**
|
|
171
207
|
* A button that opens the Command dialog when clicked.
|
|
172
208
|
*
|
|
173
|
-
* @see https://mantle.ngrok.com/components/command#commanddialogtrigger
|
|
209
|
+
* @see https://mantle.ngrok.com/components/navigation/command#commanddialogtrigger
|
|
174
210
|
*
|
|
175
211
|
* @example
|
|
176
212
|
* ```tsx
|
|
177
213
|
* <Command.DialogTrigger asChild>
|
|
178
|
-
* <Button type="button">Open Command Palette</Button>
|
|
214
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
179
215
|
* </Command.DialogTrigger>
|
|
180
216
|
* ```
|
|
181
217
|
*/
|
|
@@ -183,7 +219,7 @@ declare const Command: {
|
|
|
183
219
|
/**
|
|
184
220
|
* The visible content of the Command dialog. Renders inside the dialog portal.
|
|
185
221
|
*
|
|
186
|
-
* @see https://mantle.ngrok.com/components/command#commanddialogcontent
|
|
222
|
+
* @see https://mantle.ngrok.com/components/navigation/command#commanddialogcontent
|
|
187
223
|
*
|
|
188
224
|
* @example
|
|
189
225
|
* ```tsx
|
|
@@ -195,28 +231,17 @@ declare const Command: {
|
|
|
195
231
|
* </Command.DialogContent>
|
|
196
232
|
* ```
|
|
197
233
|
*/
|
|
198
|
-
readonly DialogContent:
|
|
199
|
-
({
|
|
200
|
-
children,
|
|
201
|
-
className,
|
|
202
|
-
description,
|
|
203
|
-
filter,
|
|
204
|
-
shouldFilter,
|
|
205
|
-
showCloseButton,
|
|
206
|
-
title
|
|
207
|
-
}: CommandDialogContentProps): import("react").JSX.Element;
|
|
208
|
-
displayName: string;
|
|
209
|
-
};
|
|
234
|
+
readonly DialogContent: typeof CommandDialogContent;
|
|
210
235
|
/**
|
|
211
236
|
* The input component for the Command component.
|
|
212
237
|
*
|
|
213
|
-
* @see https://mantle.ngrok.com/components/command#commandinput
|
|
238
|
+
* @see https://mantle.ngrok.com/components/navigation/command#commandinput
|
|
214
239
|
*
|
|
215
240
|
* @example
|
|
216
241
|
* ```tsx
|
|
217
242
|
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
218
243
|
* <Command.DialogTrigger asChild>
|
|
219
|
-
* <Button type="button">Open Command Palette</Button>
|
|
244
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
220
245
|
* </Command.DialogTrigger>
|
|
221
246
|
* <Command.DialogContent>
|
|
222
247
|
* <Command.Input placeholder="Type a command or search..." />
|
|
@@ -243,20 +268,20 @@ declare const Command: {
|
|
|
243
268
|
ref?: React.Ref<HTMLInputElement>;
|
|
244
269
|
} & {
|
|
245
270
|
asChild?: boolean;
|
|
246
|
-
}, "
|
|
271
|
+
}, "asChild" | "key" | keyof import("react").InputHTMLAttributes<HTMLInputElement>>, "onChange" | "type" | "value"> & {
|
|
247
272
|
value?: string;
|
|
248
273
|
onValueChange?: (search: string) => void;
|
|
249
274
|
} & import("react").RefAttributes<HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
250
275
|
/**
|
|
251
276
|
* The list component for the Command component.
|
|
252
277
|
*
|
|
253
|
-
* @see https://mantle.ngrok.com/components/command#commandlist
|
|
278
|
+
* @see https://mantle.ngrok.com/components/navigation/command#commandlist
|
|
254
279
|
*
|
|
255
280
|
* @example
|
|
256
281
|
* ```tsx
|
|
257
282
|
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
258
283
|
* <Command.DialogTrigger asChild>
|
|
259
|
-
* <Button type="button">Open Command Palette</Button>
|
|
284
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
260
285
|
* </Command.DialogTrigger>
|
|
261
286
|
* <Command.DialogContent>
|
|
262
287
|
* <Command.Input placeholder="Type a command or search..." />
|
|
@@ -285,19 +310,19 @@ declare const Command: {
|
|
|
285
310
|
ref?: React.Ref<HTMLDivElement>;
|
|
286
311
|
} & {
|
|
287
312
|
asChild?: boolean;
|
|
288
|
-
}, "key" | keyof import("react").HTMLAttributes<HTMLDivElement
|
|
313
|
+
}, "asChild" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
289
314
|
label?: string;
|
|
290
315
|
} & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
291
316
|
/**
|
|
292
317
|
* The empty component for the Command component.
|
|
293
318
|
*
|
|
294
|
-
* @see https://mantle.ngrok.com/components/command#commandempty
|
|
319
|
+
* @see https://mantle.ngrok.com/components/navigation/command#commandempty
|
|
295
320
|
*
|
|
296
321
|
* @example
|
|
297
322
|
* ```tsx
|
|
298
323
|
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
299
324
|
* <Command.DialogTrigger asChild>
|
|
300
|
-
* <Button type="button">Open Command Palette</Button>
|
|
325
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
301
326
|
* </Command.DialogTrigger>
|
|
302
327
|
* <Command.DialogContent>
|
|
303
328
|
* <Command.Input placeholder="Type a command or search..." />
|
|
@@ -326,17 +351,17 @@ declare const Command: {
|
|
|
326
351
|
ref?: React.Ref<HTMLDivElement>;
|
|
327
352
|
} & {
|
|
328
353
|
asChild?: boolean;
|
|
329
|
-
}, "key" | keyof import("react").HTMLAttributes<HTMLDivElement
|
|
354
|
+
}, "asChild" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
330
355
|
/**
|
|
331
356
|
* The group component for the Command component.
|
|
332
357
|
*
|
|
333
|
-
* @see https://mantle.ngrok.com/components/command#commandgroup
|
|
358
|
+
* @see https://mantle.ngrok.com/components/navigation/command#commandgroup
|
|
334
359
|
*
|
|
335
360
|
* @example
|
|
336
361
|
* ```tsx
|
|
337
362
|
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
338
363
|
* <Command.DialogTrigger asChild>
|
|
339
|
-
* <Button type="button">Open Command Palette</Button>
|
|
364
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
340
365
|
* </Command.DialogTrigger>
|
|
341
366
|
* <Command.DialogContent>
|
|
342
367
|
* <Command.Input placeholder="Type a command or search..." />
|
|
@@ -365,7 +390,7 @@ declare const Command: {
|
|
|
365
390
|
ref?: React.Ref<HTMLDivElement>;
|
|
366
391
|
} & {
|
|
367
392
|
asChild?: boolean;
|
|
368
|
-
}, "key" | keyof import("react").HTMLAttributes<HTMLDivElement
|
|
393
|
+
}, "asChild" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "heading" | "value"> & {
|
|
369
394
|
heading?: React.ReactNode;
|
|
370
395
|
value?: string;
|
|
371
396
|
forceMount?: boolean;
|
|
@@ -373,13 +398,13 @@ declare const Command: {
|
|
|
373
398
|
/**
|
|
374
399
|
* The item component for the Command component.
|
|
375
400
|
*
|
|
376
|
-
* @see https://mantle.ngrok.com/components/command#commanditem
|
|
401
|
+
* @see https://mantle.ngrok.com/components/navigation/command#commanditem
|
|
377
402
|
*
|
|
378
403
|
* @example
|
|
379
404
|
* ```tsx
|
|
380
405
|
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
381
406
|
* <Command.DialogTrigger asChild>
|
|
382
|
-
* <Button type="button">Open Command Palette</Button>
|
|
407
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
383
408
|
* </Command.DialogTrigger>
|
|
384
409
|
* <Command.DialogContent>
|
|
385
410
|
* <Command.Input placeholder="Type a command or search..." />
|
|
@@ -408,7 +433,7 @@ declare const Command: {
|
|
|
408
433
|
ref?: React.Ref<HTMLDivElement>;
|
|
409
434
|
} & {
|
|
410
435
|
asChild?: boolean;
|
|
411
|
-
}, "key" | keyof import("react").HTMLAttributes<HTMLDivElement
|
|
436
|
+
}, "asChild" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "disabled" | "onSelect" | "value"> & {
|
|
412
437
|
disabled?: boolean;
|
|
413
438
|
onSelect?: (value: string) => void;
|
|
414
439
|
value?: string;
|
|
@@ -418,13 +443,13 @@ declare const Command: {
|
|
|
418
443
|
/**
|
|
419
444
|
* The shortcut component for the Command component.
|
|
420
445
|
*
|
|
421
|
-
* @see https://mantle.ngrok.com/components/command#commandshortcut
|
|
446
|
+
* @see https://mantle.ngrok.com/components/navigation/command#commandshortcut
|
|
422
447
|
*
|
|
423
448
|
* @example
|
|
424
449
|
* ```tsx
|
|
425
450
|
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
426
451
|
* <Command.DialogTrigger asChild>
|
|
427
|
-
* <Button type="button">Open Command Palette</Button>
|
|
452
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
428
453
|
* </Command.DialogTrigger>
|
|
429
454
|
* <Command.DialogContent>
|
|
430
455
|
* <Command.Input placeholder="Type a command or search..." />
|
|
@@ -451,13 +476,13 @@ declare const Command: {
|
|
|
451
476
|
/**
|
|
452
477
|
* The separator component for the Command component.
|
|
453
478
|
*
|
|
454
|
-
* @see https://mantle.ngrok.com/components/command#commandseparator
|
|
479
|
+
* @see https://mantle.ngrok.com/components/navigation/command#commandseparator
|
|
455
480
|
*
|
|
456
481
|
* @example
|
|
457
482
|
* ```tsx
|
|
458
483
|
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
459
484
|
* <Command.DialogTrigger asChild>
|
|
460
|
-
* <Button type="button">Open Command Palette</Button>
|
|
485
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
461
486
|
* </Command.DialogTrigger>
|
|
462
487
|
* <Command.DialogContent>
|
|
463
488
|
* <Command.Input placeholder="Type a command or search..." />
|
|
@@ -484,7 +509,7 @@ declare const Command: {
|
|
|
484
509
|
ref?: React.Ref<HTMLDivElement>;
|
|
485
510
|
} & {
|
|
486
511
|
asChild?: boolean;
|
|
487
|
-
}, "key" | keyof import("react").HTMLAttributes<HTMLDivElement
|
|
512
|
+
}, "asChild" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
488
513
|
alwaysRender?: boolean;
|
|
489
514
|
} & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
490
515
|
};
|
|
@@ -497,9 +522,6 @@ type Props = Omit<ComponentProps<"kbd">, "children">;
|
|
|
497
522
|
* - Initializes to `"⌃"` to avoid SSR mismatch.
|
|
498
523
|
* - Updates on mount using `detectMetaKey()`.
|
|
499
524
|
*/
|
|
500
|
-
declare function MetaKey({
|
|
501
|
-
className,
|
|
502
|
-
...props
|
|
503
|
-
}: Props): import("react").JSX.Element;
|
|
525
|
+
declare function MetaKey({ className, ...props }: Props): import("react").JSX.Element;
|
|
504
526
|
//#endregion
|
|
505
527
|
export { Command, MetaKey, useCommandState };
|
package/dist/command.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
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};
|