@classic-homes/theme-react 0.2.3 → 0.3.1

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.mjs CHANGED
@@ -674,12 +674,1502 @@ var PageHeader = React12.forwardRef(
674
674
  );
675
675
  PageHeader.displayName = "PageHeader";
676
676
 
677
- // src/components/DataPanel.tsx
677
+ // src/components/Sheet.tsx
678
+ import * as DialogPrimitive2 from "@radix-ui/react-dialog";
679
+ import { cva as cva5 } from "class-variance-authority";
680
+
681
+ // src/components/studio/icons.tsx
682
+ import { jsx as jsx12 } from "react/jsx-runtime";
683
+ var PATHS = {
684
+ close: "M18 6 6 18M6 6l12 12",
685
+ plus: "M12 5v14M5 12h14",
686
+ "arrow-left": "M19 12H5M12 19l-7-7 7-7",
687
+ "arrow-up": "M12 19V5M5 12l7-7 7 7",
688
+ "arrow-down": "M12 5v14M19 12l-7 7-7-7",
689
+ "chevron-down": "m6 9 6 6 6-6",
690
+ "chevron-right": "m9 18 6-6-6-6",
691
+ "alert-triangle": "M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0zM12 9v4M12 17h.01",
692
+ "alert-circle": "M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20zM12 8v4M12 16h.01",
693
+ info: "M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20zM12 16v-4M12 8h.01",
694
+ "check-circle": "M22 11.08V12a10 10 0 1 1-5.93-9.14M22 4 12 14.01l-3-3",
695
+ loader: "M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83",
696
+ edit: "M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",
697
+ "wifi-off": "M2 2l20 20M8.5 16.5a5 5 0 0 1 7 0M2 8.82a15 15 0 0 1 4.17-2.65M10.66 5c4.01-.36 8.14.9 11.34 3.76M16.85 11.25a10 10 0 0 1 2.22 1.68M5 13a10 10 0 0 1 5.24-2.76M12 20h.01",
698
+ eye: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7ZM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",
699
+ refresh: "M3 12a9 9 0 0 1 15-6.7L21 8M21 3v5h-5M21 12a9 9 0 0 1-15 6.7L3 16M3 21v-5h5",
700
+ list: "M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",
701
+ settings: "M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",
702
+ search: "M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16zM21 21l-4.35-4.35",
703
+ monitor: "M4 3h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2zM8 21h8M12 17v4",
704
+ smartphone: "M7 2h10a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zM12 18h.01"
705
+ };
706
+ var DOTS = {
707
+ grip: [
708
+ [9, 5],
709
+ [15, 5],
710
+ [9, 12],
711
+ [15, 12],
712
+ [9, 19],
713
+ [15, 19]
714
+ ],
715
+ "more-horizontal": [
716
+ [5, 12],
717
+ [12, 12],
718
+ [19, 12]
719
+ ]
720
+ };
721
+ function StudioIcon({
722
+ name,
723
+ size = 16,
724
+ className
725
+ }) {
726
+ const dots = name === "grip" || name === "more-horizontal" ? DOTS[name] : null;
727
+ return /* @__PURE__ */ jsx12(
728
+ "svg",
729
+ {
730
+ width: size,
731
+ height: size,
732
+ viewBox: "0 0 24 24",
733
+ fill: dots ? "currentColor" : "none",
734
+ stroke: dots ? "none" : "currentColor",
735
+ strokeWidth: 2,
736
+ strokeLinecap: "round",
737
+ strokeLinejoin: "round",
738
+ "aria-hidden": "true",
739
+ className: cn("shrink-0", className),
740
+ children: dots ? dots.map(([cx, cy]) => /* @__PURE__ */ jsx12("circle", { cx, cy, r: 1.6 }, `${cx}-${cy}`)) : /* @__PURE__ */ jsx12("path", { d: PATHS[name] })
741
+ }
742
+ );
743
+ }
744
+
745
+ // src/components/Sheet.tsx
746
+ import { Fragment, jsx as jsx13, jsxs as jsxs5 } from "react/jsx-runtime";
747
+ var sheetVariants = cva5(
748
+ "fixed z-50 flex flex-col border-border bg-background shadow-lg outline-none duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out",
749
+ {
750
+ variants: {
751
+ side: {
752
+ right: "inset-y-0 right-0 h-dvh w-full border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right",
753
+ left: "inset-y-0 left-0 h-dvh w-full border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left",
754
+ bottom: "inset-x-0 bottom-0 max-h-[85dvh] w-full rounded-t-xl border-t pb-[env(safe-area-inset-bottom)] data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom"
755
+ },
756
+ size: { sm: "", md: "", lg: "" }
757
+ },
758
+ compoundVariants: [
759
+ { side: ["left", "right"], size: "sm", className: "sm:max-w-xs" },
760
+ { side: ["left", "right"], size: "md", className: "sm:max-w-md" },
761
+ { side: ["left", "right"], size: "lg", className: "sm:max-w-xl" }
762
+ ],
763
+ defaultVariants: { side: "right", size: "md" }
764
+ }
765
+ );
766
+ var closeClass = "flex h-9 w-9 items-center justify-center rounded-md text-muted-foreground hover:bg-muted-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring";
767
+ function Sheet({
768
+ open,
769
+ onOpenChange,
770
+ side = "right",
771
+ size = "md",
772
+ title,
773
+ hideTitle = false,
774
+ description,
775
+ headerActions,
776
+ footer,
777
+ children,
778
+ className
779
+ }) {
780
+ const close = /* @__PURE__ */ jsx13(DialogPrimitive2.Close, { className: closeClass, "aria-label": "Close", children: /* @__PURE__ */ jsx13(StudioIcon, { name: "close", size: 18 }) });
781
+ return /* @__PURE__ */ jsx13(DialogPrimitive2.Root, { open, onOpenChange, children: /* @__PURE__ */ jsxs5(DialogPrimitive2.Portal, { children: [
782
+ /* @__PURE__ */ jsx13(DialogPrimitive2.Overlay, { className: "fixed inset-0 z-50 bg-foreground/60 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0" }),
783
+ /* @__PURE__ */ jsxs5(
784
+ DialogPrimitive2.Content,
785
+ {
786
+ className: cn(sheetVariants({ side, size }), className),
787
+ ...description ? {} : { "aria-describedby": void 0 },
788
+ children: [
789
+ side === "bottom" && /* @__PURE__ */ jsxs5("div", { className: "relative flex h-6 shrink-0 items-center justify-center", children: [
790
+ /* @__PURE__ */ jsx13("div", { className: "h-1.5 w-10 rounded-full bg-muted", "aria-hidden": "true" }),
791
+ hideTitle && /* @__PURE__ */ jsx13("div", { className: "absolute right-2 top-1", children: close })
792
+ ] }),
793
+ hideTitle ? /* @__PURE__ */ jsxs5(Fragment, { children: [
794
+ /* @__PURE__ */ jsx13(DialogPrimitive2.Title, { className: "sr-only", children: title }),
795
+ description && /* @__PURE__ */ jsx13(DialogPrimitive2.Description, { className: "sr-only", children: description }),
796
+ side !== "bottom" && /* @__PURE__ */ jsx13("div", { className: "absolute right-2 top-2 z-10", children: close })
797
+ ] }) : /* @__PURE__ */ jsxs5("div", { className: "flex shrink-0 items-start gap-3 border-b border-border px-4 py-3", children: [
798
+ /* @__PURE__ */ jsxs5("div", { className: "min-w-0 flex-1", children: [
799
+ /* @__PURE__ */ jsx13(DialogPrimitive2.Title, { className: "text-base font-semibold leading-tight", children: title }),
800
+ description && /* @__PURE__ */ jsx13(DialogPrimitive2.Description, { className: "mt-1 text-sm text-muted-foreground", children: description })
801
+ ] }),
802
+ /* @__PURE__ */ jsxs5("div", { className: "-mr-1 ml-auto flex shrink-0 items-center gap-1", children: [
803
+ headerActions,
804
+ close
805
+ ] })
806
+ ] }),
807
+ /* @__PURE__ */ jsx13("div", { className: "min-h-0 flex-1 overflow-y-auto overscroll-contain", children }),
808
+ footer && /* @__PURE__ */ jsx13("div", { className: "flex shrink-0 items-center justify-end gap-2 border-t border-border px-4 py-3", children: footer })
809
+ ]
810
+ }
811
+ )
812
+ ] }) });
813
+ }
814
+
815
+ // src/components/SortableList.tsx
816
+ import * as React13 from "react";
817
+ import { Fragment as Fragment2, jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
818
+ function SortableList({
819
+ items,
820
+ getKey,
821
+ onReorder,
822
+ renderItem,
823
+ label,
824
+ getItemLabel = (_item, index) => `Item ${index + 1}`,
825
+ disabled = false,
826
+ className,
827
+ itemClassName
828
+ }) {
829
+ const instructionsId = `${React13.useId()}-sortable-help`;
830
+ const listRef = React13.useRef(null);
831
+ const [announcement, setAnnouncement] = React13.useState("");
832
+ const [drag, setDrag] = React13.useState(
833
+ null
834
+ );
835
+ const rects = React13.useRef([]);
836
+ const startY = React13.useRef(0);
837
+ const [grabbed, setGrabbed] = React13.useState(null);
838
+ const grabbedFrom = React13.useRef(0);
839
+ const moving = React13.useRef(false);
840
+ const pendingFocus = React13.useRef(null);
841
+ React13.useLayoutEffect(() => {
842
+ if (pendingFocus.current === null) return;
843
+ const handles = listRef.current?.querySelectorAll(
844
+ ":scope > li [data-sortable-handle]"
845
+ );
846
+ handles?.[pendingFocus.current]?.focus();
847
+ pendingFocus.current = null;
848
+ moving.current = false;
849
+ });
850
+ const announce = (message) => {
851
+ setAnnouncement("");
852
+ queueMicrotask(() => setAnnouncement(message));
853
+ };
854
+ const positionText = (index) => `position ${index + 1} of ${items.length}`;
855
+ const move = (from, to, keepFocus = true) => {
856
+ if (to < 0 || to >= items.length || from === to) return;
857
+ const name = getItemLabel(items[from], from);
858
+ moving.current = keepFocus;
859
+ if (keepFocus) pendingFocus.current = to;
860
+ onReorder(from, to);
861
+ setGrabbed((g) => g === from ? to : g);
862
+ announce(`${name} moved to ${positionText(to)}.`);
863
+ };
864
+ const shiftFor = (index) => {
865
+ if (!drag) return 0;
866
+ const { from, over, offset } = drag;
867
+ if (index === from) return offset;
868
+ const r = rects.current;
869
+ const height = r[from]?.height ?? 0;
870
+ const gap = r.length > 1 ? Math.max(0, r[1].top - r[0].bottom) : 0;
871
+ if (from < over && index > from && index <= over) return -(height + gap);
872
+ if (from > over && index >= over && index < from) return height + gap;
873
+ return 0;
874
+ };
875
+ const endDrag = (commit) => {
876
+ const current = drag;
877
+ setDrag(null);
878
+ rects.current = [];
879
+ if (commit && current && current.from !== current.over) move(current.from, current.over, false);
880
+ };
881
+ const handleProps = (index, key, name) => ({
882
+ type: "button",
883
+ "aria-label": `Reorder ${name}`,
884
+ "aria-roledescription": "sortable handle",
885
+ "aria-describedby": instructionsId,
886
+ "aria-pressed": grabbed === index,
887
+ "data-sortable-handle": String(key),
888
+ onPointerDown(event) {
889
+ if (disabled || event.button !== 0 || !listRef.current) return;
890
+ event.preventDefault();
891
+ event.currentTarget.setPointerCapture?.(event.pointerId);
892
+ rects.current = Array.from(listRef.current.children, (c) => c.getBoundingClientRect());
893
+ startY.current = event.clientY;
894
+ setDrag({ from: index, over: index, offset: 0 });
895
+ },
896
+ onPointerMove(event) {
897
+ if (!drag) return;
898
+ const offset = event.clientY - startY.current;
899
+ const origin = rects.current[drag.from];
900
+ const center = origin.top + origin.height / 2 + offset;
901
+ const over = rects.current.filter(
902
+ (r, i) => i !== drag.from && r.top + r.height / 2 < center
903
+ ).length;
904
+ setDrag({ ...drag, over, offset });
905
+ },
906
+ onPointerUp() {
907
+ endDrag(true);
908
+ },
909
+ onPointerCancel() {
910
+ endDrag(false);
911
+ },
912
+ onKeyDown(event) {
913
+ if (disabled) return;
914
+ const picked = grabbed === index;
915
+ if (event.key === " " || event.key === "Enter") {
916
+ event.preventDefault();
917
+ if (picked) {
918
+ setGrabbed(null);
919
+ announce(`${name} dropped at ${positionText(index)}.`);
920
+ } else {
921
+ setGrabbed(index);
922
+ grabbedFrom.current = index;
923
+ announce(`${name} picked up at ${positionText(index)}. Use the arrow keys to move it.`);
924
+ }
925
+ } else if (event.key === "Escape" && picked) {
926
+ event.preventDefault();
927
+ event.stopPropagation();
928
+ setGrabbed(null);
929
+ if (index !== grabbedFrom.current) {
930
+ moving.current = true;
931
+ pendingFocus.current = grabbedFrom.current;
932
+ onReorder(index, grabbedFrom.current);
933
+ }
934
+ announce(`Reorder cancelled. ${name} is back at ${positionText(grabbedFrom.current)}.`);
935
+ } else if ((picked || event.altKey) && (event.key === "ArrowUp" || event.key === "ArrowDown")) {
936
+ event.preventDefault();
937
+ move(index, event.key === "ArrowUp" ? index - 1 : index + 1);
938
+ } else if (picked && (event.key === "Home" || event.key === "End")) {
939
+ event.preventDefault();
940
+ move(index, event.key === "Home" ? 0 : items.length - 1);
941
+ }
942
+ },
943
+ onBlur() {
944
+ if (!moving.current && grabbed === index) setGrabbed(null);
945
+ }
946
+ });
947
+ return /* @__PURE__ */ jsxs6(Fragment2, { children: [
948
+ /* @__PURE__ */ jsx14("ul", { ref: listRef, "aria-label": label, className: cn("relative", className), children: items.map((item, index) => {
949
+ const key = getKey(item, index);
950
+ const dragging = drag?.from === index || grabbed === index;
951
+ const shift = shiftFor(index);
952
+ return /* @__PURE__ */ jsx14(
953
+ "li",
954
+ {
955
+ className: cn(
956
+ "relative",
957
+ drag && drag.from !== index && "transition-transform duration-150",
958
+ drag?.from === index && "z-10 opacity-90 shadow-lg",
959
+ itemClassName
960
+ ),
961
+ style: shift ? { transform: `translateY(${shift}px)` } : void 0,
962
+ "data-dragging": dragging || void 0,
963
+ children: renderItem({
964
+ item,
965
+ index,
966
+ handle: handleProps(index, key, getItemLabel(item, index)),
967
+ dragging
968
+ })
969
+ },
970
+ key
971
+ );
972
+ }) }),
973
+ /* @__PURE__ */ jsx14("p", { id: instructionsId, className: "sr-only", children: "Press Space or Enter to pick up, use the arrow keys to move, Space or Enter to drop, Escape to cancel." }),
974
+ /* @__PURE__ */ jsx14("div", { className: "sr-only", role: "status", "aria-live": "assertive", "aria-atomic": "true", children: announcement })
975
+ ] });
976
+ }
977
+
978
+ // src/components/studio/Studio.tsx
979
+ import * as React15 from "react";
980
+
981
+ // src/components/studio/context.ts
678
982
  import * as React14 from "react";
983
+ var StudioContext = React14.createContext(void 0);
984
+ function useStudio() {
985
+ return React14.useContext(StudioContext);
986
+ }
987
+
988
+ // src/components/studio/Studio.tsx
989
+ import { jsx as jsx15, jsxs as jsxs7 } from "react/jsx-runtime";
990
+ function useLayout() {
991
+ const [layout, setLayout] = React15.useState("wide");
992
+ React15.useEffect(() => {
993
+ const wide = window.matchMedia("(min-width: 1280px)");
994
+ const medium = window.matchMedia("(min-width: 768px)");
995
+ const update = () => setLayout(wide.matches ? "wide" : medium.matches ? "medium" : "compact");
996
+ update();
997
+ wide.addEventListener("change", update);
998
+ medium.addEventListener("change", update);
999
+ return () => {
1000
+ wide.removeEventListener("change", update);
1001
+ medium.removeEventListener("change", update);
1002
+ };
1003
+ }, []);
1004
+ return layout;
1005
+ }
1006
+ function useControllable(value, onChange) {
1007
+ const [inner, setInner] = React15.useState(false);
1008
+ const current = value ?? inner;
1009
+ const set = React15.useCallback(
1010
+ (next) => {
1011
+ if (value === void 0) setInner(next);
1012
+ onChange?.(next);
1013
+ },
1014
+ [value, onChange]
1015
+ );
1016
+ return [current, set];
1017
+ }
1018
+ var floatingButton = "pointer-events-auto inline-flex h-9 items-center gap-2 rounded-full border border-border bg-background px-3 text-sm font-medium shadow-md hover:bg-muted-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring";
1019
+ function Studio({
1020
+ bar,
1021
+ banner,
1022
+ rail,
1023
+ canvas,
1024
+ inspector,
1025
+ railLabel = "Outline",
1026
+ inspectorLabel = "Properties",
1027
+ railOpen: railOpenProp,
1028
+ onRailOpenChange,
1029
+ inspectorOpen: inspectorOpenProp,
1030
+ onInspectorOpenChange,
1031
+ className
1032
+ }) {
1033
+ const layout = useLayout();
1034
+ const [railOpen, setRailOpen] = useControllable(railOpenProp, onRailOpenChange);
1035
+ const [inspectorOpen, setInspectorOpen] = useControllable(
1036
+ inspectorOpenProp,
1037
+ onInspectorOpenChange
1038
+ );
1039
+ const railInSheet = !!rail && layout !== "wide";
1040
+ const inspectorInSheet = !!inspector && layout === "compact";
1041
+ React15.useEffect(() => {
1042
+ if (layout === "wide" && railOpen) setRailOpen(false);
1043
+ if (layout !== "compact" && inspectorOpen) setInspectorOpen(false);
1044
+ }, [layout, railOpen, inspectorOpen, setRailOpen, setInspectorOpen]);
1045
+ const context = React15.useMemo(
1046
+ () => ({
1047
+ layout,
1048
+ railInSheet,
1049
+ inspectorInSheet,
1050
+ openRail: () => railInSheet && setRailOpen(true),
1051
+ closeRail: () => setRailOpen(false),
1052
+ revealInspector: () => {
1053
+ setRailOpen(false);
1054
+ if (inspectorInSheet) setInspectorOpen(true);
1055
+ },
1056
+ closeInspector: () => setInspectorOpen(false)
1057
+ }),
1058
+ [layout, railInSheet, inspectorInSheet, setRailOpen, setInspectorOpen]
1059
+ );
1060
+ return /* @__PURE__ */ jsxs7(StudioContext.Provider, { value: context, children: [
1061
+ /* @__PURE__ */ jsxs7(
1062
+ "div",
1063
+ {
1064
+ className: cn(
1065
+ "flex h-dvh flex-col overflow-hidden bg-background text-foreground",
1066
+ className
1067
+ ),
1068
+ children: [
1069
+ bar,
1070
+ banner && /* @__PURE__ */ jsx15("div", { className: "shrink-0", children: banner }),
1071
+ /* @__PURE__ */ jsxs7("div", { className: "relative flex min-h-0 flex-1", children: [
1072
+ rail && !railInSheet && /* @__PURE__ */ jsx15(
1073
+ "aside",
1074
+ {
1075
+ "aria-label": railLabel,
1076
+ className: "hidden w-64 shrink-0 flex-col overflow-hidden border-r border-border bg-background xl:flex",
1077
+ children: rail
1078
+ }
1079
+ ),
1080
+ /* @__PURE__ */ jsxs7("div", { className: "relative min-w-0 flex-1 overflow-hidden bg-muted/40", children: [
1081
+ canvas,
1082
+ (railInSheet || inspectorInSheet) && /* @__PURE__ */ jsxs7("div", { className: "pointer-events-none absolute inset-x-3 bottom-3 z-10 flex items-end justify-between gap-2", children: [
1083
+ railInSheet ? /* @__PURE__ */ jsxs7(
1084
+ "button",
1085
+ {
1086
+ type: "button",
1087
+ className: floatingButton,
1088
+ "aria-expanded": railOpen,
1089
+ onClick: () => setRailOpen(true),
1090
+ children: [
1091
+ /* @__PURE__ */ jsx15(StudioIcon, { name: "list" }),
1092
+ railLabel
1093
+ ]
1094
+ }
1095
+ ) : /* @__PURE__ */ jsx15("span", {}),
1096
+ inspectorInSheet && /* @__PURE__ */ jsxs7(
1097
+ "button",
1098
+ {
1099
+ type: "button",
1100
+ className: floatingButton,
1101
+ "aria-expanded": inspectorOpen,
1102
+ onClick: () => setInspectorOpen(true),
1103
+ children: [
1104
+ /* @__PURE__ */ jsx15(StudioIcon, { name: "settings" }),
1105
+ inspectorLabel
1106
+ ]
1107
+ }
1108
+ )
1109
+ ] })
1110
+ ] }),
1111
+ inspector && !inspectorInSheet && /* @__PURE__ */ jsx15(
1112
+ "aside",
1113
+ {
1114
+ "aria-label": inspectorLabel,
1115
+ className: "hidden w-80 shrink-0 flex-col overflow-hidden border-l border-border bg-background md:flex 2xl:w-96",
1116
+ children: inspector
1117
+ }
1118
+ )
1119
+ ] })
1120
+ ]
1121
+ }
1122
+ ),
1123
+ rail && railInSheet && /* @__PURE__ */ jsx15(Sheet, { open: railOpen, onOpenChange: setRailOpen, side: "left", size: "sm", title: railLabel, children: /* @__PURE__ */ jsx15("div", { className: "flex h-full flex-col", children: rail }) }),
1124
+ inspector && inspectorInSheet && /* @__PURE__ */ jsx15(
1125
+ Sheet,
1126
+ {
1127
+ open: inspectorOpen,
1128
+ onOpenChange: setInspectorOpen,
1129
+ side: "bottom",
1130
+ title: inspectorLabel,
1131
+ hideTitle: true,
1132
+ children: inspector
1133
+ }
1134
+ )
1135
+ ] });
1136
+ }
1137
+
1138
+ // src/components/studio/StudioBar.tsx
1139
+ import * as React16 from "react";
1140
+
1141
+ // src/components/studio/menu.tsx
679
1142
  import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
1143
+ import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
1144
+ function StudioMenu({
1145
+ items,
1146
+ label,
1147
+ triggerClassName,
1148
+ children
1149
+ }) {
1150
+ return /* @__PURE__ */ jsxs8(DropdownMenuPrimitive.Root, { children: [
1151
+ /* @__PURE__ */ jsx16(DropdownMenuPrimitive.Trigger, { className: triggerClassName, "aria-label": label, children }),
1152
+ /* @__PURE__ */ jsx16(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx16(
1153
+ DropdownMenuPrimitive.Content,
1154
+ {
1155
+ align: "end",
1156
+ sideOffset: 4,
1157
+ collisionPadding: 8,
1158
+ className: "z-50 min-w-[10rem] overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md",
1159
+ children: items.map(
1160
+ (item, i) => item.type === "separator" ? /* @__PURE__ */ jsx16(DropdownMenuPrimitive.Separator, { className: "-mx-1 my-1 h-px bg-muted" }, i) : /* @__PURE__ */ jsxs8(
1161
+ DropdownMenuPrimitive.Item,
1162
+ {
1163
+ disabled: item.disabled,
1164
+ onSelect: () => item.onSelect?.(),
1165
+ className: cn(
1166
+ "relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:opacity-50",
1167
+ item.destructive && "text-destructive data-[highlighted]:text-destructive"
1168
+ ),
1169
+ children: [
1170
+ item.icon,
1171
+ item.label
1172
+ ]
1173
+ },
1174
+ i
1175
+ )
1176
+ )
1177
+ }
1178
+ ) })
1179
+ ] });
1180
+ }
1181
+
1182
+ // src/components/studio/StudioBar.tsx
1183
+ import { jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
1184
+ function ModeSwitch({
1185
+ modes,
1186
+ value,
1187
+ onChange
1188
+ }) {
1189
+ const refs = React16.useRef([]);
1190
+ const keyDown = (event, index) => {
1191
+ const step = event.key === "ArrowRight" || event.key === "ArrowDown" ? 1 : event.key === "ArrowLeft" || event.key === "ArrowUp" ? -1 : 0;
1192
+ if (!step) return;
1193
+ event.preventDefault();
1194
+ const next = (index + step + modes.length) % modes.length;
1195
+ onChange(modes[next].value);
1196
+ refs.current[next]?.focus();
1197
+ };
1198
+ return /* @__PURE__ */ jsx17(
1199
+ "div",
1200
+ {
1201
+ role: "radiogroup",
1202
+ "aria-label": "Editor mode",
1203
+ className: "flex h-9 w-full items-center gap-1 rounded-lg bg-muted p-1 text-muted-foreground md:w-auto",
1204
+ children: modes.map((m, i) => {
1205
+ const checked = m.value === value;
1206
+ return /* @__PURE__ */ jsxs9(
1207
+ "button",
1208
+ {
1209
+ ref: (el) => {
1210
+ refs.current[i] = el;
1211
+ },
1212
+ type: "button",
1213
+ role: "radio",
1214
+ "aria-checked": checked,
1215
+ tabIndex: checked ? 0 : -1,
1216
+ onClick: () => onChange(m.value),
1217
+ onKeyDown: (e) => keyDown(e, i),
1218
+ className: cn(
1219
+ "inline-flex h-7 flex-1 items-center justify-center gap-1.5 whitespace-nowrap rounded-md px-2.5 text-sm font-medium hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring md:flex-none",
1220
+ checked && "bg-background text-foreground shadow-sm"
1221
+ ),
1222
+ children: [
1223
+ m.icon,
1224
+ m.label
1225
+ ]
1226
+ },
1227
+ m.value
1228
+ );
1229
+ })
1230
+ }
1231
+ );
1232
+ }
1233
+ function StudioBar({
1234
+ title,
1235
+ onTitleInput,
1236
+ onTitleChange,
1237
+ titleReadonly = false,
1238
+ titlePlaceholder = "Untitled",
1239
+ subtitle,
1240
+ backHref,
1241
+ backLabel = "Back",
1242
+ modes,
1243
+ mode,
1244
+ onModeChange,
1245
+ status,
1246
+ issues,
1247
+ actions,
1248
+ menuItems,
1249
+ menuLabel = "More actions",
1250
+ className
1251
+ }) {
1252
+ const [draft, setDraft] = React16.useState(title);
1253
+ const atFocus = React16.useRef(title);
1254
+ React16.useEffect(() => setDraft(title), [title]);
1255
+ const commit = () => {
1256
+ const next = draft.trim();
1257
+ if (!next) {
1258
+ setDraft(atFocus.current);
1259
+ onTitleInput?.(atFocus.current);
1260
+ return;
1261
+ }
1262
+ if (next !== atFocus.current) onTitleChange?.(next);
1263
+ atFocus.current = next;
1264
+ };
1265
+ return /* @__PURE__ */ jsxs9(
1266
+ "header",
1267
+ {
1268
+ className: cn(
1269
+ "flex shrink-0 flex-wrap items-center gap-x-2 gap-y-2 border-b border-border bg-background px-2 py-2 md:h-14 md:flex-nowrap md:gap-x-3 md:px-3 md:py-0",
1270
+ className
1271
+ ),
1272
+ children: [
1273
+ /* @__PURE__ */ jsxs9("div", { className: "flex min-w-0 flex-1 items-center gap-1 md:basis-0", children: [
1274
+ backHref && /* @__PURE__ */ jsx17(
1275
+ "a",
1276
+ {
1277
+ href: backHref,
1278
+ "aria-label": backLabel,
1279
+ title: backLabel,
1280
+ className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-muted-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1281
+ children: /* @__PURE__ */ jsx17(StudioIcon, { name: "arrow-left", size: 18 })
1282
+ }
1283
+ ),
1284
+ /* @__PURE__ */ jsxs9("div", { className: "min-w-0 flex-1", children: [
1285
+ /* @__PURE__ */ jsx17("h1", { className: titleReadonly ? "truncate px-1.5 text-base font-semibold" : "sr-only", children: title || titlePlaceholder }),
1286
+ !titleReadonly && /* @__PURE__ */ jsx17(
1287
+ "input",
1288
+ {
1289
+ value: draft,
1290
+ "aria-label": "Title",
1291
+ placeholder: titlePlaceholder,
1292
+ className: "block w-full max-w-md truncate rounded-md border border-transparent bg-transparent px-1.5 py-0.5 text-base font-semibold leading-tight outline-none hover:border-border focus:border-input focus:bg-background focus:ring-2 focus:ring-ring",
1293
+ onChange: (e) => {
1294
+ setDraft(e.target.value);
1295
+ onTitleInput?.(e.target.value);
1296
+ },
1297
+ onFocus: (e) => atFocus.current = e.target.value,
1298
+ onBlur: commit,
1299
+ onKeyDown: (e) => {
1300
+ if (e.key === "Enter") {
1301
+ e.preventDefault();
1302
+ e.currentTarget.blur();
1303
+ } else if (e.key === "Escape") {
1304
+ e.preventDefault();
1305
+ setDraft(atFocus.current);
1306
+ onTitleInput?.(atFocus.current);
1307
+ const input = e.currentTarget;
1308
+ requestAnimationFrame(() => input.blur());
1309
+ }
1310
+ }
1311
+ }
1312
+ ),
1313
+ subtitle && /* @__PURE__ */ jsx17("p", { className: "truncate px-1.5 text-xs text-muted-foreground", children: subtitle })
1314
+ ] })
1315
+ ] }),
1316
+ modes && modes.length > 1 && /* @__PURE__ */ jsx17("div", { className: "order-last flex w-full justify-center md:order-none md:w-auto", children: /* @__PURE__ */ jsx17(
1317
+ ModeSwitch,
1318
+ {
1319
+ modes,
1320
+ value: mode ?? modes[0].value,
1321
+ onChange: (v) => v !== mode && onModeChange?.(v)
1322
+ }
1323
+ ) }),
1324
+ /* @__PURE__ */ jsxs9("div", { className: "flex shrink-0 items-center justify-end gap-1 md:flex-1 md:basis-0 md:gap-2", children: [
1325
+ status,
1326
+ issues,
1327
+ actions,
1328
+ menuItems && menuItems.length > 0 && /* @__PURE__ */ jsx17(
1329
+ StudioMenu,
1330
+ {
1331
+ items: menuItems,
1332
+ label: menuLabel,
1333
+ triggerClassName: "flex h-9 w-9 items-center justify-center rounded-md text-muted-foreground hover:bg-muted-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1334
+ children: /* @__PURE__ */ jsx17(StudioIcon, { name: "more-horizontal", size: 18 })
1335
+ }
1336
+ )
1337
+ ] })
1338
+ ]
1339
+ }
1340
+ );
1341
+ }
1342
+
1343
+ // src/components/studio/StudioOutline.tsx
1344
+ import * as React17 from "react";
1345
+ import { jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
1346
+ function StudioOutline({
1347
+ items,
1348
+ selected = null,
1349
+ onSelect,
1350
+ onReorder,
1351
+ menuItems,
1352
+ onAdd,
1353
+ addLabel = "Add",
1354
+ label = "Items",
1355
+ numbered = true,
1356
+ renderThumbnail,
1357
+ header,
1358
+ empty,
1359
+ className
1360
+ }) {
1361
+ const studio = useStudio();
1362
+ const listHost = React17.useRef(null);
1363
+ const focusIndex = Math.max(
1364
+ 0,
1365
+ items.findIndex((i) => i.id === selected)
1366
+ );
1367
+ React17.useEffect(() => {
1368
+ if (!selected) return;
1369
+ listHost.current?.querySelector(`[data-outline-id="${CSS.escape(selected)}"]`)?.scrollIntoView?.({ block: "nearest" });
1370
+ }, [selected]);
1371
+ const select = (id) => {
1372
+ onSelect?.(id);
1373
+ studio?.revealInspector();
1374
+ };
1375
+ const rowKeyDown = (event, index) => {
1376
+ const rows = Array.from(
1377
+ listHost.current?.querySelectorAll("[data-outline-row]") ?? []
1378
+ );
1379
+ const next = event.key === "ArrowDown" ? Math.min(index + 1, rows.length - 1) : event.key === "ArrowUp" ? Math.max(index - 1, 0) : event.key === "Home" ? 0 : event.key === "End" ? rows.length - 1 : -1;
1380
+ if (next < 0) return;
1381
+ event.preventDefault();
1382
+ rows[next]?.focus();
1383
+ };
1384
+ const rowMenu = (entry, index) => {
1385
+ const own = menuItems?.(entry, index) ?? [];
1386
+ if (!onReorder) return own;
1387
+ const moves = [
1388
+ {
1389
+ label: "Move up",
1390
+ icon: /* @__PURE__ */ jsx18(StudioIcon, { name: "arrow-up" }),
1391
+ disabled: index === 0,
1392
+ onSelect: () => onReorder(index, index - 1)
1393
+ },
1394
+ {
1395
+ label: "Move down",
1396
+ icon: /* @__PURE__ */ jsx18(StudioIcon, { name: "arrow-down" }),
1397
+ disabled: index === items.length - 1,
1398
+ onSelect: () => onReorder(index, index + 1)
1399
+ }
1400
+ ];
1401
+ return own.length ? [...moves, { type: "separator" }, ...own] : moves;
1402
+ };
1403
+ const row = (entry, index, handle) => {
1404
+ const active = entry.id === selected;
1405
+ const menu = rowMenu(entry, index);
1406
+ return /* @__PURE__ */ jsxs10(
1407
+ "div",
1408
+ {
1409
+ "data-outline-id": entry.id,
1410
+ className: cn(
1411
+ "group relative flex items-stretch gap-0.5 rounded-md",
1412
+ active ? "bg-primary/10 ring-1 ring-inset ring-primary/40" : "hover:bg-muted-hover"
1413
+ ),
1414
+ children: [
1415
+ handle && /* @__PURE__ */ jsx18(
1416
+ "button",
1417
+ {
1418
+ ...handle,
1419
+ className: cn(
1420
+ "flex w-6 shrink-0 cursor-grab touch-none items-center justify-center rounded-l-md text-muted-foreground opacity-0 hover:text-foreground focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring active:cursor-grabbing group-hover:opacity-100 aria-pressed:opacity-100 [@media(hover:none)]:opacity-100",
1421
+ active && "opacity-100"
1422
+ ),
1423
+ children: /* @__PURE__ */ jsx18(StudioIcon, { name: "grip", size: 14 })
1424
+ }
1425
+ ),
1426
+ /* @__PURE__ */ jsxs10(
1427
+ "button",
1428
+ {
1429
+ type: "button",
1430
+ "data-outline-row": "",
1431
+ tabIndex: index === focusIndex ? 0 : -1,
1432
+ "aria-current": active ? "true" : void 0,
1433
+ className: cn(
1434
+ "flex min-w-0 flex-1 flex-col gap-1.5 rounded-md py-2 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1435
+ !handle && "pl-2",
1436
+ entry.muted && "opacity-60"
1437
+ ),
1438
+ onClick: () => select(entry.id),
1439
+ onKeyDown: (e) => rowKeyDown(e, index),
1440
+ children: [
1441
+ renderThumbnail && /* @__PURE__ */ jsx18("div", { className: "w-full overflow-hidden rounded border border-border bg-background", children: renderThumbnail(entry, index) }),
1442
+ /* @__PURE__ */ jsxs10("span", { className: "flex min-w-0 items-start gap-2", children: [
1443
+ numbered && /* @__PURE__ */ jsx18("span", { className: "w-5 shrink-0 pt-px text-right text-xs tabular-nums text-muted-foreground", children: index + 1 }),
1444
+ entry.icon && !renderThumbnail && /* @__PURE__ */ jsx18("span", { className: "mt-px shrink-0 text-muted-foreground", "aria-hidden": "true", children: entry.icon }),
1445
+ /* @__PURE__ */ jsxs10("span", { className: "min-w-0 flex-1", children: [
1446
+ /* @__PURE__ */ jsx18(
1447
+ "span",
1448
+ {
1449
+ className: cn("block truncate text-sm text-foreground", active && "font-medium"),
1450
+ children: entry.title || "Untitled"
1451
+ }
1452
+ ),
1453
+ entry.subtitle && /* @__PURE__ */ jsx18("span", { className: "block truncate text-xs text-muted-foreground", children: entry.subtitle })
1454
+ ] }),
1455
+ entry.badge && /* @__PURE__ */ jsx18("span", { className: "shrink-0 rounded bg-muted px-1.5 py-px text-[0.6875rem] text-muted-foreground", children: entry.badge }),
1456
+ !!entry.issues && /* @__PURE__ */ jsxs10("span", { className: "inline-flex shrink-0 items-center gap-0.5 text-xs font-medium tabular-nums", children: [
1457
+ /* @__PURE__ */ jsx18(
1458
+ StudioIcon,
1459
+ {
1460
+ name: "alert-triangle",
1461
+ size: 12,
1462
+ className: entry.issueSeverity === "warning" ? "text-warning" : "text-destructive"
1463
+ }
1464
+ ),
1465
+ entry.issues,
1466
+ /* @__PURE__ */ jsx18("span", { className: "sr-only", children: entry.issues === 1 ? "issue" : "issues" })
1467
+ ] })
1468
+ ] })
1469
+ ]
1470
+ }
1471
+ ),
1472
+ menu.length > 0 && /* @__PURE__ */ jsx18(
1473
+ "div",
1474
+ {
1475
+ className: cn(
1476
+ "flex shrink-0 items-start pt-1 opacity-0 focus-within:opacity-100 group-hover:opacity-100 [@media(hover:none)]:opacity-100",
1477
+ active && "opacity-100"
1478
+ ),
1479
+ children: /* @__PURE__ */ jsx18(
1480
+ StudioMenu,
1481
+ {
1482
+ items: menu,
1483
+ label: `Actions for ${entry.title || `item ${index + 1}`}`,
1484
+ triggerClassName: "flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1485
+ children: /* @__PURE__ */ jsx18(StudioIcon, { name: "more-horizontal" })
1486
+ }
1487
+ )
1488
+ }
1489
+ )
1490
+ ]
1491
+ }
1492
+ );
1493
+ };
1494
+ return /* @__PURE__ */ jsxs10("div", { className: cn("flex h-full min-h-0 flex-col", className), children: [
1495
+ header && /* @__PURE__ */ jsx18("div", { className: "shrink-0 border-b border-border px-3 py-2", children: header }),
1496
+ /* @__PURE__ */ jsx18("div", { ref: listHost, className: "min-h-0 flex-1 overflow-y-auto p-2", children: items.length === 0 ? empty ?? /* @__PURE__ */ jsx18("p", { className: "px-2 py-6 text-center text-sm text-muted-foreground", children: "Nothing here yet." }) : onReorder ? /* @__PURE__ */ jsx18(
1497
+ SortableList,
1498
+ {
1499
+ items,
1500
+ getKey: (e) => e.id,
1501
+ onReorder,
1502
+ label,
1503
+ getItemLabel: (e, i) => e.title || `item ${i + 1}`,
1504
+ className: "space-y-0.5",
1505
+ renderItem: ({ item, index, handle }) => row(item, index, handle)
1506
+ }
1507
+ ) : /* @__PURE__ */ jsx18("ul", { "aria-label": label, className: "space-y-0.5", children: items.map((entry, index) => /* @__PURE__ */ jsx18("li", { children: row(entry, index) }, entry.id)) }) }),
1508
+ onAdd && /* @__PURE__ */ jsx18("div", { className: "shrink-0 border-t border-border p-2", children: /* @__PURE__ */ jsxs10(
1509
+ "button",
1510
+ {
1511
+ type: "button",
1512
+ onClick: onAdd,
1513
+ className: "flex h-9 w-full items-center justify-center gap-2 rounded-md border border-dashed border-border text-sm font-medium text-muted-foreground hover:border-primary hover:bg-primary/5 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1514
+ children: [
1515
+ /* @__PURE__ */ jsx18(StudioIcon, { name: "plus" }),
1516
+ addLabel
1517
+ ]
1518
+ }
1519
+ ) })
1520
+ ] });
1521
+ }
1522
+
1523
+ // src/components/studio/StudioCanvas.tsx
1524
+ import * as React18 from "react";
1525
+ import { jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
1526
+ function StudioCanvas({
1527
+ children,
1528
+ deviceToggle = false,
1529
+ device: deviceProp,
1530
+ onDeviceChange,
1531
+ maxWidth = "48rem",
1532
+ toolbar,
1533
+ label = "Canvas",
1534
+ onBackgroundClick,
1535
+ frameClassName,
1536
+ className
1537
+ }) {
1538
+ const studio = useStudio();
1539
+ const [innerDevice, setInnerDevice] = React18.useState("desktop");
1540
+ const device = deviceProp ?? innerDevice;
1541
+ const setDevice = (d) => {
1542
+ if (deviceProp === void 0) setInnerDevice(d);
1543
+ onDeviceChange?.(d);
1544
+ };
1545
+ const showDevices = deviceToggle && studio?.layout !== "compact";
1546
+ const width = device === "phone" && showDevices ? "390px" : maxWidth;
1547
+ return /* @__PURE__ */ jsxs11("section", { "aria-label": label, className: cn("flex h-full flex-col", className), children: [
1548
+ (showDevices || toolbar) && /* @__PURE__ */ jsxs11("div", { className: "flex shrink-0 items-center justify-end gap-2 px-3 pt-3", children: [
1549
+ toolbar,
1550
+ showDevices && /* @__PURE__ */ jsx19(
1551
+ "div",
1552
+ {
1553
+ role: "radiogroup",
1554
+ "aria-label": "Preview size",
1555
+ className: "inline-flex h-9 items-center gap-1 rounded-lg bg-muted p-1 text-muted-foreground",
1556
+ children: ["desktop", "phone"].map((d) => /* @__PURE__ */ jsxs11(
1557
+ "button",
1558
+ {
1559
+ type: "button",
1560
+ role: "radio",
1561
+ "aria-checked": device === d,
1562
+ onClick: () => setDevice(d),
1563
+ className: cn(
1564
+ "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",
1565
+ device === d && "bg-background text-foreground shadow-sm"
1566
+ ),
1567
+ children: [
1568
+ /* @__PURE__ */ jsx19(StudioIcon, { name: d === "desktop" ? "monitor" : "smartphone" }),
1569
+ d === "desktop" ? "Desktop" : "Phone"
1570
+ ]
1571
+ },
1572
+ d
1573
+ ))
1574
+ }
1575
+ )
1576
+ ] }),
1577
+ /* @__PURE__ */ jsx19(
1578
+ "div",
1579
+ {
1580
+ className: "min-h-0 flex-1 overflow-y-auto px-3 pb-20 pt-3 md:px-6 md:pb-10",
1581
+ onClick: (e) => {
1582
+ if (e.target === e.currentTarget) onBackgroundClick?.();
1583
+ },
1584
+ children: /* @__PURE__ */ jsx19(
1585
+ "div",
1586
+ {
1587
+ className: cn(
1588
+ "mx-auto w-full rounded-lg border border-border bg-background shadow-sm transition-[max-width] duration-200",
1589
+ frameClassName
1590
+ ),
1591
+ style: { maxWidth: width },
1592
+ children
1593
+ }
1594
+ )
1595
+ }
1596
+ )
1597
+ ] });
1598
+ }
1599
+
1600
+ // src/components/studio/StudioCanvasItem.tsx
1601
+ import * as React19 from "react";
1602
+ import { jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
1603
+ function StudioCanvasItem({
1604
+ children,
1605
+ selected = false,
1606
+ onSelect,
1607
+ label,
1608
+ toolbar,
1609
+ onInsert,
1610
+ insertLabel,
1611
+ invalid = false,
1612
+ className
1613
+ }) {
1614
+ const studio = useStudio();
1615
+ const ref = React19.useRef(null);
1616
+ const inQuickAction = (target) => !!target?.closest?.("[data-studio-quick-action]");
1617
+ const select = (reveal) => {
1618
+ if (!selected) onSelect?.();
1619
+ if (reveal) studio?.revealInspector();
1620
+ };
1621
+ React19.useEffect(() => {
1622
+ const el = ref.current;
1623
+ if (!selected || !el || el.contains(document.activeElement)) return;
1624
+ const reduce = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
1625
+ el.scrollIntoView?.({ block: "nearest", behavior: reduce ? "auto" : "smooth" });
1626
+ }, [selected]);
1627
+ return /* @__PURE__ */ jsxs12(
1628
+ "div",
1629
+ {
1630
+ ref,
1631
+ role: "group",
1632
+ "aria-label": label,
1633
+ "aria-current": selected ? "true" : void 0,
1634
+ "data-selected": selected || void 0,
1635
+ className: cn(
1636
+ "group/item relative scroll-my-6 rounded-lg transition-shadow",
1637
+ // Problems are a dashed amber outline: with a red brand primary, a red
1638
+ // ring would read as "selected"
1639
+ selected ? "ring-2 ring-primary" : "hover:ring-1 hover:ring-border",
1640
+ invalid && "-outline-offset-2 outline-dashed outline-2 outline-warning/70",
1641
+ className
1642
+ ),
1643
+ onClickCapture: (e) => select(!inQuickAction(e.target)),
1644
+ onFocus: (e) => {
1645
+ if (!inQuickAction(e.target)) select(false);
1646
+ },
1647
+ children: [
1648
+ !selected && /* @__PURE__ */ jsxs12(
1649
+ "button",
1650
+ {
1651
+ type: "button",
1652
+ className: "sr-only left-2 top-2 z-10 rounded-md bg-primary px-2 py-1 text-xs font-medium text-primary-foreground focus:not-sr-only focus:absolute",
1653
+ onClick: () => select(true),
1654
+ children: [
1655
+ "Edit ",
1656
+ label
1657
+ ]
1658
+ }
1659
+ ),
1660
+ selected && toolbar && /* @__PURE__ */ jsx20(
1661
+ "div",
1662
+ {
1663
+ "data-studio-quick-action": "",
1664
+ className: "absolute -top-4 right-3 z-10 flex items-center gap-0.5 rounded-md border border-border bg-background p-0.5 shadow-md",
1665
+ children: toolbar
1666
+ }
1667
+ ),
1668
+ children,
1669
+ onInsert && /* @__PURE__ */ jsx20("div", { className: "relative h-0", "data-studio-quick-action": "", children: /* @__PURE__ */ jsx20(
1670
+ "button",
1671
+ {
1672
+ type: "button",
1673
+ "aria-label": insertLabel ?? `Add below ${label}`,
1674
+ title: insertLabel ?? "Add below",
1675
+ className: cn(
1676
+ "absolute left-1/2 top-0 z-10 flex h-7 w-7 -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-full border border-border bg-background text-muted-foreground opacity-0 shadow-sm hover:border-primary hover:text-primary focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring group-hover/item:opacity-100 [@media(hover:none)]:opacity-100",
1677
+ selected && "opacity-100"
1678
+ ),
1679
+ onClick: (e) => {
1680
+ e.stopPropagation();
1681
+ onInsert();
1682
+ },
1683
+ children: /* @__PURE__ */ jsx20(StudioIcon, { name: "plus", size: 14 })
1684
+ }
1685
+ ) })
1686
+ ]
1687
+ }
1688
+ );
1689
+ }
1690
+
1691
+ // src/components/studio/StudioInspector.tsx
1692
+ import * as React20 from "react";
1693
+ import { jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
1694
+ function StudioInspector({
1695
+ title,
1696
+ description,
1697
+ headerActions,
1698
+ tabs,
1699
+ tab: tabProp,
1700
+ onTabChange,
1701
+ children,
1702
+ footer,
1703
+ className
1704
+ }) {
1705
+ const uid = React20.useId();
1706
+ const [innerTab, setInnerTab] = React20.useState(tabs?.[0]?.id ?? "");
1707
+ const tab = tabProp ?? innerTab;
1708
+ const hasTabs = !!tabs && tabs.length > 1;
1709
+ const choose = (id) => {
1710
+ if (id === tab) return;
1711
+ if (tabProp === void 0) setInnerTab(id);
1712
+ onTabChange?.(id);
1713
+ };
1714
+ const keyDown = (event, index) => {
1715
+ if (!tabs) return;
1716
+ const step = event.key === "ArrowRight" ? 1 : event.key === "ArrowLeft" ? -1 : 0;
1717
+ if (!step) return;
1718
+ event.preventDefault();
1719
+ const next = tabs[(index + step + tabs.length) % tabs.length];
1720
+ choose(next.id);
1721
+ document.getElementById(`${uid}-tab-${next.id}`)?.focus();
1722
+ };
1723
+ return /* @__PURE__ */ jsxs13("div", { className: cn("flex h-full min-h-0 flex-col", className), children: [
1724
+ (title || headerActions) && /* @__PURE__ */ jsxs13("div", { className: "flex shrink-0 items-start gap-2 border-b border-border px-4 py-3", children: [
1725
+ /* @__PURE__ */ jsxs13("div", { className: "min-w-0 flex-1", children: [
1726
+ title && /* @__PURE__ */ jsx21("h2", { className: "truncate text-sm font-semibold", children: title }),
1727
+ description && /* @__PURE__ */ jsx21("p", { className: "truncate text-xs text-muted-foreground", children: description })
1728
+ ] }),
1729
+ headerActions && /* @__PURE__ */ jsx21("div", { className: "flex shrink-0 items-center gap-1", children: headerActions })
1730
+ ] }),
1731
+ hasTabs && /* @__PURE__ */ jsx21(
1732
+ "div",
1733
+ {
1734
+ role: "tablist",
1735
+ "aria-label": title ?? "Inspector",
1736
+ className: "flex shrink-0 gap-4 border-b border-border px-4",
1737
+ children: tabs.map((t, index) => /* @__PURE__ */ jsxs13(
1738
+ "button",
1739
+ {
1740
+ type: "button",
1741
+ role: "tab",
1742
+ id: `${uid}-tab-${t.id}`,
1743
+ "aria-selected": t.id === tab,
1744
+ "aria-controls": `${uid}-panel`,
1745
+ tabIndex: t.id === tab ? 0 : -1,
1746
+ onClick: () => choose(t.id),
1747
+ onKeyDown: (e) => keyDown(e, index),
1748
+ className: cn(
1749
+ "-mb-px border-b-2 py-2 text-sm font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1750
+ t.id === tab ? "border-primary text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"
1751
+ ),
1752
+ children: [
1753
+ t.label,
1754
+ !!t.count && /* @__PURE__ */ jsx21("span", { className: "ml-1 rounded-full bg-muted px-1.5 text-xs tabular-nums", children: t.count })
1755
+ ]
1756
+ },
1757
+ t.id
1758
+ ))
1759
+ }
1760
+ ),
1761
+ /* @__PURE__ */ jsx21(
1762
+ "div",
1763
+ {
1764
+ className: "min-h-0 flex-1 overflow-y-auto",
1765
+ id: hasTabs ? `${uid}-panel` : void 0,
1766
+ role: hasTabs ? "tabpanel" : void 0,
1767
+ "aria-labelledby": hasTabs ? `${uid}-tab-${tab}` : void 0,
1768
+ children
1769
+ }
1770
+ ),
1771
+ footer && /* @__PURE__ */ jsx21("div", { className: "shrink-0 border-t border-border px-4 py-3", children: footer })
1772
+ ] });
1773
+ }
1774
+ function StudioInspectorSection({
1775
+ title,
1776
+ description,
1777
+ collapsible = false,
1778
+ defaultOpen = false,
1779
+ summary,
1780
+ children,
1781
+ className
1782
+ }) {
1783
+ const uid = React20.useId();
1784
+ const [open, setOpen] = React20.useState(defaultOpen);
1785
+ const expanded = !collapsible || open;
1786
+ return /* @__PURE__ */ jsxs13(
1787
+ "section",
1788
+ {
1789
+ className: cn("border-b border-border px-4 py-4 last:border-b-0", className),
1790
+ "aria-labelledby": title ? `${uid}-title` : void 0,
1791
+ children: [
1792
+ title && (collapsible ? /* @__PURE__ */ jsx21("h3", { id: `${uid}-title`, className: "-my-1", children: /* @__PURE__ */ jsxs13(
1793
+ "button",
1794
+ {
1795
+ type: "button",
1796
+ "aria-expanded": open,
1797
+ "aria-controls": `${uid}-body`,
1798
+ onClick: () => setOpen(!open),
1799
+ className: "flex w-full items-center gap-2 rounded-md py-1 text-left text-sm font-semibold focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1800
+ children: [
1801
+ /* @__PURE__ */ jsx21(
1802
+ StudioIcon,
1803
+ {
1804
+ name: "chevron-right",
1805
+ className: cn("text-muted-foreground transition-transform", open && "rotate-90")
1806
+ }
1807
+ ),
1808
+ /* @__PURE__ */ jsx21("span", { className: "flex-1", children: title }),
1809
+ summary && !open && /* @__PURE__ */ jsx21("span", { className: "text-xs font-normal text-muted-foreground", children: summary })
1810
+ ]
1811
+ }
1812
+ ) }) : /* @__PURE__ */ jsx21("h3", { id: `${uid}-title`, className: "text-sm font-semibold", children: title })),
1813
+ title && description && expanded && /* @__PURE__ */ jsx21("p", { className: "mt-1 text-xs text-muted-foreground", children: description }),
1814
+ expanded && /* @__PURE__ */ jsx21("div", { id: `${uid}-body`, className: cn("space-y-4", title && "mt-3"), children })
1815
+ ]
1816
+ }
1817
+ );
1818
+ }
1819
+ function StudioPage({
1820
+ title,
1821
+ description,
1822
+ children,
1823
+ maxWidth = "42rem",
1824
+ className
1825
+ }) {
1826
+ return /* @__PURE__ */ jsx21("div", { className: "h-full overflow-y-auto bg-muted/40", children: /* @__PURE__ */ jsxs13(
1827
+ "div",
1828
+ {
1829
+ className: cn("mx-auto w-full space-y-6 px-4 py-6 md:py-10", className),
1830
+ style: { maxWidth },
1831
+ children: [
1832
+ (title || description) && /* @__PURE__ */ jsxs13("div", { children: [
1833
+ title && /* @__PURE__ */ jsx21("h2", { className: "text-xl font-semibold", children: title }),
1834
+ description && /* @__PURE__ */ jsx21("p", { className: "mt-1 text-sm text-muted-foreground", children: description })
1835
+ ] }),
1836
+ children
1837
+ ]
1838
+ }
1839
+ ) });
1840
+ }
1841
+
1842
+ // src/components/studio/SaveStatus.tsx
1843
+ import * as PopoverPrimitive from "@radix-ui/react-popover";
1844
+ import { Fragment as Fragment3, jsx as jsx22, jsxs as jsxs14 } from "react/jsx-runtime";
1845
+ var META = {
1846
+ saved: { label: "Saved", icon: "check-circle", tone: "text-muted-foreground" },
1847
+ saving: { label: "Saving\u2026", icon: "loader", tone: "text-muted-foreground" },
1848
+ unsaved: { label: "Unsaved", icon: "edit", tone: "text-muted-foreground" },
1849
+ error: { label: "Not saved", icon: "alert-circle", tone: "text-destructive" },
1850
+ offline: { label: "Offline", icon: "wifi-off", tone: "text-warning" },
1851
+ conflict: { label: "Conflict", icon: "alert-triangle", tone: "text-destructive" },
1852
+ invalid: { label: "Needs fixes", icon: "alert-triangle", tone: "text-warning" },
1853
+ readonly: { label: "View only", icon: "eye", tone: "text-muted-foreground" }
1854
+ };
1855
+ var chip = "inline-flex h-8 items-center gap-1.5 rounded-md px-2 text-sm font-medium text-foreground";
1856
+ function SaveStatus({ state, detail, onRetry, label, className }) {
1857
+ const meta = META[state];
1858
+ const text = label ?? meta.label;
1859
+ const canRetry = !!onRetry && (state === "error" || state === "offline");
1860
+ const announced = ["error", "offline", "conflict", "invalid"].includes(state);
1861
+ const content = /* @__PURE__ */ jsxs14(Fragment3, { children: [
1862
+ /* @__PURE__ */ jsx22(
1863
+ StudioIcon,
1864
+ {
1865
+ name: meta.icon,
1866
+ className: cn(meta.tone, state === "saving" && "animate-spin")
1867
+ }
1868
+ ),
1869
+ /* @__PURE__ */ jsx22("span", { className: "sr-only sm:not-sr-only", children: text })
1870
+ ] });
1871
+ return /* @__PURE__ */ jsxs14("div", { className: cn("inline-flex", className), children: [
1872
+ detail || canRetry ? /* @__PURE__ */ jsxs14(PopoverPrimitive.Root, { children: [
1873
+ /* @__PURE__ */ jsxs14(
1874
+ PopoverPrimitive.Trigger,
1875
+ {
1876
+ className: cn(
1877
+ chip,
1878
+ "hover:bg-muted-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
1879
+ ),
1880
+ "aria-label": `Save status: ${text}. Show details`,
1881
+ children: [
1882
+ content,
1883
+ /* @__PURE__ */ jsx22(StudioIcon, { name: "chevron-down", size: 14, className: "text-muted-foreground" })
1884
+ ]
1885
+ }
1886
+ ),
1887
+ /* @__PURE__ */ jsx22(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsxs14(
1888
+ PopoverPrimitive.Content,
1889
+ {
1890
+ align: "end",
1891
+ sideOffset: 6,
1892
+ collisionPadding: 8,
1893
+ className: "z-50 w-72 rounded-md border border-border bg-popover p-3 text-sm text-popover-foreground shadow-md",
1894
+ children: [
1895
+ /* @__PURE__ */ jsx22("p", { className: "font-medium", children: text }),
1896
+ detail && /* @__PURE__ */ jsx22("p", { className: "mt-1 text-muted-foreground", children: detail }),
1897
+ canRetry && /* @__PURE__ */ jsxs14(
1898
+ "button",
1899
+ {
1900
+ type: "button",
1901
+ onClick: onRetry,
1902
+ className: "mt-3 inline-flex h-9 items-center gap-2 rounded-md border-2 border-secondary-border bg-secondary px-3 text-sm font-medium text-secondary-foreground hover:bg-secondary-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1903
+ children: [
1904
+ /* @__PURE__ */ jsx22(StudioIcon, { name: "refresh", size: 14 }),
1905
+ "Retry"
1906
+ ]
1907
+ }
1908
+ )
1909
+ ]
1910
+ }
1911
+ ) })
1912
+ ] }) : /* @__PURE__ */ jsx22("span", { className: chip, children: content }),
1913
+ /* @__PURE__ */ jsx22("span", { className: "sr-only", role: "status", "aria-live": "polite", children: announced ? text : "" })
1914
+ ] });
1915
+ }
1916
+
1917
+ // src/components/studio/IssuesButton.tsx
1918
+ import * as React21 from "react";
1919
+ import * as PopoverPrimitive2 from "@radix-ui/react-popover";
1920
+ import { Fragment as Fragment4, jsx as jsx23, jsxs as jsxs15 } from "react/jsx-runtime";
1921
+ var plural = (n, one, many) => `${n} ${n === 1 ? one : many}`;
1922
+ function IssuesButton({
1923
+ issues,
1924
+ onSelect,
1925
+ open: openProp,
1926
+ onOpenChange,
1927
+ title = "Before you publish",
1928
+ showWhenEmpty = false,
1929
+ className
1930
+ }) {
1931
+ const [innerOpen, setInnerOpen] = React21.useState(false);
1932
+ const open = openProp ?? innerOpen;
1933
+ const setOpen = (next) => {
1934
+ if (openProp === void 0) setInnerOpen(next);
1935
+ onOpenChange?.(next);
1936
+ };
1937
+ const errors = issues.filter((i) => (i.severity ?? "error") === "error");
1938
+ const warnings = issues.filter((i) => i.severity === "warning");
1939
+ const countLabel = [
1940
+ errors.length ? `${plural(errors.length, "issue", "issues")} to fix` : "",
1941
+ warnings.length ? plural(warnings.length, "suggestion", "suggestions") : ""
1942
+ ].filter(Boolean).join(", ");
1943
+ if (issues.length === 0) {
1944
+ return showWhenEmpty ? /* @__PURE__ */ jsxs15(
1945
+ "span",
1946
+ {
1947
+ className: cn(
1948
+ "inline-flex h-8 items-center gap-1.5 px-2 text-sm text-muted-foreground",
1949
+ className
1950
+ ),
1951
+ children: [
1952
+ /* @__PURE__ */ jsx23(StudioIcon, { name: "check-circle", className: "text-success" }),
1953
+ /* @__PURE__ */ jsx23("span", { className: "sr-only sm:not-sr-only", children: "No issues" })
1954
+ ]
1955
+ }
1956
+ ) : null;
1957
+ }
1958
+ const group = (list, heading, error) => list.length > 0 && /* @__PURE__ */ jsxs15(Fragment4, { children: [
1959
+ /* @__PURE__ */ jsx23("p", { className: "px-3 pb-1 pt-2 text-xs font-medium uppercase tracking-wide text-muted-foreground", children: heading }),
1960
+ /* @__PURE__ */ jsx23("ul", { className: "pb-1", children: list.map((issue) => /* @__PURE__ */ jsx23("li", { children: /* @__PURE__ */ jsxs15(
1961
+ "button",
1962
+ {
1963
+ type: "button",
1964
+ className: "flex w-full items-start gap-2 px-3 py-2 text-left text-sm hover:bg-muted-hover focus-visible:bg-muted-hover focus-visible:outline-none",
1965
+ onClick: () => {
1966
+ setOpen(false);
1967
+ onSelect?.(issue);
1968
+ },
1969
+ children: [
1970
+ /* @__PURE__ */ jsx23(
1971
+ StudioIcon,
1972
+ {
1973
+ name: error ? "alert-circle" : "info",
1974
+ className: cn("mt-0.5", error ? "text-destructive" : "text-warning")
1975
+ }
1976
+ ),
1977
+ /* @__PURE__ */ jsxs15("span", { className: "min-w-0 flex-1", children: [
1978
+ issue.location && /* @__PURE__ */ jsx23("span", { className: "block text-xs text-muted-foreground", children: issue.location }),
1979
+ issue.message
1980
+ ] })
1981
+ ]
1982
+ }
1983
+ ) }, issue.id)) })
1984
+ ] });
1985
+ return /* @__PURE__ */ jsxs15(PopoverPrimitive2.Root, { open, onOpenChange: setOpen, children: [
1986
+ /* @__PURE__ */ jsxs15(
1987
+ PopoverPrimitive2.Trigger,
1988
+ {
1989
+ "aria-label": countLabel,
1990
+ className: cn(
1991
+ "inline-flex h-8 items-center gap-1.5 rounded-md px-2 text-sm font-medium hover:bg-muted-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1992
+ className
1993
+ ),
1994
+ children: [
1995
+ /* @__PURE__ */ jsx23(
1996
+ StudioIcon,
1997
+ {
1998
+ name: "alert-triangle",
1999
+ className: errors.length ? "text-destructive" : "text-warning"
2000
+ }
2001
+ ),
2002
+ /* @__PURE__ */ jsx23("span", { "aria-hidden": "true", children: issues.length })
2003
+ ]
2004
+ }
2005
+ ),
2006
+ /* @__PURE__ */ jsx23(PopoverPrimitive2.Portal, { children: /* @__PURE__ */ jsxs15(
2007
+ PopoverPrimitive2.Content,
2008
+ {
2009
+ align: "end",
2010
+ sideOffset: 6,
2011
+ collisionPadding: 8,
2012
+ className: "z-50 flex max-h-[min(28rem,70dvh)] w-80 flex-col overflow-hidden rounded-md border border-border bg-popover text-popover-foreground shadow-md",
2013
+ children: [
2014
+ /* @__PURE__ */ jsxs15("div", { className: "border-b border-border px-3 py-2", children: [
2015
+ /* @__PURE__ */ jsx23("p", { className: "text-sm font-semibold", children: title }),
2016
+ /* @__PURE__ */ jsx23("p", { className: "text-xs text-muted-foreground", children: countLabel })
2017
+ ] }),
2018
+ /* @__PURE__ */ jsxs15("div", { className: "overflow-y-auto", children: [
2019
+ group(errors, "Must fix", true),
2020
+ group(warnings, "Suggestions", false)
2021
+ ] })
2022
+ ]
2023
+ }
2024
+ ) })
2025
+ ] });
2026
+ }
2027
+
2028
+ // src/components/studio/InsertPalette.tsx
2029
+ import * as React22 from "react";
2030
+ import { jsx as jsx24, jsxs as jsxs16 } from "react/jsx-runtime";
2031
+ function InsertPalette({
2032
+ open,
2033
+ onOpenChange,
2034
+ groups,
2035
+ onSelect,
2036
+ title = "Add",
2037
+ description,
2038
+ searchPlaceholder = "Search",
2039
+ renderThumbnail
2040
+ }) {
2041
+ const [query, setQuery] = React22.useState("");
2042
+ const listRef = React22.useRef(null);
2043
+ const searchRef = React22.useRef(null);
2044
+ React22.useEffect(() => {
2045
+ if (open) setQuery("");
2046
+ }, [open]);
2047
+ const q = query.trim().toLowerCase();
2048
+ const filtered = q ? groups.map((g) => ({
2049
+ ...g,
2050
+ items: g.items.filter(
2051
+ (item) => [item.label, item.description ?? "", ...item.keywords ?? []].some(
2052
+ (t) => t.toLowerCase().includes(q)
2053
+ )
2054
+ )
2055
+ })).filter((g) => g.items.length > 0) : groups;
2056
+ const firstMatch = filtered.flatMap((g) => g.items).find((i) => !i.disabled);
2057
+ const choose = (item) => {
2058
+ if (item.disabled) return;
2059
+ onOpenChange(false);
2060
+ onSelect(item.id);
2061
+ };
2062
+ const entries = () => Array.from(listRef.current?.querySelectorAll("[data-palette-item]") ?? []);
2063
+ return /* @__PURE__ */ jsx24(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs16(
2064
+ DialogContent,
2065
+ {
2066
+ size: renderThumbnail ? "2xl" : "xl",
2067
+ className: "max-h-[calc(100dvh-2rem)] overflow-y-auto",
2068
+ onOpenAutoFocus: (e) => {
2069
+ e.preventDefault();
2070
+ searchRef.current?.focus();
2071
+ },
2072
+ ...description ? {} : { "aria-describedby": void 0 },
2073
+ children: [
2074
+ /* @__PURE__ */ jsx24(DialogTitle, { children: title }),
2075
+ description && /* @__PURE__ */ jsx24(DialogDescription, { children: description }),
2076
+ /* @__PURE__ */ jsxs16("div", { className: "relative", children: [
2077
+ /* @__PURE__ */ jsx24(
2078
+ StudioIcon,
2079
+ {
2080
+ name: "search",
2081
+ className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"
2082
+ }
2083
+ ),
2084
+ /* @__PURE__ */ jsx24(
2085
+ "input",
2086
+ {
2087
+ ref: searchRef,
2088
+ type: "search",
2089
+ value: query,
2090
+ onChange: (e) => setQuery(e.target.value),
2091
+ "aria-label": searchPlaceholder,
2092
+ placeholder: searchPlaceholder,
2093
+ className: "h-10 w-full rounded-md border border-input bg-background pl-9 pr-3 text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
2094
+ onKeyDown: (e) => {
2095
+ if (e.key === "Enter" && firstMatch) {
2096
+ e.preventDefault();
2097
+ choose(firstMatch);
2098
+ } else if (e.key === "ArrowDown") {
2099
+ e.preventDefault();
2100
+ entries()[0]?.focus();
2101
+ }
2102
+ }
2103
+ }
2104
+ )
2105
+ ] }),
2106
+ /* @__PURE__ */ jsxs16("div", { ref: listRef, className: "space-y-5", children: [
2107
+ filtered.length === 0 && /* @__PURE__ */ jsxs16("p", { className: "py-8 text-center text-sm text-muted-foreground", children: [
2108
+ "Nothing matches \u201C",
2109
+ query,
2110
+ "\u201D."
2111
+ ] }),
2112
+ filtered.map((group) => /* @__PURE__ */ jsxs16("section", { "aria-label": group.label, children: [
2113
+ /* @__PURE__ */ jsx24("h3", { className: "mb-2 text-xs font-medium uppercase tracking-wide text-muted-foreground", children: group.label }),
2114
+ /* @__PURE__ */ jsx24(
2115
+ "ul",
2116
+ {
2117
+ className: cn(
2118
+ "grid gap-2",
2119
+ renderThumbnail ? "grid-cols-2 sm:grid-cols-3" : "grid-cols-1 sm:grid-cols-2"
2120
+ ),
2121
+ children: group.items.map((item) => /* @__PURE__ */ jsx24("li", { children: /* @__PURE__ */ jsxs16(
2122
+ "button",
2123
+ {
2124
+ type: "button",
2125
+ "data-palette-item": "",
2126
+ disabled: item.disabled,
2127
+ onClick: () => choose(item),
2128
+ onKeyDown: (e) => {
2129
+ const all = entries();
2130
+ const index = all.indexOf(e.currentTarget);
2131
+ const step = e.key === "ArrowDown" || e.key === "ArrowRight" ? 1 : e.key === "ArrowUp" || e.key === "ArrowLeft" ? -1 : 0;
2132
+ if (!step) return;
2133
+ e.preventDefault();
2134
+ const next = index + step;
2135
+ if (next < 0) searchRef.current?.focus();
2136
+ else all[Math.min(next, all.length - 1)]?.focus();
2137
+ },
2138
+ className: cn(
2139
+ "flex h-full w-full gap-3 rounded-md border border-border p-3 text-left hover:border-primary hover:bg-primary/5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
2140
+ renderThumbnail ? "flex-col" : "items-start"
2141
+ ),
2142
+ children: [
2143
+ renderThumbnail ? /* @__PURE__ */ jsx24("span", { className: "block overflow-hidden rounded border border-border bg-muted", children: renderThumbnail(item) }) : item.icon && /* @__PURE__ */ jsx24(
2144
+ "span",
2145
+ {
2146
+ className: "flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-muted text-foreground",
2147
+ "aria-hidden": "true",
2148
+ children: item.icon
2149
+ }
2150
+ ),
2151
+ /* @__PURE__ */ jsxs16("span", { className: "min-w-0", children: [
2152
+ /* @__PURE__ */ jsx24("span", { className: "block text-sm font-medium", children: item.label }),
2153
+ item.description && /* @__PURE__ */ jsx24("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: item.description })
2154
+ ] })
2155
+ ]
2156
+ }
2157
+ ) }, item.id))
2158
+ }
2159
+ )
2160
+ ] }, group.label))
2161
+ ] })
2162
+ ]
2163
+ }
2164
+ ) });
2165
+ }
2166
+
2167
+ // src/components/DataPanel.tsx
2168
+ import * as React24 from "react";
2169
+ import * as DropdownMenuPrimitive2 from "@radix-ui/react-dropdown-menu";
680
2170
 
681
2171
  // src/hooks/useFocusTrap.ts
682
- import { useEffect as useEffect2, useRef as useRef2, useCallback as useCallback2 } from "react";
2172
+ import { useEffect as useEffect7, useRef as useRef7, useCallback as useCallback3 } from "react";
683
2173
  var FOCUSABLE_SELECTOR = [
684
2174
  "a[href]",
685
2175
  "area[href]",
@@ -701,9 +2191,9 @@ function getFocusableElements(container) {
701
2191
  }
702
2192
  function useFocusTrap(options = {}) {
703
2193
  const { active = true, returnFocusTo, initialFocus, preventScroll = false } = options;
704
- const containerRef = useRef2(null);
705
- const previousActiveElementRef = useRef2(null);
706
- const handleKeyDown = useCallback2(
2194
+ const containerRef = useRef7(null);
2195
+ const previousActiveElementRef = useRef7(null);
2196
+ const handleKeyDown = useCallback3(
707
2197
  (event) => {
708
2198
  if (!active || event.key !== "Tab") return;
709
2199
  const container = containerRef.current;
@@ -726,7 +2216,7 @@ function useFocusTrap(options = {}) {
726
2216
  },
727
2217
  [active, preventScroll]
728
2218
  );
729
- useEffect2(() => {
2219
+ useEffect7(() => {
730
2220
  if (!active) return;
731
2221
  const container = containerRef.current;
732
2222
  if (!container) return;
@@ -757,14 +2247,14 @@ function useFocusTrap(options = {}) {
757
2247
  }
758
2248
 
759
2249
  // src/hooks/useEscapeKey.ts
760
- import * as React13 from "react";
2250
+ import * as React23 from "react";
761
2251
  function useEscapeKey(callback, options) {
762
2252
  const { enabled = true, preventDefault = true, stopPropagation = false } = options ?? {};
763
- const callbackRef = React13.useRef(callback);
764
- React13.useEffect(() => {
2253
+ const callbackRef = React23.useRef(callback);
2254
+ React23.useEffect(() => {
765
2255
  callbackRef.current = callback;
766
2256
  }, [callback]);
767
- React13.useEffect(() => {
2257
+ React23.useEffect(() => {
768
2258
  if (!enabled) return;
769
2259
  const handleKeyDown = (event) => {
770
2260
  if (event.key === "Escape") {
@@ -819,15 +2309,15 @@ import {
819
2309
  calculateDetachedPositionFromPinned,
820
2310
  getPinnedPullTransform
821
2311
  } from "@classic-homes/data-panel-core";
822
- import { Fragment, jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
2312
+ import { Fragment as Fragment5, jsx as jsx25, jsxs as jsxs17 } from "react/jsx-runtime";
823
2313
  function layoutViewportWidth() {
824
2314
  return document.documentElement.clientWidth;
825
2315
  }
826
- var DropdownTrigger = DropdownMenuPrimitive.Trigger;
827
- var DropdownContent = DropdownMenuPrimitive.Content;
828
- var DropdownLabel = DropdownMenuPrimitive.Label;
829
- var DropdownItem = DropdownMenuPrimitive.Item;
830
- var DropdownSeparator = DropdownMenuPrimitive.Separator;
2316
+ var DropdownTrigger = DropdownMenuPrimitive2.Trigger;
2317
+ var DropdownContent = DropdownMenuPrimitive2.Content;
2318
+ var DropdownLabel = DropdownMenuPrimitive2.Label;
2319
+ var DropdownItem = DropdownMenuPrimitive2.Item;
2320
+ var DropdownSeparator = DropdownMenuPrimitive2.Separator;
831
2321
  function useDataPanel(options = {}) {
832
2322
  const {
833
2323
  persistKey,
@@ -837,28 +2327,28 @@ function useDataPanel(options = {}) {
837
2327
  constraints = {}
838
2328
  } = options;
839
2329
  const resolvedConstraints = { ...DEFAULT_CONSTRAINTS, ...constraints };
840
- const [persistedState] = React14.useState(() => {
2330
+ const [persistedState] = React24.useState(() => {
841
2331
  if (persistKey && typeof window !== "undefined") {
842
2332
  return loadPanelState(persistKey);
843
2333
  }
844
2334
  return null;
845
2335
  });
846
- const [mode, setMode] = React14.useState(persistedState?.mode ?? initialMode);
847
- const [edge, setEdge] = React14.useState(persistedState?.edge ?? initialEdge);
848
- const [isExpanded, setIsExpanded] = React14.useState(
2336
+ const [mode, setMode] = React24.useState(persistedState?.mode ?? initialMode);
2337
+ const [edge, setEdge] = React24.useState(persistedState?.edge ?? initialEdge);
2338
+ const [isExpanded, setIsExpanded] = React24.useState(
849
2339
  persistedState?.isExpanded ?? initialExpanded
850
2340
  );
851
- const [detachedPosition, setDetachedPosition] = React14.useState(
2341
+ const [detachedPosition, setDetachedPosition] = React24.useState(
852
2342
  persistedState?.detachedPosition ?? DEFAULT_PANEL_STATE.detachedPosition
853
2343
  );
854
- const [detachedSize, setDetachedSize] = React14.useState(
2344
+ const [detachedSize, setDetachedSize] = React24.useState(
855
2345
  persistedState?.detachedSize ?? DEFAULT_PANEL_STATE.detachedSize
856
2346
  );
857
- const [pinnedSize, setPinnedSize] = React14.useState(
2347
+ const [pinnedSize, setPinnedSize] = React24.useState(
858
2348
  persistedState?.pinnedSize ?? DEFAULT_PANEL_STATE.pinnedSize
859
2349
  );
860
- const saveTimeoutRef = React14.useRef(null);
861
- const debouncedSave = React14.useCallback(() => {
2350
+ const saveTimeoutRef = React24.useRef(null);
2351
+ const debouncedSave = React24.useCallback(() => {
862
2352
  if (!persistKey) return;
863
2353
  if (saveTimeoutRef.current) {
864
2354
  clearTimeout(saveTimeoutRef.current);
@@ -877,7 +2367,7 @@ function useDataPanel(options = {}) {
877
2367
  });
878
2368
  }, 300);
879
2369
  }, [persistKey, mode, edge, isExpanded, detachedPosition, detachedSize, pinnedSize]);
880
- const handleSetMode = React14.useCallback(
2370
+ const handleSetMode = React24.useCallback(
881
2371
  (newMode) => {
882
2372
  setMode(newMode);
883
2373
  if (newMode === "detached" && typeof window !== "undefined" && detachedPosition.x === DEFAULT_PANEL_STATE.detachedPosition.x && detachedPosition.y === DEFAULT_PANEL_STATE.detachedPosition.y) {
@@ -888,7 +2378,7 @@ function useDataPanel(options = {}) {
888
2378
  },
889
2379
  [detachedPosition, detachedSize]
890
2380
  );
891
- const handleSetDetachedPosition = React14.useCallback(
2381
+ const handleSetDetachedPosition = React24.useCallback(
892
2382
  (position) => {
893
2383
  if (typeof window === "undefined") {
894
2384
  setDetachedPosition(position);
@@ -900,13 +2390,13 @@ function useDataPanel(options = {}) {
900
2390
  },
901
2391
  [detachedSize]
902
2392
  );
903
- const handleSetDetachedSize = React14.useCallback(
2393
+ const handleSetDetachedSize = React24.useCallback(
904
2394
  (size) => {
905
2395
  setDetachedSize(constrainSize(size, resolvedConstraints));
906
2396
  },
907
2397
  [resolvedConstraints]
908
2398
  );
909
- const handleSetPinnedSize = React14.useCallback(
2399
+ const handleSetPinnedSize = React24.useCallback(
910
2400
  (size) => {
911
2401
  if (typeof window === "undefined") {
912
2402
  setPinnedSize(size);
@@ -920,7 +2410,7 @@ function useDataPanel(options = {}) {
920
2410
  },
921
2411
  [edge, resolvedConstraints]
922
2412
  );
923
- React14.useEffect(() => {
2413
+ React24.useEffect(() => {
924
2414
  debouncedSave();
925
2415
  }, [debouncedSave]);
926
2416
  return {
@@ -938,7 +2428,7 @@ function useDataPanel(options = {}) {
938
2428
  setPinnedSize: handleSetPinnedSize
939
2429
  };
940
2430
  }
941
- var ChevronUpIcon = () => /* @__PURE__ */ jsx12(
2431
+ var ChevronUpIcon = () => /* @__PURE__ */ jsx25(
942
2432
  "svg",
943
2433
  {
944
2434
  xmlns: "http://www.w3.org/2000/svg",
@@ -950,10 +2440,10 @@ var ChevronUpIcon = () => /* @__PURE__ */ jsx12(
950
2440
  strokeWidth: "2",
951
2441
  strokeLinecap: "round",
952
2442
  strokeLinejoin: "round",
953
- children: /* @__PURE__ */ jsx12("path", { d: "m18 15-6-6-6 6" })
2443
+ children: /* @__PURE__ */ jsx25("path", { d: "m18 15-6-6-6 6" })
954
2444
  }
955
2445
  );
956
- var MoreVerticalIcon = () => /* @__PURE__ */ jsxs5(
2446
+ var MoreVerticalIcon = () => /* @__PURE__ */ jsxs17(
957
2447
  "svg",
958
2448
  {
959
2449
  xmlns: "http://www.w3.org/2000/svg",
@@ -966,13 +2456,13 @@ var MoreVerticalIcon = () => /* @__PURE__ */ jsxs5(
966
2456
  strokeLinecap: "round",
967
2457
  strokeLinejoin: "round",
968
2458
  children: [
969
- /* @__PURE__ */ jsx12("circle", { cx: "12", cy: "12", r: "1" }),
970
- /* @__PURE__ */ jsx12("circle", { cx: "12", cy: "5", r: "1" }),
971
- /* @__PURE__ */ jsx12("circle", { cx: "12", cy: "19", r: "1" })
2459
+ /* @__PURE__ */ jsx25("circle", { cx: "12", cy: "12", r: "1" }),
2460
+ /* @__PURE__ */ jsx25("circle", { cx: "12", cy: "5", r: "1" }),
2461
+ /* @__PURE__ */ jsx25("circle", { cx: "12", cy: "19", r: "1" })
972
2462
  ]
973
2463
  }
974
2464
  );
975
- var CloseIcon = () => /* @__PURE__ */ jsxs5(
2465
+ var CloseIcon = () => /* @__PURE__ */ jsxs17(
976
2466
  "svg",
977
2467
  {
978
2468
  xmlns: "http://www.w3.org/2000/svg",
@@ -985,12 +2475,12 @@ var CloseIcon = () => /* @__PURE__ */ jsxs5(
985
2475
  strokeLinecap: "round",
986
2476
  strokeLinejoin: "round",
987
2477
  children: [
988
- /* @__PURE__ */ jsx12("path", { d: "M18 6 6 18" }),
989
- /* @__PURE__ */ jsx12("path", { d: "m6 6 12 12" })
2478
+ /* @__PURE__ */ jsx25("path", { d: "M18 6 6 18" }),
2479
+ /* @__PURE__ */ jsx25("path", { d: "m6 6 12 12" })
990
2480
  ]
991
2481
  }
992
2482
  );
993
- var GripIcon = () => /* @__PURE__ */ jsxs5(
2483
+ var GripIcon = () => /* @__PURE__ */ jsxs17(
994
2484
  "svg",
995
2485
  {
996
2486
  xmlns: "http://www.w3.org/2000/svg",
@@ -999,12 +2489,12 @@ var GripIcon = () => /* @__PURE__ */ jsxs5(
999
2489
  viewBox: "0 0 24 24",
1000
2490
  fill: "currentColor",
1001
2491
  children: [
1002
- /* @__PURE__ */ jsx12("circle", { cx: "9", cy: "6", r: "1.5" }),
1003
- /* @__PURE__ */ jsx12("circle", { cx: "15", cy: "6", r: "1.5" }),
1004
- /* @__PURE__ */ jsx12("circle", { cx: "9", cy: "12", r: "1.5" }),
1005
- /* @__PURE__ */ jsx12("circle", { cx: "15", cy: "12", r: "1.5" }),
1006
- /* @__PURE__ */ jsx12("circle", { cx: "9", cy: "18", r: "1.5" }),
1007
- /* @__PURE__ */ jsx12("circle", { cx: "15", cy: "18", r: "1.5" })
2492
+ /* @__PURE__ */ jsx25("circle", { cx: "9", cy: "6", r: "1.5" }),
2493
+ /* @__PURE__ */ jsx25("circle", { cx: "15", cy: "6", r: "1.5" }),
2494
+ /* @__PURE__ */ jsx25("circle", { cx: "9", cy: "12", r: "1.5" }),
2495
+ /* @__PURE__ */ jsx25("circle", { cx: "15", cy: "12", r: "1.5" }),
2496
+ /* @__PURE__ */ jsx25("circle", { cx: "9", cy: "18", r: "1.5" }),
2497
+ /* @__PURE__ */ jsx25("circle", { cx: "15", cy: "18", r: "1.5" })
1008
2498
  ]
1009
2499
  }
1010
2500
  );
@@ -1014,7 +2504,7 @@ var edgeLabels = {
1014
2504
  top: "Pin to top",
1015
2505
  bottom: "Pin to bottom"
1016
2506
  };
1017
- var DataPanelHeader = React14.forwardRef(
2507
+ var DataPanelHeader = React24.forwardRef(
1018
2508
  ({
1019
2509
  title,
1020
2510
  subtitle,
@@ -1033,7 +2523,7 @@ var DataPanelHeader = React14.forwardRef(
1033
2523
  className,
1034
2524
  draggable = false
1035
2525
  }, ref) => {
1036
- return /* @__PURE__ */ jsxs5(
2526
+ return /* @__PURE__ */ jsxs17(
1037
2527
  "div",
1038
2528
  {
1039
2529
  ref,
@@ -1044,13 +2534,13 @@ var DataPanelHeader = React14.forwardRef(
1044
2534
  ),
1045
2535
  "data-panel-header": true,
1046
2536
  children: [
1047
- /* @__PURE__ */ jsx12("div", { className: "flex flex-col min-w-0 flex-1", children: headerContent ? headerContent : /* @__PURE__ */ jsxs5(Fragment, { children: [
1048
- title && /* @__PURE__ */ jsx12("h3", { id: titleId, className: "text-sm font-semibold leading-none truncate", children: title }),
1049
- subtitle && /* @__PURE__ */ jsx12("p", { className: "text-xs text-muted-foreground mt-1 truncate", children: subtitle })
2537
+ /* @__PURE__ */ jsx25("div", { className: "flex flex-col min-w-0 flex-1", children: headerContent ? headerContent : /* @__PURE__ */ jsxs17(Fragment5, { children: [
2538
+ title && /* @__PURE__ */ jsx25("h3", { id: titleId, className: "text-sm font-semibold leading-none truncate", children: title }),
2539
+ subtitle && /* @__PURE__ */ jsx25("p", { className: "text-xs text-muted-foreground mt-1 truncate", children: subtitle })
1050
2540
  ] }) }),
1051
- /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-1 shrink-0", children: [
2541
+ /* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-1 shrink-0", children: [
1052
2542
  headerActions,
1053
- /* @__PURE__ */ jsx12(
2543
+ /* @__PURE__ */ jsx25(
1054
2544
  "button",
1055
2545
  {
1056
2546
  type: "button",
@@ -1065,37 +2555,37 @@ var DataPanelHeader = React14.forwardRef(
1065
2555
  },
1066
2556
  "aria-label": isExpanded ? "Collapse panel" : "Expand panel",
1067
2557
  "aria-expanded": isExpanded,
1068
- children: /* @__PURE__ */ jsx12(
2558
+ children: /* @__PURE__ */ jsx25(
1069
2559
  "span",
1070
2560
  {
1071
2561
  className: cn(
1072
2562
  "transition-transform",
1073
2563
  { top: "", bottom: "rotate-180", left: "-rotate-90", right: "rotate-90" }[edge]
1074
2564
  ),
1075
- children: /* @__PURE__ */ jsx12(ChevronUpIcon, {})
2565
+ children: /* @__PURE__ */ jsx25(ChevronUpIcon, {})
1076
2566
  }
1077
2567
  )
1078
2568
  }
1079
2569
  ),
1080
- !disableModeSwitch && /* @__PURE__ */ jsxs5(DropdownMenuPrimitive.Root, { children: [
1081
- /* @__PURE__ */ jsx12(DropdownTrigger, { asChild: true, children: /* @__PURE__ */ jsx12(
2570
+ !disableModeSwitch && /* @__PURE__ */ jsxs17(DropdownMenuPrimitive2.Root, { children: [
2571
+ /* @__PURE__ */ jsx25(DropdownTrigger, { asChild: true, children: /* @__PURE__ */ jsx25(
1082
2572
  "button",
1083
2573
  {
1084
2574
  type: "button",
1085
2575
  className: "relative flex h-8 w-8 items-center justify-center rounded-md before:absolute before:-inset-1.5 before:content-[''] bg-transparent text-muted-foreground hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1086
2576
  "aria-label": "Panel options",
1087
- children: /* @__PURE__ */ jsx12(MoreVerticalIcon, {})
2577
+ children: /* @__PURE__ */ jsx25(MoreVerticalIcon, {})
1088
2578
  }
1089
2579
  ) }),
1090
- /* @__PURE__ */ jsx12(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsxs5(
2580
+ /* @__PURE__ */ jsx25(DropdownMenuPrimitive2.Portal, { children: /* @__PURE__ */ jsxs17(
1091
2581
  DropdownContent,
1092
2582
  {
1093
2583
  className: "z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95",
1094
2584
  sideOffset: 4,
1095
2585
  align: "end",
1096
2586
  children: [
1097
- /* @__PURE__ */ jsx12(DropdownLabel, { className: "px-2 py-1.5 text-sm font-semibold", children: "Panel Position" }),
1098
- ["left", "right", "top", "bottom"].map((e) => /* @__PURE__ */ jsxs5(
2587
+ /* @__PURE__ */ jsx25(DropdownLabel, { className: "px-2 py-1.5 text-sm font-semibold", children: "Panel Position" }),
2588
+ ["left", "right", "top", "bottom"].map((e) => /* @__PURE__ */ jsxs17(
1099
2589
  DropdownItem,
1100
2590
  {
1101
2591
  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",
@@ -1105,20 +2595,20 @@ var DataPanelHeader = React14.forwardRef(
1105
2595
  },
1106
2596
  children: [
1107
2597
  edgeLabels[e],
1108
- mode === "pinned" && edge === e && /* @__PURE__ */ jsx12("span", { className: "ml-auto text-xs", children: "\u2713" })
2598
+ mode === "pinned" && edge === e && /* @__PURE__ */ jsx25("span", { className: "ml-auto text-xs", children: "\u2713" })
1109
2599
  ]
1110
2600
  },
1111
2601
  e
1112
2602
  )),
1113
- /* @__PURE__ */ jsx12(DropdownSeparator, { className: "-mx-1 my-1 h-px bg-muted" }),
1114
- /* @__PURE__ */ jsxs5(
2603
+ /* @__PURE__ */ jsx25(DropdownSeparator, { className: "-mx-1 my-1 h-px bg-muted" }),
2604
+ /* @__PURE__ */ jsxs17(
1115
2605
  DropdownItem,
1116
2606
  {
1117
2607
  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",
1118
2608
  onSelect: () => onModeChange?.("detached"),
1119
2609
  children: [
1120
2610
  "Detach",
1121
- mode === "detached" && /* @__PURE__ */ jsx12("span", { className: "ml-auto text-xs", children: "\u2713" })
2611
+ mode === "detached" && /* @__PURE__ */ jsx25("span", { className: "ml-auto text-xs", children: "\u2713" })
1122
2612
  ]
1123
2613
  }
1124
2614
  )
@@ -1126,14 +2616,14 @@ var DataPanelHeader = React14.forwardRef(
1126
2616
  }
1127
2617
  ) })
1128
2618
  ] }),
1129
- !disableClose && /* @__PURE__ */ jsx12(
2619
+ !disableClose && /* @__PURE__ */ jsx25(
1130
2620
  "button",
1131
2621
  {
1132
2622
  type: "button",
1133
2623
  className: "relative flex h-8 w-8 items-center justify-center rounded-md before:absolute before:-inset-1.5 before:content-[''] bg-transparent text-muted-foreground hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1134
2624
  onClick: onClose,
1135
2625
  "aria-label": "Close panel",
1136
- children: /* @__PURE__ */ jsx12(CloseIcon, {})
2626
+ children: /* @__PURE__ */ jsx25(CloseIcon, {})
1137
2627
  }
1138
2628
  )
1139
2629
  ] })
@@ -1157,14 +2647,14 @@ function DataPanelCardHeader({
1157
2647
  onToggleExpand,
1158
2648
  onClose
1159
2649
  }) {
1160
- return /* @__PURE__ */ jsxs5(
2650
+ return /* @__PURE__ */ jsxs17(
1161
2651
  "div",
1162
2652
  {
1163
2653
  "data-panel-header": true,
1164
2654
  className: "relative flex items-center justify-between gap-2 border-b border-border bg-muted/30 px-4 pt-5 pb-3 cursor-pointer",
1165
2655
  onPointerDown: onHeaderPointerDown,
1166
2656
  children: [
1167
- showDragHandle && /* @__PURE__ */ jsx12(
2657
+ showDragHandle && /* @__PURE__ */ jsx25(
1168
2658
  "div",
1169
2659
  {
1170
2660
  className: "absolute top-1.5 left-1/2 -translate-x-1/2 w-10 h-1.5 rounded-full bg-muted-foreground/30 cursor-pointer touch-none",
@@ -1176,22 +2666,22 @@ function DataPanelCardHeader({
1176
2666
  onKeyDown: (e) => (e.key === "Enter" || e.key === " ") && onToggleExpand()
1177
2667
  }
1178
2668
  ),
1179
- /* @__PURE__ */ jsx12(
2669
+ /* @__PURE__ */ jsx25(
1180
2670
  "div",
1181
2671
  {
1182
2672
  className: "flex-1 min-w-0",
1183
2673
  role: "button",
1184
2674
  tabIndex: 0,
1185
2675
  onKeyDown: (e) => (e.key === "Enter" || e.key === " ") && onToggleExpand(),
1186
- children: headerContent ? headerContent : /* @__PURE__ */ jsxs5(Fragment, { children: [
1187
- subtitle && /* @__PURE__ */ jsx12("p", { className: "text-sm text-muted-foreground truncate", children: subtitle }),
1188
- title && /* @__PURE__ */ jsx12("h3", { id: titleId, className: "text-lg font-semibold truncate", children: title })
2676
+ children: headerContent ? headerContent : /* @__PURE__ */ jsxs17(Fragment5, { children: [
2677
+ subtitle && /* @__PURE__ */ jsx25("p", { className: "text-sm text-muted-foreground truncate", children: subtitle }),
2678
+ title && /* @__PURE__ */ jsx25("h3", { id: titleId, className: "text-lg font-semibold truncate", children: title })
1189
2679
  ] })
1190
2680
  }
1191
2681
  ),
1192
- /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-1 shrink-0", children: [
2682
+ /* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-1 shrink-0", children: [
1193
2683
  headerActions,
1194
- !isMobile && /* @__PURE__ */ jsx12(
2684
+ !isMobile && /* @__PURE__ */ jsx25(
1195
2685
  "button",
1196
2686
  {
1197
2687
  "data-card-drag-handle": true,
@@ -1200,10 +2690,10 @@ function DataPanelCardHeader({
1200
2690
  "aria-label": "Drag to reposition panel",
1201
2691
  title: "Drag to move",
1202
2692
  onPointerDown: onHeaderPointerDown,
1203
- children: /* @__PURE__ */ jsx12(GripIcon, {})
2693
+ children: /* @__PURE__ */ jsx25(GripIcon, {})
1204
2694
  }
1205
2695
  ),
1206
- /* @__PURE__ */ jsx12(
2696
+ /* @__PURE__ */ jsx25(
1207
2697
  "button",
1208
2698
  {
1209
2699
  type: "button",
@@ -1212,17 +2702,17 @@ function DataPanelCardHeader({
1212
2702
  "aria-expanded": isExpanded,
1213
2703
  "aria-label": isExpanded ? "Collapse panel" : "Expand panel",
1214
2704
  title: isExpanded ? "Collapse" : "Expand",
1215
- children: /* @__PURE__ */ jsx12("span", { className: cn("inline-flex transition-transform", isExpanded && "rotate-180"), children: /* @__PURE__ */ jsx12(ChevronUpIcon, {}) })
2705
+ children: /* @__PURE__ */ jsx25("span", { className: cn("inline-flex transition-transform", isExpanded && "rotate-180"), children: /* @__PURE__ */ jsx25(ChevronUpIcon, {}) })
1216
2706
  }
1217
2707
  ),
1218
- !disableClose && /* @__PURE__ */ jsx12(
2708
+ !disableClose && /* @__PURE__ */ jsx25(
1219
2709
  "button",
1220
2710
  {
1221
2711
  type: "button",
1222
2712
  className: "relative flex h-8 w-8 items-center justify-center rounded-md before:absolute before:-inset-1.5 before:content-[''] text-muted-foreground hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1223
2713
  onClick: onClose,
1224
2714
  "aria-label": "Close panel",
1225
- children: /* @__PURE__ */ jsx12(CloseIcon, {})
2715
+ children: /* @__PURE__ */ jsx25(CloseIcon, {})
1226
2716
  }
1227
2717
  )
1228
2718
  ] })
@@ -1230,9 +2720,9 @@ function DataPanelCardHeader({
1230
2720
  }
1231
2721
  );
1232
2722
  }
1233
- var DataPanelContent = React14.forwardRef(
2723
+ var DataPanelContent = React24.forwardRef(
1234
2724
  ({ children, className, "aria-label": ariaLabel = "Panel content" }, ref) => {
1235
- return /* @__PURE__ */ jsx12(
2725
+ return /* @__PURE__ */ jsx25(
1236
2726
  "div",
1237
2727
  {
1238
2728
  ref,
@@ -1245,7 +2735,7 @@ var DataPanelContent = React14.forwardRef(
1245
2735
  }
1246
2736
  );
1247
2737
  DataPanelContent.displayName = "DataPanelContent";
1248
- var DataPanelFooter = React14.forwardRef(
2738
+ var DataPanelFooter = React24.forwardRef(
1249
2739
  ({ actions = [], footerContent, footerActions, className }, ref) => {
1250
2740
  if (!footerContent && actions.length === 0 && !footerActions) {
1251
2741
  return null;
@@ -1254,7 +2744,7 @@ var DataPanelFooter = React14.forwardRef(
1254
2744
  if (variant === "primary") return "default";
1255
2745
  return variant ?? "default";
1256
2746
  };
1257
- return /* @__PURE__ */ jsx12(
2747
+ return /* @__PURE__ */ jsx25(
1258
2748
  "div",
1259
2749
  {
1260
2750
  ref,
@@ -1262,9 +2752,9 @@ var DataPanelFooter = React14.forwardRef(
1262
2752
  "flex items-center justify-end gap-2 border-t border-border bg-muted/30 px-4 py-3",
1263
2753
  className
1264
2754
  ),
1265
- children: footerContent ? footerContent : /* @__PURE__ */ jsxs5(Fragment, { children: [
2755
+ children: footerContent ? footerContent : /* @__PURE__ */ jsxs17(Fragment5, { children: [
1266
2756
  footerActions,
1267
- actions.map((action, index) => /* @__PURE__ */ jsx12(
2757
+ actions.map((action, index) => /* @__PURE__ */ jsx25(
1268
2758
  Button,
1269
2759
  {
1270
2760
  variant: mapVariant(action.variant),
@@ -1281,7 +2771,7 @@ var DataPanelFooter = React14.forwardRef(
1281
2771
  }
1282
2772
  );
1283
2773
  DataPanelFooter.displayName = "DataPanelFooter";
1284
- var DataPanelTab = React14.forwardRef(
2774
+ var DataPanelTab = React24.forwardRef(
1285
2775
  ({
1286
2776
  title = "Panel",
1287
2777
  subtitle,
@@ -1307,15 +2797,15 @@ var DataPanelTab = React14.forwardRef(
1307
2797
  bottom: "left-1/2 rounded-t-lg border-b-0"
1308
2798
  }[edge];
1309
2799
  const insetStyle = { [edge]: tabInset };
1310
- const innerRef = React14.useRef(null);
1311
- const dragRef = React14.useRef({
2800
+ const innerRef = React24.useRef(null);
2801
+ const dragRef = React24.useRef({
1312
2802
  startX: 0,
1313
2803
  startY: 0,
1314
2804
  startOffset: 0,
1315
2805
  moved: false,
1316
2806
  pointerId: -1
1317
2807
  });
1318
- const [dragOffset, setDragOffset] = React14.useState(null);
2808
+ const [dragOffset, setDragOffset] = React24.useState(null);
1319
2809
  const effectiveOffset = dragOffset ?? offset;
1320
2810
  const draggable = !!onOffsetChange;
1321
2811
  const tabTransform = getTabTransform(edge, tabWidth, effectiveOffset);
@@ -1384,7 +2874,7 @@ var DataPanelTab = React14.forwardRef(
1384
2874
  onClick?.();
1385
2875
  }
1386
2876
  };
1387
- React14.useEffect(() => {
2877
+ React24.useEffect(() => {
1388
2878
  if (!onOffsetChange || dragOffset !== null) return;
1389
2879
  const reclamp = () => {
1390
2880
  const clamped = constrainTabOffset(
@@ -1400,7 +2890,7 @@ var DataPanelTab = React14.forwardRef(
1400
2890
  window.addEventListener("resize", reclamp);
1401
2891
  return () => window.removeEventListener("resize", reclamp);
1402
2892
  }, [edge, tabWidth, offset, onOffsetChange, dragOffset]);
1403
- return /* @__PURE__ */ jsxs5(
2893
+ return /* @__PURE__ */ jsxs17(
1404
2894
  "div",
1405
2895
  {
1406
2896
  ref: setRefs,
@@ -1426,7 +2916,7 @@ var DataPanelTab = React14.forwardRef(
1426
2916
  onPointerUp: draggable ? handlePointerUp : void 0,
1427
2917
  onPointerCancel: draggable ? handlePointerCancel : void 0,
1428
2918
  children: [
1429
- /* @__PURE__ */ jsxs5(
2919
+ /* @__PURE__ */ jsxs17(
1430
2920
  "button",
1431
2921
  {
1432
2922
  type: "button",
@@ -1435,12 +2925,12 @@ var DataPanelTab = React14.forwardRef(
1435
2925
  onClick: draggable ? void 0 : onClick,
1436
2926
  onKeyDown: handleExpandKeyDown,
1437
2927
  children: [
1438
- /* @__PURE__ */ jsx12("span", { className: "truncate text-sm font-semibold", children: title }),
1439
- subtitle && /* @__PURE__ */ jsx12("span", { className: "truncate text-xs text-muted-foreground", children: subtitle })
2928
+ /* @__PURE__ */ jsx25("span", { className: "truncate text-sm font-semibold", children: title }),
2929
+ subtitle && /* @__PURE__ */ jsx25("span", { className: "truncate text-xs text-muted-foreground", children: subtitle })
1440
2930
  ]
1441
2931
  }
1442
2932
  ),
1443
- !disableClose && onClose && /* @__PURE__ */ jsx12(
2933
+ !disableClose && onClose && /* @__PURE__ */ jsx25(
1444
2934
  "button",
1445
2935
  {
1446
2936
  "data-no-drag": true,
@@ -1451,7 +2941,7 @@ var DataPanelTab = React14.forwardRef(
1451
2941
  e.stopPropagation();
1452
2942
  onClose();
1453
2943
  },
1454
- children: /* @__PURE__ */ jsx12(CloseIcon, {})
2944
+ children: /* @__PURE__ */ jsx25(CloseIcon, {})
1455
2945
  }
1456
2946
  )
1457
2947
  ]
@@ -1473,7 +2963,7 @@ function ResizeHandles({
1473
2963
  onPinnedSizeChange,
1474
2964
  constraints
1475
2965
  }) {
1476
- const handleDetachedKeyDown = React14.useCallback(
2966
+ const handleDetachedKeyDown = React24.useCallback(
1477
2967
  (e, handle) => {
1478
2968
  const step = e.shiftKey ? KEYBOARD_RESIZE_STEP_LARGE : KEYBOARD_RESIZE_STEP;
1479
2969
  let width = detachedSize.width;
@@ -1536,7 +3026,7 @@ function ResizeHandles({
1536
3026
  },
1537
3027
  [detachedPosition, detachedSize, constraints, onDetachedResize]
1538
3028
  );
1539
- const handlePinnedKeyDown = React14.useCallback(
3029
+ const handlePinnedKeyDown = React24.useCallback(
1540
3030
  (e) => {
1541
3031
  const step = e.shiftKey ? KEYBOARD_RESIZE_STEP_LARGE : KEYBOARD_RESIZE_STEP;
1542
3032
  let newSize = pinnedSize;
@@ -1596,12 +3086,12 @@ function ResizeHandles({
1596
3086
  "bottom-left",
1597
3087
  "bottom-right"
1598
3088
  ];
1599
- return /* @__PURE__ */ jsx12(Fragment, { children: handles.map((handle) => {
3089
+ return /* @__PURE__ */ jsx25(Fragment5, { children: handles.map((handle) => {
1600
3090
  const isCorner = handle.includes("-");
1601
3091
  const isHorizontal2 = handle === "top" || handle === "bottom";
1602
3092
  const isVertical = handle === "left" || handle === "right";
1603
3093
  const { min: min2, max: max2 } = getAriaValueMinMax(handle);
1604
- return /* @__PURE__ */ jsx12(
3094
+ return /* @__PURE__ */ jsx25(
1605
3095
  "div",
1606
3096
  {
1607
3097
  className: cn(
@@ -1630,7 +3120,7 @@ function ResizeHandles({
1630
3120
  const pinnedHandle = getPinnedResizeHandle(edge);
1631
3121
  const isHorizontal = edge === "left" || edge === "right";
1632
3122
  const { min, max } = getAriaValueMinMax(pinnedHandle);
1633
- return /* @__PURE__ */ jsx12(
3123
+ return /* @__PURE__ */ jsx25(
1634
3124
  "div",
1635
3125
  {
1636
3126
  className: cn(
@@ -1653,7 +3143,7 @@ function ResizeHandles({
1653
3143
  }
1654
3144
  );
1655
3145
  }
1656
- var DataPanel = React14.forwardRef(
3146
+ var DataPanel = React24.forwardRef(
1657
3147
  ({
1658
3148
  open: controlledOpen,
1659
3149
  onOpenChange,
@@ -1685,76 +3175,76 @@ var DataPanel = React14.forwardRef(
1685
3175
  footerActions,
1686
3176
  className
1687
3177
  }, ref) => {
1688
- const resolvedConstraints = React14.useMemo(
3178
+ const resolvedConstraints = React24.useMemo(
1689
3179
  () => ({ ...DEFAULT_CONSTRAINTS, ...constraints }),
1690
3180
  [constraints]
1691
3181
  );
1692
- const resolvedCardConfig = React14.useMemo(
3182
+ const resolvedCardConfig = React24.useMemo(
1693
3183
  () => ({ ...DEFAULT_CARD_CONFIG, ...cardConfig }),
1694
3184
  [cardConfig]
1695
3185
  );
1696
- const panelId = React14.useId();
3186
+ const panelId = React24.useId();
1697
3187
  const titleId = `${panelId}-title`;
1698
- const [internalOpen, setInternalOpen] = React14.useState(true);
1699
- const [internalMode, setInternalMode] = React14.useState(DEFAULT_PANEL_STATE.mode);
1700
- const [internalVariant, setInternalVariant] = React14.useState(
3188
+ const [internalOpen, setInternalOpen] = React24.useState(true);
3189
+ const [internalMode, setInternalMode] = React24.useState(DEFAULT_PANEL_STATE.mode);
3190
+ const [internalVariant, setInternalVariant] = React24.useState(
1701
3191
  DEFAULT_PANEL_STATE.variant
1702
3192
  );
1703
- const [internalEdge, setInternalEdge] = React14.useState(DEFAULT_PANEL_STATE.edge);
1704
- const [internalExpanded, setInternalExpanded] = React14.useState(
3193
+ const [internalEdge, setInternalEdge] = React24.useState(DEFAULT_PANEL_STATE.edge);
3194
+ const [internalExpanded, setInternalExpanded] = React24.useState(
1705
3195
  DEFAULT_PANEL_STATE.isExpanded
1706
3196
  );
1707
- const [detachedPosition, setDetachedPosition] = React14.useState(
3197
+ const [detachedPosition, setDetachedPosition] = React24.useState(
1708
3198
  DEFAULT_PANEL_STATE.detachedPosition
1709
3199
  );
1710
- const [detachedSize, setDetachedSize] = React14.useState(DEFAULT_PANEL_STATE.detachedSize);
1711
- const [pinnedSize, setPinnedSize] = React14.useState(DEFAULT_PANEL_STATE.pinnedSize);
1712
- const [tabOffset, setTabOffset] = React14.useState(DEFAULT_PANEL_STATE.tabOffset);
1713
- const [viewportWidth, setViewportWidth] = React14.useState(
3200
+ const [detachedSize, setDetachedSize] = React24.useState(DEFAULT_PANEL_STATE.detachedSize);
3201
+ const [pinnedSize, setPinnedSize] = React24.useState(DEFAULT_PANEL_STATE.pinnedSize);
3202
+ const [tabOffset, setTabOffset] = React24.useState(DEFAULT_PANEL_STATE.tabOffset);
3203
+ const [viewportWidth, setViewportWidth] = React24.useState(
1714
3204
  typeof window !== "undefined" ? layoutViewportWidth() : 1024
1715
3205
  );
1716
- const [viewportHeight, setViewportHeight] = React14.useState(
3206
+ const [viewportHeight, setViewportHeight] = React24.useState(
1717
3207
  typeof window !== "undefined" ? window.innerHeight : 768
1718
3208
  );
1719
3209
  const isMobile = viewportWidth < 640;
1720
- const [cardHorizontalPosition, setCardHorizontalPosition] = React14.useState(0);
1721
- const [cardExpandedHeight, setCardExpandedHeight] = React14.useState(0);
1722
- const [cardWidth, setCardWidth] = React14.useState(null);
1723
- const [cardDragCurrentHeight, setCardDragCurrentHeight] = React14.useState(CARD_HEADER_HEIGHT);
1724
- const [isCardVerticalDragging, setIsCardVerticalDragging] = React14.useState(false);
1725
- const [isCardHorizontalDragging, setIsCardHorizontalDragging] = React14.useState(false);
1726
- const [isCardHeightTransitioning, setIsCardHeightTransitioning] = React14.useState(false);
1727
- const [isCardWidthResizing, setIsCardWidthResizing] = React14.useState(false);
1728
- const [isCardTopResizing, setIsCardTopResizing] = React14.useState(false);
1729
- const [isDragging, setIsDragging] = React14.useState(false);
1730
- const [isResizing, setIsResizing] = React14.useState(false);
1731
- const [snapPreview, setSnapPreview] = React14.useState(null);
1732
- const [isPinnedDragging, setIsPinnedDragging] = React14.useState(false);
1733
- const [pullOffset, setPullOffset] = React14.useState(0);
1734
- const dragStateRef = React14.useRef({
3210
+ const [cardHorizontalPosition, setCardHorizontalPosition] = React24.useState(0);
3211
+ const [cardExpandedHeight, setCardExpandedHeight] = React24.useState(0);
3212
+ const [cardWidth, setCardWidth] = React24.useState(null);
3213
+ const [cardDragCurrentHeight, setCardDragCurrentHeight] = React24.useState(CARD_HEADER_HEIGHT);
3214
+ const [isCardVerticalDragging, setIsCardVerticalDragging] = React24.useState(false);
3215
+ const [isCardHorizontalDragging, setIsCardHorizontalDragging] = React24.useState(false);
3216
+ const [isCardHeightTransitioning, setIsCardHeightTransitioning] = React24.useState(false);
3217
+ const [isCardWidthResizing, setIsCardWidthResizing] = React24.useState(false);
3218
+ const [isCardTopResizing, setIsCardTopResizing] = React24.useState(false);
3219
+ const [isDragging, setIsDragging] = React24.useState(false);
3220
+ const [isResizing, setIsResizing] = React24.useState(false);
3221
+ const [snapPreview, setSnapPreview] = React24.useState(null);
3222
+ const [isPinnedDragging, setIsPinnedDragging] = React24.useState(false);
3223
+ const [pullOffset, setPullOffset] = React24.useState(0);
3224
+ const dragStateRef = React24.useRef({
1735
3225
  startPosition: { x: 0, y: 0 },
1736
3226
  startPanelPosition: { x: 0, y: 0 }
1737
3227
  });
1738
- const pinnedDragStateRef = React14.useRef({
3228
+ const pinnedDragStateRef = React24.useRef({
1739
3229
  startPosition: { x: 0, y: 0 },
1740
3230
  hasDetached: false
1741
3231
  });
1742
- const resizeStateRef = React14.useRef({
3232
+ const resizeStateRef = React24.useRef({
1743
3233
  handle: null,
1744
3234
  startPosition: { x: 0, y: 0 },
1745
3235
  startSize: { width: 0, height: 0 },
1746
3236
  startPanelPosition: { x: 0, y: 0 }
1747
3237
  });
1748
- const cardDragStateRef = React14.useRef({
3238
+ const cardDragStateRef = React24.useRef({
1749
3239
  startY: 0,
1750
3240
  startX: 0,
1751
3241
  startTime: 0,
1752
3242
  startExpanded: false,
1753
3243
  startHorizontalPosition: 0
1754
3244
  });
1755
- const cardCurrentHeightRef = React14.useRef(CARD_HEADER_HEIGHT);
1756
- const cardTopResizeStartRef = React14.useRef({ startY: 0, startHeight: 0 });
1757
- const cardWidthResizeStateRef = React14.useRef({
3245
+ const cardCurrentHeightRef = React24.useRef(CARD_HEADER_HEIGHT);
3246
+ const cardTopResizeStartRef = React24.useRef({ startY: 0, startHeight: 0 });
3247
+ const cardWidthResizeStateRef = React24.useRef({
1758
3248
  handle: null,
1759
3249
  startX: 0,
1760
3250
  startWidth: 0,
@@ -1766,9 +3256,9 @@ var DataPanel = React14.forwardRef(
1766
3256
  const edge = controlledEdge ?? internalEdge;
1767
3257
  const isExpanded = controlledExpanded ?? internalExpanded;
1768
3258
  const showContent = variant !== "card" || isExpanded || isCardVerticalDragging;
1769
- const saveTimeoutRef = React14.useRef(null);
1770
- const isMountedRef = React14.useRef(true);
1771
- React14.useEffect(() => {
3259
+ const saveTimeoutRef = React24.useRef(null);
3260
+ const isMountedRef = React24.useRef(true);
3261
+ React24.useEffect(() => {
1772
3262
  isMountedRef.current = true;
1773
3263
  return () => {
1774
3264
  isMountedRef.current = false;
@@ -1779,7 +3269,7 @@ var DataPanel = React14.forwardRef(
1779
3269
  }
1780
3270
  };
1781
3271
  }, []);
1782
- const debouncedSave = React14.useCallback(() => {
3272
+ const debouncedSave = React24.useCallback(() => {
1783
3273
  if (!persistKey) return;
1784
3274
  if (saveTimeoutRef.current) {
1785
3275
  clearTimeout(saveTimeoutRef.current);
@@ -1808,11 +3298,11 @@ var DataPanel = React14.forwardRef(
1808
3298
  pinnedSize,
1809
3299
  tabOffset
1810
3300
  ]);
1811
- React14.useEffect(() => {
3301
+ React24.useEffect(() => {
1812
3302
  debouncedSave();
1813
3303
  }, [debouncedSave]);
1814
- const hasLoadedRef = React14.useRef(false);
1815
- React14.useEffect(() => {
3304
+ const hasLoadedRef = React24.useRef(false);
3305
+ React24.useEffect(() => {
1816
3306
  if (!persistKey || hasLoadedRef.current) return;
1817
3307
  hasLoadedRef.current = true;
1818
3308
  const persisted = loadPanelState(persistKey);
@@ -1829,7 +3319,7 @@ var DataPanel = React14.forwardRef(
1829
3319
  if (persisted.tabOffset !== void 0) setTabOffset(persisted.tabOffset);
1830
3320
  }
1831
3321
  }, [persistKey, controlledMode, controlledVariant, controlledEdge, controlledExpanded]);
1832
- React14.useEffect(() => {
3322
+ React24.useEffect(() => {
1833
3323
  if (mode === "detached" && detachedPosition.x === DEFAULT_PANEL_STATE.detachedPosition.x && detachedPosition.y === DEFAULT_PANEL_STATE.detachedPosition.y) {
1834
3324
  setDetachedPosition(
1835
3325
  getInitialDetachedPosition(detachedSize, layoutViewportWidth(), window.innerHeight)
@@ -1858,7 +3348,7 @@ var DataPanel = React14.forwardRef(
1858
3348
  ref.current = node;
1859
3349
  }
1860
3350
  };
1861
- const handleModeChange = React14.useCallback(
3351
+ const handleModeChange = React24.useCallback(
1862
3352
  (newMode) => {
1863
3353
  if (controlledMode === void 0) {
1864
3354
  setInternalMode(newMode);
@@ -1867,7 +3357,7 @@ var DataPanel = React14.forwardRef(
1867
3357
  },
1868
3358
  [controlledMode, onModeChange]
1869
3359
  );
1870
- const handleEdgeChange = React14.useCallback(
3360
+ const handleEdgeChange = React24.useCallback(
1871
3361
  (newEdge) => {
1872
3362
  if (controlledEdge === void 0) {
1873
3363
  setInternalEdge(newEdge);
@@ -1876,7 +3366,7 @@ var DataPanel = React14.forwardRef(
1876
3366
  },
1877
3367
  [controlledEdge, onEdgeChange]
1878
3368
  );
1879
- const handleExpandedChange = React14.useCallback(
3369
+ const handleExpandedChange = React24.useCallback(
1880
3370
  (newExpanded) => {
1881
3371
  if (controlledExpanded === void 0) {
1882
3372
  setInternalExpanded(newExpanded);
@@ -1910,7 +3400,7 @@ var DataPanel = React14.forwardRef(
1910
3400
  document.body.style.userSelect = "none";
1911
3401
  }
1912
3402
  };
1913
- const handleDragMove = React14.useCallback(
3403
+ const handleDragMove = React24.useCallback(
1914
3404
  (e) => {
1915
3405
  if (!isDragging) return;
1916
3406
  const currentPos = getPointerPosition(e);
@@ -1937,7 +3427,7 @@ var DataPanel = React14.forwardRef(
1937
3427
  },
1938
3428
  [isDragging, detachedSize, snapThreshold]
1939
3429
  );
1940
- const handleDragEnd = React14.useCallback(() => {
3430
+ const handleDragEnd = React24.useCallback(() => {
1941
3431
  if (!isDragging) return;
1942
3432
  setIsDragging(false);
1943
3433
  document.body.style.cursor = "";
@@ -1948,7 +3438,7 @@ var DataPanel = React14.forwardRef(
1948
3438
  setSnapPreview(null);
1949
3439
  }
1950
3440
  }, [isDragging, snapPreview, handleModeChange, handleEdgeChange]);
1951
- const handlePinnedDragMove = React14.useCallback(
3441
+ const handlePinnedDragMove = React24.useCallback(
1952
3442
  (e) => {
1953
3443
  if (!isPinnedDragging) return;
1954
3444
  const currentPos = getPointerPosition(e);
@@ -1984,7 +3474,7 @@ var DataPanel = React14.forwardRef(
1984
3474
  },
1985
3475
  [isPinnedDragging, edge, detachThreshold, pinnedSize, detachedSize, handleModeChange]
1986
3476
  );
1987
- const handlePinnedDragEnd = React14.useCallback(() => {
3477
+ const handlePinnedDragEnd = React24.useCallback(() => {
1988
3478
  if (!isPinnedDragging) return;
1989
3479
  setIsPinnedDragging(false);
1990
3480
  setPullOffset(0);
@@ -2006,7 +3496,7 @@ var DataPanel = React14.forwardRef(
2006
3496
  document.body.style.cursor = getResizeCursor(handle);
2007
3497
  document.body.style.userSelect = "none";
2008
3498
  };
2009
- const handleResizeMove = React14.useCallback(
3499
+ const handleResizeMove = React24.useCallback(
2010
3500
  (e) => {
2011
3501
  if (!isResizing || !resizeStateRef.current.handle) return;
2012
3502
  const currentPos = getPointerPosition(e);
@@ -2047,7 +3537,7 @@ var DataPanel = React14.forwardRef(
2047
3537
  },
2048
3538
  [isResizing, mode, edge, resolvedConstraints]
2049
3539
  );
2050
- const handleResizeEnd = React14.useCallback(() => {
3540
+ const handleResizeEnd = React24.useCallback(() => {
2051
3541
  if (!isResizing) return;
2052
3542
  setIsResizing(false);
2053
3543
  resizeStateRef.current.handle = null;
@@ -2079,7 +3569,7 @@ var DataPanel = React14.forwardRef(
2079
3569
  }
2080
3570
  document.body.style.userSelect = "none";
2081
3571
  };
2082
- const handleCardPointerMove = React14.useCallback(
3572
+ const handleCardPointerMove = React24.useCallback(
2083
3573
  (e) => {
2084
3574
  const currentPos = getPointerPosition(e);
2085
3575
  if (isCardVerticalDragging) {
@@ -2119,7 +3609,7 @@ var DataPanel = React14.forwardRef(
2119
3609
  resolvedCardConfig.maxWidth
2120
3610
  ]
2121
3611
  );
2122
- const handleCardPointerUp = React14.useCallback(
3612
+ const handleCardPointerUp = React24.useCallback(
2123
3613
  (e) => {
2124
3614
  const endTime = Date.now();
2125
3615
  const currentPos = getPointerPosition(e);
@@ -2176,7 +3666,7 @@ var DataPanel = React14.forwardRef(
2176
3666
  document.body.style.cursor = "ns-resize";
2177
3667
  document.body.style.userSelect = "none";
2178
3668
  };
2179
- const handleCardResizeMove = React14.useCallback(
3669
+ const handleCardResizeMove = React24.useCallback(
2180
3670
  (e) => {
2181
3671
  if (!isCardTopResizing) return;
2182
3672
  const currentPos = getPointerPosition(e);
@@ -2189,7 +3679,7 @@ var DataPanel = React14.forwardRef(
2189
3679
  },
2190
3680
  [isCardTopResizing, viewportHeight]
2191
3681
  );
2192
- const handleCardResizeEnd = React14.useCallback(() => {
3682
+ const handleCardResizeEnd = React24.useCallback(() => {
2193
3683
  if (!isCardTopResizing) return;
2194
3684
  setIsCardTopResizing(false);
2195
3685
  document.body.style.cursor = "";
@@ -2220,7 +3710,7 @@ var DataPanel = React14.forwardRef(
2220
3710
  document.body.style.cursor = "ew-resize";
2221
3711
  document.body.style.userSelect = "none";
2222
3712
  };
2223
- const handleCardWidthResizeMove = React14.useCallback(
3713
+ const handleCardWidthResizeMove = React24.useCallback(
2224
3714
  (e) => {
2225
3715
  const st = cardWidthResizeStateRef.current;
2226
3716
  if (!isCardWidthResizing || !st.handle) return;
@@ -2260,7 +3750,7 @@ var DataPanel = React14.forwardRef(
2260
3750
  resolvedCardConfig.maxWidth
2261
3751
  ]
2262
3752
  );
2263
- const handleCardWidthResizeEnd = React14.useCallback(() => {
3753
+ const handleCardWidthResizeEnd = React24.useCallback(() => {
2264
3754
  if (!isCardWidthResizing) return;
2265
3755
  setIsCardWidthResizing(false);
2266
3756
  cardWidthResizeStateRef.current.handle = null;
@@ -2308,7 +3798,7 @@ var DataPanel = React14.forwardRef(
2308
3798
  if (kind === "width-left") setCardHorizontalPosition((p) => p - appliedDelta);
2309
3799
  debouncedSave();
2310
3800
  };
2311
- React14.useEffect(() => {
3801
+ React24.useEffect(() => {
2312
3802
  if (isDragging) {
2313
3803
  window.addEventListener("pointermove", handleDragMove);
2314
3804
  window.addEventListener("pointerup", handleDragEnd);
@@ -2320,7 +3810,7 @@ var DataPanel = React14.forwardRef(
2320
3810
  };
2321
3811
  }
2322
3812
  }, [isDragging, handleDragMove, handleDragEnd]);
2323
- React14.useEffect(() => {
3813
+ React24.useEffect(() => {
2324
3814
  if (isPinnedDragging) {
2325
3815
  window.addEventListener("pointermove", handlePinnedDragMove);
2326
3816
  window.addEventListener("pointerup", handlePinnedDragEnd);
@@ -2332,7 +3822,7 @@ var DataPanel = React14.forwardRef(
2332
3822
  };
2333
3823
  }
2334
3824
  }, [isPinnedDragging, handlePinnedDragMove, handlePinnedDragEnd]);
2335
- React14.useEffect(() => {
3825
+ React24.useEffect(() => {
2336
3826
  if (isResizing) {
2337
3827
  window.addEventListener("pointermove", handleResizeMove);
2338
3828
  window.addEventListener("pointerup", handleResizeEnd);
@@ -2344,7 +3834,7 @@ var DataPanel = React14.forwardRef(
2344
3834
  };
2345
3835
  }
2346
3836
  }, [isResizing, handleResizeMove, handleResizeEnd]);
2347
- React14.useEffect(() => {
3837
+ React24.useEffect(() => {
2348
3838
  if (isCardVerticalDragging || isCardHorizontalDragging) {
2349
3839
  window.addEventListener("pointermove", handleCardPointerMove);
2350
3840
  window.addEventListener("pointerup", handleCardPointerUp);
@@ -2361,7 +3851,7 @@ var DataPanel = React14.forwardRef(
2361
3851
  handleCardPointerMove,
2362
3852
  handleCardPointerUp
2363
3853
  ]);
2364
- React14.useEffect(() => {
3854
+ React24.useEffect(() => {
2365
3855
  if (isCardTopResizing) {
2366
3856
  window.addEventListener("pointermove", handleCardResizeMove);
2367
3857
  window.addEventListener("pointerup", handleCardResizeEnd);
@@ -2373,7 +3863,7 @@ var DataPanel = React14.forwardRef(
2373
3863
  };
2374
3864
  }
2375
3865
  }, [isCardTopResizing, handleCardResizeMove, handleCardResizeEnd]);
2376
- React14.useEffect(() => {
3866
+ React24.useEffect(() => {
2377
3867
  if (isCardWidthResizing) {
2378
3868
  window.addEventListener("pointermove", handleCardWidthResizeMove);
2379
3869
  window.addEventListener("pointerup", handleCardWidthResizeEnd);
@@ -2385,7 +3875,7 @@ var DataPanel = React14.forwardRef(
2385
3875
  };
2386
3876
  }
2387
3877
  }, [isCardWidthResizing, handleCardWidthResizeMove, handleCardWidthResizeEnd]);
2388
- React14.useEffect(() => {
3878
+ React24.useEffect(() => {
2389
3879
  const onResize = () => {
2390
3880
  setViewportWidth(layoutViewportWidth());
2391
3881
  setViewportHeight(window.innerHeight);
@@ -2395,19 +3885,19 @@ var DataPanel = React14.forwardRef(
2395
3885
  window.addEventListener("resize", onResize);
2396
3886
  return () => window.removeEventListener("resize", onResize);
2397
3887
  }, []);
2398
- React14.useEffect(() => {
3888
+ React24.useEffect(() => {
2399
3889
  if (isMobile && variant === "card") {
2400
3890
  setCardHorizontalPosition(0);
2401
3891
  setCardWidth(null);
2402
3892
  }
2403
3893
  }, [isMobile, variant]);
2404
- React14.useEffect(() => {
3894
+ React24.useEffect(() => {
2405
3895
  if (isCardHeightTransitioning) {
2406
3896
  const t = setTimeout(() => setIsCardHeightTransitioning(false), 350);
2407
3897
  return () => clearTimeout(t);
2408
3898
  }
2409
3899
  }, [isCardHeightTransitioning]);
2410
- const panelStyles = React14.useMemo(() => {
3900
+ const panelStyles = React24.useMemo(() => {
2411
3901
  if (variant === "card") {
2412
3902
  const defaultCardWidth = Math.min(
2413
3903
  viewportWidth - resolvedCardConfig.horizontalMargin * 2,
@@ -2472,7 +3962,7 @@ var DataPanel = React14.forwardRef(
2472
3962
  }[edge] : "animate-scale-in";
2473
3963
  if (!open) return null;
2474
3964
  if (variant === "full" && !isExpanded && mode === "pinned") {
2475
- return /* @__PURE__ */ jsx12(
3965
+ return /* @__PURE__ */ jsx25(
2476
3966
  DataPanelTab,
2477
3967
  {
2478
3968
  title,
@@ -2488,8 +3978,8 @@ var DataPanel = React14.forwardRef(
2488
3978
  }
2489
3979
  );
2490
3980
  }
2491
- return /* @__PURE__ */ jsxs5(Fragment, { children: [
2492
- snapPreview && /* @__PURE__ */ jsx12(
3981
+ return /* @__PURE__ */ jsxs17(Fragment5, { children: [
3982
+ snapPreview && /* @__PURE__ */ jsx25(
2493
3983
  "div",
2494
3984
  {
2495
3985
  className: cn(
@@ -2501,7 +3991,7 @@ var DataPanel = React14.forwardRef(
2501
3991
  )
2502
3992
  }
2503
3993
  ),
2504
- variant === "card" && isExpanded && isMobile && /* @__PURE__ */ jsx12(
3994
+ variant === "card" && isExpanded && isMobile && /* @__PURE__ */ jsx25(
2505
3995
  "div",
2506
3996
  {
2507
3997
  className: "fixed inset-0 z-40 bg-black/50 transition-opacity",
@@ -2509,7 +3999,7 @@ var DataPanel = React14.forwardRef(
2509
3999
  onClick: handleToggleExpand
2510
4000
  }
2511
4001
  ),
2512
- /* @__PURE__ */ jsxs5(
4002
+ /* @__PURE__ */ jsxs17(
2513
4003
  "div",
2514
4004
  {
2515
4005
  ref: setPanelRef,
@@ -2531,7 +4021,7 @@ var DataPanel = React14.forwardRef(
2531
4021
  "aria-expanded": variant === "card" ? isExpanded : void 0,
2532
4022
  onPointerDown: variant === "full" ? handleDragStart : void 0,
2533
4023
  children: [
2534
- variant === "card" ? /* @__PURE__ */ jsx12(
4024
+ variant === "card" ? /* @__PURE__ */ jsx25(
2535
4025
  DataPanelCardHeader,
2536
4026
  {
2537
4027
  title,
@@ -2547,7 +4037,7 @@ var DataPanel = React14.forwardRef(
2547
4037
  onToggleExpand: handleToggleExpand,
2548
4038
  onClose: () => handleOpenChange(false)
2549
4039
  }
2550
- ) : /* @__PURE__ */ jsx12(
4040
+ ) : /* @__PURE__ */ jsx25(
2551
4041
  DataPanelHeader,
2552
4042
  {
2553
4043
  title,
@@ -2567,9 +4057,9 @@ var DataPanel = React14.forwardRef(
2567
4057
  draggable: !disableDrag && (mode === "detached" || mode === "pinned" && detachThreshold > 0)
2568
4058
  }
2569
4059
  ),
2570
- showContent && /* @__PURE__ */ jsxs5(Fragment, { children: [
2571
- /* @__PURE__ */ jsx12(DataPanelContent, { children }),
2572
- /* @__PURE__ */ jsx12(
4060
+ showContent && /* @__PURE__ */ jsxs17(Fragment5, { children: [
4061
+ /* @__PURE__ */ jsx25(DataPanelContent, { children }),
4062
+ /* @__PURE__ */ jsx25(
2573
4063
  DataPanelFooter,
2574
4064
  {
2575
4065
  actions,
@@ -2578,7 +4068,7 @@ var DataPanel = React14.forwardRef(
2578
4068
  }
2579
4069
  )
2580
4070
  ] }),
2581
- variant === "full" && !disableResize && /* @__PURE__ */ jsx12(
4071
+ variant === "full" && !disableResize && /* @__PURE__ */ jsx25(
2582
4072
  ResizeHandles,
2583
4073
  {
2584
4074
  mode,
@@ -2609,8 +4099,8 @@ var DataPanel = React14.forwardRef(
2609
4099
  constraints: resolvedConstraints
2610
4100
  }
2611
4101
  ),
2612
- variant === "card" && isExpanded && !disableResize && !isMobile && /* @__PURE__ */ jsxs5(Fragment, { children: [
2613
- /* @__PURE__ */ jsx12(
4102
+ variant === "card" && isExpanded && !disableResize && !isMobile && /* @__PURE__ */ jsxs17(Fragment5, { children: [
4103
+ /* @__PURE__ */ jsx25(
2614
4104
  "div",
2615
4105
  {
2616
4106
  className: "resize-handle resize-handle--horizontal resize-handle--top",
@@ -2626,7 +4116,7 @@ var DataPanel = React14.forwardRef(
2626
4116
  onKeyDown: (e) => handleCardResizeKeyDown(e, "height")
2627
4117
  }
2628
4118
  ),
2629
- /* @__PURE__ */ jsx12(
4119
+ /* @__PURE__ */ jsx25(
2630
4120
  "div",
2631
4121
  {
2632
4122
  className: "resize-handle resize-handle--vertical resize-handle--left resize-handle--card-edge",
@@ -2642,7 +4132,7 @@ var DataPanel = React14.forwardRef(
2642
4132
  onKeyDown: (e) => handleCardResizeKeyDown(e, "width-left")
2643
4133
  }
2644
4134
  ),
2645
- /* @__PURE__ */ jsx12(
4135
+ /* @__PURE__ */ jsx25(
2646
4136
  "div",
2647
4137
  {
2648
4138
  className: "resize-handle resize-handle--vertical resize-handle--right resize-handle--card-edge",
@@ -2668,10 +4158,10 @@ var DataPanel = React14.forwardRef(
2668
4158
  DataPanel.displayName = "DataPanel";
2669
4159
 
2670
4160
  // src/components/Skeleton.tsx
2671
- import * as React15 from "react";
2672
- import { cva as cva5 } from "class-variance-authority";
2673
- import { jsx as jsx13 } from "react/jsx-runtime";
2674
- var skeletonVariants = cva5("rounded-md bg-muted", {
4161
+ import * as React25 from "react";
4162
+ import { cva as cva6 } from "class-variance-authority";
4163
+ import { jsx as jsx26 } from "react/jsx-runtime";
4164
+ var skeletonVariants = cva6("rounded-md bg-muted", {
2675
4165
  variants: {
2676
4166
  variant: {
2677
4167
  default: "",
@@ -2686,10 +4176,10 @@ var skeletonVariants = cva5("rounded-md bg-muted", {
2686
4176
  variant: "default"
2687
4177
  }
2688
4178
  });
2689
- var Skeleton = React15.forwardRef(
4179
+ var Skeleton = React25.forwardRef(
2690
4180
  ({ className, variant, animation = "pulse", ...props }, ref) => {
2691
4181
  const animationClass = animation === "pulse" ? "animate-pulse" : animation === "shimmer" ? "animate-shimmer" : "";
2692
- return /* @__PURE__ */ jsx13(
4182
+ return /* @__PURE__ */ jsx26(
2693
4183
  "div",
2694
4184
  {
2695
4185
  ref,
@@ -2702,10 +4192,10 @@ var Skeleton = React15.forwardRef(
2702
4192
  Skeleton.displayName = "Skeleton";
2703
4193
 
2704
4194
  // src/components/Spinner.tsx
2705
- import * as React16 from "react";
2706
- import { cva as cva6 } from "class-variance-authority";
2707
- import { jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
2708
- var spinnerVariants = cva6("animate-spin text-current", {
4195
+ import * as React26 from "react";
4196
+ import { cva as cva7 } from "class-variance-authority";
4197
+ import { jsx as jsx27, jsxs as jsxs18 } from "react/jsx-runtime";
4198
+ var spinnerVariants = cva7("animate-spin text-current", {
2709
4199
  variants: {
2710
4200
  size: {
2711
4201
  sm: "h-4 w-4",
@@ -2718,9 +4208,9 @@ var spinnerVariants = cva6("animate-spin text-current", {
2718
4208
  size: "md"
2719
4209
  }
2720
4210
  });
2721
- var Spinner = React16.forwardRef(
4211
+ var Spinner = React26.forwardRef(
2722
4212
  ({ className, size, label = "Loading...", ...props }, ref) => {
2723
- return /* @__PURE__ */ jsxs6(
4213
+ return /* @__PURE__ */ jsxs18(
2724
4214
  "svg",
2725
4215
  {
2726
4216
  ref,
@@ -2732,7 +4222,7 @@ var Spinner = React16.forwardRef(
2732
4222
  role: "status",
2733
4223
  ...props,
2734
4224
  children: [
2735
- /* @__PURE__ */ jsx14(
4225
+ /* @__PURE__ */ jsx27(
2736
4226
  "circle",
2737
4227
  {
2738
4228
  className: "opacity-25",
@@ -2743,7 +4233,7 @@ var Spinner = React16.forwardRef(
2743
4233
  strokeWidth: "4"
2744
4234
  }
2745
4235
  ),
2746
- /* @__PURE__ */ jsx14(
4236
+ /* @__PURE__ */ jsx27(
2747
4237
  "path",
2748
4238
  {
2749
4239
  className: "opacity-75",
@@ -2751,7 +4241,7 @@ var Spinner = React16.forwardRef(
2751
4241
  d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
2752
4242
  }
2753
4243
  ),
2754
- /* @__PURE__ */ jsx14("title", { children: label })
4244
+ /* @__PURE__ */ jsx27("title", { children: label })
2755
4245
  ]
2756
4246
  }
2757
4247
  );
@@ -2760,8 +4250,8 @@ var Spinner = React16.forwardRef(
2760
4250
  Spinner.displayName = "Spinner";
2761
4251
 
2762
4252
  // src/components/LoadingLogo.tsx
2763
- import * as React17 from "react";
2764
- import { jsx as jsx15, jsxs as jsxs7 } from "react/jsx-runtime";
4253
+ import * as React27 from "react";
4254
+ import { jsx as jsx28, jsxs as jsxs19 } from "react/jsx-runtime";
2765
4255
  var logoPaths = [
2766
4256
  "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",
2767
4257
  "M14.602 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",
@@ -2783,12 +4273,12 @@ var colors = {
2783
4273
  stroke: "#ffffff"
2784
4274
  }
2785
4275
  };
2786
- var LoadingLogo = React17.forwardRef(
4276
+ var LoadingLogo = React27.forwardRef(
2787
4277
  ({ width = 40, height = 40, loading = false, variant = "dark", className, ...props }, ref) => {
2788
4278
  const currentColors = colors[variant];
2789
4279
  const fillColor = loading ? currentColors.fillLoading : currentColors.fill;
2790
4280
  const strokeColor = currentColors.stroke;
2791
- return /* @__PURE__ */ jsxs7(
4281
+ return /* @__PURE__ */ jsxs19(
2792
4282
  "div",
2793
4283
  {
2794
4284
  ref,
@@ -2798,7 +4288,7 @@ var LoadingLogo = React17.forwardRef(
2798
4288
  "aria-label": loading ? "Loading" : "Classic Homes",
2799
4289
  ...props,
2800
4290
  children: [
2801
- /* @__PURE__ */ jsxs7(
4291
+ /* @__PURE__ */ jsxs19(
2802
4292
  "svg",
2803
4293
  {
2804
4294
  width: "100%",
@@ -2808,8 +4298,8 @@ var LoadingLogo = React17.forwardRef(
2808
4298
  xmlns: "http://www.w3.org/2000/svg",
2809
4299
  "aria-hidden": "true",
2810
4300
  children: [
2811
- /* @__PURE__ */ jsx15("g", { fill: fillColor, className: "transition-all duration-300", children: logoPaths.map((path, i) => /* @__PURE__ */ jsx15("path", { d: path }, i)) }),
2812
- loading && /* @__PURE__ */ jsx15(
4301
+ /* @__PURE__ */ jsx28("g", { fill: fillColor, className: "transition-all duration-300", children: logoPaths.map((path, i) => /* @__PURE__ */ jsx28("path", { d: path }, i)) }),
4302
+ loading && /* @__PURE__ */ jsx28(
2813
4303
  "g",
2814
4304
  {
2815
4305
  fill: "none",
@@ -2817,13 +4307,13 @@ var LoadingLogo = React17.forwardRef(
2817
4307
  strokeWidth: "0.5",
2818
4308
  strokeDasharray: "10 4",
2819
4309
  className: "animate-trace",
2820
- children: logoPaths.map((path, i) => /* @__PURE__ */ jsx15("path", { d: path }, i))
4310
+ children: logoPaths.map((path, i) => /* @__PURE__ */ jsx28("path", { d: path }, i))
2821
4311
  }
2822
4312
  )
2823
4313
  ]
2824
4314
  }
2825
4315
  ),
2826
- loading && /* @__PURE__ */ jsx15("span", { className: "sr-only", children: "Loading" })
4316
+ loading && /* @__PURE__ */ jsx28("span", { className: "sr-only", children: "Loading" })
2827
4317
  ]
2828
4318
  }
2829
4319
  );
@@ -2832,10 +4322,10 @@ var LoadingLogo = React17.forwardRef(
2832
4322
  LoadingLogo.displayName = "LoadingLogo";
2833
4323
 
2834
4324
  // src/components/ProgressBar.tsx
2835
- import * as React18 from "react";
2836
- import { cva as cva7 } from "class-variance-authority";
2837
- import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
2838
- var progressBarVariants = cva7("w-full overflow-hidden rounded-full bg-muted", {
4325
+ import * as React28 from "react";
4326
+ import { cva as cva8 } from "class-variance-authority";
4327
+ import { jsx as jsx29, jsxs as jsxs20 } from "react/jsx-runtime";
4328
+ var progressBarVariants = cva8("w-full overflow-hidden rounded-full bg-muted", {
2839
4329
  variants: {
2840
4330
  size: {
2841
4331
  sm: "h-1",
@@ -2847,7 +4337,7 @@ var progressBarVariants = cva7("w-full overflow-hidden rounded-full bg-muted", {
2847
4337
  size: "md"
2848
4338
  }
2849
4339
  });
2850
- var progressFillVariants = cva7("h-full rounded-full transition-all duration-300", {
4340
+ var progressFillVariants = cva8("h-full rounded-full transition-all duration-300", {
2851
4341
  variants: {
2852
4342
  variant: {
2853
4343
  default: "bg-primary",
@@ -2860,12 +4350,12 @@ var progressFillVariants = cva7("h-full rounded-full transition-all duration-300
2860
4350
  variant: "default"
2861
4351
  }
2862
4352
  });
2863
- var ProgressBar = React18.forwardRef(
4353
+ var ProgressBar = React28.forwardRef(
2864
4354
  ({ className, size, variant, value, max = 100, label = "Progress", showValue = false, ...props }, ref) => {
2865
4355
  const isIndeterminate = value === void 0;
2866
4356
  const clampedValue = isIndeterminate ? 0 : Math.min(Math.max(0, value), max);
2867
4357
  const percentage = isIndeterminate ? 0 : Math.round(clampedValue / max * 100);
2868
- return /* @__PURE__ */ jsxs8(
4358
+ return /* @__PURE__ */ jsxs20(
2869
4359
  "div",
2870
4360
  {
2871
4361
  ref,
@@ -2877,7 +4367,7 @@ var ProgressBar = React18.forwardRef(
2877
4367
  className: cn("flex items-center gap-2", className),
2878
4368
  ...props,
2879
4369
  children: [
2880
- /* @__PURE__ */ jsx16("div", { className: cn(progressBarVariants({ size })), children: /* @__PURE__ */ jsx16(
4370
+ /* @__PURE__ */ jsx29("div", { className: cn(progressBarVariants({ size })), children: /* @__PURE__ */ jsx29(
2881
4371
  "div",
2882
4372
  {
2883
4373
  className: cn(
@@ -2887,7 +4377,7 @@ var ProgressBar = React18.forwardRef(
2887
4377
  style: isIndeterminate ? void 0 : { width: `${percentage}%` }
2888
4378
  }
2889
4379
  ) }),
2890
- showValue && !isIndeterminate && /* @__PURE__ */ jsxs8("span", { className: "text-sm tabular-nums text-muted-foreground", children: [
4380
+ showValue && !isIndeterminate && /* @__PURE__ */ jsxs20("span", { className: "text-sm tabular-nums text-muted-foreground", children: [
2891
4381
  percentage,
2892
4382
  "%"
2893
4383
  ] })
@@ -2899,11 +4389,11 @@ var ProgressBar = React18.forwardRef(
2899
4389
  ProgressBar.displayName = "ProgressBar";
2900
4390
 
2901
4391
  // src/components/LoadingOverlay.tsx
2902
- import * as React19 from "react";
2903
- import { Fragment as Fragment2, jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
4392
+ import * as React29 from "react";
4393
+ import { Fragment as Fragment6, jsx as jsx30, jsxs as jsxs21 } from "react/jsx-runtime";
2904
4394
  var spinnerSizeMap = { sm: "sm", md: "md", lg: "lg", xl: "xl" };
2905
4395
  var logoSizeMap = { sm: 32, md: 40, lg: 56, xl: 80 };
2906
- var LoadingOverlay = React19.forwardRef(
4396
+ var LoadingOverlay = React29.forwardRef(
2907
4397
  ({
2908
4398
  loading = true,
2909
4399
  variant = "spinner",
@@ -2918,8 +4408,8 @@ var LoadingOverlay = React19.forwardRef(
2918
4408
  children,
2919
4409
  ...props
2920
4410
  }, ref) => {
2921
- const [visible, setVisible] = React19.useState(delay === 0 && loading);
2922
- React19.useEffect(() => {
4411
+ const [visible, setVisible] = React29.useState(delay === 0 && loading);
4412
+ React29.useEffect(() => {
2923
4413
  if (!loading) {
2924
4414
  setVisible(false);
2925
4415
  return;
@@ -2932,23 +4422,23 @@ var LoadingOverlay = React19.forwardRef(
2932
4422
  return () => clearTimeout(timer);
2933
4423
  }, [loading, delay]);
2934
4424
  if (!visible) {
2935
- return mode === "inline" ? null : /* @__PURE__ */ jsx17(Fragment2, { children });
4425
+ return mode === "inline" ? null : /* @__PURE__ */ jsx30(Fragment6, { children });
2936
4426
  }
2937
- const indicator = /* @__PURE__ */ jsxs9(Fragment2, { children: [
2938
- variant === "spinner" && /* @__PURE__ */ jsx17(Spinner, { size: spinnerSizeMap[size] }),
2939
- variant === "logo" && /* @__PURE__ */ jsx17(LoadingLogo, { loading: true, width: logoSizeMap[size], height: logoSizeMap[size] }),
2940
- variant === "progress" && /* @__PURE__ */ jsx17(ProgressBar, { value: progress, className: "w-48 max-w-full" }),
2941
- variant === "skeleton" && /* @__PURE__ */ jsxs9("div", { className: "w-full space-y-3", children: [
2942
- /* @__PURE__ */ jsx17(Skeleton, { variant: "title" }),
2943
- /* @__PURE__ */ jsx17(Skeleton, { variant: "text" }),
2944
- /* @__PURE__ */ jsx17(Skeleton, { variant: "text" }),
2945
- /* @__PURE__ */ jsx17(Skeleton, { variant: "text", className: "w-2/3" })
4427
+ const indicator = /* @__PURE__ */ jsxs21(Fragment6, { children: [
4428
+ variant === "spinner" && /* @__PURE__ */ jsx30(Spinner, { size: spinnerSizeMap[size] }),
4429
+ variant === "logo" && /* @__PURE__ */ jsx30(LoadingLogo, { loading: true, width: logoSizeMap[size], height: logoSizeMap[size] }),
4430
+ variant === "progress" && /* @__PURE__ */ jsx30(ProgressBar, { value: progress, className: "w-48 max-w-full" }),
4431
+ variant === "skeleton" && /* @__PURE__ */ jsxs21("div", { className: "w-full space-y-3", children: [
4432
+ /* @__PURE__ */ jsx30(Skeleton, { variant: "title" }),
4433
+ /* @__PURE__ */ jsx30(Skeleton, { variant: "text" }),
4434
+ /* @__PURE__ */ jsx30(Skeleton, { variant: "text" }),
4435
+ /* @__PURE__ */ jsx30(Skeleton, { variant: "text", className: "w-2/3" })
2946
4436
  ] }),
2947
- message && /* @__PURE__ */ jsx17("p", { className: "mt-2 text-sm text-muted-foreground animate-pulse-subtle", children: message }),
2948
- !message && /* @__PURE__ */ jsx17("span", { className: "sr-only", children: "Loading" })
4437
+ message && /* @__PURE__ */ jsx30("p", { className: "mt-2 text-sm text-muted-foreground animate-pulse-subtle", children: message }),
4438
+ !message && /* @__PURE__ */ jsx30("span", { className: "sr-only", children: "Loading" })
2949
4439
  ] });
2950
4440
  if (mode === "inline") {
2951
- return /* @__PURE__ */ jsx17(
4441
+ return /* @__PURE__ */ jsx30(
2952
4442
  "div",
2953
4443
  {
2954
4444
  ref,
@@ -2962,9 +4452,9 @@ var LoadingOverlay = React19.forwardRef(
2962
4452
  }
2963
4453
  const bgClass = opaque ? "bg-background" : mode === "fullscreen" ? "bg-background/80" : "bg-background/60";
2964
4454
  const positionClass = mode === "fullscreen" ? "fixed inset-0 z-50" : "absolute inset-0 z-10";
2965
- return /* @__PURE__ */ jsxs9(Fragment2, { children: [
4455
+ return /* @__PURE__ */ jsxs21(Fragment6, { children: [
2966
4456
  children,
2967
- /* @__PURE__ */ jsx17(
4457
+ /* @__PURE__ */ jsx30(
2968
4458
  "div",
2969
4459
  {
2970
4460
  ref,
@@ -2987,9 +4477,9 @@ var LoadingOverlay = React19.forwardRef(
2987
4477
  LoadingOverlay.displayName = "LoadingOverlay";
2988
4478
 
2989
4479
  // src/components/LoadingPage.tsx
2990
- import * as React20 from "react";
2991
- import { jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
2992
- var LoadingPage = React20.forwardRef(
4480
+ import * as React30 from "react";
4481
+ import { jsx as jsx31, jsxs as jsxs22 } from "react/jsx-runtime";
4482
+ var LoadingPage = React30.forwardRef(
2993
4483
  ({
2994
4484
  loading = true,
2995
4485
  message,
@@ -3000,8 +4490,8 @@ var LoadingPage = React20.forwardRef(
3000
4490
  className,
3001
4491
  ...props
3002
4492
  }, ref) => {
3003
- const [visible, setVisible] = React20.useState(delay === 0 && loading);
3004
- React20.useEffect(() => {
4493
+ const [visible, setVisible] = React30.useState(delay === 0 && loading);
4494
+ React30.useEffect(() => {
3005
4495
  if (!loading) {
3006
4496
  setVisible(false);
3007
4497
  return;
@@ -3014,7 +4504,7 @@ var LoadingPage = React20.forwardRef(
3014
4504
  return () => clearTimeout(timer);
3015
4505
  }, [loading, delay]);
3016
4506
  if (!visible) return null;
3017
- return /* @__PURE__ */ jsxs10(
4507
+ return /* @__PURE__ */ jsxs22(
3018
4508
  "div",
3019
4509
  {
3020
4510
  ref,
@@ -3026,10 +4516,10 @@ var LoadingPage = React20.forwardRef(
3026
4516
  ),
3027
4517
  ...props,
3028
4518
  children: [
3029
- showLogo ? /* @__PURE__ */ jsx18(LoadingLogo, { loading: true, width: 64, height: 64, variant: logoVariant }) : /* @__PURE__ */ jsx18(Spinner, { size: "xl" }),
3030
- progress !== void 0 && /* @__PURE__ */ jsx18(ProgressBar, { value: progress, className: "mt-6 w-48 max-w-full" }),
3031
- message && /* @__PURE__ */ jsx18("p", { className: "mt-4 text-sm text-muted-foreground animate-pulse-subtle", children: message }),
3032
- /* @__PURE__ */ jsxs10("span", { className: "sr-only", children: [
4519
+ showLogo ? /* @__PURE__ */ jsx31(LoadingLogo, { loading: true, width: 64, height: 64, variant: logoVariant }) : /* @__PURE__ */ jsx31(Spinner, { size: "xl" }),
4520
+ progress !== void 0 && /* @__PURE__ */ jsx31(ProgressBar, { value: progress, className: "mt-6 w-48 max-w-full" }),
4521
+ message && /* @__PURE__ */ jsx31("p", { className: "mt-4 text-sm text-muted-foreground animate-pulse-subtle", children: message }),
4522
+ /* @__PURE__ */ jsxs22("span", { className: "sr-only", children: [
3033
4523
  message || "Loading",
3034
4524
  progress !== void 0 && `, ${Math.round(progress)}% complete`
3035
4525
  ] })
@@ -3041,9 +4531,9 @@ var LoadingPage = React20.forwardRef(
3041
4531
  LoadingPage.displayName = "LoadingPage";
3042
4532
 
3043
4533
  // src/components/LoadingSection.tsx
3044
- import * as React21 from "react";
3045
- import { jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
3046
- var LoadingSection = React21.forwardRef(
4534
+ import * as React31 from "react";
4535
+ import { jsx as jsx32, jsxs as jsxs23 } from "react/jsx-runtime";
4536
+ var LoadingSection = React31.forwardRef(
3047
4537
  ({
3048
4538
  loading = false,
3049
4539
  variant = "spinner",
@@ -3056,7 +4546,7 @@ var LoadingSection = React21.forwardRef(
3056
4546
  children,
3057
4547
  ...props
3058
4548
  }, ref) => {
3059
- return /* @__PURE__ */ jsxs11(
4549
+ return /* @__PURE__ */ jsxs23(
3060
4550
  "div",
3061
4551
  {
3062
4552
  ref,
@@ -3066,7 +4556,7 @@ var LoadingSection = React21.forwardRef(
3066
4556
  ...props,
3067
4557
  children: [
3068
4558
  children,
3069
- loading && /* @__PURE__ */ jsx19(
4559
+ loading && /* @__PURE__ */ jsx32(
3070
4560
  LoadingOverlay,
3071
4561
  {
3072
4562
  mode: "overlay",
@@ -3085,11 +4575,11 @@ var LoadingSection = React21.forwardRef(
3085
4575
  LoadingSection.displayName = "LoadingSection";
3086
4576
 
3087
4577
  // src/components/LiveRegion.tsx
3088
- import * as React22 from "react";
3089
- import { jsx as jsx20 } from "react/jsx-runtime";
3090
- var LiveRegion = React22.forwardRef(
4578
+ import * as React32 from "react";
4579
+ import { jsx as jsx33 } from "react/jsx-runtime";
4580
+ var LiveRegion = React32.forwardRef(
3091
4581
  ({ message, politeness = "polite", atomic = true, visuallyHidden = true, className, children }, ref) => {
3092
- return /* @__PURE__ */ jsx20(
4582
+ return /* @__PURE__ */ jsx33(
3093
4583
  "div",
3094
4584
  {
3095
4585
  ref,
@@ -3108,9 +4598,9 @@ var LiveRegion = React22.forwardRef(
3108
4598
  LiveRegion.displayName = "LiveRegion";
3109
4599
 
3110
4600
  // src/components/SkipLink.tsx
3111
- import * as React23 from "react";
3112
- import { jsx as jsx21 } from "react/jsx-runtime";
3113
- var SkipLink = React23.forwardRef(
4601
+ import * as React33 from "react";
4602
+ import { jsx as jsx34 } from "react/jsx-runtime";
4603
+ var SkipLink = React33.forwardRef(
3114
4604
  ({ targetId, className, children = "Skip to main content", ...props }, ref) => {
3115
4605
  const handleClick = (e) => {
3116
4606
  e.preventDefault();
@@ -3128,7 +4618,7 @@ var SkipLink = React23.forwardRef(
3128
4618
  }
3129
4619
  props.onClick?.(e);
3130
4620
  };
3131
- return /* @__PURE__ */ jsx21(
4621
+ return /* @__PURE__ */ jsx34(
3132
4622
  "a",
3133
4623
  {
3134
4624
  ref,
@@ -3144,11 +4634,11 @@ var SkipLink = React23.forwardRef(
3144
4634
  SkipLink.displayName = "SkipLink";
3145
4635
 
3146
4636
  // src/hooks/useFocusRef.ts
3147
- import { useRef as useRef5, useEffect as useEffect7 } from "react";
4637
+ import { useRef as useRef10, useEffect as useEffect12 } from "react";
3148
4638
  function useFocusRef(options = {}) {
3149
4639
  const { focusOnMount = false, preventScroll = false, delay = 0 } = options;
3150
- const ref = useRef5(null);
3151
- useEffect7(() => {
4640
+ const ref = useRef10(null);
4641
+ useEffect12(() => {
3152
4642
  if (!focusOnMount) return;
3153
4643
  const focus = () => {
3154
4644
  if (ref.current && typeof ref.current.focus === "function") {
@@ -3167,10 +4657,10 @@ function useFocusRef(options = {}) {
3167
4657
  }
3168
4658
 
3169
4659
  // src/hooks/useReducedMotion.ts
3170
- import { useState as useState6, useEffect as useEffect8 } from "react";
4660
+ import { useState as useState13, useEffect as useEffect13 } from "react";
3171
4661
  function useReducedMotion() {
3172
- const [reducedMotion, setReducedMotion] = useState6(false);
3173
- useEffect8(() => {
4662
+ const [reducedMotion, setReducedMotion] = useState13(false);
4663
+ useEffect13(() => {
3174
4664
  const mediaQuery = window.matchMedia("(prefers-reduced-motion: reduce)");
3175
4665
  setReducedMotion(mediaQuery.matches);
3176
4666
  const handleChange = (event) => {
@@ -3185,7 +4675,7 @@ function useReducedMotion() {
3185
4675
  }
3186
4676
 
3187
4677
  // src/hooks/useArrowNavigation.ts
3188
- import { useCallback as useCallback4, useRef as useRef6, useState as useState7 } from "react";
4678
+ import { useCallback as useCallback5, useRef as useRef11, useState as useState14 } from "react";
3189
4679
  var DEFAULT_SELECTOR = '[role="menuitem"], [role="option"], [role="tab"], button, a, [tabindex]:not([tabindex="-1"])';
3190
4680
  function useArrowNavigation(options = {}) {
3191
4681
  const {
@@ -3194,18 +4684,18 @@ function useArrowNavigation(options = {}) {
3194
4684
  itemSelector = DEFAULT_SELECTOR,
3195
4685
  onFocusChange
3196
4686
  } = options;
3197
- const containerRef = useRef6(null);
3198
- const focusedIndexRef = useRef6(-1);
3199
- const [focusedIndex, setFocusedIndexState] = useState7(-1);
3200
- const setFocusedIndex = useCallback4((index) => {
4687
+ const containerRef = useRef11(null);
4688
+ const focusedIndexRef = useRef11(-1);
4689
+ const [focusedIndex, setFocusedIndexState] = useState14(-1);
4690
+ const setFocusedIndex = useCallback5((index) => {
3201
4691
  focusedIndexRef.current = index;
3202
4692
  setFocusedIndexState(index);
3203
4693
  }, []);
3204
- const getFocusableItems = useCallback4(() => {
4694
+ const getFocusableItems = useCallback5(() => {
3205
4695
  if (!containerRef.current) return [];
3206
4696
  return Array.from(containerRef.current.querySelectorAll(itemSelector));
3207
4697
  }, [itemSelector]);
3208
- const focusItem = useCallback4(
4698
+ const focusItem = useCallback5(
3209
4699
  (index) => {
3210
4700
  const items = getFocusableItems();
3211
4701
  if (items.length === 0) return;
@@ -3225,7 +4715,7 @@ function useArrowNavigation(options = {}) {
3225
4715
  },
3226
4716
  [getFocusableItems, loop, onFocusChange, setFocusedIndex]
3227
4717
  );
3228
- const handleKeyDown = useCallback4(
4718
+ const handleKeyDown = useCallback5(
3229
4719
  (event) => {
3230
4720
  const items = getFocusableItems();
3231
4721
  if (items.length === 0) return;
@@ -3272,7 +4762,7 @@ function useArrowNavigation(options = {}) {
3272
4762
  },
3273
4763
  [orientation, focusItem, getFocusableItems]
3274
4764
  );
3275
- const handleFocus = useCallback4(
4765
+ const handleFocus = useCallback5(
3276
4766
  (event) => {
3277
4767
  const items = getFocusableItems();
3278
4768
  const index = items.indexOf(event.target);
@@ -3290,7 +4780,7 @@ function useArrowNavigation(options = {}) {
3290
4780
  onFocus: handleFocus
3291
4781
  };
3292
4782
  const tabStopIndex = focusedIndex === -1 ? 0 : focusedIndex;
3293
- const getItemProps = useCallback4(
4783
+ const getItemProps = useCallback5(
3294
4784
  (index) => ({
3295
4785
  tabIndex: index === tabStopIndex ? 0 : -1,
3296
4786
  onFocus: () => {
@@ -3308,20 +4798,20 @@ function useArrowNavigation(options = {}) {
3308
4798
  }
3309
4799
 
3310
4800
  // src/hooks/useRovingTabindex.ts
3311
- import { useState as useState8, useCallback as useCallback5, useRef as useRef7 } from "react";
4801
+ import { useState as useState15, useCallback as useCallback6, useRef as useRef12 } from "react";
3312
4802
  var DEFAULT_SELECTOR2 = "[data-roving-tabindex-item]";
3313
4803
  function useRovingTabindex(options = {}) {
3314
4804
  const { loop = true, itemSelector = DEFAULT_SELECTOR2, initialIndex = 0, onIndexChange } = options;
3315
- const [activeIndex, setActiveIndex] = useState8(initialIndex);
3316
- const containerRef = useRef7(null);
3317
- const itemsRef = useRef7(/* @__PURE__ */ new Map());
3318
- const getItems = useCallback5(() => {
4805
+ const [activeIndex, setActiveIndex] = useState15(initialIndex);
4806
+ const containerRef = useRef12(null);
4807
+ const itemsRef = useRef12(/* @__PURE__ */ new Map());
4808
+ const getItems = useCallback6(() => {
3319
4809
  if (!containerRef.current) {
3320
4810
  return Array.from(itemsRef.current.values());
3321
4811
  }
3322
4812
  return Array.from(containerRef.current.querySelectorAll(itemSelector));
3323
4813
  }, [itemSelector]);
3324
- const focusIndex = useCallback5(
4814
+ const focusIndex = useCallback6(
3325
4815
  (index) => {
3326
4816
  const items = getItems();
3327
4817
  if (items.length === 0) return;
@@ -3341,7 +4831,7 @@ function useRovingTabindex(options = {}) {
3341
4831
  },
3342
4832
  [getItems, loop, onIndexChange]
3343
4833
  );
3344
- const handleKeyDown = useCallback5(
4834
+ const handleKeyDown = useCallback6(
3345
4835
  (event) => {
3346
4836
  const items = getItems();
3347
4837
  if (items.length === 0) return;
@@ -3379,7 +4869,7 @@ function useRovingTabindex(options = {}) {
3379
4869
  },
3380
4870
  onKeyDown: handleKeyDown
3381
4871
  };
3382
- const getItemProps = useCallback5(
4872
+ const getItemProps = useCallback6(
3383
4873
  (index) => ({
3384
4874
  "data-roving-tabindex-item": true,
3385
4875
  tabIndex: index === activeIndex ? 0 : -1,
@@ -3416,21 +4906,21 @@ function useRovingTabindex(options = {}) {
3416
4906
  }
3417
4907
 
3418
4908
  // src/hooks/useClickOutside.ts
3419
- import * as React24 from "react";
4909
+ import * as React34 from "react";
3420
4910
  function useClickOutside(ref, callback, options) {
3421
4911
  const {
3422
4912
  enabled = true,
3423
4913
  events = ["mousedown", "touchstart"],
3424
4914
  ignoreElements = []
3425
4915
  } = options ?? {};
3426
- const callbackRef = React24.useRef(callback);
3427
- const ignoreElementsRef = React24.useRef(ignoreElements);
3428
- React24.useEffect(() => {
4916
+ const callbackRef = React34.useRef(callback);
4917
+ const ignoreElementsRef = React34.useRef(ignoreElements);
4918
+ React34.useEffect(() => {
3429
4919
  callbackRef.current = callback;
3430
4920
  ignoreElementsRef.current = ignoreElements;
3431
4921
  }, [callback, ignoreElements]);
3432
4922
  const eventsKey = events.join(",");
3433
- React24.useEffect(() => {
4923
+ React34.useEffect(() => {
3434
4924
  if (!enabled) return;
3435
4925
  const handleEvent = (event) => {
3436
4926
  const target = event.target;
@@ -3483,6 +4973,8 @@ export {
3483
4973
  DialogTitle,
3484
4974
  DialogTrigger,
3485
4975
  Input,
4976
+ InsertPalette,
4977
+ IssuesButton,
3486
4978
  Label,
3487
4979
  LiveRegion,
3488
4980
  LoadingLogo,
@@ -3492,10 +4984,21 @@ export {
3492
4984
  PageHeader,
3493
4985
  PasswordInput,
3494
4986
  ProgressBar,
4987
+ SaveStatus,
3495
4988
  Separator,
4989
+ Sheet,
3496
4990
  Skeleton,
3497
4991
  SkipLink,
4992
+ SortableList,
3498
4993
  Spinner,
4994
+ Studio,
4995
+ StudioBar,
4996
+ StudioCanvas,
4997
+ StudioCanvasItem,
4998
+ StudioInspector,
4999
+ StudioInspectorSection,
5000
+ StudioOutline,
5001
+ StudioPage,
3499
5002
  Switch,
3500
5003
  badgeVariants,
3501
5004
  buttonVariants,
@@ -3515,5 +5018,6 @@ export {
3515
5018
  useFocusRef,
3516
5019
  useFocusTrap,
3517
5020
  useReducedMotion,
3518
- useRovingTabindex
5021
+ useRovingTabindex,
5022
+ useStudio
3519
5023
  };