@ngrok/mantle 0.87.0 → 0.88.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/agent.json +1 -1
- package/dist/description-list.d.ts +4 -0
- package/dist/description-list.js +1 -1
- package/dist/hooks.d.ts +36 -1
- package/dist/hooks.js +1 -1
- package/dist/llms.txt +1 -1
- package/dist/mantle.css +9 -20
- package/dist/sidebar.d.ts +2 -2
- package/dist/sidebar.js +1 -1
- package/dist/tabs.d.ts +172 -33
- package/dist/tabs.js +1 -1
- package/dist/use-is-hydrated-after-paint-Drj0lNi4.js +1 -0
- package/package.json +2 -2
- package/dist/use-breakpoint-CjyNk0fi.js +0 -1
package/dist/agent.json
CHANGED
|
@@ -11,6 +11,8 @@ type DescriptionListProps = ComponentProps<"dl"> & WithAsChild & WithDataSlot;
|
|
|
11
11
|
* A semantically correct description list built on the HTML `<dl>` element.
|
|
12
12
|
* Renders a list of label/value pairs with alternating row backgrounds,
|
|
13
13
|
* commonly used in detail views to display metadata about a resource.
|
|
14
|
+
* The value column has a `0` minimum width, so a value that truncates or
|
|
15
|
+
* wraps stays inside the row instead of widening the list.
|
|
14
16
|
*
|
|
15
17
|
* | Data Attribute | Value | Description |
|
|
16
18
|
* | --- | --- | --- |
|
|
@@ -148,6 +150,8 @@ declare const DescriptionList: {
|
|
|
148
150
|
* A semantically correct description list built on the HTML `<dl>` element.
|
|
149
151
|
* Renders a list of label/value pairs with alternating row backgrounds,
|
|
150
152
|
* commonly used in detail views to display metadata about a resource.
|
|
153
|
+
* The value column has a `0` minimum width, so a value that truncates or
|
|
154
|
+
* wraps stays inside the row instead of widening the list.
|
|
151
155
|
*
|
|
152
156
|
* @see https://mantle.ngrok.com/components/data-display/description-list#descriptionlistroot
|
|
153
157
|
*
|
package/dist/description-list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-BsvE2ntj.js";import{c as r}from"react/compiler-runtime";import{jsx as i}from"react/jsx-runtime";const a={Root:a=>{let o=r(18),s,c,l,u,d,f;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5],f=o[6]):({asChild:f,className:c,children:s,"data-slot":l,ref:u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d,o[6]=f);let p=f!==void 0&&f?n:`dl`,m;o[7]===l?m=o[8]:(m=t(l,`description-list`),o[7]=l,o[8]=m);let h;o[9]===c?h=o[10]:(h=e(`relative scrollbar overflow-x-auto overscroll-x-none rounded-lg border border-card grid grid-cols-[
|
|
1
|
+
import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-BsvE2ntj.js";import{c as r}from"react/compiler-runtime";import{jsx as i}from"react/jsx-runtime";const a={Root:a=>{let o=r(18),s,c,l,u,d,f;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5],f=o[6]):({asChild:f,className:c,children:s,"data-slot":l,ref:u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d,o[6]=f);let p=f!==void 0&&f?n:`dl`,m;o[7]===l?m=o[8]:(m=t(l,`description-list`),o[7]=l,o[8]=m);let h;o[9]===c?h=o[10]:(h=e(`relative scrollbar overflow-x-auto overscroll-x-none rounded-lg border border-card grid grid-cols-[auto_minmax(0,1fr)] gap-x-4 [&>*:nth-child(odd)]:bg-neutral-500/5 p-1`,c),o[9]=c,o[10]=h);let g;return o[11]!==p||o[12]!==s||o[13]!==u||o[14]!==d||o[15]!==m||o[16]!==h?(g=i(p,{ref:u,"data-slot":m,className:h,...d,children:s}),o[11]=p,o[12]=s,o[13]=u,o[14]=d,o[15]=m,o[16]=h,o[17]=g):g=o[17],g},Item:t=>{let a=r(14),o,s,c,l,u;a[0]===t?(o=a[1],s=a[2],c=a[3],l=a[4],u=a[5]):({asChild:u,className:s,children:o,ref:c,...l}=t,a[0]=t,a[1]=o,a[2]=s,a[3]=c,a[4]=l,a[5]=u);let d=u!==void 0&&u?n:`div`,f;a[6]===s?f=a[7]:(f=e(`rounded-sm col-span-full grid grid-cols-subgrid items-center`,s),a[6]=s,a[7]=f);let p;return a[8]!==d||a[9]!==o||a[10]!==c||a[11]!==l||a[12]!==f?(p=i(d,{ref:c,"data-slot":`description-list-item`,className:f,...l,children:o}),a[8]=d,a[9]=o,a[10]=c,a[11]=l,a[12]=f,a[13]=p):p=a[13],p},Label:t=>{let a=r(14),o,s,c,l,u;a[0]===t?(o=a[1],s=a[2],c=a[3],l=a[4],u=a[5]):({asChild:u,className:s,children:o,ref:c,...l}=t,a[0]=t,a[1]=o,a[2]=s,a[3]=c,a[4]=l,a[5]=u);let d=u!==void 0&&u?n:`dt`,f;a[6]===s?f=a[7]:(f=e(`text-muted text-sm font-sans font-medium min-w-36 p-2`,s),a[6]=s,a[7]=f);let p;return a[8]!==d||a[9]!==o||a[10]!==c||a[11]!==l||a[12]!==f?(p=i(d,{ref:c,"data-slot":`description-list-label`,className:f,...l,children:o}),a[8]=d,a[9]=o,a[10]=c,a[11]=l,a[12]=f,a[13]=p):p=a[13],p},Value:t=>{let a=r(14),o,s,c,l,u;a[0]===t?(o=a[1],s=a[2],c=a[3],l=a[4],u=a[5]):({asChild:u,className:s,children:o,ref:c,...l}=t,a[0]=t,a[1]=o,a[2]=s,a[3]=c,a[4]=l,a[5]=u);let d=u!==void 0&&u?n:`dd`,f;a[6]===s?f=a[7]:(f=e(`text-body font-mono text-mono py-2 px-3`,s),a[6]=s,a[7]=f);let p;return a[8]!==d||a[9]!==o||a[10]!==c||a[11]!==l||a[12]!==f?(p=i(d,{ref:c,"data-slot":`description-list-value`,className:f,...l,children:o}),a[8]=d,a[9]=o,a[10]=c,a[11]=l,a[12]=f,a[13]=p):p=a[13],p}};export{a as DescriptionList};
|
package/dist/hooks.d.ts
CHANGED
|
@@ -268,6 +268,10 @@ declare function useDebouncedCallback<T extends (...args: unknown[]) => unknown>
|
|
|
268
268
|
* localStorage): render a same-size placeholder until hydration so the real
|
|
269
269
|
* UI mounts exactly once, with the real client-side values.
|
|
270
270
|
*
|
|
271
|
+
* To gate a CSS transition on a post-hydration state correction, use
|
|
272
|
+
* `useIsHydratedAfterPaint` instead. This hook flips in the same commit as
|
|
273
|
+
* the correction, so the transition runs.
|
|
274
|
+
*
|
|
271
275
|
* @example
|
|
272
276
|
* ```tsx
|
|
273
277
|
* function PreferencesPanel() {
|
|
@@ -279,6 +283,37 @@ declare function useDebouncedCallback<T extends (...args: unknown[]) => unknown>
|
|
|
279
283
|
*/
|
|
280
284
|
declare function useIsHydrated(): boolean;
|
|
281
285
|
//#endregion
|
|
286
|
+
//#region src/hooks/use-is-hydrated-after-paint.d.ts
|
|
287
|
+
/**
|
|
288
|
+
* Returns `false` on the server, in the hydration render, and in the mount
|
|
289
|
+
* commit, then `true` from the next animation frame.
|
|
290
|
+
*
|
|
291
|
+
* Use it to gate a CSS transition that must not run on a post-hydration
|
|
292
|
+
* state correction. `useIsHydrated` flips in the hydration commit. A
|
|
293
|
+
* `useLocalStorage` or any other `useSyncExternalStore` correction lands in
|
|
294
|
+
* that same commit. CSS starts a transition from the commit's after-change
|
|
295
|
+
* style, so the transition runs. One frame later the correction has painted,
|
|
296
|
+
* so a gate keyed on this result opens on settled values. For every other
|
|
297
|
+
* client-only branch, `useIsHydrated` is the right hook: it costs no extra
|
|
298
|
+
* render.
|
|
299
|
+
*
|
|
300
|
+
* @example
|
|
301
|
+
* ```tsx
|
|
302
|
+
* function Panel({ open }: { open: boolean }) {
|
|
303
|
+
* const isHydrated = useIsHydratedAfterPaint();
|
|
304
|
+
* // A persisted-collapsed `open` snaps on load and animates on every later toggle.
|
|
305
|
+
* return (
|
|
306
|
+
* <div
|
|
307
|
+
* data-state={open ? "expanded" : "collapsed"}
|
|
308
|
+
* data-hydrated={isHydrated ? "" : undefined}
|
|
309
|
+
* className="w-52 transition-[width] data-[state=collapsed]:w-13 not-data-hydrated:transition-none"
|
|
310
|
+
* />
|
|
311
|
+
* );
|
|
312
|
+
* }
|
|
313
|
+
* ```
|
|
314
|
+
*/
|
|
315
|
+
declare function useIsHydratedAfterPaint(): boolean;
|
|
316
|
+
//#endregion
|
|
282
317
|
//#region src/hooks/use-isomorphic-layout-effect.d.ts
|
|
283
318
|
/**
|
|
284
319
|
* A drop-in replacement for `useLayoutEffect` that does not warn during
|
|
@@ -680,4 +715,4 @@ type UseUndoRedoReturn<T> = {
|
|
|
680
715
|
*/
|
|
681
716
|
declare function useUndoRedo<T extends NonNullable<unknown>>(): UseUndoRedoReturn<T>;
|
|
682
717
|
//#endregion
|
|
683
|
-
export { type Breakpoint, type TailwindBreakpoint, type UseInViewOptions, type UseUndoRedoReturn, breakpoints, useBreakpoint, useCallbackRef, useComposedRefs, useCopyToClipboard, useDebounce, useDebouncedCallback, useInView, useIsBelowBreakpoint, useIsHydrated, useLocalStorage, useSessionStorage, useUndoRedo };
|
|
718
|
+
export { type Breakpoint, type TailwindBreakpoint, type UseInViewOptions, type UseUndoRedoReturn, breakpoints, useBreakpoint, useCallbackRef, useComposedRefs, useCopyToClipboard, useDebounce, useDebouncedCallback, useInView, useIsBelowBreakpoint, useIsHydrated, useIsHydratedAfterPaint, useLocalStorage, useSessionStorage, useUndoRedo };
|
package/dist/hooks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{n as t}from"./compose-refs-sFdxsL7k.js";import{t as n}from"./use-is-hydrated-DDCqXmju.js";import{t as r}from"./use-copy-to-clipboard-ByLT8veV.js";import{t as i}from"./use-callback-ref-BvVyI5K1.js";import{t as a}from"./use-matches-media-query-m860lols.js";import{n as o,t as s}from"./use-prefers-reduced-motion-Cj9tJ181.js";import{
|
|
1
|
+
import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{n as t}from"./compose-refs-sFdxsL7k.js";import{t as n}from"./use-is-hydrated-DDCqXmju.js";import{t as r}from"./use-copy-to-clipboard-ByLT8veV.js";import{t as i}from"./use-callback-ref-BvVyI5K1.js";import{t as a}from"./use-matches-media-query-m860lols.js";import{n as o,t as s}from"./use-prefers-reduced-motion-Cj9tJ181.js";import{i as c,n as l,r as u,t as d}from"./use-is-hydrated-after-paint-Drj0lNi4.js";import{t as f}from"./in-view-T_AAYaaF.js";import{c as p}from"react/compiler-runtime";import{useEffect as m,useRef as h,useState as g,useSyncExternalStore as _}from"react";function v(e,t){let n=p(4),[r,i]=g(e),a,o;return n[0]!==t.waitMs||n[1]!==e?(a=()=>{let n=window.setTimeout(()=>{i(e)},t.waitMs);return()=>{window.clearTimeout(n)}},o=[e,t.waitMs],n[0]=t.waitMs,n[1]=e,n[2]=a,n[3]=o):(a=n[2],o=n[3]),m(a,o),r}function y(e,t){let n=p(5),r=i(e),a=h(0),o,s;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>()=>window.clearTimeout(a.current),s=[],n[0]=o,n[1]=s):(o=n[0],s=n[1]),m(o,s);let c;return n[2]!==t.waitMs||n[3]!==r?(c=(...e)=>{let n=e;window.clearTimeout(a.current),a.current=window.setTimeout(()=>r(...n),t.waitMs)},n[2]=t.waitMs,n[3]=r,n[4]=c):c=n[4],c}const b=new Map;function x(e){if(e.key==null){b.clear();return}b.has(e.key)&&(e.newValue==null?b.delete(e.key):b.set(e.key,e.newValue))}function S(){try{return window.localStorage}catch{return null}}function C(e){return function(t){function n(n){let r=n.storageArea==null||n.storageArea===S(),i=n.key==null||n.key===e;r&&i&&(x(n),t())}return window.addEventListener(`storage`,n),()=>{window.removeEventListener(`storage`,n)}}}function w(){return null}function T(e){let t=b.get(e);if(t!=null)return t;try{return window.localStorage.getItem(e)}catch{return null}}function E(e,t){try{window.localStorage.setItem(e,t),b.delete(e)}catch{b.set(e,t)}}function D(e,t){try{let n=JSON.parse(e);return typeof n==`string`?n:t}catch{return t}}function O(e,t){let n=p(12),r;n[0]===e?r=n[1]:(r=C(e),n[0]=e,n[1]=r);let i=r,a;n[2]===e?a=n[3]:(a=()=>T(e),n[2]=e,n[3]=a);let o=_(i,a,w),s;n[4]!==t||n[5]!==o?(s=o==null?t:D(o,t),n[4]=t,n[5]=o,n[6]=s):s=n[6];let c=s,l;n[7]===e?l=n[8]:(l=t=>{let n=JSON.stringify(t);E(e,n),window.dispatchEvent(new StorageEvent(`storage`,{key:e,newValue:n,storageArea:S()}))},n[7]=e,n[8]=l);let u=l,d;return n[9]!==u||n[10]!==c?(d=[c,u],n[9]=u,n[10]=c,n[11]=d):d=n[11],d}const k=new Map;function A(e){if(e.key==null){k.clear();return}k.has(e.key)&&(e.newValue==null?k.delete(e.key):k.set(e.key,e.newValue))}function j(){try{return window.sessionStorage}catch{return null}}function M(e){return function(t){function n(n){let r=n.storageArea==null||n.storageArea===j(),i=n.key==null||n.key===e;r&&i&&(A(n),t())}return window.addEventListener(`storage`,n),()=>{window.removeEventListener(`storage`,n)}}}function N(){return null}function P(e){let t=k.get(e);if(t!=null)return t;try{return window.sessionStorage.getItem(e)}catch{return null}}function F(e,t){try{window.sessionStorage.setItem(e,t),k.delete(e)}catch{k.set(e,t)}}function I(e,t){try{let n=JSON.parse(e);return typeof n==`string`?n:t}catch{return t}}function L(e,t){let n=p(12),r;n[0]===e?r=n[1]:(r=M(e),n[0]=e,n[1]=r);let i=r,a;n[2]===e?a=n[3]:(a=()=>P(e),n[2]=e,n[3]=a);let o=_(i,a,N),s;n[4]!==t||n[5]!==o?(s=o==null?t:I(o,t),n[4]=t,n[5]=o,n[6]=s):s=n[6];let c=s,l;n[7]===e?l=n[8]:(l=t=>{let n=JSON.stringify(t);F(e,n),window.dispatchEvent(new StorageEvent(`storage`,{key:e,newValue:n,storageArea:j()}))},n[7]=e,n[8]=l);let u=l,d;return n[9]!==u||n[10]!==c?(d=[c,u],n[9]=u,n[10]=c,n[11]=d):d=n[11],d}function R(){return o()?`auto`:`smooth`}function z(e,t){let n=p(14),r;n[0]===t?r=n[1]:(r=t===void 0?{}:t,n[0]=t,n[1]=r);let{root:i,margin:a,amount:o,once:s,initial:c}=r,l=s!==void 0&&s,u=c!==void 0&&c,[d,_]=g(u),v=h(u),y;n[2]!==o||n[3]!==a||n[4]!==l||n[5]!==e||n[6]!==i?.current?(y=()=>{let t=e.current;if(t==null||l&&v.current)return;let n=function(){if(v.current=!0,_(!0),!l)return()=>{v.current=!1,_(!1)}},r={root:i?.current??void 0,margin:a,amount:o};return f(t,n,r)},n[2]=o,n[3]=a,n[4]=l,n[5]=e,n[6]=i?.current,n[7]=y):y=n[7];let b;return n[8]!==o||n[9]!==a||n[10]!==l||n[11]!==e||n[12]!==i?(b=[i,e,a,l,o],n[8]=o,n[9]=a,n[10]=l,n[11]=e,n[12]=i,n[13]=b):b=n[13],m(y,b),d}function B(){let e=p(9),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let n=h(t),r;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],e[1]=r):r=e[1];let i=h(r),a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a={undo:0,redo:0},e[2]=a):a=e[2];let[o,s]=g(a),c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=e=>{n.current.push(e),i.current=[],s({undo:n.current.length,redo:0})},e[3]=c):c=e[3];let l=c,u;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(u=e=>{let t=n.current[n.current.length-1];if(t!==void 0)return n.current.pop(),i.current.push(e),s({undo:n.current.length,redo:i.current.length}),t},e[4]=u):u=e[4];let d=u,f;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>{let t=i.current[i.current.length-1];if(t!==void 0)return i.current.pop(),n.current.push(e),s({undo:n.current.length,redo:i.current.length}),t},e[5]=f):f=e[5];let m=f,_=o.undo>0,v=o.redo>0,y;return e[6]!==v||e[7]!==_?(y={canUndo:_,canRedo:v,push:l,undo:d,redo:m},e[6]=v,e[7]=_,e[8]=y):y=e[8],y}export{l as breakpoints,s as getPrefersReducedMotion,u as useBreakpoint,i as useCallbackRef,t as useComposedRefs,r as useCopyToClipboard,v as useDebounce,y as useDebouncedCallback,z as useInView,c as useIsBelowBreakpoint,n as useIsHydrated,d as useIsHydratedAfterPaint,e as useIsomorphicLayoutEffect,O as useLocalStorage,a as useMatchesMediaQuery,o as usePrefersReducedMotion,R as useScrollBehavior,L as useSessionStorage,B as useUndoRedo};
|
package/dist/llms.txt
CHANGED
package/dist/mantle.css
CHANGED
|
@@ -1054,30 +1054,19 @@ MARK: UTILITIES
|
|
|
1054
1054
|
* `--_fade-left` / `--_fade-right` (the animation drives the upstream
|
|
1055
1055
|
* `--_scroll-fade-*` vars, so a static override always wins).
|
|
1056
1056
|
*
|
|
1057
|
-
*
|
|
1058
|
-
*
|
|
1059
|
-
* row opaque by setting `--_fade-bottom-border: black`, so the border runs
|
|
1060
|
-
* solid to the container edges while the scrolled content above it fades.
|
|
1061
|
-
* The second mask layer defaults to fully transparent — an identity under
|
|
1062
|
-
* additive compositing — so it costs other consumers nothing.
|
|
1057
|
+
* The mask covers the whole box, borders included. A hairline that must stay
|
|
1058
|
+
* solid belongs on a sibling outside the container, as `Tabs.Separator` does.
|
|
1063
1059
|
*/
|
|
1064
1060
|
--_fade-left: var(--_scroll-fade-left);
|
|
1065
1061
|
--_fade-right: var(--_scroll-fade-right);
|
|
1066
1062
|
|
|
1067
|
-
mask-image:
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
),
|
|
1075
|
-
linear-gradient(
|
|
1076
|
-
to bottom,
|
|
1077
|
-
transparent calc(100% - 1px),
|
|
1078
|
-
var(--_fade-bottom-border, transparent) calc(100% - 1px)
|
|
1079
|
-
);
|
|
1080
|
-
mask-composite: add;
|
|
1063
|
+
mask-image: linear-gradient(
|
|
1064
|
+
to right,
|
|
1065
|
+
var(--_fade-left),
|
|
1066
|
+
black 40px,
|
|
1067
|
+
black calc(100% - 40px),
|
|
1068
|
+
var(--_fade-right)
|
|
1069
|
+
);
|
|
1081
1070
|
|
|
1082
1071
|
@supports (animation-timeline: scroll()) {
|
|
1083
1072
|
animation-name: scroll-fade-x-start, scroll-fade-x-end;
|
package/dist/sidebar.d.ts
CHANGED
|
@@ -273,7 +273,7 @@ type SidebarNavProps = ComponentProps<"div"> & WithDataSlot;
|
|
|
273
273
|
* | Data Attribute | Value | Description |
|
|
274
274
|
* | --- | --- | --- |
|
|
275
275
|
* | `data-state` | `"expanded"` \| `"collapsed"` | On the desktop panel surface. Mirrors the root's expanded state and drives the width collapse to the icon rail; descendant parts style off it with `group-data-[state=collapsed]/sidebar-nav:`. |
|
|
276
|
-
* | `data-hydrated` | present after hydration | Presence-only, desktop panel surface. The
|
|
276
|
+
* | `data-hydrated` | present one frame after hydration | Presence-only, desktop panel surface. The panel's pre-hydration visibility gate, its width transition, and descendant collapse transitions all key off its absence in CSS (`not-data-hydrated:`, `group-not-data-hydrated/sidebar-nav:`). The stamp waits one frame, so an SSR state correction paints first and snaps instead of animating on page load. |
|
|
277
277
|
* | `data-mobile` | present in the mobile sheet | Presence-only. Marks the `Sheet.Content` presentation used below the root's `mobileBreakpoint`. |
|
|
278
278
|
* | `data-state` | `"open"` \| `"closed"` | In the mobile sheet only, where the panel *is* the `Sheet`'s Radix dialog content element and Radix owns the attribute — the sheet's open/close animation state, not the desktop expanded state. Consumers style against it too. |
|
|
279
279
|
*
|
|
@@ -1586,7 +1586,7 @@ declare const Sidebar: {
|
|
|
1586
1586
|
* | Data Attribute | Value | Description |
|
|
1587
1587
|
* | --- | --- | --- |
|
|
1588
1588
|
* | `data-state` | `"expanded"` \| `"collapsed"` | On the desktop panel surface. Mirrors the root's expanded state and drives the width collapse to the icon rail; descendant parts style off it with `group-data-[state=collapsed]/sidebar-nav:`. |
|
|
1589
|
-
* | `data-hydrated` | present after hydration | Presence-only, desktop panel surface. The
|
|
1589
|
+
* | `data-hydrated` | present one frame after hydration | Presence-only, desktop panel surface. The panel's pre-hydration visibility gate, its width transition, and descendant collapse transitions all key off its absence in CSS (`not-data-hydrated:`, `group-not-data-hydrated/sidebar-nav:`). The stamp waits one frame, so an SSR state correction paints first and snaps instead of animating on page load. |
|
|
1590
1590
|
* | `data-mobile` | present in the mobile sheet | Presence-only. Marks the `Sheet.Content` presentation used below the root's `mobileBreakpoint`. |
|
|
1591
1591
|
* | `data-state` | `"open"` \| `"closed"` | In the mobile sheet only, where the panel *is* the `Sheet`'s Radix dialog content element and Radix owns the attribute — the sheet's open/close animation state, not the desktop expanded state. Consumers style against it too. |
|
|
1592
1592
|
*
|
package/dist/sidebar.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-BsvE2ntj.js";import{t as r}from"./button-pwkdtR3U.js";import{t as i}from"./use-is-hydrated-DDCqXmju.js";import{n as a}from"./separator-D98be0gY.js";import{n as o,t as s}from"./use-is-apple-platform-CMPzIYjz.js";import{t as c}from"./use-callback-ref-BvVyI5K1.js";import{n as l}from"./cookie-ca4g5CKp.js";import{t as u}from"./sheet-B5x8EO9Y.js";import{r as d}from"./use-breakpoint-CjyNk0fi.js";import{t as f}from"./tooltip-H03l7E4Y.js";import{c as p}from"react/compiler-runtime";import{createContext as m,useContext as h,useEffect as g,useId as _,useRef as v,useState as y}from"react";import b from"tiny-invariant";import{Fragment as x,jsx as S,jsxs as C}from"react/jsx-runtime";import{SidebarSimpleIcon as w}from"@phosphor-icons/react/SidebarSimple";const T={sm:`hidden sm:block`,md:`hidden md:block`,lg:`hidden lg:block`},E=m(null);function D(){let e=h(E);return b(e,`useSidebar must be used within Sidebar.Root.`),e}function O(e){let t=h(E);return b(t,`Sidebar.${e} must be rendered inside Sidebar.Root.`),t}const k=[];function A(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.tagName===`SELECT`:!1}function j(){let e=Symbol(`sidebar-keyboard-shortcut`);return k.push(e),{isOwner:()=>k[0]===e,release:()=>{let t=k.indexOf(e);t!==-1&&k.splice(t,1)}}}const M=e=>{let t=p(34),{children:n,defaultOpen:r,keyboardShortcut:i,mobileBreakpoint:a,onOpenChange:s,onOpenMobileChange:l,open:u,openMobile:f}=e,m=r===void 0||r,h=i===void 0||i,b=a===void 0?`lg`:a,x=d(b),C=_(),w=u!=null,[T,D]=y(m),O=w?u:T,k;t[0]!==w||t[1]!==s?(k=e=>{w||D(e),s?.(e)},t[0]=w,t[1]=s,t[2]=k):k=t[2];let M=k,N=f!=null,[P,F]=y(!1),I=N?f:P,L;t[3]!==N||t[4]!==l?(L=e=>{N||F(e),l?.(e)},t[3]=N,t[4]=l,t[5]=L):L=t[5];let R=L,z=v(x),B,V;t[6]!==x||t[7]!==I||t[8]!==R?(B=()=>{let e=z.current&&!x;z.current=x,e&&I&&R(!1)},V=[x,I,R],t[6]=x,t[7]=I,t[8]=R,t[9]=B,t[10]=V):(B=t[9],V=t[10]),g(B,V);let H;t[11]!==x||t[12]!==O||t[13]!==I||t[14]!==M||t[15]!==R?(H=()=>{x?R(!I):M(!O)},t[11]=x,t[12]=O,t[13]=I,t[14]=M,t[15]=R,t[16]=H):H=t[16];let U=H,W=c(U),G,K;t[17]!==h||t[18]!==W?(K=()=>{if(!h)return;let e=j(),t=o(),n=n=>{if(!e.isOwner()||A(n.target))return;let r=t?n.metaKey:n.ctrlKey,i=t?n.ctrlKey:n.metaKey;n.key?.toLowerCase()===`b`&&r&&!i&&!n.altKey&&!n.shiftKey&&(n.preventDefault(),W())};return window.addEventListener(`keydown`,n),()=>{window.removeEventListener(`keydown`,n),e.release()}},G=[h,W],t[17]=h,t[18]=W,t[19]=G,t[20]=K):(G=t[19],K=t[20]),g(K,G);let q;t[21]!==x||t[22]!==h||t[23]!==b||t[24]!==C||t[25]!==O||t[26]!==I||t[27]!==M||t[28]!==R||t[29]!==U?(q={isMobile:x,keyboardShortcut:h,mobileBreakpoint:b,navId:C,open:O,openMobile:I,setOpen:M,setOpenMobile:R,toggle:U},t[21]=x,t[22]=h,t[23]=b,t[24]=C,t[25]=O,t[26]=I,t[27]=M,t[28]=R,t[29]=U,t[30]=q):q=t[30];let J=q,Y;return t[31]!==n||t[32]!==J?(Y=S(E.Provider,{value:J,children:n}),t[31]=n,t[32]=J,t[33]=Y):Y=t[33],Y},N=n=>{let r=p(49),a,o,s,c,l,d;r[0]===n?(a=r[1],o=r[2],s=r[3],c=r[4],l=r[5],d=r[6]):({"aria-label":a,"aria-labelledby":o,children:s,className:c,"data-slot":l,...d}=n,r[0]=n,r[1]=a,r[2]=o,r[3]=s,r[4]=c,r[5]=l,r[6]=d);let{isMobile:f,mobileBreakpoint:m,navId:h,open:g,openMobile:_,setOpenMobile:v}=O(`Nav`),y=i(),b=a??(o==null?`Main`:void 0);if(f){let n;r[7]===l?n=r[8]:(n=t(l,`sidebar-nav`),r[7]=l,r[8]=n);let i;r[9]===o?i=r[10]:(i=o==null?null:{"aria-labelledby":o},r[9]=o,r[10]=i);let a;r[11]===c?a=r[12]:(a=e(`bg-base w-(--sidebar-width-mobile,18rem) max-w-full p-0`,c),r[11]=c,r[12]=a);let f=b??`Sidebar`,p;r[13]===f?p=r[14]:(p=S(u.Title,{className:`sr-only`,children:f}),r[13]=f,r[14]=p);let m;r[15]!==b||r[16]!==o||r[17]!==s||r[18]!==h?(m=S(`nav`,{id:h,"aria-label":b,"aria-labelledby":o,className:`flex h-full w-full min-w-0 flex-col text-sm`,children:s}),r[15]=b,r[16]=o,r[17]=s,r[18]=h,r[19]=m):m=r[19];let g;r[20]!==d||r[21]!==n||r[22]!==i||r[23]!==a||r[24]!==p||r[25]!==m?(g=C(u.Content,{side:`left`,preferredWidth:`sm:max-w-(--sidebar-width-mobile,18rem)`,"data-slot":n,"data-mobile":``,...i,className:a,...d,children:[p,m]}),r[20]=d,r[21]=n,r[22]=i,r[23]=a,r[24]=p,r[25]=m,r[26]=g):g=r[26];let y;return r[27]!==_||r[28]!==v||r[29]!==g?(y=S(u.Root,{open:_,onOpenChange:v,children:g}),r[27]=_,r[28]=v,r[29]=g,r[30]=y):y=r[30],y}let x;r[31]===l?x=r[32]:(x=t(l,`sidebar-nav`),r[31]=l,r[32]=x);let w=g?`expanded`:`collapsed`,E=y?``:void 0,D=!y&&T[m],k=y&&`transition-[width] duration-200 ease-linear motion-reduce:transition-none`,A;r[33]!==c||r[34]!==D||r[35]!==k?(A=e(`group/sidebar-nav bg-base relative h-full w-(--sidebar-width,13rem) shrink-0 overflow-hidden`,`data-[state=collapsed]:w-(--sidebar-width-icon,3.25rem)`,D,k,c),r[33]=c,r[34]=D,r[35]=k,r[36]=A):A=r[36];let j;r[37]!==b||r[38]!==o||r[39]!==s||r[40]!==h?(j=S(`nav`,{id:h,"aria-label":b,"aria-labelledby":o,className:`absolute inset-y-0 left-0 flex w-full min-w-0 flex-col text-sm`,children:s}),r[37]=b,r[38]=o,r[39]=s,r[40]=h,r[41]=j):j=r[41];let M;return r[42]!==d||r[43]!==x||r[44]!==w||r[45]!==E||r[46]!==A||r[47]!==j?(M=S(`div`,{"data-slot":x,"data-state":w,"data-hydrated":E,className:A,...d,children:j}),r[42]=d,r[43]=x,r[44]=w,r[45]=E,r[46]=A,r[47]=j,r[48]=M):M=r[48],M},P=S(w,{}),F=e=>{let t=p(7),{label:n,shortcut:r}=e,i;t[0]===n?i=t[1]:(i=S(`span`,{"data-slot":`sidebar-tooltip-label`,className:`contents`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=r!=null&&S(`span`,{"aria-hidden":!0,"data-slot":`sidebar-tooltip-shortcut`,className:`inline-flex shrink-0 items-center gap-0.5 [&_kbd]:h-4 [&_kbd]:min-w-4 [&_kbd]:bg-neutral-500/25 [&_kbd]:px-0.5 [&_kbd]:text-xs`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=C(`span`,{"data-slot":`sidebar-tooltip-row`,className:`flex items-center gap-1.5`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o},I=e=>{let n=p(32),i,a,o,c,l,u,d,m;n[0]===e?(i=n[1],a=n[2],o=n[3],c=n[4],l=n[5],u=n[6],d=n[7],m=n[8]):({appearance:l,"data-slot":i,icon:u,intent:d,label:m,onClick:a,shortcut:c,...o}=e,n[0]=e,n[1]=i,n[2]=a,n[3]=o,n[4]=c,n[5]=l,n[6]=u,n[7]=d,n[8]=m);let h=l===void 0?`ghost`:l,g=u===void 0?P:u,_=d===void 0?`neutral`:d,v=m===void 0?`Toggle Sidebar`:m,{isMobile:y,keyboardShortcut:b,navId:x,open:w,openMobile:T,toggle:E}=O(`Trigger`),D=s(),k=y?T:w,A=!y||T,j=b?c:void 0,M=D?`Meta+B`:`Control+B`,N=A?x:void 0,I=b?M:void 0,L;n[9]===i?L=n[10]:(L=t(i,`sidebar-trigger`),n[9]=i,n[10]=L);let R=k?`expanded`:`collapsed`,z;n[11]!==a||n[12]!==E?(z=e=>{a?.(e),e.defaultPrevented||E()},n[11]=a,n[12]=E,n[13]=z):z=n[13];let B;n[14]!==h||n[15]!==k||n[16]!==g||n[17]!==_||n[18]!==v||n[19]!==o||n[20]!==N||n[21]!==I||n[22]!==L||n[23]!==R||n[24]!==z?(B=S(f.Trigger,{asChild:!0,children:S(r,{appearance:h,"aria-controls":N,"aria-expanded":k,"aria-keyshortcuts":I,"data-slot":L,"data-state":R,icon:g,intent:_,label:v,onClick:z,...o})}),n[14]=h,n[15]=k,n[16]=g,n[17]=_,n[18]=v,n[19]=o,n[20]=N,n[21]=I,n[22]=L,n[23]=R,n[24]=z,n[25]=B):B=n[25];let V;n[26]!==j||n[27]!==v?(V=S(f.Content,{"data-slot":`sidebar-trigger-tooltip`,children:S(F,{label:v,shortcut:j})}),n[26]=j,n[27]=v,n[28]=V):V=n[28];let H;return n[29]!==B||n[30]!==V?(H=C(f.Root,{children:[B,V]}),n[29]=B,n[30]=V,n[31]=H):H=n[31],H},L=r=>{let i=p(16),a,o,s,c,l;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?n:`div`,d;i[6]===c?d=i[7]:(d=t(c,`sidebar-header`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=e(`grid grid-cols-1 grid-rows-(--sidebar-header-height,4.5rem) shrink-0 items-center px-3`,`group-data-[state=expanded]/sidebar-nav:pr-1`,s),i[8]=s,i[9]=f);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(m=S(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=m):m=i[15],m},R=r=>{let i=p(16),a,o,s,c,l;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?n:`div`,d;i[6]===c?d=i[7]:(d=t(c,`sidebar-body`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=e(`scrollbar scrollbar-gutter-stable scroll-fade-y flex-1 scroll-py-6 space-y-2 overflow-y-auto overflow-x-hidden px-3 pt-1.5 pb-4`,`group-data-[state=expanded]/sidebar-nav:pr-1`,`group-data-[state=collapsed]/sidebar-nav:scrollbar-none`,`group-data-[state=collapsed]/sidebar-nav:scrollbar-gutter-auto`,`group-data-[state=collapsed]/sidebar-nav:[&::-webkit-scrollbar]:hidden`,s),i[8]=s,i[9]=f);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(m=S(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=m):m=i[15],m},z=r=>{let i=p(16),a,o,s,c,l;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?n:`div`,d;i[6]===c?d=i[7]:(d=t(c,`sidebar-footer`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=e(`shrink-0 px-3 pt-3 pb-3.5`,`group-data-[state=expanded]/sidebar-nav:pr-1`,s),i[8]=s,i[9]=f);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(m=S(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=m):m=i[15],m},B=m(null),V=r=>{let i=p(21),a,o,s,c,l;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let[u,d]=y(null),f;i[6]===u?f=i[7]:(f={mountedLabelId:u,setMountedLabelId:d},i[6]=u,i[7]=f);let m=f,h=a?n:`div`,g;i[8]===c?g=i[9]:(g=t(c,`sidebar-group`),i[8]=c,i[9]=g);let _;i[10]===s?_=i[11]:(_=e(`pt-0.5`,s),i[10]=s,i[11]=_);let v;i[12]!==h||i[13]!==o||i[14]!==l||i[15]!==g||i[16]!==_?(v=S(h,{"data-slot":g,className:_,...l,children:o}),i[12]=h,i[13]=o,i[14]=l,i[15]=g,i[16]=_,i[17]=v):v=i[17];let b;return i[18]!==m||i[19]!==v?(b=S(B.Provider,{value:m,children:v}),i[18]=m,i[19]=v,i[20]=b):b=i[20],b},H=r=>{let i=p(22),a,o,s,c,l,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6]):({asChild:a,children:o,className:s,"data-slot":c,id:l,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u);let d=h(B),f=_(),m=l??(d==null?void 0:f),v=d?.setMountedLabelId,y,b;i[7]!==m||i[8]!==v?(y=()=>{if(v!=null&&m!=null)return v(m),()=>{v(null)}},b=[v,m],i[7]=m,i[8]=v,i[9]=y,i[10]=b):(y=i[9],b=i[10]),g(y,b);let x=a?n:`div`,C;i[11]===c?C=i[12]:(C=t(c,`sidebar-group-label`),i[11]=c,i[12]=C);let w;i[13]===s?w=i[14]:(w=e(`text-muted flex min-w-0 items-center gap-2 truncate px-2 py-1 text-xs font-medium`,`group-data-[state=collapsed]/sidebar-nav:opacity-0`,`group-data-[state=collapsed]/sidebar-nav:pointer-events-none`,`group-data-hydrated/sidebar-nav:transition-opacity group-data-hydrated/sidebar-nav:duration-200 group-data-hydrated/sidebar-nav:ease-linear group-data-hydrated/sidebar-nav:motion-reduce:transition-none`,s),i[13]=s,i[14]=w);let T;return i[15]!==x||i[16]!==o||i[17]!==m||i[18]!==u||i[19]!==C||i[20]!==w?(T=S(x,{id:m,"data-slot":C,className:w,...u,children:o}),i[15]=x,i[16]=o,i[17]=m,i[18]=u,i[19]=C,i[20]=w,i[21]=T):T=i[21],T},U=r=>{let i=p(18),a,o,s,c,l,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6]):({"aria-labelledby":a,asChild:o,children:s,className:c,"data-slot":l,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u);let d=h(B),f=o?n:`ul`,m=a??d?.mountedLabelId??void 0,g;i[7]===l?g=i[8]:(g=t(l,`sidebar-list`),i[7]=l,i[8]=g);let _;i[9]===c?_=i[10]:(_=e(`mb-2 space-y-px`,c),i[9]=c,i[10]=_);let v;return i[11]!==f||i[12]!==s||i[13]!==u||i[14]!==m||i[15]!==g||i[16]!==_?(v=S(f,{"aria-labelledby":m,"data-slot":g,className:_,...u,children:s}),i[11]=f,i[12]=s,i[13]=u,i[14]=m,i[15]=g,i[16]=_,i[17]=v):v=i[17],v},W=r=>{let i=p(16),a,o,s,c,l;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?n:`li`,d;i[6]===c?d=i[7]:(d=t(c,`sidebar-item`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=e(`list-none`,s),i[8]=s,i[9]=f);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(m=S(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=m):m=i[15],m},G=[`ring-focus-accent flex w-full min-w-0 items-center gap-2 truncate rounded-md px-2 py-1 text-left font-normal transition-none focus:outline-hidden focus-visible:ring-4`,`text-body hover:text-strong hover:bg-neutral-500/10`,`data-state-open:bg-neutral-500/15 data-state-open:text-strong`,`group-data-[state=collapsed]/sidebar-nav:ml-1`,`group-data-[state=collapsed]/sidebar-nav:w-7`,`group-data-[state=collapsed]/sidebar-nav:p-1`].join(` `),K={Root:M,Nav:N,Trigger:I,Header:L,Body:R,Footer:z,Group:V,GroupLabel:H,List:U,Item:W,ItemButton:r=>{let i=p(21),a,o,s,c,l,u,d;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6],d=i[7]):({asChild:a,children:o,className:s,current:c,"data-slot":l,type:d,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u,i[7]=d);let f=a?n:`button`,m;i[8]===l?m=i[9]:(m=t(l,`sidebar-item-button`),i[8]=l,i[9]=m);let h=c?``:void 0,g=c?`page`:void 0,_=a?d:d??`button`,v;i[10]===s?v=i[11]:(v=e(G,`data-current:bg-neutral-500/15 data-current:text-strong`,`aria-[current=page]:bg-neutral-500/15 aria-[current=page]:text-strong`,`[&>svg]:text-muted hover:[&>svg]:text-strong data-current:[&>svg]:text-strong aria-[current=page]:[&>svg]:text-strong [&>svg:first-child]:size-5 [&>svg]:shrink-0`,s),i[10]=s,i[11]=v);let y;return i[12]!==f||i[13]!==o||i[14]!==u||i[15]!==m||i[16]!==h||i[17]!==g||i[18]!==_||i[19]!==v?(y=S(f,{"data-slot":m,"data-current":h,"aria-current":g,type:_,className:v,...u,children:o}),i[12]=f,i[13]=o,i[14]=u,i[15]=m,i[16]=h,i[17]=g,i[18]=_,i[19]=v,i[20]=y):y=i[20],y},SearchTrigger:r=>{let i=p(23),a,o,s,c,l,u,d;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6],d=i[7]):({asChild:a,children:o,className:s,"data-slot":c,shortcut:u,type:d,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u,i[7]=d);let f=a?n:`button`,m;i[8]!==a||i[9]!==o||i[10]!==u?(m=a?o:C(x,{children:[S(`span`,{"data-slot":`sidebar-search-trigger-label`,className:`contents`,children:o}),S(`span`,{"aria-hidden":!0,"data-slot":`sidebar-search-trigger-shortcut`,className:e(`pointer-events-none -mr-1 ml-auto inline-flex shrink-0 items-center gap-0.5 opacity-0 select-none`,`group-hover:opacity-100 group-focus-visible:opacity-100`,`group-data-[state=collapsed]/sidebar-nav:hidden`,`[&_kbd]:text-body [&_kbd]:h-5 [&_kbd]:min-w-5 [&_kbd]:bg-neutral-500/20 [&_kbd]:px-1 [&_kbd]:text-xs [&_kbd]:font-normal`,`empty:hidden`),children:u})]}),i[8]=a,i[9]=o,i[10]=u,i[11]=m):m=i[11];let h=m,g;i[12]===c?g=i[13]:(g=t(c,`sidebar-search-trigger`),i[12]=c,i[13]=g);let _=a?d:d??`button`,v;i[14]===s?v=i[15]:(v=e(`group`,G,`[&>svg:first-child]:text-muted hover:[&>svg:first-child]:text-strong`,`[&>svg:first-child]:size-5`,`[&>[data-slot=sidebar-search-trigger-label]>svg:first-child]:text-muted`,`hover:[&>[data-slot=sidebar-search-trigger-label]>svg:first-child]:text-strong`,`[&>[data-slot=sidebar-search-trigger-label]>svg:first-child]:size-5`,`[&_svg]:shrink-0`,s),i[14]=s,i[15]=v);let y;return i[16]!==f||i[17]!==h||i[18]!==l||i[19]!==g||i[20]!==_||i[21]!==v?(y=S(f,{"data-slot":g,type:_,className:v,...l,children:h}),i[16]=f,i[17]=h,i[18]=l,i[19]=g,i[20]=_,i[21]=v,i[22]=y):y=i[22],y},SwitcherTrigger:r=>{let i=p(18),a,o,s,c,l,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6]):({asChild:a,children:o,className:s,"data-slot":c,type:u,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u);let d=a?n:`button`,f;i[7]===c?f=i[8]:(f=t(c,`sidebar-switcher-trigger`),i[7]=c,i[8]=f);let m=a?u:u??`button`,h;i[9]===s?h=i[10]:(h=e(`text-body hover:text-strong hover:bg-neutral-500/10 flex w-full min-w-0 items-center gap-2 rounded-[0.625rem] py-1 pr-1.5 pl-1 text-left font-medium transition-none`,`data-state-open:bg-neutral-500/15 data-state-open:text-strong`,`ring-focus-accent focus:outline-hidden focus-visible:ring-4`,`*:first:size-7`,`group-data-[state=collapsed]/sidebar-nav:w-9`,`group-data-[state=collapsed]/sidebar-nav:p-1`,`group-data-[state=collapsed]/sidebar-nav:[&>:not(:first-child)]:sr-only`,s),i[9]=s,i[10]=h);let g;return i[11]!==d||i[12]!==o||i[13]!==l||i[14]!==f||i[15]!==m||i[16]!==h?(g=S(d,{"data-slot":f,type:m,className:h,...l,children:o}),i[11]=d,i[12]=o,i[13]=l,i[14]=f,i[15]=m,i[16]=h,i[17]=g):g=i[17],g},Tooltip:e=>{let n=p(26),r,i,a,o,s,c;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],c=n[6]):({children:r,"data-slot":i,label:a,shortcut:s,side:c,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s,n[6]=c);let l=c===void 0?`right`:c,{isMobile:u,open:d}=O(`Tooltip`),m=!u&&!d,[h,g]=y(!1),[_,v]=y(m);_!==m&&(v(m),g(!1));let b;n[7]===m?b=n[8]:(b=e=>{g(e&&m)},n[7]=m,n[8]=b);let x=b,w=m&&h,T;n[9]===r?T=n[10]:(T=S(f.Trigger,{asChild:!0,children:r}),n[9]=r,n[10]=T);let E;n[11]===i?E=n[12]:(E=t(i,`sidebar-tooltip`),n[11]=i,n[12]=E);let D;n[13]!==a||n[14]!==s?(D=S(F,{label:a,shortcut:s}),n[13]=a,n[14]=s,n[15]=D):D=n[15];let k;n[16]!==o||n[17]!==l||n[18]!==E||n[19]!==D?(k=S(f.Content,{"data-slot":E,side:l,...o,children:D}),n[16]=o,n[17]=l,n[18]=E,n[19]=D,n[20]=k):k=n[20];let A;return n[21]!==x||n[22]!==w||n[23]!==T||n[24]!==k?(A=C(f.Root,{disableHoverableContent:!0,onOpenChange:x,open:w,children:[T,k]}),n[21]=x,n[22]=w,n[23]=T,n[24]=k,n[25]=A):A=n[25],A},Separator:n=>{let r=p(12),i,o,s;r[0]===n?(i=r[1],o=r[2],s=r[3]):({className:i,"data-slot":o,...s}=n,r[0]=n,r[1]=i,r[2]=o,r[3]=s);let c;r[4]===o?c=r[5]:(c=t(o,`sidebar-separator`),r[4]=o,r[5]=c);let l;r[6]===i?l=r[7]:(l=e(`my-3`,`group-data-[state=collapsed]/sidebar-nav:w-9`,i),r[6]=i,r[7]=l);let u;return r[8]!==s||r[9]!==c||r[10]!==l?(u=S(a,{"data-slot":c,className:l,...s}),r[8]=s,r[9]=c,r[10]=l,r[11]=u):u=r[11],u}},q=`mantle-sidebar-state`,J={collapsed:`collapsed`,expanded:`expanded`};function Y(e){let t=l(e,q);if(t===J.expanded)return!0;if(t===J.collapsed)return!1}function X(e,t={}){let{domain:n,maxAge:r=31536e3,path:i=`/`,sameSite:a=`Lax`,secure:o=!1}=t,s=e?J.expanded:J.collapsed,c=[`${q}=${s}`,`Max-Age=${r}`,`Path=${i}`];return n!=null&&c.push(`Domain=${n}`),c.push(`SameSite=${a}`),o&&c.push(`Secure`),c.join(`; `)}export{q as SIDEBAR_STATE_COOKIE_NAME,K as Sidebar,Y as extractSidebarStateCookie,X as serializeSidebarStateCookie,D as useSidebar};
|
|
1
|
+
import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-BsvE2ntj.js";import{t as r}from"./button-pwkdtR3U.js";import{n as i}from"./separator-D98be0gY.js";import{n as a,t as o}from"./use-is-apple-platform-CMPzIYjz.js";import{t as s}from"./use-callback-ref-BvVyI5K1.js";import{n as c}from"./cookie-ca4g5CKp.js";import{t as l}from"./sheet-B5x8EO9Y.js";import{i as u,t as d}from"./use-is-hydrated-after-paint-Drj0lNi4.js";import{t as f}from"./tooltip-H03l7E4Y.js";import{c as p}from"react/compiler-runtime";import{createContext as m,useContext as h,useEffect as g,useId as _,useRef as v,useState as y}from"react";import b from"tiny-invariant";import{Fragment as x,jsx as S,jsxs as C}from"react/jsx-runtime";import{SidebarSimpleIcon as w}from"@phosphor-icons/react/SidebarSimple";const T={sm:`max-sm:not-data-hydrated:hidden`,md:`max-md:not-data-hydrated:hidden`,lg:`max-lg:not-data-hydrated:hidden`},E=m(null);function D(){let e=h(E);return b(e,`useSidebar must be used within Sidebar.Root.`),e}function O(e){let t=h(E);return b(t,`Sidebar.${e} must be rendered inside Sidebar.Root.`),t}const k=[];function A(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.tagName===`SELECT`:!1}function j(){let e=Symbol(`sidebar-keyboard-shortcut`);return k.push(e),{isOwner:()=>k[0]===e,release:()=>{let t=k.indexOf(e);t!==-1&&k.splice(t,1)}}}const M=e=>{let t=p(34),{children:n,defaultOpen:r,keyboardShortcut:i,mobileBreakpoint:o,onOpenChange:c,onOpenMobileChange:l,open:d,openMobile:f}=e,m=r===void 0||r,h=i===void 0||i,b=o===void 0?`lg`:o,x=u(b),C=_(),w=d!=null,[T,D]=y(m),O=w?d:T,k;t[0]!==w||t[1]!==c?(k=e=>{w||D(e),c?.(e)},t[0]=w,t[1]=c,t[2]=k):k=t[2];let M=k,N=f!=null,[P,F]=y(!1),I=N?f:P,L;t[3]!==N||t[4]!==l?(L=e=>{N||F(e),l?.(e)},t[3]=N,t[4]=l,t[5]=L):L=t[5];let R=L,z=v(x),B,V;t[6]!==x||t[7]!==I||t[8]!==R?(B=()=>{let e=z.current&&!x;z.current=x,e&&I&&R(!1)},V=[x,I,R],t[6]=x,t[7]=I,t[8]=R,t[9]=B,t[10]=V):(B=t[9],V=t[10]),g(B,V);let H;t[11]!==x||t[12]!==O||t[13]!==I||t[14]!==M||t[15]!==R?(H=()=>{x?R(!I):M(!O)},t[11]=x,t[12]=O,t[13]=I,t[14]=M,t[15]=R,t[16]=H):H=t[16];let U=H,W=s(U),G,K;t[17]!==h||t[18]!==W?(K=()=>{if(!h)return;let e=j(),t=a(),n=n=>{if(!e.isOwner()||A(n.target))return;let r=t?n.metaKey:n.ctrlKey,i=t?n.ctrlKey:n.metaKey;n.key?.toLowerCase()===`b`&&r&&!i&&!n.altKey&&!n.shiftKey&&(n.preventDefault(),W())};return window.addEventListener(`keydown`,n),()=>{window.removeEventListener(`keydown`,n),e.release()}},G=[h,W],t[17]=h,t[18]=W,t[19]=G,t[20]=K):(G=t[19],K=t[20]),g(K,G);let q;t[21]!==x||t[22]!==h||t[23]!==b||t[24]!==C||t[25]!==O||t[26]!==I||t[27]!==M||t[28]!==R||t[29]!==U?(q={isMobile:x,keyboardShortcut:h,mobileBreakpoint:b,navId:C,open:O,openMobile:I,setOpen:M,setOpenMobile:R,toggle:U},t[21]=x,t[22]=h,t[23]=b,t[24]=C,t[25]=O,t[26]=I,t[27]=M,t[28]=R,t[29]=U,t[30]=q):q=t[30];let J=q,Y;return t[31]!==n||t[32]!==J?(Y=S(E.Provider,{value:J,children:n}),t[31]=n,t[32]=J,t[33]=Y):Y=t[33],Y},N=n=>{let r=p(48),i,a,o,s,c,u;r[0]===n?(i=r[1],a=r[2],o=r[3],s=r[4],c=r[5],u=r[6]):({"aria-label":i,"aria-labelledby":a,children:o,className:s,"data-slot":c,...u}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=c,r[6]=u);let{isMobile:f,mobileBreakpoint:m,navId:h,open:g,openMobile:_,setOpenMobile:v}=O(`Nav`),y=d(),b=i??(a==null?`Main`:void 0);if(f){let n;r[7]===c?n=r[8]:(n=t(c,`sidebar-nav`),r[7]=c,r[8]=n);let i;r[9]===a?i=r[10]:(i=a==null?null:{"aria-labelledby":a},r[9]=a,r[10]=i);let d;r[11]===s?d=r[12]:(d=e(`bg-base w-(--sidebar-width-mobile,18rem) max-w-full p-0`,s),r[11]=s,r[12]=d);let f=b??`Sidebar`,p;r[13]===f?p=r[14]:(p=S(l.Title,{className:`sr-only`,children:f}),r[13]=f,r[14]=p);let m;r[15]!==b||r[16]!==a||r[17]!==o||r[18]!==h?(m=S(`nav`,{id:h,"aria-label":b,"aria-labelledby":a,className:`flex h-full w-full min-w-0 flex-col text-sm`,children:o}),r[15]=b,r[16]=a,r[17]=o,r[18]=h,r[19]=m):m=r[19];let g;r[20]!==u||r[21]!==n||r[22]!==i||r[23]!==d||r[24]!==p||r[25]!==m?(g=C(l.Content,{side:`left`,preferredWidth:`sm:max-w-(--sidebar-width-mobile,18rem)`,"data-slot":n,"data-mobile":``,...i,className:d,...u,children:[p,m]}),r[20]=u,r[21]=n,r[22]=i,r[23]=d,r[24]=p,r[25]=m,r[26]=g):g=r[26];let y;return r[27]!==_||r[28]!==v||r[29]!==g?(y=S(l.Root,{open:_,onOpenChange:v,children:g}),r[27]=_,r[28]=v,r[29]=g,r[30]=y):y=r[30],y}let x;r[31]===c?x=r[32]:(x=t(c,`sidebar-nav`),r[31]=c,r[32]=x);let w=T[m],E;r[33]!==s||r[34]!==w?(E=e(`group/sidebar-nav bg-base relative h-full w-(--sidebar-width,13rem) shrink-0 overflow-hidden`,`data-[state=collapsed]:w-(--sidebar-width-icon,3.25rem)`,w,`transition-[width] duration-200 ease-linear motion-reduce:transition-none not-data-hydrated:transition-none`,s),r[33]=s,r[34]=w,r[35]=E):E=r[35];let D=g?`expanded`:`collapsed`,k=y?``:void 0,A;r[36]!==b||r[37]!==a||r[38]!==o||r[39]!==h?(A=S(`nav`,{id:h,"aria-label":b,"aria-labelledby":a,className:`absolute inset-y-0 left-0 flex w-full min-w-0 flex-col text-sm`,children:o}),r[36]=b,r[37]=a,r[38]=o,r[39]=h,r[40]=A):A=r[40];let j;return r[41]!==u||r[42]!==x||r[43]!==E||r[44]!==D||r[45]!==k||r[46]!==A?(j=S(`div`,{"data-slot":x,className:E,...u,"data-state":D,"data-hydrated":k,children:A}),r[41]=u,r[42]=x,r[43]=E,r[44]=D,r[45]=k,r[46]=A,r[47]=j):j=r[47],j},P=S(w,{}),F=e=>{let t=p(7),{label:n,shortcut:r}=e,i;t[0]===n?i=t[1]:(i=S(`span`,{"data-slot":`sidebar-tooltip-label`,className:`contents`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=r!=null&&S(`span`,{"aria-hidden":!0,"data-slot":`sidebar-tooltip-shortcut`,className:`inline-flex shrink-0 items-center gap-0.5 [&_kbd]:h-4 [&_kbd]:min-w-4 [&_kbd]:bg-neutral-500/25 [&_kbd]:px-0.5 [&_kbd]:text-xs`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=C(`span`,{"data-slot":`sidebar-tooltip-row`,className:`flex items-center gap-1.5`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o},I=e=>{let n=p(32),i,a,s,c,l,u,d,m;n[0]===e?(i=n[1],a=n[2],s=n[3],c=n[4],l=n[5],u=n[6],d=n[7],m=n[8]):({appearance:l,"data-slot":i,icon:u,intent:d,label:m,onClick:a,shortcut:c,...s}=e,n[0]=e,n[1]=i,n[2]=a,n[3]=s,n[4]=c,n[5]=l,n[6]=u,n[7]=d,n[8]=m);let h=l===void 0?`ghost`:l,g=u===void 0?P:u,_=d===void 0?`neutral`:d,v=m===void 0?`Toggle Sidebar`:m,{isMobile:y,keyboardShortcut:b,navId:x,open:w,openMobile:T,toggle:E}=O(`Trigger`),D=o(),k=y?T:w,A=!y||T,j=b?c:void 0,M=D?`Meta+B`:`Control+B`,N=A?x:void 0,I=b?M:void 0,L;n[9]===i?L=n[10]:(L=t(i,`sidebar-trigger`),n[9]=i,n[10]=L);let R=k?`expanded`:`collapsed`,z;n[11]!==a||n[12]!==E?(z=e=>{a?.(e),e.defaultPrevented||E()},n[11]=a,n[12]=E,n[13]=z):z=n[13];let B;n[14]!==h||n[15]!==k||n[16]!==g||n[17]!==_||n[18]!==v||n[19]!==s||n[20]!==N||n[21]!==I||n[22]!==L||n[23]!==R||n[24]!==z?(B=S(f.Trigger,{asChild:!0,children:S(r,{appearance:h,"aria-controls":N,"aria-expanded":k,"aria-keyshortcuts":I,"data-slot":L,"data-state":R,icon:g,intent:_,label:v,onClick:z,...s})}),n[14]=h,n[15]=k,n[16]=g,n[17]=_,n[18]=v,n[19]=s,n[20]=N,n[21]=I,n[22]=L,n[23]=R,n[24]=z,n[25]=B):B=n[25];let V;n[26]!==j||n[27]!==v?(V=S(f.Content,{"data-slot":`sidebar-trigger-tooltip`,children:S(F,{label:v,shortcut:j})}),n[26]=j,n[27]=v,n[28]=V):V=n[28];let H;return n[29]!==B||n[30]!==V?(H=C(f.Root,{children:[B,V]}),n[29]=B,n[30]=V,n[31]=H):H=n[31],H},L=r=>{let i=p(16),a,o,s,c,l;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?n:`div`,d;i[6]===c?d=i[7]:(d=t(c,`sidebar-header`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=e(`grid grid-cols-1 grid-rows-(--sidebar-header-height,4.5rem) shrink-0 items-center px-3`,`group-data-[state=expanded]/sidebar-nav:pr-1`,s),i[8]=s,i[9]=f);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(m=S(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=m):m=i[15],m},R=r=>{let i=p(16),a,o,s,c,l;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?n:`div`,d;i[6]===c?d=i[7]:(d=t(c,`sidebar-body`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=e(`scrollbar scrollbar-gutter-stable scroll-fade-y flex-1 scroll-py-6 space-y-2 overflow-y-auto overflow-x-hidden px-3 pt-1.5 pb-4`,`group-data-[state=expanded]/sidebar-nav:pr-1`,`group-data-[state=collapsed]/sidebar-nav:scrollbar-none`,`group-data-[state=collapsed]/sidebar-nav:scrollbar-gutter-auto`,`group-data-[state=collapsed]/sidebar-nav:[&::-webkit-scrollbar]:hidden`,s),i[8]=s,i[9]=f);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(m=S(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=m):m=i[15],m},z=r=>{let i=p(16),a,o,s,c,l;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?n:`div`,d;i[6]===c?d=i[7]:(d=t(c,`sidebar-footer`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=e(`shrink-0 px-3 pt-3 pb-3.5`,`group-data-[state=expanded]/sidebar-nav:pr-1`,s),i[8]=s,i[9]=f);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(m=S(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=m):m=i[15],m},B=m(null),V=r=>{let i=p(21),a,o,s,c,l;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let[u,d]=y(null),f;i[6]===u?f=i[7]:(f={mountedLabelId:u,setMountedLabelId:d},i[6]=u,i[7]=f);let m=f,h=a?n:`div`,g;i[8]===c?g=i[9]:(g=t(c,`sidebar-group`),i[8]=c,i[9]=g);let _;i[10]===s?_=i[11]:(_=e(`pt-0.5`,s),i[10]=s,i[11]=_);let v;i[12]!==h||i[13]!==o||i[14]!==l||i[15]!==g||i[16]!==_?(v=S(h,{"data-slot":g,className:_,...l,children:o}),i[12]=h,i[13]=o,i[14]=l,i[15]=g,i[16]=_,i[17]=v):v=i[17];let b;return i[18]!==m||i[19]!==v?(b=S(B.Provider,{value:m,children:v}),i[18]=m,i[19]=v,i[20]=b):b=i[20],b},H=r=>{let i=p(22),a,o,s,c,l,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6]):({asChild:a,children:o,className:s,"data-slot":c,id:l,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u);let d=h(B),f=_(),m=l??(d==null?void 0:f),v=d?.setMountedLabelId,y,b;i[7]!==m||i[8]!==v?(y=()=>{if(v!=null&&m!=null)return v(m),()=>{v(null)}},b=[v,m],i[7]=m,i[8]=v,i[9]=y,i[10]=b):(y=i[9],b=i[10]),g(y,b);let x=a?n:`div`,C;i[11]===c?C=i[12]:(C=t(c,`sidebar-group-label`),i[11]=c,i[12]=C);let w;i[13]===s?w=i[14]:(w=e(`text-muted flex min-w-0 items-center gap-2 truncate px-2 py-1 text-xs font-medium`,`group-data-[state=collapsed]/sidebar-nav:opacity-0`,`group-data-[state=collapsed]/sidebar-nav:pointer-events-none`,`transition-opacity duration-200 ease-linear motion-reduce:transition-none group-not-data-hydrated/sidebar-nav:transition-none`,s),i[13]=s,i[14]=w);let T;return i[15]!==x||i[16]!==o||i[17]!==m||i[18]!==u||i[19]!==C||i[20]!==w?(T=S(x,{id:m,"data-slot":C,className:w,...u,children:o}),i[15]=x,i[16]=o,i[17]=m,i[18]=u,i[19]=C,i[20]=w,i[21]=T):T=i[21],T},U=r=>{let i=p(18),a,o,s,c,l,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6]):({"aria-labelledby":a,asChild:o,children:s,className:c,"data-slot":l,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u);let d=h(B),f=o?n:`ul`,m=a??d?.mountedLabelId??void 0,g;i[7]===l?g=i[8]:(g=t(l,`sidebar-list`),i[7]=l,i[8]=g);let _;i[9]===c?_=i[10]:(_=e(`mb-2 space-y-px`,c),i[9]=c,i[10]=_);let v;return i[11]!==f||i[12]!==s||i[13]!==u||i[14]!==m||i[15]!==g||i[16]!==_?(v=S(f,{"aria-labelledby":m,"data-slot":g,className:_,...u,children:s}),i[11]=f,i[12]=s,i[13]=u,i[14]=m,i[15]=g,i[16]=_,i[17]=v):v=i[17],v},W=r=>{let i=p(16),a,o,s,c,l;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?n:`li`,d;i[6]===c?d=i[7]:(d=t(c,`sidebar-item`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=e(`list-none`,s),i[8]=s,i[9]=f);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(m=S(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=m):m=i[15],m},G=[`ring-focus-accent flex w-full min-w-0 items-center gap-2 truncate rounded-md px-2 py-1 text-left font-normal transition-none focus:outline-hidden focus-visible:ring-4`,`text-body hover:text-strong hover:bg-neutral-500/10`,`data-state-open:bg-neutral-500/15 data-state-open:text-strong`,`group-data-[state=collapsed]/sidebar-nav:ml-1`,`group-data-[state=collapsed]/sidebar-nav:w-7`,`group-data-[state=collapsed]/sidebar-nav:p-1`].join(` `),K={Root:M,Nav:N,Trigger:I,Header:L,Body:R,Footer:z,Group:V,GroupLabel:H,List:U,Item:W,ItemButton:r=>{let i=p(21),a,o,s,c,l,u,d;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6],d=i[7]):({asChild:a,children:o,className:s,current:c,"data-slot":l,type:d,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u,i[7]=d);let f=a?n:`button`,m;i[8]===l?m=i[9]:(m=t(l,`sidebar-item-button`),i[8]=l,i[9]=m);let h=c?``:void 0,g=c?`page`:void 0,_=a?d:d??`button`,v;i[10]===s?v=i[11]:(v=e(G,`data-current:bg-neutral-500/15 data-current:text-strong`,`aria-[current=page]:bg-neutral-500/15 aria-[current=page]:text-strong`,`[&>svg]:text-muted hover:[&>svg]:text-strong data-current:[&>svg]:text-strong aria-[current=page]:[&>svg]:text-strong [&>svg:first-child]:size-5 [&>svg]:shrink-0`,s),i[10]=s,i[11]=v);let y;return i[12]!==f||i[13]!==o||i[14]!==u||i[15]!==m||i[16]!==h||i[17]!==g||i[18]!==_||i[19]!==v?(y=S(f,{"data-slot":m,"data-current":h,"aria-current":g,type:_,className:v,...u,children:o}),i[12]=f,i[13]=o,i[14]=u,i[15]=m,i[16]=h,i[17]=g,i[18]=_,i[19]=v,i[20]=y):y=i[20],y},SearchTrigger:r=>{let i=p(23),a,o,s,c,l,u,d;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6],d=i[7]):({asChild:a,children:o,className:s,"data-slot":c,shortcut:u,type:d,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u,i[7]=d);let f=a?n:`button`,m;i[8]!==a||i[9]!==o||i[10]!==u?(m=a?o:C(x,{children:[S(`span`,{"data-slot":`sidebar-search-trigger-label`,className:`contents`,children:o}),S(`span`,{"aria-hidden":!0,"data-slot":`sidebar-search-trigger-shortcut`,className:e(`pointer-events-none -mr-1 ml-auto inline-flex shrink-0 items-center gap-0.5 opacity-0 select-none`,`group-hover:opacity-100 group-focus-visible:opacity-100`,`group-data-[state=collapsed]/sidebar-nav:hidden`,`[&_kbd]:text-body [&_kbd]:h-5 [&_kbd]:min-w-5 [&_kbd]:bg-neutral-500/20 [&_kbd]:px-1 [&_kbd]:text-xs [&_kbd]:font-normal`,`empty:hidden`),children:u})]}),i[8]=a,i[9]=o,i[10]=u,i[11]=m):m=i[11];let h=m,g;i[12]===c?g=i[13]:(g=t(c,`sidebar-search-trigger`),i[12]=c,i[13]=g);let _=a?d:d??`button`,v;i[14]===s?v=i[15]:(v=e(`group`,G,`[&>svg:first-child]:text-muted hover:[&>svg:first-child]:text-strong`,`[&>svg:first-child]:size-5`,`[&>[data-slot=sidebar-search-trigger-label]>svg:first-child]:text-muted`,`hover:[&>[data-slot=sidebar-search-trigger-label]>svg:first-child]:text-strong`,`[&>[data-slot=sidebar-search-trigger-label]>svg:first-child]:size-5`,`[&_svg]:shrink-0`,s),i[14]=s,i[15]=v);let y;return i[16]!==f||i[17]!==h||i[18]!==l||i[19]!==g||i[20]!==_||i[21]!==v?(y=S(f,{"data-slot":g,type:_,className:v,...l,children:h}),i[16]=f,i[17]=h,i[18]=l,i[19]=g,i[20]=_,i[21]=v,i[22]=y):y=i[22],y},SwitcherTrigger:r=>{let i=p(18),a,o,s,c,l,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6]):({asChild:a,children:o,className:s,"data-slot":c,type:u,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u);let d=a?n:`button`,f;i[7]===c?f=i[8]:(f=t(c,`sidebar-switcher-trigger`),i[7]=c,i[8]=f);let m=a?u:u??`button`,h;i[9]===s?h=i[10]:(h=e(`text-body hover:text-strong hover:bg-neutral-500/10 flex w-full min-w-0 items-center gap-2 rounded-[0.625rem] py-1 pr-1.5 pl-1 text-left font-medium transition-none`,`data-state-open:bg-neutral-500/15 data-state-open:text-strong`,`ring-focus-accent focus:outline-hidden focus-visible:ring-4`,`*:first:size-7`,`group-data-[state=collapsed]/sidebar-nav:w-9`,`group-data-[state=collapsed]/sidebar-nav:p-1`,`group-data-[state=collapsed]/sidebar-nav:[&>:not(:first-child)]:sr-only`,s),i[9]=s,i[10]=h);let g;return i[11]!==d||i[12]!==o||i[13]!==l||i[14]!==f||i[15]!==m||i[16]!==h?(g=S(d,{"data-slot":f,type:m,className:h,...l,children:o}),i[11]=d,i[12]=o,i[13]=l,i[14]=f,i[15]=m,i[16]=h,i[17]=g):g=i[17],g},Tooltip:e=>{let n=p(26),r,i,a,o,s,c;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],c=n[6]):({children:r,"data-slot":i,label:a,shortcut:s,side:c,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s,n[6]=c);let l=c===void 0?`right`:c,{isMobile:u,open:d}=O(`Tooltip`),m=!u&&!d,[h,g]=y(!1),[_,v]=y(m);_!==m&&(v(m),g(!1));let b;n[7]===m?b=n[8]:(b=e=>{g(e&&m)},n[7]=m,n[8]=b);let x=b,w=m&&h,T;n[9]===r?T=n[10]:(T=S(f.Trigger,{asChild:!0,children:r}),n[9]=r,n[10]=T);let E;n[11]===i?E=n[12]:(E=t(i,`sidebar-tooltip`),n[11]=i,n[12]=E);let D;n[13]!==a||n[14]!==s?(D=S(F,{label:a,shortcut:s}),n[13]=a,n[14]=s,n[15]=D):D=n[15];let k;n[16]!==o||n[17]!==l||n[18]!==E||n[19]!==D?(k=S(f.Content,{"data-slot":E,side:l,...o,children:D}),n[16]=o,n[17]=l,n[18]=E,n[19]=D,n[20]=k):k=n[20];let A;return n[21]!==x||n[22]!==w||n[23]!==T||n[24]!==k?(A=C(f.Root,{disableHoverableContent:!0,onOpenChange:x,open:w,children:[T,k]}),n[21]=x,n[22]=w,n[23]=T,n[24]=k,n[25]=A):A=n[25],A},Separator:n=>{let r=p(12),a,o,s;r[0]===n?(a=r[1],o=r[2],s=r[3]):({className:a,"data-slot":o,...s}=n,r[0]=n,r[1]=a,r[2]=o,r[3]=s);let c;r[4]===o?c=r[5]:(c=t(o,`sidebar-separator`),r[4]=o,r[5]=c);let l;r[6]===a?l=r[7]:(l=e(`my-3`,`group-data-[state=collapsed]/sidebar-nav:w-9`,a),r[6]=a,r[7]=l);let u;return r[8]!==s||r[9]!==c||r[10]!==l?(u=S(i,{"data-slot":c,className:l,...s}),r[8]=s,r[9]=c,r[10]=l,r[11]=u):u=r[11],u}},q=`mantle-sidebar-state`,J={collapsed:`collapsed`,expanded:`expanded`};function Y(e){let t=c(e,q);if(t===J.expanded)return!0;if(t===J.collapsed)return!1}function X(e,t={}){let{domain:n,maxAge:r=31536e3,path:i=`/`,sameSite:a=`Lax`,secure:o=!1}=t,s=e?J.expanded:J.collapsed,c=[`${q}=${s}`,`Max-Age=${r}`,`Path=${i}`];return n!=null&&c.push(`Domain=${n}`),c.push(`SameSite=${a}`),o&&c.push(`Secure`),c.join(`; `)}export{q as SIDEBAR_STATE_COOKIE_NAME,K as Sidebar,Y as extractSidebarStateCookie,X as serializeSidebarStateCookie,D as useSidebar};
|
package/dist/tabs.d.ts
CHANGED
|
@@ -1,11 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as SelfClosingWithAsChild } from "./as-child-D23mGo4f.js";
|
|
2
|
+
import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
|
|
3
|
+
import { n as Separator } from "./separator-Bo4nY_3M.js";
|
|
4
|
+
import { ComponentProps } from "react";
|
|
2
5
|
import { Content, List, Root, Trigger } from "@radix-ui/react-tabs";
|
|
3
6
|
//#region src/components/tabs/tabs.d.ts
|
|
4
7
|
/**
|
|
5
|
-
*
|
|
8
|
+
* Layered sections of content, called tab panels, that show one at a time.
|
|
6
9
|
* The outermost part; it owns `orientation` and `appearance`. It stamps both as
|
|
7
10
|
* `data-orientation` and `data-appearance` for the parts below to style against.
|
|
8
11
|
*
|
|
12
|
+
* **Data attributes:**
|
|
13
|
+
*
|
|
14
|
+
* | Data Attribute | Value | Description |
|
|
15
|
+
* | ------------------ | ------------------------------ | --------------------------------------------------------- |
|
|
16
|
+
* | `data-slot` | `"tabs"` | On the root element. |
|
|
17
|
+
* | `data-orientation` | `"horizontal"` \| `"vertical"` | The `orientation` prop. Set by Radix. |
|
|
18
|
+
* | `data-appearance` | `"classic"` \| `"pill"` | The `appearance` prop. Descendant parts style against it. |
|
|
19
|
+
*
|
|
20
|
+
* **CSS variables:**
|
|
21
|
+
*
|
|
22
|
+
* | CSS Variable | Default | Description |
|
|
23
|
+
* | ------------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
|
|
24
|
+
* | `--tabs-gap` | `1rem` | The space between the list and the content. `Tabs.Separator` pulls itself up by it, so set the variable here instead of a `gap-*` class. |
|
|
25
|
+
*
|
|
9
26
|
* @see https://mantle.ngrok.com/components/navigation/tabs#tabsroot
|
|
10
27
|
*
|
|
11
28
|
* @example
|
|
@@ -15,6 +32,7 @@ import { Content, List, Root, Trigger } from "@radix-ui/react-tabs";
|
|
|
15
32
|
* <Tabs.Trigger value="account">Account</Tabs.Trigger>
|
|
16
33
|
* <Tabs.Trigger value="password">Password</Tabs.Trigger>
|
|
17
34
|
* </Tabs.List>
|
|
35
|
+
* <Tabs.Separator />
|
|
18
36
|
* <Tabs.Content value="account">
|
|
19
37
|
* <p>Make changes to your account here.</p>
|
|
20
38
|
* </Tabs.Content>
|
|
@@ -24,7 +42,7 @@ import { Content, List, Root, Trigger } from "@radix-ui/react-tabs";
|
|
|
24
42
|
* </Tabs.Root>
|
|
25
43
|
* ```
|
|
26
44
|
*/
|
|
27
|
-
declare const Root$1: ({ className, children, orientation, appearance, ...props }: ComponentProps<typeof Root> & {
|
|
45
|
+
declare const Root$1: ({ className, children, "data-slot": dataSlot, orientation, appearance, ...props }: ComponentProps<typeof Root> & WithDataSlot & {
|
|
28
46
|
/**
|
|
29
47
|
* The appearance of the tabs. Classic appearance shows the tab
|
|
30
48
|
* list with an underline; pill appearance shows each tab as a pill.
|
|
@@ -34,11 +52,15 @@ declare const Root$1: ({ className, children, orientation, appearance, ...props
|
|
|
34
52
|
}) => import("react").JSX.Element;
|
|
35
53
|
/**
|
|
36
54
|
* Contains the triggers that are aligned along the edge of the active content.
|
|
55
|
+
* The list draws no border of its own: compose `Tabs.Separator` after it for
|
|
56
|
+
* the hairline between the triggers and the content.
|
|
57
|
+
*
|
|
58
|
+
* **Data attributes:**
|
|
37
59
|
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
60
|
+
* | Data Attribute | Value | Description |
|
|
61
|
+
* | ------------------ | ------------------------------ | ------------------------------------- |
|
|
62
|
+
* | `data-slot` | `"tabs-list"` | On the tablist element. |
|
|
63
|
+
* | `data-orientation` | `"horizontal"` \| `"vertical"` | The root's orientation. Set by Radix. |
|
|
42
64
|
*
|
|
43
65
|
* @see https://mantle.ngrok.com/components/navigation/tabs#tabslist
|
|
44
66
|
*
|
|
@@ -49,32 +71,61 @@ declare const Root$1: ({ className, children, orientation, appearance, ...props
|
|
|
49
71
|
* <Tabs.Trigger value="account">Account</Tabs.Trigger>
|
|
50
72
|
* <Tabs.Trigger value="password">Password</Tabs.Trigger>
|
|
51
73
|
* </Tabs.List>
|
|
74
|
+
* <Tabs.Separator />
|
|
52
75
|
* <Tabs.Content value="account">
|
|
53
76
|
* <p>Make changes to your account here.</p>
|
|
54
77
|
* </Tabs.Content>
|
|
55
78
|
* </Tabs.Root>
|
|
56
79
|
* ```
|
|
80
|
+
*/
|
|
81
|
+
declare const List$1: ({ className, "data-slot": dataSlot, ref, ...props }: ComponentProps<typeof List> & WithDataSlot) => import("react").JSX.Element;
|
|
82
|
+
type TabsSeparatorProps = Omit<ComponentProps<typeof Separator>, "asChild" | "children" | "orientation"> & SelfClosingWithAsChild & WithDataSlot;
|
|
83
|
+
/**
|
|
84
|
+
* The hairline between the list and the content, in the `separator` color
|
|
85
|
+
* token. Compose it directly after `Tabs.List`. It follows the root's
|
|
86
|
+
* `orientation`: a horizontal root draws it under the list, a vertical root
|
|
87
|
+
* draws it beside the list. It is a sibling of the list and not a child, so it
|
|
88
|
+
* spans the root's full width and neither scrolls nor fades with the triggers.
|
|
89
|
+
*
|
|
90
|
+
* As the root's direct child it pulls itself up by `--tabs-gap` and sits flush
|
|
91
|
+
* against the list, while the content keeps the gap. Inside a wrapper of your
|
|
92
|
+
* own, the offset stays off.
|
|
93
|
+
*
|
|
94
|
+
* The separator is decorative (`role="none"`). Pass `semantic` for
|
|
95
|
+
* `role="separator"`. Outside `Tabs.Root` it throws.
|
|
96
|
+
*
|
|
97
|
+
* **CSS variables:**
|
|
98
|
+
*
|
|
99
|
+
* | CSS Variable | Default | Description |
|
|
100
|
+
* | ------------ | ------- | --------------------------------------------------------------------------------------------- |
|
|
101
|
+
* | `--tabs-gap` | `1rem` | Read, not owned. `Tabs.Root` sets it; the separator cancels it to sit flush against the list. |
|
|
102
|
+
*
|
|
103
|
+
* **Data attributes:**
|
|
104
|
+
*
|
|
105
|
+
* | Data Attribute | Value | Description |
|
|
106
|
+
* | ------------------ | ------------------------------ | --------------------------------------------- |
|
|
107
|
+
* | `data-slot` | `"tabs-separator"` | On the separator element. |
|
|
108
|
+
* | `data-orientation` | `"horizontal"` \| `"vertical"` | The root's orientation. |
|
|
109
|
+
* | `data-separator` | present | Presence-only. Set by the mantle `Separator`. |
|
|
110
|
+
*
|
|
111
|
+
* @see https://mantle.ngrok.com/components/navigation/tabs#tabsseparator
|
|
57
112
|
*
|
|
58
113
|
* @example
|
|
59
114
|
* ```tsx
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
115
|
+
* <Tabs.Root defaultValue="account">
|
|
116
|
+
* <Tabs.List>
|
|
117
|
+
* <Tabs.Trigger value="account">Account</Tabs.Trigger>
|
|
118
|
+
* <Tabs.Trigger value="password">Password</Tabs.Trigger>
|
|
119
|
+
* </Tabs.List>
|
|
120
|
+
* <Tabs.Separator />
|
|
121
|
+
* <Tabs.Content value="account">
|
|
122
|
+
* <p>Make changes to your account here.</p>
|
|
123
|
+
* </Tabs.Content>
|
|
124
|
+
* </Tabs.Root>
|
|
65
125
|
* ```
|
|
66
126
|
*/
|
|
67
|
-
declare const
|
|
68
|
-
|
|
69
|
-
* Hide the tablist's border — the bottom border of a horizontal classic
|
|
70
|
-
* tablist, or the side border of a vertical one. Also rendered as a
|
|
71
|
-
* `data-hide-border` attribute on the tablist element. Has no effect on
|
|
72
|
-
* the pill appearance, which never draws a border.
|
|
73
|
-
* @default false
|
|
74
|
-
*/
|
|
75
|
-
hideBorder?: boolean;
|
|
76
|
-
}) => import("react").JSX.Element;
|
|
77
|
-
type TabsTriggerProps = ComponentProps<typeof Trigger>;
|
|
127
|
+
declare const TabsSeparator: ({ className, "data-slot": dataSlot, ...props }: TabsSeparatorProps) => import("react").JSX.Element;
|
|
128
|
+
type TabsTriggerProps = ComponentProps<typeof Trigger> & WithDataSlot;
|
|
78
129
|
/**
|
|
79
130
|
* The button that activates its associated content.
|
|
80
131
|
*
|
|
@@ -87,7 +138,7 @@ type TabsTriggerProps = ComponentProps<typeof Trigger>;
|
|
|
87
138
|
* so the icon, the label, and `Tabs.Badge` stay flex items of the trigger and
|
|
88
139
|
* keep its `gap`. A `[&>svg]` class of your own no longer reaches an icon you
|
|
89
140
|
* pass as a child, because that icon is now a grandchild. Match the part's own
|
|
90
|
-
* variant instead
|
|
141
|
+
* variant instead: `[&>[data-slot=tabs-trigger-label]>svg]:size-4`. A `[&_svg]`
|
|
91
142
|
* or a class on the icon loses to the default, which is more specific.
|
|
92
143
|
*
|
|
93
144
|
* **Data attributes:**
|
|
@@ -96,6 +147,9 @@ type TabsTriggerProps = ComponentProps<typeof Trigger>;
|
|
|
96
147
|
* | -------------- | ------------------------ | ------------------------------------ |
|
|
97
148
|
* | `data-slot` | `"tabs-trigger"` | On the trigger element. |
|
|
98
149
|
* | `data-slot` | `"tabs-trigger-label"` | On the `<span>` wrapping `children`. |
|
|
150
|
+
* | `data-orientation` | `"horizontal"` \| `"vertical"` | The root's orientation. Set by Radix. |
|
|
151
|
+
* | `data-state` | `"active"` \| `"inactive"` | Whether the trigger's panel is shown. Set by Radix. |
|
|
152
|
+
* | `data-disabled` | present when `disabled` | Presence-only. Set by Radix. |
|
|
99
153
|
*
|
|
100
154
|
* @see https://mantle.ngrok.com/components/navigation/tabs#tabstrigger
|
|
101
155
|
*
|
|
@@ -106,16 +160,23 @@ type TabsTriggerProps = ComponentProps<typeof Trigger>;
|
|
|
106
160
|
* <Tabs.Trigger value="account">Account</Tabs.Trigger>
|
|
107
161
|
* <Tabs.Trigger value="password">Password</Tabs.Trigger>
|
|
108
162
|
* </Tabs.List>
|
|
163
|
+
* <Tabs.Separator />
|
|
109
164
|
* <Tabs.Content value="account">
|
|
110
165
|
* <p>Make changes to your account here.</p>
|
|
111
166
|
* </Tabs.Content>
|
|
112
167
|
* </Tabs.Root>
|
|
113
168
|
* ```
|
|
114
169
|
*/
|
|
115
|
-
declare const Trigger$1: ({ "aria-disabled": _ariaDisabled, asChild, children, className, disabled: _disabled, ref, ...props }: TabsTriggerProps) => import("react").JSX.Element;
|
|
170
|
+
declare const Trigger$1: ({ "aria-disabled": _ariaDisabled, asChild, children, className, "data-slot": dataSlot, disabled: _disabled, ref, ...props }: TabsTriggerProps) => import("react").JSX.Element;
|
|
116
171
|
/**
|
|
117
172
|
* A badge to render inside a tab trigger, typically a count or a status indicator.
|
|
118
173
|
*
|
|
174
|
+
* **Data attributes:**
|
|
175
|
+
*
|
|
176
|
+
* | Data Attribute | Value | Description |
|
|
177
|
+
* | -------------- | -------------- | --------------------- |
|
|
178
|
+
* | `data-slot` | `"tabs-badge"` | On the badge element. |
|
|
179
|
+
*
|
|
119
180
|
* @see https://mantle.ngrok.com/components/navigation/tabs#tabsbadge
|
|
120
181
|
*
|
|
121
182
|
* @example
|
|
@@ -127,14 +188,23 @@ declare const Trigger$1: ({ "aria-disabled": _ariaDisabled, asChild, children, c
|
|
|
127
188
|
* </Tabs.Trigger>
|
|
128
189
|
* <Tabs.Trigger value="password">Password</Tabs.Trigger>
|
|
129
190
|
* </Tabs.List>
|
|
191
|
+
* <Tabs.Separator />
|
|
130
192
|
* </Tabs.Root>
|
|
131
193
|
* ```
|
|
132
194
|
*/
|
|
133
|
-
declare const Badge: ({ className, children, ...props }:
|
|
195
|
+
declare const Badge: ({ className, children, "data-slot": dataSlot, ...props }: ComponentProps<"span"> & WithDataSlot) => import("react").JSX.Element;
|
|
134
196
|
/**
|
|
135
197
|
* Contains the content associated with each trigger.
|
|
136
198
|
* It renders when that trigger is active.
|
|
137
199
|
*
|
|
200
|
+
* **Data attributes:**
|
|
201
|
+
*
|
|
202
|
+
* | Data Attribute | Value | Description |
|
|
203
|
+
* | ------------------ | ------------------------------ | ----------------------------------------- |
|
|
204
|
+
* | `data-slot` | `"tabs-content"` | On the panel element. |
|
|
205
|
+
* | `data-orientation` | `"horizontal"` \| `"vertical"` | The root's orientation. Set by Radix. |
|
|
206
|
+
* | `data-state` | `"active"` \| `"inactive"` | Whether the panel is shown. Set by Radix. |
|
|
207
|
+
*
|
|
138
208
|
* @see https://mantle.ngrok.com/components/navigation/tabs#tabscontent
|
|
139
209
|
*
|
|
140
210
|
* @example
|
|
@@ -144,6 +214,7 @@ declare const Badge: ({ className, children, ...props }: HTMLAttributes<HTMLSpan
|
|
|
144
214
|
* <Tabs.Trigger value="account">Account</Tabs.Trigger>
|
|
145
215
|
* <Tabs.Trigger value="password">Password</Tabs.Trigger>
|
|
146
216
|
* </Tabs.List>
|
|
217
|
+
* <Tabs.Separator />
|
|
147
218
|
* <Tabs.Content value="account">
|
|
148
219
|
* <p>Make changes to your account here.</p>
|
|
149
220
|
* </Tabs.Content>
|
|
@@ -153,9 +224,9 @@ declare const Badge: ({ className, children, ...props }: HTMLAttributes<HTMLSpan
|
|
|
153
224
|
* </Tabs.Root>
|
|
154
225
|
* ```
|
|
155
226
|
*/
|
|
156
|
-
declare const Content$1: ({ className, ...props }: ComponentProps<typeof Content>) => import("react").JSX.Element;
|
|
227
|
+
declare const Content$1: ({ className, "data-slot": dataSlot, ...props }: ComponentProps<typeof Content> & WithDataSlot) => import("react").JSX.Element;
|
|
157
228
|
/**
|
|
158
|
-
*
|
|
229
|
+
* Layered sections of content, called tab panels, that show one at a time.
|
|
159
230
|
*
|
|
160
231
|
* @see https://mantle.ngrok.com/components/navigation/tabs
|
|
161
232
|
*
|
|
@@ -166,6 +237,7 @@ declare const Content$1: ({ className, ...props }: ComponentProps<typeof Content
|
|
|
166
237
|
* ├── Tabs.List
|
|
167
238
|
* │ └── Tabs.Trigger
|
|
168
239
|
* │ └── Tabs.Badge
|
|
240
|
+
* ├── Tabs.Separator
|
|
169
241
|
* └── Tabs.Content
|
|
170
242
|
* ```
|
|
171
243
|
*
|
|
@@ -176,6 +248,7 @@ declare const Content$1: ({ className, ...props }: ComponentProps<typeof Content
|
|
|
176
248
|
* <Tabs.Trigger value="account">Account</Tabs.Trigger>
|
|
177
249
|
* <Tabs.Trigger value="password">Password</Tabs.Trigger>
|
|
178
250
|
* </Tabs.List>
|
|
251
|
+
* <Tabs.Separator />
|
|
179
252
|
* <Tabs.Content value="account">
|
|
180
253
|
* <p>Make changes to your account here.</p>
|
|
181
254
|
* </Tabs.Content>
|
|
@@ -187,10 +260,18 @@ declare const Content$1: ({ className, ...props }: ComponentProps<typeof Content
|
|
|
187
260
|
*/
|
|
188
261
|
declare const Tabs: {
|
|
189
262
|
/**
|
|
190
|
-
*
|
|
263
|
+
* Layered sections of content, called tab panels, that show one at a time.
|
|
191
264
|
* The outermost part; it owns `orientation` and `appearance`. It stamps both as
|
|
192
265
|
* `data-orientation` and `data-appearance` for the parts below to style against.
|
|
193
266
|
*
|
|
267
|
+
* **Data attributes:**
|
|
268
|
+
*
|
|
269
|
+
* | Data Attribute | Value | Description |
|
|
270
|
+
* | ------------------ | ------------------------------ | --------------------------------------------------------- |
|
|
271
|
+
* | `data-slot` | `"tabs"` | On the root element. |
|
|
272
|
+
* | `data-orientation` | `"horizontal"` \| `"vertical"` | The `orientation` prop. Set by Radix. |
|
|
273
|
+
* | `data-appearance` | `"classic"` \| `"pill"` | The `appearance` prop. Descendant parts style against it. |
|
|
274
|
+
*
|
|
194
275
|
* @see https://mantle.ngrok.com/components/navigation/tabs#tabsroot
|
|
195
276
|
*
|
|
196
277
|
* @example
|
|
@@ -200,6 +281,7 @@ declare const Tabs: {
|
|
|
200
281
|
* <Tabs.Trigger value="account">Account</Tabs.Trigger>
|
|
201
282
|
* <Tabs.Trigger value="password">Password</Tabs.Trigger>
|
|
202
283
|
* </Tabs.List>
|
|
284
|
+
* <Tabs.Separator />
|
|
203
285
|
* <Tabs.Content value="account">
|
|
204
286
|
* <p>Make changes to your account here.</p>
|
|
205
287
|
* </Tabs.Content>
|
|
@@ -211,6 +293,14 @@ declare const Tabs: {
|
|
|
211
293
|
* Contains the content associated with each trigger.
|
|
212
294
|
* It renders when that trigger is active.
|
|
213
295
|
*
|
|
296
|
+
* **Data attributes:**
|
|
297
|
+
*
|
|
298
|
+
* | Data Attribute | Value | Description |
|
|
299
|
+
* | ------------------ | ------------------------------ | ----------------------------------------- |
|
|
300
|
+
* | `data-slot` | `"tabs-content"` | On the panel element. |
|
|
301
|
+
* | `data-orientation` | `"horizontal"` \| `"vertical"` | The root's orientation. Set by Radix. |
|
|
302
|
+
* | `data-state` | `"active"` \| `"inactive"` | Whether the panel is shown. Set by Radix. |
|
|
303
|
+
*
|
|
214
304
|
* @see https://mantle.ngrok.com/components/navigation/tabs#tabscontent
|
|
215
305
|
*
|
|
216
306
|
* @example
|
|
@@ -219,6 +309,7 @@ declare const Tabs: {
|
|
|
219
309
|
* <Tabs.List>
|
|
220
310
|
* <Tabs.Trigger value="account">Account</Tabs.Trigger>
|
|
221
311
|
* </Tabs.List>
|
|
312
|
+
* <Tabs.Separator />
|
|
222
313
|
* <Tabs.Content value="account">
|
|
223
314
|
* <p>Make changes to your account here.</p>
|
|
224
315
|
* </Tabs.Content>
|
|
@@ -228,10 +319,15 @@ declare const Tabs: {
|
|
|
228
319
|
readonly Content: typeof Content$1;
|
|
229
320
|
/**
|
|
230
321
|
* Contains the triggers that are aligned along the edge of the active content.
|
|
322
|
+
* The list draws no border of its own: compose `Tabs.Separator` after it for
|
|
323
|
+
* the hairline between the triggers and the content.
|
|
324
|
+
*
|
|
325
|
+
* **Data attributes:**
|
|
231
326
|
*
|
|
232
|
-
*
|
|
233
|
-
*
|
|
234
|
-
* `
|
|
327
|
+
* | Data Attribute | Value | Description |
|
|
328
|
+
* | ------------------ | ------------------------------ | ------------------------------------- |
|
|
329
|
+
* | `data-slot` | `"tabs-list"` | On the tablist element. |
|
|
330
|
+
* | `data-orientation` | `"horizontal"` \| `"vertical"` | The root's orientation. Set by Radix. |
|
|
235
331
|
*
|
|
236
332
|
* @see https://mantle.ngrok.com/components/navigation/tabs#tabslist
|
|
237
333
|
*
|
|
@@ -242,10 +338,42 @@ declare const Tabs: {
|
|
|
242
338
|
* <Tabs.Trigger value="account">Account</Tabs.Trigger>
|
|
243
339
|
* <Tabs.Trigger value="password">Password</Tabs.Trigger>
|
|
244
340
|
* </Tabs.List>
|
|
341
|
+
* <Tabs.Separator />
|
|
245
342
|
* </Tabs.Root>
|
|
246
343
|
* ```
|
|
247
344
|
*/
|
|
248
345
|
readonly List: typeof List$1;
|
|
346
|
+
/**
|
|
347
|
+
* The hairline between the list and the content, in the `separator` color
|
|
348
|
+
* token. Compose it directly after `Tabs.List`. It follows the root's
|
|
349
|
+
* `orientation`: a horizontal root draws it under the list, a vertical root
|
|
350
|
+
* draws it beside the list. It is a sibling of the list and not a child, so it
|
|
351
|
+
* spans the root's full width and neither scrolls nor fades with the triggers.
|
|
352
|
+
*
|
|
353
|
+
* As the root's direct child it pulls itself up by `--tabs-gap` and sits flush
|
|
354
|
+
* against the list, while the content keeps the gap. Inside a wrapper of your
|
|
355
|
+
* own, the offset stays off.
|
|
356
|
+
*
|
|
357
|
+
* The separator is decorative (`role="none"`). Pass `semantic` for
|
|
358
|
+
* `role="separator"`. Outside `Tabs.Root` it throws.
|
|
359
|
+
*
|
|
360
|
+
* @see https://mantle.ngrok.com/components/navigation/tabs#tabsseparator
|
|
361
|
+
*
|
|
362
|
+
* @example
|
|
363
|
+
* ```tsx
|
|
364
|
+
* <Tabs.Root defaultValue="account">
|
|
365
|
+
* <Tabs.List>
|
|
366
|
+
* <Tabs.Trigger value="account">Account</Tabs.Trigger>
|
|
367
|
+
* <Tabs.Trigger value="password">Password</Tabs.Trigger>
|
|
368
|
+
* </Tabs.List>
|
|
369
|
+
* <Tabs.Separator />
|
|
370
|
+
* <Tabs.Content value="account">
|
|
371
|
+
* <p>Make changes to your account here.</p>
|
|
372
|
+
* </Tabs.Content>
|
|
373
|
+
* </Tabs.Root>
|
|
374
|
+
* ```
|
|
375
|
+
*/
|
|
376
|
+
readonly Separator: typeof TabsSeparator;
|
|
249
377
|
/**
|
|
250
378
|
* The button that activates its associated content.
|
|
251
379
|
*
|
|
@@ -258,7 +386,7 @@ declare const Tabs: {
|
|
|
258
386
|
* so the icon, the label, and `Tabs.Badge` stay flex items of the trigger and
|
|
259
387
|
* keep its `gap`. A `[&>svg]` class of your own no longer reaches an icon you
|
|
260
388
|
* pass as a child, because that icon is now a grandchild. Match the part's own
|
|
261
|
-
* variant instead
|
|
389
|
+
* variant instead: `[&>[data-slot=tabs-trigger-label]>svg]:size-4`. A `[&_svg]`
|
|
262
390
|
* or a class on the icon loses to the default, which is more specific.
|
|
263
391
|
*
|
|
264
392
|
* **Data attributes:**
|
|
@@ -267,6 +395,9 @@ declare const Tabs: {
|
|
|
267
395
|
* | -------------- | ------------------------ | ------------------------------------ |
|
|
268
396
|
* | `data-slot` | `"tabs-trigger"` | On the trigger element. |
|
|
269
397
|
* | `data-slot` | `"tabs-trigger-label"` | On the `<span>` wrapping `children`. |
|
|
398
|
+
* | `data-orientation` | `"horizontal"` \| `"vertical"` | The root's orientation. Set by Radix. |
|
|
399
|
+
* | `data-state` | `"active"` \| `"inactive"` | Whether the trigger's panel is shown. Set by Radix. |
|
|
400
|
+
* | `data-disabled` | present when `disabled` | Presence-only. Set by Radix. |
|
|
270
401
|
*
|
|
271
402
|
* @see https://mantle.ngrok.com/components/navigation/tabs#tabstrigger
|
|
272
403
|
*
|
|
@@ -277,6 +408,7 @@ declare const Tabs: {
|
|
|
277
408
|
* <Tabs.Trigger value="account">Account</Tabs.Trigger>
|
|
278
409
|
* <Tabs.Trigger value="password">Password</Tabs.Trigger>
|
|
279
410
|
* </Tabs.List>
|
|
411
|
+
* <Tabs.Separator />
|
|
280
412
|
* </Tabs.Root>
|
|
281
413
|
* ```
|
|
282
414
|
*/
|
|
@@ -284,6 +416,12 @@ declare const Tabs: {
|
|
|
284
416
|
/**
|
|
285
417
|
* A badge to render inside a tab trigger, typically a count or a status indicator.
|
|
286
418
|
*
|
|
419
|
+
* **Data attributes:**
|
|
420
|
+
*
|
|
421
|
+
* | Data Attribute | Value | Description |
|
|
422
|
+
* | -------------- | -------------- | --------------------- |
|
|
423
|
+
* | `data-slot` | `"tabs-badge"` | On the badge element. |
|
|
424
|
+
*
|
|
287
425
|
* @see https://mantle.ngrok.com/components/navigation/tabs#tabsbadge
|
|
288
426
|
*
|
|
289
427
|
* @example
|
|
@@ -294,6 +432,7 @@ declare const Tabs: {
|
|
|
294
432
|
* Account <Tabs.Badge>5</Tabs.Badge>
|
|
295
433
|
* </Tabs.Trigger>
|
|
296
434
|
* </Tabs.List>
|
|
435
|
+
* <Tabs.Separator />
|
|
297
436
|
* </Tabs.Root>
|
|
298
437
|
* ```
|
|
299
438
|
*/
|
package/dist/tabs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./compose-refs-sFdxsL7k.js";import{t}from"./cx-0HCjnNv1.js";import{t as n}from"./booleanish-BfvnW6vy.js";import{t as
|
|
1
|
+
import{n as e}from"./compose-refs-sFdxsL7k.js";import{t}from"./cx-0HCjnNv1.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{t as r}from"./booleanish-BfvnW6vy.js";import{t as i}from"./clsx-DUGZgXfJ.js";import{n as a}from"./separator-D98be0gY.js";import{t as o}from"./use-prefers-reduced-motion-Cj9tJ181.js";import{c as s}from"react/compiler-runtime";import{Children as c,cloneElement as l,createContext as u,isValidElement as d,useContext as f,useEffect as p,useRef as m}from"react";import h from"tiny-invariant";import{Fragment as g,jsx as _,jsxs as v}from"react/jsx-runtime";import{cva as y}from"class-variance-authority";import{Content as b,List as x,Root as S,Trigger as C}from"@radix-ui/react-tabs";const w=u(null);function T(e){let t=f(w);return h(t!=null,`${e} must be rendered inside Tabs.Root.`),t}const E=e=>{let r=s(25),i,a,o,c,l,u;r[0]===e?(i=r[1],a=r[2],o=r[3],c=r[4],l=r[5],u=r[6]):({className:a,children:i,"data-slot":o,orientation:l,appearance:u,...c}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=c,r[5]=l,r[6]=u);let d=l===void 0?`horizontal`:l,f=u===void 0?`classic`:u,p;r[7]!==f||r[8]!==d?(p={orientation:d,appearance:f},r[7]=f,r[8]=d,r[9]=p):p=r[9];let m=p,h;r[10]===o?h=r[11]:(h=n(o,`tabs`),r[10]=o,r[11]=h);let g=d===`horizontal`?`flex-col`:`flex-row`,v;r[12]!==a||r[13]!==g?(v=t(`flex [--tabs-gap:--spacing(4)] gap-(--tabs-gap)`,g,a),r[12]=a,r[13]=g,r[14]=v):v=r[14];let y;r[15]!==f||r[16]!==i||r[17]!==d||r[18]!==c||r[19]!==h||r[20]!==v?(y=_(S,{"data-slot":h,"data-appearance":f,className:v,orientation:d,...c,children:i}),r[15]=f,r[16]=i,r[17]=d,r[18]=c,r[19]=h,r[20]=v,r[21]=y):y=r[21];let b;return r[22]!==m||r[23]!==y?(b=_(w.Provider,{value:m,children:y}),r[22]=m,r[23]=y,r[24]=b):b=r[24],b},D=y(`flex`,{variants:{orientation:{horizontal:`scroll-fade-x flex-row items-center overflow-x-auto overscroll-x-none self-stretch min-w-0 pt-1 -mt-1 px-1 -mx-1`,vertical:`flex-col items-end gap-3.5 self-stretch`},appearance:{classic:``,pill:``}},compoundVariants:[{orientation:`horizontal`,appearance:`pill`,className:`gap-1 pb-1 -mb-1`},{orientation:`horizontal`,appearance:`classic`,className:`gap-6`}]}),O=r=>{let i=s(20),a,c,l,u;i[0]===r?(a=i[1],c=i[2],l=i[3],u=i[4]):({className:a,"data-slot":c,ref:u,...l}=r,i[0]=r,i[1]=a,i[2]=c,i[3]=l,i[4]=u);let{orientation:d,appearance:f}=T(`Tabs.List`),h=m(null),g=e(h,u),v,y;i[5]===d?(v=i[6],y=i[7]):(v=()=>{let e=h.current;if(!e||d!==`horizontal`)return;let t=new AbortController,{signal:n}=t,r=!1;e.addEventListener(`pointerdown`,()=>{r=!0},{signal:n});let i=()=>{r=!1};return e.addEventListener(`pointerup`,i,{signal:n}),e.addEventListener(`pointercancel`,i,{signal:n}),e.addEventListener(`keydown`,i,{signal:n}),e.addEventListener(`focusin`,t=>{if(!r&&t.target instanceof Element&&t.target!==e){let e=o()?`auto`:`smooth`;t.target.scrollIntoView({behavior:e,inline:`center`,block:`nearest`})}},{signal:n}),()=>{t.abort()}},y=[d],i[5]=d,i[6]=v,i[7]=y),p(v,y);let b;i[8]===c?b=i[9]:(b=n(c,`tabs-list`),i[8]=c,i[9]=b);let S;i[10]!==f||i[11]!==a||i[12]!==d?(S=t(D({orientation:d,appearance:f}),a),i[10]=f,i[11]=a,i[12]=d,i[13]=S):S=i[13];let C;return i[14]!==g||i[15]!==d||i[16]!==l||i[17]!==b||i[18]!==S?(C=_(x,{"aria-orientation":d,"data-slot":b,className:S,ref:g,...l}),i[14]=g,i[15]=d,i[16]=l,i[17]=b,i[18]=S,i[19]=C):C=i[19],C},k=e=>{let r=s(14),i,o,c;r[0]===e?(i=r[1],o=r[2],c=r[3]):({className:i,"data-slot":o,...c}=e,r[0]=e,r[1]=i,r[2]=o,r[3]=c);let{orientation:l}=T(`Tabs.Separator`),u=l===`horizontal`?`[[data-slot~=tabs]>&]:-mt-(--tabs-gap)`:`h-auto self-stretch [[data-slot~=tabs]>&]:-ml-(--tabs-gap)`,d;r[4]===o?d=r[5]:(d=n(o,`tabs-separator`),r[4]=o,r[5]=d);let f;r[6]!==i||r[7]!==u?(f=t(u,i),r[6]=i,r[7]=u,r[8]=f):f=r[8];let p;return r[9]!==l||r[10]!==c||r[11]!==d||r[12]!==f?(p=_(a,{"data-slot":d,orientation:l,className:f,...c}),r[9]=l,r[10]=c,r[11]=d,r[12]=f,r[13]=p):p=r[13],p},A=y(`absolute z-0`,{variants:{orientation:{horizontal:`bottom-0 left-0 right-0 h-0.75`,vertical:`-right-px bottom-0 top-0 w-0.75`},appearance:{classic:`group-data-state-active/tab-trigger:bg-neutral-950`,pill:`hidden`}}}),j=()=>{let e=s(5),{orientation:t,appearance:n}=T(`Tabs.Trigger`),r;e[0]!==n||e[1]!==t?(r=i(A({orientation:t,appearance:n})),e[0]=n,e[1]=t,e[2]=r):r=e[2];let a;return e[3]===r?a=e[4]:(a=_(`span`,{"aria-hidden":!0,className:r}),e[3]=r,e[4]=a),a},M=y(t(`group/tab-trigger relative flex cursor-pointer items-center gap-1 whitespace-nowrap py-3 text-sm font-medium text-gray-600`,`ring-focus-accent outline-hidden`,`aria-disabled:cursor-default aria-disabled:opacity-50`,`focus-visible:ring-4`,`[&>[data-slot=tabs-trigger-label]>svg]:shrink-0 [&>[data-slot=tabs-trigger-label]>svg]:size-5`,`not-aria-disabled:hover:text-gray-900`),{variants:{orientation:{horizontal:`rounded-tl-md rounded-tr-md`,vertical:`rounded-bl-md rounded-tl-md pr-3`},appearance:{classic:t(`not-aria-disabled:hover:data-state-active:text-strong`,`data-state-active:text-strong`),pill:t(`not-aria-disabled:hover:data-state-active:text-strong`,`not-aria-disabled:hover:data-state-active:bg-neutral-500/15`,`data-state-active:text-strong`,`data-state-active:bg-neutral-500/15`,`rounded-full py-2 px-3`)}}}),N={Root:E,Content:e=>{let r=s(12),i,a,o;r[0]===e?(i=r[1],a=r[2],o=r[3]):({className:i,"data-slot":a,...o}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o);let c;r[4]===a?c=r[5]:(c=n(a,`tabs-content`),r[4]=a,r[5]=c);let l;r[6]===i?l=r[7]:(l=t(`focus-visible:ring-focus-accent outline-hidden focus-visible:ring-4`,i),r[6]=i,r[7]=l);let u;return r[8]!==o||r[9]!==c||r[10]!==l?(u=_(b,{"data-slot":c,className:l,...o}),r[8]=o,r[9]=c,r[10]=l,r[11]=u):u=r[11],u},List:O,Separator:k,Trigger:e=>{let i=s(44),a,o,u,f,p,m,y,b;i[0]===e?(a=i[1],o=i[2],u=i[3],f=i[4],p=i[5],m=i[6],y=i[7],b=i[8]):({"aria-disabled":a,asChild:b,children:u,className:f,"data-slot":p,disabled:o,ref:y,...m}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=u,i[4]=f,i[5]=p,i[6]=m,i[7]=y,i[8]=b);let x=b!==void 0&&b,{orientation:S,appearance:w}=T(`Tabs.Trigger`),E=a??o,D;i[9]===E?D=i[10]:(D=r(E),i[9]=E,i[10]=D);let O=D,k=a??o,A;i[11]!==w||i[12]!==f||i[13]!==S?(A=t(M({orientation:S,appearance:w}),f),i[11]=w,i[12]=f,i[13]=S,i[14]=A):A=i[14];let N;i[15]===p?N=i[16]:(N=n(p,`tabs-trigger`),i[15]=p,i[16]=N);let P;i[17]!==O||i[18]!==m||i[19]!==k||i[20]!==A||i[21]!==N?(P={"aria-disabled":k,className:A,"data-slot":N,disabled:O,...m},i[17]=O,i[18]=m,i[19]=k,i[20]=A,i[21]=N,i[22]=P):P=i[22];let F=P;if(x){let e;i[23]===u?e=i[24]:(e=c.only(u),h(d(e),"When using `asChild`, TabsTrigger must be passed a single child as a JSX tag."),i[23]=u,i[24]=e);let t=e.props?.children,n;if(i[25]!==O||i[26]!==t||i[27]!==y||i[28]!==e||i[29]!==F){let r=O?{href:void 0,to:void 0}:{},a;i[31]!==O||i[32]!==e?(a=O?_(`button`,{type:`button`}):e,i[31]=O,i[32]=e,i[33]=a):a=i[33];let o;i[34]===Symbol.for(`react.memo_cache_sentinel`)?(o=_(j,{}),i[34]=o):o=i[34];let s;i[35]===t?s=i[36]:(s=v(g,{children:[o,_(`span`,{"data-slot":`tabs-trigger-label`,className:`contents`,children:t})]}),i[35]=t,i[36]=s),n=_(C,{asChild:!0,...F,ref:y,children:l(a,r,s)}),i[25]=O,i[26]=t,i[27]=y,i[28]=e,i[29]=F,i[30]=n}else n=i[30];return n}let I;i[37]===Symbol.for(`react.memo_cache_sentinel`)?(I=_(j,{}),i[37]=I):I=i[37];let L;i[38]===u?L=i[39]:(L=_(`span`,{"data-slot":`tabs-trigger-label`,className:`contents`,children:u}),i[38]=u,i[39]=L);let R;return i[40]!==y||i[41]!==L||i[42]!==F?(R=v(C,{ref:y,...F,children:[I,L]}),i[40]=y,i[41]=L,i[42]=F,i[43]=R):R=i[43],R},Badge:e=>{let r=s(14),i,a,o,c;r[0]===e?(i=r[1],a=r[2],o=r[3],c=r[4]):({className:a,children:i,"data-slot":o,...c}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=c);let l;r[5]===o?l=r[6]:(l=n(o,`tabs-badge`),r[5]=o,r[6]=l);let u;r[7]===a?u=r[8]:(u=t(`rounded-full bg-neutral-500/20 px-1.5 text-xs font-medium text-gray-600`,`group-data-state-active/tab-trigger:bg-neutral-950/10 group-data-state-active/tab-trigger:text-strong group-hover/tab-trigger:group-enabled/tab-trigger:group-data-state-active/tab-trigger:text-strong`,`group-hover/tab-trigger:group-enabled/tab-trigger:text-gray-700`,a),r[7]=a,r[8]=u);let d;return r[9]!==i||r[10]!==c||r[11]!==l||r[12]!==u?(d=_(`span`,{"data-slot":l,className:u,...c,children:i}),r[9]=i,r[10]=c,r[11]=l,r[12]=u,r[13]=d):d=r[13],d}};export{N as Tabs};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e}from"react/compiler-runtime";import{useEffect as t,useState as n,useSyncExternalStore as r}from"react";const i=[`2xl`,`xl`,`lg`,`md`,`sm`,`xs`,`2xs`],a=[`default`,...i];function o(){return r(S,C,s)}function s(){return`default`}function c(t){let n=e(4),i;n[0]===t?i=n[1]:(i=T(t),n[0]=t,n[1]=i);let a;return n[2]===t?a=n[3]:(a=D(t),n[2]=t,n[3]=a),r(i,a,l)}function l(){return!1}const u={"2xl":`(min-width: 96rem)`,xl:`(min-width: 80rem)`,lg:`(min-width: 64rem)`,md:`(min-width: 48rem)`,sm:`(min-width: 40rem)`,xs:`(min-width: 30rem)`,"2xs":`(min-width: 22.5rem)`},d={"2xl":`(max-width: 95.99rem)`,xl:`(max-width: 79.99rem)`,lg:`(max-width: 63.99rem)`,md:`(max-width: 47.99rem)`,sm:`(max-width: 39.99rem)`,xs:`(max-width: 29.99rem)`,"2xs":`(max-width: 22.49rem)`};let f=null,p=null;function m(){return f||={"2xl":window.matchMedia(u[`2xl`]),xl:window.matchMedia(u.xl),lg:window.matchMedia(u.lg),md:window.matchMedia(u.md),sm:window.matchMedia(u.sm),xs:window.matchMedia(u.xs),"2xs":window.matchMedia(u[`2xs`])},f}function h(e){return p||={"2xl":window.matchMedia(d[`2xl`]),xl:window.matchMedia(d.xl),lg:window.matchMedia(d.lg),md:window.matchMedia(d.md),sm:window.matchMedia(d.sm),xs:window.matchMedia(d.xs),"2xs":window.matchMedia(d[`2xs`])},p[e]}let g=`default`;const _=new Set;let v=!1;function y(){let e=m();for(let t of i)if(e[t].matches)return t;return`default`}let b=!1;function x(){b||(b=!0,requestAnimationFrame(()=>{b=!1;let e=y();if(e!==g){g=e;for(let e of _)e()}}))}function S(e){if(_.add(e),!v){v=!0;let e=m();g=y();for(let t of Object.values(e))t.addEventListener(`change`,x)}return e(),()=>{if(_.delete(e),_.size===0&&v){v=!1;let e=m();for(let t of Object.values(e))t.removeEventListener(`change`,x)}}}function C(){return v||(g=y()),g}const w=new Map;function T(e){let t=w.get(e);return t||(t=t=>{let n=h(e),r=!1,i=()=>{r||(r=!0,requestAnimationFrame(()=>{r=!1,t()}))};return n.addEventListener(`change`,i),()=>{n.removeEventListener(`change`,i)}},w.set(e,t),t)}const E=new Map;function D(e){let t=E.get(e);return t||(t=()=>h(e).matches,E.set(e,t),t)}function O(){let r=e(2),[i,a]=n(!1),o,s;return r[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>{let e=requestAnimationFrame(()=>{a(!0)});return()=>{cancelAnimationFrame(e)}},s=[],r[0]=o,r[1]=s):(o=r[0],s=r[1]),t(o,s),i}export{c as i,a as n,o as r,O as t};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngrok/mantle",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.88.0",
|
|
4
4
|
"description": "mantle is ngrok's UI library and design system.",
|
|
5
5
|
"homepage": "https://mantle.ngrok.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
"d3-scale": "4.0.2",
|
|
140
140
|
"d3-shape": "3.2.0",
|
|
141
141
|
"input-otp": "1.5.0",
|
|
142
|
-
"react-day-picker": "10.0.
|
|
142
|
+
"react-day-picker": "10.0.2",
|
|
143
143
|
"sonner": "2.0.8",
|
|
144
144
|
"tiny-invariant": "1.3.3",
|
|
145
145
|
"tw-animate-css": "1.4.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as e}from"react/compiler-runtime";import{useSyncExternalStore as t}from"react";const n=[`2xl`,`xl`,`lg`,`md`,`sm`,`xs`,`2xs`],r=[`default`,...n];function i(){return t(b,x,a)}function a(){return`default`}function o(n){let r=e(4),i;r[0]===n?i=r[1]:(i=C(n),r[0]=n,r[1]=i);let a;return r[2]===n?a=r[3]:(a=T(n),r[2]=n,r[3]=a),t(i,a,s)}function s(){return!1}const c={"2xl":`(min-width: 96rem)`,xl:`(min-width: 80rem)`,lg:`(min-width: 64rem)`,md:`(min-width: 48rem)`,sm:`(min-width: 40rem)`,xs:`(min-width: 30rem)`,"2xs":`(min-width: 22.5rem)`},l={"2xl":`(max-width: 95.99rem)`,xl:`(max-width: 79.99rem)`,lg:`(max-width: 63.99rem)`,md:`(max-width: 47.99rem)`,sm:`(max-width: 39.99rem)`,xs:`(max-width: 29.99rem)`,"2xs":`(max-width: 22.49rem)`};let u=null,d=null;function f(){return u||={"2xl":window.matchMedia(c[`2xl`]),xl:window.matchMedia(c.xl),lg:window.matchMedia(c.lg),md:window.matchMedia(c.md),sm:window.matchMedia(c.sm),xs:window.matchMedia(c.xs),"2xs":window.matchMedia(c[`2xs`])},u}function p(e){return d||={"2xl":window.matchMedia(l[`2xl`]),xl:window.matchMedia(l.xl),lg:window.matchMedia(l.lg),md:window.matchMedia(l.md),sm:window.matchMedia(l.sm),xs:window.matchMedia(l.xs),"2xs":window.matchMedia(l[`2xs`])},d[e]}let m=`default`;const h=new Set;let g=!1;function _(){let e=f();for(let t of n)if(e[t].matches)return t;return`default`}let v=!1;function y(){v||(v=!0,requestAnimationFrame(()=>{v=!1;let e=_();if(e!==m){m=e;for(let e of h)e()}}))}function b(e){if(h.add(e),!g){g=!0;let e=f();m=_();for(let t of Object.values(e))t.addEventListener(`change`,y)}return e(),()=>{if(h.delete(e),h.size===0&&g){g=!1;let e=f();for(let t of Object.values(e))t.removeEventListener(`change`,y)}}}function x(){return g||(m=_()),m}const S=new Map;function C(e){let t=S.get(e);return t||(t=t=>{let n=p(e),r=!1,i=()=>{r||(r=!0,requestAnimationFrame(()=>{r=!1,t()}))};return n.addEventListener(`change`,i),()=>{n.removeEventListener(`change`,i)}},S.set(e,t),t)}const w=new Map;function T(e){let t=w.get(e);return t||(t=()=>p(e).matches,w.set(e,t),t)}export{i as n,o as r,r as t};
|