@classic-homes/theme-react 0.4.2 → 0.5.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/index.js CHANGED
@@ -87,6 +87,7 @@ __export(index_exports, {
87
87
  badgeVariants: () => badgeVariants,
88
88
  buttonVariants: () => buttonVariants,
89
89
  cn: () => cn,
90
+ labelVariants: () => labelVariants,
90
91
  pageHeaderActionsVariants: () => pageHeaderActionsVariants,
91
92
  pageHeaderContainerVariants: () => pageHeaderContainerVariants,
92
93
  pageHeaderSubtitleVariants: () => pageHeaderSubtitleVariants,
@@ -207,9 +208,25 @@ var CardFooter = React2.forwardRef(
207
208
  CardFooter.displayName = "CardFooter";
208
209
 
209
210
  // src/components/Input.tsx
211
+ var React4 = __toESM(require("react"));
212
+
213
+ // src/lib/useDevWarning.ts
210
214
  var React3 = __toESM(require("react"));
215
+ var warnedOnce = /* @__PURE__ */ new Set();
216
+ function useDevWarning(condition, message, once = false) {
217
+ React3.useEffect(() => {
218
+ if (process.env.NODE_ENV === "production" || !condition) return;
219
+ if (once) {
220
+ if (warnedOnce.has(message)) return;
221
+ warnedOnce.add(message);
222
+ }
223
+ console.warn(message);
224
+ }, [condition, message, once]);
225
+ }
226
+
227
+ // src/components/Input.tsx
211
228
  var import_jsx_runtime3 = require("react/jsx-runtime");
212
- var Input = React3.forwardRef(
229
+ var Input = React4.forwardRef(
213
230
  ({
214
231
  className,
215
232
  type,
@@ -218,13 +235,10 @@ var Input = React3.forwardRef(
218
235
  "aria-describedby": ariaDescribedBy,
219
236
  ...props
220
237
  }, ref) => {
221
- if (process.env.NODE_ENV !== "production") {
222
- if (!props["aria-label"] && !props["aria-labelledby"] && !props.id) {
223
- console.warn(
224
- "Input: Missing accessible label. Provide aria-label, aria-labelledby, or associate with a Label using id/htmlFor for WCAG compliance."
225
- );
226
- }
227
- }
238
+ useDevWarning(
239
+ !props["aria-label"] && !props["aria-labelledby"] && !props.id,
240
+ "Input: Missing accessible label. Provide aria-label, aria-labelledby, or associate with a Label using id/htmlFor for WCAG compliance."
241
+ );
228
242
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
229
243
  "input",
230
244
  {
@@ -247,24 +261,24 @@ var Input = React3.forwardRef(
247
261
  Input.displayName = "Input";
248
262
 
249
263
  // src/components/PasswordInput.tsx
250
- var React5 = __toESM(require("react"));
264
+ var React6 = __toESM(require("react"));
251
265
 
252
266
  // src/hooks/useAnnounce.ts
253
- var React4 = __toESM(require("react"));
267
+ var React5 = __toESM(require("react"));
254
268
  function useAnnounce(defaultOptions) {
255
- const [message, setMessage] = React4.useState("");
256
- const [politeness, setPoliteness] = React4.useState(
269
+ const [message, setMessage] = React5.useState("");
270
+ const [politeness, setPoliteness] = React5.useState(
257
271
  defaultOptions?.politeness ?? "polite"
258
272
  );
259
- const clearTimeoutRef = React4.useRef(null);
260
- const clear = React4.useCallback(() => {
273
+ const clearTimeoutRef = React5.useRef(null);
274
+ const clear = React5.useCallback(() => {
261
275
  setMessage("");
262
276
  if (clearTimeoutRef.current) {
263
277
  clearTimeout(clearTimeoutRef.current);
264
278
  clearTimeoutRef.current = null;
265
279
  }
266
280
  }, []);
267
- const announce = React4.useCallback(
281
+ const announce = React5.useCallback(
268
282
  (newMessage, options) => {
269
283
  if (clearTimeoutRef.current) {
270
284
  clearTimeout(clearTimeoutRef.current);
@@ -282,7 +296,7 @@ function useAnnounce(defaultOptions) {
282
296
  },
283
297
  [defaultOptions?.clearDelay, defaultOptions?.politeness]
284
298
  );
285
- React4.useEffect(() => {
299
+ React5.useEffect(() => {
286
300
  return () => {
287
301
  if (clearTimeoutRef.current) {
288
302
  clearTimeout(clearTimeoutRef.current);
@@ -334,7 +348,7 @@ var EyeOffIcon = () => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
334
348
  children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24M1 1l22 22" })
335
349
  }
336
350
  );
337
- var PasswordInput = React5.forwardRef(
351
+ var PasswordInput = React6.forwardRef(
338
352
  ({
339
353
  className,
340
354
  disabled,
@@ -347,15 +361,12 @@ var PasswordInput = React5.forwardRef(
347
361
  "aria-labelledby": ariaLabelledBy,
348
362
  ...props
349
363
  }, ref) => {
350
- const [showPassword, setShowPassword] = React5.useState(false);
364
+ const [showPassword, setShowPassword] = React6.useState(false);
351
365
  const { announce, message, politeness } = useAnnounce();
352
- if (process.env.NODE_ENV !== "production") {
353
- if (!ariaLabel && !ariaLabelledBy && !id) {
354
- console.warn(
355
- "PasswordInput: Missing accessible label. Provide aria-label, aria-labelledby, or an id to associate with a Label element for WCAG compliance."
356
- );
357
- }
358
- }
366
+ useDevWarning(
367
+ !ariaLabel && !ariaLabelledBy && !id,
368
+ "PasswordInput: Missing accessible label. Provide aria-label, aria-labelledby, or an id to associate with a Label element for WCAG compliance."
369
+ );
359
370
  const toggleVisibility = () => {
360
371
  setShowPassword((prev) => {
361
372
  const newState = !prev;
@@ -399,18 +410,18 @@ var PasswordInput = React5.forwardRef(
399
410
  PasswordInput.displayName = "PasswordInput";
400
411
 
401
412
  // src/components/Label.tsx
402
- var React6 = __toESM(require("react"));
413
+ var React7 = __toESM(require("react"));
403
414
  var LabelPrimitive = __toESM(require("@radix-ui/react-label"));
404
415
  var import_class_variance_authority2 = require("class-variance-authority");
405
416
  var import_jsx_runtime5 = require("react/jsx-runtime");
406
417
  var labelVariants = (0, import_class_variance_authority2.cva)(
407
418
  "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
408
419
  );
409
- var Label = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(LabelPrimitive.Root, { ref, className: cn(labelVariants(), className), ...props }));
420
+ var Label = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(LabelPrimitive.Root, { ref, className: cn(labelVariants(), className), ...props }));
410
421
  Label.displayName = LabelPrimitive.Root.displayName;
411
422
 
412
423
  // src/components/Badge.tsx
413
- var React7 = __toESM(require("react"));
424
+ var React8 = __toESM(require("react"));
414
425
  var import_class_variance_authority3 = require("class-variance-authority");
415
426
  var import_jsx_runtime6 = require("react/jsx-runtime");
416
427
  var badgeVariants = (0, import_class_variance_authority3.cva)(
@@ -458,7 +469,7 @@ var badgeVariants = (0, import_class_variance_authority3.cva)(
458
469
  }
459
470
  }
460
471
  );
461
- var Badge = React7.forwardRef(
472
+ var Badge = React8.forwardRef(
462
473
  ({ className, variant, size, live, clickable, label, children, onClick, ...props }, ref) => {
463
474
  if (process.env.NODE_ENV !== "production") {
464
475
  if (live && !label) {
@@ -469,41 +480,34 @@ var Badge = React7.forwardRef(
469
480
  }
470
481
  const isInteractive = clickable || !!onClick;
471
482
  const classes = cn(badgeVariants({ variant, size, clickable: isInteractive }), className);
472
- const sharedProps = {
473
- role: live ? "status" : void 0,
474
- "aria-live": live ? "polite" : void 0,
475
- "aria-atomic": live ? "true" : void 0,
476
- className: classes,
477
- ...props
478
- };
483
+ const liveProps = live ? { role: "status", "aria-live": "polite", "aria-atomic": "true" } : {};
484
+ const content = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
485
+ children,
486
+ label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "sr-only", children: label })
487
+ ] });
479
488
  if (isInteractive) {
480
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
489
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
481
490
  "button",
482
491
  {
483
492
  ref,
484
493
  type: "button",
485
494
  onClick,
486
- ...sharedProps,
487
- children: [
488
- children,
489
- label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "sr-only", children: label })
490
- ]
495
+ className: classes,
496
+ ...props,
497
+ children: live ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { ...liveProps, children: content }) : content
491
498
  }
492
499
  );
493
500
  }
494
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { ref, ...sharedProps, children: [
495
- children,
496
- label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "sr-only", children: label })
497
- ] });
501
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { ref, ...liveProps, className: classes, ...props, children: content });
498
502
  }
499
503
  );
500
504
  Badge.displayName = "Badge";
501
505
 
502
506
  // src/components/Separator.tsx
503
- var React8 = __toESM(require("react"));
507
+ var React9 = __toESM(require("react"));
504
508
  var SeparatorPrimitive = __toESM(require("@radix-ui/react-separator"));
505
509
  var import_jsx_runtime7 = require("react/jsx-runtime");
506
- var Separator = React8.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => {
510
+ var Separator = React9.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => {
507
511
  if (process.env.NODE_ENV !== "production") {
508
512
  if (!decorative && !props["aria-label"]) {
509
513
  console.warn(
@@ -529,12 +533,12 @@ var Separator = React8.forwardRef(({ className, orientation = "horizontal", deco
529
533
  Separator.displayName = SeparatorPrimitive.Root.displayName;
530
534
 
531
535
  // src/components/Switch.tsx
532
- var React9 = __toESM(require("react"));
536
+ var React10 = __toESM(require("react"));
533
537
  var SwitchPrimitives = __toESM(require("@radix-ui/react-switch"));
534
538
  var import_jsx_runtime8 = require("react/jsx-runtime");
535
539
  var SwitchRoot = SwitchPrimitives.Root;
536
540
  var SwitchThumb = SwitchPrimitives.Thumb;
537
- var Switch = React9.forwardRef(
541
+ var Switch = React10.forwardRef(
538
542
  ({
539
543
  className,
540
544
  size = "default",
@@ -543,13 +547,10 @@ var Switch = React9.forwardRef(
543
547
  "aria-describedby": ariaDescribedBy,
544
548
  ...props
545
549
  }, ref) => {
546
- if (process.env.NODE_ENV !== "production") {
547
- if (!ariaLabel && !ariaLabelledBy && !props.id) {
548
- console.warn(
549
- "Switch: Missing accessible label. Provide aria-label, aria-labelledby, or associate with a Label using id/htmlFor for WCAG compliance."
550
- );
551
- }
552
- }
550
+ useDevWarning(
551
+ !ariaLabel && !ariaLabelledBy && !props.id,
552
+ "Switch: Missing accessible label. Provide aria-label, aria-labelledby, or associate with a Label using id/htmlFor for WCAG compliance."
553
+ );
553
554
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
554
555
  SwitchRoot,
555
556
  {
@@ -581,10 +582,10 @@ var Switch = React9.forwardRef(
581
582
  Switch.displayName = SwitchPrimitives.Root.displayName;
582
583
 
583
584
  // src/components/Avatar.tsx
584
- var React10 = __toESM(require("react"));
585
+ var React11 = __toESM(require("react"));
585
586
  var AvatarPrimitive = __toESM(require("@radix-ui/react-avatar"));
586
587
  var import_jsx_runtime9 = require("react/jsx-runtime");
587
- var Avatar = React10.forwardRef(
588
+ var Avatar = React11.forwardRef(
588
589
  ({ className, name, "aria-label": ariaLabel, ...props }, ref) => {
589
590
  if (process.env.NODE_ENV !== "production") {
590
591
  if (!ariaLabel && !name) {
@@ -598,6 +599,7 @@ var Avatar = React10.forwardRef(
598
599
  AvatarPrimitive.Root,
599
600
  {
600
601
  ref,
602
+ role: computedAriaLabel ? "img" : void 0,
601
603
  "aria-label": computedAriaLabel,
602
604
  className: cn("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", className),
603
605
  ...props
@@ -606,7 +608,7 @@ var Avatar = React10.forwardRef(
606
608
  }
607
609
  );
608
610
  Avatar.displayName = AvatarPrimitive.Root.displayName;
609
- var AvatarImage = React10.forwardRef(({ className, alt, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
611
+ var AvatarImage = React11.forwardRef(({ className, alt, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
610
612
  AvatarPrimitive.Image,
611
613
  {
612
614
  ref,
@@ -616,7 +618,7 @@ var AvatarImage = React10.forwardRef(({ className, alt, ...props }, ref) => /* @
616
618
  }
617
619
  ));
618
620
  AvatarImage.displayName = AvatarPrimitive.Image.displayName;
619
- var AvatarFallback = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
621
+ var AvatarFallback = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
620
622
  AvatarPrimitive.Fallback,
621
623
  {
622
624
  ref,
@@ -630,7 +632,7 @@ var AvatarFallback = React10.forwardRef(({ className, ...props }, ref) => /* @__
630
632
  AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
631
633
 
632
634
  // src/components/Dialog.tsx
633
- var React11 = __toESM(require("react"));
635
+ var React12 = __toESM(require("react"));
634
636
  var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
635
637
  var import_jsx_runtime10 = require("react/jsx-runtime");
636
638
  var PrimitiveOverlay = DialogPrimitive.Overlay;
@@ -649,7 +651,7 @@ var dialogSizeClasses = {
649
651
  "2xl": "max-w-[min(theme(maxWidth.3xl),calc(100vw-2rem))]",
650
652
  full: "max-w-[calc(100vw-2rem)]"
651
653
  };
652
- var DialogOverlay = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
654
+ var DialogOverlay = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
653
655
  PrimitiveOverlay,
654
656
  {
655
657
  ref,
@@ -661,19 +663,50 @@ var DialogOverlay = React11.forwardRef(({ className, ...props }, ref) => /* @__P
661
663
  }
662
664
  ));
663
665
  DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
664
- var DialogContent = React11.forwardRef(({ className, children, size = "md", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(DialogPortal, { children: [
666
+ var DialogContent = React12.forwardRef(({ className, children, size = "md", showClose = false, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(DialogPortal, { children: [
665
667
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DialogOverlay, {}),
666
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
668
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
667
669
  PrimitiveContent,
668
670
  {
669
671
  ref,
670
672
  className: cn(
671
- "fixed left-[50%] top-[50%] z-50 grid w-full translate-x-[-50%] translate-y-[-50%] gap-4 border border-border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
673
+ // max-h + overflow: a dialog taller than the viewport scrolls inside
674
+ // itself instead of running off-screen.
675
+ "fixed left-[50%] top-[50%] z-50 grid max-h-[calc(100dvh-2rem)] w-full translate-x-[-50%] translate-y-[-50%] gap-4 overflow-y-auto overscroll-contain border border-border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
672
676
  dialogSizeClasses[size],
673
677
  className
674
678
  ),
675
679
  ...props,
676
- children
680
+ children: [
681
+ children,
682
+ showClose && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
683
+ DialogPrimitive.Close,
684
+ {
685
+ className: "absolute right-3 top-3 flex h-9 w-9 items-center justify-center rounded-md bg-transparent text-muted-foreground hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none",
686
+ "aria-label": "Close dialog",
687
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
688
+ "svg",
689
+ {
690
+ xmlns: "http://www.w3.org/2000/svg",
691
+ width: "20",
692
+ height: "20",
693
+ viewBox: "0 0 24 24",
694
+ fill: "none",
695
+ stroke: "currentColor",
696
+ strokeWidth: "2",
697
+ strokeLinecap: "round",
698
+ strokeLinejoin: "round",
699
+ className: "h-5 w-5",
700
+ "aria-hidden": "true",
701
+ children: [
702
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { d: "M18 6 6 18" }),
703
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { d: "m6 6 12 12" })
704
+ ]
705
+ }
706
+ )
707
+ }
708
+ )
709
+ ]
677
710
  }
678
711
  )
679
712
  ] }));
@@ -688,7 +721,7 @@ var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_r
688
721
  }
689
722
  );
690
723
  DialogFooter.displayName = "DialogFooter";
691
- var DialogTitle = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
724
+ var DialogTitle = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
692
725
  PrimitiveTitle,
693
726
  {
694
727
  ref,
@@ -697,7 +730,7 @@ var DialogTitle = React11.forwardRef(({ className, ...props }, ref) => /* @__PUR
697
730
  }
698
731
  ));
699
732
  DialogTitle.displayName = DialogPrimitive.Title.displayName;
700
- var DialogDescription = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
733
+ var DialogDescription = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
701
734
  PrimitiveDescription,
702
735
  {
703
736
  ref,
@@ -708,7 +741,7 @@ var DialogDescription = React11.forwardRef(({ className, ...props }, ref) => /*
708
741
  DialogDescription.displayName = DialogPrimitive.Description.displayName;
709
742
 
710
743
  // src/components/PageHeader.tsx
711
- var React12 = __toESM(require("react"));
744
+ var React13 = __toESM(require("react"));
712
745
  var import_class_variance_authority4 = require("class-variance-authority");
713
746
  var import_jsx_runtime11 = require("react/jsx-runtime");
714
747
  var pageHeaderContainerVariants = (0, import_class_variance_authority4.cva)("", {
@@ -771,15 +804,13 @@ var pageHeaderActionsVariants = (0, import_class_variance_authority4.cva)("flex
771
804
  variant: "default"
772
805
  }
773
806
  });
774
- var PageHeader = React12.forwardRef(
807
+ var PageHeader = React13.forwardRef(
775
808
  ({ className, variant, title, subtitle, actions, as: Heading = "h1", ...props }, ref) => {
776
- if (process.env.NODE_ENV !== "production") {
777
- if (Heading === "h1") {
778
- console.warn(
779
- 'PageHeader: Using as="h1" (the default). Ensure there is only one h1 per page for proper document structure. Consider as="h2" for secondary headers.'
780
- );
781
- }
782
- }
809
+ useDevWarning(
810
+ Heading === "h1",
811
+ 'PageHeader: Using as="h1" (the default). Ensure there is only one h1 per page for proper document structure. Consider as="h2" for secondary headers.',
812
+ true
813
+ );
783
814
  return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
784
815
  "header",
785
816
  {
@@ -945,8 +976,9 @@ function Sheet({
945
976
  }
946
977
 
947
978
  // src/components/SortableList.tsx
948
- var React13 = __toESM(require("react"));
979
+ var React14 = __toESM(require("react"));
949
980
  var import_jsx_runtime14 = require("react/jsx-runtime");
981
+ var HANDLE_STYLE = { touchAction: "none" };
950
982
  function SortableList({
951
983
  items,
952
984
  getKey,
@@ -958,19 +990,19 @@ function SortableList({
958
990
  className,
959
991
  itemClassName
960
992
  }) {
961
- const instructionsId = `${React13.useId()}-sortable-help`;
962
- const listRef = React13.useRef(null);
963
- const [announcement, setAnnouncement] = React13.useState("");
964
- const [drag, setDrag] = React13.useState(
993
+ const instructionsId = `${React14.useId()}-sortable-help`;
994
+ const listRef = React14.useRef(null);
995
+ const [announcement, setAnnouncement] = React14.useState("");
996
+ const [drag, setDrag] = React14.useState(
965
997
  null
966
998
  );
967
- const rects = React13.useRef([]);
968
- const startY = React13.useRef(0);
969
- const [grabbed, setGrabbed] = React13.useState(null);
970
- const grabbedFrom = React13.useRef(0);
971
- const moving = React13.useRef(false);
972
- const pendingFocus = React13.useRef(null);
973
- React13.useLayoutEffect(() => {
999
+ const rects = React14.useRef([]);
1000
+ const startY = React14.useRef(0);
1001
+ const [grabbed, setGrabbed] = React14.useState(null);
1002
+ const grabbedFrom = React14.useRef(0);
1003
+ const moving = React14.useRef(false);
1004
+ const pendingFocus = React14.useRef(null);
1005
+ React14.useLayoutEffect(() => {
974
1006
  if (pendingFocus.current === null) return;
975
1007
  const handles = listRef.current?.querySelectorAll(
976
1008
  ":scope > li [data-sortable-handle]"
@@ -1017,6 +1049,7 @@ function SortableList({
1017
1049
  "aria-describedby": instructionsId,
1018
1050
  "aria-pressed": grabbed === index,
1019
1051
  "data-sortable-handle": String(key),
1052
+ style: HANDLE_STYLE,
1020
1053
  onPointerDown(event) {
1021
1054
  if (disabled || event.button !== 0 || !listRef.current) return;
1022
1055
  event.preventDefault();
@@ -1108,20 +1141,20 @@ function SortableList({
1108
1141
  }
1109
1142
 
1110
1143
  // src/components/studio/Studio.tsx
1111
- var React15 = __toESM(require("react"));
1144
+ var React16 = __toESM(require("react"));
1112
1145
 
1113
1146
  // src/components/studio/context.ts
1114
- var React14 = __toESM(require("react"));
1115
- var StudioContext = React14.createContext(void 0);
1147
+ var React15 = __toESM(require("react"));
1148
+ var StudioContext = React15.createContext(void 0);
1116
1149
  function useStudio() {
1117
- return React14.useContext(StudioContext);
1150
+ return React15.useContext(StudioContext);
1118
1151
  }
1119
1152
 
1120
1153
  // src/components/studio/Studio.tsx
1121
1154
  var import_jsx_runtime15 = require("react/jsx-runtime");
1122
1155
  function useLayout() {
1123
- const [layout, setLayout] = React15.useState("wide");
1124
- React15.useEffect(() => {
1156
+ const [layout, setLayout] = React16.useState("wide");
1157
+ React16.useEffect(() => {
1125
1158
  const wide = window.matchMedia("(min-width: 1280px)");
1126
1159
  const medium = window.matchMedia("(min-width: 768px)");
1127
1160
  const update = () => setLayout(wide.matches ? "wide" : medium.matches ? "medium" : "compact");
@@ -1136,9 +1169,9 @@ function useLayout() {
1136
1169
  return layout;
1137
1170
  }
1138
1171
  function useControllable(value, onChange) {
1139
- const [inner, setInner] = React15.useState(false);
1172
+ const [inner, setInner] = React16.useState(false);
1140
1173
  const current = value ?? inner;
1141
- const set = React15.useCallback(
1174
+ const set = React16.useCallback(
1142
1175
  (next) => {
1143
1176
  if (value === void 0) setInner(next);
1144
1177
  onChange?.(next);
@@ -1170,11 +1203,11 @@ function Studio({
1170
1203
  );
1171
1204
  const railInSheet = !!rail && layout !== "wide";
1172
1205
  const inspectorInSheet = !!inspector && layout === "compact";
1173
- React15.useEffect(() => {
1206
+ React16.useEffect(() => {
1174
1207
  if (layout === "wide" && railOpen) setRailOpen(false);
1175
1208
  if (layout !== "compact" && inspectorOpen) setInspectorOpen(false);
1176
1209
  }, [layout, railOpen, inspectorOpen, setRailOpen, setInspectorOpen]);
1177
- const context = React15.useMemo(
1210
+ const context = React16.useMemo(
1178
1211
  () => ({
1179
1212
  layout,
1180
1213
  railInSheet,
@@ -1268,7 +1301,7 @@ function Studio({
1268
1301
  }
1269
1302
 
1270
1303
  // src/components/studio/StudioBar.tsx
1271
- var React16 = __toESM(require("react"));
1304
+ var React17 = __toESM(require("react"));
1272
1305
 
1273
1306
  // src/components/studio/menu.tsx
1274
1307
  var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
@@ -1318,7 +1351,7 @@ function ModeSwitch({
1318
1351
  value,
1319
1352
  onChange
1320
1353
  }) {
1321
- const refs = React16.useRef([]);
1354
+ const refs = React17.useRef([]);
1322
1355
  const keyDown = (event, index) => {
1323
1356
  const step = event.key === "ArrowRight" || event.key === "ArrowDown" ? 1 : event.key === "ArrowLeft" || event.key === "ArrowUp" ? -1 : 0;
1324
1357
  if (!step) return;
@@ -1381,9 +1414,9 @@ function StudioBar({
1381
1414
  menuLabel = "More actions",
1382
1415
  className
1383
1416
  }) {
1384
- const [draft, setDraft] = React16.useState(title);
1385
- const atFocus = React16.useRef(title);
1386
- React16.useEffect(() => setDraft(title), [title]);
1417
+ const [draft, setDraft] = React17.useState(title);
1418
+ const atFocus = React17.useRef(title);
1419
+ React17.useEffect(() => setDraft(title), [title]);
1387
1420
  const commit = () => {
1388
1421
  const next = draft.trim();
1389
1422
  if (!next) {
@@ -1473,7 +1506,7 @@ function StudioBar({
1473
1506
  }
1474
1507
 
1475
1508
  // src/components/studio/StudioOutline.tsx
1476
- var React17 = __toESM(require("react"));
1509
+ var React18 = __toESM(require("react"));
1477
1510
  var import_jsx_runtime18 = require("react/jsx-runtime");
1478
1511
  function StudioOutline({
1479
1512
  items,
@@ -1491,12 +1524,12 @@ function StudioOutline({
1491
1524
  className
1492
1525
  }) {
1493
1526
  const studio = useStudio();
1494
- const listHost = React17.useRef(null);
1527
+ const listHost = React18.useRef(null);
1495
1528
  const focusIndex = Math.max(
1496
1529
  0,
1497
1530
  items.findIndex((i) => i.id === selected)
1498
1531
  );
1499
- React17.useEffect(() => {
1532
+ React18.useEffect(() => {
1500
1533
  if (!selected) return;
1501
1534
  listHost.current?.querySelector(`[data-outline-id="${CSS.escape(selected)}"]`)?.scrollIntoView?.({ block: "nearest" });
1502
1535
  }, [selected]);
@@ -1653,8 +1686,9 @@ function StudioOutline({
1653
1686
  }
1654
1687
 
1655
1688
  // src/components/studio/StudioCanvas.tsx
1656
- var React18 = __toESM(require("react"));
1689
+ var React19 = __toESM(require("react"));
1657
1690
  var import_jsx_runtime19 = require("react/jsx-runtime");
1691
+ var DEVICES = ["desktop", "phone"];
1658
1692
  function StudioCanvas({
1659
1693
  children,
1660
1694
  deviceToggle = false,
@@ -1668,13 +1702,31 @@ function StudioCanvas({
1668
1702
  className
1669
1703
  }) {
1670
1704
  const studio = useStudio();
1671
- const [innerDevice, setInnerDevice] = React18.useState("desktop");
1705
+ const [innerDevice, setInnerDevice] = React19.useState("desktop");
1672
1706
  const device = deviceProp ?? innerDevice;
1673
1707
  const setDevice = (d) => {
1674
1708
  if (deviceProp === void 0) setInnerDevice(d);
1675
1709
  onDeviceChange?.(d);
1676
1710
  };
1677
1711
  const showDevices = deviceToggle && studio?.layout !== "compact";
1712
+ const deviceRefs = React19.useRef([]);
1713
+ const deviceKeyDown = (event, index) => {
1714
+ const step = event.key === "ArrowRight" || event.key === "ArrowDown" ? 1 : event.key === "ArrowLeft" || event.key === "ArrowUp" ? -1 : 0;
1715
+ if (!step) return;
1716
+ event.preventDefault();
1717
+ const next = (index + step + DEVICES.length) % DEVICES.length;
1718
+ setDevice(DEVICES[next]);
1719
+ deviceRefs.current[next]?.focus();
1720
+ };
1721
+ const handleKeyDown = (e) => {
1722
+ if (e.key !== "Escape" || e.defaultPrevented || !onBackgroundClick) return;
1723
+ const target = e.target;
1724
+ if (target.isContentEditable || ["INPUT", "TEXTAREA", "SELECT"].includes(target.tagName)) {
1725
+ return;
1726
+ }
1727
+ e.preventDefault();
1728
+ onBackgroundClick();
1729
+ };
1678
1730
  const width = device === "phone" && showDevices ? "390px" : maxWidth;
1679
1731
  return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("section", { "aria-label": label, className: cn("flex h-full flex-col", className), children: [
1680
1732
  (showDevices || toolbar) && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex shrink-0 items-center justify-end gap-2 px-3 pt-3", children: [
@@ -1685,13 +1737,18 @@ function StudioCanvas({
1685
1737
  role: "radiogroup",
1686
1738
  "aria-label": "Preview size",
1687
1739
  className: "inline-flex h-9 items-center gap-1 rounded-lg bg-muted p-1 text-muted-foreground",
1688
- children: ["desktop", "phone"].map((d) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
1740
+ children: DEVICES.map((d, i) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
1689
1741
  "button",
1690
1742
  {
1743
+ ref: (el) => {
1744
+ deviceRefs.current[i] = el;
1745
+ },
1691
1746
  type: "button",
1692
1747
  role: "radio",
1693
1748
  "aria-checked": device === d,
1749
+ tabIndex: device === d ? 0 : -1,
1694
1750
  onClick: () => setDevice(d),
1751
+ onKeyDown: (e) => deviceKeyDown(e, i),
1695
1752
  className: cn(
1696
1753
  "inline-flex h-7 items-center gap-1.5 rounded-md px-2.5 text-sm font-medium hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1697
1754
  device === d && "bg-background text-foreground shadow-sm"
@@ -1713,6 +1770,7 @@ function StudioCanvas({
1713
1770
  onClick: (e) => {
1714
1771
  if (e.target === e.currentTarget) onBackgroundClick?.();
1715
1772
  },
1773
+ onKeyDown: handleKeyDown,
1716
1774
  children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1717
1775
  "div",
1718
1776
  {
@@ -1730,7 +1788,7 @@ function StudioCanvas({
1730
1788
  }
1731
1789
 
1732
1790
  // src/components/studio/StudioCanvasItem.tsx
1733
- var React19 = __toESM(require("react"));
1791
+ var React20 = __toESM(require("react"));
1734
1792
  var import_jsx_runtime20 = require("react/jsx-runtime");
1735
1793
  function StudioCanvasItem({
1736
1794
  children,
@@ -1745,14 +1803,14 @@ function StudioCanvasItem({
1745
1803
  className
1746
1804
  }) {
1747
1805
  const studio = useStudio();
1748
- const ref = React19.useRef(null);
1749
- const pickedHere = React19.useRef(false);
1806
+ const ref = React20.useRef(null);
1807
+ const pickedHere = React20.useRef(false);
1750
1808
  const inQuickAction = (target) => !!target?.closest?.("[data-studio-quick-action]");
1751
1809
  const select = (reveal) => {
1752
1810
  if (!selected) onSelect?.();
1753
1811
  if (reveal) studio?.revealInspector();
1754
1812
  };
1755
- React19.useEffect(() => {
1813
+ React20.useEffect(() => {
1756
1814
  const el = ref.current;
1757
1815
  const here = pickedHere.current;
1758
1816
  pickedHere.current = false;
@@ -1830,7 +1888,7 @@ function StudioCanvasItem({
1830
1888
  }
1831
1889
 
1832
1890
  // src/components/studio/StudioInspector.tsx
1833
- var React20 = __toESM(require("react"));
1891
+ var React21 = __toESM(require("react"));
1834
1892
  var import_jsx_runtime21 = require("react/jsx-runtime");
1835
1893
  function StudioInspector({
1836
1894
  title,
@@ -1843,9 +1901,10 @@ function StudioInspector({
1843
1901
  footer,
1844
1902
  className
1845
1903
  }) {
1846
- const uid = React20.useId();
1847
- const [innerTab, setInnerTab] = React20.useState(tabs?.[0]?.id ?? "");
1848
- const tab = tabProp ?? innerTab;
1904
+ const uid = React21.useId();
1905
+ const [innerTab, setInnerTab] = React21.useState(tabs?.[0]?.id ?? "");
1906
+ const requestedTab = tabProp ?? innerTab;
1907
+ const tab = !tabs || tabs.some((t) => t.id === requestedTab) ? requestedTab : tabs[0]?.id ?? "";
1849
1908
  const hasTabs = !!tabs && tabs.length > 1;
1850
1909
  const choose = (id) => {
1851
1910
  if (id === tab) return;
@@ -1921,8 +1980,8 @@ function StudioInspectorSection({
1921
1980
  children,
1922
1981
  className
1923
1982
  }) {
1924
- const uid = React20.useId();
1925
- const [open, setOpen] = React20.useState(defaultOpen);
1983
+ const uid = React21.useId();
1984
+ const [open, setOpen] = React21.useState(defaultOpen);
1926
1985
  const expanded = !collapsible || open;
1927
1986
  return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
1928
1987
  "section",
@@ -2056,7 +2115,7 @@ function SaveStatus({ state, detail, onRetry, label, className }) {
2056
2115
  }
2057
2116
 
2058
2117
  // src/components/studio/IssuesButton.tsx
2059
- var React21 = __toESM(require("react"));
2118
+ var React22 = __toESM(require("react"));
2060
2119
  var PopoverPrimitive2 = __toESM(require("@radix-ui/react-popover"));
2061
2120
  var import_jsx_runtime23 = require("react/jsx-runtime");
2062
2121
  var plural = (n, one, many) => `${n} ${n === 1 ? one : many}`;
@@ -2069,7 +2128,7 @@ function IssuesButton({
2069
2128
  showWhenEmpty = false,
2070
2129
  className
2071
2130
  }) {
2072
- const [innerOpen, setInnerOpen] = React21.useState(false);
2131
+ const [innerOpen, setInnerOpen] = React22.useState(false);
2073
2132
  const open = openProp ?? innerOpen;
2074
2133
  const setOpen = (next) => {
2075
2134
  if (openProp === void 0) setInnerOpen(next);
@@ -2167,7 +2226,7 @@ function IssuesButton({
2167
2226
  }
2168
2227
 
2169
2228
  // src/components/studio/InsertPalette.tsx
2170
- var React22 = __toESM(require("react"));
2229
+ var React23 = __toESM(require("react"));
2171
2230
  var import_jsx_runtime24 = require("react/jsx-runtime");
2172
2231
  function InsertPalette({
2173
2232
  open,
@@ -2179,11 +2238,11 @@ function InsertPalette({
2179
2238
  searchPlaceholder = "Search",
2180
2239
  renderThumbnail
2181
2240
  }) {
2182
- const [query, setQuery] = React22.useState("");
2183
- const picked = React22.useRef(false);
2184
- const listRef = React22.useRef(null);
2185
- const searchRef = React22.useRef(null);
2186
- React22.useEffect(() => {
2241
+ const [query, setQuery] = React23.useState("");
2242
+ const picked = React23.useRef(false);
2243
+ const listRef = React23.useRef(null);
2244
+ const searchRef = React23.useRef(null);
2245
+ React23.useEffect(() => {
2187
2246
  if (!open) return;
2188
2247
  setQuery("");
2189
2248
  picked.current = false;
@@ -2315,7 +2374,7 @@ function InsertPalette({
2315
2374
  }
2316
2375
 
2317
2376
  // src/components/DataPanel.tsx
2318
- var React24 = __toESM(require("react"));
2377
+ var React25 = __toESM(require("react"));
2319
2378
  var DropdownMenuPrimitive2 = __toESM(require("@radix-ui/react-dropdown-menu"));
2320
2379
 
2321
2380
  // src/hooks/useFocusTrap.ts
@@ -2372,6 +2431,7 @@ function useFocusTrap(options = {}) {
2372
2431
  if (!container) return;
2373
2432
  previousActiveElementRef.current = document.activeElement;
2374
2433
  const focusableElements = getFocusableElements(container);
2434
+ let focusFrame = 0;
2375
2435
  if (focusableElements.length > 0) {
2376
2436
  let elementToFocus = null;
2377
2437
  if (initialFocus) {
@@ -2380,12 +2440,13 @@ function useFocusTrap(options = {}) {
2380
2440
  if (!elementToFocus) {
2381
2441
  elementToFocus = focusableElements[0];
2382
2442
  }
2383
- requestAnimationFrame(() => {
2443
+ focusFrame = requestAnimationFrame(() => {
2384
2444
  elementToFocus?.focus({ preventScroll });
2385
2445
  });
2386
2446
  }
2387
2447
  document.addEventListener("keydown", handleKeyDown);
2388
2448
  return () => {
2449
+ cancelAnimationFrame(focusFrame);
2389
2450
  document.removeEventListener("keydown", handleKeyDown);
2390
2451
  const elementToReturn = returnFocusTo ?? previousActiveElementRef.current;
2391
2452
  if (elementToReturn && typeof elementToReturn.focus === "function") {
@@ -2397,14 +2458,14 @@ function useFocusTrap(options = {}) {
2397
2458
  }
2398
2459
 
2399
2460
  // src/hooks/useEscapeKey.ts
2400
- var React23 = __toESM(require("react"));
2461
+ var React24 = __toESM(require("react"));
2401
2462
  function useEscapeKey(callback, options) {
2402
2463
  const { enabled = true, preventDefault = true, stopPropagation = false } = options ?? {};
2403
- const callbackRef = React23.useRef(callback);
2404
- React23.useEffect(() => {
2464
+ const callbackRef = React24.useRef(callback);
2465
+ React24.useEffect(() => {
2405
2466
  callbackRef.current = callback;
2406
2467
  }, [callback]);
2407
- React23.useEffect(() => {
2468
+ React24.useEffect(() => {
2408
2469
  if (!enabled) return;
2409
2470
  const handleKeyDown = (event) => {
2410
2471
  if (event.key === "Escape") {
@@ -2430,64 +2491,72 @@ var import_jsx_runtime25 = require("react/jsx-runtime");
2430
2491
  function layoutViewportWidth() {
2431
2492
  return document.documentElement.clientWidth;
2432
2493
  }
2494
+ var SSR_VIEWPORT_WIDTH = 1024;
2495
+ var SSR_VIEWPORT_HEIGHT = 768;
2496
+ var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React25.useLayoutEffect : React25.useEffect;
2433
2497
  function isSecondaryMouseButton(e) {
2434
2498
  return e.pointerType === "mouse" && e.button !== 0;
2435
2499
  }
2436
2500
  var DropdownTrigger = DropdownMenuPrimitive2.Trigger;
2437
2501
  var DropdownContent = DropdownMenuPrimitive2.Content;
2438
2502
  var DropdownLabel = DropdownMenuPrimitive2.Label;
2439
- var DropdownItem = DropdownMenuPrimitive2.Item;
2503
+ var DropdownRadioGroup = DropdownMenuPrimitive2.RadioGroup;
2504
+ var DropdownRadioItem = DropdownMenuPrimitive2.RadioItem;
2505
+ var DropdownItemIndicator = DropdownMenuPrimitive2.ItemIndicator;
2506
+ var menuRadioItemClass = "relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none bg-popover focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50";
2440
2507
  var DropdownSeparator = DropdownMenuPrimitive2.Separator;
2508
+ var EMPTY_CONSTRAINTS = {};
2509
+ var EMPTY_CARD_CONFIG = {};
2510
+ var EMPTY_ACTIONS = [];
2441
2511
  function useDataPanel(options = {}) {
2442
2512
  const {
2443
2513
  persistKey,
2444
2514
  initialMode = import_data_panel_core.DEFAULT_PANEL_STATE.mode,
2445
2515
  initialEdge = import_data_panel_core.DEFAULT_PANEL_STATE.edge,
2446
2516
  initialExpanded = import_data_panel_core.DEFAULT_PANEL_STATE.isExpanded,
2447
- constraints = {}
2517
+ constraints = EMPTY_CONSTRAINTS
2448
2518
  } = options;
2449
- const resolvedConstraints = { ...import_data_panel_core.DEFAULT_CONSTRAINTS, ...constraints };
2450
- const [persistedState] = React24.useState(() => {
2519
+ const resolvedConstraints = React25.useMemo(
2520
+ () => ({ ...import_data_panel_core.DEFAULT_CONSTRAINTS, ...constraints }),
2521
+ [constraints]
2522
+ );
2523
+ const [persistedState] = React25.useState(() => {
2451
2524
  if (persistKey && typeof window !== "undefined") {
2452
2525
  return (0, import_data_panel_core.loadPanelState)(persistKey);
2453
2526
  }
2454
2527
  return null;
2455
2528
  });
2456
- const [mode, setMode] = React24.useState(persistedState?.mode ?? initialMode);
2457
- const [edge, setEdge] = React24.useState(persistedState?.edge ?? initialEdge);
2458
- const [isExpanded, setIsExpanded] = React24.useState(
2529
+ const [mode, setMode] = React25.useState(persistedState?.mode ?? initialMode);
2530
+ const [edge, setEdge] = React25.useState(persistedState?.edge ?? initialEdge);
2531
+ const [isExpanded, setIsExpanded] = React25.useState(
2459
2532
  persistedState?.isExpanded ?? initialExpanded
2460
2533
  );
2461
- const [detachedPosition, setDetachedPosition] = React24.useState(
2534
+ const [detachedPosition, setDetachedPosition] = React25.useState(
2462
2535
  persistedState?.detachedPosition ?? import_data_panel_core.DEFAULT_PANEL_STATE.detachedPosition
2463
2536
  );
2464
- const [detachedSize, setDetachedSize] = React24.useState(
2537
+ const [detachedSize, setDetachedSize] = React25.useState(
2465
2538
  persistedState?.detachedSize ?? import_data_panel_core.DEFAULT_PANEL_STATE.detachedSize
2466
2539
  );
2467
- const [pinnedSize, setPinnedSize] = React24.useState(
2540
+ const [pinnedSize, setPinnedSize] = React25.useState(
2468
2541
  persistedState?.pinnedSize ?? import_data_panel_core.DEFAULT_PANEL_STATE.pinnedSize
2469
2542
  );
2470
- const saveTimeoutRef = React24.useRef(null);
2471
- const debouncedSave = React24.useCallback(() => {
2543
+ const saveTimeoutRef = React25.useRef(null);
2544
+ const debouncedSave = React25.useCallback(() => {
2472
2545
  if (!persistKey) return;
2473
2546
  if (saveTimeoutRef.current) {
2474
2547
  clearTimeout(saveTimeoutRef.current);
2475
2548
  }
2476
2549
  saveTimeoutRef.current = setTimeout(() => {
2477
2550
  (0, import_data_panel_core.savePanelState)(persistKey, {
2551
+ ...import_data_panel_core.DEFAULT_PANEL_STATE,
2552
+ ...(0, import_data_panel_core.loadPanelState)(persistKey),
2478
2553
  mode,
2479
- variant: "full",
2480
2554
  edge,
2481
- isExpanded,
2482
- detachedPosition,
2483
- detachedSize,
2484
- pinnedSize,
2485
- cardSnapIndex: 0,
2486
- tabOffset: 0
2555
+ isExpanded
2487
2556
  });
2488
2557
  }, 300);
2489
- }, [persistKey, mode, edge, isExpanded, detachedPosition, detachedSize, pinnedSize]);
2490
- const handleSetMode = React24.useCallback(
2558
+ }, [persistKey, mode, edge, isExpanded]);
2559
+ const handleSetMode = React25.useCallback(
2491
2560
  (newMode) => {
2492
2561
  setMode(newMode);
2493
2562
  if (newMode === "detached" && typeof window !== "undefined" && detachedPosition.x === import_data_panel_core.DEFAULT_PANEL_STATE.detachedPosition.x && detachedPosition.y === import_data_panel_core.DEFAULT_PANEL_STATE.detachedPosition.y) {
@@ -2498,7 +2567,7 @@ function useDataPanel(options = {}) {
2498
2567
  },
2499
2568
  [detachedPosition, detachedSize]
2500
2569
  );
2501
- const handleSetDetachedPosition = React24.useCallback(
2570
+ const handleSetDetachedPosition = React25.useCallback(
2502
2571
  (position) => {
2503
2572
  if (typeof window === "undefined") {
2504
2573
  setDetachedPosition(position);
@@ -2510,13 +2579,13 @@ function useDataPanel(options = {}) {
2510
2579
  },
2511
2580
  [detachedSize]
2512
2581
  );
2513
- const handleSetDetachedSize = React24.useCallback(
2582
+ const handleSetDetachedSize = React25.useCallback(
2514
2583
  (size) => {
2515
2584
  setDetachedSize((0, import_data_panel_core.constrainSize)(size, resolvedConstraints));
2516
2585
  },
2517
2586
  [resolvedConstraints]
2518
2587
  );
2519
- const handleSetPinnedSize = React24.useCallback(
2588
+ const handleSetPinnedSize = React25.useCallback(
2520
2589
  (size) => {
2521
2590
  if (typeof window === "undefined") {
2522
2591
  setPinnedSize(size);
@@ -2530,7 +2599,7 @@ function useDataPanel(options = {}) {
2530
2599
  },
2531
2600
  [edge, resolvedConstraints]
2532
2601
  );
2533
- React24.useEffect(() => {
2602
+ React25.useEffect(() => {
2534
2603
  debouncedSave();
2535
2604
  }, [debouncedSave]);
2536
2605
  return {
@@ -2624,7 +2693,7 @@ var edgeLabels = {
2624
2693
  top: "Pin to top",
2625
2694
  bottom: "Pin to bottom"
2626
2695
  };
2627
- var DataPanelHeader = React24.forwardRef(
2696
+ var DataPanelHeader = React25.forwardRef(
2628
2697
  ({
2629
2698
  title,
2630
2699
  subtitle,
@@ -2707,30 +2776,28 @@ var DataPanelHeader = React24.forwardRef(
2707
2776
  align: "end",
2708
2777
  children: [
2709
2778
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DropdownLabel, { className: "px-2 py-1.5 text-sm font-semibold", children: "Panel Position" }),
2710
- ["left", "right", "top", "bottom"].map((e) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
2711
- DropdownItem,
2779
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
2780
+ DropdownRadioGroup,
2712
2781
  {
2713
- className: "relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none bg-popover focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
2714
- onSelect: () => {
2782
+ value: mode === "detached" ? "detached" : edge,
2783
+ onValueChange: (value) => {
2784
+ if (value === "detached") {
2785
+ onModeChange?.("detached");
2786
+ return;
2787
+ }
2715
2788
  onModeChange?.("pinned");
2716
- onEdgeChange?.(e);
2789
+ onEdgeChange?.(value);
2717
2790
  },
2718
2791
  children: [
2719
- edgeLabels[e],
2720
- mode === "pinned" && edge === e && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "ml-auto text-xs", children: "\u2713" })
2721
- ]
2722
- },
2723
- e
2724
- )),
2725
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DropdownSeparator, { className: "-mx-1 my-1 h-px bg-muted" }),
2726
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
2727
- DropdownItem,
2728
- {
2729
- className: "relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none bg-popover focus:bg-accent focus:text-accent-foreground",
2730
- onSelect: () => onModeChange?.("detached"),
2731
- children: [
2732
- "Detach",
2733
- mode === "detached" && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "ml-auto text-xs", children: "\u2713" })
2792
+ ["left", "right", "top", "bottom"].map((e) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(DropdownRadioItem, { value: e, className: menuRadioItemClass, children: [
2793
+ edgeLabels[e],
2794
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DropdownItemIndicator, { className: "ml-auto text-xs", children: "\u2713" })
2795
+ ] }, e)),
2796
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DropdownSeparator, { className: "-mx-1 my-1 h-px bg-muted" }),
2797
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(DropdownRadioItem, { value: "detached", className: menuRadioItemClass, children: [
2798
+ "Detach",
2799
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DropdownItemIndicator, { className: "ml-auto text-xs", children: "\u2713" })
2800
+ ] })
2734
2801
  ]
2735
2802
  }
2736
2803
  )
@@ -2848,7 +2915,7 @@ function DataPanelCardHeader({
2848
2915
  }
2849
2916
  );
2850
2917
  }
2851
- var DataPanelContent = React24.forwardRef(
2918
+ var DataPanelContent = React25.forwardRef(
2852
2919
  ({ children, className, "aria-label": ariaLabel = "Panel content" }, ref) => {
2853
2920
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2854
2921
  "div",
@@ -2863,7 +2930,7 @@ var DataPanelContent = React24.forwardRef(
2863
2930
  }
2864
2931
  );
2865
2932
  DataPanelContent.displayName = "DataPanelContent";
2866
- var DataPanelFooter = React24.forwardRef(
2933
+ var DataPanelFooter = React25.forwardRef(
2867
2934
  ({ actions = [], footerContent, footerActions, className }, ref) => {
2868
2935
  if (!footerContent && actions.length === 0 && !footerActions) {
2869
2936
  return null;
@@ -2899,7 +2966,7 @@ var DataPanelFooter = React24.forwardRef(
2899
2966
  }
2900
2967
  );
2901
2968
  DataPanelFooter.displayName = "DataPanelFooter";
2902
- var DataPanelTab = React24.forwardRef(
2969
+ var DataPanelTab = React25.forwardRef(
2903
2970
  ({
2904
2971
  title = "Panel",
2905
2972
  subtitle,
@@ -2925,17 +2992,18 @@ var DataPanelTab = React24.forwardRef(
2925
2992
  bottom: "left-1/2 rounded-t-lg border-b-0"
2926
2993
  }[edge];
2927
2994
  const insetStyle = { [edge]: tabInset };
2928
- const innerRef = React24.useRef(null);
2929
- const dragRef = React24.useRef({
2995
+ const innerRef = React25.useRef(null);
2996
+ const dragRef = React25.useRef({
2930
2997
  startX: 0,
2931
2998
  startY: 0,
2932
2999
  startOffset: 0,
2933
3000
  moved: false,
2934
3001
  pointerId: -1
2935
3002
  });
2936
- const [dragOffset, setDragOffset] = React24.useState(null);
3003
+ const [dragOffset, setDragOffset] = React25.useState(null);
2937
3004
  const effectiveOffset = dragOffset ?? offset;
2938
3005
  const draggable = !!onOffsetChange;
3006
+ const pointerHandledRef = React25.useRef(false);
2939
3007
  const tabTransform = (0, import_data_panel_core.getTabTransform)(edge, tabWidth, effectiveOffset);
2940
3008
  const tabBounds = (0, import_data_panel_core.getTabBounds)(edge, tabWidth);
2941
3009
  const setRefs = (node) => {
@@ -2979,6 +3047,10 @@ var DataPanelTab = React24.forwardRef(
2979
3047
  e.currentTarget.releasePointerCapture(e.pointerId);
2980
3048
  }
2981
3049
  d.pointerId = -1;
3050
+ pointerHandledRef.current = true;
3051
+ setTimeout(() => {
3052
+ pointerHandledRef.current = false;
3053
+ }, 0);
2982
3054
  if (d.moved) {
2983
3055
  onOffsetChange?.(dragOffset ?? offset);
2984
3056
  } else {
@@ -3002,7 +3074,7 @@ var DataPanelTab = React24.forwardRef(
3002
3074
  onClick?.();
3003
3075
  }
3004
3076
  };
3005
- React24.useEffect(() => {
3077
+ React25.useEffect(() => {
3006
3078
  if (!onOffsetChange || dragOffset !== null) return;
3007
3079
  const reclamp = () => {
3008
3080
  const clamped = (0, import_data_panel_core.constrainTabOffset)(
@@ -3050,7 +3122,13 @@ var DataPanelTab = React24.forwardRef(
3050
3122
  type: "button",
3051
3123
  "aria-label": `Expand ${title} panel`,
3052
3124
  className: "flex min-w-0 flex-1 flex-col text-left leading-tight hover:opacity-80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
3053
- onClick: draggable ? void 0 : onClick,
3125
+ onClick: () => {
3126
+ if (pointerHandledRef.current) {
3127
+ pointerHandledRef.current = false;
3128
+ return;
3129
+ }
3130
+ onClick?.();
3131
+ },
3054
3132
  onKeyDown: handleExpandKeyDown,
3055
3133
  children: [
3056
3134
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "truncate text-sm font-semibold", children: title }),
@@ -3091,7 +3169,7 @@ function ResizeHandles({
3091
3169
  onPinnedSizeChange,
3092
3170
  constraints
3093
3171
  }) {
3094
- const handleDetachedKeyDown = React24.useCallback(
3172
+ const handleDetachedKeyDown = React25.useCallback(
3095
3173
  (e, handle) => {
3096
3174
  const step = e.shiftKey ? KEYBOARD_RESIZE_STEP_LARGE : KEYBOARD_RESIZE_STEP;
3097
3175
  let width = detachedSize.width;
@@ -3154,7 +3232,7 @@ function ResizeHandles({
3154
3232
  },
3155
3233
  [detachedPosition, detachedSize, constraints, onDetachedResize]
3156
3234
  );
3157
- const handlePinnedKeyDown = React24.useCallback(
3235
+ const handlePinnedKeyDown = React25.useCallback(
3158
3236
  (e) => {
3159
3237
  const step = e.shiftKey ? KEYBOARD_RESIZE_STEP_LARGE : KEYBOARD_RESIZE_STEP;
3160
3238
  let newSize = pinnedSize;
@@ -3271,14 +3349,14 @@ function ResizeHandles({
3271
3349
  }
3272
3350
  );
3273
3351
  }
3274
- var DataPanel = React24.forwardRef(
3352
+ var DataPanel = React25.forwardRef(
3275
3353
  ({
3276
3354
  open: controlledOpen,
3277
3355
  onOpenChange,
3278
3356
  mode: controlledMode,
3279
3357
  onModeChange,
3280
3358
  variant: controlledVariant,
3281
- cardConfig = {},
3359
+ cardConfig = EMPTY_CARD_CONFIG,
3282
3360
  edge: controlledEdge,
3283
3361
  onEdgeChange,
3284
3362
  expanded: controlledExpanded,
@@ -3286,8 +3364,8 @@ var DataPanel = React24.forwardRef(
3286
3364
  title,
3287
3365
  subtitle,
3288
3366
  children,
3289
- actions = [],
3290
- constraints = {},
3367
+ actions = EMPTY_ACTIONS,
3368
+ constraints = EMPTY_CONSTRAINTS,
3291
3369
  tabWidth = import_data_panel_core.DEFAULT_TAB_WIDTH,
3292
3370
  tabInset = 0,
3293
3371
  disableClose = false,
@@ -3303,39 +3381,35 @@ var DataPanel = React24.forwardRef(
3303
3381
  footerActions,
3304
3382
  className
3305
3383
  }, ref) => {
3306
- const resolvedConstraints = React24.useMemo(
3384
+ const resolvedConstraints = React25.useMemo(
3307
3385
  () => ({ ...import_data_panel_core.DEFAULT_CONSTRAINTS, ...constraints }),
3308
3386
  [constraints]
3309
3387
  );
3310
- const resolvedCardConfig = React24.useMemo(
3388
+ const resolvedCardConfig = React25.useMemo(
3311
3389
  () => ({ ...import_data_panel_core.DEFAULT_CARD_CONFIG, ...cardConfig }),
3312
3390
  [cardConfig]
3313
3391
  );
3314
- const panelId = React24.useId();
3392
+ const panelId = React25.useId();
3315
3393
  const titleId = `${panelId}-title`;
3316
- const [internalOpen, setInternalOpen] = React24.useState(true);
3317
- const [internalMode, setInternalMode] = React24.useState(import_data_panel_core.DEFAULT_PANEL_STATE.mode);
3318
- const [internalVariant, setInternalVariant] = React24.useState(
3394
+ const [internalOpen, setInternalOpen] = React25.useState(true);
3395
+ const [internalMode, setInternalMode] = React25.useState(import_data_panel_core.DEFAULT_PANEL_STATE.mode);
3396
+ const [internalVariant, setInternalVariant] = React25.useState(
3319
3397
  import_data_panel_core.DEFAULT_PANEL_STATE.variant
3320
3398
  );
3321
- const [internalEdge, setInternalEdge] = React24.useState(import_data_panel_core.DEFAULT_PANEL_STATE.edge);
3322
- const [internalExpanded, setInternalExpanded] = React24.useState(
3399
+ const [internalEdge, setInternalEdge] = React25.useState(import_data_panel_core.DEFAULT_PANEL_STATE.edge);
3400
+ const [internalExpanded, setInternalExpanded] = React25.useState(
3323
3401
  import_data_panel_core.DEFAULT_PANEL_STATE.isExpanded
3324
3402
  );
3325
- const [detachedPosition, setDetachedPosition] = React24.useState(
3403
+ const [detachedPosition, setDetachedPosition] = React25.useState(
3326
3404
  import_data_panel_core.DEFAULT_PANEL_STATE.detachedPosition
3327
3405
  );
3328
- const [detachedSize, setDetachedSize] = React24.useState(import_data_panel_core.DEFAULT_PANEL_STATE.detachedSize);
3329
- const [pinnedSize, setPinnedSize] = React24.useState(import_data_panel_core.DEFAULT_PANEL_STATE.pinnedSize);
3330
- const [tabOffset, setTabOffset] = React24.useState(import_data_panel_core.DEFAULT_PANEL_STATE.tabOffset);
3331
- const [viewportWidth, setViewportWidth] = React24.useState(
3332
- typeof window !== "undefined" ? layoutViewportWidth() : 1024
3333
- );
3334
- const [viewportHeight, setViewportHeight] = React24.useState(
3335
- typeof window !== "undefined" ? window.innerHeight : 768
3336
- );
3406
+ const [detachedSize, setDetachedSize] = React25.useState(import_data_panel_core.DEFAULT_PANEL_STATE.detachedSize);
3407
+ const [pinnedSize, setPinnedSize] = React25.useState(import_data_panel_core.DEFAULT_PANEL_STATE.pinnedSize);
3408
+ const [tabOffset, setTabOffset] = React25.useState(import_data_panel_core.DEFAULT_PANEL_STATE.tabOffset);
3409
+ const [viewportWidth, setViewportWidth] = React25.useState(SSR_VIEWPORT_WIDTH);
3410
+ const [viewportHeight, setViewportHeight] = React25.useState(SSR_VIEWPORT_HEIGHT);
3337
3411
  const isMobile = viewportWidth < 640;
3338
- const cardDefaultLeftOffset = React24.useCallback(
3412
+ const cardDefaultLeftOffset = React25.useCallback(
3339
3413
  (width) => {
3340
3414
  const margin = resolvedCardConfig.horizontalMargin;
3341
3415
  if (resolvedCardConfig.align === "left") return margin;
@@ -3346,45 +3420,45 @@ var DataPanel = React24.forwardRef(
3346
3420
  },
3347
3421
  [viewportWidth, resolvedCardConfig.align, resolvedCardConfig.horizontalMargin]
3348
3422
  );
3349
- const [cardHorizontalPosition, setCardHorizontalPosition] = React24.useState(0);
3350
- const [cardExpandedHeight, setCardExpandedHeight] = React24.useState(0);
3351
- const [cardWidth, setCardWidth] = React24.useState(null);
3352
- const [cardDragCurrentHeight, setCardDragCurrentHeight] = React24.useState(import_data_panel_core.CARD_HEADER_HEIGHT);
3353
- const [isCardVerticalDragging, setIsCardVerticalDragging] = React24.useState(false);
3354
- const [isCardHorizontalDragging, setIsCardHorizontalDragging] = React24.useState(false);
3355
- const [isCardHeightTransitioning, setIsCardHeightTransitioning] = React24.useState(false);
3356
- const [isCardWidthResizing, setIsCardWidthResizing] = React24.useState(false);
3357
- const [isCardTopResizing, setIsCardTopResizing] = React24.useState(false);
3358
- const [isDragging, setIsDragging] = React24.useState(false);
3359
- const [isResizing, setIsResizing] = React24.useState(false);
3360
- const [snapPreview, setSnapPreview] = React24.useState(null);
3361
- const [isPinnedDragging, setIsPinnedDragging] = React24.useState(false);
3362
- const [pullOffset, setPullOffset] = React24.useState(0);
3363
- const dragStateRef = React24.useRef({
3423
+ const [cardHorizontalPosition, setCardHorizontalPosition] = React25.useState(0);
3424
+ const [cardExpandedHeight, setCardExpandedHeight] = React25.useState(0);
3425
+ const [cardWidth, setCardWidth] = React25.useState(null);
3426
+ const [cardDragCurrentHeight, setCardDragCurrentHeight] = React25.useState(import_data_panel_core.CARD_HEADER_HEIGHT);
3427
+ const [isCardVerticalDragging, setIsCardVerticalDragging] = React25.useState(false);
3428
+ const [isCardHorizontalDragging, setIsCardHorizontalDragging] = React25.useState(false);
3429
+ const [isCardHeightTransitioning, setIsCardHeightTransitioning] = React25.useState(false);
3430
+ const [isCardWidthResizing, setIsCardWidthResizing] = React25.useState(false);
3431
+ const [isCardTopResizing, setIsCardTopResizing] = React25.useState(false);
3432
+ const [isDragging, setIsDragging] = React25.useState(false);
3433
+ const [isResizing, setIsResizing] = React25.useState(false);
3434
+ const [snapPreview, setSnapPreview] = React25.useState(null);
3435
+ const [isPinnedDragging, setIsPinnedDragging] = React25.useState(false);
3436
+ const [pullOffset, setPullOffset] = React25.useState(0);
3437
+ const dragStateRef = React25.useRef({
3364
3438
  startPosition: { x: 0, y: 0 },
3365
3439
  startPanelPosition: { x: 0, y: 0 }
3366
3440
  });
3367
- const pinnedDragStateRef = React24.useRef({
3441
+ const pinnedDragStateRef = React25.useRef({
3368
3442
  startPosition: { x: 0, y: 0 },
3369
3443
  hasDetached: false
3370
3444
  });
3371
- const resizeStateRef = React24.useRef({
3445
+ const resizeStateRef = React25.useRef({
3372
3446
  handle: null,
3373
3447
  startPosition: { x: 0, y: 0 },
3374
3448
  startSize: { width: 0, height: 0 },
3375
3449
  startPanelPosition: { x: 0, y: 0 }
3376
3450
  });
3377
- const cardDragStateRef = React24.useRef({
3451
+ const cardDragStateRef = React25.useRef({
3378
3452
  startY: 0,
3379
3453
  startX: 0,
3380
3454
  startTime: 0,
3381
3455
  startExpanded: false,
3382
3456
  startHorizontalPosition: 0
3383
3457
  });
3384
- const cardCurrentHeightRef = React24.useRef(import_data_panel_core.CARD_HEADER_HEIGHT);
3385
- const cardTopResizeStartRef = React24.useRef({ startY: 0, startHeight: 0 });
3386
- const cardHeightUserSetRef = React24.useRef(false);
3387
- const cardWidthResizeStateRef = React24.useRef({
3458
+ const cardCurrentHeightRef = React25.useRef(import_data_panel_core.CARD_HEADER_HEIGHT);
3459
+ const cardTopResizeStartRef = React25.useRef({ startY: 0, startHeight: 0 });
3460
+ const cardHeightUserSetRef = React25.useRef(false);
3461
+ const cardWidthResizeStateRef = React25.useRef({
3388
3462
  handle: null,
3389
3463
  startX: 0,
3390
3464
  startWidth: 0,
@@ -3396,9 +3470,12 @@ var DataPanel = React24.forwardRef(
3396
3470
  const edge = controlledEdge ?? internalEdge;
3397
3471
  const isExpanded = controlledExpanded ?? internalExpanded;
3398
3472
  const showContent = variant !== "card" || isExpanded || isCardVerticalDragging;
3399
- const saveTimeoutRef = React24.useRef(null);
3400
- const isMountedRef = React24.useRef(true);
3401
- React24.useEffect(() => {
3473
+ const resizeRight = !disableResize && (variant === "full" && (mode === "detached" || edge === "left") || variant === "card" && isExpanded && !isMobile);
3474
+ const resizeBottom = !disableResize && variant === "full" && (mode === "detached" || edge === "top");
3475
+ const hasFooter = !!(footerContent || actions.length > 0 || footerActions);
3476
+ const saveTimeoutRef = React25.useRef(null);
3477
+ const isMountedRef = React25.useRef(true);
3478
+ React25.useEffect(() => {
3402
3479
  isMountedRef.current = true;
3403
3480
  return () => {
3404
3481
  isMountedRef.current = false;
@@ -3409,7 +3486,7 @@ var DataPanel = React24.forwardRef(
3409
3486
  }
3410
3487
  };
3411
3488
  }, []);
3412
- const debouncedSave = React24.useCallback(() => {
3489
+ const debouncedSave = React25.useCallback(() => {
3413
3490
  if (!persistKey) return;
3414
3491
  if (saveTimeoutRef.current) {
3415
3492
  clearTimeout(saveTimeoutRef.current);
@@ -3438,12 +3515,12 @@ var DataPanel = React24.forwardRef(
3438
3515
  pinnedSize,
3439
3516
  tabOffset
3440
3517
  ]);
3441
- React24.useEffect(() => {
3518
+ React25.useEffect(() => {
3442
3519
  debouncedSave();
3443
3520
  }, [debouncedSave]);
3444
- const hasLoadedRef = React24.useRef(false);
3445
- const hasPersistedPositionRef = React24.useRef(false);
3446
- React24.useEffect(() => {
3521
+ const hasLoadedRef = React25.useRef(false);
3522
+ const hasPersistedPositionRef = React25.useRef(false);
3523
+ React25.useEffect(() => {
3447
3524
  if (!persistKey || hasLoadedRef.current) return;
3448
3525
  hasLoadedRef.current = true;
3449
3526
  const persisted = (0, import_data_panel_core.loadPanelState)(persistKey);
@@ -3472,7 +3549,7 @@ var DataPanel = React24.forwardRef(
3472
3549
  if (persisted.tabOffset !== void 0) setTabOffset(persisted.tabOffset);
3473
3550
  }
3474
3551
  }, [persistKey, controlledMode, controlledVariant, controlledEdge, controlledExpanded]);
3475
- React24.useEffect(() => {
3552
+ React25.useEffect(() => {
3476
3553
  if (mode === "detached" && !hasPersistedPositionRef.current && detachedPosition.x === import_data_panel_core.DEFAULT_PANEL_STATE.detachedPosition.x && detachedPosition.y === import_data_panel_core.DEFAULT_PANEL_STATE.detachedPosition.y) {
3477
3554
  setDetachedPosition(
3478
3555
  (0, import_data_panel_core.getInitialDetachedPosition)(detachedSize, layoutViewportWidth(), window.innerHeight)
@@ -3495,8 +3572,8 @@ var DataPanel = React24.forwardRef(
3495
3572
  },
3496
3573
  { enabled: isDialog, preventDefault: false }
3497
3574
  );
3498
- const panelElRef = React24.useRef(null);
3499
- const tabRef = React24.useRef(null);
3575
+ const panelElRef = React25.useRef(null);
3576
+ const tabRef = React25.useRef(null);
3500
3577
  const setPanelRef = (node) => {
3501
3578
  panelElRef.current = node;
3502
3579
  focusTrapRef.current = node;
@@ -3506,7 +3583,7 @@ var DataPanel = React24.forwardRef(
3506
3583
  ref.current = node;
3507
3584
  }
3508
3585
  };
3509
- const handleModeChange = React24.useCallback(
3586
+ const handleModeChange = React25.useCallback(
3510
3587
  (newMode) => {
3511
3588
  if (controlledMode === void 0) {
3512
3589
  setInternalMode(newMode);
@@ -3515,7 +3592,7 @@ var DataPanel = React24.forwardRef(
3515
3592
  },
3516
3593
  [controlledMode, onModeChange]
3517
3594
  );
3518
- const handleEdgeChange = React24.useCallback(
3595
+ const handleEdgeChange = React25.useCallback(
3519
3596
  (newEdge) => {
3520
3597
  if (controlledEdge === void 0) {
3521
3598
  setInternalEdge(newEdge);
@@ -3524,8 +3601,8 @@ var DataPanel = React24.forwardRef(
3524
3601
  },
3525
3602
  [controlledEdge, onEdgeChange]
3526
3603
  );
3527
- const restoreFocusRef = React24.useRef(false);
3528
- const handleExpandedChange = React24.useCallback(
3604
+ const restoreFocusRef = React25.useRef(false);
3605
+ const handleExpandedChange = React25.useCallback(
3529
3606
  (newExpanded) => {
3530
3607
  const active = typeof document !== "undefined" ? document.activeElement : null;
3531
3608
  restoreFocusRef.current = newExpanded !== isExpanded && !!active && active !== document.body;
@@ -3536,7 +3613,7 @@ var DataPanel = React24.forwardRef(
3536
3613
  },
3537
3614
  [controlledExpanded, onExpandedChange, isExpanded]
3538
3615
  );
3539
- React24.useEffect(() => {
3616
+ React25.useEffect(() => {
3540
3617
  if (!restoreFocusRef.current) return;
3541
3618
  restoreFocusRef.current = false;
3542
3619
  const active = document.activeElement;
@@ -3569,7 +3646,7 @@ var DataPanel = React24.forwardRef(
3569
3646
  document.body.style.userSelect = "none";
3570
3647
  }
3571
3648
  };
3572
- const handleDragMove = React24.useCallback(
3649
+ const handleDragMove = React25.useCallback(
3573
3650
  (e) => {
3574
3651
  if (!isDragging) return;
3575
3652
  const currentPos = (0, import_data_panel_core.getPointerPosition)(e);
@@ -3596,7 +3673,7 @@ var DataPanel = React24.forwardRef(
3596
3673
  },
3597
3674
  [isDragging, detachedSize, snapThreshold]
3598
3675
  );
3599
- const handleDragEnd = React24.useCallback(() => {
3676
+ const handleDragEnd = React25.useCallback(() => {
3600
3677
  if (!isDragging) return;
3601
3678
  setIsDragging(false);
3602
3679
  document.body.style.cursor = "";
@@ -3607,7 +3684,7 @@ var DataPanel = React24.forwardRef(
3607
3684
  setSnapPreview(null);
3608
3685
  }
3609
3686
  }, [isDragging, snapPreview, handleModeChange, handleEdgeChange]);
3610
- const handlePinnedDragMove = React24.useCallback(
3687
+ const handlePinnedDragMove = React25.useCallback(
3611
3688
  (e) => {
3612
3689
  if (!isPinnedDragging) return;
3613
3690
  const currentPos = (0, import_data_panel_core.getPointerPosition)(e);
@@ -3643,7 +3720,7 @@ var DataPanel = React24.forwardRef(
3643
3720
  },
3644
3721
  [isPinnedDragging, edge, detachThreshold, pinnedSize, detachedSize, handleModeChange]
3645
3722
  );
3646
- const handlePinnedDragEnd = React24.useCallback(() => {
3723
+ const handlePinnedDragEnd = React25.useCallback(() => {
3647
3724
  if (!isPinnedDragging) return;
3648
3725
  setIsPinnedDragging(false);
3649
3726
  setPullOffset(0);
@@ -3665,7 +3742,7 @@ var DataPanel = React24.forwardRef(
3665
3742
  document.body.style.cursor = (0, import_data_panel_core.getResizeCursor)(handle);
3666
3743
  document.body.style.userSelect = "none";
3667
3744
  };
3668
- const handleResizeMove = React24.useCallback(
3745
+ const handleResizeMove = React25.useCallback(
3669
3746
  (e) => {
3670
3747
  if (!isResizing || !resizeStateRef.current.handle) return;
3671
3748
  const currentPos = (0, import_data_panel_core.getPointerPosition)(e);
@@ -3706,7 +3783,7 @@ var DataPanel = React24.forwardRef(
3706
3783
  },
3707
3784
  [isResizing, mode, edge, resolvedConstraints]
3708
3785
  );
3709
- const handleResizeEnd = React24.useCallback(() => {
3786
+ const handleResizeEnd = React25.useCallback(() => {
3710
3787
  if (!isResizing) return;
3711
3788
  setIsResizing(false);
3712
3789
  resizeStateRef.current.handle = null;
@@ -3738,7 +3815,7 @@ var DataPanel = React24.forwardRef(
3738
3815
  }
3739
3816
  document.body.style.userSelect = "none";
3740
3817
  };
3741
- const handleCardPointerMove = React24.useCallback(
3818
+ const handleCardPointerMove = React25.useCallback(
3742
3819
  (e) => {
3743
3820
  const currentPos = (0, import_data_panel_core.getPointerPosition)(e);
3744
3821
  if (isCardVerticalDragging) {
@@ -3778,7 +3855,7 @@ var DataPanel = React24.forwardRef(
3778
3855
  resolvedCardConfig.maxWidth
3779
3856
  ]
3780
3857
  );
3781
- const handleCardPointerUp = React24.useCallback(
3858
+ const handleCardPointerUp = React25.useCallback(
3782
3859
  (e) => {
3783
3860
  const endTime = Date.now();
3784
3861
  const currentPos = (0, import_data_panel_core.getPointerPosition)(e);
@@ -3836,7 +3913,7 @@ var DataPanel = React24.forwardRef(
3836
3913
  document.body.style.cursor = "ns-resize";
3837
3914
  document.body.style.userSelect = "none";
3838
3915
  };
3839
- const handleCardResizeMove = React24.useCallback(
3916
+ const handleCardResizeMove = React25.useCallback(
3840
3917
  (e) => {
3841
3918
  if (!isCardTopResizing) return;
3842
3919
  const currentPos = (0, import_data_panel_core.getPointerPosition)(e);
@@ -3850,7 +3927,7 @@ var DataPanel = React24.forwardRef(
3850
3927
  },
3851
3928
  [isCardTopResizing, viewportHeight]
3852
3929
  );
3853
- const handleCardResizeEnd = React24.useCallback(() => {
3930
+ const handleCardResizeEnd = React25.useCallback(() => {
3854
3931
  if (!isCardTopResizing) return;
3855
3932
  setIsCardTopResizing(false);
3856
3933
  document.body.style.cursor = "";
@@ -3879,7 +3956,7 @@ var DataPanel = React24.forwardRef(
3879
3956
  document.body.style.cursor = "ew-resize";
3880
3957
  document.body.style.userSelect = "none";
3881
3958
  };
3882
- const handleCardWidthResizeMove = React24.useCallback(
3959
+ const handleCardWidthResizeMove = React25.useCallback(
3883
3960
  (e) => {
3884
3961
  const st = cardWidthResizeStateRef.current;
3885
3962
  if (!isCardWidthResizing || !st.handle) return;
@@ -3921,7 +3998,7 @@ var DataPanel = React24.forwardRef(
3921
3998
  resolvedCardConfig.maxWidth
3922
3999
  ]
3923
4000
  );
3924
- const handleCardWidthResizeEnd = React24.useCallback(() => {
4001
+ const handleCardWidthResizeEnd = React25.useCallback(() => {
3925
4002
  if (!isCardWidthResizing) return;
3926
4003
  setIsCardWidthResizing(false);
3927
4004
  cardWidthResizeStateRef.current.handle = null;
@@ -3972,7 +4049,7 @@ var DataPanel = React24.forwardRef(
3972
4049
  if (kind === "width-left") setCardHorizontalPosition((p) => p - appliedDelta);
3973
4050
  debouncedSave();
3974
4051
  };
3975
- React24.useEffect(() => {
4052
+ React25.useEffect(() => {
3976
4053
  if (isDragging) {
3977
4054
  window.addEventListener("pointermove", handleDragMove);
3978
4055
  window.addEventListener("pointerup", handleDragEnd);
@@ -3984,7 +4061,7 @@ var DataPanel = React24.forwardRef(
3984
4061
  };
3985
4062
  }
3986
4063
  }, [isDragging, handleDragMove, handleDragEnd]);
3987
- React24.useEffect(() => {
4064
+ React25.useEffect(() => {
3988
4065
  if (isPinnedDragging) {
3989
4066
  window.addEventListener("pointermove", handlePinnedDragMove);
3990
4067
  window.addEventListener("pointerup", handlePinnedDragEnd);
@@ -3996,7 +4073,7 @@ var DataPanel = React24.forwardRef(
3996
4073
  };
3997
4074
  }
3998
4075
  }, [isPinnedDragging, handlePinnedDragMove, handlePinnedDragEnd]);
3999
- React24.useEffect(() => {
4076
+ React25.useEffect(() => {
4000
4077
  if (isResizing) {
4001
4078
  window.addEventListener("pointermove", handleResizeMove);
4002
4079
  window.addEventListener("pointerup", handleResizeEnd);
@@ -4008,7 +4085,7 @@ var DataPanel = React24.forwardRef(
4008
4085
  };
4009
4086
  }
4010
4087
  }, [isResizing, handleResizeMove, handleResizeEnd]);
4011
- React24.useEffect(() => {
4088
+ React25.useEffect(() => {
4012
4089
  if (isCardVerticalDragging || isCardHorizontalDragging) {
4013
4090
  window.addEventListener("pointermove", handleCardPointerMove);
4014
4091
  window.addEventListener("pointerup", handleCardPointerUp);
@@ -4025,7 +4102,7 @@ var DataPanel = React24.forwardRef(
4025
4102
  handleCardPointerMove,
4026
4103
  handleCardPointerUp
4027
4104
  ]);
4028
- React24.useEffect(() => {
4105
+ React25.useEffect(() => {
4029
4106
  if (isCardTopResizing) {
4030
4107
  window.addEventListener("pointermove", handleCardResizeMove);
4031
4108
  window.addEventListener("pointerup", handleCardResizeEnd);
@@ -4037,7 +4114,7 @@ var DataPanel = React24.forwardRef(
4037
4114
  };
4038
4115
  }
4039
4116
  }, [isCardTopResizing, handleCardResizeMove, handleCardResizeEnd]);
4040
- React24.useEffect(() => {
4117
+ React25.useEffect(() => {
4041
4118
  if (isCardWidthResizing) {
4042
4119
  window.addEventListener("pointermove", handleCardWidthResizeMove);
4043
4120
  window.addEventListener("pointerup", handleCardWidthResizeEnd);
@@ -4049,10 +4126,10 @@ var DataPanel = React24.forwardRef(
4049
4126
  };
4050
4127
  }
4051
4128
  }, [isCardWidthResizing, handleCardWidthResizeMove, handleCardWidthResizeEnd]);
4052
- const resizeStateLatestRef = React24.useRef({ mode, detachedSize });
4129
+ const resizeStateLatestRef = React25.useRef({ mode, detachedSize });
4053
4130
  resizeStateLatestRef.current = { mode, detachedSize };
4054
4131
  const expandedRatio = resolvedCardConfig.expandedRatio;
4055
- React24.useEffect(() => {
4132
+ useIsomorphicLayoutEffect(() => {
4056
4133
  const onResize = () => {
4057
4134
  const vh = window.innerHeight;
4058
4135
  setViewportWidth(layoutViewportWidth());
@@ -4074,19 +4151,19 @@ var DataPanel = React24.forwardRef(
4074
4151
  window.addEventListener("resize", onWindowResize);
4075
4152
  return () => window.removeEventListener("resize", onWindowResize);
4076
4153
  }, [expandedRatio]);
4077
- React24.useEffect(() => {
4154
+ React25.useEffect(() => {
4078
4155
  if (isMobile && variant === "card") {
4079
4156
  setCardHorizontalPosition(0);
4080
4157
  setCardWidth(null);
4081
4158
  }
4082
4159
  }, [isMobile, variant]);
4083
- React24.useEffect(() => {
4160
+ React25.useEffect(() => {
4084
4161
  if (isCardHeightTransitioning) {
4085
4162
  const t = setTimeout(() => setIsCardHeightTransitioning(false), 350);
4086
4163
  return () => clearTimeout(t);
4087
4164
  }
4088
4165
  }, [isCardHeightTransitioning]);
4089
- const panelStyles = React24.useMemo(() => {
4166
+ const panelStyles = React25.useMemo(() => {
4090
4167
  if (variant === "card") {
4091
4168
  const defaultCardWidth = Math.min(
4092
4169
  viewportWidth - resolvedCardConfig.horizontalMargin * 2,
@@ -4206,7 +4283,6 @@ var DataPanel = React24.forwardRef(
4206
4283
  "aria-modal": isDialog ? "true" : void 0,
4207
4284
  "aria-labelledby": title ? titleId : void 0,
4208
4285
  "aria-label": !title ? "Side panel" : void 0,
4209
- "aria-expanded": variant === "card" ? isExpanded : void 0,
4210
4286
  onPointerDown: variant === "full" ? handleDragStart : void 0,
4211
4287
  children: [
4212
4288
  variant === "card" ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
@@ -4246,7 +4322,13 @@ var DataPanel = React24.forwardRef(
4246
4322
  }
4247
4323
  ),
4248
4324
  showContent && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
4249
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DataPanelContent, { children }),
4325
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4326
+ DataPanelContent,
4327
+ {
4328
+ className: cn(resizeRight && "mr-2.5", resizeBottom && !hasFooter && "mb-2.5"),
4329
+ children
4330
+ }
4331
+ ),
4250
4332
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4251
4333
  DataPanelFooter,
4252
4334
  {
@@ -4346,7 +4428,7 @@ var DataPanel = React24.forwardRef(
4346
4428
  DataPanel.displayName = "DataPanel";
4347
4429
 
4348
4430
  // src/components/Skeleton.tsx
4349
- var React25 = __toESM(require("react"));
4431
+ var React26 = __toESM(require("react"));
4350
4432
  var import_class_variance_authority6 = require("class-variance-authority");
4351
4433
  var import_jsx_runtime26 = require("react/jsx-runtime");
4352
4434
  var skeletonVariants = (0, import_class_variance_authority6.cva)("rounded-md bg-muted", {
@@ -4364,7 +4446,7 @@ var skeletonVariants = (0, import_class_variance_authority6.cva)("rounded-md bg-
4364
4446
  variant: "default"
4365
4447
  }
4366
4448
  });
4367
- var Skeleton = React25.forwardRef(
4449
+ var Skeleton = React26.forwardRef(
4368
4450
  ({ className, variant, animation = "pulse", ...props }, ref) => {
4369
4451
  const animationClass = animation === "pulse" ? "animate-pulse" : animation === "shimmer" ? "animate-shimmer" : "";
4370
4452
  return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
@@ -4380,7 +4462,7 @@ var Skeleton = React25.forwardRef(
4380
4462
  Skeleton.displayName = "Skeleton";
4381
4463
 
4382
4464
  // src/components/Spinner.tsx
4383
- var React26 = __toESM(require("react"));
4465
+ var React27 = __toESM(require("react"));
4384
4466
  var import_class_variance_authority7 = require("class-variance-authority");
4385
4467
  var import_jsx_runtime27 = require("react/jsx-runtime");
4386
4468
  var spinnerVariants = (0, import_class_variance_authority7.cva)("animate-spin text-current", {
@@ -4396,7 +4478,7 @@ var spinnerVariants = (0, import_class_variance_authority7.cva)("animate-spin te
4396
4478
  size: "md"
4397
4479
  }
4398
4480
  });
4399
- var Spinner = React26.forwardRef(
4481
+ var Spinner = React27.forwardRef(
4400
4482
  ({ className, size, label = "Loading...", ...props }, ref) => {
4401
4483
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
4402
4484
  "svg",
@@ -4438,7 +4520,7 @@ var Spinner = React26.forwardRef(
4438
4520
  Spinner.displayName = "Spinner";
4439
4521
 
4440
4522
  // src/components/LoadingLogo.tsx
4441
- var React27 = __toESM(require("react"));
4523
+ var React28 = __toESM(require("react"));
4442
4524
  var import_jsx_runtime28 = require("react/jsx-runtime");
4443
4525
  var logoPaths = [
4444
4526
  "M9.902 16.6c.3.7 1.7.8 1-.6-.6-1.4-2.3-5.1-6.1-6.3-1.7-.5-3.7.4-4.3 1.6-.4.7-1.1 2.9.5 4.3.8.7 1.9 1.2 3.6 1 .4-.1.9-.5.6-.8-.5-.4-1.9-1.7-1.1-2.7.7-.8 1.4-.6 2-.3.4.2 2.1 1 3.7 3.6l.1.2z",
@@ -4461,7 +4543,7 @@ var colors = {
4461
4543
  stroke: "#ffffff"
4462
4544
  }
4463
4545
  };
4464
- var LoadingLogo = React27.forwardRef(
4546
+ var LoadingLogo = React28.forwardRef(
4465
4547
  ({ width = 40, height = 40, loading = false, variant = "dark", className, ...props }, ref) => {
4466
4548
  const currentColors = colors[variant];
4467
4549
  const fillColor = loading ? currentColors.fillLoading : currentColors.fill;
@@ -4510,7 +4592,7 @@ var LoadingLogo = React27.forwardRef(
4510
4592
  LoadingLogo.displayName = "LoadingLogo";
4511
4593
 
4512
4594
  // src/components/ProgressBar.tsx
4513
- var React28 = __toESM(require("react"));
4595
+ var React29 = __toESM(require("react"));
4514
4596
  var import_class_variance_authority8 = require("class-variance-authority");
4515
4597
  var import_jsx_runtime29 = require("react/jsx-runtime");
4516
4598
  var progressBarVariants = (0, import_class_variance_authority8.cva)("w-full overflow-hidden rounded-full bg-muted", {
@@ -4538,7 +4620,7 @@ var progressFillVariants = (0, import_class_variance_authority8.cva)("h-full rou
4538
4620
  variant: "default"
4539
4621
  }
4540
4622
  });
4541
- var ProgressBar = React28.forwardRef(
4623
+ var ProgressBar = React29.forwardRef(
4542
4624
  ({ className, size, variant, value, max = 100, label = "Progress", showValue = false, ...props }, ref) => {
4543
4625
  const isIndeterminate = value === void 0;
4544
4626
  const clampedValue = isIndeterminate ? 0 : Math.min(Math.max(0, value), max);
@@ -4577,11 +4659,11 @@ var ProgressBar = React28.forwardRef(
4577
4659
  ProgressBar.displayName = "ProgressBar";
4578
4660
 
4579
4661
  // src/components/LoadingOverlay.tsx
4580
- var React29 = __toESM(require("react"));
4662
+ var React30 = __toESM(require("react"));
4581
4663
  var import_jsx_runtime30 = require("react/jsx-runtime");
4582
4664
  var spinnerSizeMap = { sm: "sm", md: "md", lg: "lg", xl: "xl" };
4583
4665
  var logoSizeMap = { sm: 32, md: 40, lg: 56, xl: 80 };
4584
- var LoadingOverlay = React29.forwardRef(
4666
+ var LoadingOverlay = React30.forwardRef(
4585
4667
  ({
4586
4668
  loading = true,
4587
4669
  variant = "spinner",
@@ -4596,8 +4678,8 @@ var LoadingOverlay = React29.forwardRef(
4596
4678
  children,
4597
4679
  ...props
4598
4680
  }, ref) => {
4599
- const [visible, setVisible] = React29.useState(delay === 0 && loading);
4600
- React29.useEffect(() => {
4681
+ const [visible, setVisible] = React30.useState(delay === 0 && loading);
4682
+ React30.useEffect(() => {
4601
4683
  if (!loading) {
4602
4684
  setVisible(false);
4603
4685
  return;
@@ -4609,8 +4691,14 @@ var LoadingOverlay = React29.forwardRef(
4609
4691
  const timer = setTimeout(() => setVisible(true), delay);
4610
4692
  return () => clearTimeout(timer);
4611
4693
  }, [loading, delay]);
4694
+ if (!visible && mode === "inline") {
4695
+ return null;
4696
+ }
4612
4697
  if (!visible) {
4613
- return mode === "inline" ? null : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_jsx_runtime30.Fragment, { children });
4698
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
4699
+ children,
4700
+ null
4701
+ ] });
4614
4702
  }
4615
4703
  const indicator = /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
4616
4704
  variant === "spinner" && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Spinner, { size: spinnerSizeMap[size] }),
@@ -4665,9 +4753,9 @@ var LoadingOverlay = React29.forwardRef(
4665
4753
  LoadingOverlay.displayName = "LoadingOverlay";
4666
4754
 
4667
4755
  // src/components/LoadingPage.tsx
4668
- var React30 = __toESM(require("react"));
4756
+ var React31 = __toESM(require("react"));
4669
4757
  var import_jsx_runtime31 = require("react/jsx-runtime");
4670
- var LoadingPage = React30.forwardRef(
4758
+ var LoadingPage = React31.forwardRef(
4671
4759
  ({
4672
4760
  loading = true,
4673
4761
  message,
@@ -4678,8 +4766,8 @@ var LoadingPage = React30.forwardRef(
4678
4766
  className,
4679
4767
  ...props
4680
4768
  }, ref) => {
4681
- const [visible, setVisible] = React30.useState(delay === 0 && loading);
4682
- React30.useEffect(() => {
4769
+ const [visible, setVisible] = React31.useState(delay === 0 && loading);
4770
+ React31.useEffect(() => {
4683
4771
  if (!loading) {
4684
4772
  setVisible(false);
4685
4773
  return;
@@ -4719,9 +4807,9 @@ var LoadingPage = React30.forwardRef(
4719
4807
  LoadingPage.displayName = "LoadingPage";
4720
4808
 
4721
4809
  // src/components/LoadingSection.tsx
4722
- var React31 = __toESM(require("react"));
4810
+ var React32 = __toESM(require("react"));
4723
4811
  var import_jsx_runtime32 = require("react/jsx-runtime");
4724
- var LoadingSection = React31.forwardRef(
4812
+ var LoadingSection = React32.forwardRef(
4725
4813
  ({
4726
4814
  loading = false,
4727
4815
  variant = "spinner",
@@ -4763,9 +4851,9 @@ var LoadingSection = React31.forwardRef(
4763
4851
  LoadingSection.displayName = "LoadingSection";
4764
4852
 
4765
4853
  // src/components/LiveRegion.tsx
4766
- var React32 = __toESM(require("react"));
4854
+ var React33 = __toESM(require("react"));
4767
4855
  var import_jsx_runtime33 = require("react/jsx-runtime");
4768
- var LiveRegion = React32.forwardRef(
4856
+ var LiveRegion = React33.forwardRef(
4769
4857
  ({ message, politeness = "polite", atomic = true, visuallyHidden = true, className, children }, ref) => {
4770
4858
  return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4771
4859
  "div",
@@ -4786,9 +4874,9 @@ var LiveRegion = React32.forwardRef(
4786
4874
  LiveRegion.displayName = "LiveRegion";
4787
4875
 
4788
4876
  // src/components/SkipLink.tsx
4789
- var React33 = __toESM(require("react"));
4877
+ var React34 = __toESM(require("react"));
4790
4878
  var import_jsx_runtime34 = require("react/jsx-runtime");
4791
- var SkipLink = React33.forwardRef(
4879
+ var SkipLink = React34.forwardRef(
4792
4880
  ({ targetId, className, children = "Skip to main content", onClick, ...props }, ref) => {
4793
4881
  const handleClick = (e) => {
4794
4882
  e.preventDefault();
@@ -4864,7 +4952,7 @@ function useReducedMotion() {
4864
4952
 
4865
4953
  // src/hooks/useArrowNavigation.ts
4866
4954
  var import_react4 = require("react");
4867
- var DEFAULT_SELECTOR = '[role="menuitem"], [role="option"], [role="tab"], button, a, [tabindex]:not([tabindex="-1"])';
4955
+ var DEFAULT_SELECTOR = '[data-arrow-nav-item], [role="menuitem"], [role="option"], [role="tab"], button, a, [tabindex]:not([tabindex="-1"])';
4868
4956
  function useArrowNavigation(options = {}) {
4869
4957
  const {
4870
4958
  orientation = "vertical",
@@ -4970,6 +5058,7 @@ function useArrowNavigation(options = {}) {
4970
5058
  const tabStopIndex = focusedIndex === -1 ? 0 : focusedIndex;
4971
5059
  const getItemProps = (0, import_react4.useCallback)(
4972
5060
  (index) => ({
5061
+ "data-arrow-nav-item": true,
4973
5062
  tabIndex: index === tabStopIndex ? 0 : -1,
4974
5063
  onFocus: () => {
4975
5064
  setFocusedIndex(index);
@@ -5058,7 +5147,7 @@ function useRovingTabindex(options = {}) {
5058
5147
  onKeyDown: handleKeyDown
5059
5148
  };
5060
5149
  const getItemProps = (0, import_react5.useCallback)(
5061
- (index) => ({
5150
+ (index, handlers = {}) => ({
5062
5151
  "data-roving-tabindex-item": true,
5063
5152
  tabIndex: index === activeIndex ? 0 : -1,
5064
5153
  ref: (node) => {
@@ -5068,11 +5157,13 @@ function useRovingTabindex(options = {}) {
5068
5157
  itemsRef.current.delete(index);
5069
5158
  }
5070
5159
  },
5071
- onClick: () => {
5160
+ onClick: (event) => {
5161
+ handlers.onClick?.(event);
5072
5162
  setActiveIndex(index);
5073
5163
  onIndexChange?.(index);
5074
5164
  },
5075
- onFocus: () => {
5165
+ onFocus: (event) => {
5166
+ handlers.onFocus?.(event);
5076
5167
  if (activeIndex !== index) {
5077
5168
  setActiveIndex(index);
5078
5169
  onIndexChange?.(index);
@@ -5094,21 +5185,21 @@ function useRovingTabindex(options = {}) {
5094
5185
  }
5095
5186
 
5096
5187
  // src/hooks/useClickOutside.ts
5097
- var React34 = __toESM(require("react"));
5188
+ var React35 = __toESM(require("react"));
5098
5189
  function useClickOutside(ref, callback, options) {
5099
5190
  const {
5100
5191
  enabled = true,
5101
5192
  events = ["mousedown", "touchstart"],
5102
5193
  ignoreElements = []
5103
5194
  } = options ?? {};
5104
- const callbackRef = React34.useRef(callback);
5105
- const ignoreElementsRef = React34.useRef(ignoreElements);
5106
- React34.useEffect(() => {
5195
+ const callbackRef = React35.useRef(callback);
5196
+ const ignoreElementsRef = React35.useRef(ignoreElements);
5197
+ React35.useEffect(() => {
5107
5198
  callbackRef.current = callback;
5108
5199
  ignoreElementsRef.current = ignoreElements;
5109
5200
  }, [callback, ignoreElements]);
5110
5201
  const eventsKey = events.join(",");
5111
- React34.useEffect(() => {
5202
+ React35.useEffect(() => {
5112
5203
  if (!enabled) return;
5113
5204
  const handleEvent = (event) => {
5114
5205
  const target = event.target;
@@ -5192,6 +5283,7 @@ function useClickOutside(ref, callback, options) {
5192
5283
  badgeVariants,
5193
5284
  buttonVariants,
5194
5285
  cn,
5286
+ labelVariants,
5195
5287
  pageHeaderActionsVariants,
5196
5288
  pageHeaderContainerVariants,
5197
5289
  pageHeaderSubtitleVariants,