@wow-two-beta/ui 0.0.63 → 0.0.64
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/actions/index.js +2 -2
- package/dist/{chunk-XB4TU643.js → chunk-5YT7XRTW.js} +16 -8
- package/dist/chunk-5YT7XRTW.js.map +1 -0
- package/dist/{chunk-BLU5JZAB.js → chunk-GTBNVI77.js} +51 -22
- package/dist/chunk-GTBNVI77.js.map +1 -0
- package/dist/{chunk-MYLSXVIS.js → chunk-H3WC7KRX.js} +115 -49
- package/dist/chunk-H3WC7KRX.js.map +1 -0
- package/dist/{chunk-H4P5MAGS.js → chunk-MZZKA3ZS.js} +33 -11
- package/dist/chunk-MZZKA3ZS.js.map +1 -0
- package/dist/{chunk-WIXKLDTN.js → chunk-NEH4ITXL.js} +205 -87
- package/dist/chunk-NEH4ITXL.js.map +1 -0
- package/dist/{chunk-3IVQNIHV.js → chunk-NIFL35PJ.js} +3 -3
- package/dist/{chunk-3IVQNIHV.js.map → chunk-NIFL35PJ.js.map} +1 -1
- package/dist/{chunk-EQNTG53H.js → chunk-NW7ULTYL.js} +8 -7
- package/dist/chunk-NW7ULTYL.js.map +1 -0
- package/dist/{chunk-XPUKDLD3.js → chunk-O4Y52ERR.js} +77 -37
- package/dist/chunk-O4Y52ERR.js.map +1 -0
- package/dist/{chunk-YNC2CIJR.js → chunk-RDRFXVNX.js} +63 -19
- package/dist/chunk-RDRFXVNX.js.map +1 -0
- package/dist/{chunk-4QQLJOGP.js → chunk-YQGEF43L.js} +40 -17
- package/dist/chunk-YQGEF43L.js.map +1 -0
- package/dist/{chunk-5JYRZ5PA.js → chunk-ZC4H4PIN.js} +88 -56
- package/dist/chunk-ZC4H4PIN.js.map +1 -0
- package/dist/display/index.js +2 -2
- package/dist/feedback/index.js +2 -2
- package/dist/feedback/undoBar/UndoBar.d.ts +1 -1
- package/dist/forms/combobox/Combobox.d.ts +1 -1
- package/dist/forms/index.js +5 -5
- package/dist/index.css +38 -0
- package/dist/index.js +11 -11
- package/dist/layout/index.js +3 -3
- package/dist/nav/dropdownMenu/DropdownMenu.d.ts +1 -1
- package/dist/nav/index.js +3 -3
- package/dist/nav/menu/Menu.d.ts +1 -1
- package/dist/overlays/index.js +4 -4
- package/package.json +1 -1
- package/dist/chunk-4QQLJOGP.js.map +0 -1
- package/dist/chunk-5JYRZ5PA.js.map +0 -1
- package/dist/chunk-BLU5JZAB.js.map +0 -1
- package/dist/chunk-EQNTG53H.js.map +0 -1
- package/dist/chunk-H4P5MAGS.js.map +0 -1
- package/dist/chunk-MYLSXVIS.js.map +0 -1
- package/dist/chunk-WIXKLDTN.js.map +0 -1
- package/dist/chunk-XB4TU643.js.map +0 -1
- package/dist/chunk-XPUKDLD3.js.map +0 -1
- package/dist/chunk-YNC2CIJR.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Drawer, DrawerContent, DrawerTitle, DrawerDescription } from './chunk-
|
|
2
|
-
import { DialogContent, DialogClose, Dialog, DialogTrigger, DialogHeader, DialogTitle, DialogDescription, DialogBody, DialogFooter } from './chunk-
|
|
1
|
+
import { Drawer, DrawerContent, DrawerTitle, DrawerDescription } from './chunk-ZC4H4PIN.js';
|
|
2
|
+
import { DialogContent, DialogClose, Dialog, DialogTrigger, DialogHeader, DialogTitle, DialogDescription, DialogBody, DialogFooter } from './chunk-MZZKA3ZS.js';
|
|
3
3
|
import { OverlayChromeProvider, OverlayTitle, OverlayDescription } from './chunk-NOOKDXIZ.js';
|
|
4
|
-
import { Backdrop } from './chunk-
|
|
4
|
+
import { Backdrop } from './chunk-NW7ULTYL.js';
|
|
5
5
|
import { useControlled, useEscape } from './chunk-V267IMBH.js';
|
|
6
6
|
import { surfaceVariants } from './chunk-DX7FYAKY.js';
|
|
7
|
-
import { Slot,
|
|
7
|
+
import { Slot, Presence, AnchoredPositioner, DismissableLayer, Portal, ScrollLockProvider, OverlayArrow } from './chunk-XLYJF3HC.js';
|
|
8
8
|
import { cn, composeRefs } from './chunk-X2MYOHOB.js';
|
|
9
9
|
import { forwardRef, createContext, useMemo, useState, useRef, useId, useEffect, useContext, useCallback, isValidElement, cloneElement } from 'react';
|
|
10
10
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
@@ -139,9 +139,8 @@ var DEFAULT_WIDTH = "w-72";
|
|
|
139
139
|
var PopoverContent = forwardRef(
|
|
140
140
|
function PopoverContent2({ isBare, variant, tone, radius, padding, elevation, className, children, ...rest }, forwardedRef) {
|
|
141
141
|
const ctx = usePopoverContext();
|
|
142
|
-
if (!ctx.open) return null;
|
|
143
142
|
const resolvedPadding = padding ?? (isBare ? "none" : "lg");
|
|
144
|
-
return /* @__PURE__ */ jsx(
|
|
143
|
+
return /* @__PURE__ */ jsx(Presence, { isPresent: ctx.open, children: /* @__PURE__ */ jsx(PopoverPortalRoot, { children: /* @__PURE__ */ jsx(
|
|
145
144
|
AnchoredPositioner,
|
|
146
145
|
{
|
|
147
146
|
anchor: ctx.triggerNode,
|
|
@@ -166,9 +165,12 @@ var PopoverContent = forwardRef(
|
|
|
166
165
|
{
|
|
167
166
|
ref: forwardedRef,
|
|
168
167
|
role: "dialog",
|
|
169
|
-
"data-state": "open",
|
|
170
168
|
className: cn(
|
|
171
|
-
|
|
169
|
+
/* pop (fade+scale) gated on the portal-root data-state + motion-safe
|
|
170
|
+
so reduced-motion users get no movement. */
|
|
171
|
+
"outline-none",
|
|
172
|
+
"motion-safe:group-data-[state=open]:animate-(--animate-pop-in)",
|
|
173
|
+
"motion-safe:group-data-[state=closed]:animate-(--animate-pop-out) motion-reduce:animate-none",
|
|
172
174
|
!isBare && cn(
|
|
173
175
|
DEFAULT_WIDTH,
|
|
174
176
|
surfaceVariants({
|
|
@@ -188,7 +190,12 @@ var PopoverContent = forwardRef(
|
|
|
188
190
|
}
|
|
189
191
|
) })
|
|
190
192
|
}
|
|
191
|
-
) });
|
|
193
|
+
) }) });
|
|
194
|
+
}
|
|
195
|
+
);
|
|
196
|
+
var PopoverPortalRoot = forwardRef(
|
|
197
|
+
function PopoverPortalRoot2({ children, className, ...props }, ref) {
|
|
198
|
+
return /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx("div", { ref, className: cn("group contents", className), ...props, children }) });
|
|
192
199
|
}
|
|
193
200
|
);
|
|
194
201
|
function PopoverArrow({ className, ...rest }) {
|
|
@@ -278,10 +285,9 @@ function HoverCardTrigger({ children }) {
|
|
|
278
285
|
}
|
|
279
286
|
});
|
|
280
287
|
}
|
|
281
|
-
var
|
|
282
|
-
function
|
|
288
|
+
var HoverCardPanel = forwardRef(
|
|
289
|
+
function HoverCardPanel2({ className, children, onPointerEnter, onPointerLeave, ...rest }, forwardedRef) {
|
|
283
290
|
const ctx = useHoverCardContext();
|
|
284
|
-
if (!ctx.open) return null;
|
|
285
291
|
return /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(
|
|
286
292
|
AnchoredPositioner,
|
|
287
293
|
{
|
|
@@ -293,7 +299,6 @@ var HoverCardContent = forwardRef(
|
|
|
293
299
|
"div",
|
|
294
300
|
{
|
|
295
301
|
ref: forwardedRef,
|
|
296
|
-
"data-state": "open",
|
|
297
302
|
onPointerEnter: (e) => {
|
|
298
303
|
onPointerEnter?.(e);
|
|
299
304
|
ctx.cancelHide();
|
|
@@ -303,7 +308,8 @@ var HoverCardContent = forwardRef(
|
|
|
303
308
|
ctx.hide();
|
|
304
309
|
},
|
|
305
310
|
className: cn(
|
|
306
|
-
"w-64 rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md outline-none
|
|
311
|
+
"w-64 rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md outline-none",
|
|
312
|
+
"motion-safe:data-[state=open]:animate-(--animate-pop-in) motion-safe:data-[state=closed]:animate-(--animate-pop-out) motion-reduce:animate-none",
|
|
307
313
|
className
|
|
308
314
|
),
|
|
309
315
|
...rest,
|
|
@@ -314,6 +320,12 @@ var HoverCardContent = forwardRef(
|
|
|
314
320
|
) });
|
|
315
321
|
}
|
|
316
322
|
);
|
|
323
|
+
var HoverCardContent = forwardRef(
|
|
324
|
+
function HoverCardContent2(props, forwardedRef) {
|
|
325
|
+
const ctx = useHoverCardContext();
|
|
326
|
+
return /* @__PURE__ */ jsx(Presence, { isPresent: ctx.open, children: /* @__PURE__ */ jsx(HoverCardPanel, { ref: forwardedRef, ...props }) });
|
|
327
|
+
}
|
|
328
|
+
);
|
|
317
329
|
function HoverCardArrow({ className, ...rest }) {
|
|
318
330
|
return /* @__PURE__ */ jsx(OverlayArrow, { className: cn("text-popover", className), ...rest });
|
|
319
331
|
}
|
|
@@ -453,11 +465,21 @@ var BottomSheet = forwardRef(function BottomSheet2({
|
|
|
453
465
|
const startYRef = useRef(null);
|
|
454
466
|
const startHeightRef = useRef(0);
|
|
455
467
|
const [dragHeight, setDragHeight] = useState(null);
|
|
468
|
+
const [isExiting, setIsExiting] = useState(false);
|
|
456
469
|
const titleId = useId();
|
|
457
470
|
const descriptionId = useId();
|
|
458
471
|
useEffect(() => {
|
|
459
472
|
if (open) setCurrentSnap(Math.min(initialSnap, snapPoints.length - 1));
|
|
460
473
|
}, [open, initialSnap, snapPoints.length]);
|
|
474
|
+
useEffect(() => {
|
|
475
|
+
if (open) {
|
|
476
|
+
setIsExiting(false);
|
|
477
|
+
return;
|
|
478
|
+
}
|
|
479
|
+
setIsExiting(true);
|
|
480
|
+
const timer = window.setTimeout(() => setIsExiting(false), 320);
|
|
481
|
+
return () => window.clearTimeout(timer);
|
|
482
|
+
}, [open]);
|
|
461
483
|
const ctx = useMemo(
|
|
462
484
|
() => ({ open, setOpen, currentSnap, setCurrentSnap, snapPoints }),
|
|
463
485
|
[open, setOpen, currentSnap, snapPoints]
|
|
@@ -510,7 +532,7 @@ var BottomSheet = forwardRef(function BottomSheet2({
|
|
|
510
532
|
else if (dragToDismiss) setOpen(false);
|
|
511
533
|
}
|
|
512
534
|
};
|
|
513
|
-
if (!open) return null;
|
|
535
|
+
if (!open && !isExiting) return null;
|
|
514
536
|
const heightStyle = (() => {
|
|
515
537
|
if (dragHeight != null) return `${dragHeight}px`;
|
|
516
538
|
const point = snapPoints[currentSnap];
|
|
@@ -518,22 +540,26 @@ var BottomSheet = forwardRef(function BottomSheet2({
|
|
|
518
540
|
return point ?? "40vh";
|
|
519
541
|
})();
|
|
520
542
|
return /* @__PURE__ */ jsx(BottomSheetContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsxs(ScrollLockProvider, { children: [
|
|
521
|
-
/* @__PURE__ */ jsx(
|
|
543
|
+
/* @__PURE__ */ jsx(Presence, { isPresent: open, children: /* @__PURE__ */ jsx(
|
|
522
544
|
Backdrop,
|
|
523
545
|
{
|
|
524
546
|
isInline: true,
|
|
547
|
+
className: cn(
|
|
548
|
+
"motion-safe:data-[state=open]:animate-(--animate-fade-in)",
|
|
549
|
+
"motion-safe:data-[state=closed]:animate-(--animate-fade-out)"
|
|
550
|
+
),
|
|
525
551
|
onClick: () => {
|
|
526
552
|
if (dismissOnOutsideClick) setOpen(false);
|
|
527
553
|
}
|
|
528
554
|
}
|
|
529
|
-
),
|
|
555
|
+
) }),
|
|
530
556
|
/* @__PURE__ */ jsx(FocusScope, { asChild: true, trapped: true, loop: true, children: /* @__PURE__ */ jsx(
|
|
531
557
|
DismissableLayer,
|
|
532
558
|
{
|
|
533
559
|
isEscapeDisabled: !dismissOnEscape,
|
|
534
560
|
onEscape: () => setOpen(false),
|
|
535
561
|
isOutsideClickDisabled: true,
|
|
536
|
-
children: /* @__PURE__ */ jsxs(
|
|
562
|
+
children: /* @__PURE__ */ jsx(Presence, { isPresent: open, children: /* @__PURE__ */ jsxs(
|
|
537
563
|
"div",
|
|
538
564
|
{
|
|
539
565
|
ref: (el) => {
|
|
@@ -547,10 +573,13 @@ var BottomSheet = forwardRef(function BottomSheet2({
|
|
|
547
573
|
"aria-describedby": descriptionId,
|
|
548
574
|
style: {
|
|
549
575
|
height: heightStyle,
|
|
550
|
-
transition: dragHeight == null ? "height 220ms ease-out" : "none"
|
|
576
|
+
transition: dragHeight == null ? "height 220ms ease-out, transform var(--duration-base) var(--ease-out)" : "none"
|
|
551
577
|
},
|
|
552
578
|
className: cn(
|
|
553
579
|
"fixed inset-x-0 bottom-0 z-modal flex flex-col rounded-t-xl border-t outline-none",
|
|
580
|
+
"will-change-transform",
|
|
581
|
+
"motion-safe:data-[state=closed]:translate-y-full",
|
|
582
|
+
"motion-reduce:translate-y-0",
|
|
554
583
|
surfaceVariants({
|
|
555
584
|
variant: variant ?? "elevated",
|
|
556
585
|
tone,
|
|
@@ -583,7 +612,7 @@ var BottomSheet = forwardRef(function BottomSheet2({
|
|
|
583
612
|
/* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto px-4 pb-4", children: /* @__PURE__ */ jsx(OverlayChromeProvider, { value: chromeCtx, children }) })
|
|
584
613
|
]
|
|
585
614
|
}
|
|
586
|
-
)
|
|
615
|
+
) })
|
|
587
616
|
}
|
|
588
617
|
) })
|
|
589
618
|
] }) }) });
|
|
@@ -594,5 +623,5 @@ BottomSheet.Title = BottomSheetTitle;
|
|
|
594
623
|
BottomSheet.Description = BottomSheetDescription;
|
|
595
624
|
|
|
596
625
|
export { ActionSheet, ActionSheetAction, ActionSheetCancel, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, BottomSheet, BottomSheetDescription, BottomSheetTitle, HoverCard, HoverCardArrow, HoverCardContent, HoverCardTrigger, Popover, PopoverArrow, PopoverContent, PopoverTrigger, useBottomSheet };
|
|
597
|
-
//# sourceMappingURL=chunk-
|
|
598
|
-
//# sourceMappingURL=chunk-
|
|
626
|
+
//# sourceMappingURL=chunk-GTBNVI77.js.map
|
|
627
|
+
//# sourceMappingURL=chunk-GTBNVI77.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/overlays/alertDialog/AlertDialog.tsx","../src/overlays/popover/Popover.tsx","../src/overlays/hoverCard/HoverCard.tsx","../src/overlays/actionSheet/ActionSheet.tsx","../src/overlays/bottomSheet/BottomSheet.tsx"],"names":["AlertDialogContent","AlertDialogAction","AlertDialogCancel","jsx","forwardRef","PopoverTrigger","PopoverContent","PopoverPortalRoot","createContext","useContext","useRef","useMemo","HoverCardPanel","HoverCardContent","ActionSheetAction","ActionSheetCancel","BottomSheet","useState","useEffect","jsxs","FocusScope"],"mappings":";;;;;;;;;;;;AAkBO,SAAS,YAAY,KAAA,EAAyB;AACnD,EAAA,2BAAQ,MAAA,EAAA,EAAQ,GAAG,OAAO,IAAA,EAAK,aAAA,EAAc,uBAAuB,KAAA,EAAO,CAAA;AAC7E;AAEO,IAAM,kBAAA,GAAqB,UAAA;AAAA,EAChC,SAASA,mBAAAA,CAAmB,KAAA,EAAO,GAAA,EAAK;AACtC,IAAA,uBAAO,GAAA,CAAC,aAAA,EAAA,EAAc,GAAA,EAAW,GAAG,KAAA,EAAO,CAAA;AAAA,EAC7C;AACF;AASO,IAAM,iBAAA,GAAoB,UAAA;AAAA,EAC/B,SAASC,kBAAAA,CAAkB,EAAE,QAAA,EAAU,OAAA,EAAS,WAAW,QAAA,EAAU,GAAG,IAAA,EAAK,EAAG,GAAA,EAAK;AACnF,IAAA,uBACE,GAAA;AAAA,MAAC,WAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,OAAA,EAAS,CAAC,CAAA,KAAM;AACd,UAAA,OAAA,GAAU,CAAC,CAAA;AACX,UAAA,IAAI,EAAE,gBAAA,EAAkB;AACxB,UAAA,QAAA,IAAW;AAAA,QACb,CAAA;AAAA,QACA,SAAA,EAAW,EAAA;AAAA,UACT,kOAAA;AAAA,UACA;AAAA,SACF;AAAA,QACC,GAAG,IAAA;AAAA,QAEH;AAAA;AAAA,KACH;AAAA,EAEJ;AACF;AAOO,IAAM,iBAAA,GAAoB,UAAA;AAAA,EAC/B,SAASC,mBAAkB,EAAE,SAAA,EAAW,UAAU,GAAG,IAAA,IAAQ,GAAA,EA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A,GAAAA,CAAC,qBAAA,EAAA,EAAsB,KAAA,EAAO,SAAA,EAAY,QAAA,EAAS,CAAA,EACrD;AAAA;AAAA;AAAA,SACA,EACF;AAAA;AAAA,KACF,EACF;AAAA,GAAA,EACF,GACF,CAAA,EACF,CAAA;AAEJ,CAAC;AAIM,IAAM,gBAAA,GAAmB;AACzB,IAAM,sBAAA,GAAyB;AAOrC,WAAA,CAAqC,KAAA,GAAQ,gBAAA;AAC7C,WAAA,CAAqC,WAAA,GAAc,sBAAA","file":"chunk-GTBNVI77.js","sourcesContent":["import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from 'react';\nimport { cn } from '../../utils';\nimport {\n Dialog,\n DialogBody,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n DialogClose,\n type DialogProps,\n type DialogContentProps,\n} from '../dialog';\n\nexport type AlertDialogProps = Omit<DialogProps, 'role' | 'dismissOnOutsideClick'>;\n\nexport function AlertDialog(props: AlertDialogProps) {\n return <Dialog {...props} role=\"alertdialog\" dismissOnOutsideClick={false} />;\n}\n\nexport const AlertDialogContent = forwardRef<HTMLDivElement, DialogContentProps>(\n function AlertDialogContent(props, ref) {\n return <DialogContent ref={ref} {...props} />;\n },\n);\n\nexport interface AlertDialogActionProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {\n /** Runs before the dialog closes. */\n onAction?: () => void;\n children: ReactNode;\n}\n\nexport const AlertDialogAction = forwardRef<HTMLButtonElement, AlertDialogActionProps>(\n function AlertDialogAction({ onAction, onClick, className, children, ...rest }, ref) {\n return (\n <DialogClose\n ref={ref}\n onClick={(e) => {\n onClick?.(e);\n if (e.defaultPrevented) return;\n onAction?.();\n }}\n className={cn(\n 'inline-flex h-9 items-center justify-center rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n className,\n )}\n {...rest}\n >\n {children}\n </DialogClose>\n );\n },\n);\n\nexport interface AlertDialogCancelProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {\n children: ReactNode;\n}\n\nexport const AlertDialogCancel = forwardRef<HTMLButtonElement, AlertDialogCancelProps>(\n function AlertDialogCancel({ className, children, ...rest }, ref) {\n return (\n <DialogClose\n ref={ref}\n className={cn(\n 'inline-flex h-9 items-center justify-center rounded-md border border-border bg-background px-4 text-sm font-medium text-foreground transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n className,\n )}\n {...rest}\n >\n {children}\n </DialogClose>\n );\n },\n);\n\ntype AlertDialogComponent = typeof AlertDialog & {\n Trigger: typeof DialogTrigger;\n Content: typeof AlertDialogContent;\n Header: typeof DialogHeader;\n Title: typeof DialogTitle;\n Description: typeof DialogDescription;\n Body: typeof DialogBody;\n Footer: typeof DialogFooter;\n Action: typeof AlertDialogAction;\n Cancel: typeof AlertDialogCancel;\n};\n\n(AlertDialog as AlertDialogComponent).Trigger = DialogTrigger;\n(AlertDialog as AlertDialogComponent).Content = AlertDialogContent;\n(AlertDialog as AlertDialogComponent).Header = DialogHeader;\n(AlertDialog as AlertDialogComponent).Title = DialogTitle;\n(AlertDialog as AlertDialogComponent).Description = DialogDescription;\n(AlertDialog as AlertDialogComponent).Body = DialogBody;\n(AlertDialog as AlertDialogComponent).Footer = DialogFooter;\n(AlertDialog as AlertDialogComponent).Action = AlertDialogAction;\n(AlertDialog as AlertDialogComponent).Cancel = AlertDialogCancel;\n\nexport default AlertDialog as AlertDialogComponent;\n","import {\n createContext,\n forwardRef,\n useContext,\n useMemo,\n useRef,\n useState,\n type ButtonHTMLAttributes,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { FocusScope } from '@radix-ui/react-focus-scope';\nimport { cn, composeRefs, surfaceVariants, type SurfaceVariants } from '../../utils';\nimport { useControlled } from '../../hooks';\nimport {\n AnchoredPositioner,\n DismissableLayer,\n OverlayArrow,\n Portal,\n Presence,\n Slot,\n type AnchoredPositionerProps,\n type OverlayArrowProps,\n} from '../../primitives';\n\ninterface PopoverContextValue {\n open: boolean;\n setOpen: (open: boolean) => void;\n triggerRef: React.MutableRefObject<HTMLElement | null>;\n /** Trigger node held in state so an initially-open popover re-renders anchored. */\n triggerNode: HTMLElement | null;\n onTriggerChange: (node: HTMLElement | null) => void;\n placement: AnchoredPositionerProps['placement'];\n offset: number;\n dismissOnOutsideClick: boolean;\n dismissOnEscape: boolean;\n}\n\nconst PopoverContext = createContext<PopoverContextValue | null>(null);\n\nfunction usePopoverContext() {\n const ctx = useContext(PopoverContext);\n if (!ctx) throw new Error('Popover.* must be used inside <Popover>');\n return ctx;\n}\n\nexport interface PopoverProps {\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n placement?: AnchoredPositionerProps['placement'];\n offset?: number;\n dismissOnOutsideClick?: boolean;\n dismissOnEscape?: boolean;\n children: ReactNode;\n}\n\nexport function Popover({\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n placement = 'bottom',\n offset = 8,\n dismissOnOutsideClick = true,\n dismissOnEscape = true,\n children,\n}: PopoverProps) {\n const [open, setOpen] = useControlled({\n controlled: openProp,\n default: defaultOpen,\n onChange: onOpenChange,\n });\n const triggerRef = useRef<HTMLElement | null>(null);\n const [triggerNode, setTriggerNode] = useState<HTMLElement | null>(null);\n\n const ctx = useMemo<PopoverContextValue>(\n () => ({\n open,\n setOpen,\n triggerRef,\n triggerNode,\n onTriggerChange: setTriggerNode,\n placement,\n offset,\n dismissOnOutsideClick,\n dismissOnEscape,\n }),\n [open, setOpen, triggerNode, placement, offset, dismissOnOutsideClick, dismissOnEscape],\n );\n\n return <PopoverContext.Provider value={ctx}>{children}</PopoverContext.Provider>;\n}\n\nexport interface PopoverTriggerProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {\n asChild?: boolean;\n children: ReactNode;\n}\n\nexport const PopoverTrigger = forwardRef<HTMLButtonElement, PopoverTriggerProps>(\n function PopoverTrigger({ asChild, onClick, children, ...rest }, forwardedRef) {\n const ctx = usePopoverContext();\n const { triggerRef, onTriggerChange } = ctx;\n const Component = asChild ? Slot : 'button';\n // Memoized so the callback ref isn't re-invoked (null → node) every render.\n const composedRef = useMemo(\n () =>\n composeRefs<HTMLButtonElement>(\n forwardedRef,\n triggerRef as React.MutableRefObject<HTMLButtonElement | null>,\n onTriggerChange,\n ),\n [forwardedRef, triggerRef, onTriggerChange],\n );\n return (\n <Component\n ref={composedRef as never}\n type=\"button\"\n aria-haspopup=\"dialog\"\n aria-expanded={ctx.open}\n data-state={ctx.open ? 'open' : 'closed'}\n onClick={(e: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(e);\n if (e.defaultPrevented) return;\n ctx.setOpen(!ctx.open);\n }}\n {...rest}\n >\n {children}\n </Component>\n );\n },\n);\n\n/** Represents the prop surface of the `Popover.Content`. */\nexport interface PopoverContentProps\n extends HTMLAttributes<HTMLDivElement>,\n SurfaceVariants {\n /** Skips the surface chrome (bg/border/shadow); keeps only z-index + animation. */\n isBare?: boolean;\n children: ReactNode;\n}\n\n/** Contains the default chrome width that preserves the historical look. */\nconst DEFAULT_WIDTH = 'w-72';\n\nexport const PopoverContent = forwardRef<HTMLDivElement, PopoverContentProps>(\n function PopoverContent(\n { isBare, variant, tone, radius, padding, elevation, className, children, ...rest },\n forwardedRef,\n ) {\n const ctx = usePopoverContext();\n /* Default to lg padding when chrome is on (matches old `p-4`); consumer can override. */\n const resolvedPadding = padding ?? (isBare ? 'none' : 'lg');\n return (\n <Presence isPresent={ctx.open}>\n {/* `Presence` injects ref + data-state onto this portal root and defers\n unmount until its exit anim ends. The panel pop is driven off this\n root's state via `group-data-[state=*]` on the surface below. */}\n <PopoverPortalRoot>\n {/* z-popover (80) on the SC root (transform makes the stacking context) so a\n popover from a Dialog (z-modal, 70) paints above it — both portal to body. */}\n <AnchoredPositioner\n anchor={ctx.triggerNode}\n placement={ctx.placement}\n offset={ctx.offset}\n className=\"z-popover\"\n >\n <FocusScope asChild trapped loop>\n <DismissableLayer\n isEscapeDisabled={!ctx.dismissOnEscape}\n onEscape={() => {\n ctx.setOpen(false);\n requestAnimationFrame(() => ctx.triggerRef.current?.focus());\n }}\n isOutsideClickDisabled={!ctx.dismissOnOutsideClick}\n onOutsidePointerDown={(e) => {\n if (ctx.triggerRef.current?.contains(e.target as Node)) return;\n ctx.setOpen(false);\n }}\n >\n <div\n ref={forwardedRef}\n role=\"dialog\"\n className={cn(\n /* pop (fade+scale) gated on the portal-root data-state + motion-safe\n so reduced-motion users get no movement. */\n 'outline-none',\n 'motion-safe:group-data-[state=open]:animate-(--animate-pop-in)',\n 'motion-safe:group-data-[state=closed]:animate-(--animate-pop-out) motion-reduce:animate-none',\n !isBare &&\n cn(\n DEFAULT_WIDTH,\n surfaceVariants({\n variant,\n tone,\n radius,\n padding: resolvedPadding,\n elevation,\n }),\n ),\n className,\n )}\n {...rest}\n >\n {children}\n </div>\n </DismissableLayer>\n </FocusScope>\n </AnchoredPositioner>\n </PopoverPortalRoot>\n </Presence>\n );\n },\n);\n\n/**\n * `Presence`-clonable root: a single element that accepts `ref` + `data-state`\n * (injected by `Presence`) and renders inside a `Portal`. Marked `group` so the\n * panel below animates off its `data-[state]`. Holds no layout of its own\n * (`display: contents`) so the anchored positioning of children is unaffected.\n */\nconst PopoverPortalRoot = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function PopoverPortalRoot({ children, className, ...props }, ref) {\n return (\n <Portal>\n <div ref={ref} className={cn('group contents', className)} {...props}>\n {children}\n </div>\n </Portal>\n );\n },\n);\n\nexport function PopoverArrow({ className, ...rest }: OverlayArrowProps) {\n return <OverlayArrow className={cn('text-popover', className)} {...rest} />;\n}\n\ntype PopoverComponent = typeof Popover & {\n Trigger: typeof PopoverTrigger;\n Content: typeof PopoverContent;\n Arrow: typeof PopoverArrow;\n};\n\n(Popover as PopoverComponent).Trigger = PopoverTrigger;\n(Popover as PopoverComponent).Content = PopoverContent;\n(Popover as PopoverComponent).Arrow = PopoverArrow;\n\nexport default Popover as PopoverComponent;\n","import {\n cloneElement,\n createContext,\n forwardRef,\n isValidElement,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react';\nimport { cn, composeRefs } from '../../utils';\nimport { useControlled, useEscape } from '../../hooks';\nimport {\n AnchoredPositioner,\n OverlayArrow,\n Portal,\n Presence,\n type AnchoredPositionerProps,\n type OverlayArrowProps,\n} from '../../primitives';\n\ninterface HoverCardContextValue {\n open: boolean;\n setOpen: (open: boolean) => void;\n triggerRef: React.MutableRefObject<HTMLElement | null>;\n show: () => void;\n hide: () => void;\n cancelHide: () => void;\n placement: AnchoredPositionerProps['placement'];\n offset: number;\n}\n\nconst HoverCardContext = createContext<HoverCardContextValue | null>(null);\n\nfunction useHoverCardContext() {\n const ctx = useContext(HoverCardContext);\n if (!ctx) throw new Error('HoverCard.* must be used inside <HoverCard>');\n return ctx;\n}\n\nexport interface HoverCardProps {\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n openDelay?: number;\n closeDelay?: number;\n placement?: AnchoredPositionerProps['placement'];\n offset?: number;\n children: ReactNode;\n}\n\nexport function HoverCard({\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n openDelay = 700,\n closeDelay = 300,\n placement = 'bottom',\n offset = 8,\n children,\n}: HoverCardProps) {\n const [open, setOpen] = useControlled({\n controlled: openProp,\n default: defaultOpen,\n onChange: onOpenChange,\n });\n const triggerRef = useRef<HTMLElement | null>(null);\n const openTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const closeTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const clear = useCallback(() => {\n if (openTimer.current) clearTimeout(openTimer.current);\n if (closeTimer.current) clearTimeout(closeTimer.current);\n openTimer.current = null;\n closeTimer.current = null;\n }, []);\n\n const show = useCallback(() => {\n clear();\n openTimer.current = setTimeout(() => setOpen(true), openDelay);\n }, [clear, openDelay, setOpen]);\n\n const hide = useCallback(() => {\n clear();\n closeTimer.current = setTimeout(() => setOpen(false), closeDelay);\n }, [clear, closeDelay, setOpen]);\n\n const cancelHide = useCallback(() => {\n if (closeTimer.current) {\n clearTimeout(closeTimer.current);\n closeTimer.current = null;\n }\n }, []);\n\n // Clear pending timers on unmount — avoids setState-after-unmount.\n useEffect(() => clear, [clear]);\n\n // WCAG 1.4.13 — hover content must be dismissible without moving the pointer.\n useEscape(() => {\n clear();\n setOpen(false);\n }, open);\n\n const ctx = useMemo<HoverCardContextValue>(\n () => ({ open, setOpen, triggerRef, show, hide, cancelHide, placement, offset }),\n [open, setOpen, show, hide, cancelHide, placement, offset],\n );\n\n return <HoverCardContext.Provider value={ctx}>{children}</HoverCardContext.Provider>;\n}\n\nexport interface HoverCardTriggerProps {\n asChild?: boolean;\n children: ReactElement;\n}\n\nexport function HoverCardTrigger({ children }: HoverCardTriggerProps) {\n const ctx = useHoverCardContext();\n if (!isValidElement(children)) return children;\n const trigger = children as ReactElement<{\n ref?: Ref<HTMLElement>;\n onPointerEnter?: (e: React.PointerEvent) => void;\n onPointerLeave?: (e: React.PointerEvent) => void;\n onFocus?: (e: React.FocusEvent) => void;\n onBlur?: (e: React.FocusEvent) => void;\n }> & { ref?: Ref<HTMLElement> };\n\n return cloneElement(trigger, {\n ref: composeRefs((node: HTMLElement | null) => {\n ctx.triggerRef.current = node;\n }, trigger.ref),\n onPointerEnter: (e: React.PointerEvent) => {\n trigger.props.onPointerEnter?.(e);\n ctx.show();\n },\n onPointerLeave: (e: React.PointerEvent) => {\n trigger.props.onPointerLeave?.(e);\n ctx.hide();\n },\n onFocus: (e: React.FocusEvent) => {\n trigger.props.onFocus?.(e);\n ctx.show();\n },\n onBlur: (e: React.FocusEvent) => {\n trigger.props.onBlur?.(e);\n ctx.hide();\n },\n });\n}\n\nexport interface HoverCardContentProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n}\n\n/*\n * Presence clones its single child and injects `ref` + `data-state` onto it,\n * so that child must be the animated element. Portal/AnchoredPositioner can't\n * carry those props down to the styled div, so this forwardRef panel bridges\n * them: Presence drives this panel, the panel renders the Portal → positioner\n * tree, and forwards `ref` + the injected `data-state` (via `...rest`) onto the\n * inner div that carries the pop transition.\n */\nconst HoverCardPanel = forwardRef<HTMLDivElement, HoverCardContentProps>(\n function HoverCardPanel({ className, children, onPointerEnter, onPointerLeave, ...rest }, forwardedRef) {\n const ctx = useHoverCardContext();\n return (\n <Portal>\n <AnchoredPositioner\n anchor={ctx.triggerRef.current}\n placement={ctx.placement}\n offset={ctx.offset}\n className=\"z-dropdown\"\n >\n <div\n ref={forwardedRef}\n onPointerEnter={(e) => {\n onPointerEnter?.(e);\n ctx.cancelHide();\n }}\n onPointerLeave={(e) => {\n onPointerLeave?.(e);\n ctx.hide();\n }}\n className={cn(\n 'w-64 rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md outline-none',\n 'motion-safe:data-[state=open]:animate-(--animate-pop-in) motion-safe:data-[state=closed]:animate-(--animate-pop-out) motion-reduce:animate-none',\n className,\n )}\n {...rest}\n >\n {children}\n </div>\n </AnchoredPositioner>\n </Portal>\n );\n },\n);\n\nexport const HoverCardContent = forwardRef<HTMLDivElement, HoverCardContentProps>(\n function HoverCardContent(props, forwardedRef) {\n const ctx = useHoverCardContext();\n return (\n <Presence isPresent={ctx.open}>\n <HoverCardPanel ref={forwardedRef} {...props} />\n </Presence>\n );\n },\n);\n\nexport function HoverCardArrow({ className, ...rest }: OverlayArrowProps) {\n return <OverlayArrow className={cn('text-popover', className)} {...rest} />;\n}\n\ntype HoverCardComponent = typeof HoverCard & {\n Trigger: typeof HoverCardTrigger;\n Content: typeof HoverCardContent;\n Arrow: typeof HoverCardArrow;\n};\n\n(HoverCard as HoverCardComponent).Trigger = HoverCardTrigger;\n(HoverCard as HoverCardComponent).Content = HoverCardContent;\n(HoverCard as HoverCardComponent).Arrow = HoverCardArrow;\n\nexport default HoverCard as HoverCardComponent;\n","import {\n createContext,\n forwardRef,\n useContext,\n useMemo,\n type ButtonHTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { cn } from '../../utils';\nimport { useControlled } from '../../hooks';\nimport { Drawer, DrawerContent, DrawerDescription, DrawerTitle } from '../drawer';\n\ninterface ActionSheetContextValue {\n setOpen: (open: boolean) => void;\n}\n\nconst ActionSheetContext = createContext<ActionSheetContextValue | null>(null);\n\nfunction useActionSheetContext() {\n const ctx = useContext(ActionSheetContext);\n if (!ctx) throw new Error('ActionSheet.* must be used inside <ActionSheet>');\n return ctx;\n}\n\nexport interface ActionSheetProps {\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n title?: ReactNode;\n description?: ReactNode;\n className?: string;\n children: ReactNode;\n}\n\n/**\n * iOS-style action sheet — opinionated bottom Drawer with stacked button rows\n * and a separated Cancel.\n */\nexport function ActionSheet({\n open,\n defaultOpen,\n onOpenChange,\n title,\n description,\n className,\n children,\n}: ActionSheetProps) {\n // ActionSheet owns open state + drives Drawer fully controlled, so `ctx.setOpen`\n // works in both controlled and uncontrolled modes (Drawer's context isn't interceptable).\n const [resolvedOpen, setOpen] = useControlled({\n controlled: open,\n default: defaultOpen ?? false,\n onChange: onOpenChange,\n });\n\n const ctx = useMemo<ActionSheetContextValue>(() => ({ setOpen }), [setOpen]);\n\n return (\n <ActionSheetContext.Provider value={ctx}>\n <Drawer open={resolvedOpen} onOpenChange={setOpen} side=\"bottom\">\n <DrawerContent\n className={cn(\n 'mx-auto max-w-md rounded-t-xl bg-card p-2 text-card-foreground',\n className,\n )}\n >\n {(title || description) && (\n <div className=\"px-3 py-2 text-center\">\n {title && (\n <DrawerTitle className=\"text-sm font-medium text-muted-foreground\">\n {title}\n </DrawerTitle>\n )}\n {description && (\n <DrawerDescription className=\"mt-1 text-xs text-muted-foreground\">\n {description}\n </DrawerDescription>\n )}\n </div>\n )}\n <div className=\"flex flex-col gap-px overflow-hidden rounded-lg bg-border\">\n {children}\n </div>\n </DrawerContent>\n </Drawer>\n </ActionSheetContext.Provider>\n );\n}\n\nexport interface ActionSheetActionProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n onSelect?: () => void;\n isDestructive?: boolean;\n}\n\nexport const ActionSheetAction = forwardRef<HTMLButtonElement, ActionSheetActionProps>(\n function ActionSheetAction(\n { className, onSelect, isDestructive, onClick, children, type = 'button', ...rest },\n ref,\n ) {\n const ctx = useActionSheetContext();\n return (\n <button\n ref={ref}\n type={type}\n onClick={(e) => {\n onClick?.(e);\n if (e.defaultPrevented) return;\n onSelect?.();\n ctx.setOpen(false);\n }}\n className={cn(\n 'flex h-12 w-full items-center justify-center bg-card px-4 text-base font-medium transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50',\n isDestructive ? 'text-destructive' : 'text-foreground',\n className,\n )}\n {...rest}\n >\n {children}\n </button>\n );\n },\n);\n\nexport type ActionSheetCancelProps = ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const ActionSheetCancel = forwardRef<HTMLButtonElement, ActionSheetCancelProps>(\n function ActionSheetCancel({ className, onClick, children = 'Cancel', type = 'button', ...rest }, ref) {\n const ctx = useActionSheetContext();\n return (\n <button\n ref={ref}\n type={type}\n onClick={(e) => {\n onClick?.(e);\n if (e.defaultPrevented) return;\n ctx.setOpen(false);\n }}\n className={cn(\n 'mt-2 flex h-12 w-full items-center justify-center rounded-lg bg-card text-base font-semibold text-foreground shadow-sm transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n className,\n )}\n {...rest}\n >\n {children}\n </button>\n );\n },\n);\n\ntype ActionSheetComponent = typeof ActionSheet & {\n Action: typeof ActionSheetAction;\n Cancel: typeof ActionSheetCancel;\n};\n\n(ActionSheet as ActionSheetComponent).Action = ActionSheetAction;\n(ActionSheet as ActionSheetComponent).Cancel = ActionSheetCancel;\n\nexport default ActionSheet as ActionSheetComponent;\n","import {\n createContext,\n forwardRef,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n type KeyboardEvent,\n type PointerEvent as ReactPointerEvent,\n type ReactNode,\n} from 'react';\nimport { FocusScope } from '@radix-ui/react-focus-scope';\nimport { cn, surfaceVariants, type SurfaceVariants } from '../../utils';\nimport { useControlled } from '../../hooks';\nimport { DismissableLayer, Portal, Presence, ScrollLockProvider } from '../../primitives';\nimport { Backdrop } from '../backdrop';\nimport {\n OverlayChromeProvider,\n OverlayDescription,\n OverlayTitle,\n type OverlayChromeContextValue,\n} from '../OverlayChrome';\n\ntype SnapPoint = number | string;\n\ninterface BottomSheetContextValue {\n open: boolean;\n setOpen: (open: boolean) => void;\n currentSnap: number;\n setCurrentSnap: (i: number) => void;\n snapPoints: SnapPoint[];\n}\n\nconst BottomSheetContext = createContext<BottomSheetContextValue | null>(null);\n\nexport function useBottomSheet() {\n const ctx = useContext(BottomSheetContext);\n if (!ctx) throw new Error('useBottomSheet must be used inside <BottomSheet>');\n return ctx;\n}\n\nfunction resolveSnapPx(point: SnapPoint, viewport: number): number {\n if (typeof point === 'number') return point;\n const trimmed = point.trim();\n if (trimmed.endsWith('vh')) return (parseFloat(trimmed) / 100) * viewport;\n if (trimmed.endsWith('px')) return parseFloat(trimmed);\n if (trimmed.endsWith('%')) return (parseFloat(trimmed) / 100) * viewport;\n // Fallback: try parseFloat as px.\n const n = parseFloat(trimmed);\n return Number.isFinite(n) ? n : 0;\n}\n\n/** Represents the prop surface of `BottomSheet`. */\nexport interface BottomSheetProps extends HTMLAttributes<HTMLDivElement>, SurfaceVariants {\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n snapPoints?: SnapPoint[];\n initialSnap?: number;\n dismissOnOutsideClick?: boolean;\n dismissOnEscape?: boolean;\n dragToDismiss?: boolean;\n children: ReactNode;\n}\n\n/**\n * Mobile bottom sheet with drag handle + snap points. Pointer-event drag\n * between heights; releasing snaps to the nearest point. Past the lowest\n * snap with `dragToDismiss`, the sheet closes.\n */\nexport const BottomSheet = forwardRef<HTMLDivElement, BottomSheetProps>(function BottomSheet(\n {\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n snapPoints = ['40vh', '90vh'],\n initialSnap = 0,\n dismissOnOutsideClick = true,\n dismissOnEscape = true,\n dragToDismiss = true,\n variant,\n tone,\n radius,\n padding,\n elevation,\n className,\n children,\n ...rest\n },\n forwardedRef,\n) {\n const [open, setOpen] = useControlled({\n controlled: openProp,\n default: defaultOpen,\n onChange: onOpenChange,\n });\n const [currentSnap, setCurrentSnap] = useState(\n Math.min(initialSnap, snapPoints.length - 1),\n );\n const sheetRef = useRef<HTMLDivElement | null>(null);\n const startYRef = useRef<number | null>(null);\n const startHeightRef = useRef(0);\n const [dragHeight, setDragHeight] = useState<number | null>(null);\n // Keeps the portal subtree (scroll lock + backdrop + sheet) mounted while the\n // exit animation plays after `open` flips false; the per-node <Presence>\n // wrappers defer their own unmount, and this flag releases the scroll lock\n // only once they've finished. Mirrors the \"open OR exiting\" gate other\n // overlays use, while preserving the no-lock-when-closed behavior.\n const [isExiting, setIsExiting] = useState(false);\n const titleId = useId();\n const descriptionId = useId();\n\n // Reset to initialSnap each time we re-open.\n useEffect(() => {\n if (open) setCurrentSnap(Math.min(initialSnap, snapPoints.length - 1));\n }, [open, initialSnap, snapPoints.length]);\n\n // Drive the trailing-mount flag: opening clears it; closing holds the subtree\n // mounted for one exit cycle (longest motion token = base duration) so the\n // slide-down + backdrop fade can play, then drops it to release scroll lock.\n useEffect(() => {\n if (open) {\n setIsExiting(false);\n return;\n }\n setIsExiting(true);\n const timer = window.setTimeout(() => setIsExiting(false), 320);\n return () => window.clearTimeout(timer);\n }, [open]);\n\n const ctx = useMemo<BottomSheetContextValue>(\n () => ({ open, setOpen, currentSnap, setCurrentSnap, snapPoints }),\n [open, setOpen, currentSnap, snapPoints],\n );\n\n const chromeCtx = useMemo<OverlayChromeContextValue>(\n () => ({ titleId, descriptionId, close: () => setOpen(false) }),\n [titleId, descriptionId, setOpen],\n );\n\n const handlePointerDown = (e: ReactPointerEvent<HTMLDivElement>) => {\n startYRef.current = e.clientY;\n const rect = sheetRef.current?.getBoundingClientRect();\n startHeightRef.current = rect ? rect.height : 0;\n (e.currentTarget as HTMLElement).setPointerCapture(e.pointerId);\n };\n\n const handlePointerMove = (e: ReactPointerEvent<HTMLDivElement>) => {\n if (startYRef.current == null) return;\n const dy = e.clientY - startYRef.current;\n setDragHeight(Math.max(0, startHeightRef.current - dy));\n };\n\n const handlePointerUp = (e: ReactPointerEvent<HTMLDivElement>) => {\n if (startYRef.current == null) return;\n startYRef.current = null;\n (e.currentTarget as HTMLElement).releasePointerCapture?.(e.pointerId);\n\n const viewport = typeof window !== 'undefined' ? window.innerHeight : 800;\n const heights = snapPoints.map((p) => resolveSnapPx(p, viewport));\n const liveHeight = dragHeight ?? heights[currentSnap] ?? 0;\n setDragHeight(null);\n\n // Below lowest snap by 60px → dismiss.\n if (dragToDismiss && liveHeight < (heights[0] ?? 0) - 60) {\n setOpen(false);\n return;\n }\n // Snap to nearest.\n let bestIdx = 0;\n let bestDist = Number.POSITIVE_INFINITY;\n heights.forEach((h, i) => {\n const d = Math.abs(h - liveHeight);\n if (d < bestDist) {\n bestDist = d;\n bestIdx = i;\n }\n });\n setCurrentSnap(bestIdx);\n };\n\n const handleKeyDown = (e: KeyboardEvent<HTMLDivElement>) => {\n if (e.key === 'ArrowUp' && currentSnap < snapPoints.length - 1) {\n e.preventDefault();\n setCurrentSnap(currentSnap + 1);\n } else if (e.key === 'ArrowDown') {\n e.preventDefault();\n if (currentSnap > 0) setCurrentSnap(currentSnap - 1);\n else if (dragToDismiss) setOpen(false);\n }\n };\n\n // Mounted whenever open OR mid-exit — the <Presence> wrappers below defer\n // their own unmount until the slide-down / fade-out finishes.\n if (!open && !isExiting) return null;\n\n const heightStyle: string | number = (() => {\n if (dragHeight != null) return `${dragHeight}px`;\n const point = snapPoints[currentSnap];\n if (typeof point === 'number') return `${point}px`;\n return point ?? '40vh';\n })();\n\n return (\n <BottomSheetContext.Provider value={ctx}>\n <Portal>\n <ScrollLockProvider>\n {/* Backdrop in its own Presence so its fade-out plays before unmount;\n `Presence` injects `data-state` onto it and the fade tokens gate on it. */}\n <Presence isPresent={open}>\n <Backdrop\n isInline\n className={cn(\n 'motion-safe:data-[state=open]:animate-(--animate-fade-in)',\n 'motion-safe:data-[state=closed]:animate-(--animate-fade-out)',\n )}\n onClick={() => {\n if (dismissOnOutsideClick) setOpen(false);\n }}\n />\n </Presence>\n <FocusScope asChild trapped loop>\n <DismissableLayer\n isEscapeDisabled={!dismissOnEscape}\n onEscape={() => setOpen(false)}\n isOutsideClickDisabled\n >\n {/* The sheet panel is the Presence-animated node — it carries\n `data-state` (injected via {...props}) and the slide classes.\n FULL slide from the bottom edge: translate-y-full when closed,\n driven by `transition-transform` (the inline transition also\n carries `transform` so the height + slide animate together).\n Gated `motion-safe` + `motion-reduce` so reduced-motion users\n get no movement. */}\n <Presence isPresent={open}>\n <div\n ref={(el) => {\n sheetRef.current = el;\n if (typeof forwardedRef === 'function') forwardedRef(el);\n else if (forwardedRef) (forwardedRef as React.MutableRefObject<HTMLDivElement | null>).current = el;\n }}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={titleId}\n aria-describedby={descriptionId}\n style={{\n height: heightStyle,\n transition:\n dragHeight == null\n ? 'height 220ms ease-out, transform var(--duration-base) var(--ease-out)'\n : 'none',\n }}\n className={cn(\n 'fixed inset-x-0 bottom-0 z-modal flex flex-col rounded-t-xl border-t outline-none',\n 'will-change-transform',\n 'motion-safe:data-[state=closed]:translate-y-full',\n 'motion-reduce:translate-y-0',\n surfaceVariants({\n variant: variant ?? 'elevated',\n tone,\n radius: radius ?? 'none',\n padding: padding ?? 'none',\n elevation: elevation ?? 5,\n }),\n className,\n )}\n {...rest}\n >\n <div\n role=\"separator\"\n aria-orientation=\"horizontal\"\n aria-valuenow={currentSnap}\n aria-valuemin={0}\n aria-valuemax={snapPoints.length - 1}\n tabIndex={0}\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onPointerUp={handlePointerUp}\n onPointerCancel={handlePointerUp}\n onKeyDown={handleKeyDown}\n className=\"flex h-7 cursor-ns-resize items-center justify-center focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring\"\n >\n <span className=\"h-1 w-10 rounded-full bg-border-strong\" aria-hidden=\"true\" />\n </div>\n <div className=\"flex-1 overflow-y-auto px-4 pb-4\">\n <OverlayChromeProvider value={chromeCtx}>{children}</OverlayChromeProvider>\n </div>\n </div>\n </Presence>\n </DismissableLayer>\n </FocusScope>\n </ScrollLockProvider>\n </Portal>\n </BottomSheetContext.Provider>\n );\n});\n\n// Re-export shared chrome under the BottomSheet namespace — they wire\n// `id={titleId}`/`id={descriptionId}` so the sheet's aria-labelledby/describedby resolve.\nexport const BottomSheetTitle = OverlayTitle;\nexport const BottomSheetDescription = OverlayDescription;\n\ntype BottomSheetComponent = typeof BottomSheet & {\n Title: typeof BottomSheetTitle;\n Description: typeof BottomSheetDescription;\n};\n\n(BottomSheet as BottomSheetComponent).Title = BottomSheetTitle;\n(BottomSheet as BottomSheetComponent).Description = BottomSheetDescription;\n\nexport default BottomSheet as BottomSheetComponent;\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { listboxItemVariants, listboxEmptyVariants, listboxGroupLabelVariants, listboxSeparatorVariants } from './chunk-FMTBJJP6.js';
|
|
2
|
-
import { DialogContent, Dialog } from './chunk-
|
|
3
|
-
import { useControlled } from './chunk-V267IMBH.js';
|
|
2
|
+
import { DialogContent, Dialog } from './chunk-MZZKA3ZS.js';
|
|
3
|
+
import { useControlled, useReducedMotion } from './chunk-V267IMBH.js';
|
|
4
4
|
import { Icon } from './chunk-MVMDDGW7.js';
|
|
5
5
|
import { dataAttr, tv, surfaceVariants } from './chunk-DX7FYAKY.js';
|
|
6
|
-
import { Slot, RovingFocusGroup, useRovingFocusItem, Portal, AnchoredPositioner, DismissableLayer } from './chunk-XLYJF3HC.js';
|
|
6
|
+
import { Slot, RovingFocusGroup, useRovingFocusItem, Portal, AnchoredPositioner, DismissableLayer, Presence } from './chunk-XLYJF3HC.js';
|
|
7
7
|
import { cn, composeRefs } from './chunk-X2MYOHOB.js';
|
|
8
8
|
import { forwardRef, Fragment, createContext, useId, useRef, useEffect, useCallback, useMemo, useState, useContext } from 'react';
|
|
9
9
|
import { ChevronsLeft, ChevronLeft, ChevronRight, ChevronsRight, ChevronDown, Search } from 'lucide-react';
|
|
@@ -203,7 +203,6 @@ function Menu({
|
|
|
203
203
|
() => ({ registerItem, unregisterItem, itemsRef, onClose }),
|
|
204
204
|
[registerItem, unregisterItem, onClose]
|
|
205
205
|
);
|
|
206
|
-
if (!open) return null;
|
|
207
206
|
return /* @__PURE__ */ jsx(MenuContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(
|
|
208
207
|
AnchoredPositioner,
|
|
209
208
|
{
|
|
@@ -211,43 +210,41 @@ function Menu({
|
|
|
211
210
|
placement,
|
|
212
211
|
offset,
|
|
213
212
|
className: "z-dropdown",
|
|
214
|
-
children: /* @__PURE__ */ jsx(FocusScope, { asChild: true, trapped: true, loop: true, children: /* @__PURE__ */ jsx(
|
|
213
|
+
children: /* @__PURE__ */ jsx(Presence, { isPresent: open, children: /* @__PURE__ */ jsx(FocusScope, { asChild: true, trapped: true, loop: true, children: /* @__PURE__ */ jsx(
|
|
215
214
|
DismissableLayer,
|
|
216
215
|
{
|
|
216
|
+
role: "menu",
|
|
217
|
+
"aria-label": ariaLabel,
|
|
217
218
|
onEscape: onClose,
|
|
218
219
|
onOutsidePointerDown: (e) => {
|
|
219
220
|
if (anchor?.contains(e.target)) return;
|
|
220
221
|
onClose();
|
|
221
222
|
},
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
"
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
e.preventDefault();
|
|
243
|
-
onClose();
|
|
244
|
-
}
|
|
245
|
-
},
|
|
246
|
-
children
|
|
223
|
+
className: cn(
|
|
224
|
+
surfaceVariants({
|
|
225
|
+
variant: variant ?? "surface",
|
|
226
|
+
tone,
|
|
227
|
+
radius: radius ?? "md",
|
|
228
|
+
padding: padding ?? "xs",
|
|
229
|
+
elevation
|
|
230
|
+
}),
|
|
231
|
+
menuVariants(),
|
|
232
|
+
"motion-safe:data-[state=open]:animate-(--animate-pop-in)",
|
|
233
|
+
"motion-safe:data-[state=closed]:animate-(--animate-pop-out)",
|
|
234
|
+
"motion-reduce:animate-none",
|
|
235
|
+
className
|
|
236
|
+
),
|
|
237
|
+
onKeyDown: (e) => {
|
|
238
|
+
onKeyDown?.(e);
|
|
239
|
+
if (e.defaultPrevented) return;
|
|
240
|
+
if (e.key === "Tab") {
|
|
241
|
+
e.preventDefault();
|
|
242
|
+
onClose();
|
|
247
243
|
}
|
|
248
|
-
|
|
244
|
+
},
|
|
245
|
+
children
|
|
249
246
|
}
|
|
250
|
-
) })
|
|
247
|
+
) }) })
|
|
251
248
|
}
|
|
252
249
|
) }) });
|
|
253
250
|
}
|
|
@@ -423,16 +420,48 @@ var DropdownMenuTrigger = forwardRef(
|
|
|
423
420
|
);
|
|
424
421
|
}
|
|
425
422
|
);
|
|
423
|
+
var DropdownMenuPanel = forwardRef(
|
|
424
|
+
function DropdownMenuPanel2({ className, children, ...props }, ref) {
|
|
425
|
+
return /* @__PURE__ */ jsx(
|
|
426
|
+
"div",
|
|
427
|
+
{
|
|
428
|
+
ref,
|
|
429
|
+
className: cn(
|
|
430
|
+
/* pop (fade + slight scale) gated on data-state; motion-safe so
|
|
431
|
+
reduced-motion users get no movement. */
|
|
432
|
+
"motion-safe:data-[state=open]:animate-(--animate-pop-in)",
|
|
433
|
+
"motion-safe:data-[state=closed]:animate-(--animate-pop-out)",
|
|
434
|
+
"motion-reduce:animate-none",
|
|
435
|
+
className
|
|
436
|
+
),
|
|
437
|
+
...props,
|
|
438
|
+
children
|
|
439
|
+
}
|
|
440
|
+
);
|
|
441
|
+
}
|
|
442
|
+
);
|
|
426
443
|
function DropdownMenuContent({
|
|
427
444
|
className,
|
|
428
445
|
"aria-label": ariaLabel,
|
|
429
446
|
children
|
|
430
447
|
}) {
|
|
431
448
|
const ctx = useDropdownMenuContext();
|
|
449
|
+
const reducedMotion = useReducedMotion();
|
|
450
|
+
const [mounted, setMounted] = useState(ctx.open);
|
|
451
|
+
useEffect(() => {
|
|
452
|
+
if (ctx.open) {
|
|
453
|
+
setMounted(true);
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
if (!reducedMotion) return;
|
|
457
|
+
const raf = requestAnimationFrame(() => setMounted(false));
|
|
458
|
+
return () => cancelAnimationFrame(raf);
|
|
459
|
+
}, [ctx.open, reducedMotion]);
|
|
460
|
+
if (!mounted) return null;
|
|
432
461
|
return /* @__PURE__ */ jsx(
|
|
433
462
|
Menu,
|
|
434
463
|
{
|
|
435
|
-
open:
|
|
464
|
+
open: mounted,
|
|
436
465
|
anchor: ctx.triggerNode,
|
|
437
466
|
onClose: () => {
|
|
438
467
|
ctx.setOpen(false);
|
|
@@ -441,8 +470,16 @@ function DropdownMenuContent({
|
|
|
441
470
|
placement: ctx.placement,
|
|
442
471
|
offset: ctx.offset,
|
|
443
472
|
"aria-label": ariaLabel,
|
|
444
|
-
|
|
445
|
-
|
|
473
|
+
children: /* @__PURE__ */ jsx(Presence, { isPresent: ctx.open, children: /* @__PURE__ */ jsx(
|
|
474
|
+
DropdownMenuPanel,
|
|
475
|
+
{
|
|
476
|
+
className,
|
|
477
|
+
onAnimationEnd: () => {
|
|
478
|
+
if (!ctx.open) setMounted(false);
|
|
479
|
+
},
|
|
480
|
+
children
|
|
481
|
+
}
|
|
482
|
+
) })
|
|
446
483
|
}
|
|
447
484
|
);
|
|
448
485
|
}
|
|
@@ -564,7 +601,7 @@ function ContextMenuContent({
|
|
|
564
601
|
placement,
|
|
565
602
|
offset,
|
|
566
603
|
"aria-label": ariaLabel,
|
|
567
|
-
className,
|
|
604
|
+
className: cn("motion-safe:animate-(--animate-pop-in)", className),
|
|
568
605
|
children
|
|
569
606
|
}
|
|
570
607
|
);
|
|
@@ -931,17 +968,48 @@ var NavigationMenuLink = forwardRef(
|
|
|
931
968
|
);
|
|
932
969
|
}
|
|
933
970
|
);
|
|
971
|
+
var NavigationMenuPanel = forwardRef(
|
|
972
|
+
function NavigationMenuPanel2({ className, children, ...props }, ref) {
|
|
973
|
+
return /* @__PURE__ */ jsx(
|
|
974
|
+
"div",
|
|
975
|
+
{
|
|
976
|
+
ref,
|
|
977
|
+
className: cn(
|
|
978
|
+
/* pop (fade + slight scale) gated on data-state; motion-safe so
|
|
979
|
+
reduced-motion users get no movement. */
|
|
980
|
+
"min-w-[12rem] outline-none",
|
|
981
|
+
"motion-safe:data-[state=open]:animate-(--animate-pop-in)",
|
|
982
|
+
"motion-safe:data-[state=closed]:animate-(--animate-pop-out)",
|
|
983
|
+
"motion-reduce:animate-none",
|
|
984
|
+
surfaceVariants({ variant: "surface", radius: "md", padding: "md" }),
|
|
985
|
+
className
|
|
986
|
+
),
|
|
987
|
+
...props,
|
|
988
|
+
children
|
|
989
|
+
}
|
|
990
|
+
);
|
|
991
|
+
}
|
|
992
|
+
);
|
|
934
993
|
var NavigationMenuContent = forwardRef(
|
|
935
994
|
function NavigationMenuContent2({ className, children, ...rest }, ref) {
|
|
936
995
|
const nav = useNavContext();
|
|
937
996
|
const item = useNavItemContext();
|
|
997
|
+
const reducedMotion = useReducedMotion();
|
|
938
998
|
const handleClose = useCallback(() => {
|
|
939
999
|
nav.setActiveId(null);
|
|
940
1000
|
requestAnimationFrame(() => item.triggerRef.current?.focus());
|
|
941
1001
|
}, [nav, item.triggerRef]);
|
|
1002
|
+
const [mounted, setMounted] = useState(item.open);
|
|
942
1003
|
useEffect(() => {
|
|
943
|
-
|
|
944
|
-
|
|
1004
|
+
if (item.open) {
|
|
1005
|
+
setMounted(true);
|
|
1006
|
+
return;
|
|
1007
|
+
}
|
|
1008
|
+
if (!reducedMotion) return;
|
|
1009
|
+
const raf = requestAnimationFrame(() => setMounted(false));
|
|
1010
|
+
return () => cancelAnimationFrame(raf);
|
|
1011
|
+
}, [item.open, reducedMotion]);
|
|
1012
|
+
if (!mounted) return null;
|
|
945
1013
|
return /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(
|
|
946
1014
|
AnchoredPositioner,
|
|
947
1015
|
{
|
|
@@ -957,22 +1025,20 @@ var NavigationMenuContent = forwardRef(
|
|
|
957
1025
|
if (item.triggerRef.current?.contains(e.target)) return;
|
|
958
1026
|
nav.setActiveId(null);
|
|
959
1027
|
},
|
|
960
|
-
children: /* @__PURE__ */ jsx(
|
|
961
|
-
|
|
1028
|
+
children: /* @__PURE__ */ jsx(Presence, { isPresent: item.open, children: /* @__PURE__ */ jsx(
|
|
1029
|
+
NavigationMenuPanel,
|
|
962
1030
|
{
|
|
963
1031
|
ref,
|
|
964
1032
|
id: item.contentId,
|
|
965
1033
|
"aria-labelledby": item.triggerId,
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
className
|
|
971
|
-
),
|
|
1034
|
+
className,
|
|
1035
|
+
onAnimationEnd: () => {
|
|
1036
|
+
if (!item.open) setMounted(false);
|
|
1037
|
+
},
|
|
972
1038
|
...rest,
|
|
973
1039
|
children
|
|
974
1040
|
}
|
|
975
|
-
)
|
|
1041
|
+
) })
|
|
976
1042
|
}
|
|
977
1043
|
)
|
|
978
1044
|
}
|
|
@@ -1428,5 +1494,5 @@ var TableOfContents = forwardRef(
|
|
|
1428
1494
|
);
|
|
1429
1495
|
|
|
1430
1496
|
export { Breadcrumb, CommandPalette, CommandPaletteContent, CommandPaletteEmpty, CommandPaletteGroup, CommandPaletteInput, CommandPaletteItem, CommandPaletteList, CommandPaletteSeparator, ContextMenu, ContextMenuContent, ContextMenuTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuTrigger, Menu, MenuGroup, MenuItem, MenuLabel, MenuSeparator, Menubar, MenubarContent, MenubarMenu, MenubarTrigger, NavItem, NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, Pagination, ScrollSpy, TableOfContents, menuItemVariants, menuLabelVariants, menuSeparatorVariants, menuVariants, useScrollSpy };
|
|
1431
|
-
//# sourceMappingURL=chunk-
|
|
1432
|
-
//# sourceMappingURL=chunk-
|
|
1497
|
+
//# sourceMappingURL=chunk-H3WC7KRX.js.map
|
|
1498
|
+
//# sourceMappingURL=chunk-H3WC7KRX.js.map
|