@constructive-io/ui 0.14.1 → 0.15.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/{ai-B08ufcbD.cjs → ai-DpeOFEwx.cjs} +9 -10
- package/dist/ai-DpeOFEwx.cjs.map +1 -0
- package/dist/{ai-4JrVVL3q.js → ai-b5y3Iqy4.js} +9 -10
- package/dist/ai-b5y3Iqy4.js.map +1 -0
- package/dist/components/ai/index.cjs +1 -1
- package/dist/components/ai/index.js +1 -1
- package/dist/components/autocomplete.cjs +1 -1
- package/dist/components/autocomplete.js +1 -1
- package/dist/components/badge.d.cts +2 -2
- package/dist/components/badge.d.ts +2 -2
- package/dist/components/button.cjs +2 -2
- package/dist/components/button.cjs.map +1 -1
- package/dist/components/button.d.cts +2 -2
- package/dist/components/button.d.ts +2 -2
- package/dist/components/button.js +2 -2
- package/dist/components/button.js.map +1 -1
- package/dist/components/card.d.cts +1 -1
- package/dist/components/card.d.ts +1 -1
- package/dist/components/combobox.cjs +1 -1
- package/dist/components/combobox.js +1 -1
- package/dist/components/command.cjs +1 -1
- package/dist/components/command.js +1 -1
- package/dist/components/dropdown-menu.cjs +8 -7
- package/dist/components/dropdown-menu.cjs.map +1 -1
- package/dist/components/dropdown-menu.js +8 -7
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/input-group.cjs +2 -2
- package/dist/components/input-group.cjs.map +1 -1
- package/dist/components/input-group.js +2 -2
- package/dist/components/input-group.js.map +1 -1
- package/dist/components/input-otp.cjs +5 -2
- package/dist/components/input-otp.cjs.map +1 -1
- package/dist/components/input-otp.js +5 -2
- package/dist/components/input-otp.js.map +1 -1
- package/dist/components/item.d.cts +1 -1
- package/dist/components/item.d.ts +1 -1
- package/dist/components/multi-select.cjs +1 -1
- package/dist/components/multi-select.js +1 -1
- package/dist/components/select.cjs +5 -5
- package/dist/components/select.cjs.map +1 -1
- package/dist/components/select.js +5 -5
- package/dist/components/select.js.map +1 -1
- package/dist/components/sheet.cjs +1 -1
- package/dist/components/sheet.js +1 -1
- package/dist/components/sidebar.cjs +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/stack/index.d.cts +1 -1
- package/dist/components/stack/index.d.ts +1 -1
- package/dist/components/toggle-group.cjs +6 -2
- package/dist/components/toggle-group.cjs.map +1 -1
- package/dist/components/toggle-group.js +6 -2
- package/dist/components/toggle-group.js.map +1 -1
- package/dist/components/workspace-kit/index.cjs +1 -1
- package/dist/components/workspace-kit/index.js +1 -1
- package/dist/{fluid-highlight-YWFRZXsw.cjs → fluid-highlight-B8olepSM.cjs} +7 -5
- package/dist/fluid-highlight-B8olepSM.cjs.map +1 -0
- package/dist/{fluid-highlight-CNELHV8o.js → fluid-highlight-BXVfWNk9.js} +7 -5
- package/dist/fluid-highlight-BXVfWNk9.js.map +1 -0
- package/dist/{index-B7cT7gZU.d.cts → index-BzLmDsId.d.cts} +3 -3
- package/dist/{index-B7cT7gZU.d.ts → index-BzLmDsId.d.ts} +3 -3
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/{sheet-OxWlnT_G.cjs → sheet-CGFqOAoI.cjs} +2 -2
- package/dist/{sheet-OxWlnT_G.cjs.map → sheet-CGFqOAoI.cjs.map} +1 -1
- package/dist/{sheet-wPF_l9Cn.js → sheet-LOK_d8-K.js} +2 -2
- package/dist/{sheet-wPF_l9Cn.js.map → sheet-LOK_d8-K.js.map} +1 -1
- package/dist/{sidebar-DWl1Azyv.js → sidebar-BNZkdIvO.js} +2 -2
- package/dist/{sidebar-DWl1Azyv.js.map → sidebar-BNZkdIvO.js.map} +1 -1
- package/dist/{sidebar-BEEWmJwC.cjs → sidebar-Bt7qXsqo.cjs} +2 -2
- package/dist/{sidebar-BEEWmJwC.cjs.map → sidebar-Bt7qXsqo.cjs.map} +1 -1
- package/package.json +2 -2
- package/dist/ai-4JrVVL3q.js.map +0 -1
- package/dist/ai-B08ufcbD.cjs.map +0 -1
- package/dist/fluid-highlight-CNELHV8o.js.map +0 -1
- package/dist/fluid-highlight-YWFRZXsw.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fluid-highlight-BXVfWNk9.js","names":[],"sources":["../src/lib/motion/fluid-highlight.tsx"],"sourcesContent":["'use client';\n\nimport { useCallback, useEffect, useState } from 'react';\nimport { motion, useReducedMotion } from 'motion/react';\n\nimport { cn } from '../utils';\nimport { useSpringTiers } from './tuning';\n\ninterface Rect {\n\ttop: number;\n\tleft: number;\n\twidth: number;\n\theight: number;\n}\n\n/**\n * Base UI toggles a bare `data-highlighted` attribute; cmdk uses\n * `data-selected=\"true\"`; Toggle/ToggleGroup mark the active item with\n * `data-pressed`. The `:not([...=\"false\"])` guards cover components\n * like multi-select that render the attribute explicitly as \"false\".\n */\nconst TARGET_SELECTOR =\n\t'[data-highlighted]:not([data-highlighted=\"false\"]), [data-selected=\"true\"], [data-pressed]:not([data-pressed=\"false\"])';\nconst OBSERVED_ATTRIBUTES = ['data-highlighted', 'data-selected', 'data-pressed'];\n\n/**\n * Where `target` sits inside `container`, in the container's own unscaled pixels. Popups scale in from 95%, and a\n * transform changes no attribute or size to re-measure on, so a rect read on the first frame is shrunken; dividing\n * by the container's current scale gives the size and offset it settles at. Pass `box` when the caller has already\n * measured the container.\n */\nexport function unscaledRect(target: Element, container: HTMLElement, box = container.getBoundingClientRect()): Rect {\n\tconst t = target.getBoundingClientRect();\n\tconst scaleX = box.width / container.offsetWidth || 1;\n\tconst scaleY = box.height / container.offsetHeight || 1;\n\treturn {\n\t\ttop: (t.top - box.top) / scaleY,\n\t\tleft: (t.left - box.left) / scaleX,\n\t\twidth: t.width / scaleX,\n\t\theight: t.height / scaleY,\n\t};\n}\n\n/**\n * Track the highlighted descendant of `container` and return its rect in the\n * container's padding-box coordinates. Updates on highlight changes, DOM\n * mutations, and any nested scroll (scroll doesn't bubble, so capture).\n */\nfunction useFluidHighlight(container: HTMLElement | null): { rect: Rect; visible: boolean } | null {\n\tconst [state, setState] = useState<{ rect: Rect; visible: boolean } | null>(null);\n\n\tuseEffect(() => {\n\t\tif (!container) return;\n\n\t\tconst update = () => {\n\t\t\tconst target = container.querySelector<HTMLElement>(TARGET_SELECTOR);\n\t\t\tif (!target) {\n\t\t\t\tsetState((s) => (s ? { ...s, visible: false } : s));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Unscaled, or a popup still scaling in leaves the highlight at the shrunken size of its first frame.\n\t\t\tconst offset = unscaledRect(target, container);\n\t\t\tsetState({\n\t\t\t\trect: {\n\t\t\t\t\t...offset,\n\t\t\t\t\ttop: offset.top - container.clientTop + container.scrollTop,\n\t\t\t\t\tleft: offset.left - container.clientLeft,\n\t\t\t\t},\n\t\t\t\tvisible: true,\n\t\t\t});\n\t\t};\n\n\t\tupdate();\n\t\tconst observer = new MutationObserver(update);\n\t\tobserver.observe(container, {\n\t\t\tattributes: true,\n\t\t\tattributeFilter: OBSERVED_ATTRIBUTES,\n\t\t\tchildList: true,\n\t\t\tsubtree: true,\n\t\t});\n\t\t// Re-measure on resize too — items can reflow without attribute changes.\n\t\t// ResizeObserver is absent in jsdom and some embedded webviews.\n\t\tconst resizeObserver =\n\t\t\ttypeof ResizeObserver === 'undefined' ? null : new ResizeObserver(update);\n\t\tresizeObserver?.observe(container);\n\t\tcontainer.addEventListener('scroll', update, { capture: true, passive: true });\n\t\treturn () => {\n\t\t\tobserver.disconnect();\n\t\t\tresizeObserver?.disconnect();\n\t\t\tcontainer.removeEventListener('scroll', update, { capture: true });\n\t\t};\n\t}, [container]);\n\n\treturn state;\n}\n\n/**\n * Traveling highlight for menu/list popups — slides under whichever item is\n * `[data-highlighted]` (Base UI) or `[data-selected=\"true\"]` (cmdk) instead of\n * flashing a per-item background. Render as the first child of a `relative`\n * container; positioned siblings paint on top. No props needed — it locates\n * its own parent as the tracking container.\n *\n * Appears and moves instantly by default: a list highlight follows the pointer and the\n * arrow keys, the most frequent interactions in a menu, so it must never trail behind\n * them. `travel` slides it on the dial-tunable fast spring tier instead, for a selection\n * indicator the user changes deliberately (a toggle group). Reduced motion never travels.\n */\nexport function FluidHighlight({\n\tclassName,\n\tinset = 0,\n\ttravel = false,\n}: {\n\tclassName?: string;\n\tinset?: number;\n\t/** Slide between targets on a spring (a selection indicator), instead of moving at once. */\n\ttravel?: boolean;\n}) {\n\t// offsetParent is the containing block this span is positioned against —\n\t// measuring the target in the same coordinate space keeps rect math exact\n\t// whether the container itself scrolls or sits inside scrolled content.\n\tconst [container, setContainer] = useState<HTMLElement | null>(null);\n\tconst state = useFluidHighlight(container);\n\tconst reduce = useReducedMotion();\n\tconst tier = useSpringTiers().fast;\n\n\t// Stable, so React doesn't detach and reattach it (and set state again) on every render.\n\tconst mountRef = useCallback((el: HTMLElement | null) => {\n\t\tsetContainer((el?.offsetParent as HTMLElement | null) ?? el?.parentElement ?? null);\n\t}, []);\n\n\tconst rect = state\n\t\t? {\n\t\t\t\ttop: state.rect.top + inset,\n\t\t\t\tleft: state.rect.left + inset,\n\t\t\t\twidth: state.rect.width - inset * 2,\n\t\t\t\theight: state.rect.height - inset * 2,\n\t\t\t}\n\t\t: null;\n\n\treturn (\n\t\t// Remount on idle→tracking so the pill fades in at the target instead of\n\t\t// sliding from (0,0) — `initial` only applies on mount.\n\t\t<motion.span\n\t\t\tkey={state ? 'tracking' : 'idle'}\n\t\t\tref={mountRef}\n\t\t\taria-hidden\n\t\t\tclassName={cn('pointer-events-none absolute rounded-sm bg-accent', className)}\n\t\t\tinitial={rect ? { ...rect, opacity: 0 } : false}\n\t\t\tanimate={rect ? { ...rect, opacity: state?.visible ? 1 : 0 } : { opacity: 0 }}\n\t\t\ttransition={\n\t\t\t\treduce || !travel ? { duration: 0 } : { type: 'spring', visualDuration: tier.duration, bounce: tier.bounce }\n\t\t\t}\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;AAqBA,MAAM,kBACL;AACD,MA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;EAClE;CACD,GAAG,CAAC,SAAS,CAAC;CAEd,OAAO;AACR;;;;;;;;;;;;;AAcA,SAAgB,eAAe,EAC9B,WACA,QAAQ,GACR,SAAS,SAMP;CAIF,MAAM,CAAC,WAAW,gBAAgB,SAA6B,IAAI;CACnE,MAAM,QAAQ,kBAAkB,SAAS;CACzC,MAAM,SAAS,iBAAiB;CAChC,MAAM,OAAO,eAAe,CAAC,CAAC;CAG9B,MAAM,WAAW,aAAa,OAA2B;EACxD,aAAc,IAAI,gBAAuC,IAAI,iBAAiB,IAAI;CACnF,GAAG,CAAC,CAAC;CAEL,MAAM,OAAO,QACV;EACA,KAAK,MAAM,KAAK,MAAM;EACtB,MAAM,MAAM,KAAK,OAAO;EACxB,OAAO,MAAM,KAAK,QAAQ,QAAQ;EAClC,QAAQ,MAAM,KAAK,SAAS,QAAQ;CACrC,IACC;CAEH,OAGC,oBAAC,OAAO,MAAR;EAEC,KAAK;EACL;EACA,WAAW,GAAG,qDAAqD,SAAS;EAC5E,SAAS,OAAO;GAAE,GAAG;GAAM,SAAS;EAAE,IAAI;EAC1C,SAAS,OAAO;GAAE,GAAG;GAAM,SAAS,OAAO,UAAU,IAAI;EAAE,IAAI,EAAE,SAAS,EAAE;EAC5E,YACC,UAAU,CAAC,SAAS,EAAE,UAAU,EAAE,IAAI;GAAE,MAAM;GAAU,gBAAgB,KAAK;GAAU,QAAQ,KAAK;EAAO;CAE5G,GATK,QAAQ,aAAa,MAS1B;AAEH"}
|
|
@@ -361,7 +361,7 @@ declare function useCardReady(): {
|
|
|
361
361
|
};
|
|
362
362
|
//#endregion
|
|
363
363
|
//#region src/components/stack/stack-viewport.d.ts
|
|
364
|
-
declare function CardStackViewport({ backdrop, renderBackdrop, renderHeader, renderEmpty, peekDepth, animation, mobile, peekGestures, className }: CardStackViewportProps): string | number | bigint | boolean |
|
|
364
|
+
declare function CardStackViewport({ backdrop, renderBackdrop, renderHeader, renderEmpty, peekDepth, animation, mobile, peekGestures, className }: CardStackViewportProps): string | number | bigint | boolean | Iterable<React$2.ReactNode> | Promise<string | number | bigint | boolean | React$2.ReactPortal | React$2.ReactElement<unknown, string | React$2.JSXElementConstructor<any>> | Iterable<React$2.ReactNode> | null | undefined> | React$2.JSX.Element | null | undefined;
|
|
365
365
|
//#endregion
|
|
366
366
|
//#region src/components/stack/stack-backdrop.d.ts
|
|
367
367
|
type StackBackdropProps = {
|
|
@@ -510,7 +510,7 @@ interface DeferredCardContentProps {
|
|
|
510
510
|
* </DeferredCardContent>
|
|
511
511
|
* ```
|
|
512
512
|
*/
|
|
513
|
-
declare function DeferredCardContent({ children, placeholder, delay, immediate, priority, onReady }: DeferredCardContentProps): string | number | bigint | boolean |
|
|
513
|
+
declare function DeferredCardContent({ children, placeholder, delay, immediate, priority, onReady }: DeferredCardContentProps): string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react").JSX.Element;
|
|
514
514
|
//#endregion
|
|
515
515
|
//#region src/components/stack/use-stack-responsive.d.ts
|
|
516
516
|
type UseStackResponsiveOptions = MobileConfig;
|
|
@@ -690,4 +690,4 @@ declare function createReducedMotionVariants(): Variants;
|
|
|
690
690
|
declare const reducedMotionBackdropVariants: Variants;
|
|
691
691
|
//#endregion
|
|
692
692
|
export { useStackLayoutMode as $, useIsMobile as A, StackHeaderSlot as B, isCardVisible as C, UsePeekGesturesResult as D, UsePeekGesturesOptions as E, StackCardProps as F, CardStackProvider as G, StackBackdrop as H, UseStackGesturesResult as I, useCardReady as J, useCardIndex as K, useStackGestures as L, DeferredCardContent as M, DeferredCardContentProps as N, usePeekGestures as O, StackCard as P, useStackContext as Q, StackHeader as R, getVisibleCardIndices as S, parseWidthToPixels as T, StackBackdropProps as U, StackHeaderSlotProps as V, CardStackViewport as W, useIsTopCard as X, useCardStack as Y, useStackCards as Z, getCardOffset as _, PushOptions as _t, createExitTransition as a, CardPushOptions as at, getResponsiveCardOffset as b, StackState as bt, peekDragSpring as c, CardSpec as ct, reducedMotionBackdropVariants as d, CardStackViewportProps as dt, AnimationConfig as et, snapBackSpring as f, DismissOptions as ft, calculateResponsiveOffset as g, PeekGestureConfig as gt, ResponsiveOffsetResult as h, MobileConfig as ht, createEnterTransition as i, CardInjectedProps as it, useStackResponsive as j, UseStackResponsiveResult as k, peekHoverSpring as l, CardStackApi as lt, ResponsiveOffsetConfig as m, LayoutMode as mt, backdropVariants as n, CardComponent as nt, createOffsetTransition as o, CardRouteDefinition as ot, swipeDismissTransition as p, GestureConfig as pt, useCardInjectedProps as q, createCardVariants as r, CardId as rt, createReducedMotionVariants as s, CardRouteMap as st, DEFAULT_ANIMATION_CONFIG as t, BackdropConfig as tt, peekSlideSpring as u, CardStackProviderProps as ut, getCardZIndex as v, StackAction as vt, normalizeWidth as w, getSideBySideOffset as x, getCascadeOffset as y, StackContextValue as yt, StackHeaderProps as z };
|
|
693
|
-
//# sourceMappingURL=index-
|
|
693
|
+
//# sourceMappingURL=index-BzLmDsId.d.cts.map
|
|
@@ -361,7 +361,7 @@ declare function useCardReady(): {
|
|
|
361
361
|
};
|
|
362
362
|
//#endregion
|
|
363
363
|
//#region src/components/stack/stack-viewport.d.ts
|
|
364
|
-
declare function CardStackViewport({ backdrop, renderBackdrop, renderHeader, renderEmpty, peekDepth, animation, mobile, peekGestures, className }: CardStackViewportProps): string | number | bigint | boolean |
|
|
364
|
+
declare function CardStackViewport({ backdrop, renderBackdrop, renderHeader, renderEmpty, peekDepth, animation, mobile, peekGestures, className }: CardStackViewportProps): string | number | bigint | boolean | Iterable<React$2.ReactNode> | Promise<string | number | bigint | boolean | React$2.ReactPortal | React$2.ReactElement<unknown, string | React$2.JSXElementConstructor<any>> | Iterable<React$2.ReactNode> | null | undefined> | React$2.JSX.Element | null | undefined;
|
|
365
365
|
//#endregion
|
|
366
366
|
//#region src/components/stack/stack-backdrop.d.ts
|
|
367
367
|
type StackBackdropProps = {
|
|
@@ -510,7 +510,7 @@ interface DeferredCardContentProps {
|
|
|
510
510
|
* </DeferredCardContent>
|
|
511
511
|
* ```
|
|
512
512
|
*/
|
|
513
|
-
declare function DeferredCardContent({ children, placeholder, delay, immediate, priority, onReady }: DeferredCardContentProps): string | number | bigint | boolean |
|
|
513
|
+
declare function DeferredCardContent({ children, placeholder, delay, immediate, priority, onReady }: DeferredCardContentProps): string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react").JSX.Element;
|
|
514
514
|
//#endregion
|
|
515
515
|
//#region src/components/stack/use-stack-responsive.d.ts
|
|
516
516
|
type UseStackResponsiveOptions = MobileConfig;
|
|
@@ -690,4 +690,4 @@ declare function createReducedMotionVariants(): Variants;
|
|
|
690
690
|
declare const reducedMotionBackdropVariants: Variants;
|
|
691
691
|
//#endregion
|
|
692
692
|
export { useStackLayoutMode as $, useIsMobile as A, StackHeaderSlot as B, isCardVisible as C, UsePeekGesturesResult as D, UsePeekGesturesOptions as E, StackCardProps as F, CardStackProvider as G, StackBackdrop as H, UseStackGesturesResult as I, useCardReady as J, useCardIndex as K, useStackGestures as L, DeferredCardContent as M, DeferredCardContentProps as N, usePeekGestures as O, StackCard as P, useStackContext as Q, StackHeader as R, getVisibleCardIndices as S, parseWidthToPixels as T, StackBackdropProps as U, StackHeaderSlotProps as V, CardStackViewport as W, useIsTopCard as X, useCardStack as Y, useStackCards as Z, getCardOffset as _, PushOptions as _t, createExitTransition as a, CardPushOptions as at, getResponsiveCardOffset as b, StackState as bt, peekDragSpring as c, CardSpec as ct, reducedMotionBackdropVariants as d, CardStackViewportProps as dt, AnimationConfig as et, snapBackSpring as f, DismissOptions as ft, calculateResponsiveOffset as g, PeekGestureConfig as gt, ResponsiveOffsetResult as h, MobileConfig as ht, createEnterTransition as i, CardInjectedProps as it, useStackResponsive as j, UseStackResponsiveResult as k, peekHoverSpring as l, CardStackApi as lt, ResponsiveOffsetConfig as m, LayoutMode as mt, backdropVariants as n, CardComponent as nt, createOffsetTransition as o, CardRouteDefinition as ot, swipeDismissTransition as p, GestureConfig as pt, useCardInjectedProps as q, createCardVariants as r, CardId as rt, createReducedMotionVariants as s, CardRouteMap as st, DEFAULT_ANIMATION_CONFIG as t, BackdropConfig as tt, peekSlideSpring as u, CardStackProviderProps as ut, getCardZIndex as v, StackAction as vt, normalizeWidth as w, getSideBySideOffset as x, getCascadeOffset as y, StackContextValue as yt, StackHeaderProps as z };
|
|
693
|
-
//# sourceMappingURL=index-
|
|
693
|
+
//# sourceMappingURL=index-BzLmDsId.d.ts.map
|
package/dist/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
3
3
|
const require_utils = require('./utils-CzTQ3-VI.cjs');
|
|
4
4
|
const require_slot = require('./slot-C-jEfihz.cjs');
|
|
5
5
|
const require_initials = require('./initials-DSkWTOb0.cjs');
|
|
6
|
-
const require_sheet = require('./sheet-
|
|
6
|
+
const require_sheet = require('./sheet-CGFqOAoI.cjs');
|
|
7
7
|
const require_motion_config = require('./motion-config-DZ7w5Uhq.cjs');
|
|
8
8
|
const require_tuning = require('./tuning-BRPG7U1U.cjs');
|
|
9
9
|
const require_theme = require('./theme.cjs');
|
|
@@ -61,7 +61,7 @@ const require_components_multi_select = require('./components/multi-select.cjs')
|
|
|
61
61
|
const require_components_tags = require('./components/tags.cjs');
|
|
62
62
|
const require_record_picker = require('./record-picker-BQ1-Vx0g.cjs');
|
|
63
63
|
const require_components_stepper = require('./components/stepper.cjs');
|
|
64
|
-
const require_sidebar = require('./sidebar-
|
|
64
|
+
const require_sidebar = require('./sidebar-Bt7qXsqo.cjs');
|
|
65
65
|
const require_components_calendar_rac = require('./components/calendar-rac.cjs');
|
|
66
66
|
const require_json_input = require('./json-input-D8yM578l.cjs');
|
|
67
67
|
const require_components_sonner = require('./components/sonner.cjs');
|
|
@@ -75,7 +75,7 @@ const require_components_responsive_diagram = require('./components/responsive-d
|
|
|
75
75
|
const require_components_unlink_button = require('./components/unlink-button.cjs');
|
|
76
76
|
const require_stack = require('./stack-CEvmUSwF.cjs');
|
|
77
77
|
const require_toast = require('./toast-08jF1DBQ.cjs');
|
|
78
|
-
const require_ai = require('./ai-
|
|
78
|
+
const require_ai = require('./ai-DpeOFEwx.cjs');
|
|
79
79
|
let _constructive_io_ui_portal = require("@constructive-io/ui/portal");
|
|
80
80
|
|
|
81
81
|
exports.Accordion = require_components_accordion.Accordion;
|
package/dist/index.d.cts
CHANGED
|
@@ -55,7 +55,7 @@ import { Skeleton, SkeletonProps } from "./components/skeleton.cjs";
|
|
|
55
55
|
import { Slider, SliderProps } from "./components/slider.cjs";
|
|
56
56
|
import { Toaster } from "./components/sonner.cjs";
|
|
57
57
|
import { Spinner, SpinnerProps } from "./components/spinner.cjs";
|
|
58
|
-
import { $ as useStackLayoutMode, A as useIsMobile, B as StackHeaderSlot, C as isCardVisible, D as UsePeekGesturesResult, E as UsePeekGesturesOptions, F as StackCardProps, G as CardStackProvider, H as StackBackdrop, I as UseStackGesturesResult, J as useCardReady, K as useCardIndex, L as useStackGestures, M as DeferredCardContent, N as DeferredCardContentProps, O as usePeekGestures, P as StackCard, Q as useStackContext, R as StackHeader, S as getVisibleCardIndices, T as parseWidthToPixels, U as StackBackdropProps, V as StackHeaderSlotProps, W as CardStackViewport, X as useIsTopCard, Y as useCardStack, Z as useStackCards, _ as getCardOffset, _t as PushOptions, a as createExitTransition, at as CardPushOptions, b as getResponsiveCardOffset, bt as StackState, c as peekDragSpring, ct as CardSpec, d as reducedMotionBackdropVariants, dt as CardStackViewportProps, et as AnimationConfig, f as snapBackSpring, ft as DismissOptions, g as calculateResponsiveOffset, gt as PeekGestureConfig, h as ResponsiveOffsetResult, ht as MobileConfig, i as createEnterTransition, it as CardInjectedProps, j as useStackResponsive, k as UseStackResponsiveResult, l as peekHoverSpring, lt as CardStackApi, m as ResponsiveOffsetConfig, mt as LayoutMode, n as backdropVariants, nt as CardComponent, o as createOffsetTransition, ot as CardRouteDefinition, p as swipeDismissTransition, pt as GestureConfig, q as useCardInjectedProps, r as createCardVariants, rt as CardId, s as createReducedMotionVariants, st as CardRouteMap, t as DEFAULT_ANIMATION_CONFIG, tt as BackdropConfig, u as peekSlideSpring, ut as CardStackProviderProps, v as getCardZIndex, vt as StackAction, w as normalizeWidth, x as getSideBySideOffset, y as getCascadeOffset, yt as StackContextValue, z as StackHeaderProps } from "./index-
|
|
58
|
+
import { $ as useStackLayoutMode, A as useIsMobile, B as StackHeaderSlot, C as isCardVisible, D as UsePeekGesturesResult, E as UsePeekGesturesOptions, F as StackCardProps, G as CardStackProvider, H as StackBackdrop, I as UseStackGesturesResult, J as useCardReady, K as useCardIndex, L as useStackGestures, M as DeferredCardContent, N as DeferredCardContentProps, O as usePeekGestures, P as StackCard, Q as useStackContext, R as StackHeader, S as getVisibleCardIndices, T as parseWidthToPixels, U as StackBackdropProps, V as StackHeaderSlotProps, W as CardStackViewport, X as useIsTopCard, Y as useCardStack, Z as useStackCards, _ as getCardOffset, _t as PushOptions, a as createExitTransition, at as CardPushOptions, b as getResponsiveCardOffset, bt as StackState, c as peekDragSpring, ct as CardSpec, d as reducedMotionBackdropVariants, dt as CardStackViewportProps, et as AnimationConfig, f as snapBackSpring, ft as DismissOptions, g as calculateResponsiveOffset, gt as PeekGestureConfig, h as ResponsiveOffsetResult, ht as MobileConfig, i as createEnterTransition, it as CardInjectedProps, j as useStackResponsive, k as UseStackResponsiveResult, l as peekHoverSpring, lt as CardStackApi, m as ResponsiveOffsetConfig, mt as LayoutMode, n as backdropVariants, nt as CardComponent, o as createOffsetTransition, ot as CardRouteDefinition, p as swipeDismissTransition, pt as GestureConfig, q as useCardInjectedProps, r as createCardVariants, rt as CardId, s as createReducedMotionVariants, st as CardRouteMap, t as DEFAULT_ANIMATION_CONFIG, tt as BackdropConfig, u as peekSlideSpring, ut as CardStackProviderProps, v as getCardZIndex, vt as StackAction, w as normalizeWidth, x as getSideBySideOffset, y as getCascadeOffset, yt as StackContextValue, z as StackHeaderProps } from "./index-BzLmDsId.cjs";
|
|
59
59
|
import { Stepper, StepperDescription, StepperIndicator, StepperItem, StepperSeparator, StepperTitle, StepperTrigger } from "./components/stepper.cjs";
|
|
60
60
|
import { Switch, SwitchProps } from "./components/switch.cjs";
|
|
61
61
|
import { Table, TableBody, TableCaption, TableCell, TableCellProps, TableFooter, TableGroupRow, TableGroupRowProps, TableHead, TableHeader, TableRow } from "./components/table.cjs";
|
package/dist/index.d.ts
CHANGED
|
@@ -55,7 +55,7 @@ import { Skeleton, SkeletonProps } from "./components/skeleton.js";
|
|
|
55
55
|
import { Slider, SliderProps } from "./components/slider.js";
|
|
56
56
|
import { Toaster } from "./components/sonner.js";
|
|
57
57
|
import { Spinner, SpinnerProps } from "./components/spinner.js";
|
|
58
|
-
import { $ as useStackLayoutMode, A as useIsMobile, B as StackHeaderSlot, C as isCardVisible, D as UsePeekGesturesResult, E as UsePeekGesturesOptions, F as StackCardProps, G as CardStackProvider, H as StackBackdrop, I as UseStackGesturesResult, J as useCardReady, K as useCardIndex, L as useStackGestures, M as DeferredCardContent, N as DeferredCardContentProps, O as usePeekGestures, P as StackCard, Q as useStackContext, R as StackHeader, S as getVisibleCardIndices, T as parseWidthToPixels, U as StackBackdropProps, V as StackHeaderSlotProps, W as CardStackViewport, X as useIsTopCard, Y as useCardStack, Z as useStackCards, _ as getCardOffset, _t as PushOptions, a as createExitTransition, at as CardPushOptions, b as getResponsiveCardOffset, bt as StackState, c as peekDragSpring, ct as CardSpec, d as reducedMotionBackdropVariants, dt as CardStackViewportProps, et as AnimationConfig, f as snapBackSpring, ft as DismissOptions, g as calculateResponsiveOffset, gt as PeekGestureConfig, h as ResponsiveOffsetResult, ht as MobileConfig, i as createEnterTransition, it as CardInjectedProps, j as useStackResponsive, k as UseStackResponsiveResult, l as peekHoverSpring, lt as CardStackApi, m as ResponsiveOffsetConfig, mt as LayoutMode, n as backdropVariants, nt as CardComponent, o as createOffsetTransition, ot as CardRouteDefinition, p as swipeDismissTransition, pt as GestureConfig, q as useCardInjectedProps, r as createCardVariants, rt as CardId, s as createReducedMotionVariants, st as CardRouteMap, t as DEFAULT_ANIMATION_CONFIG, tt as BackdropConfig, u as peekSlideSpring, ut as CardStackProviderProps, v as getCardZIndex, vt as StackAction, w as normalizeWidth, x as getSideBySideOffset, y as getCascadeOffset, yt as StackContextValue, z as StackHeaderProps } from "./index-
|
|
58
|
+
import { $ as useStackLayoutMode, A as useIsMobile, B as StackHeaderSlot, C as isCardVisible, D as UsePeekGesturesResult, E as UsePeekGesturesOptions, F as StackCardProps, G as CardStackProvider, H as StackBackdrop, I as UseStackGesturesResult, J as useCardReady, K as useCardIndex, L as useStackGestures, M as DeferredCardContent, N as DeferredCardContentProps, O as usePeekGestures, P as StackCard, Q as useStackContext, R as StackHeader, S as getVisibleCardIndices, T as parseWidthToPixels, U as StackBackdropProps, V as StackHeaderSlotProps, W as CardStackViewport, X as useIsTopCard, Y as useCardStack, Z as useStackCards, _ as getCardOffset, _t as PushOptions, a as createExitTransition, at as CardPushOptions, b as getResponsiveCardOffset, bt as StackState, c as peekDragSpring, ct as CardSpec, d as reducedMotionBackdropVariants, dt as CardStackViewportProps, et as AnimationConfig, f as snapBackSpring, ft as DismissOptions, g as calculateResponsiveOffset, gt as PeekGestureConfig, h as ResponsiveOffsetResult, ht as MobileConfig, i as createEnterTransition, it as CardInjectedProps, j as useStackResponsive, k as UseStackResponsiveResult, l as peekHoverSpring, lt as CardStackApi, m as ResponsiveOffsetConfig, mt as LayoutMode, n as backdropVariants, nt as CardComponent, o as createOffsetTransition, ot as CardRouteDefinition, p as swipeDismissTransition, pt as GestureConfig, q as useCardInjectedProps, r as createCardVariants, rt as CardId, s as createReducedMotionVariants, st as CardRouteMap, t as DEFAULT_ANIMATION_CONFIG, tt as BackdropConfig, u as peekSlideSpring, ut as CardStackProviderProps, v as getCardZIndex, vt as StackAction, w as normalizeWidth, x as getSideBySideOffset, y as getCascadeOffset, yt as StackContextValue, z as StackHeaderProps } from "./index-BzLmDsId.js";
|
|
59
59
|
import { Stepper, StepperDescription, StepperIndicator, StepperItem, StepperSeparator, StepperTitle, StepperTrigger } from "./components/stepper.js";
|
|
60
60
|
import { Switch, SwitchProps } from "./components/switch.js";
|
|
61
61
|
import { Table, TableBody, TableCaption, TableCell, TableCellProps, TableFooter, TableGroupRow, TableGroupRowProps, TableHead, TableHeader, TableRow } from "./components/table.js";
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { t as cn } from "./utils-BkMLyah9.js";
|
|
3
3
|
import { i as mergeProps, n as Slottable, r as composeRefs, t as Slot } from "./slot-EL8zfLG0.js";
|
|
4
4
|
import { t as initials } from "./initials-kCcHgrSy.js";
|
|
5
|
-
import { a as SheetDescription, d as SheetTitle, f as SheetTrigger, h as useControllableState, i as SheetContent, n as Sheet, o as SheetFooter, r as SheetClose, s as SheetHeader } from "./sheet-
|
|
5
|
+
import { a as SheetDescription, d as SheetTitle, f as SheetTrigger, h as useControllableState, i as SheetContent, n as Sheet, o as SheetFooter, r as SheetClose, s as SheetHeader } from "./sheet-LOK_d8-K.js";
|
|
6
6
|
import { a as tierSpring, i as tierExit, n as easings, o as transitions, r as springs, s as variants, t as durations } from "./motion-config-DoFp4I8f.js";
|
|
7
7
|
import { i as useSpringTiers, n as getSpringTiers, r as setSpringTiers, t as DEFAULT_SPRING_TIERS } from "./tuning-BKVFsxLr.js";
|
|
8
8
|
import { constructiveTheme } from "./theme.js";
|
|
@@ -60,7 +60,7 @@ import { MultiSelect } from "./components/multi-select.js";
|
|
|
60
60
|
import { Tags, TagsContent, TagsEmpty, TagsGroup, TagsInput, TagsItem, TagsList, TagsTrigger, TagsValue } from "./components/tags.js";
|
|
61
61
|
import { t as RecordPicker } from "./record-picker-DSRo4RXV.js";
|
|
62
62
|
import { Stepper, StepperDescription, StepperIndicator, StepperItem, StepperSeparator, StepperTitle, StepperTrigger } from "./components/stepper.js";
|
|
63
|
-
import { C as SidebarTrigger, S as SidebarSeparator, _ as SidebarMenuSub, a as SidebarGroupAction, b as SidebarProvider, c as SidebarHeader, d as SidebarMenu, f as SidebarMenuAction, g as SidebarMenuSkeleton, h as SidebarMenuItem, i as SidebarGroup, l as SidebarInput, m as SidebarMenuButton, n as SidebarContent, o as SidebarGroupContent, p as SidebarMenuBadge, r as SidebarFooter, s as SidebarGroupLabel, t as Sidebar, u as SidebarInset, v as SidebarMenuSubButton, w as useSidebar, x as SidebarRail, y as SidebarMenuSubItem } from "./sidebar-
|
|
63
|
+
import { C as SidebarTrigger, S as SidebarSeparator, _ as SidebarMenuSub, a as SidebarGroupAction, b as SidebarProvider, c as SidebarHeader, d as SidebarMenu, f as SidebarMenuAction, g as SidebarMenuSkeleton, h as SidebarMenuItem, i as SidebarGroup, l as SidebarInput, m as SidebarMenuButton, n as SidebarContent, o as SidebarGroupContent, p as SidebarMenuBadge, r as SidebarFooter, s as SidebarGroupLabel, t as Sidebar, u as SidebarInset, v as SidebarMenuSubButton, w as useSidebar, x as SidebarRail, y as SidebarMenuSubItem } from "./sidebar-BNZkdIvO.js";
|
|
64
64
|
import { Calendar, RangeCalendar } from "./components/calendar-rac.js";
|
|
65
65
|
import { n as JsonInput, r as validateJson, t as JsonEditor } from "./json-input-CH5aEmoA.js";
|
|
66
66
|
import { Toaster } from "./components/sonner.js";
|
|
@@ -74,7 +74,7 @@ import { ResponsiveDiagram } from "./components/responsive-diagram.js";
|
|
|
74
74
|
import { UnlinkButton } from "./components/unlink-button.js";
|
|
75
75
|
import { A as peekSlideSpring, B as useStackCards, C as createCardVariants, D as createReducedMotionVariants, E as createOffsetTransition, F as useCardIndex, H as useStackLayoutMode, I as useCardInjectedProps, L as useCardReady, M as snapBackSpring, N as swipeDismissTransition, O as peekDragSpring, P as CardStackProvider, R as useCardStack, S as backdropVariants, T as createExitTransition, V as useStackContext, _ as parseWidthToPixels, a as useStackGestures, b as StackBackdrop, c as calculateResponsiveOffset, d as getCascadeOffset, f as getResponsiveCardOffset, g as normalizeWidth, h as isCardVisible, i as useStackResponsive, j as reducedMotionBackdropVariants, k as peekHoverSpring, l as getCardOffset, m as getVisibleCardIndices, n as CardStackViewport, o as StackCard, p as getSideBySideOffset, r as useIsMobile, s as usePeekGestures, t as DeferredCardContent, u as getCardZIndex, v as StackHeader, w as createEnterTransition, x as DEFAULT_ANIMATION_CONFIG, y as StackHeaderSlot, z as useIsTopCard } from "./stack-Kqu7YaR0.js";
|
|
76
76
|
import { a as showErrorToast, i as showInfoToast, n as showWarningToast, r as showSuccessToast, t as toast } from "./toast-CVW5XY4u.js";
|
|
77
|
-
import { $ as useChatContainer, A as PromptSuggestions, B as normalizeToolStatus, C as TaskRow, D as DiffTable, E as PlanTracker, F as Sources, G as ThinkingTrace, H as ChainOfThoughtStep, I as ApprovalCard, J as formatDuration, K as Reasoning, L as StatusIcon, M as InlineDiff, N as lineDiff, O as StreamingText, P as Source, Q as ChatContainerContent, R as Tool, S as TaskList, T as formatCompact, U as Step, V as ChainOfThought, W as Steps, X as ScrollButton, Y as SystemMessage, Z as ChatContainer, _ as AiImage, _t as AgentLoader, a as PromptInputAttachments, at as MessageAvatar, b as ContextCard, c as UsageNotice, ct as renderBasicMarkdown, d as PromptInputTrayRow, dt as PromptInput, et as ResponseStream, f as ThinkingStatus, ft as PromptInputAction, g as iconEnterClass, gt as usePromptInput, h as MarkTile, ht as PromptInputTextarea, i as PromptInputAttachment, it as MessageActions, j as FeedbackBar, k as PromptSuggestion, l as usageTone, lt as STREAM_THROTTLE_MS, m as ToolTrace, mt as PromptInputBody, n as ConnectPrompt, nt as Message, o as CostBlocks, ot as MessageContent, p as formatElapsed, pt as PromptInputActions, q as ThinkingBar, r as AskCard, rt as MessageAction, s as ModelSelector, st as Markdown, t as AgentDraftCard, tt as CodeBlock, u as PromptInputTray, ut as useThrottledText, v as FileUpload, vt as Loader, w as ContextRing, x as ContextCards, y as RecommendationCard, yt as TextShimmer, z as ToolGroup } from "./ai-
|
|
77
|
+
import { $ as useChatContainer, A as PromptSuggestions, B as normalizeToolStatus, C as TaskRow, D as DiffTable, E as PlanTracker, F as Sources, G as ThinkingTrace, H as ChainOfThoughtStep, I as ApprovalCard, J as formatDuration, K as Reasoning, L as StatusIcon, M as InlineDiff, N as lineDiff, O as StreamingText, P as Source, Q as ChatContainerContent, R as Tool, S as TaskList, T as formatCompact, U as Step, V as ChainOfThought, W as Steps, X as ScrollButton, Y as SystemMessage, Z as ChatContainer, _ as AiImage, _t as AgentLoader, a as PromptInputAttachments, at as MessageAvatar, b as ContextCard, c as UsageNotice, ct as renderBasicMarkdown, d as PromptInputTrayRow, dt as PromptInput, et as ResponseStream, f as ThinkingStatus, ft as PromptInputAction, g as iconEnterClass, gt as usePromptInput, h as MarkTile, ht as PromptInputTextarea, i as PromptInputAttachment, it as MessageActions, j as FeedbackBar, k as PromptSuggestion, l as usageTone, lt as STREAM_THROTTLE_MS, m as ToolTrace, mt as PromptInputBody, n as ConnectPrompt, nt as Message, o as CostBlocks, ot as MessageContent, p as formatElapsed, pt as PromptInputActions, q as ThinkingBar, r as AskCard, rt as MessageAction, s as ModelSelector, st as Markdown, t as AgentDraftCard, tt as CodeBlock, u as PromptInputTray, ut as useThrottledText, v as FileUpload, vt as Loader, w as ContextRing, x as ContextCards, y as RecommendationCard, yt as TextShimmer, z as ToolGroup } from "./ai-b5y3Iqy4.js";
|
|
78
78
|
import { ModalPortalScope, PORTAL_ROOT_ID, PortalRoot, useFloatingOverlayPortalProps, useInModalOverlay, usePortalContainer, usePortalContext, useRootPortalContainer } from "@constructive-io/ui/portal";
|
|
79
79
|
|
|
80
80
|
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AgentDraftCard, AgentLoader, AiImage, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, ApprovalCard, AskCard, Autocomplete, AutocompleteEmpty, AutocompleteInput, AutocompleteItem, AutocompletePopup, AutocompleteSeparator, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardStackProvider, CardStackViewport, CardTitle, ChainOfThought, ChainOfThoughtStep, ChatContainer, ChatContainerContent, Checkbox, CheckboxGroup, CodeBlock, Collapsible, CollapsiblePanel as CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxList, ComboboxSeparator, ComboboxTrigger, Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, ConnectPrompt, ContextCard, ContextCards, ContextRing, CostBlocks, DEFAULT_ANIMATION_CONFIG, DEFAULT_SPRING_TIERS, DeferredCardContent, Dialog, DialogBackdrop, DialogClose, DialogPopup as DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogTitle, DialogTrigger, DiffTable, Dock, DockIcon, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, FeedbackBar, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldRow, FieldSeparator, FieldSet, FieldTitle, FileUpload, FlickeringGrid, FlowZoomPanel, Form, FormControl, FormControl$1 as FormControlComponent, FormDescription, FormField, FormItem, FormLabel, FormMessage, InlineDiff, Input, InputGroup, InputGroupAddon, InputGroupInput, InputGroupText, InputGroupTextarea, InputOtp, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, JsonEditor, JsonInput, Kbd, KbdGroup, Label, Loader, MarkTile, Markdown, Message, MessageAction, MessageActions, MessageAvatar, MessageContent, ModalPortalScope, ModelSelector, MotionGrid, MultiSelect, NEUTRAL_CHROMA_WEIGHTS, NEUTRAL_REFERENCE_HUE, PIN_FAMILIES, PORTAL_ROOT_ID, PageHeader, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PlanTracker, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger, PortalRoot, Progress, ProgressiveBlur, ProgressiveBlurScrollContainer, PromptInput, PromptInputAction, PromptInputActions, PromptInputAttachment, PromptInputAttachments, PromptInputBody, PromptInputTextarea, PromptInputTray, PromptInputTrayRow, PromptSuggestion, PromptSuggestions, Radio, Radio as RadioGroupItem, RadioGroup, RangeCalendar, Reasoning, RecommendationCard, RecordPicker, ResizableHandle, ResizablePanel, ResizablePanelGroup, ResponseStream, ResponsiveDiagram, STREAM_THROTTLE_MS, ScrollArea, ScrollBar, ScrollButton, Select, SelectPopup as SelectContent, SelectPopup, SelectFieldItem, SelectGroup, SelectGroupLabel, SelectGroupLabel as SelectLabel, SelectItem, SelectRichItem, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Slot, Slottable, Source, Sources, Spinner, StackBackdrop, StackCard, StackHeader, StackHeaderSlot, StatusIcon, Step, Stepper, StepperDescription, StepperIndicator, StepperItem, StepperSeparator, StepperTitle, StepperTrigger, Steps, StreamingText, Switch, SystemMessage, THEME_PRESETS, THEME_PRESET_IDS, Table, TableBody, TableCaption, TableCell, TableFooter, TableGroupRow, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tags, TagsContent, TagsEmpty, TagsGroup, TagsInput, TagsItem, TagsList, TagsTrigger, TagsValue, TaskList, TaskRow, TextShimmer, Textarea, ThinkingBar, ThinkingStatus, ThinkingTrace, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tool, ToolGroup, ToolTrace, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UnlinkButton, UsageNotice, alertVariants, backdropVariants, badgeVariants, buildThemeDialConfig, buttonGroupVariants, buttonVariants, calculateResponsiveOffset, cardVariants, cn, composeRefs, constructiveTheme, contrastRatio, createCardVariants, createEnterTransition, createExitTransition, createOffsetTransition, createReducedMotionVariants, defaultThemeTuning, deriveModeTokens, dialValuesToTuning, dockVariants, durations, easings, fitModeTuning, formatCompact, formatDuration, formatElapsed, formatOklch, getCardOffset, getCardZIndex, getCascadeOffset, getResponsiveCardOffset, getSideBySideOffset, getSpringTiers, getThemePreset, getVisibleCardIndices, iconEnterClass, initials, isCardVisible, isThemePresetId, itemMediaVariants, itemVariants, lineDiff, mergeProps, modeTuningDefaults, normalizeToolStatus, normalizeWidth, oklchToLinearSrgb, parseColor, parseOklch, parseWidthToPixels, peekDragSpring, peekHoverSpring, peekSlideSpring, reducedMotionBackdropVariants, relativeLuminance, renderBasicMarkdown, resolveThemeTuning, setSpringTiers, shadowBorderRecipe, showErrorToast, showInfoToast, showSuccessToast, showWarningToast, snapBackSpring, springs, swipeDismissTransition, themeOverrideStyleSheet, themePresetRegistryName, tierExit, tierSpring, toCssDeclarations, toast, toggleVariants, transitions, tuningToDialValues, usageTone, useCardIndex, useCardInjectedProps, useCardReady, useCardStack, useChatContainer, useControllableState, useFloatingOverlayPortalProps, useFormField, useInModalOverlay, useIsMobile, useIsTopCard, usePeekGestures, usePortalContainer, usePortalContext, usePromptInput, useRootPortalContainer, useSidebar, useSpringTiers, useStackCards, useStackContext, useStackGestures, useStackLayoutMode, useStackResponsive, useThrottledText, validateJson, variants };
|
|
@@ -373,7 +373,7 @@ function SheetContent({ side = "right", className, transition, overlay = true, s
|
|
|
373
373
|
}, `sheet-content-${sheetId}`),
|
|
374
374
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_constructive_io_ui_portal.ModalPortalScope, { children }), showClose && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_base_ui_react_dialog.Dialog.Close, {
|
|
375
375
|
"data-slot": "sheet-close",
|
|
376
|
-
className: "data-[open]:bg-secondary absolute top-4 end-4\n rounded-sm opacity-70
|
|
376
|
+
className: "data-[open]:bg-secondary absolute top-4 end-4\n rounded-sm opacity-70 hover:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50\n disabled:pointer-events-none",
|
|
377
377
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.X, { className: "h-4 w-4" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
378
378
|
className: "sr-only",
|
|
379
379
|
children: "Close"
|
|
@@ -505,4 +505,4 @@ Object.defineProperty(exports, 'useSheetStack', {
|
|
|
505
505
|
return useSheetStack;
|
|
506
506
|
}
|
|
507
507
|
});
|
|
508
|
-
//# sourceMappingURL=sheet-
|
|
508
|
+
//# sourceMappingURL=sheet-CGFqOAoI.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet-OxWlnT_G.cjs","names":["React","SheetPrimitive","cn","useSpringTiers","tierSpring","tierExit","AnimatePresence","motion","easings","scrollSafeInitialFocus","ModalPortalScope","X"],"sources":["../src/lib/use-controllable-state.ts","../src/components/sheet.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\n\ntype UseControllableStateParams<T> = {\n\tprop?: T;\n\tdefaultProp?: T;\n\tonChange?: (value: T) => void;\n};\n\n/**\n * Hook for managing controlled/uncontrolled state.\n * Supports both controlled (prop-driven) and uncontrolled (internal state) patterns.\n */\nexport function useControllableState<T>({\n\tprop,\n\tdefaultProp,\n\tonChange,\n}: UseControllableStateParams<T>): [T, (value: T) => void] {\n\tconst [uncontrolledValue, setUncontrolledValue] = useState<T>(defaultProp as T);\n\tconst isControlled = prop !== undefined;\n\tconst value = isControlled ? prop : uncontrolledValue;\n\n\t// Store onChange in ref to keep callback stable\n\tconst onChangeRef = useRef(onChange);\n\tuseEffect(() => {\n\t\tonChangeRef.current = onChange;\n\t}, [onChange]);\n\n\tconst setValue = useCallback(\n\t\t(newValue: T) => {\n\t\t\tif (!isControlled) {\n\t\t\t\tsetUncontrolledValue(newValue);\n\t\t\t}\n\t\t\tonChangeRef.current?.(newValue);\n\t\t},\n\t\t[isControlled],\n\t);\n\n\treturn [value, setValue];\n}\n","'use client';\n\nimport * as React from 'react';\nimport { Dialog as SheetPrimitive } from '@base-ui/react/dialog';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { X } from 'lucide-react';\nimport { AnimatePresence, motion, type HTMLMotionProps, type Transition } from 'motion/react';\n\nimport { scrollSafeInitialFocus } from '../lib/initial-focus';\nimport { easings, tierExit, tierSpring } from '../lib/motion/motion-config';\nimport { useSpringTiers } from '../lib/motion/tuning';\nimport { useControllableState } from '../lib/use-controllable-state';\nimport { ModalPortalScope, useRootPortalContainer } from '@constructive-io/ui/portal';\nimport { cn } from '../lib/utils';\n\n// ============================================================================\n// Sheet Stack Context - Manages nested/stacked sheets\n// ============================================================================\n\ntype SheetInfo = {\n\tid: string;\n\tdepth: number;\n\tclose: () => void;\n};\n\ntype SheetSize = {\n\twidth: number;\n\theight: number;\n};\n\ntype StackMode = 'cascade' | 'collapse';\n\ntype SheetStackContextType = {\n\tsheets: SheetInfo[];\n\tsheetSizes: Record<string, SheetSize | undefined>;\n\tstackMode: StackMode;\n\tregisterSheet: (info: SheetInfo) => void;\n\tunregisterSheet: (id: string) => void;\n\tsetSheetSize: (id: string, size: SheetSize) => void;\n\tgetSheetSize: (id: string) => SheetSize | undefined;\n\tisTopSheet: (id: string) => boolean;\n\tgetSheetsAbove: (id: string) => number;\n};\n\nconst SheetStackContext = React.createContext<SheetStackContextType | undefined>(undefined);\n\nconst SHEET_INDENT = 24; // pixels to push outer sheets when inner opens\n\ntype SheetStackProviderProps = {\n\tchildren: React.ReactNode;\n\t/** Controls how sheets are pushed when stacking.\n\t * - 'cascade' (default): Each sheet is incrementally indented by SHEET_INDENT\n\t * - 'collapse': Only the sheet directly below the top gets full-width push, others cascade relative to it\n\t */\n\tstackMode?: StackMode;\n};\n\nfunction SheetStackProvider({ children, stackMode = 'cascade' }: SheetStackProviderProps) {\n\tconst [sheets, setSheets] = React.useState<SheetInfo[]>([]);\n\tconst [sheetSizes, setSheetSizes] = React.useState<Record<string, SheetSize | undefined>>({});\n\n\t// Register sheet - insert sorted by depth (lower depth = earlier in array)\n\t// This ensures sheets are ordered correctly regardless of registration timing\n\tconst registerSheet = React.useCallback((info: SheetInfo) => {\n\t\tsetSheets((prev) => {\n\t\t\tif (prev.some((s) => s.id === info.id)) return prev;\n\t\t\t// Insert in sorted order by depth\n\t\t\tconst newSheets = [...prev, info];\n\t\t\tnewSheets.sort((a, b) => a.depth - b.depth);\n\t\t\treturn newSheets;\n\t\t});\n\t}, []);\n\n\tconst unregisterSheet = React.useCallback((id: string) => {\n\t\tsetSheets((prev) => prev.filter((s) => s.id !== id));\n\t\tsetSheetSizes((prev) => {\n\t\t\tif (!prev[id]) return prev;\n\t\t\tconst next = { ...prev };\n\t\t\tdelete next[id];\n\t\t\treturn next;\n\t\t});\n\t}, []);\n\n\tconst setSheetSize = React.useCallback((id: string, size: SheetSize) => {\n\t\tsetSheetSizes((prev) => {\n\t\t\tconst current = prev[id];\n\t\t\tif (current && current.width === size.width && current.height === size.height) return prev;\n\t\t\treturn { ...prev, [id]: size };\n\t\t});\n\t}, []);\n\n\tconst getSheetSize = React.useCallback((id: string) => sheetSizes[id], [sheetSizes]);\n\n\t// Topmost sheet = highest depth = last in sorted array\n\tconst isTopSheet = React.useCallback((id: string) => {\n\t\tif (sheets.length === 0) return false;\n\t\treturn sheets[sheets.length - 1]?.id === id;\n\t}, [sheets]);\n\n\t// Sheets above = sheets with higher depth than this one\n\tconst getSheetsAbove = React.useCallback((id: string) => {\n\t\tconst index = sheets.findIndex((s) => s.id === id);\n\t\tif (index === -1) return 0;\n\t\t// Sheets after this index have higher depth (are on top)\n\t\treturn sheets.length - index - 1;\n\t}, [sheets]);\n\n\t// Memoize value - callbacks are stable, only sheets changes\n\tconst value = React.useMemo(\n\t\t() => ({\n\t\t\tsheets,\n\t\t\tsheetSizes,\n\t\t\tstackMode,\n\t\t\tregisterSheet,\n\t\t\tunregisterSheet,\n\t\t\tsetSheetSize,\n\t\t\tgetSheetSize,\n\t\t\tisTopSheet,\n\t\t\tgetSheetsAbove,\n\t\t}),\n\t\t[sheets, sheetSizes, stackMode, registerSheet, unregisterSheet, setSheetSize, getSheetSize, isTopSheet, getSheetsAbove],\n\t);\n\n\treturn <SheetStackContext.Provider value={value}>{children}</SheetStackContext.Provider>;\n}\n\nconst useSheetStack = (): SheetStackContextType | undefined => {\n\treturn React.useContext(SheetStackContext);\n};\n\n// ============================================================================\n// Sheet Nesting Context - Tracks nesting level via React tree\n// ============================================================================\n\ntype SheetNestingContextType = {\n\tlevel: number;\n\tparentSheetId: string | null;\n};\n\nconst SheetNestingContext = React.createContext<SheetNestingContextType>({\n\tlevel: 0,\n\tparentSheetId: null,\n});\n\nconst useSheetNesting = () => React.useContext(SheetNestingContext);\n\n// ============================================================================\n// Individual Sheet Context\n// ============================================================================\n\ntype SheetContextType = {\n\tisOpen: boolean;\n\tsheetId: string;\n\tdepth: number;\n\tsheetsAbove: number;\n\tisTopSheet: boolean;\n\tclose: () => void;\n};\n\nconst SheetContext = React.createContext<SheetContextType | undefined>(undefined);\n\nconst useSheet = (): SheetContextType => {\n\tconst context = React.useContext(SheetContext);\n\tif (!context) {\n\t\tthrow new Error('useSheet must be used within a Sheet');\n\t}\n\treturn context;\n};\n\ntype DialogChangeEventDetails = Parameters<NonNullable<React.ComponentProps<typeof SheetPrimitive.Root>['onOpenChange']>>[1];\n\ntype SheetProps = Omit<React.ComponentProps<typeof SheetPrimitive.Root>, 'onOpenChange'> & {\n\t/** Unique identifier for this sheet in a stack. Auto-generated if not provided. */\n\tsheetId?: string;\n\t/** Callback when open state changes - simplified to just boolean for backwards compatibility */\n\tonOpenChange?: (open: boolean) => void;\n};\n\nfunction Sheet({\n\tchildren,\n\tsheetId: providedId,\n\topen: openProp,\n\tdefaultOpen = false,\n\tonOpenChange,\n\tmodal,\n\t...props\n}: SheetProps) {\n\tconst [isOpen, setIsOpen] = useControllableState({\n\t\tprop: openProp,\n\t\tdefaultProp: defaultOpen,\n\t\tonChange: onOpenChange,\n\t});\n\tconst sheetStack = useSheetStack();\n\tconst nesting = useSheetNesting();\n\tconst generatedId = React.useId();\n\tconst sheetId = providedId ?? `sheet-${generatedId.replace(/:/g, '')}`;\n\n\t// Depth is determined by nesting level in React tree\n\tconst depth = nesting.level;\n\n\tconst close = React.useCallback(() => {\n\t\tsetIsOpen(false);\n\t}, [setIsOpen]);\n\n\tconst registerSheet = sheetStack?.registerSheet;\n\tconst unregisterSheet = sheetStack?.unregisterSheet;\n\n\t// Register/unregister with stack when open state changes\n\tReact.useEffect(() => {\n\t\tif (registerSheet && isOpen) {\n\t\t\t// Close any open dropdowns/popovers by blurring active element\n\t\t\t// This ensures selects close before the sheet stacks on top\n\t\t\tif (document.activeElement instanceof HTMLElement) {\n\t\t\t\tdocument.activeElement.blur();\n\t\t\t}\n\t\t\tregisterSheet({ id: sheetId, depth, close });\n\t\t\treturn () => unregisterSheet?.(sheetId);\n\t\t}\n\t}, [isOpen, sheetId, depth, close, registerSheet, unregisterSheet]);\n\n\t// Base UI owns dismissal details; this adapter preserves the package's boolean callback.\n\tconst handleOpenChange = React.useCallback((open: boolean, _eventDetails: DialogChangeEventDetails) => {\n\t\tsetIsOpen(open);\n\t}, [setIsOpen]);\n\n\t// Calculate sheets above and whether this is the top sheet\n\tconst sheetsAbove = sheetStack?.getSheetsAbove(sheetId) ?? 0;\n\tconst isTopSheet = sheetStack?.isTopSheet(sheetId) ?? true;\n\n\t// Nested sheets must be non-modal to prevent Base UI from closing parent on interaction\n\tconst isNested = depth > 0;\n\n\treturn (\n\t\t<SheetNestingContext.Provider value={{ level: depth + 1, parentSheetId: sheetId }}>\n\t\t\t<SheetContext.Provider value={{ isOpen, sheetId, depth, sheetsAbove, isTopSheet, close }}>\n\t\t\t\t<SheetPrimitive.Root\n\t\t\t\t\tdata-slot=\"sheet\"\n\t\t\t\t\t{...props}\n\t\t\t\t\topen={isOpen}\n\t\t\t\t\tmodal={isNested ? false : modal}\n\t\t\t\t\tonOpenChange={handleOpenChange}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</SheetPrimitive.Root>\n\t\t\t</SheetContext.Provider>\n\t\t</SheetNestingContext.Provider>\n\t);\n}\n\ntype SheetTriggerProps = React.ComponentProps<typeof SheetPrimitive.Trigger> & {\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n};\n\nfunction SheetTrigger({ asChild, children, render, nativeButton, ...props }: SheetTriggerProps) {\n\tconst childRender = render === undefined && asChild && React.isValidElement(children) ? children : undefined;\n\n\treturn (\n\t\t<SheetPrimitive.Trigger\n\t\t\tdata-slot=\"sheet-trigger\"\n\t\t\tnativeButton={nativeButton ?? (childRender ? true : undefined)}\n\t\t\trender={render ?? childRender}\n\t\t\t{...props}\n\t\t>\n\t\t\t{childRender ? undefined : children}\n\t\t</SheetPrimitive.Trigger>\n\t);\n}\n\ntype SheetCloseProps = React.ComponentProps<typeof SheetPrimitive.Close> & {\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n};\n\nfunction SheetClose({ asChild, children, render, nativeButton, ...props }: SheetCloseProps) {\n\tconst childRender = render === undefined && asChild && React.isValidElement(children) ? children : undefined;\n\n\treturn (\n\t\t<SheetPrimitive.Close\n\t\t\tdata-slot=\"sheet-close\"\n\t\t\tnativeButton={nativeButton ?? (childRender ? true : undefined)}\n\t\t\trender={render ?? childRender}\n\t\t\t{...props}\n\t\t>\n\t\t\t{childRender ? undefined : children}\n\t\t</SheetPrimitive.Close>\n\t);\n}\n\ntype SheetPortalProps = React.ComponentProps<typeof SheetPrimitive.Portal> & {\n\t/** @deprecated Base UI manages mounting automatically */\n\tforceMount?: boolean;\n};\n\nfunction SheetPortal({ forceMount: _forceMount, container: containerProp, ...props }: SheetPortalProps) {\n\tconst rootContainer = useRootPortalContainer();\n\tconst container = containerProp === undefined ? (rootContainer ?? undefined) : containerProp;\n\n\tconst style = {\n\t\t...(props.style ?? {}),\n\t\t['--z-layer-floating' as any]: 'var(--z-layer-floating-elevated)',\n\t} satisfies React.CSSProperties;\n\n\treturn <SheetPrimitive.Portal data-slot=\"sheet-portal\" container={container} {...props} style={style} />;\n}\n\ntype SheetOverlayProps = React.HTMLAttributes<HTMLDivElement> & {\n\t/** @deprecated Base UI Backdrop handles child elements natively */\n\tasChild?: boolean;\n\t/** @deprecated Base UI manages mounting automatically */\n\tforceMount?: boolean;\n};\n\nfunction SheetOverlay({ className, asChild: _asChild, forceMount: _forceMount, ...props }: SheetOverlayProps) {\n\treturn (\n\t\t<SheetPrimitive.Backdrop\n\t\t\tdata-slot=\"sheet-overlay\"\n\t\t\tclassName={cn('fixed inset-0 z-[var(--z-layer-modal-backdrop)] bg-black/32 backdrop-blur-sm', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// The panel scrolls itself: content taller than the viewport used to be clipped with no way to reach it. Callers that manage their own\n// scroll region (a `flex-1 min-h-0 overflow-y-auto` body) are unaffected because the sheet then never overflows.\nconst sheetVariants = cva('fixed flex flex-col gap-3 overflow-y-auto overscroll-contain bg-background p-4 shadow-lg outline-hidden [overflow-wrap:break-word]', {\n\tvariants: {\n\t\tside: {\n\t\t\ttop: 'inset-x-0 top-0 max-h-dvh border-b',\n\t\t\tbottom: 'inset-x-0 bottom-0 max-h-dvh border-t',\n\t\t\tleft: 'inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm',\n\t\t\tright: 'inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm',\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tside: 'right',\n\t},\n});\n\ntype SheetContentProps = Omit<React.ComponentProps<typeof SheetPrimitive.Popup>, 'children'> &\n\tVariantProps<typeof sheetVariants> &\n\tHTMLMotionProps<'div'> & {\n\t\ttransition?: Transition;\n\t\toverlay?: boolean;\n\t\t/** Whether to show the close button. Defaults to true. */\n\t\tshowClose?: boolean;\n\t\tchildren?: React.ReactNode;\n\t\t/** @deprecated Base UI manages mounting automatically */\n\t\tforceMount?: boolean;\n\t\t/** @deprecated Use onOpenChange on Root instead */\n\t\tonInteractOutside?: (e: Event) => void;\n\t\t/** @deprecated Use onOpenChange on Root instead */\n\t\tonPointerDownOutside?: (e: Event) => void;\n\t\t/** @deprecated Use onOpenChange on Root instead */\n\t\tonEscapeKeyDown?: (e: KeyboardEvent) => void;\n\t\t/** @deprecated Use onOpenChange on Root instead */\n\t\tonFocusOutside?: (e: Event) => void;\n\t};\n\n// Default width for nested sheets (used for collapse mode calculations)\n// Using max-w-md (28rem = 448px) as the typical nested sheet width\nconst NESTED_SHEET_WIDTH = 448;\n\n// Gap between the top two visible sheets in collapse mode\nconst SHEET_STACK_GAP = 0;\n\n/**\n * Calculate the push offset based on side, number of sheets above, and stack mode.\n * - 'cascade': Each sheet is incrementally indented by SHEET_INDENT per layer above\n * - 'collapse': Bottom sheets are pushed to opposite side to make room for top sheet\n */\nfunction getPushOffset(\n\tside: 'top' | 'bottom' | 'left' | 'right',\n\tsheetsAbove: number,\n\tstackMode: StackMode = 'cascade',\n\tcollapseBaseSize: number = NESTED_SHEET_WIDTH,\n): { x?: number | string; y?: number | string } {\n\tif (sheetsAbove === 0) {\n\t\treturn { x: 0, y: 0 };\n\t}\n\n\tif (stackMode === 'collapse') {\n\t\t// Keep the top 2 sheets visible:\n\t\t// - The sheet directly under the top is pushed by (top sheet width + small gap)\n\t\t// - Deeper sheets cascade under that with a small indent per extra layer\n\t\tconst baseOffset = collapseBaseSize + SHEET_STACK_GAP;\n\t\tconst offset = baseOffset + (sheetsAbove - 1) * SHEET_INDENT;\n\n\t\tswitch (side) {\n\t\t\tcase 'right':\n\t\t\t\treturn { x: -offset };\n\t\t\tcase 'left':\n\t\t\t\treturn { x: offset };\n\t\t\tcase 'top':\n\t\t\t\treturn { y: offset };\n\t\t\tcase 'bottom':\n\t\t\t\treturn { y: -offset };\n\t\t}\n\t}\n\n\t// Cascade mode: incremental indent\n\tconst offset = sheetsAbove * SHEET_INDENT;\n\n\tswitch (side) {\n\t\tcase 'right':\n\t\t\treturn { x: -offset };\n\t\tcase 'left':\n\t\t\treturn { x: offset };\n\t\tcase 'top':\n\t\t\treturn { y: offset };\n\t\tcase 'bottom':\n\t\t\treturn { y: -offset };\n\t}\n}\n\n/**\n * Get the initial position for sheet animation based on side.\n * Pure transform animation for GPU acceleration - no opacity/scale changes.\n */\nfunction getInitialPosition(side: 'top' | 'bottom' | 'left' | 'right') {\n\tswitch (side) {\n\t\tcase 'right':\n\t\t\treturn { x: '100%' };\n\t\tcase 'left':\n\t\t\treturn { x: '-100%' };\n\t\tcase 'top':\n\t\t\treturn { y: '-100%' };\n\t\tcase 'bottom':\n\t\t\treturn { y: '100%' };\n\t}\n}\n\n/**\n * Get the exit position for sheet animation based on side.\n * Pure transform for smooth GPU-accelerated exit.\n */\nfunction getExitPosition(side: 'top' | 'bottom' | 'left' | 'right') {\n\tswitch (side) {\n\t\tcase 'right':\n\t\t\treturn { x: '100%' };\n\t\tcase 'left':\n\t\t\treturn { x: '-100%' };\n\t\tcase 'top':\n\t\t\treturn { y: '-100%' };\n\t\tcase 'bottom':\n\t\t\treturn { y: '100%' };\n\t}\n}\n\nfunction SheetContent({\n\tside = 'right',\n\tclassName,\n\ttransition,\n\toverlay = true,\n\tshowClose = true,\n\tchildren,\n\tforceMount: _forceMount,\n\tonInteractOutside: _onInteractOutside,\n\tonPointerDownOutside: _onPointerDownOutside,\n\tonEscapeKeyDown: _onEscapeKeyDown,\n\tonFocusOutside: _onFocusOutside,\n\tinitialFocus,\n\t...props\n}: SheetContentProps) {\n\tconst { isOpen, depth, sheetId } = useSheet();\n\tconst springTiers = useSpringTiers();\n\tconst sheetStack = useSheetStack();\n\n\t// Calculate sheetsAbove directly from stack to ensure it's always current\n\t// sheetsAbove = number of sheets with higher depth (on top of this one)\n\tconst sheetsAbove = sheetStack?.getSheetsAbove(sheetId) ?? 0;\n\tconst stackMode = sheetStack?.stackMode ?? 'cascade';\n\n\t// Ensure side is never null (default already handles undefined, but TS needs explicit assertion)\n\tconst resolvedSide = side ?? 'right';\n\n\t// Calculate z-index based on depth (base modal content z-index + depth * 10)\n\t// We use a calc() string to reference the CSS variable\n\tconst zIndex = `calc(var(--z-layer-modal-content) + ${depth * 10})`;\n\n\t// Push offset for when sheets are stacked above this one\n\t// sheetsAbove > 0 means there are sheets on top, so this sheet should be pushed back\n\tconst topSheetId = sheetStack?.sheets[sheetStack.sheets.length - 1]?.id;\n\tconst topSheetSize = topSheetId ? sheetStack?.getSheetSize(topSheetId) : undefined;\n\tconst collapseBaseSize = topSheetSize\n\t\t? resolvedSide === 'left' || resolvedSide === 'right'\n\t\t\t? topSheetSize.width\n\t\t\t: topSheetSize.height\n\t\t: undefined;\n\n\tconst pushOffset = getPushOffset(resolvedSide, sheetsAbove, stackMode, collapseBaseSize ?? NESTED_SHEET_WIDTH);\n\n\tconst contentRef = React.useRef<HTMLDivElement>(null);\n\tReact.useLayoutEffect(() => {\n\t\tif (!isOpen) return;\n\t\tif (!sheetStack) return;\n\t\tconst el = contentRef.current;\n\t\tif (!el) return;\n\t\tlet rafId = 0;\n\t\tconst update = () => {\n\t\t\tconst rect = el.getBoundingClientRect();\n\t\t\tsheetStack.setSheetSize(sheetId, { width: rect.width, height: rect.height });\n\t\t};\n\t\tupdate();\n\t\tif (typeof ResizeObserver === 'undefined') return;\n\t\tconst ro = new ResizeObserver(() => {\n\t\t\tcancelAnimationFrame(rafId);\n\t\t\trafId = requestAnimationFrame(update);\n\t\t});\n\t\tro.observe(el);\n\t\treturn () => {\n\t\t\tcancelAnimationFrame(rafId);\n\t\t\tro.disconnect();\n\t\t};\n\t}, [isOpen, sheetId, sheetStack]);\n\n\t// Animate position includes base position (0) plus any push offset\n\t// Only transform properties for GPU acceleration\n\tconst animatePosition = {\n\t\tx: pushOffset.x ?? 0,\n\t\ty: pushOffset.y ?? 0,\n\t};\n\n\t// Enter rides the slow spring tier; exits use the quicker exit tween.\n\tconst enterTransition = transition ?? tierSpring(springTiers.slow);\n\tconst exitTransition = tierExit(springTiers.slow);\n\n\treturn (\n\t\t<AnimatePresence initial={false}>\n\t\t\t{isOpen && (\n\t\t\t\t<SheetPortal data-slot='sheet-portal'>\n\t\t\t\t\t{/* Only show overlay for the first (bottom-most) sheet in stack */}\n\t\t\t\t\t{overlay && depth === 0 && (\n\t\t\t\t\t\t<SheetPrimitive.Backdrop\n\t\t\t\t\t\t\tdata-slot=\"sheet-overlay\"\n\t\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\tkey='sheet-overlay'\n\t\t\t\t\t\t\t\t\tclassName='fixed inset-0 bg-black/32 backdrop-blur-sm'\n\t\t\t\t\t\t\t\t\tinitial={{ opacity: 0 }}\n\t\t\t\t\t\t\t\t\tanimate={{ opacity: 1 }}\n\t\t\t\t\t\t\t\t\texit={{ opacity: 0 }}\n\t\t\t\t\t\t\t\t\ttransition={{ duration: springTiers.moderate.duration, ease: easings.easeOut }}\n\t\t\t\t\t\t\t\t\tstyle={{ zIndex: 'var(--z-layer-modal-backdrop)' }}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t<SheetPrimitive.Popup\n\t\t\t\t\t\tdata-slot=\"sheet-content\"\n\t\t\t\t\t\tdata-sheet-depth={depth}\n\t\t\t\t\t\tdata-sheet-id={sheetId}\n\t\t\t\t\t\t// A sheet that scrolls opens at its top, not scrolled to a footer button that is first in tab order.\n\t\t\t\t\t\t// Leaving `initialFocus` out and passing `undefined` are the same thing: both get this default.\n\t\t\t\t\t\tinitialFocus={initialFocus ?? scrollSafeInitialFocus(() => contentRef.current)}\n\t\t\t\t\t\t{...props}\n\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\tkey={`sheet-content-${sheetId}`}\n\t\t\t\t\t\t\t\tref={contentRef}\n\t\t\t\t\t\t\t\tvariants={{\n\t\t\t\t\t\t\t\t\tinitial: getInitialPosition(resolvedSide),\n\t\t\t\t\t\t\t\t\tanimate: animatePosition,\n\t\t\t\t\t\t\t\t\texit: {\n\t\t\t\t\t\t\t\t\t\t...getExitPosition(resolvedSide),\n\t\t\t\t\t\t\t\t\t\ttransition: exitTransition,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tinitial='initial'\n\t\t\t\t\t\t\t\tanimate='animate'\n\t\t\t\t\t\t\t\texit='exit'\n\t\t\t\t\t\t\t\ttransition={enterTransition}\n\t\t\t\t\t\t\t\tstyle={{ zIndex }}\n\t\t\t\t\t\t\t\tclassName={cn(sheetVariants({ side: resolvedSide }), className)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{/* ModalPortalScope creates a scoped portal container for floating elements inside */}\n\t\t\t\t\t\t<ModalPortalScope>\n\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t</ModalPortalScope>\n\t\t\t\t\t\t{showClose && (\n\t\t\t\t\t\t\t<SheetPrimitive.Close\n\t\t\t\t\t\t\t\tdata-slot=\"sheet-close\"\n\t\t\t\t\t\t\t\tclassName='data-[open]:bg-secondary absolute top-4 end-4\n\t\t\t\t\t\t\t\t\trounded-sm opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50\n\t\t\t\t\t\t\t\t disabled:pointer-events-none'\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<X className='h-4 w-4' />\n\t\t\t\t\t\t\t\t<span className='sr-only'>Close</span>\n\t\t\t\t\t\t\t</SheetPrimitive.Close>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</SheetPrimitive.Popup>\n\t\t\t\t</SheetPortal>\n\t\t\t)}\n\t\t</AnimatePresence>\n\t);\n}\n\ntype SheetHeaderProps = React.ComponentProps<'div'> & {\n\t/** `band` tints the header and closes it with a hairline, edge to edge. */\n\tvariant?: 'default' | 'band';\n};\n\nfunction SheetHeader({ className, variant = 'default', ...props }: SheetHeaderProps) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"sheet-header\"\n\t\t\tdata-variant={variant}\n\t\t\tclassName={cn(\n\t\t\t\t'flex flex-col space-y-2',\n\t\t\t\t// `pe-6` keeps the title clear of the close button.\n\t\t\t\tvariant === 'default' && 'pb-4 pe-6 text-center sm:text-start',\n\t\t\t\t// Bleeds through SheetContent's p-4 to the panel edges.\n\t\t\t\tvariant === 'band' && '-mx-4 -mt-4 border-b bg-muted/50 p-4 pe-12 text-start',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\ntype SheetFooterProps = React.ComponentProps<'div'> & {\n\t/** `band` pins a tinted footer to the bottom edge, closed off by a hairline. */\n\tvariant?: 'default' | 'band';\n};\n\nfunction SheetFooter({ className, variant = 'default', ...props }: SheetFooterProps) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"sheet-footer\"\n\t\t\tdata-variant={variant}\n\t\t\tclassName={cn(\n\t\t\t\t'flex flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:justify-end',\n\t\t\t\tvariant === 'default' && 'pt-4',\n\t\t\t\tvariant === 'band' && '-mx-4 mt-auto -mb-4 border-t bg-muted/50 px-4 py-3',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\ntype SheetTitleProps = React.ComponentProps<typeof SheetPrimitive.Title>;\n\nfunction SheetTitle({ className, ...props }: SheetTitleProps) {\n\treturn (\n\t\t<SheetPrimitive.Title\n\t\t\tdata-slot=\"sheet-title\"\n\t\t\tclassName={cn('text-foreground text-lg font-semibold', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\ntype SheetDescriptionProps = React.ComponentProps<typeof SheetPrimitive.Description>;\n\nfunction SheetDescription({ className, ...props }: SheetDescriptionProps) {\n\treturn (\n\t\t<SheetPrimitive.Description\n\t\t\tdata-slot=\"sheet-description\"\n\t\t\tclassName={cn('text-muted-foreground text-sm', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\t// Stack provider for nested sheets\n\tSheetStackProvider,\n\tuseSheetStack,\n\t// Individual sheet hooks\n\tuseSheet,\n\t// Components\n\tSheet,\n\tSheetPortal,\n\tSheetOverlay,\n\tSheetTrigger,\n\tSheetClose,\n\tSheetContent,\n\tSheetHeader,\n\tSheetFooter,\n\tSheetTitle,\n\tSheetDescription,\n\t// Constants\n\tSHEET_INDENT,\n\t// Types\n\ttype StackMode,\n\ttype SheetStackProviderProps,\n\ttype SheetProps,\n\ttype SheetPortalProps,\n\ttype SheetOverlayProps,\n\ttype SheetTriggerProps,\n\ttype SheetCloseProps,\n\ttype SheetContentProps,\n\ttype SheetHeaderProps,\n\ttype SheetFooterProps,\n\ttype SheetTitleProps,\n\ttype SheetDescriptionProps,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAYA,SAAgB,qBAAwB,EACvC,MACA,aACA,YAC0D;CAC1D,MAAM,CAAC,mBAAmB,4CAAoC,WAAgB;CAC9E,MAAM,eAAe,SAAS;CAC9B,MAAM,QAAQ,eAAe,OAAO;CAGpC,MAAM,gCAAqB,QAAQ;CACnC,2BAAgB;EACf,YAAY,UAAU;CACvB,GAAG,CAAC,QAAQ,CAAC;CAYb,OAAO,CAAC,+BATN,aAAgB;EAChB,IAAI,CAAC,cACJ,qBAAqB,QAAQ;EAE9B,YAAY,UAAU,QAAQ;CAC/B,GACA,CAAC,YAAY,CAGQ,CAAC;AACxB;;;;ACMA,MAAM,oBAAoBA,MAAM,cAAiD,MAAS;AAE1F,MAAM,eAAe;AAWrB,SAAS,mBAAmB,EAAE,UAAU,YAAY,aAAsC;CACzF,MAAM,CAAC,QAAQ,aAAaA,MAAM,SAAsB,CAAC,CAAC;CAC1D,MAAM,CAAC,YAAY,iBAAiBA,MAAM,SAAgD,CAAC,CAAC;CAI5F,MAAM,gBAAgBA,MAAM,aAAa,SAAoB;EAC5D,WAAW,SAAS;GACnB,IAAI,KAAK,MAAM,MAAM,EAAE,OAAO,KAAK,EAAE,GAAG,OAAO;GAE/C,MAAM,YAAY,CAAC,GAAG,MAAM,IAAI;GAChC,UAAU,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,KAAK;GAC1C,OAAO;EACR,CAAC;CACF,GAAG,CAAC,CAAC;CAEL,MAAM,kBAAkBA,MAAM,aAAa,OAAe;EACzD,WAAW,SAAS,KAAK,QAAQ,MAAM,EAAE,OAAO,EAAE,CAAC;EACnD,eAAe,SAAS;GACvB,IAAI,CAAC,KAAK,KAAK,OAAO;GACtB,MAAM,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AAY,EAAE,WAAW,UAAU,WAAW,GAAG,SAA2B;CACpF,OACC,2CAAC,OAAD;EACC,aAAU;EACV,gBAAc;EACd,WAAWA,iBACV,uEACA,YAAY,aAAa,QACzB,YAAY,UAAU,sDACtB,SACD;EACA,GAAI;CACJ;AAEH;AAIA,SAAS,WAAW,EAAE,WAAW,GAAG,SAA0B;CAC7D,OACC,2CAACD,6BAAe,OAAhB;EACC,aAAU;EACV,WAAWC,iBAAG,yCAAyC,SAAS;EAChE,GAAI;CACJ;AAEH;AAIA,SAAS,iBAAiB,EAAE,WAAW,GAAG,SAAgC;CACzE,OACC,2CAACD,6BAAe,aAAhB;EACC,aAAU;EACV,WAAWC,iBAAG,iCAAiC,SAAS;EACxD,GAAI;CACJ;AAEH"}
|
|
1
|
+
{"version":3,"file":"sheet-CGFqOAoI.cjs","names":["React","SheetPrimitive","cn","useSpringTiers","tierSpring","tierExit","AnimatePresence","motion","easings","scrollSafeInitialFocus","ModalPortalScope","X"],"sources":["../src/lib/use-controllable-state.ts","../src/components/sheet.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\n\ntype UseControllableStateParams<T> = {\n\tprop?: T;\n\tdefaultProp?: T;\n\tonChange?: (value: T) => void;\n};\n\n/**\n * Hook for managing controlled/uncontrolled state.\n * Supports both controlled (prop-driven) and uncontrolled (internal state) patterns.\n */\nexport function useControllableState<T>({\n\tprop,\n\tdefaultProp,\n\tonChange,\n}: UseControllableStateParams<T>): [T, (value: T) => void] {\n\tconst [uncontrolledValue, setUncontrolledValue] = useState<T>(defaultProp as T);\n\tconst isControlled = prop !== undefined;\n\tconst value = isControlled ? prop : uncontrolledValue;\n\n\t// Store onChange in ref to keep callback stable\n\tconst onChangeRef = useRef(onChange);\n\tuseEffect(() => {\n\t\tonChangeRef.current = onChange;\n\t}, [onChange]);\n\n\tconst setValue = useCallback(\n\t\t(newValue: T) => {\n\t\t\tif (!isControlled) {\n\t\t\t\tsetUncontrolledValue(newValue);\n\t\t\t}\n\t\t\tonChangeRef.current?.(newValue);\n\t\t},\n\t\t[isControlled],\n\t);\n\n\treturn [value, setValue];\n}\n","'use client';\n\nimport * as React from 'react';\nimport { Dialog as SheetPrimitive } from '@base-ui/react/dialog';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { X } from 'lucide-react';\nimport { AnimatePresence, motion, type HTMLMotionProps, type Transition } from 'motion/react';\n\nimport { scrollSafeInitialFocus } from '../lib/initial-focus';\nimport { easings, tierExit, tierSpring } from '../lib/motion/motion-config';\nimport { useSpringTiers } from '../lib/motion/tuning';\nimport { useControllableState } from '../lib/use-controllable-state';\nimport { ModalPortalScope, useRootPortalContainer } from '@constructive-io/ui/portal';\nimport { cn } from '../lib/utils';\n\n// ============================================================================\n// Sheet Stack Context - Manages nested/stacked sheets\n// ============================================================================\n\ntype SheetInfo = {\n\tid: string;\n\tdepth: number;\n\tclose: () => void;\n};\n\ntype SheetSize = {\n\twidth: number;\n\theight: number;\n};\n\ntype StackMode = 'cascade' | 'collapse';\n\ntype SheetStackContextType = {\n\tsheets: SheetInfo[];\n\tsheetSizes: Record<string, SheetSize | undefined>;\n\tstackMode: StackMode;\n\tregisterSheet: (info: SheetInfo) => void;\n\tunregisterSheet: (id: string) => void;\n\tsetSheetSize: (id: string, size: SheetSize) => void;\n\tgetSheetSize: (id: string) => SheetSize | undefined;\n\tisTopSheet: (id: string) => boolean;\n\tgetSheetsAbove: (id: string) => number;\n};\n\nconst SheetStackContext = React.createContext<SheetStackContextType | undefined>(undefined);\n\nconst SHEET_INDENT = 24; // pixels to push outer sheets when inner opens\n\ntype SheetStackProviderProps = {\n\tchildren: React.ReactNode;\n\t/** Controls how sheets are pushed when stacking.\n\t * - 'cascade' (default): Each sheet is incrementally indented by SHEET_INDENT\n\t * - 'collapse': Only the sheet directly below the top gets full-width push, others cascade relative to it\n\t */\n\tstackMode?: StackMode;\n};\n\nfunction SheetStackProvider({ children, stackMode = 'cascade' }: SheetStackProviderProps) {\n\tconst [sheets, setSheets] = React.useState<SheetInfo[]>([]);\n\tconst [sheetSizes, setSheetSizes] = React.useState<Record<string, SheetSize | undefined>>({});\n\n\t// Register sheet - insert sorted by depth (lower depth = earlier in array)\n\t// This ensures sheets are ordered correctly regardless of registration timing\n\tconst registerSheet = React.useCallback((info: SheetInfo) => {\n\t\tsetSheets((prev) => {\n\t\t\tif (prev.some((s) => s.id === info.id)) return prev;\n\t\t\t// Insert in sorted order by depth\n\t\t\tconst newSheets = [...prev, info];\n\t\t\tnewSheets.sort((a, b) => a.depth - b.depth);\n\t\t\treturn newSheets;\n\t\t});\n\t}, []);\n\n\tconst unregisterSheet = React.useCallback((id: string) => {\n\t\tsetSheets((prev) => prev.filter((s) => s.id !== id));\n\t\tsetSheetSizes((prev) => {\n\t\t\tif (!prev[id]) return prev;\n\t\t\tconst next = { ...prev };\n\t\t\tdelete next[id];\n\t\t\treturn next;\n\t\t});\n\t}, []);\n\n\tconst setSheetSize = React.useCallback((id: string, size: SheetSize) => {\n\t\tsetSheetSizes((prev) => {\n\t\t\tconst current = prev[id];\n\t\t\tif (current && current.width === size.width && current.height === size.height) return prev;\n\t\t\treturn { ...prev, [id]: size };\n\t\t});\n\t}, []);\n\n\tconst getSheetSize = React.useCallback((id: string) => sheetSizes[id], [sheetSizes]);\n\n\t// Topmost sheet = highest depth = last in sorted array\n\tconst isTopSheet = React.useCallback((id: string) => {\n\t\tif (sheets.length === 0) return false;\n\t\treturn sheets[sheets.length - 1]?.id === id;\n\t}, [sheets]);\n\n\t// Sheets above = sheets with higher depth than this one\n\tconst getSheetsAbove = React.useCallback((id: string) => {\n\t\tconst index = sheets.findIndex((s) => s.id === id);\n\t\tif (index === -1) return 0;\n\t\t// Sheets after this index have higher depth (are on top)\n\t\treturn sheets.length - index - 1;\n\t}, [sheets]);\n\n\t// Memoize value - callbacks are stable, only sheets changes\n\tconst value = React.useMemo(\n\t\t() => ({\n\t\t\tsheets,\n\t\t\tsheetSizes,\n\t\t\tstackMode,\n\t\t\tregisterSheet,\n\t\t\tunregisterSheet,\n\t\t\tsetSheetSize,\n\t\t\tgetSheetSize,\n\t\t\tisTopSheet,\n\t\t\tgetSheetsAbove,\n\t\t}),\n\t\t[sheets, sheetSizes, stackMode, registerSheet, unregisterSheet, setSheetSize, getSheetSize, isTopSheet, getSheetsAbove],\n\t);\n\n\treturn <SheetStackContext.Provider value={value}>{children}</SheetStackContext.Provider>;\n}\n\nconst useSheetStack = (): SheetStackContextType | undefined => {\n\treturn React.useContext(SheetStackContext);\n};\n\n// ============================================================================\n// Sheet Nesting Context - Tracks nesting level via React tree\n// ============================================================================\n\ntype SheetNestingContextType = {\n\tlevel: number;\n\tparentSheetId: string | null;\n};\n\nconst SheetNestingContext = React.createContext<SheetNestingContextType>({\n\tlevel: 0,\n\tparentSheetId: null,\n});\n\nconst useSheetNesting = () => React.useContext(SheetNestingContext);\n\n// ============================================================================\n// Individual Sheet Context\n// ============================================================================\n\ntype SheetContextType = {\n\tisOpen: boolean;\n\tsheetId: string;\n\tdepth: number;\n\tsheetsAbove: number;\n\tisTopSheet: boolean;\n\tclose: () => void;\n};\n\nconst SheetContext = React.createContext<SheetContextType | undefined>(undefined);\n\nconst useSheet = (): SheetContextType => {\n\tconst context = React.useContext(SheetContext);\n\tif (!context) {\n\t\tthrow new Error('useSheet must be used within a Sheet');\n\t}\n\treturn context;\n};\n\ntype DialogChangeEventDetails = Parameters<NonNullable<React.ComponentProps<typeof SheetPrimitive.Root>['onOpenChange']>>[1];\n\ntype SheetProps = Omit<React.ComponentProps<typeof SheetPrimitive.Root>, 'onOpenChange'> & {\n\t/** Unique identifier for this sheet in a stack. Auto-generated if not provided. */\n\tsheetId?: string;\n\t/** Callback when open state changes - simplified to just boolean for backwards compatibility */\n\tonOpenChange?: (open: boolean) => void;\n};\n\nfunction Sheet({\n\tchildren,\n\tsheetId: providedId,\n\topen: openProp,\n\tdefaultOpen = false,\n\tonOpenChange,\n\tmodal,\n\t...props\n}: SheetProps) {\n\tconst [isOpen, setIsOpen] = useControllableState({\n\t\tprop: openProp,\n\t\tdefaultProp: defaultOpen,\n\t\tonChange: onOpenChange,\n\t});\n\tconst sheetStack = useSheetStack();\n\tconst nesting = useSheetNesting();\n\tconst generatedId = React.useId();\n\tconst sheetId = providedId ?? `sheet-${generatedId.replace(/:/g, '')}`;\n\n\t// Depth is determined by nesting level in React tree\n\tconst depth = nesting.level;\n\n\tconst close = React.useCallback(() => {\n\t\tsetIsOpen(false);\n\t}, [setIsOpen]);\n\n\tconst registerSheet = sheetStack?.registerSheet;\n\tconst unregisterSheet = sheetStack?.unregisterSheet;\n\n\t// Register/unregister with stack when open state changes\n\tReact.useEffect(() => {\n\t\tif (registerSheet && isOpen) {\n\t\t\t// Close any open dropdowns/popovers by blurring active element\n\t\t\t// This ensures selects close before the sheet stacks on top\n\t\t\tif (document.activeElement instanceof HTMLElement) {\n\t\t\t\tdocument.activeElement.blur();\n\t\t\t}\n\t\t\tregisterSheet({ id: sheetId, depth, close });\n\t\t\treturn () => unregisterSheet?.(sheetId);\n\t\t}\n\t}, [isOpen, sheetId, depth, close, registerSheet, unregisterSheet]);\n\n\t// Base UI owns dismissal details; this adapter preserves the package's boolean callback.\n\tconst handleOpenChange = React.useCallback((open: boolean, _eventDetails: DialogChangeEventDetails) => {\n\t\tsetIsOpen(open);\n\t}, [setIsOpen]);\n\n\t// Calculate sheets above and whether this is the top sheet\n\tconst sheetsAbove = sheetStack?.getSheetsAbove(sheetId) ?? 0;\n\tconst isTopSheet = sheetStack?.isTopSheet(sheetId) ?? true;\n\n\t// Nested sheets must be non-modal to prevent Base UI from closing parent on interaction\n\tconst isNested = depth > 0;\n\n\treturn (\n\t\t<SheetNestingContext.Provider value={{ level: depth + 1, parentSheetId: sheetId }}>\n\t\t\t<SheetContext.Provider value={{ isOpen, sheetId, depth, sheetsAbove, isTopSheet, close }}>\n\t\t\t\t<SheetPrimitive.Root\n\t\t\t\t\tdata-slot=\"sheet\"\n\t\t\t\t\t{...props}\n\t\t\t\t\topen={isOpen}\n\t\t\t\t\tmodal={isNested ? false : modal}\n\t\t\t\t\tonOpenChange={handleOpenChange}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</SheetPrimitive.Root>\n\t\t\t</SheetContext.Provider>\n\t\t</SheetNestingContext.Provider>\n\t);\n}\n\ntype SheetTriggerProps = React.ComponentProps<typeof SheetPrimitive.Trigger> & {\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n};\n\nfunction SheetTrigger({ asChild, children, render, nativeButton, ...props }: SheetTriggerProps) {\n\tconst childRender = render === undefined && asChild && React.isValidElement(children) ? children : undefined;\n\n\treturn (\n\t\t<SheetPrimitive.Trigger\n\t\t\tdata-slot=\"sheet-trigger\"\n\t\t\tnativeButton={nativeButton ?? (childRender ? true : undefined)}\n\t\t\trender={render ?? childRender}\n\t\t\t{...props}\n\t\t>\n\t\t\t{childRender ? undefined : children}\n\t\t</SheetPrimitive.Trigger>\n\t);\n}\n\ntype SheetCloseProps = React.ComponentProps<typeof SheetPrimitive.Close> & {\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n};\n\nfunction SheetClose({ asChild, children, render, nativeButton, ...props }: SheetCloseProps) {\n\tconst childRender = render === undefined && asChild && React.isValidElement(children) ? children : undefined;\n\n\treturn (\n\t\t<SheetPrimitive.Close\n\t\t\tdata-slot=\"sheet-close\"\n\t\t\tnativeButton={nativeButton ?? (childRender ? true : undefined)}\n\t\t\trender={render ?? childRender}\n\t\t\t{...props}\n\t\t>\n\t\t\t{childRender ? undefined : children}\n\t\t</SheetPrimitive.Close>\n\t);\n}\n\ntype SheetPortalProps = React.ComponentProps<typeof SheetPrimitive.Portal> & {\n\t/** @deprecated Base UI manages mounting automatically */\n\tforceMount?: boolean;\n};\n\nfunction SheetPortal({ forceMount: _forceMount, container: containerProp, ...props }: SheetPortalProps) {\n\tconst rootContainer = useRootPortalContainer();\n\tconst container = containerProp === undefined ? (rootContainer ?? undefined) : containerProp;\n\n\tconst style = {\n\t\t...(props.style ?? {}),\n\t\t['--z-layer-floating' as any]: 'var(--z-layer-floating-elevated)',\n\t} satisfies React.CSSProperties;\n\n\treturn <SheetPrimitive.Portal data-slot=\"sheet-portal\" container={container} {...props} style={style} />;\n}\n\ntype SheetOverlayProps = React.HTMLAttributes<HTMLDivElement> & {\n\t/** @deprecated Base UI Backdrop handles child elements natively */\n\tasChild?: boolean;\n\t/** @deprecated Base UI manages mounting automatically */\n\tforceMount?: boolean;\n};\n\nfunction SheetOverlay({ className, asChild: _asChild, forceMount: _forceMount, ...props }: SheetOverlayProps) {\n\treturn (\n\t\t<SheetPrimitive.Backdrop\n\t\t\tdata-slot=\"sheet-overlay\"\n\t\t\tclassName={cn('fixed inset-0 z-[var(--z-layer-modal-backdrop)] bg-black/32 backdrop-blur-sm', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// The panel scrolls itself: content taller than the viewport used to be clipped with no way to reach it. Callers that manage their own\n// scroll region (a `flex-1 min-h-0 overflow-y-auto` body) are unaffected because the sheet then never overflows.\nconst sheetVariants = cva('fixed flex flex-col gap-3 overflow-y-auto overscroll-contain bg-background p-4 shadow-lg outline-hidden [overflow-wrap:break-word]', {\n\tvariants: {\n\t\tside: {\n\t\t\ttop: 'inset-x-0 top-0 max-h-dvh border-b',\n\t\t\tbottom: 'inset-x-0 bottom-0 max-h-dvh border-t',\n\t\t\tleft: 'inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm',\n\t\t\tright: 'inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm',\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tside: 'right',\n\t},\n});\n\ntype SheetContentProps = Omit<React.ComponentProps<typeof SheetPrimitive.Popup>, 'children'> &\n\tVariantProps<typeof sheetVariants> &\n\tHTMLMotionProps<'div'> & {\n\t\ttransition?: Transition;\n\t\toverlay?: boolean;\n\t\t/** Whether to show the close button. Defaults to true. */\n\t\tshowClose?: boolean;\n\t\tchildren?: React.ReactNode;\n\t\t/** @deprecated Base UI manages mounting automatically */\n\t\tforceMount?: boolean;\n\t\t/** @deprecated Use onOpenChange on Root instead */\n\t\tonInteractOutside?: (e: Event) => void;\n\t\t/** @deprecated Use onOpenChange on Root instead */\n\t\tonPointerDownOutside?: (e: Event) => void;\n\t\t/** @deprecated Use onOpenChange on Root instead */\n\t\tonEscapeKeyDown?: (e: KeyboardEvent) => void;\n\t\t/** @deprecated Use onOpenChange on Root instead */\n\t\tonFocusOutside?: (e: Event) => void;\n\t};\n\n// Default width for nested sheets (used for collapse mode calculations)\n// Using max-w-md (28rem = 448px) as the typical nested sheet width\nconst NESTED_SHEET_WIDTH = 448;\n\n// Gap between the top two visible sheets in collapse mode\nconst SHEET_STACK_GAP = 0;\n\n/**\n * Calculate the push offset based on side, number of sheets above, and stack mode.\n * - 'cascade': Each sheet is incrementally indented by SHEET_INDENT per layer above\n * - 'collapse': Bottom sheets are pushed to opposite side to make room for top sheet\n */\nfunction getPushOffset(\n\tside: 'top' | 'bottom' | 'left' | 'right',\n\tsheetsAbove: number,\n\tstackMode: StackMode = 'cascade',\n\tcollapseBaseSize: number = NESTED_SHEET_WIDTH,\n): { x?: number | string; y?: number | string } {\n\tif (sheetsAbove === 0) {\n\t\treturn { x: 0, y: 0 };\n\t}\n\n\tif (stackMode === 'collapse') {\n\t\t// Keep the top 2 sheets visible:\n\t\t// - The sheet directly under the top is pushed by (top sheet width + small gap)\n\t\t// - Deeper sheets cascade under that with a small indent per extra layer\n\t\tconst baseOffset = collapseBaseSize + SHEET_STACK_GAP;\n\t\tconst offset = baseOffset + (sheetsAbove - 1) * SHEET_INDENT;\n\n\t\tswitch (side) {\n\t\t\tcase 'right':\n\t\t\t\treturn { x: -offset };\n\t\t\tcase 'left':\n\t\t\t\treturn { x: offset };\n\t\t\tcase 'top':\n\t\t\t\treturn { y: offset };\n\t\t\tcase 'bottom':\n\t\t\t\treturn { y: -offset };\n\t\t}\n\t}\n\n\t// Cascade mode: incremental indent\n\tconst offset = sheetsAbove * SHEET_INDENT;\n\n\tswitch (side) {\n\t\tcase 'right':\n\t\t\treturn { x: -offset };\n\t\tcase 'left':\n\t\t\treturn { x: offset };\n\t\tcase 'top':\n\t\t\treturn { y: offset };\n\t\tcase 'bottom':\n\t\t\treturn { y: -offset };\n\t}\n}\n\n/**\n * Get the initial position for sheet animation based on side.\n * Pure transform animation for GPU acceleration - no opacity/scale changes.\n */\nfunction getInitialPosition(side: 'top' | 'bottom' | 'left' | 'right') {\n\tswitch (side) {\n\t\tcase 'right':\n\t\t\treturn { x: '100%' };\n\t\tcase 'left':\n\t\t\treturn { x: '-100%' };\n\t\tcase 'top':\n\t\t\treturn { y: '-100%' };\n\t\tcase 'bottom':\n\t\t\treturn { y: '100%' };\n\t}\n}\n\n/**\n * Get the exit position for sheet animation based on side.\n * Pure transform for smooth GPU-accelerated exit.\n */\nfunction getExitPosition(side: 'top' | 'bottom' | 'left' | 'right') {\n\tswitch (side) {\n\t\tcase 'right':\n\t\t\treturn { x: '100%' };\n\t\tcase 'left':\n\t\t\treturn { x: '-100%' };\n\t\tcase 'top':\n\t\t\treturn { y: '-100%' };\n\t\tcase 'bottom':\n\t\t\treturn { y: '100%' };\n\t}\n}\n\nfunction SheetContent({\n\tside = 'right',\n\tclassName,\n\ttransition,\n\toverlay = true,\n\tshowClose = true,\n\tchildren,\n\tforceMount: _forceMount,\n\tonInteractOutside: _onInteractOutside,\n\tonPointerDownOutside: _onPointerDownOutside,\n\tonEscapeKeyDown: _onEscapeKeyDown,\n\tonFocusOutside: _onFocusOutside,\n\tinitialFocus,\n\t...props\n}: SheetContentProps) {\n\tconst { isOpen, depth, sheetId } = useSheet();\n\tconst springTiers = useSpringTiers();\n\tconst sheetStack = useSheetStack();\n\n\t// Calculate sheetsAbove directly from stack to ensure it's always current\n\t// sheetsAbove = number of sheets with higher depth (on top of this one)\n\tconst sheetsAbove = sheetStack?.getSheetsAbove(sheetId) ?? 0;\n\tconst stackMode = sheetStack?.stackMode ?? 'cascade';\n\n\t// Ensure side is never null (default already handles undefined, but TS needs explicit assertion)\n\tconst resolvedSide = side ?? 'right';\n\n\t// Calculate z-index based on depth (base modal content z-index + depth * 10)\n\t// We use a calc() string to reference the CSS variable\n\tconst zIndex = `calc(var(--z-layer-modal-content) + ${depth * 10})`;\n\n\t// Push offset for when sheets are stacked above this one\n\t// sheetsAbove > 0 means there are sheets on top, so this sheet should be pushed back\n\tconst topSheetId = sheetStack?.sheets[sheetStack.sheets.length - 1]?.id;\n\tconst topSheetSize = topSheetId ? sheetStack?.getSheetSize(topSheetId) : undefined;\n\tconst collapseBaseSize = topSheetSize\n\t\t? resolvedSide === 'left' || resolvedSide === 'right'\n\t\t\t? topSheetSize.width\n\t\t\t: topSheetSize.height\n\t\t: undefined;\n\n\tconst pushOffset = getPushOffset(resolvedSide, sheetsAbove, stackMode, collapseBaseSize ?? NESTED_SHEET_WIDTH);\n\n\tconst contentRef = React.useRef<HTMLDivElement>(null);\n\tReact.useLayoutEffect(() => {\n\t\tif (!isOpen) return;\n\t\tif (!sheetStack) return;\n\t\tconst el = contentRef.current;\n\t\tif (!el) return;\n\t\tlet rafId = 0;\n\t\tconst update = () => {\n\t\t\tconst rect = el.getBoundingClientRect();\n\t\t\tsheetStack.setSheetSize(sheetId, { width: rect.width, height: rect.height });\n\t\t};\n\t\tupdate();\n\t\tif (typeof ResizeObserver === 'undefined') return;\n\t\tconst ro = new ResizeObserver(() => {\n\t\t\tcancelAnimationFrame(rafId);\n\t\t\trafId = requestAnimationFrame(update);\n\t\t});\n\t\tro.observe(el);\n\t\treturn () => {\n\t\t\tcancelAnimationFrame(rafId);\n\t\t\tro.disconnect();\n\t\t};\n\t}, [isOpen, sheetId, sheetStack]);\n\n\t// Animate position includes base position (0) plus any push offset\n\t// Only transform properties for GPU acceleration\n\tconst animatePosition = {\n\t\tx: pushOffset.x ?? 0,\n\t\ty: pushOffset.y ?? 0,\n\t};\n\n\t// Enter rides the slow spring tier; exits use the quicker exit tween.\n\tconst enterTransition = transition ?? tierSpring(springTiers.slow);\n\tconst exitTransition = tierExit(springTiers.slow);\n\n\treturn (\n\t\t<AnimatePresence initial={false}>\n\t\t\t{isOpen && (\n\t\t\t\t<SheetPortal data-slot='sheet-portal'>\n\t\t\t\t\t{/* Only show overlay for the first (bottom-most) sheet in stack */}\n\t\t\t\t\t{overlay && depth === 0 && (\n\t\t\t\t\t\t<SheetPrimitive.Backdrop\n\t\t\t\t\t\t\tdata-slot=\"sheet-overlay\"\n\t\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\tkey='sheet-overlay'\n\t\t\t\t\t\t\t\t\tclassName='fixed inset-0 bg-black/32 backdrop-blur-sm'\n\t\t\t\t\t\t\t\t\tinitial={{ opacity: 0 }}\n\t\t\t\t\t\t\t\t\tanimate={{ opacity: 1 }}\n\t\t\t\t\t\t\t\t\texit={{ opacity: 0 }}\n\t\t\t\t\t\t\t\t\ttransition={{ duration: springTiers.moderate.duration, ease: easings.easeOut }}\n\t\t\t\t\t\t\t\t\tstyle={{ zIndex: 'var(--z-layer-modal-backdrop)' }}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t<SheetPrimitive.Popup\n\t\t\t\t\t\tdata-slot=\"sheet-content\"\n\t\t\t\t\t\tdata-sheet-depth={depth}\n\t\t\t\t\t\tdata-sheet-id={sheetId}\n\t\t\t\t\t\t// A sheet that scrolls opens at its top, not scrolled to a footer button that is first in tab order.\n\t\t\t\t\t\t// Leaving `initialFocus` out and passing `undefined` are the same thing: both get this default.\n\t\t\t\t\t\tinitialFocus={initialFocus ?? scrollSafeInitialFocus(() => contentRef.current)}\n\t\t\t\t\t\t{...props}\n\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\tkey={`sheet-content-${sheetId}`}\n\t\t\t\t\t\t\t\tref={contentRef}\n\t\t\t\t\t\t\t\tvariants={{\n\t\t\t\t\t\t\t\t\tinitial: getInitialPosition(resolvedSide),\n\t\t\t\t\t\t\t\t\tanimate: animatePosition,\n\t\t\t\t\t\t\t\t\texit: {\n\t\t\t\t\t\t\t\t\t\t...getExitPosition(resolvedSide),\n\t\t\t\t\t\t\t\t\t\ttransition: exitTransition,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tinitial='initial'\n\t\t\t\t\t\t\t\tanimate='animate'\n\t\t\t\t\t\t\t\texit='exit'\n\t\t\t\t\t\t\t\ttransition={enterTransition}\n\t\t\t\t\t\t\t\tstyle={{ zIndex }}\n\t\t\t\t\t\t\t\tclassName={cn(sheetVariants({ side: resolvedSide }), className)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{/* ModalPortalScope creates a scoped portal container for floating elements inside */}\n\t\t\t\t\t\t<ModalPortalScope>\n\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t</ModalPortalScope>\n\t\t\t\t\t\t{showClose && (\n\t\t\t\t\t\t\t// Hover brightens the close button at once, with no fade (hover is the most frequent interaction).\n\t\t\t\t\t\t\t<SheetPrimitive.Close\n\t\t\t\t\t\t\t\tdata-slot=\"sheet-close\"\n\t\t\t\t\t\t\t\tclassName='data-[open]:bg-secondary absolute top-4 end-4\n\t\t\t\t\t\t\t\t\trounded-sm opacity-70 hover:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50\n\t\t\t\t\t\t\t\t disabled:pointer-events-none'\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<X className='h-4 w-4' />\n\t\t\t\t\t\t\t\t<span className='sr-only'>Close</span>\n\t\t\t\t\t\t\t</SheetPrimitive.Close>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</SheetPrimitive.Popup>\n\t\t\t\t</SheetPortal>\n\t\t\t)}\n\t\t</AnimatePresence>\n\t);\n}\n\ntype SheetHeaderProps = React.ComponentProps<'div'> & {\n\t/** `band` tints the header and closes it with a hairline, edge to edge. */\n\tvariant?: 'default' | 'band';\n};\n\nfunction SheetHeader({ className, variant = 'default', ...props }: SheetHeaderProps) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"sheet-header\"\n\t\t\tdata-variant={variant}\n\t\t\tclassName={cn(\n\t\t\t\t'flex flex-col space-y-2',\n\t\t\t\t// `pe-6` keeps the title clear of the close button.\n\t\t\t\tvariant === 'default' && 'pb-4 pe-6 text-center sm:text-start',\n\t\t\t\t// Bleeds through SheetContent's p-4 to the panel edges.\n\t\t\t\tvariant === 'band' && '-mx-4 -mt-4 border-b bg-muted/50 p-4 pe-12 text-start',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\ntype SheetFooterProps = React.ComponentProps<'div'> & {\n\t/** `band` pins a tinted footer to the bottom edge, closed off by a hairline. */\n\tvariant?: 'default' | 'band';\n};\n\nfunction SheetFooter({ className, variant = 'default', ...props }: SheetFooterProps) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"sheet-footer\"\n\t\t\tdata-variant={variant}\n\t\t\tclassName={cn(\n\t\t\t\t'flex flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:justify-end',\n\t\t\t\tvariant === 'default' && 'pt-4',\n\t\t\t\tvariant === 'band' && '-mx-4 mt-auto -mb-4 border-t bg-muted/50 px-4 py-3',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\ntype SheetTitleProps = React.ComponentProps<typeof SheetPrimitive.Title>;\n\nfunction SheetTitle({ className, ...props }: SheetTitleProps) {\n\treturn (\n\t\t<SheetPrimitive.Title\n\t\t\tdata-slot=\"sheet-title\"\n\t\t\tclassName={cn('text-foreground text-lg font-semibold', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\ntype SheetDescriptionProps = React.ComponentProps<typeof SheetPrimitive.Description>;\n\nfunction SheetDescription({ className, ...props }: SheetDescriptionProps) {\n\treturn (\n\t\t<SheetPrimitive.Description\n\t\t\tdata-slot=\"sheet-description\"\n\t\t\tclassName={cn('text-muted-foreground text-sm', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\t// Stack provider for nested sheets\n\tSheetStackProvider,\n\tuseSheetStack,\n\t// Individual sheet hooks\n\tuseSheet,\n\t// Components\n\tSheet,\n\tSheetPortal,\n\tSheetOverlay,\n\tSheetTrigger,\n\tSheetClose,\n\tSheetContent,\n\tSheetHeader,\n\tSheetFooter,\n\tSheetTitle,\n\tSheetDescription,\n\t// Constants\n\tSHEET_INDENT,\n\t// Types\n\ttype StackMode,\n\ttype SheetStackProviderProps,\n\ttype SheetProps,\n\ttype SheetPortalProps,\n\ttype SheetOverlayProps,\n\ttype SheetTriggerProps,\n\ttype SheetCloseProps,\n\ttype SheetContentProps,\n\ttype SheetHeaderProps,\n\ttype SheetFooterProps,\n\ttype SheetTitleProps,\n\ttype SheetDescriptionProps,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAYA,SAAgB,qBAAwB,EACvC,MACA,aACA,YAC0D;CAC1D,MAAM,CAAC,mBAAmB,4CAAoC,WAAgB;CAC9E,MAAM,eAAe,SAAS;CAC9B,MAAM,QAAQ,eAAe,OAAO;CAGpC,MAAM,gCAAqB,QAAQ;CACnC,2BAAgB;EACf,YAAY,UAAU;CACvB,GAAG,CAAC,QAAQ,CAAC;CAYb,OAAO,CAAC,+BATN,aAAgB;EAChB,IAAI,CAAC,cACJ,qBAAqB,QAAQ;EAE9B,YAAY,UAAU,QAAQ;CAC/B,GACA,CAAC,YAAY,CAGQ,CAAC;AACxB;;;;ACMA,MAAM,oBAAoBA,MAAM,cAAiD,MAAS;AAE1F,MAAM,eAAe;AAWrB,SAAS,mBAAmB,EAAE,UAAU,YAAY,aAAsC;CACzF,MAAM,CAAC,QAAQ,aAAaA,MAAM,SAA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AChB,WAAWL,iBAAG,cAAc,EAAE,MAAM,aAAa,CAAC,GAAG,SAAS;IAC9D,GAhBK,iBAAiB,SAgBtB;cA1BH,CA8BC,2CAACQ,6CAAD,EACE,SACgB,IACjB,aAEA,4CAACT,6BAAe,OAAhB;KACC,aAAU;KACV,WAAU;eAFX,CAMC,2CAACU,gBAAD,EAAG,WAAU,UAAW,IACxB,2CAAC,QAAD;MAAM,WAAU;gBAAU;KAAW,EAChB;MAEF;KACV;;CAEE;AAEnB;AAOA,SAAS,YAAY,EAAE,WAAW,UAAU,WAAW,GAAG,SAA2B;CACpF,OACC,2CAAC,OAAD;EACC,aAAU;EACV,gBAAc;EACd,WAAWT,iBACV,2BAEA,YAAY,aAAa,uCAEzB,YAAY,UAAU,yDACtB,SACD;EACA,GAAI;CACJ;AAEH;AAOA,SAAS,YAAY,EAAE,WAAW,UAAU,WAAW,GAAG,SAA2B;CACpF,OACC,2CAAC,OAAD;EACC,aAAU;EACV,gBAAc;EACd,WAAWA,iBACV,uEACA,YAAY,aAAa,QACzB,YAAY,UAAU,sDACtB,SACD;EACA,GAAI;CACJ;AAEH;AAIA,SAAS,WAAW,EAAE,WAAW,GAAG,SAA0B;CAC7D,OACC,2CAACD,6BAAe,OAAhB;EACC,aAAU;EACV,WAAWC,iBAAG,yCAAyC,SAAS;EAChE,GAAI;CACJ;AAEH;AAIA,SAAS,iBAAiB,EAAE,WAAW,GAAG,SAAgC;CACzE,OACC,2CAACD,6BAAe,aAAhB;EACC,aAAU;EACV,WAAWC,iBAAG,iCAAiC,SAAS;EACxD,GAAI;CACJ;AAEH"}
|
|
@@ -372,7 +372,7 @@ function SheetContent({ side = "right", className, transition, overlay = true, s
|
|
|
372
372
|
}, `sheet-content-${sheetId}`),
|
|
373
373
|
children: [/* @__PURE__ */ jsx(ModalPortalScope, { children }), showClose && /* @__PURE__ */ jsxs(Dialog.Close, {
|
|
374
374
|
"data-slot": "sheet-close",
|
|
375
|
-
className: "data-[open]:bg-secondary absolute top-4 end-4\n rounded-sm opacity-70
|
|
375
|
+
className: "data-[open]:bg-secondary absolute top-4 end-4\n rounded-sm opacity-70 hover:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50\n disabled:pointer-events-none",
|
|
376
376
|
children: [/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }), /* @__PURE__ */ jsx("span", {
|
|
377
377
|
className: "sr-only",
|
|
378
378
|
children: "Close"
|
|
@@ -415,4 +415,4 @@ function SheetDescription({ className, ...props }) {
|
|
|
415
415
|
|
|
416
416
|
//#endregion
|
|
417
417
|
export { SheetDescription as a, SheetOverlay as c, SheetTitle as d, SheetTrigger as f, useControllableState as h, SheetContent as i, SheetPortal as l, useSheetStack as m, Sheet as n, SheetFooter as o, useSheet as p, SheetClose as r, SheetHeader as s, SHEET_INDENT as t, SheetStackProvider as u };
|
|
418
|
-
//# sourceMappingURL=sheet-
|
|
418
|
+
//# sourceMappingURL=sheet-LOK_d8-K.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet-wPF_l9Cn.js","names":["React","SheetPrimitive"],"sources":["../src/lib/use-controllable-state.ts","../src/components/sheet.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\n\ntype UseControllableStateParams<T> = {\n\tprop?: T;\n\tdefaultProp?: T;\n\tonChange?: (value: T) => void;\n};\n\n/**\n * Hook for managing controlled/uncontrolled state.\n * Supports both controlled (prop-driven) and uncontrolled (internal state) patterns.\n */\nexport function useControllableState<T>({\n\tprop,\n\tdefaultProp,\n\tonChange,\n}: UseControllableStateParams<T>): [T, (value: T) => void] {\n\tconst [uncontrolledValue, setUncontrolledValue] = useState<T>(defaultProp as T);\n\tconst isControlled = prop !== undefined;\n\tconst value = isControlled ? prop : uncontrolledValue;\n\n\t// Store onChange in ref to keep callback stable\n\tconst onChangeRef = useRef(onChange);\n\tuseEffect(() => {\n\t\tonChangeRef.current = onChange;\n\t}, [onChange]);\n\n\tconst setValue = useCallback(\n\t\t(newValue: T) => {\n\t\t\tif (!isControlled) {\n\t\t\t\tsetUncontrolledValue(newValue);\n\t\t\t}\n\t\t\tonChangeRef.current?.(newValue);\n\t\t},\n\t\t[isControlled],\n\t);\n\n\treturn [value, setValue];\n}\n","'use client';\n\nimport * as React from 'react';\nimport { Dialog as SheetPrimitive } from '@base-ui/react/dialog';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { X } from 'lucide-react';\nimport { AnimatePresence, motion, type HTMLMotionProps, type Transition } from 'motion/react';\n\nimport { scrollSafeInitialFocus } from '../lib/initial-focus';\nimport { easings, tierExit, tierSpring } from '../lib/motion/motion-config';\nimport { useSpringTiers } from '../lib/motion/tuning';\nimport { useControllableState } from '../lib/use-controllable-state';\nimport { ModalPortalScope, useRootPortalContainer } from '@constructive-io/ui/portal';\nimport { cn } from '../lib/utils';\n\n// ============================================================================\n// Sheet Stack Context - Manages nested/stacked sheets\n// ============================================================================\n\ntype SheetInfo = {\n\tid: string;\n\tdepth: number;\n\tclose: () => void;\n};\n\ntype SheetSize = {\n\twidth: number;\n\theight: number;\n};\n\ntype StackMode = 'cascade' | 'collapse';\n\ntype SheetStackContextType = {\n\tsheets: SheetInfo[];\n\tsheetSizes: Record<string, SheetSize | undefined>;\n\tstackMode: StackMode;\n\tregisterSheet: (info: SheetInfo) => void;\n\tunregisterSheet: (id: string) => void;\n\tsetSheetSize: (id: string, size: SheetSize) => void;\n\tgetSheetSize: (id: string) => SheetSize | undefined;\n\tisTopSheet: (id: string) => boolean;\n\tgetSheetsAbove: (id: string) => number;\n};\n\nconst SheetStackContext = React.createContext<SheetStackContextType | undefined>(undefined);\n\nconst SHEET_INDENT = 24; // pixels to push outer sheets when inner opens\n\ntype SheetStackProviderProps = {\n\tchildren: React.ReactNode;\n\t/** Controls how sheets are pushed when stacking.\n\t * - 'cascade' (default): Each sheet is incrementally indented by SHEET_INDENT\n\t * - 'collapse': Only the sheet directly below the top gets full-width push, others cascade relative to it\n\t */\n\tstackMode?: StackMode;\n};\n\nfunction SheetStackProvider({ children, stackMode = 'cascade' }: SheetStackProviderProps) {\n\tconst [sheets, setSheets] = React.useState<SheetInfo[]>([]);\n\tconst [sheetSizes, setSheetSizes] = React.useState<Record<string, SheetSize | undefined>>({});\n\n\t// Register sheet - insert sorted by depth (lower depth = earlier in array)\n\t// This ensures sheets are ordered correctly regardless of registration timing\n\tconst registerSheet = React.useCallback((info: SheetInfo) => {\n\t\tsetSheets((prev) => {\n\t\t\tif (prev.some((s) => s.id === info.id)) return prev;\n\t\t\t// Insert in sorted order by depth\n\t\t\tconst newSheets = [...prev, info];\n\t\t\tnewSheets.sort((a, b) => a.depth - b.depth);\n\t\t\treturn newSheets;\n\t\t});\n\t}, []);\n\n\tconst unregisterSheet = React.useCallback((id: string) => {\n\t\tsetSheets((prev) => prev.filter((s) => s.id !== id));\n\t\tsetSheetSizes((prev) => {\n\t\t\tif (!prev[id]) return prev;\n\t\t\tconst next = { ...prev };\n\t\t\tdelete next[id];\n\t\t\treturn next;\n\t\t});\n\t}, []);\n\n\tconst setSheetSize = React.useCallback((id: string, size: SheetSize) => {\n\t\tsetSheetSizes((prev) => {\n\t\t\tconst current = prev[id];\n\t\t\tif (current && current.width === size.width && current.height === size.height) return prev;\n\t\t\treturn { ...prev, [id]: size };\n\t\t});\n\t}, []);\n\n\tconst getSheetSize = React.useCallback((id: string) => sheetSizes[id], [sheetSizes]);\n\n\t// Topmost sheet = highest depth = last in sorted array\n\tconst isTopSheet = React.useCallback((id: string) => {\n\t\tif (sheets.length === 0) return false;\n\t\treturn sheets[sheets.length - 1]?.id === id;\n\t}, [sheets]);\n\n\t// Sheets above = sheets with higher depth than this one\n\tconst getSheetsAbove = React.useCallback((id: string) => {\n\t\tconst index = sheets.findIndex((s) => s.id === id);\n\t\tif (index === -1) return 0;\n\t\t// Sheets after this index have higher depth (are on top)\n\t\treturn sheets.length - index - 1;\n\t}, [sheets]);\n\n\t// Memoize value - callbacks are stable, only sheets changes\n\tconst value = React.useMemo(\n\t\t() => ({\n\t\t\tsheets,\n\t\t\tsheetSizes,\n\t\t\tstackMode,\n\t\t\tregisterSheet,\n\t\t\tunregisterSheet,\n\t\t\tsetSheetSize,\n\t\t\tgetSheetSize,\n\t\t\tisTopSheet,\n\t\t\tgetSheetsAbove,\n\t\t}),\n\t\t[sheets, sheetSizes, stackMode, registerSheet, unregisterSheet, setSheetSize, getSheetSize, isTopSheet, getSheetsAbove],\n\t);\n\n\treturn <SheetStackContext.Provider value={value}>{children}</SheetStackContext.Provider>;\n}\n\nconst useSheetStack = (): SheetStackContextType | undefined => {\n\treturn React.useContext(SheetStackContext);\n};\n\n// ============================================================================\n// Sheet Nesting Context - Tracks nesting level via React tree\n// ============================================================================\n\ntype SheetNestingContextType = {\n\tlevel: number;\n\tparentSheetId: string | null;\n};\n\nconst SheetNestingContext = React.createContext<SheetNestingContextType>({\n\tlevel: 0,\n\tparentSheetId: null,\n});\n\nconst useSheetNesting = () => React.useContext(SheetNestingContext);\n\n// ============================================================================\n// Individual Sheet Context\n// ============================================================================\n\ntype SheetContextType = {\n\tisOpen: boolean;\n\tsheetId: string;\n\tdepth: number;\n\tsheetsAbove: number;\n\tisTopSheet: boolean;\n\tclose: () => void;\n};\n\nconst SheetContext = React.createContext<SheetContextType | undefined>(undefined);\n\nconst useSheet = (): SheetContextType => {\n\tconst context = React.useContext(SheetContext);\n\tif (!context) {\n\t\tthrow new Error('useSheet must be used within a Sheet');\n\t}\n\treturn context;\n};\n\ntype DialogChangeEventDetails = Parameters<NonNullable<React.ComponentProps<typeof SheetPrimitive.Root>['onOpenChange']>>[1];\n\ntype SheetProps = Omit<React.ComponentProps<typeof SheetPrimitive.Root>, 'onOpenChange'> & {\n\t/** Unique identifier for this sheet in a stack. Auto-generated if not provided. */\n\tsheetId?: string;\n\t/** Callback when open state changes - simplified to just boolean for backwards compatibility */\n\tonOpenChange?: (open: boolean) => void;\n};\n\nfunction Sheet({\n\tchildren,\n\tsheetId: providedId,\n\topen: openProp,\n\tdefaultOpen = false,\n\tonOpenChange,\n\tmodal,\n\t...props\n}: SheetProps) {\n\tconst [isOpen, setIsOpen] = useControllableState({\n\t\tprop: openProp,\n\t\tdefaultProp: defaultOpen,\n\t\tonChange: onOpenChange,\n\t});\n\tconst sheetStack = useSheetStack();\n\tconst nesting = useSheetNesting();\n\tconst generatedId = React.useId();\n\tconst sheetId = providedId ?? `sheet-${generatedId.replace(/:/g, '')}`;\n\n\t// Depth is determined by nesting level in React tree\n\tconst depth = nesting.level;\n\n\tconst close = React.useCallback(() => {\n\t\tsetIsOpen(false);\n\t}, [setIsOpen]);\n\n\tconst registerSheet = sheetStack?.registerSheet;\n\tconst unregisterSheet = sheetStack?.unregisterSheet;\n\n\t// Register/unregister with stack when open state changes\n\tReact.useEffect(() => {\n\t\tif (registerSheet && isOpen) {\n\t\t\t// Close any open dropdowns/popovers by blurring active element\n\t\t\t// This ensures selects close before the sheet stacks on top\n\t\t\tif (document.activeElement instanceof HTMLElement) {\n\t\t\t\tdocument.activeElement.blur();\n\t\t\t}\n\t\t\tregisterSheet({ id: sheetId, depth, close });\n\t\t\treturn () => unregisterSheet?.(sheetId);\n\t\t}\n\t}, [isOpen, sheetId, depth, close, registerSheet, unregisterSheet]);\n\n\t// Base UI owns dismissal details; this adapter preserves the package's boolean callback.\n\tconst handleOpenChange = React.useCallback((open: boolean, _eventDetails: DialogChangeEventDetails) => {\n\t\tsetIsOpen(open);\n\t}, [setIsOpen]);\n\n\t// Calculate sheets above and whether this is the top sheet\n\tconst sheetsAbove = sheetStack?.getSheetsAbove(sheetId) ?? 0;\n\tconst isTopSheet = sheetStack?.isTopSheet(sheetId) ?? true;\n\n\t// Nested sheets must be non-modal to prevent Base UI from closing parent on interaction\n\tconst isNested = depth > 0;\n\n\treturn (\n\t\t<SheetNestingContext.Provider value={{ level: depth + 1, parentSheetId: sheetId }}>\n\t\t\t<SheetContext.Provider value={{ isOpen, sheetId, depth, sheetsAbove, isTopSheet, close }}>\n\t\t\t\t<SheetPrimitive.Root\n\t\t\t\t\tdata-slot=\"sheet\"\n\t\t\t\t\t{...props}\n\t\t\t\t\topen={isOpen}\n\t\t\t\t\tmodal={isNested ? false : modal}\n\t\t\t\t\tonOpenChange={handleOpenChange}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</SheetPrimitive.Root>\n\t\t\t</SheetContext.Provider>\n\t\t</SheetNestingContext.Provider>\n\t);\n}\n\ntype SheetTriggerProps = React.ComponentProps<typeof SheetPrimitive.Trigger> & {\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n};\n\nfunction SheetTrigger({ asChild, children, render, nativeButton, ...props }: SheetTriggerProps) {\n\tconst childRender = render === undefined && asChild && React.isValidElement(children) ? children : undefined;\n\n\treturn (\n\t\t<SheetPrimitive.Trigger\n\t\t\tdata-slot=\"sheet-trigger\"\n\t\t\tnativeButton={nativeButton ?? (childRender ? true : undefined)}\n\t\t\trender={render ?? childRender}\n\t\t\t{...props}\n\t\t>\n\t\t\t{childRender ? undefined : children}\n\t\t</SheetPrimitive.Trigger>\n\t);\n}\n\ntype SheetCloseProps = React.ComponentProps<typeof SheetPrimitive.Close> & {\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n};\n\nfunction SheetClose({ asChild, children, render, nativeButton, ...props }: SheetCloseProps) {\n\tconst childRender = render === undefined && asChild && React.isValidElement(children) ? children : undefined;\n\n\treturn (\n\t\t<SheetPrimitive.Close\n\t\t\tdata-slot=\"sheet-close\"\n\t\t\tnativeButton={nativeButton ?? (childRender ? true : undefined)}\n\t\t\trender={render ?? childRender}\n\t\t\t{...props}\n\t\t>\n\t\t\t{childRender ? undefined : children}\n\t\t</SheetPrimitive.Close>\n\t);\n}\n\ntype SheetPortalProps = React.ComponentProps<typeof SheetPrimitive.Portal> & {\n\t/** @deprecated Base UI manages mounting automatically */\n\tforceMount?: boolean;\n};\n\nfunction SheetPortal({ forceMount: _forceMount, container: containerProp, ...props }: SheetPortalProps) {\n\tconst rootContainer = useRootPortalContainer();\n\tconst container = containerProp === undefined ? (rootContainer ?? undefined) : containerProp;\n\n\tconst style = {\n\t\t...(props.style ?? {}),\n\t\t['--z-layer-floating' as any]: 'var(--z-layer-floating-elevated)',\n\t} satisfies React.CSSProperties;\n\n\treturn <SheetPrimitive.Portal data-slot=\"sheet-portal\" container={container} {...props} style={style} />;\n}\n\ntype SheetOverlayProps = React.HTMLAttributes<HTMLDivElement> & {\n\t/** @deprecated Base UI Backdrop handles child elements natively */\n\tasChild?: boolean;\n\t/** @deprecated Base UI manages mounting automatically */\n\tforceMount?: boolean;\n};\n\nfunction SheetOverlay({ className, asChild: _asChild, forceMount: _forceMount, ...props }: SheetOverlayProps) {\n\treturn (\n\t\t<SheetPrimitive.Backdrop\n\t\t\tdata-slot=\"sheet-overlay\"\n\t\t\tclassName={cn('fixed inset-0 z-[var(--z-layer-modal-backdrop)] bg-black/32 backdrop-blur-sm', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// The panel scrolls itself: content taller than the viewport used to be clipped with no way to reach it. Callers that manage their own\n// scroll region (a `flex-1 min-h-0 overflow-y-auto` body) are unaffected because the sheet then never overflows.\nconst sheetVariants = cva('fixed flex flex-col gap-3 overflow-y-auto overscroll-contain bg-background p-4 shadow-lg outline-hidden [overflow-wrap:break-word]', {\n\tvariants: {\n\t\tside: {\n\t\t\ttop: 'inset-x-0 top-0 max-h-dvh border-b',\n\t\t\tbottom: 'inset-x-0 bottom-0 max-h-dvh border-t',\n\t\t\tleft: 'inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm',\n\t\t\tright: 'inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm',\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tside: 'right',\n\t},\n});\n\ntype SheetContentProps = Omit<React.ComponentProps<typeof SheetPrimitive.Popup>, 'children'> &\n\tVariantProps<typeof sheetVariants> &\n\tHTMLMotionProps<'div'> & {\n\t\ttransition?: Transition;\n\t\toverlay?: boolean;\n\t\t/** Whether to show the close button. Defaults to true. */\n\t\tshowClose?: boolean;\n\t\tchildren?: React.ReactNode;\n\t\t/** @deprecated Base UI manages mounting automatically */\n\t\tforceMount?: boolean;\n\t\t/** @deprecated Use onOpenChange on Root instead */\n\t\tonInteractOutside?: (e: Event) => void;\n\t\t/** @deprecated Use onOpenChange on Root instead */\n\t\tonPointerDownOutside?: (e: Event) => void;\n\t\t/** @deprecated Use onOpenChange on Root instead */\n\t\tonEscapeKeyDown?: (e: KeyboardEvent) => void;\n\t\t/** @deprecated Use onOpenChange on Root instead */\n\t\tonFocusOutside?: (e: Event) => void;\n\t};\n\n// Default width for nested sheets (used for collapse mode calculations)\n// Using max-w-md (28rem = 448px) as the typical nested sheet width\nconst NESTED_SHEET_WIDTH = 448;\n\n// Gap between the top two visible sheets in collapse mode\nconst SHEET_STACK_GAP = 0;\n\n/**\n * Calculate the push offset based on side, number of sheets above, and stack mode.\n * - 'cascade': Each sheet is incrementally indented by SHEET_INDENT per layer above\n * - 'collapse': Bottom sheets are pushed to opposite side to make room for top sheet\n */\nfunction getPushOffset(\n\tside: 'top' | 'bottom' | 'left' | 'right',\n\tsheetsAbove: number,\n\tstackMode: StackMode = 'cascade',\n\tcollapseBaseSize: number = NESTED_SHEET_WIDTH,\n): { x?: number | string; y?: number | string } {\n\tif (sheetsAbove === 0) {\n\t\treturn { x: 0, y: 0 };\n\t}\n\n\tif (stackMode === 'collapse') {\n\t\t// Keep the top 2 sheets visible:\n\t\t// - The sheet directly under the top is pushed by (top sheet width + small gap)\n\t\t// - Deeper sheets cascade under that with a small indent per extra layer\n\t\tconst baseOffset = collapseBaseSize + SHEET_STACK_GAP;\n\t\tconst offset = baseOffset + (sheetsAbove - 1) * SHEET_INDENT;\n\n\t\tswitch (side) {\n\t\t\tcase 'right':\n\t\t\t\treturn { x: -offset };\n\t\t\tcase 'left':\n\t\t\t\treturn { x: offset };\n\t\t\tcase 'top':\n\t\t\t\treturn { y: offset };\n\t\t\tcase 'bottom':\n\t\t\t\treturn { y: -offset };\n\t\t}\n\t}\n\n\t// Cascade mode: incremental indent\n\tconst offset = sheetsAbove * SHEET_INDENT;\n\n\tswitch (side) {\n\t\tcase 'right':\n\t\t\treturn { x: -offset };\n\t\tcase 'left':\n\t\t\treturn { x: offset };\n\t\tcase 'top':\n\t\t\treturn { y: offset };\n\t\tcase 'bottom':\n\t\t\treturn { y: -offset };\n\t}\n}\n\n/**\n * Get the initial position for sheet animation based on side.\n * Pure transform animation for GPU acceleration - no opacity/scale changes.\n */\nfunction getInitialPosition(side: 'top' | 'bottom' | 'left' | 'right') {\n\tswitch (side) {\n\t\tcase 'right':\n\t\t\treturn { x: '100%' };\n\t\tcase 'left':\n\t\t\treturn { x: '-100%' };\n\t\tcase 'top':\n\t\t\treturn { y: '-100%' };\n\t\tcase 'bottom':\n\t\t\treturn { y: '100%' };\n\t}\n}\n\n/**\n * Get the exit position for sheet animation based on side.\n * Pure transform for smooth GPU-accelerated exit.\n */\nfunction getExitPosition(side: 'top' | 'bottom' | 'left' | 'right') {\n\tswitch (side) {\n\t\tcase 'right':\n\t\t\treturn { x: '100%' };\n\t\tcase 'left':\n\t\t\treturn { x: '-100%' };\n\t\tcase 'top':\n\t\t\treturn { y: '-100%' };\n\t\tcase 'bottom':\n\t\t\treturn { y: '100%' };\n\t}\n}\n\nfunction SheetContent({\n\tside = 'right',\n\tclassName,\n\ttransition,\n\toverlay = true,\n\tshowClose = true,\n\tchildren,\n\tforceMount: _forceMount,\n\tonInteractOutside: _onInteractOutside,\n\tonPointerDownOutside: _onPointerDownOutside,\n\tonEscapeKeyDown: _onEscapeKeyDown,\n\tonFocusOutside: _onFocusOutside,\n\tinitialFocus,\n\t...props\n}: SheetContentProps) {\n\tconst { isOpen, depth, sheetId } = useSheet();\n\tconst springTiers = useSpringTiers();\n\tconst sheetStack = useSheetStack();\n\n\t// Calculate sheetsAbove directly from stack to ensure it's always current\n\t// sheetsAbove = number of sheets with higher depth (on top of this one)\n\tconst sheetsAbove = sheetStack?.getSheetsAbove(sheetId) ?? 0;\n\tconst stackMode = sheetStack?.stackMode ?? 'cascade';\n\n\t// Ensure side is never null (default already handles undefined, but TS needs explicit assertion)\n\tconst resolvedSide = side ?? 'right';\n\n\t// Calculate z-index based on depth (base modal content z-index + depth * 10)\n\t// We use a calc() string to reference the CSS variable\n\tconst zIndex = `calc(var(--z-layer-modal-content) + ${depth * 10})`;\n\n\t// Push offset for when sheets are stacked above this one\n\t// sheetsAbove > 0 means there are sheets on top, so this sheet should be pushed back\n\tconst topSheetId = sheetStack?.sheets[sheetStack.sheets.length - 1]?.id;\n\tconst topSheetSize = topSheetId ? sheetStack?.getSheetSize(topSheetId) : undefined;\n\tconst collapseBaseSize = topSheetSize\n\t\t? resolvedSide === 'left' || resolvedSide === 'right'\n\t\t\t? topSheetSize.width\n\t\t\t: topSheetSize.height\n\t\t: undefined;\n\n\tconst pushOffset = getPushOffset(resolvedSide, sheetsAbove, stackMode, collapseBaseSize ?? NESTED_SHEET_WIDTH);\n\n\tconst contentRef = React.useRef<HTMLDivElement>(null);\n\tReact.useLayoutEffect(() => {\n\t\tif (!isOpen) return;\n\t\tif (!sheetStack) return;\n\t\tconst el = contentRef.current;\n\t\tif (!el) return;\n\t\tlet rafId = 0;\n\t\tconst update = () => {\n\t\t\tconst rect = el.getBoundingClientRect();\n\t\t\tsheetStack.setSheetSize(sheetId, { width: rect.width, height: rect.height });\n\t\t};\n\t\tupdate();\n\t\tif (typeof ResizeObserver === 'undefined') return;\n\t\tconst ro = new ResizeObserver(() => {\n\t\t\tcancelAnimationFrame(rafId);\n\t\t\trafId = requestAnimationFrame(update);\n\t\t});\n\t\tro.observe(el);\n\t\treturn () => {\n\t\t\tcancelAnimationFrame(rafId);\n\t\t\tro.disconnect();\n\t\t};\n\t}, [isOpen, sheetId, sheetStack]);\n\n\t// Animate position includes base position (0) plus any push offset\n\t// Only transform properties for GPU acceleration\n\tconst animatePosition = {\n\t\tx: pushOffset.x ?? 0,\n\t\ty: pushOffset.y ?? 0,\n\t};\n\n\t// Enter rides the slow spring tier; exits use the quicker exit tween.\n\tconst enterTransition = transition ?? tierSpring(springTiers.slow);\n\tconst exitTransition = tierExit(springTiers.slow);\n\n\treturn (\n\t\t<AnimatePresence initial={false}>\n\t\t\t{isOpen && (\n\t\t\t\t<SheetPortal data-slot='sheet-portal'>\n\t\t\t\t\t{/* Only show overlay for the first (bottom-most) sheet in stack */}\n\t\t\t\t\t{overlay && depth === 0 && (\n\t\t\t\t\t\t<SheetPrimitive.Backdrop\n\t\t\t\t\t\t\tdata-slot=\"sheet-overlay\"\n\t\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\tkey='sheet-overlay'\n\t\t\t\t\t\t\t\t\tclassName='fixed inset-0 bg-black/32 backdrop-blur-sm'\n\t\t\t\t\t\t\t\t\tinitial={{ opacity: 0 }}\n\t\t\t\t\t\t\t\t\tanimate={{ opacity: 1 }}\n\t\t\t\t\t\t\t\t\texit={{ opacity: 0 }}\n\t\t\t\t\t\t\t\t\ttransition={{ duration: springTiers.moderate.duration, ease: easings.easeOut }}\n\t\t\t\t\t\t\t\t\tstyle={{ zIndex: 'var(--z-layer-modal-backdrop)' }}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t<SheetPrimitive.Popup\n\t\t\t\t\t\tdata-slot=\"sheet-content\"\n\t\t\t\t\t\tdata-sheet-depth={depth}\n\t\t\t\t\t\tdata-sheet-id={sheetId}\n\t\t\t\t\t\t// A sheet that scrolls opens at its top, not scrolled to a footer button that is first in tab order.\n\t\t\t\t\t\t// Leaving `initialFocus` out and passing `undefined` are the same thing: both get this default.\n\t\t\t\t\t\tinitialFocus={initialFocus ?? scrollSafeInitialFocus(() => contentRef.current)}\n\t\t\t\t\t\t{...props}\n\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\tkey={`sheet-content-${sheetId}`}\n\t\t\t\t\t\t\t\tref={contentRef}\n\t\t\t\t\t\t\t\tvariants={{\n\t\t\t\t\t\t\t\t\tinitial: getInitialPosition(resolvedSide),\n\t\t\t\t\t\t\t\t\tanimate: animatePosition,\n\t\t\t\t\t\t\t\t\texit: {\n\t\t\t\t\t\t\t\t\t\t...getExitPosition(resolvedSide),\n\t\t\t\t\t\t\t\t\t\ttransition: exitTransition,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tinitial='initial'\n\t\t\t\t\t\t\t\tanimate='animate'\n\t\t\t\t\t\t\t\texit='exit'\n\t\t\t\t\t\t\t\ttransition={enterTransition}\n\t\t\t\t\t\t\t\tstyle={{ zIndex }}\n\t\t\t\t\t\t\t\tclassName={cn(sheetVariants({ side: resolvedSide }), className)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{/* ModalPortalScope creates a scoped portal container for floating elements inside */}\n\t\t\t\t\t\t<ModalPortalScope>\n\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t</ModalPortalScope>\n\t\t\t\t\t\t{showClose && (\n\t\t\t\t\t\t\t<SheetPrimitive.Close\n\t\t\t\t\t\t\t\tdata-slot=\"sheet-close\"\n\t\t\t\t\t\t\t\tclassName='data-[open]:bg-secondary absolute top-4 end-4\n\t\t\t\t\t\t\t\t\trounded-sm opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50\n\t\t\t\t\t\t\t\t disabled:pointer-events-none'\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<X className='h-4 w-4' />\n\t\t\t\t\t\t\t\t<span className='sr-only'>Close</span>\n\t\t\t\t\t\t\t</SheetPrimitive.Close>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</SheetPrimitive.Popup>\n\t\t\t\t</SheetPortal>\n\t\t\t)}\n\t\t</AnimatePresence>\n\t);\n}\n\ntype SheetHeaderProps = React.ComponentProps<'div'> & {\n\t/** `band` tints the header and closes it with a hairline, edge to edge. */\n\tvariant?: 'default' | 'band';\n};\n\nfunction SheetHeader({ className, variant = 'default', ...props }: SheetHeaderProps) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"sheet-header\"\n\t\t\tdata-variant={variant}\n\t\t\tclassName={cn(\n\t\t\t\t'flex flex-col space-y-2',\n\t\t\t\t// `pe-6` keeps the title clear of the close button.\n\t\t\t\tvariant === 'default' && 'pb-4 pe-6 text-center sm:text-start',\n\t\t\t\t// Bleeds through SheetContent's p-4 to the panel edges.\n\t\t\t\tvariant === 'band' && '-mx-4 -mt-4 border-b bg-muted/50 p-4 pe-12 text-start',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\ntype SheetFooterProps = React.ComponentProps<'div'> & {\n\t/** `band` pins a tinted footer to the bottom edge, closed off by a hairline. */\n\tvariant?: 'default' | 'band';\n};\n\nfunction SheetFooter({ className, variant = 'default', ...props }: SheetFooterProps) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"sheet-footer\"\n\t\t\tdata-variant={variant}\n\t\t\tclassName={cn(\n\t\t\t\t'flex flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:justify-end',\n\t\t\t\tvariant === 'default' && 'pt-4',\n\t\t\t\tvariant === 'band' && '-mx-4 mt-auto -mb-4 border-t bg-muted/50 px-4 py-3',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\ntype SheetTitleProps = React.ComponentProps<typeof SheetPrimitive.Title>;\n\nfunction SheetTitle({ className, ...props }: SheetTitleProps) {\n\treturn (\n\t\t<SheetPrimitive.Title\n\t\t\tdata-slot=\"sheet-title\"\n\t\t\tclassName={cn('text-foreground text-lg font-semibold', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\ntype SheetDescriptionProps = React.ComponentProps<typeof SheetPrimitive.Description>;\n\nfunction SheetDescription({ className, ...props }: SheetDescriptionProps) {\n\treturn (\n\t\t<SheetPrimitive.Description\n\t\t\tdata-slot=\"sheet-description\"\n\t\t\tclassName={cn('text-muted-foreground text-sm', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\t// Stack provider for nested sheets\n\tSheetStackProvider,\n\tuseSheetStack,\n\t// Individual sheet hooks\n\tuseSheet,\n\t// Components\n\tSheet,\n\tSheetPortal,\n\tSheetOverlay,\n\tSheetTrigger,\n\tSheetClose,\n\tSheetContent,\n\tSheetHeader,\n\tSheetFooter,\n\tSheetTitle,\n\tSheetDescription,\n\t// Constants\n\tSHEET_INDENT,\n\t// Types\n\ttype StackMode,\n\ttype SheetStackProviderProps,\n\ttype SheetProps,\n\ttype SheetPortalProps,\n\ttype SheetOverlayProps,\n\ttype SheetTriggerProps,\n\ttype SheetCloseProps,\n\ttype SheetContentProps,\n\ttype SheetHeaderProps,\n\ttype SheetFooterProps,\n\ttype SheetTitleProps,\n\ttype SheetDescriptionProps,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAYA,SAAgB,qBAAwB,EACvC,MACA,aACA,YAC0D;CAC1D,MAAM,CAAC,mBAAmB,wBAAwB,SAAY,WAAgB;CAC9E,MAAM,eAAe,SAAS;CAC9B,MAAM,QAAQ,eAAe,OAAO;CAGpC,MAAM,cAAc,OAAO,QAAQ;CACnC,gBAAgB;EACf,YAAY,UAAU;CACvB,GAAG,CAAC,QAAQ,CAAC;CAYb,OAAO,CAAC,OAVS,aACf,aAAgB;EAChB,IAAI,CAAC,cACJ,qBAAqB,QAAQ;EAE9B,YAAY,UAAU,QAAQ;CAC/B,GACA,CAAC,YAAY,CAGQ,CAAC;AACxB;;;;ACMA,MAAM,oBAAoBA,QAAM,cAAiD,MAAS;AAE1F,MAAM,eAAe;AAWrB,SAAS,mBAAmB,EAAE,UAAU,YAAY,aAAsC;CACzF,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KACZ,OAAO,EAAE,OAAO;KAChB,WAAW,GAAG,cAAc,EAAE,MAAM,aAAa,CAAC,GAAG,SAAS;IAC9D,GAhBK,iBAAiB,SAgBtB;cA1BH,CA8BC,oBAAC,kBAAD,EACE,SACgB,IACjB,aACA,qBAACA,OAAe,OAAhB;KACC,aAAU;KACV,WAAU;eAFX,CAMC,oBAAC,GAAD,EAAG,WAAU,UAAW,IACxB,oBAAC,QAAD;MAAM,WAAU;gBAAU;KAAW,EAChB;MAEF;KACV;;CAEE;AAEnB;AAOA,SAAS,YAAY,EAAE,WAAW,UAAU,WAAW,GAAG,SAA2B;CACpF,OACC,oBAAC,OAAD;EACC,aAAU;EACV,gBAAc;EACd,WAAW,GACV,2BAEA,YAAY,aAAa,uCAEzB,YAAY,UAAU,yDACtB,SACD;EACA,GAAI;CACJ;AAEH;AAOA,SAAS,YAAY,EAAE,WAAW,UAAU,WAAW,GAAG,SAA2B;CACpF,OACC,oBAAC,OAAD;EACC,aAAU;EACV,gBAAc;EACd,WAAW,GACV,uEACA,YAAY,aAAa,QACzB,YAAY,UAAU,sDACtB,SACD;EACA,GAAI;CACJ;AAEH;AAIA,SAAS,WAAW,EAAE,WAAW,GAAG,SAA0B;CAC7D,OACC,oBAACA,OAAe,OAAhB;EACC,aAAU;EACV,WAAW,GAAG,yCAAyC,SAAS;EAChE,GAAI;CACJ;AAEH;AAIA,SAAS,iBAAiB,EAAE,WAAW,GAAG,SAAgC;CACzE,OACC,oBAACA,OAAe,aAAhB;EACC,aAAU;EACV,WAAW,GAAG,iCAAiC,SAAS;EACxD,GAAI;CACJ;AAEH"}
|
|
1
|
+
{"version":3,"file":"sheet-LOK_d8-K.js","names":["React","SheetPrimitive"],"sources":["../src/lib/use-controllable-state.ts","../src/components/sheet.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\n\ntype UseControllableStateParams<T> = {\n\tprop?: T;\n\tdefaultProp?: T;\n\tonChange?: (value: T) => void;\n};\n\n/**\n * Hook for managing controlled/uncontrolled state.\n * Supports both controlled (prop-driven) and uncontrolled (internal state) patterns.\n */\nexport function useControllableState<T>({\n\tprop,\n\tdefaultProp,\n\tonChange,\n}: UseControllableStateParams<T>): [T, (value: T) => void] {\n\tconst [uncontrolledValue, setUncontrolledValue] = useState<T>(defaultProp as T);\n\tconst isControlled = prop !== undefined;\n\tconst value = isControlled ? prop : uncontrolledValue;\n\n\t// Store onChange in ref to keep callback stable\n\tconst onChangeRef = useRef(onChange);\n\tuseEffect(() => {\n\t\tonChangeRef.current = onChange;\n\t}, [onChange]);\n\n\tconst setValue = useCallback(\n\t\t(newValue: T) => {\n\t\t\tif (!isControlled) {\n\t\t\t\tsetUncontrolledValue(newValue);\n\t\t\t}\n\t\t\tonChangeRef.current?.(newValue);\n\t\t},\n\t\t[isControlled],\n\t);\n\n\treturn [value, setValue];\n}\n","'use client';\n\nimport * as React from 'react';\nimport { Dialog as SheetPrimitive } from '@base-ui/react/dialog';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { X } from 'lucide-react';\nimport { AnimatePresence, motion, type HTMLMotionProps, type Transition } from 'motion/react';\n\nimport { scrollSafeInitialFocus } from '../lib/initial-focus';\nimport { easings, tierExit, tierSpring } from '../lib/motion/motion-config';\nimport { useSpringTiers } from '../lib/motion/tuning';\nimport { useControllableState } from '../lib/use-controllable-state';\nimport { ModalPortalScope, useRootPortalContainer } from '@constructive-io/ui/portal';\nimport { cn } from '../lib/utils';\n\n// ============================================================================\n// Sheet Stack Context - Manages nested/stacked sheets\n// ============================================================================\n\ntype SheetInfo = {\n\tid: string;\n\tdepth: number;\n\tclose: () => void;\n};\n\ntype SheetSize = {\n\twidth: number;\n\theight: number;\n};\n\ntype StackMode = 'cascade' | 'collapse';\n\ntype SheetStackContextType = {\n\tsheets: SheetInfo[];\n\tsheetSizes: Record<string, SheetSize | undefined>;\n\tstackMode: StackMode;\n\tregisterSheet: (info: SheetInfo) => void;\n\tunregisterSheet: (id: string) => void;\n\tsetSheetSize: (id: string, size: SheetSize) => void;\n\tgetSheetSize: (id: string) => SheetSize | undefined;\n\tisTopSheet: (id: string) => boolean;\n\tgetSheetsAbove: (id: string) => number;\n};\n\nconst SheetStackContext = React.createContext<SheetStackContextType | undefined>(undefined);\n\nconst SHEET_INDENT = 24; // pixels to push outer sheets when inner opens\n\ntype SheetStackProviderProps = {\n\tchildren: React.ReactNode;\n\t/** Controls how sheets are pushed when stacking.\n\t * - 'cascade' (default): Each sheet is incrementally indented by SHEET_INDENT\n\t * - 'collapse': Only the sheet directly below the top gets full-width push, others cascade relative to it\n\t */\n\tstackMode?: StackMode;\n};\n\nfunction SheetStackProvider({ children, stackMode = 'cascade' }: SheetStackProviderProps) {\n\tconst [sheets, setSheets] = React.useState<SheetInfo[]>([]);\n\tconst [sheetSizes, setSheetSizes] = React.useState<Record<string, SheetSize | undefined>>({});\n\n\t// Register sheet - insert sorted by depth (lower depth = earlier in array)\n\t// This ensures sheets are ordered correctly regardless of registration timing\n\tconst registerSheet = React.useCallback((info: SheetInfo) => {\n\t\tsetSheets((prev) => {\n\t\t\tif (prev.some((s) => s.id === info.id)) return prev;\n\t\t\t// Insert in sorted order by depth\n\t\t\tconst newSheets = [...prev, info];\n\t\t\tnewSheets.sort((a, b) => a.depth - b.depth);\n\t\t\treturn newSheets;\n\t\t});\n\t}, []);\n\n\tconst unregisterSheet = React.useCallback((id: string) => {\n\t\tsetSheets((prev) => prev.filter((s) => s.id !== id));\n\t\tsetSheetSizes((prev) => {\n\t\t\tif (!prev[id]) return prev;\n\t\t\tconst next = { ...prev };\n\t\t\tdelete next[id];\n\t\t\treturn next;\n\t\t});\n\t}, []);\n\n\tconst setSheetSize = React.useCallback((id: string, size: SheetSize) => {\n\t\tsetSheetSizes((prev) => {\n\t\t\tconst current = prev[id];\n\t\t\tif (current && current.width === size.width && current.height === size.height) return prev;\n\t\t\treturn { ...prev, [id]: size };\n\t\t});\n\t}, []);\n\n\tconst getSheetSize = React.useCallback((id: string) => sheetSizes[id], [sheetSizes]);\n\n\t// Topmost sheet = highest depth = last in sorted array\n\tconst isTopSheet = React.useCallback((id: string) => {\n\t\tif (sheets.length === 0) return false;\n\t\treturn sheets[sheets.length - 1]?.id === id;\n\t}, [sheets]);\n\n\t// Sheets above = sheets with higher depth than this one\n\tconst getSheetsAbove = React.useCallback((id: string) => {\n\t\tconst index = sheets.findIndex((s) => s.id === id);\n\t\tif (index === -1) return 0;\n\t\t// Sheets after this index have higher depth (are on top)\n\t\treturn sheets.length - index - 1;\n\t}, [sheets]);\n\n\t// Memoize value - callbacks are stable, only sheets changes\n\tconst value = React.useMemo(\n\t\t() => ({\n\t\t\tsheets,\n\t\t\tsheetSizes,\n\t\t\tstackMode,\n\t\t\tregisterSheet,\n\t\t\tunregisterSheet,\n\t\t\tsetSheetSize,\n\t\t\tgetSheetSize,\n\t\t\tisTopSheet,\n\t\t\tgetSheetsAbove,\n\t\t}),\n\t\t[sheets, sheetSizes, stackMode, registerSheet, unregisterSheet, setSheetSize, getSheetSize, isTopSheet, getSheetsAbove],\n\t);\n\n\treturn <SheetStackContext.Provider value={value}>{children}</SheetStackContext.Provider>;\n}\n\nconst useSheetStack = (): SheetStackContextType | undefined => {\n\treturn React.useContext(SheetStackContext);\n};\n\n// ============================================================================\n// Sheet Nesting Context - Tracks nesting level via React tree\n// ============================================================================\n\ntype SheetNestingContextType = {\n\tlevel: number;\n\tparentSheetId: string | null;\n};\n\nconst SheetNestingContext = React.createContext<SheetNestingContextType>({\n\tlevel: 0,\n\tparentSheetId: null,\n});\n\nconst useSheetNesting = () => React.useContext(SheetNestingContext);\n\n// ============================================================================\n// Individual Sheet Context\n// ============================================================================\n\ntype SheetContextType = {\n\tisOpen: boolean;\n\tsheetId: string;\n\tdepth: number;\n\tsheetsAbove: number;\n\tisTopSheet: boolean;\n\tclose: () => void;\n};\n\nconst SheetContext = React.createContext<SheetContextType | undefined>(undefined);\n\nconst useSheet = (): SheetContextType => {\n\tconst context = React.useContext(SheetContext);\n\tif (!context) {\n\t\tthrow new Error('useSheet must be used within a Sheet');\n\t}\n\treturn context;\n};\n\ntype DialogChangeEventDetails = Parameters<NonNullable<React.ComponentProps<typeof SheetPrimitive.Root>['onOpenChange']>>[1];\n\ntype SheetProps = Omit<React.ComponentProps<typeof SheetPrimitive.Root>, 'onOpenChange'> & {\n\t/** Unique identifier for this sheet in a stack. Auto-generated if not provided. */\n\tsheetId?: string;\n\t/** Callback when open state changes - simplified to just boolean for backwards compatibility */\n\tonOpenChange?: (open: boolean) => void;\n};\n\nfunction Sheet({\n\tchildren,\n\tsheetId: providedId,\n\topen: openProp,\n\tdefaultOpen = false,\n\tonOpenChange,\n\tmodal,\n\t...props\n}: SheetProps) {\n\tconst [isOpen, setIsOpen] = useControllableState({\n\t\tprop: openProp,\n\t\tdefaultProp: defaultOpen,\n\t\tonChange: onOpenChange,\n\t});\n\tconst sheetStack = useSheetStack();\n\tconst nesting = useSheetNesting();\n\tconst generatedId = React.useId();\n\tconst sheetId = providedId ?? `sheet-${generatedId.replace(/:/g, '')}`;\n\n\t// Depth is determined by nesting level in React tree\n\tconst depth = nesting.level;\n\n\tconst close = React.useCallback(() => {\n\t\tsetIsOpen(false);\n\t}, [setIsOpen]);\n\n\tconst registerSheet = sheetStack?.registerSheet;\n\tconst unregisterSheet = sheetStack?.unregisterSheet;\n\n\t// Register/unregister with stack when open state changes\n\tReact.useEffect(() => {\n\t\tif (registerSheet && isOpen) {\n\t\t\t// Close any open dropdowns/popovers by blurring active element\n\t\t\t// This ensures selects close before the sheet stacks on top\n\t\t\tif (document.activeElement instanceof HTMLElement) {\n\t\t\t\tdocument.activeElement.blur();\n\t\t\t}\n\t\t\tregisterSheet({ id: sheetId, depth, close });\n\t\t\treturn () => unregisterSheet?.(sheetId);\n\t\t}\n\t}, [isOpen, sheetId, depth, close, registerSheet, unregisterSheet]);\n\n\t// Base UI owns dismissal details; this adapter preserves the package's boolean callback.\n\tconst handleOpenChange = React.useCallback((open: boolean, _eventDetails: DialogChangeEventDetails) => {\n\t\tsetIsOpen(open);\n\t}, [setIsOpen]);\n\n\t// Calculate sheets above and whether this is the top sheet\n\tconst sheetsAbove = sheetStack?.getSheetsAbove(sheetId) ?? 0;\n\tconst isTopSheet = sheetStack?.isTopSheet(sheetId) ?? true;\n\n\t// Nested sheets must be non-modal to prevent Base UI from closing parent on interaction\n\tconst isNested = depth > 0;\n\n\treturn (\n\t\t<SheetNestingContext.Provider value={{ level: depth + 1, parentSheetId: sheetId }}>\n\t\t\t<SheetContext.Provider value={{ isOpen, sheetId, depth, sheetsAbove, isTopSheet, close }}>\n\t\t\t\t<SheetPrimitive.Root\n\t\t\t\t\tdata-slot=\"sheet\"\n\t\t\t\t\t{...props}\n\t\t\t\t\topen={isOpen}\n\t\t\t\t\tmodal={isNested ? false : modal}\n\t\t\t\t\tonOpenChange={handleOpenChange}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</SheetPrimitive.Root>\n\t\t\t</SheetContext.Provider>\n\t\t</SheetNestingContext.Provider>\n\t);\n}\n\ntype SheetTriggerProps = React.ComponentProps<typeof SheetPrimitive.Trigger> & {\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n};\n\nfunction SheetTrigger({ asChild, children, render, nativeButton, ...props }: SheetTriggerProps) {\n\tconst childRender = render === undefined && asChild && React.isValidElement(children) ? children : undefined;\n\n\treturn (\n\t\t<SheetPrimitive.Trigger\n\t\t\tdata-slot=\"sheet-trigger\"\n\t\t\tnativeButton={nativeButton ?? (childRender ? true : undefined)}\n\t\t\trender={render ?? childRender}\n\t\t\t{...props}\n\t\t>\n\t\t\t{childRender ? undefined : children}\n\t\t</SheetPrimitive.Trigger>\n\t);\n}\n\ntype SheetCloseProps = React.ComponentProps<typeof SheetPrimitive.Close> & {\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n};\n\nfunction SheetClose({ asChild, children, render, nativeButton, ...props }: SheetCloseProps) {\n\tconst childRender = render === undefined && asChild && React.isValidElement(children) ? children : undefined;\n\n\treturn (\n\t\t<SheetPrimitive.Close\n\t\t\tdata-slot=\"sheet-close\"\n\t\t\tnativeButton={nativeButton ?? (childRender ? true : undefined)}\n\t\t\trender={render ?? childRender}\n\t\t\t{...props}\n\t\t>\n\t\t\t{childRender ? undefined : children}\n\t\t</SheetPrimitive.Close>\n\t);\n}\n\ntype SheetPortalProps = React.ComponentProps<typeof SheetPrimitive.Portal> & {\n\t/** @deprecated Base UI manages mounting automatically */\n\tforceMount?: boolean;\n};\n\nfunction SheetPortal({ forceMount: _forceMount, container: containerProp, ...props }: SheetPortalProps) {\n\tconst rootContainer = useRootPortalContainer();\n\tconst container = containerProp === undefined ? (rootContainer ?? undefined) : containerProp;\n\n\tconst style = {\n\t\t...(props.style ?? {}),\n\t\t['--z-layer-floating' as any]: 'var(--z-layer-floating-elevated)',\n\t} satisfies React.CSSProperties;\n\n\treturn <SheetPrimitive.Portal data-slot=\"sheet-portal\" container={container} {...props} style={style} />;\n}\n\ntype SheetOverlayProps = React.HTMLAttributes<HTMLDivElement> & {\n\t/** @deprecated Base UI Backdrop handles child elements natively */\n\tasChild?: boolean;\n\t/** @deprecated Base UI manages mounting automatically */\n\tforceMount?: boolean;\n};\n\nfunction SheetOverlay({ className, asChild: _asChild, forceMount: _forceMount, ...props }: SheetOverlayProps) {\n\treturn (\n\t\t<SheetPrimitive.Backdrop\n\t\t\tdata-slot=\"sheet-overlay\"\n\t\t\tclassName={cn('fixed inset-0 z-[var(--z-layer-modal-backdrop)] bg-black/32 backdrop-blur-sm', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// The panel scrolls itself: content taller than the viewport used to be clipped with no way to reach it. Callers that manage their own\n// scroll region (a `flex-1 min-h-0 overflow-y-auto` body) are unaffected because the sheet then never overflows.\nconst sheetVariants = cva('fixed flex flex-col gap-3 overflow-y-auto overscroll-contain bg-background p-4 shadow-lg outline-hidden [overflow-wrap:break-word]', {\n\tvariants: {\n\t\tside: {\n\t\t\ttop: 'inset-x-0 top-0 max-h-dvh border-b',\n\t\t\tbottom: 'inset-x-0 bottom-0 max-h-dvh border-t',\n\t\t\tleft: 'inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm',\n\t\t\tright: 'inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm',\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tside: 'right',\n\t},\n});\n\ntype SheetContentProps = Omit<React.ComponentProps<typeof SheetPrimitive.Popup>, 'children'> &\n\tVariantProps<typeof sheetVariants> &\n\tHTMLMotionProps<'div'> & {\n\t\ttransition?: Transition;\n\t\toverlay?: boolean;\n\t\t/** Whether to show the close button. Defaults to true. */\n\t\tshowClose?: boolean;\n\t\tchildren?: React.ReactNode;\n\t\t/** @deprecated Base UI manages mounting automatically */\n\t\tforceMount?: boolean;\n\t\t/** @deprecated Use onOpenChange on Root instead */\n\t\tonInteractOutside?: (e: Event) => void;\n\t\t/** @deprecated Use onOpenChange on Root instead */\n\t\tonPointerDownOutside?: (e: Event) => void;\n\t\t/** @deprecated Use onOpenChange on Root instead */\n\t\tonEscapeKeyDown?: (e: KeyboardEvent) => void;\n\t\t/** @deprecated Use onOpenChange on Root instead */\n\t\tonFocusOutside?: (e: Event) => void;\n\t};\n\n// Default width for nested sheets (used for collapse mode calculations)\n// Using max-w-md (28rem = 448px) as the typical nested sheet width\nconst NESTED_SHEET_WIDTH = 448;\n\n// Gap between the top two visible sheets in collapse mode\nconst SHEET_STACK_GAP = 0;\n\n/**\n * Calculate the push offset based on side, number of sheets above, and stack mode.\n * - 'cascade': Each sheet is incrementally indented by SHEET_INDENT per layer above\n * - 'collapse': Bottom sheets are pushed to opposite side to make room for top sheet\n */\nfunction getPushOffset(\n\tside: 'top' | 'bottom' | 'left' | 'right',\n\tsheetsAbove: number,\n\tstackMode: StackMode = 'cascade',\n\tcollapseBaseSize: number = NESTED_SHEET_WIDTH,\n): { x?: number | string; y?: number | string } {\n\tif (sheetsAbove === 0) {\n\t\treturn { x: 0, y: 0 };\n\t}\n\n\tif (stackMode === 'collapse') {\n\t\t// Keep the top 2 sheets visible:\n\t\t// - The sheet directly under the top is pushed by (top sheet width + small gap)\n\t\t// - Deeper sheets cascade under that with a small indent per extra layer\n\t\tconst baseOffset = collapseBaseSize + SHEET_STACK_GAP;\n\t\tconst offset = baseOffset + (sheetsAbove - 1) * SHEET_INDENT;\n\n\t\tswitch (side) {\n\t\t\tcase 'right':\n\t\t\t\treturn { x: -offset };\n\t\t\tcase 'left':\n\t\t\t\treturn { x: offset };\n\t\t\tcase 'top':\n\t\t\t\treturn { y: offset };\n\t\t\tcase 'bottom':\n\t\t\t\treturn { y: -offset };\n\t\t}\n\t}\n\n\t// Cascade mode: incremental indent\n\tconst offset = sheetsAbove * SHEET_INDENT;\n\n\tswitch (side) {\n\t\tcase 'right':\n\t\t\treturn { x: -offset };\n\t\tcase 'left':\n\t\t\treturn { x: offset };\n\t\tcase 'top':\n\t\t\treturn { y: offset };\n\t\tcase 'bottom':\n\t\t\treturn { y: -offset };\n\t}\n}\n\n/**\n * Get the initial position for sheet animation based on side.\n * Pure transform animation for GPU acceleration - no opacity/scale changes.\n */\nfunction getInitialPosition(side: 'top' | 'bottom' | 'left' | 'right') {\n\tswitch (side) {\n\t\tcase 'right':\n\t\t\treturn { x: '100%' };\n\t\tcase 'left':\n\t\t\treturn { x: '-100%' };\n\t\tcase 'top':\n\t\t\treturn { y: '-100%' };\n\t\tcase 'bottom':\n\t\t\treturn { y: '100%' };\n\t}\n}\n\n/**\n * Get the exit position for sheet animation based on side.\n * Pure transform for smooth GPU-accelerated exit.\n */\nfunction getExitPosition(side: 'top' | 'bottom' | 'left' | 'right') {\n\tswitch (side) {\n\t\tcase 'right':\n\t\t\treturn { x: '100%' };\n\t\tcase 'left':\n\t\t\treturn { x: '-100%' };\n\t\tcase 'top':\n\t\t\treturn { y: '-100%' };\n\t\tcase 'bottom':\n\t\t\treturn { y: '100%' };\n\t}\n}\n\nfunction SheetContent({\n\tside = 'right',\n\tclassName,\n\ttransition,\n\toverlay = true,\n\tshowClose = true,\n\tchildren,\n\tforceMount: _forceMount,\n\tonInteractOutside: _onInteractOutside,\n\tonPointerDownOutside: _onPointerDownOutside,\n\tonEscapeKeyDown: _onEscapeKeyDown,\n\tonFocusOutside: _onFocusOutside,\n\tinitialFocus,\n\t...props\n}: SheetContentProps) {\n\tconst { isOpen, depth, sheetId } = useSheet();\n\tconst springTiers = useSpringTiers();\n\tconst sheetStack = useSheetStack();\n\n\t// Calculate sheetsAbove directly from stack to ensure it's always current\n\t// sheetsAbove = number of sheets with higher depth (on top of this one)\n\tconst sheetsAbove = sheetStack?.getSheetsAbove(sheetId) ?? 0;\n\tconst stackMode = sheetStack?.stackMode ?? 'cascade';\n\n\t// Ensure side is never null (default already handles undefined, but TS needs explicit assertion)\n\tconst resolvedSide = side ?? 'right';\n\n\t// Calculate z-index based on depth (base modal content z-index + depth * 10)\n\t// We use a calc() string to reference the CSS variable\n\tconst zIndex = `calc(var(--z-layer-modal-content) + ${depth * 10})`;\n\n\t// Push offset for when sheets are stacked above this one\n\t// sheetsAbove > 0 means there are sheets on top, so this sheet should be pushed back\n\tconst topSheetId = sheetStack?.sheets[sheetStack.sheets.length - 1]?.id;\n\tconst topSheetSize = topSheetId ? sheetStack?.getSheetSize(topSheetId) : undefined;\n\tconst collapseBaseSize = topSheetSize\n\t\t? resolvedSide === 'left' || resolvedSide === 'right'\n\t\t\t? topSheetSize.width\n\t\t\t: topSheetSize.height\n\t\t: undefined;\n\n\tconst pushOffset = getPushOffset(resolvedSide, sheetsAbove, stackMode, collapseBaseSize ?? NESTED_SHEET_WIDTH);\n\n\tconst contentRef = React.useRef<HTMLDivElement>(null);\n\tReact.useLayoutEffect(() => {\n\t\tif (!isOpen) return;\n\t\tif (!sheetStack) return;\n\t\tconst el = contentRef.current;\n\t\tif (!el) return;\n\t\tlet rafId = 0;\n\t\tconst update = () => {\n\t\t\tconst rect = el.getBoundingClientRect();\n\t\t\tsheetStack.setSheetSize(sheetId, { width: rect.width, height: rect.height });\n\t\t};\n\t\tupdate();\n\t\tif (typeof ResizeObserver === 'undefined') return;\n\t\tconst ro = new ResizeObserver(() => {\n\t\t\tcancelAnimationFrame(rafId);\n\t\t\trafId = requestAnimationFrame(update);\n\t\t});\n\t\tro.observe(el);\n\t\treturn () => {\n\t\t\tcancelAnimationFrame(rafId);\n\t\t\tro.disconnect();\n\t\t};\n\t}, [isOpen, sheetId, sheetStack]);\n\n\t// Animate position includes base position (0) plus any push offset\n\t// Only transform properties for GPU acceleration\n\tconst animatePosition = {\n\t\tx: pushOffset.x ?? 0,\n\t\ty: pushOffset.y ?? 0,\n\t};\n\n\t// Enter rides the slow spring tier; exits use the quicker exit tween.\n\tconst enterTransition = transition ?? tierSpring(springTiers.slow);\n\tconst exitTransition = tierExit(springTiers.slow);\n\n\treturn (\n\t\t<AnimatePresence initial={false}>\n\t\t\t{isOpen && (\n\t\t\t\t<SheetPortal data-slot='sheet-portal'>\n\t\t\t\t\t{/* Only show overlay for the first (bottom-most) sheet in stack */}\n\t\t\t\t\t{overlay && depth === 0 && (\n\t\t\t\t\t\t<SheetPrimitive.Backdrop\n\t\t\t\t\t\t\tdata-slot=\"sheet-overlay\"\n\t\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\tkey='sheet-overlay'\n\t\t\t\t\t\t\t\t\tclassName='fixed inset-0 bg-black/32 backdrop-blur-sm'\n\t\t\t\t\t\t\t\t\tinitial={{ opacity: 0 }}\n\t\t\t\t\t\t\t\t\tanimate={{ opacity: 1 }}\n\t\t\t\t\t\t\t\t\texit={{ opacity: 0 }}\n\t\t\t\t\t\t\t\t\ttransition={{ duration: springTiers.moderate.duration, ease: easings.easeOut }}\n\t\t\t\t\t\t\t\t\tstyle={{ zIndex: 'var(--z-layer-modal-backdrop)' }}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t<SheetPrimitive.Popup\n\t\t\t\t\t\tdata-slot=\"sheet-content\"\n\t\t\t\t\t\tdata-sheet-depth={depth}\n\t\t\t\t\t\tdata-sheet-id={sheetId}\n\t\t\t\t\t\t// A sheet that scrolls opens at its top, not scrolled to a footer button that is first in tab order.\n\t\t\t\t\t\t// Leaving `initialFocus` out and passing `undefined` are the same thing: both get this default.\n\t\t\t\t\t\tinitialFocus={initialFocus ?? scrollSafeInitialFocus(() => contentRef.current)}\n\t\t\t\t\t\t{...props}\n\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\tkey={`sheet-content-${sheetId}`}\n\t\t\t\t\t\t\t\tref={contentRef}\n\t\t\t\t\t\t\t\tvariants={{\n\t\t\t\t\t\t\t\t\tinitial: getInitialPosition(resolvedSide),\n\t\t\t\t\t\t\t\t\tanimate: animatePosition,\n\t\t\t\t\t\t\t\t\texit: {\n\t\t\t\t\t\t\t\t\t\t...getExitPosition(resolvedSide),\n\t\t\t\t\t\t\t\t\t\ttransition: exitTransition,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tinitial='initial'\n\t\t\t\t\t\t\t\tanimate='animate'\n\t\t\t\t\t\t\t\texit='exit'\n\t\t\t\t\t\t\t\ttransition={enterTransition}\n\t\t\t\t\t\t\t\tstyle={{ zIndex }}\n\t\t\t\t\t\t\t\tclassName={cn(sheetVariants({ side: resolvedSide }), className)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{/* ModalPortalScope creates a scoped portal container for floating elements inside */}\n\t\t\t\t\t\t<ModalPortalScope>\n\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t</ModalPortalScope>\n\t\t\t\t\t\t{showClose && (\n\t\t\t\t\t\t\t// Hover brightens the close button at once, with no fade (hover is the most frequent interaction).\n\t\t\t\t\t\t\t<SheetPrimitive.Close\n\t\t\t\t\t\t\t\tdata-slot=\"sheet-close\"\n\t\t\t\t\t\t\t\tclassName='data-[open]:bg-secondary absolute top-4 end-4\n\t\t\t\t\t\t\t\t\trounded-sm opacity-70 hover:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50\n\t\t\t\t\t\t\t\t disabled:pointer-events-none'\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<X className='h-4 w-4' />\n\t\t\t\t\t\t\t\t<span className='sr-only'>Close</span>\n\t\t\t\t\t\t\t</SheetPrimitive.Close>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</SheetPrimitive.Popup>\n\t\t\t\t</SheetPortal>\n\t\t\t)}\n\t\t</AnimatePresence>\n\t);\n}\n\ntype SheetHeaderProps = React.ComponentProps<'div'> & {\n\t/** `band` tints the header and closes it with a hairline, edge to edge. */\n\tvariant?: 'default' | 'band';\n};\n\nfunction SheetHeader({ className, variant = 'default', ...props }: SheetHeaderProps) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"sheet-header\"\n\t\t\tdata-variant={variant}\n\t\t\tclassName={cn(\n\t\t\t\t'flex flex-col space-y-2',\n\t\t\t\t// `pe-6` keeps the title clear of the close button.\n\t\t\t\tvariant === 'default' && 'pb-4 pe-6 text-center sm:text-start',\n\t\t\t\t// Bleeds through SheetContent's p-4 to the panel edges.\n\t\t\t\tvariant === 'band' && '-mx-4 -mt-4 border-b bg-muted/50 p-4 pe-12 text-start',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\ntype SheetFooterProps = React.ComponentProps<'div'> & {\n\t/** `band` pins a tinted footer to the bottom edge, closed off by a hairline. */\n\tvariant?: 'default' | 'band';\n};\n\nfunction SheetFooter({ className, variant = 'default', ...props }: SheetFooterProps) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"sheet-footer\"\n\t\t\tdata-variant={variant}\n\t\t\tclassName={cn(\n\t\t\t\t'flex flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:justify-end',\n\t\t\t\tvariant === 'default' && 'pt-4',\n\t\t\t\tvariant === 'band' && '-mx-4 mt-auto -mb-4 border-t bg-muted/50 px-4 py-3',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\ntype SheetTitleProps = React.ComponentProps<typeof SheetPrimitive.Title>;\n\nfunction SheetTitle({ className, ...props }: SheetTitleProps) {\n\treturn (\n\t\t<SheetPrimitive.Title\n\t\t\tdata-slot=\"sheet-title\"\n\t\t\tclassName={cn('text-foreground text-lg font-semibold', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\ntype SheetDescriptionProps = React.ComponentProps<typeof SheetPrimitive.Description>;\n\nfunction SheetDescription({ className, ...props }: SheetDescriptionProps) {\n\treturn (\n\t\t<SheetPrimitive.Description\n\t\t\tdata-slot=\"sheet-description\"\n\t\t\tclassName={cn('text-muted-foreground text-sm', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\t// Stack provider for nested sheets\n\tSheetStackProvider,\n\tuseSheetStack,\n\t// Individual sheet hooks\n\tuseSheet,\n\t// Components\n\tSheet,\n\tSheetPortal,\n\tSheetOverlay,\n\tSheetTrigger,\n\tSheetClose,\n\tSheetContent,\n\tSheetHeader,\n\tSheetFooter,\n\tSheetTitle,\n\tSheetDescription,\n\t// Constants\n\tSHEET_INDENT,\n\t// Types\n\ttype StackMode,\n\ttype SheetStackProviderProps,\n\ttype SheetProps,\n\ttype SheetPortalProps,\n\ttype SheetOverlayProps,\n\ttype SheetTriggerProps,\n\ttype SheetCloseProps,\n\ttype SheetContentProps,\n\ttype SheetHeaderProps,\n\ttype SheetFooterProps,\n\ttype SheetTitleProps,\n\ttype SheetDescriptionProps,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAYA,SAAgB,qBAAwB,EACvC,MACA,aACA,YAC0D;CAC1D,MAAM,CAAC,mBAAmB,wBAAwB,SA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,GAAG,yCAAyC,SAAS;EAChE,GAAI;CACJ;AAEH;AAIA,SAAS,iBAAiB,EAAE,WAAW,GAAG,SAAgC;CACzE,OACC,oBAACA,OAAe,aAAhB;EACC,aAAU;EACV,WAAW,GAAG,iCAAiC,SAAS;EACxD,GAAI;CACJ;AAEH"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { t as cn } from "./utils-BkMLyah9.js";
|
|
3
|
-
import { a as SheetDescription, d as SheetTitle, i as SheetContent, n as Sheet, s as SheetHeader } from "./sheet-
|
|
3
|
+
import { a as SheetDescription, d as SheetTitle, i as SheetContent, n as Sheet, s as SheetHeader } from "./sheet-LOK_d8-K.js";
|
|
4
4
|
import { Button } from "./components/button.js";
|
|
5
5
|
import { Separator } from "./components/separator.js";
|
|
6
6
|
import { t as truncateTextRuns } from "./text-runs-DqcEO8L_.js";
|
|
@@ -495,4 +495,4 @@ function SidebarMenuSubButton({ render, size = "md", isActive = false, className
|
|
|
495
495
|
|
|
496
496
|
//#endregion
|
|
497
497
|
export { SidebarTrigger as C, SidebarSeparator as S, SidebarMenuSub as _, SidebarGroupAction as a, SidebarProvider as b, SidebarHeader as c, SidebarMenu as d, SidebarMenuAction as f, SidebarMenuSkeleton as g, SidebarMenuItem as h, SidebarGroup as i, SidebarInput as l, SidebarMenuButton as m, SidebarContent as n, SidebarGroupContent as o, SidebarMenuBadge as p, SidebarFooter as r, SidebarGroupLabel as s, Sidebar as t, SidebarInset as u, SidebarMenuSubButton as v, useSidebar as w, SidebarRail as x, SidebarMenuSubItem as y };
|
|
498
|
-
//# sourceMappingURL=sidebar-
|
|
498
|
+
//# sourceMappingURL=sidebar-BNZkdIvO.js.map
|