@ngrok/mantle 0.79.0 → 0.79.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent.json +1 -1
- package/dist/centered-layout.d.ts +16 -4
- package/dist/code-block.js +1 -1
- package/dist/dropdown-menu-Bt1aKF1g.js +1 -0
- package/dist/{dropdown-menu-DMNw8ItM.d.ts → dropdown-menu-DP_Ne9Mr.d.ts} +2 -1
- package/dist/dropdown-menu.d.ts +2 -2
- package/dist/dropdown-menu.js +1 -1
- package/dist/index-g2rfwNCH.d.ts +1 -0
- package/dist/llms.txt +1 -1
- package/dist/split-button.d.ts +3 -2
- package/dist/split-button.js +1 -1
- package/dist/theme-switcher.d.ts +145 -24
- package/dist/theme-switcher.js +1 -1
- package/package.json +1 -1
- package/dist/dropdown-menu-ByUQkAvJ.js +0 -1
- package/dist/index-DZRbVkZa.d.ts +0 -1
package/dist/agent.json
CHANGED
|
@@ -32,7 +32,10 @@ import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
|
|
|
32
32
|
* </Main>
|
|
33
33
|
* </CenteredLayout.Body>
|
|
34
34
|
* <CenteredLayout.Footer>
|
|
35
|
-
* <ThemeSwitcher
|
|
35
|
+
* <ThemeSwitcher.Root>
|
|
36
|
+
* <ThemeSwitcher.Trigger />
|
|
37
|
+
* <ThemeSwitcher.Content />
|
|
38
|
+
* </ThemeSwitcher.Root>
|
|
36
39
|
* </CenteredLayout.Footer>
|
|
37
40
|
* </CenteredLayout.Root>
|
|
38
41
|
* ```
|
|
@@ -59,7 +62,10 @@ declare const CenteredLayout: {
|
|
|
59
62
|
* </Main>
|
|
60
63
|
* </CenteredLayout.Body>
|
|
61
64
|
* <CenteredLayout.Footer>
|
|
62
|
-
* <ThemeSwitcher
|
|
65
|
+
* <ThemeSwitcher.Root>
|
|
66
|
+
* <ThemeSwitcher.Trigger />
|
|
67
|
+
* <ThemeSwitcher.Content />
|
|
68
|
+
* </ThemeSwitcher.Root>
|
|
63
69
|
* </CenteredLayout.Footer>
|
|
64
70
|
* </CenteredLayout.Root>
|
|
65
71
|
* ```
|
|
@@ -110,7 +116,10 @@ declare const CenteredLayout: {
|
|
|
110
116
|
* </Main>
|
|
111
117
|
* </CenteredLayout.Body>
|
|
112
118
|
* <CenteredLayout.Footer>
|
|
113
|
-
* <ThemeSwitcher
|
|
119
|
+
* <ThemeSwitcher.Root>
|
|
120
|
+
* <ThemeSwitcher.Trigger />
|
|
121
|
+
* <ThemeSwitcher.Content />
|
|
122
|
+
* </ThemeSwitcher.Root>
|
|
114
123
|
* </CenteredLayout.Footer>
|
|
115
124
|
* </CenteredLayout.Root>
|
|
116
125
|
* ```
|
|
@@ -136,7 +145,10 @@ declare const CenteredLayout: {
|
|
|
136
145
|
* </Main>
|
|
137
146
|
* </CenteredLayout.Body>
|
|
138
147
|
* <CenteredLayout.Footer>
|
|
139
|
-
* <ThemeSwitcher
|
|
148
|
+
* <ThemeSwitcher.Root>
|
|
149
|
+
* <ThemeSwitcher.Trigger />
|
|
150
|
+
* <ThemeSwitcher.Content />
|
|
151
|
+
* </ThemeSwitcher.Root>
|
|
140
152
|
* </CenteredLayout.Footer>
|
|
141
153
|
* </CenteredLayout.Root>
|
|
142
154
|
* ```
|
package/dist/code-block.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./compose-refs-Cjf2gfB8.js";import{t}from"./cx-IiQEAKf5.js";import{t as n}from"./icon-CDtYjF_H.js";import{t as r}from"./slot-DmPrjM7N.js";import{t as i}from"./icon-button-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-
|
|
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-base 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(`m-0 font-sans text-xs font-medium`,n),...i}));J.displayName=`CodeBlockTitle`;const Y=k(({className:e,label:n=`Copy code`,onCopy:r,onCopyError:o,onClick:s,...c},l)=>{let{copyTextRef:u}=V(),d=a(),[f,p]=P(!1),m=N(void 0);return j(()=>()=>{m.current!=null&&clearTimeout(m.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-base`,children:I(i,{type:`button`,appearance:`ghost`,intent:`neutral`,size:`sm`,label:n,icon:I(f?ae:oe,{}),className:t(`bg-base not-disabled:hover:bg-neutral-500/15`,e),ref:l,onClick:async e=>{try{if(s?.(e),e.defaultPrevented){m.current!=null&&clearTimeout(m.current);return}let t=u.current;await d(t),r?.(t),p(!0),m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{p(!1)},2e3)}catch(e){o?.(e)}},...c})})});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-base px-4 py-2 font-sans text-gray-700 hover:bg-base-hover`,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:r,svg:i,...a}){let s=i;if(r!=null)switch(r){case`file`:s=I(se,{weight:`fill`});break;case`cli`:s=I(ce,{weight:`fill`});break;case`traffic-policy`:s=I(o,{});break}return I(n,{"data-slot":`code-block-icon`,className:t(`size-5`,e),svg:s,...a})}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 font-sans 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]===`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-CDtYjF_H.js";import{n}from"./slot-DmPrjM7N.js";import{n as r}from"./separator-kBnnv3Cw.js";import{forwardRef as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{CaretRightIcon as s}from"@phosphor-icons/react/CaretRight";import{CheckIcon as c}from"@phosphor-icons/react/Check";import*as l from"@radix-ui/react-dropdown-menu";const u=l.Root;u.displayName=`DropdownMenu`;const d=i((e,t)=>a(l.Trigger,{ref:t,"data-slot":`dropdown-menu-trigger`,...e}));d.displayName=`DropdownMenuTrigger`;const f=i(({className:t,...n},r)=>a(l.Group,{ref:r,"data-slot":`dropdown-menu-group`,className:e(`space-y-px`,t),...n}));f.displayName=`DropdownMenuGroup`;const p=l.Portal;p.displayName=`DropdownMenuPortal`;const m=l.Sub;m.displayName=`DropdownMenuSub`;const h=i(({className:t,...n},r)=>a(l.RadioGroup,{ref:r,"data-slot":`dropdown-menu-radio-group`,className:e(`space-y-px`,t),...n}));h.displayName=`DropdownMenuRadioGroup`;const g=i(({className:n,inset:r,children:i,...c},u)=>o(l.SubTrigger,{"data-slot":`dropdown-menu-sub-trigger`,className:e(`focus:bg-accent data-state-open:bg-accent relative flex select-none items-center rounded-md py-1.5 pl-2 pr-9 text-sm outline-hidden`,`data-highlighted:bg-active-menu-item data-state-open:bg-active-menu-item`,`[&>svg]:size-5 [&_svg]:shrink-0`,r&&`pl-8`,n),ref:u,...c,children:[i,a(`span`,{className:`absolute right-2 flex items-center`,children:a(t,{svg:a(s,{weight:`bold`}),className:`size-4`})})]}));g.displayName=`DropdownMenuSubTrigger`;const _=i(({className:t,loop:n=!0,...r},i)=>a(p,{children:a(l.SubContent,{"data-slot":`dropdown-menu-sub-content`,className:e(`scrollbar`,`text-popover-foreground border-popover bg-popover p-1.25 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95 data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2 z-50 min-w-32 overflow-hidden rounded-md border shadow-xl space-y-px font-sans`,`my-2 max-h-[calc(var(--radix-dropdown-menu-content-available-height)-16px)] overflow-auto`,t),loop:n,ref:i,...r})}));_.displayName=`DropdownMenuSubContent`;const v=i(({className:t,"data-slot":r,onClick:i,loop:o=!0,width:s,...c},u)=>a(p,{children:a(l.Content,{ref:u,"data-slot":n(r,`dropdown-menu-content`),className:e(`scrollbar`,`text-popover-foreground border-popover bg-popover p-1.25 z-50 min-w-32 overflow-hidden rounded-md border shadow-xl outline-hidden space-y-px font-sans`,`data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95`,`my-2 max-h-[calc(var(--radix-dropdown-menu-content-available-height)-16px)] overflow-auto`,s===`trigger`&&`w-(--radix-dropdown-menu-trigger-width)`,t),loop:o,onClick:e=>{e.stopPropagation(),i?.(e)},...c})}));v.displayName=`DropdownMenuContent`;const y=i(({className:t,inset:n,...r},i)=>a(l.Item,{ref:i,"data-slot":`dropdown-menu-item`,className:e(`relative flex cursor-pointer select-none items-center rounded-md px-2 py-1.5 text-strong text-sm font-normal outline-hidden transition-colors`,`data-highlighted:bg-active-menu-item`,`focus:bg-accent focus:text-accent-foreground`,`data-disabled:cursor-default data-disabled:opacity-50`,`[&>svg]:size-5 [&_svg]:shrink-0`,n&&`pl-8`,t),...r}));y.displayName=`DropdownMenuItem`;const b=i(({className:n,children:r,checked:i,...s},u)=>o(l.CheckboxItem,{ref:u,"data-slot":`dropdown-menu-checkbox-item`,className:e(`text-strong data-disabled:pointer-events-none data-disabled:opacity-50 relative flex cursor-pointer select-none items-center gap-2 rounded-md py-1.5 pl-2 pr-9 text-sm font-normal outline-hidden`,`data-highlighted:bg-active-menu-item`,`aria-checked:bg-selected-menu-item`,`data-highlighted:aria-checked:bg-active-selected-menu-item!`,`[&>svg]:size-5 [&_svg]:shrink-0`,n),checked:i,...s,children:[a(`span`,{className:`absolute right-2 flex items-center`,children:a(l.ItemIndicator,{children:a(t,{svg:a(c,{weight:`bold`}),className:`size-4 text-accent-600`})})}),r]}));b.displayName=`DropdownMenuCheckboxItem`;const x=i(({className:n,children:r,...i},s)=>o(l.RadioItem,{"data-slot":`dropdown-menu-radio-item`,className:e(`group/dropdown-menu-radio-item`,`text-strong data-disabled:pointer-events-none data-disabled:opacity-50 relative flex cursor-pointer select-none items-center gap-2 rounded-md py-1.5 px-2 text-sm font-normal outline-none`,`data-highlighted:bg-active-menu-item`,`aria-checked:bg-selected-menu-item aria-checked:pr-9`,`data-highlighted:aria-checked:bg-active-selected-menu-item!`,`[&>svg]:size-5 [&_svg]:shrink-0`,n),ref:s,...i,children:[a(`span`,{className:`absolute right-2 items-center hidden group-aria-checked/dropdown-menu-radio-item:flex`,children:a(l.ItemIndicator,{children:a(t,{svg:a(c,{weight:`bold`}),className:`size-4 text-accent-600`})})}),r]}));x.displayName=`DropdownMenuRadioItem`;const S=i(({className:t,inset:n,...r},i)=>a(l.Label,{ref:i,"data-slot":`dropdown-menu-label`,className:e(`px-2 py-1.5 text-sm font-medium`,n&&`pl-8`,t),...r}));S.displayName=`DropdownMenuLabel`;const C=i(({className:t,...n},i)=>a(r,{ref:i,"data-slot":`dropdown-menu-separator`,className:e(`-mx-1.25 my-1 w-auto`,t),...n}));C.displayName=`DropdownMenuSeparator`;const w=({className:t,...n})=>a(`span`,{"data-slot":`dropdown-menu-shortcut`,className:e(`ml-auto text-xs tracking-widest opacity-60`,t),...n});w.displayName=`DropdownMenuShortcut`;const T={Root:u,CheckboxItem:b,Content:v,Group:f,Item:y,Label:S,RadioGroup:h,RadioItem:x,Separator:C,Shortcut:w,Sub:m,SubContent:_,SubTrigger:g,Trigger:d};export{T as t};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { t as WithAsChild } from "./as-child-CYEVu1WY.js";
|
|
2
|
+
import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
|
|
2
3
|
import { ComponentProps } from "react";
|
|
3
4
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
4
5
|
//#region src/components/dropdown-menu/dropdown-menu.d.ts
|
|
@@ -112,7 +113,7 @@ declare const DropdownMenu: {
|
|
|
112
113
|
* </DropdownMenu.Root>
|
|
113
114
|
* ```
|
|
114
115
|
*/
|
|
115
|
-
readonly Content: import("react").ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
116
|
+
readonly Content: import("react").ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & WithDataSlot & {
|
|
116
117
|
/**
|
|
117
118
|
* Whether the DropdownMenuContent should match the width of the trigger or use the intrinsic content width.
|
|
118
119
|
*/
|
package/dist/dropdown-menu.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as DropdownMenu } from "./dropdown-menu-
|
|
2
|
-
import "./index-
|
|
1
|
+
import { t as DropdownMenu } from "./dropdown-menu-DP_Ne9Mr.js";
|
|
2
|
+
import "./index-g2rfwNCH.js";
|
|
3
3
|
export { DropdownMenu };
|
package/dist/dropdown-menu.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./dropdown-menu-
|
|
1
|
+
import{t as e}from"./dropdown-menu-Bt1aKF1g.js";export{e as DropdownMenu};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./dropdown-menu-DP_Ne9Mr.js";
|
package/dist/llms.txt
CHANGED
package/dist/split-button.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { t as Button } from "./button-DcXOWUYo.js";
|
|
2
2
|
import { t as IconButton } from "./icon-button-B7uEj1qq.js";
|
|
3
|
+
import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
|
|
3
4
|
import { t as ButtonSize } from "./sizes-BCoI4bhP.js";
|
|
4
|
-
import { t as DropdownMenu } from "./dropdown-menu-
|
|
5
|
+
import { t as DropdownMenu } from "./dropdown-menu-DP_Ne9Mr.js";
|
|
5
6
|
import { ComponentProps, ReactNode } from "react";
|
|
6
7
|
//#region src/components/split-button/split-button.d.ts
|
|
7
8
|
type RootProps = ComponentProps<typeof DropdownMenu.Root> & ComponentProps<"div"> & {
|
|
@@ -171,7 +172,7 @@ declare const SplitButton: {
|
|
|
171
172
|
* </SplitButton.Root>
|
|
172
173
|
* ```
|
|
173
174
|
*/
|
|
174
|
-
readonly MenuContent: import("react").ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
175
|
+
readonly MenuContent: import("react").ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & WithDataSlot & {
|
|
175
176
|
width?: "trigger" | "content";
|
|
176
177
|
} & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
177
178
|
/**
|
package/dist/split-button.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-CDtYjF_H.js";import{t as n}from"./icon-button-DV2-GZHf.js";import{t as r}from"./button-ClC60Nzg.js";import{t as i}from"./dropdown-menu-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-CDtYjF_H.js";import{t as n}from"./icon-button-DV2-GZHf.js";import{t as r}from"./button-ClC60Nzg.js";import{t as i}from"./dropdown-menu-Bt1aKF1g.js";import{CaretDownIcon as a}from"@phosphor-icons/react/CaretDown";import{createContext as o,forwardRef as s,useContext as c,useMemo as l}from"react";import{jsx as u}from"react/jsx-runtime";const d=o({size:`md`}),f=s(({className:t,children:n,dir:r,open:a,defaultOpen:o,onOpenChange:s,modal:c,size:f=`md`,...p},m)=>{let h=l(()=>({size:f}),[f]);return u(i.Root,{dir:r,open:a,defaultOpen:o,onOpenChange:s,modal:c,children:u(d.Provider,{value:h,children:u(`div`,{"data-slot":`split-button`,"data-size":f,className:e(`flex flex-row [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none [&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:not(:first-child)]:-ml-px [&>*:focus]:relative [&>*:focus]:z-10 [&>*:hover]:relative [&>*:hover]:z-10 *:active:scale-100!`,t),ref:m,...p,children:n})})})});f.displayName=`SplitButton`;const p=s((e,t)=>{let{size:n}=c(d);return u(r,{appearance:`outlined`,intent:`neutral`,ref:t,size:n,...e})});p.displayName=`SplitButtonPrimaryAction`;const m=s(({icon:e,...r},o)=>{let{size:s}=c(d);return u(i.Trigger,{asChild:!0,className:`group`,children:u(n,{icon:e??u(t,{svg:u(a,{weight:`bold`,className:`size-4 group-data-[state=open]:-rotate-180 transition-transform ease-out duration-150`})}),appearance:`outlined`,intent:`neutral`,ref:o,size:s,...r})})});m.displayName=`SplitButtonMenuTrigger`;const h=s(({align:e=`end`,...t},n)=>u(i.Content,{align:e,ref:n,...t}));h.displayName=`SplitButtonMenuContent`;const g=s(({className:t,...n},r)=>u(i.Item,{className:e(`gap-2`,t),ref:r,...n}));g.displayName=`SplitButtonMenuItem`;const _={Root:f,PrimaryAction:p,MenuTrigger:m,MenuContent:h,MenuItem:g};export{_ as SplitButton};
|
package/dist/theme-switcher.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { t as WithStyleProps } from "./with-style-props-Dq5Vntqy.js";
|
|
2
|
-
import { n as IconButtonAppearance } from "./icon-button-B7uEj1qq.js";
|
|
3
|
-
import { t as
|
|
4
|
-
import "./
|
|
5
|
-
import
|
|
2
|
+
import { n as IconButtonAppearance, r as IconButtonProps } from "./icon-button-B7uEj1qq.js";
|
|
3
|
+
import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
|
|
4
|
+
import { t as DropdownMenu } from "./dropdown-menu-DP_Ne9Mr.js";
|
|
5
|
+
import "./index-g2rfwNCH.js";
|
|
6
|
+
import { ComponentProps, ComponentPropsWithoutRef } from "react";
|
|
6
7
|
//#region src/components/theme-switcher/theme-switcher.d.ts
|
|
7
8
|
/**
|
|
8
9
|
* The props for the `ThemeDropdownMenuRadioGroup` component.
|
|
@@ -13,41 +14,161 @@ declare namespace ThemeDropdownMenuRadioGroup {
|
|
|
13
14
|
var displayName: string;
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
16
|
-
* The props for the `ThemeSwitcher` component.
|
|
17
|
+
* The props for the `ThemeSwitcher.Root` component. Identical to
|
|
18
|
+
* `DropdownMenu.Root`'s props — `Root` forwards everything through.
|
|
17
19
|
*/
|
|
18
|
-
type
|
|
20
|
+
type ThemeSwitcherRootProps = ComponentProps<typeof DropdownMenu.Root>;
|
|
21
|
+
/**
|
|
22
|
+
* The stateful root of the theme switcher: a thin forwarding wrapper over
|
|
23
|
+
* `DropdownMenu.Root` that owns the menu's open/closed state. Renders no DOM
|
|
24
|
+
* of its own. Compose `ThemeSwitcher.Trigger` and `ThemeSwitcher.Content`
|
|
25
|
+
* inside it.
|
|
26
|
+
*
|
|
27
|
+
* @see https://mantle.ngrok.com/components/forms/theme-switcher
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <ThemeSwitcher.Root>
|
|
32
|
+
* <ThemeSwitcher.Trigger />
|
|
33
|
+
* <ThemeSwitcher.Content />
|
|
34
|
+
* </ThemeSwitcher.Root>
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
declare const Root: {
|
|
38
|
+
(props: ThemeSwitcherRootProps): import("react").JSX.Element;
|
|
39
|
+
displayName: string;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* The props for the `ThemeSwitcher.Trigger` component. Forwards
|
|
43
|
+
* `IconButton`'s props, except the parts the trigger owns: `icon` (the
|
|
44
|
+
* SSR-safe themed icon) and `intent` (always `"neutral"`). `asChild` and
|
|
45
|
+
* `children` are removed — the trigger renders only its icon and sr-only
|
|
46
|
+
* label, so both would be silently meaningless. `appearance` and `label`
|
|
47
|
+
* become optional with theme-switcher defaults.
|
|
48
|
+
*/
|
|
49
|
+
type ThemeSwitcherTriggerProps = Omit<IconButtonProps, "appearance" | "asChild" | "children" | "icon" | "intent" | "label"> & WithDataSlot & {
|
|
19
50
|
/**
|
|
20
51
|
* The visual style of the trigger `IconButton`. Optional here —
|
|
21
|
-
* `ThemeSwitcher` defaults to `"ghost"` so the trigger sits
|
|
22
|
-
* headers and toolbars.
|
|
52
|
+
* `ThemeSwitcher.Trigger` defaults to `"ghost"` so the trigger sits
|
|
53
|
+
* quietly in headers and toolbars.
|
|
23
54
|
*
|
|
24
55
|
* @default "ghost"
|
|
25
56
|
*/
|
|
26
57
|
appearance?: IconButtonAppearance;
|
|
27
58
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
|
|
59
|
+
* The accessible name for the trigger `IconButton`. Visually hidden but
|
|
60
|
+
* announced to screen readers. Override it for localization.
|
|
61
|
+
*
|
|
62
|
+
* @default "Change Theme"
|
|
63
|
+
*/
|
|
64
|
+
label?: string;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* The props for the `ThemeSwitcher.Content` component. Identical to
|
|
68
|
+
* `DropdownMenu.Content`'s props — positioning and collision behavior
|
|
69
|
+
* (`align`, `side`, `collisionPadding`, …) plus `className`/`style` all
|
|
70
|
+
* forward through.
|
|
71
|
+
*/
|
|
72
|
+
type ThemeSwitcherContentProps = ComponentPropsWithoutRef<typeof DropdownMenu.Content> & WithDataSlot;
|
|
73
|
+
/**
|
|
74
|
+
* The canonical picker for mantle's theme system: a compact `IconButton`
|
|
75
|
+
* trigger (ghost by default) that opens a `DropdownMenu` hosting
|
|
76
|
+
* `ThemeDropdownMenuRadioGroup`, the theme-selection radio group.
|
|
77
|
+
*
|
|
78
|
+
* Reads and writes the active theme via `useTheme`, so it must render inside
|
|
79
|
+
* a `ThemeProvider` — `useTheme` throws outside of one.
|
|
80
|
+
*
|
|
81
|
+
* To embed theme selection in an existing menu instead (e.g. an account menu
|
|
82
|
+
* submenu), use `ThemeDropdownMenuRadioGroup` directly.
|
|
83
|
+
*
|
|
84
|
+
* @see https://mantle.ngrok.com/components/forms/theme-switcher
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* Composition:
|
|
88
|
+
* ```
|
|
89
|
+
* ThemeSwitcher.Root
|
|
90
|
+
* ├── ThemeSwitcher.Trigger
|
|
91
|
+
* └── ThemeSwitcher.Content
|
|
92
|
+
* ```
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```tsx
|
|
96
|
+
* <ThemeProvider>
|
|
97
|
+
* <header>
|
|
98
|
+
* <ThemeSwitcher.Root>
|
|
99
|
+
* <ThemeSwitcher.Trigger />
|
|
100
|
+
* <ThemeSwitcher.Content />
|
|
101
|
+
* </ThemeSwitcher.Root>
|
|
102
|
+
* </header>
|
|
103
|
+
* </ThemeProvider>
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
declare const ThemeSwitcher: {
|
|
107
|
+
/**
|
|
108
|
+
* The stateful root: a thin forwarding wrapper over `DropdownMenu.Root`
|
|
109
|
+
* that owns the menu's open/closed state. Renders no DOM of its own.
|
|
110
|
+
*
|
|
111
|
+
* @see https://mantle.ngrok.com/components/forms/theme-switcher
|
|
33
112
|
*
|
|
34
113
|
* @example
|
|
35
114
|
* ```tsx
|
|
36
|
-
* <ThemeSwitcher
|
|
115
|
+
* <ThemeSwitcher.Root>
|
|
116
|
+
* <ThemeSwitcher.Trigger />
|
|
117
|
+
* <ThemeSwitcher.Content />
|
|
118
|
+
* </ThemeSwitcher.Root>
|
|
37
119
|
* ```
|
|
38
120
|
*/
|
|
39
|
-
|
|
121
|
+
readonly Root: typeof Root;
|
|
40
122
|
/**
|
|
41
|
-
* The
|
|
42
|
-
*
|
|
123
|
+
* The button that opens the theme menu: an `IconButton` (ghost by default)
|
|
124
|
+
* with an SSR-safe themed icon. Forwards `IconButton` props; `label`
|
|
125
|
+
* defaults to `"Change Theme"`.
|
|
43
126
|
*
|
|
44
|
-
* @
|
|
127
|
+
* @see https://mantle.ngrok.com/components/forms/theme-switcher
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```tsx
|
|
131
|
+
* <ThemeSwitcher.Root>
|
|
132
|
+
* <ThemeSwitcher.Trigger appearance="outlined" label="Choose a theme" />
|
|
133
|
+
* <ThemeSwitcher.Content />
|
|
134
|
+
* </ThemeSwitcher.Root>
|
|
135
|
+
* ```
|
|
45
136
|
*/
|
|
46
|
-
label
|
|
137
|
+
readonly Trigger: import("react").ForwardRefExoticComponent<Omit<IconButtonProps, "appearance" | "asChild" | "children" | "icon" | "intent" | "label"> & WithDataSlot & {
|
|
138
|
+
/**
|
|
139
|
+
* The visual style of the trigger `IconButton`. Optional here —
|
|
140
|
+
* `ThemeSwitcher.Trigger` defaults to `"ghost"` so the trigger sits
|
|
141
|
+
* quietly in headers and toolbars.
|
|
142
|
+
*
|
|
143
|
+
* @default "ghost"
|
|
144
|
+
*/
|
|
145
|
+
appearance?: IconButtonAppearance;
|
|
146
|
+
/**
|
|
147
|
+
* The accessible name for the trigger `IconButton`. Visually hidden but
|
|
148
|
+
* announced to screen readers. Override it for localization.
|
|
149
|
+
*
|
|
150
|
+
* @default "Change Theme"
|
|
151
|
+
*/
|
|
152
|
+
label?: string;
|
|
153
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
154
|
+
/**
|
|
155
|
+
* The popover the trigger opens: forwards `DropdownMenu.Content` props
|
|
156
|
+
* (`align`, `side`, `collisionPadding`, `className`, …) and renders the
|
|
157
|
+
* five-theme radio group when no `children` are given.
|
|
158
|
+
*
|
|
159
|
+
* @see https://mantle.ngrok.com/components/forms/theme-switcher
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* ```tsx
|
|
163
|
+
* <ThemeSwitcher.Root>
|
|
164
|
+
* <ThemeSwitcher.Trigger />
|
|
165
|
+
* <ThemeSwitcher.Content align="end" collisionPadding={{ right: 16 }} />
|
|
166
|
+
* </ThemeSwitcher.Root>
|
|
167
|
+
* ```
|
|
168
|
+
*/
|
|
169
|
+
readonly Content: import("react").ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & WithDataSlot & {
|
|
170
|
+
width?: "trigger" | "content";
|
|
171
|
+
} & import("react").RefAttributes<HTMLDivElement>, "ref"> & WithDataSlot & import("react").RefAttributes<HTMLDivElement>>;
|
|
47
172
|
};
|
|
48
|
-
declare function ThemeSwitcher({ appearance, className, contentProps, label, style }: ThemeSwitcherProps): import("react").JSX.Element;
|
|
49
|
-
declare namespace ThemeSwitcher {
|
|
50
|
-
var displayName: string;
|
|
51
|
-
}
|
|
52
173
|
//#endregion
|
|
53
|
-
export { ThemeDropdownMenuRadioGroup, type ThemeDropdownMenuRadioGroupProps, ThemeSwitcher, type
|
|
174
|
+
export { ThemeDropdownMenuRadioGroup, type ThemeDropdownMenuRadioGroupProps, ThemeSwitcher, type ThemeSwitcherContentProps, type ThemeSwitcherRootProps, type ThemeSwitcherTriggerProps };
|
package/dist/theme-switcher.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./icon-CDtYjF_H.js";import{t}from"./icon-button-DV2-GZHf.js";import{t as
|
|
1
|
+
import{t as e}from"./icon-CDtYjF_H.js";import{n as t}from"./slot-DmPrjM7N.js";import{t as n}from"./icon-button-DV2-GZHf.js";import{t as r}from"./browser-only-CPH56Xw_.js";import{d as i,h as a,l as o,p as s}from"./theme-provider-Djj_jBo6.js";import{t as c}from"./dropdown-menu-Bt1aKF1g.js";import{n as l,t as u}from"./theme-D8kZCOzM.js";import{t as d}from"./skeleton-Bu3tgNcW.js";import{forwardRef as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";const h={system:`System Preference`,light:`Light Mode`,dark:`Dark Mode`,"light-high-contrast":`Light High Contrast`,"dark-high-contrast":`Dark High Contrast`},g=({className:t,style:n})=>{let[r,u]=o();return p(c.RadioGroup,{"data-slot":`theme-dropdown-menu-radio-group`,className:t,style:n,value:r,onValueChange:e=>{s(e)&&u(e)},children:a.map(t=>m(c.RadioItem,{value:i(t),children:[p(e,{svg:p(l,{theme:t})}),h[t]]},t))})};g.displayName=`ThemeDropdownMenuRadioGroup`;const _=e=>p(c.Root,{...e});_.displayName=`ThemeSwitcher`;const v=f(({appearance:e=`ghost`,"data-slot":i,disabled:a,label:o=`Change Theme`,...s},l)=>p(c.Trigger,{asChild:!0,disabled:a,children:p(n,{ref:l,appearance:e,disabled:a,"data-slot":t(i,`theme-switcher-trigger`),intent:`neutral`,icon:p(r,{fallback:p(d,{className:`rounded-full size-5`}),children:()=>p(u,{className:`size-5`})}),label:o,...s})}));v.displayName=`ThemeSwitcherTrigger`;const y=f(({children:e,"data-slot":n,...r},i)=>p(c.Content,{ref:i,"data-slot":t(n,`theme-switcher-content`),...r,children:e??p(g,{})}));y.displayName=`ThemeSwitcherContent`;const b={Root:_,Trigger:v,Content:y};export{g as ThemeDropdownMenuRadioGroup,b as ThemeSwitcher};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-CDtYjF_H.js";import{n}from"./separator-kBnnv3Cw.js";import{forwardRef as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{CaretRightIcon as o}from"@phosphor-icons/react/CaretRight";import{CheckIcon as s}from"@phosphor-icons/react/Check";import*as c from"@radix-ui/react-dropdown-menu";const l=c.Root;l.displayName=`DropdownMenu`;const u=r((e,t)=>i(c.Trigger,{ref:t,"data-slot":`dropdown-menu-trigger`,...e}));u.displayName=`DropdownMenuTrigger`;const d=r(({className:t,...n},r)=>i(c.Group,{ref:r,"data-slot":`dropdown-menu-group`,className:e(`space-y-px`,t),...n}));d.displayName=`DropdownMenuGroup`;const f=c.Portal;f.displayName=`DropdownMenuPortal`;const p=c.Sub;p.displayName=`DropdownMenuSub`;const m=r(({className:t,...n},r)=>i(c.RadioGroup,{ref:r,"data-slot":`dropdown-menu-radio-group`,className:e(`space-y-px`,t),...n}));m.displayName=`DropdownMenuRadioGroup`;const h=r(({className:n,inset:r,children:s,...l},u)=>a(c.SubTrigger,{"data-slot":`dropdown-menu-sub-trigger`,className:e(`focus:bg-accent data-state-open:bg-accent relative flex select-none items-center rounded-md py-1.5 pl-2 pr-9 text-sm outline-hidden`,`data-highlighted:bg-active-menu-item data-state-open:bg-active-menu-item`,`[&>svg]:size-5 [&_svg]:shrink-0`,r&&`pl-8`,n),ref:u,...l,children:[s,i(`span`,{className:`absolute right-2 flex items-center`,children:i(t,{svg:i(o,{weight:`bold`}),className:`size-4`})})]}));h.displayName=`DropdownMenuSubTrigger`;const g=r(({className:t,loop:n=!0,...r},a)=>i(f,{children:i(c.SubContent,{"data-slot":`dropdown-menu-sub-content`,className:e(`scrollbar`,`text-popover-foreground border-popover bg-popover p-1.25 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95 data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2 z-50 min-w-32 overflow-hidden rounded-md border shadow-xl space-y-px font-sans`,`my-2 max-h-[calc(var(--radix-dropdown-menu-content-available-height)-16px)] overflow-auto`,t),loop:n,ref:a,...r})}));g.displayName=`DropdownMenuSubContent`;const _=r(({className:t,onClick:n,loop:r=!0,width:a,...o},s)=>i(f,{children:i(c.Content,{ref:s,"data-slot":`dropdown-menu-content`,className:e(`scrollbar`,`text-popover-foreground border-popover bg-popover p-1.25 z-50 min-w-32 overflow-hidden rounded-md border shadow-xl outline-hidden space-y-px font-sans`,`data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95`,`my-2 max-h-[calc(var(--radix-dropdown-menu-content-available-height)-16px)] overflow-auto`,a===`trigger`&&`w-(--radix-dropdown-menu-trigger-width)`,t),loop:r,onClick:e=>{e.stopPropagation(),n?.(e)},...o})}));_.displayName=`DropdownMenuContent`;const v=r(({className:t,inset:n,...r},a)=>i(c.Item,{ref:a,"data-slot":`dropdown-menu-item`,className:e(`relative flex cursor-pointer select-none items-center rounded-md px-2 py-1.5 text-strong text-sm font-normal outline-hidden transition-colors`,`data-highlighted:bg-active-menu-item`,`focus:bg-accent focus:text-accent-foreground`,`data-disabled:cursor-default data-disabled:opacity-50`,`[&>svg]:size-5 [&_svg]:shrink-0`,n&&`pl-8`,t),...r}));v.displayName=`DropdownMenuItem`;const y=r(({className:n,children:r,checked:o,...l},u)=>a(c.CheckboxItem,{ref:u,"data-slot":`dropdown-menu-checkbox-item`,className:e(`text-strong data-disabled:pointer-events-none data-disabled:opacity-50 relative flex cursor-pointer select-none items-center gap-2 rounded-md py-1.5 pl-2 pr-9 text-sm font-normal outline-hidden`,`data-highlighted:bg-active-menu-item`,`aria-checked:bg-selected-menu-item`,`data-highlighted:aria-checked:bg-active-selected-menu-item!`,`[&>svg]:size-5 [&_svg]:shrink-0`,n),checked:o,...l,children:[i(`span`,{className:`absolute right-2 flex items-center`,children:i(c.ItemIndicator,{children:i(t,{svg:i(s,{weight:`bold`}),className:`size-4 text-accent-600`})})}),r]}));y.displayName=`DropdownMenuCheckboxItem`;const b=r(({className:n,children:r,...o},l)=>a(c.RadioItem,{"data-slot":`dropdown-menu-radio-item`,className:e(`group/dropdown-menu-radio-item`,`text-strong data-disabled:pointer-events-none data-disabled:opacity-50 relative flex cursor-pointer select-none items-center gap-2 rounded-md py-1.5 px-2 text-sm font-normal outline-none`,`data-highlighted:bg-active-menu-item`,`aria-checked:bg-selected-menu-item aria-checked:pr-9`,`data-highlighted:aria-checked:bg-active-selected-menu-item!`,`[&>svg]:size-5 [&_svg]:shrink-0`,n),ref:l,...o,children:[i(`span`,{className:`absolute right-2 items-center hidden group-aria-checked/dropdown-menu-radio-item:flex`,children:i(c.ItemIndicator,{children:i(t,{svg:i(s,{weight:`bold`}),className:`size-4 text-accent-600`})})}),r]}));b.displayName=`DropdownMenuRadioItem`;const x=r(({className:t,inset:n,...r},a)=>i(c.Label,{ref:a,"data-slot":`dropdown-menu-label`,className:e(`px-2 py-1.5 text-sm font-medium`,n&&`pl-8`,t),...r}));x.displayName=`DropdownMenuLabel`;const S=r(({className:t,...r},a)=>i(n,{ref:a,"data-slot":`dropdown-menu-separator`,className:e(`-mx-1.25 my-1 w-auto`,t),...r}));S.displayName=`DropdownMenuSeparator`;const C=({className:t,...n})=>i(`span`,{"data-slot":`dropdown-menu-shortcut`,className:e(`ml-auto text-xs tracking-widest opacity-60`,t),...n});C.displayName=`DropdownMenuShortcut`;const w={Root:l,CheckboxItem:y,Content:_,Group:d,Item:v,Label:x,RadioGroup:m,RadioItem:b,Separator:S,Shortcut:C,Sub:p,SubContent:g,SubTrigger:h,Trigger:u};export{w as t};
|
package/dist/index-DZRbVkZa.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./dropdown-menu-DMNw8ItM.js";
|