@classic-homes/theme-react 0.5.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -114,8 +114,57 @@ function useDevWarning(condition, message, once = false) {
114
114
  }, [condition, message, once]);
115
115
  }
116
116
 
117
+ // src/lib/undoable-text.ts
118
+ var RANGE_TYPES = /* @__PURE__ */ new Set(["text", "search", "url", "tel", "password"]);
119
+ function supportsRange(el) {
120
+ return el instanceof HTMLTextAreaElement || RANGE_TYPES.has(el.type);
121
+ }
122
+ function setNativeValue(el, text) {
123
+ const proto = el instanceof HTMLTextAreaElement ? HTMLTextAreaElement : HTMLInputElement;
124
+ const setter = Object.getOwnPropertyDescriptor(proto.prototype, "value")?.set;
125
+ if (setter) setter.call(el, text);
126
+ else el.value = text;
127
+ }
128
+ function setTextUndoable(el, text, options = {}) {
129
+ const current = el.value;
130
+ const ranged = supportsRange(el);
131
+ const start = ranged ? Math.max(0, Math.min(options.start ?? 0, current.length)) : 0;
132
+ const end = ranged ? Math.max(start, Math.min(options.end ?? current.length, current.length)) : current.length;
133
+ if (current.slice(start, end) === text) return true;
134
+ if (ranged && typeof document !== "undefined" && typeof document.execCommand === "function") {
135
+ if (document.activeElement !== el) el.focus({ preventScroll: true });
136
+ el.setSelectionRange(start, end);
137
+ let applied = false;
138
+ try {
139
+ applied = text === "" ? document.execCommand("delete", false) : document.execCommand("insertText", false, text);
140
+ } catch {
141
+ applied = false;
142
+ }
143
+ if (applied && el.value !== current) return true;
144
+ }
145
+ if (ranged) el.setRangeText(text, start, end, "end");
146
+ else setNativeValue(el, text);
147
+ el.dispatchEvent(new Event("input", { bubbles: true }));
148
+ return false;
149
+ }
150
+
117
151
  // src/components/Input.tsx
118
- import { jsx as jsx3 } from "react/jsx-runtime";
152
+ import { jsx as jsx3, jsxs } from "react/jsx-runtime";
153
+ var UndoIcon = () => /* @__PURE__ */ jsx3(
154
+ "svg",
155
+ {
156
+ width: 14,
157
+ height: 14,
158
+ viewBox: "0 0 24 24",
159
+ fill: "none",
160
+ stroke: "currentColor",
161
+ strokeWidth: 2,
162
+ strokeLinecap: "round",
163
+ strokeLinejoin: "round",
164
+ "aria-hidden": "true",
165
+ children: /* @__PURE__ */ jsx3("path", { d: "M3 7v6h6M3 13a9 9 0 1 0 2.64-6.36L3 9" })
166
+ }
167
+ );
119
168
  var Input = React4.forwardRef(
120
169
  ({
121
170
  className,
@@ -123,13 +172,29 @@ var Input = React4.forwardRef(
123
172
  "aria-invalid": ariaInvalid,
124
173
  required,
125
174
  "aria-describedby": ariaDescribedBy,
175
+ revertTo,
176
+ revertLabel = "Revert to saved",
126
177
  ...props
127
178
  }, ref) => {
179
+ const innerRef = React4.useRef(null);
180
+ const setRefs = React4.useCallback(
181
+ (el) => {
182
+ innerRef.current = el;
183
+ if (typeof ref === "function") ref(el);
184
+ else if (ref) ref.current = el;
185
+ },
186
+ [ref]
187
+ );
188
+ const [liveValue, setLiveValue] = React4.useState(
189
+ () => String(props.value ?? props.defaultValue ?? "")
190
+ );
191
+ const shown = props.value !== void 0 ? String(props.value) : liveValue;
192
+ const canRevert = revertTo !== void 0 && !props.disabled && !props.readOnly && shown !== revertTo;
128
193
  useDevWarning(
129
194
  !props["aria-label"] && !props["aria-labelledby"] && !props.id,
130
195
  "Input: Missing accessible label. Provide aria-label, aria-labelledby, or associate with a Label using id/htmlFor for WCAG compliance."
131
196
  );
132
- return /* @__PURE__ */ jsx3(
197
+ const input = /* @__PURE__ */ jsx3(
133
198
  "input",
134
199
  {
135
200
  type,
@@ -140,12 +205,34 @@ var Input = React4.forwardRef(
140
205
  className: cn(
141
206
  "flex h-10 w-full rounded-md border border-input bg-background text-foreground px-3 py-2 text-sm max-sm:text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
142
207
  ariaInvalid === true || ariaInvalid === "true" ? "border-destructive focus-visible:ring-destructive" : "",
208
+ revertTo !== void 0 && "pr-9",
143
209
  className
144
210
  ),
145
- ref,
146
- ...props
211
+ ref: setRefs,
212
+ ...props,
213
+ onChange: (e) => {
214
+ setLiveValue(e.currentTarget.value);
215
+ props.onChange?.(e);
216
+ }
147
217
  }
148
218
  );
219
+ if (revertTo === void 0) return input;
220
+ return /* @__PURE__ */ jsxs("div", { className: "relative w-full", children: [
221
+ input,
222
+ canRevert && /* @__PURE__ */ jsx3(
223
+ "button",
224
+ {
225
+ type: "button",
226
+ className: "absolute right-1.5 top-1/2 inline-flex h-7 w-7 -translate-y-1/2 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
227
+ "aria-label": revertLabel,
228
+ title: revertLabel,
229
+ onClick: () => {
230
+ if (innerRef.current) setTextUndoable(innerRef.current, revertTo);
231
+ },
232
+ children: /* @__PURE__ */ jsx3(UndoIcon, {})
233
+ }
234
+ )
235
+ ] });
149
236
  }
150
237
  );
151
238
  Input.displayName = "Input";
@@ -202,8 +289,8 @@ function useAnnounce(defaultOptions) {
202
289
  }
203
290
 
204
291
  // src/components/PasswordInput.tsx
205
- import { jsx as jsx4, jsxs } from "react/jsx-runtime";
206
- var EyeIcon = () => /* @__PURE__ */ jsxs(
292
+ import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
293
+ var EyeIcon = () => /* @__PURE__ */ jsxs2(
207
294
  "svg",
208
295
  {
209
296
  width: 18,
@@ -264,7 +351,7 @@ var PasswordInput = React6.forwardRef(
264
351
  return newState;
265
352
  });
266
353
  };
267
- return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
354
+ return /* @__PURE__ */ jsxs2("div", { className: "relative", children: [
268
355
  /* @__PURE__ */ jsx4(
269
356
  "input",
270
357
  {
@@ -313,7 +400,7 @@ Label.displayName = LabelPrimitive.Root.displayName;
313
400
  // src/components/Badge.tsx
314
401
  import * as React8 from "react";
315
402
  import { cva as cva3 } from "class-variance-authority";
316
- import { Fragment, jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
403
+ import { Fragment, jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
317
404
  var badgeVariants = cva3(
318
405
  "inline-flex items-center justify-center rounded-md border font-medium w-fit whitespace-nowrap shrink-0 gap-1",
319
406
  {
@@ -371,7 +458,7 @@ var Badge = React8.forwardRef(
371
458
  const isInteractive = clickable || !!onClick;
372
459
  const classes = cn(badgeVariants({ variant, size, clickable: isInteractive }), className);
373
460
  const liveProps = live ? { role: "status", "aria-live": "polite", "aria-atomic": "true" } : {};
374
- const content = /* @__PURE__ */ jsxs2(Fragment, { children: [
461
+ const content = /* @__PURE__ */ jsxs3(Fragment, { children: [
375
462
  children,
376
463
  label && /* @__PURE__ */ jsx6("span", { className: "sr-only", children: label })
377
464
  ] });
@@ -524,7 +611,7 @@ AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
524
611
  // src/components/Dialog.tsx
525
612
  import * as React12 from "react";
526
613
  import * as DialogPrimitive from "@radix-ui/react-dialog";
527
- import { jsx as jsx10, jsxs as jsxs3 } from "react/jsx-runtime";
614
+ import { jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
528
615
  var PrimitiveOverlay = DialogPrimitive.Overlay;
529
616
  var PrimitiveContent = DialogPrimitive.Content;
530
617
  var PrimitiveTitle = DialogPrimitive.Title;
@@ -553,9 +640,9 @@ var DialogOverlay = React12.forwardRef(({ className, ...props }, ref) => /* @__P
553
640
  }
554
641
  ));
555
642
  DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
556
- var DialogContent = React12.forwardRef(({ className, children, size = "md", showClose = false, ...props }, ref) => /* @__PURE__ */ jsxs3(DialogPortal, { children: [
643
+ var DialogContent = React12.forwardRef(({ className, children, size = "md", showClose = false, ...props }, ref) => /* @__PURE__ */ jsxs4(DialogPortal, { children: [
557
644
  /* @__PURE__ */ jsx10(DialogOverlay, {}),
558
- /* @__PURE__ */ jsxs3(
645
+ /* @__PURE__ */ jsxs4(
559
646
  PrimitiveContent,
560
647
  {
561
648
  ref,
@@ -574,7 +661,7 @@ var DialogContent = React12.forwardRef(({ className, children, size = "md", show
574
661
  {
575
662
  className: "absolute right-3 top-3 flex h-9 w-9 items-center justify-center rounded-md bg-transparent text-muted-foreground hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none",
576
663
  "aria-label": "Close dialog",
577
- children: /* @__PURE__ */ jsxs3(
664
+ children: /* @__PURE__ */ jsxs4(
578
665
  "svg",
579
666
  {
580
667
  xmlns: "http://www.w3.org/2000/svg",
@@ -633,7 +720,7 @@ DialogDescription.displayName = DialogPrimitive.Description.displayName;
633
720
  // src/components/PageHeader.tsx
634
721
  import * as React13 from "react";
635
722
  import { cva as cva4 } from "class-variance-authority";
636
- import { jsx as jsx11, jsxs as jsxs4 } from "react/jsx-runtime";
723
+ import { jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
637
724
  var pageHeaderContainerVariants = cva4("", {
638
725
  variants: {
639
726
  variant: {
@@ -701,7 +788,7 @@ var PageHeader = React13.forwardRef(
701
788
  'PageHeader: Using as="h1" (the default). Ensure there is only one h1 per page for proper document structure. Consider as="h2" for secondary headers.',
702
789
  true
703
790
  );
704
- return /* @__PURE__ */ jsxs4(
791
+ return /* @__PURE__ */ jsxs5(
705
792
  "header",
706
793
  {
707
794
  ref,
@@ -796,7 +883,7 @@ function StudioIcon({
796
883
  }
797
884
 
798
885
  // src/components/Sheet.tsx
799
- import { Fragment as Fragment2, jsx as jsx13, jsxs as jsxs5 } from "react/jsx-runtime";
886
+ import { Fragment as Fragment2, jsx as jsx13, jsxs as jsxs6 } from "react/jsx-runtime";
800
887
  var sheetVariants = cva5(
801
888
  "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",
802
889
  {
@@ -831,28 +918,28 @@ function Sheet({
831
918
  className
832
919
  }) {
833
920
  const close = /* @__PURE__ */ jsx13(DialogPrimitive2.Close, { className: closeClass, "aria-label": "Close", children: /* @__PURE__ */ jsx13(StudioIcon, { name: "close", size: 18 }) });
834
- return /* @__PURE__ */ jsx13(DialogPrimitive2.Root, { open, onOpenChange, children: /* @__PURE__ */ jsxs5(DialogPrimitive2.Portal, { children: [
921
+ return /* @__PURE__ */ jsx13(DialogPrimitive2.Root, { open, onOpenChange, children: /* @__PURE__ */ jsxs6(DialogPrimitive2.Portal, { children: [
835
922
  /* @__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" }),
836
- /* @__PURE__ */ jsxs5(
923
+ /* @__PURE__ */ jsxs6(
837
924
  DialogPrimitive2.Content,
838
925
  {
839
926
  className: cn(sheetVariants({ side, size }), className),
840
927
  ...description ? {} : { "aria-describedby": void 0 },
841
928
  children: [
842
- side === "bottom" && /* @__PURE__ */ jsxs5("div", { className: "relative flex h-6 shrink-0 items-center justify-center", children: [
929
+ side === "bottom" && /* @__PURE__ */ jsxs6("div", { className: "relative flex h-6 shrink-0 items-center justify-center", children: [
843
930
  /* @__PURE__ */ jsx13("div", { className: "h-1.5 w-10 rounded-full bg-muted", "aria-hidden": "true" }),
844
931
  hideTitle && /* @__PURE__ */ jsx13("div", { className: "absolute right-2 top-1", children: close })
845
932
  ] }),
846
- hideTitle ? /* @__PURE__ */ jsxs5(Fragment2, { children: [
933
+ hideTitle ? /* @__PURE__ */ jsxs6(Fragment2, { children: [
847
934
  /* @__PURE__ */ jsx13(DialogPrimitive2.Title, { className: "sr-only", children: title }),
848
935
  description && /* @__PURE__ */ jsx13(DialogPrimitive2.Description, { className: "sr-only", children: description }),
849
936
  side !== "bottom" && /* @__PURE__ */ jsx13("div", { className: "absolute right-2 top-2 z-10", children: close })
850
- ] }) : /* @__PURE__ */ jsxs5("div", { className: "flex shrink-0 items-start gap-3 border-b border-border px-4 py-3", children: [
851
- /* @__PURE__ */ jsxs5("div", { className: "min-w-0 flex-1", children: [
937
+ ] }) : /* @__PURE__ */ jsxs6("div", { className: "flex shrink-0 items-start gap-3 border-b border-border px-4 py-3", children: [
938
+ /* @__PURE__ */ jsxs6("div", { className: "min-w-0 flex-1", children: [
852
939
  /* @__PURE__ */ jsx13(DialogPrimitive2.Title, { className: "text-base font-semibold leading-tight", children: title }),
853
940
  description && /* @__PURE__ */ jsx13(DialogPrimitive2.Description, { className: "mt-1 text-sm text-muted-foreground", children: description })
854
941
  ] }),
855
- /* @__PURE__ */ jsxs5("div", { className: "-mr-1 ml-auto flex shrink-0 items-center gap-1", children: [
942
+ /* @__PURE__ */ jsxs6("div", { className: "-mr-1 ml-auto flex shrink-0 items-center gap-1", children: [
856
943
  headerActions,
857
944
  close
858
945
  ] })
@@ -867,7 +954,7 @@ function Sheet({
867
954
 
868
955
  // src/components/SortableList.tsx
869
956
  import * as React14 from "react";
870
- import { Fragment as Fragment3, jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
957
+ import { Fragment as Fragment3, jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
871
958
  var HANDLE_STYLE = { touchAction: "none" };
872
959
  function SortableList({
873
960
  items,
@@ -999,7 +1086,7 @@ function SortableList({
999
1086
  if (!moving.current && grabbed === index) setGrabbed(null);
1000
1087
  }
1001
1088
  });
1002
- return /* @__PURE__ */ jsxs6(Fragment3, { children: [
1089
+ return /* @__PURE__ */ jsxs7(Fragment3, { children: [
1003
1090
  /* @__PURE__ */ jsx14("ul", { ref: listRef, "aria-label": label, className: cn("relative", className), children: items.map((item, index) => {
1004
1091
  const key = getKey(item, index);
1005
1092
  const dragging = drag?.from === index || grabbed === index;
@@ -1041,7 +1128,7 @@ function useStudio() {
1041
1128
  }
1042
1129
 
1043
1130
  // src/components/studio/Studio.tsx
1044
- import { jsx as jsx15, jsxs as jsxs7 } from "react/jsx-runtime";
1131
+ import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
1045
1132
  function useLayout() {
1046
1133
  const [layout, setLayout] = React16.useState("wide");
1047
1134
  React16.useEffect(() => {
@@ -1112,8 +1199,8 @@ function Studio({
1112
1199
  }),
1113
1200
  [layout, railInSheet, inspectorInSheet, setRailOpen, setInspectorOpen]
1114
1201
  );
1115
- return /* @__PURE__ */ jsxs7(StudioContext.Provider, { value: context, children: [
1116
- /* @__PURE__ */ jsxs7(
1202
+ return /* @__PURE__ */ jsxs8(StudioContext.Provider, { value: context, children: [
1203
+ /* @__PURE__ */ jsxs8(
1117
1204
  "div",
1118
1205
  {
1119
1206
  className: cn(
@@ -1123,7 +1210,7 @@ function Studio({
1123
1210
  children: [
1124
1211
  bar,
1125
1212
  banner && /* @__PURE__ */ jsx15("div", { className: "shrink-0", children: banner }),
1126
- /* @__PURE__ */ jsxs7("div", { className: "relative flex min-h-0 flex-1", children: [
1213
+ /* @__PURE__ */ jsxs8("div", { className: "relative flex min-h-0 flex-1", children: [
1127
1214
  rail && !railInSheet && /* @__PURE__ */ jsx15(
1128
1215
  "aside",
1129
1216
  {
@@ -1132,10 +1219,10 @@ function Studio({
1132
1219
  children: rail
1133
1220
  }
1134
1221
  ),
1135
- /* @__PURE__ */ jsxs7("div", { className: "relative min-w-0 flex-1 overflow-hidden bg-muted/40", children: [
1222
+ /* @__PURE__ */ jsxs8("div", { className: "relative min-w-0 flex-1 overflow-hidden bg-muted/40", children: [
1136
1223
  canvas,
1137
- (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: [
1138
- railInSheet ? /* @__PURE__ */ jsxs7(
1224
+ (railInSheet || inspectorInSheet) && /* @__PURE__ */ jsxs8("div", { className: "pointer-events-none absolute inset-x-3 bottom-3 z-10 flex items-end justify-between gap-2", children: [
1225
+ railInSheet ? /* @__PURE__ */ jsxs8(
1139
1226
  "button",
1140
1227
  {
1141
1228
  type: "button",
@@ -1148,7 +1235,7 @@ function Studio({
1148
1235
  ]
1149
1236
  }
1150
1237
  ) : /* @__PURE__ */ jsx15("span", {}),
1151
- inspectorInSheet && /* @__PURE__ */ jsxs7(
1238
+ inspectorInSheet && /* @__PURE__ */ jsxs8(
1152
1239
  "button",
1153
1240
  {
1154
1241
  type: "button",
@@ -1195,14 +1282,14 @@ import * as React17 from "react";
1195
1282
 
1196
1283
  // src/components/studio/menu.tsx
1197
1284
  import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
1198
- import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
1285
+ import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
1199
1286
  function StudioMenu({
1200
1287
  items,
1201
1288
  label,
1202
1289
  triggerClassName,
1203
1290
  children
1204
1291
  }) {
1205
- return /* @__PURE__ */ jsxs8(DropdownMenuPrimitive.Root, { children: [
1292
+ return /* @__PURE__ */ jsxs9(DropdownMenuPrimitive.Root, { children: [
1206
1293
  /* @__PURE__ */ jsx16(DropdownMenuPrimitive.Trigger, { className: triggerClassName, "aria-label": label, children }),
1207
1294
  /* @__PURE__ */ jsx16(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx16(
1208
1295
  DropdownMenuPrimitive.Content,
@@ -1212,7 +1299,7 @@ function StudioMenu({
1212
1299
  collisionPadding: 8,
1213
1300
  className: "z-50 min-w-[10rem] overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md",
1214
1301
  children: items.map(
1215
- (item, i) => item.type === "separator" ? /* @__PURE__ */ jsx16(DropdownMenuPrimitive.Separator, { className: "-mx-1 my-1 h-px bg-muted" }, i) : /* @__PURE__ */ jsxs8(
1302
+ (item, i) => item.type === "separator" ? /* @__PURE__ */ jsx16(DropdownMenuPrimitive.Separator, { className: "-mx-1 my-1 h-px bg-muted" }, i) : /* @__PURE__ */ jsxs9(
1216
1303
  DropdownMenuPrimitive.Item,
1217
1304
  {
1218
1305
  disabled: item.disabled,
@@ -1235,7 +1322,7 @@ function StudioMenu({
1235
1322
  }
1236
1323
 
1237
1324
  // src/components/studio/StudioBar.tsx
1238
- import { jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
1325
+ import { jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
1239
1326
  function ModeSwitch({
1240
1327
  modes,
1241
1328
  value,
@@ -1258,7 +1345,7 @@ function ModeSwitch({
1258
1345
  className: "flex h-9 w-full items-center gap-1 rounded-lg bg-muted p-1 text-muted-foreground md:w-auto",
1259
1346
  children: modes.map((m, i) => {
1260
1347
  const checked = m.value === value;
1261
- return /* @__PURE__ */ jsxs9(
1348
+ return /* @__PURE__ */ jsxs10(
1262
1349
  "button",
1263
1350
  {
1264
1351
  ref: (el) => {
@@ -1317,7 +1404,7 @@ function StudioBar({
1317
1404
  if (next !== atFocus.current) onTitleChange?.(next);
1318
1405
  atFocus.current = next;
1319
1406
  };
1320
- return /* @__PURE__ */ jsxs9(
1407
+ return /* @__PURE__ */ jsxs10(
1321
1408
  "header",
1322
1409
  {
1323
1410
  className: cn(
@@ -1325,7 +1412,7 @@ function StudioBar({
1325
1412
  className
1326
1413
  ),
1327
1414
  children: [
1328
- /* @__PURE__ */ jsxs9("div", { className: "flex min-w-0 flex-1 items-center gap-1 md:basis-0", children: [
1415
+ /* @__PURE__ */ jsxs10("div", { className: "flex min-w-0 flex-1 items-center gap-1 md:basis-0", children: [
1329
1416
  backHref && /* @__PURE__ */ jsx17(
1330
1417
  "a",
1331
1418
  {
@@ -1336,7 +1423,7 @@ function StudioBar({
1336
1423
  children: /* @__PURE__ */ jsx17(StudioIcon, { name: "arrow-left", size: 18 })
1337
1424
  }
1338
1425
  ),
1339
- /* @__PURE__ */ jsxs9("div", { className: "min-w-0 flex-1", children: [
1426
+ /* @__PURE__ */ jsxs10("div", { className: "min-w-0 flex-1", children: [
1340
1427
  /* @__PURE__ */ jsx17("h1", { className: titleReadonly ? "truncate px-1.5 text-base font-semibold" : "sr-only", children: title || titlePlaceholder }),
1341
1428
  !titleReadonly && /* @__PURE__ */ jsx17(
1342
1429
  "input",
@@ -1376,7 +1463,7 @@ function StudioBar({
1376
1463
  onChange: (v) => v !== mode && onModeChange?.(v)
1377
1464
  }
1378
1465
  ) }),
1379
- /* @__PURE__ */ jsxs9("div", { className: "flex shrink-0 items-center justify-end gap-1 md:flex-1 md:basis-0 md:gap-2", children: [
1466
+ /* @__PURE__ */ jsxs10("div", { className: "flex shrink-0 items-center justify-end gap-1 md:flex-1 md:basis-0 md:gap-2", children: [
1380
1467
  status,
1381
1468
  issues,
1382
1469
  actions,
@@ -1397,7 +1484,7 @@ function StudioBar({
1397
1484
 
1398
1485
  // src/components/studio/StudioOutline.tsx
1399
1486
  import * as React18 from "react";
1400
- import { jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
1487
+ import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
1401
1488
  function StudioOutline({
1402
1489
  items,
1403
1490
  selected = null,
@@ -1458,7 +1545,7 @@ function StudioOutline({
1458
1545
  const row = (entry, index, handle) => {
1459
1546
  const active = entry.id === selected;
1460
1547
  const menu = rowMenu(entry, index);
1461
- return /* @__PURE__ */ jsxs10(
1548
+ return /* @__PURE__ */ jsxs11(
1462
1549
  "div",
1463
1550
  {
1464
1551
  "data-outline-id": entry.id,
@@ -1478,7 +1565,7 @@ function StudioOutline({
1478
1565
  children: /* @__PURE__ */ jsx18(StudioIcon, { name: "grip", size: 14 })
1479
1566
  }
1480
1567
  ),
1481
- /* @__PURE__ */ jsxs10(
1568
+ /* @__PURE__ */ jsxs11(
1482
1569
  "button",
1483
1570
  {
1484
1571
  type: "button",
@@ -1494,10 +1581,10 @@ function StudioOutline({
1494
1581
  onKeyDown: (e) => rowKeyDown(e, index),
1495
1582
  children: [
1496
1583
  renderThumbnail && /* @__PURE__ */ jsx18("div", { className: "w-full overflow-hidden rounded border border-border bg-background", children: renderThumbnail(entry, index) }),
1497
- /* @__PURE__ */ jsxs10("span", { className: "flex min-w-0 items-start gap-2", children: [
1584
+ /* @__PURE__ */ jsxs11("span", { className: "flex min-w-0 items-start gap-2", children: [
1498
1585
  numbered && /* @__PURE__ */ jsx18("span", { className: "w-5 shrink-0 pt-px text-right text-xs tabular-nums text-muted-foreground", children: index + 1 }),
1499
1586
  entry.icon && !renderThumbnail && /* @__PURE__ */ jsx18("span", { className: "mt-px shrink-0 text-muted-foreground", "aria-hidden": "true", children: entry.icon }),
1500
- /* @__PURE__ */ jsxs10("span", { className: "min-w-0 flex-1", children: [
1587
+ /* @__PURE__ */ jsxs11("span", { className: "min-w-0 flex-1", children: [
1501
1588
  /* @__PURE__ */ jsx18(
1502
1589
  "span",
1503
1590
  {
@@ -1508,7 +1595,7 @@ function StudioOutline({
1508
1595
  entry.subtitle && /* @__PURE__ */ jsx18("span", { className: "block truncate text-xs text-muted-foreground", children: entry.subtitle })
1509
1596
  ] }),
1510
1597
  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 }),
1511
- !!entry.issues && /* @__PURE__ */ jsxs10("span", { className: "inline-flex shrink-0 items-center gap-0.5 text-xs font-medium tabular-nums", children: [
1598
+ !!entry.issues && /* @__PURE__ */ jsxs11("span", { className: "inline-flex shrink-0 items-center gap-0.5 text-xs font-medium tabular-nums", children: [
1512
1599
  /* @__PURE__ */ jsx18(
1513
1600
  StudioIcon,
1514
1601
  {
@@ -1546,7 +1633,7 @@ function StudioOutline({
1546
1633
  }
1547
1634
  );
1548
1635
  };
1549
- return /* @__PURE__ */ jsxs10("div", { className: cn("flex h-full min-h-0 flex-col", className), children: [
1636
+ return /* @__PURE__ */ jsxs11("div", { className: cn("flex h-full min-h-0 flex-col", className), children: [
1550
1637
  header && /* @__PURE__ */ jsx18("div", { className: "shrink-0 border-b border-border px-3 py-2", children: header }),
1551
1638
  /* @__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(
1552
1639
  SortableList,
@@ -1560,7 +1647,7 @@ function StudioOutline({
1560
1647
  renderItem: ({ item, index, handle }) => row(item, index, handle)
1561
1648
  }
1562
1649
  ) : /* @__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)) }) }),
1563
- onAdd && /* @__PURE__ */ jsx18("div", { className: "shrink-0 border-t border-border p-2", children: /* @__PURE__ */ jsxs10(
1650
+ onAdd && /* @__PURE__ */ jsx18("div", { className: "shrink-0 border-t border-border p-2", children: /* @__PURE__ */ jsxs11(
1564
1651
  "button",
1565
1652
  {
1566
1653
  type: "button",
@@ -1577,7 +1664,7 @@ function StudioOutline({
1577
1664
 
1578
1665
  // src/components/studio/StudioCanvas.tsx
1579
1666
  import * as React19 from "react";
1580
- import { jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
1667
+ import { jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
1581
1668
  var DEVICES = ["desktop", "phone"];
1582
1669
  function StudioCanvas({
1583
1670
  children,
@@ -1618,8 +1705,8 @@ function StudioCanvas({
1618
1705
  onBackgroundClick();
1619
1706
  };
1620
1707
  const width = device === "phone" && showDevices ? "390px" : maxWidth;
1621
- return /* @__PURE__ */ jsxs11("section", { "aria-label": label, className: cn("flex h-full flex-col", className), children: [
1622
- (showDevices || toolbar) && /* @__PURE__ */ jsxs11("div", { className: "flex shrink-0 items-center justify-end gap-2 px-3 pt-3", children: [
1708
+ return /* @__PURE__ */ jsxs12("section", { "aria-label": label, className: cn("flex h-full flex-col", className), children: [
1709
+ (showDevices || toolbar) && /* @__PURE__ */ jsxs12("div", { className: "flex shrink-0 items-center justify-end gap-2 px-3 pt-3", children: [
1623
1710
  toolbar,
1624
1711
  showDevices && /* @__PURE__ */ jsx19(
1625
1712
  "div",
@@ -1627,7 +1714,7 @@ function StudioCanvas({
1627
1714
  role: "radiogroup",
1628
1715
  "aria-label": "Preview size",
1629
1716
  className: "inline-flex h-9 items-center gap-1 rounded-lg bg-muted p-1 text-muted-foreground",
1630
- children: DEVICES.map((d, i) => /* @__PURE__ */ jsxs11(
1717
+ children: DEVICES.map((d, i) => /* @__PURE__ */ jsxs12(
1631
1718
  "button",
1632
1719
  {
1633
1720
  ref: (el) => {
@@ -1679,7 +1766,7 @@ function StudioCanvas({
1679
1766
 
1680
1767
  // src/components/studio/StudioCanvasItem.tsx
1681
1768
  import * as React20 from "react";
1682
- import { jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
1769
+ import { jsx as jsx20, jsxs as jsxs13 } from "react/jsx-runtime";
1683
1770
  function StudioCanvasItem({
1684
1771
  children,
1685
1772
  selected = false,
@@ -1709,7 +1796,7 @@ function StudioCanvasItem({
1709
1796
  const reduce = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
1710
1797
  el.scrollIntoView?.({ block: "nearest", behavior: reduce ? "auto" : "smooth" });
1711
1798
  }, [selected]);
1712
- return /* @__PURE__ */ jsxs12(
1799
+ return /* @__PURE__ */ jsxs13(
1713
1800
  "div",
1714
1801
  {
1715
1802
  ref,
@@ -1735,7 +1822,7 @@ function StudioCanvasItem({
1735
1822
  select(false);
1736
1823
  },
1737
1824
  children: [
1738
- /* @__PURE__ */ jsxs12(
1825
+ /* @__PURE__ */ jsxs13(
1739
1826
  "button",
1740
1827
  {
1741
1828
  type: "button",
@@ -1783,7 +1870,7 @@ function StudioCanvasItem({
1783
1870
 
1784
1871
  // src/components/studio/StudioInspector.tsx
1785
1872
  import * as React21 from "react";
1786
- import { jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
1873
+ import { jsx as jsx21, jsxs as jsxs14 } from "react/jsx-runtime";
1787
1874
  function StudioInspector({
1788
1875
  title,
1789
1876
  description,
@@ -1814,9 +1901,9 @@ function StudioInspector({
1814
1901
  choose(next.id);
1815
1902
  document.getElementById(`${uid}-tab-${next.id}`)?.focus();
1816
1903
  };
1817
- return /* @__PURE__ */ jsxs13("div", { className: cn("flex h-full min-h-0 flex-col", className), children: [
1818
- (title || headerActions) && /* @__PURE__ */ jsxs13("div", { className: "flex shrink-0 items-start gap-2 border-b border-border px-4 py-3", children: [
1819
- /* @__PURE__ */ jsxs13("div", { className: "min-w-0 flex-1", children: [
1904
+ return /* @__PURE__ */ jsxs14("div", { className: cn("flex h-full min-h-0 flex-col", className), children: [
1905
+ (title || headerActions) && /* @__PURE__ */ jsxs14("div", { className: "flex shrink-0 items-start gap-2 border-b border-border px-4 py-3", children: [
1906
+ /* @__PURE__ */ jsxs14("div", { className: "min-w-0 flex-1", children: [
1820
1907
  title && /* @__PURE__ */ jsx21("h2", { className: "truncate text-sm font-semibold", children: title }),
1821
1908
  description && /* @__PURE__ */ jsx21("p", { className: "truncate text-xs text-muted-foreground", children: description })
1822
1909
  ] }),
@@ -1828,7 +1915,7 @@ function StudioInspector({
1828
1915
  role: "tablist",
1829
1916
  "aria-label": title ?? "Inspector",
1830
1917
  className: "flex shrink-0 gap-4 border-b border-border px-4",
1831
- children: tabs.map((t, index) => /* @__PURE__ */ jsxs13(
1918
+ children: tabs.map((t, index) => /* @__PURE__ */ jsxs14(
1832
1919
  "button",
1833
1920
  {
1834
1921
  type: "button",
@@ -1877,13 +1964,13 @@ function StudioInspectorSection({
1877
1964
  const uid = React21.useId();
1878
1965
  const [open, setOpen] = React21.useState(defaultOpen);
1879
1966
  const expanded = !collapsible || open;
1880
- return /* @__PURE__ */ jsxs13(
1967
+ return /* @__PURE__ */ jsxs14(
1881
1968
  "section",
1882
1969
  {
1883
1970
  className: cn("border-b border-border px-4 py-4 last:border-b-0", className),
1884
1971
  "aria-labelledby": title ? `${uid}-title` : void 0,
1885
1972
  children: [
1886
- title && (collapsible ? /* @__PURE__ */ jsx21("h3", { id: `${uid}-title`, className: "-my-1", children: /* @__PURE__ */ jsxs13(
1973
+ title && (collapsible ? /* @__PURE__ */ jsx21("h3", { id: `${uid}-title`, className: "-my-1", children: /* @__PURE__ */ jsxs14(
1887
1974
  "button",
1888
1975
  {
1889
1976
  type: "button",
@@ -1917,13 +2004,13 @@ function StudioPage({
1917
2004
  maxWidth = "42rem",
1918
2005
  className
1919
2006
  }) {
1920
- return /* @__PURE__ */ jsx21("div", { className: "h-full overflow-y-auto bg-muted/40", children: /* @__PURE__ */ jsxs13(
2007
+ return /* @__PURE__ */ jsx21("div", { className: "h-full overflow-y-auto bg-muted/40", children: /* @__PURE__ */ jsxs14(
1921
2008
  "div",
1922
2009
  {
1923
2010
  className: cn("mx-auto w-full space-y-6 px-4 py-6 md:py-10", className),
1924
2011
  style: { maxWidth },
1925
2012
  children: [
1926
- (title || description) && /* @__PURE__ */ jsxs13("div", { children: [
2013
+ (title || description) && /* @__PURE__ */ jsxs14("div", { children: [
1927
2014
  title && /* @__PURE__ */ jsx21("h2", { className: "text-xl font-semibold", children: title }),
1928
2015
  description && /* @__PURE__ */ jsx21("p", { className: "mt-1 text-sm text-muted-foreground", children: description })
1929
2016
  ] }),
@@ -1935,7 +2022,7 @@ function StudioPage({
1935
2022
 
1936
2023
  // src/components/studio/SaveStatus.tsx
1937
2024
  import * as PopoverPrimitive from "@radix-ui/react-popover";
1938
- import { Fragment as Fragment4, jsx as jsx22, jsxs as jsxs14 } from "react/jsx-runtime";
2025
+ import { Fragment as Fragment4, jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
1939
2026
  var META = {
1940
2027
  saved: { label: "Saved", icon: "check-circle", tone: "text-muted-foreground" },
1941
2028
  saving: { label: "Saving\u2026", icon: "loader", tone: "text-muted-foreground" },
@@ -1952,7 +2039,7 @@ function SaveStatus({ state, detail, onRetry, label, className }) {
1952
2039
  const text = label ?? meta.label;
1953
2040
  const canRetry = !!onRetry && (state === "error" || state === "offline");
1954
2041
  const announced = ["error", "offline", "conflict", "invalid"].includes(state);
1955
- const content = /* @__PURE__ */ jsxs14(Fragment4, { children: [
2042
+ const content = /* @__PURE__ */ jsxs15(Fragment4, { children: [
1956
2043
  /* @__PURE__ */ jsx22(
1957
2044
  StudioIcon,
1958
2045
  {
@@ -1962,9 +2049,9 @@ function SaveStatus({ state, detail, onRetry, label, className }) {
1962
2049
  ),
1963
2050
  /* @__PURE__ */ jsx22("span", { className: "sr-only sm:not-sr-only", children: text })
1964
2051
  ] });
1965
- return /* @__PURE__ */ jsxs14("div", { className: cn("inline-flex", className), children: [
1966
- detail || canRetry ? /* @__PURE__ */ jsxs14(PopoverPrimitive.Root, { children: [
1967
- /* @__PURE__ */ jsxs14(
2052
+ return /* @__PURE__ */ jsxs15("div", { className: cn("inline-flex", className), children: [
2053
+ detail || canRetry ? /* @__PURE__ */ jsxs15(PopoverPrimitive.Root, { children: [
2054
+ /* @__PURE__ */ jsxs15(
1968
2055
  PopoverPrimitive.Trigger,
1969
2056
  {
1970
2057
  className: cn(
@@ -1978,7 +2065,7 @@ function SaveStatus({ state, detail, onRetry, label, className }) {
1978
2065
  ]
1979
2066
  }
1980
2067
  ),
1981
- /* @__PURE__ */ jsx22(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsxs14(
2068
+ /* @__PURE__ */ jsx22(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsxs15(
1982
2069
  PopoverPrimitive.Content,
1983
2070
  {
1984
2071
  align: "end",
@@ -1988,7 +2075,7 @@ function SaveStatus({ state, detail, onRetry, label, className }) {
1988
2075
  children: [
1989
2076
  /* @__PURE__ */ jsx22("p", { className: "font-medium", children: text }),
1990
2077
  detail && /* @__PURE__ */ jsx22("p", { className: "mt-1 text-muted-foreground", children: detail }),
1991
- canRetry && /* @__PURE__ */ jsxs14(
2078
+ canRetry && /* @__PURE__ */ jsxs15(
1992
2079
  "button",
1993
2080
  {
1994
2081
  type: "button",
@@ -2011,7 +2098,7 @@ function SaveStatus({ state, detail, onRetry, label, className }) {
2011
2098
  // src/components/studio/IssuesButton.tsx
2012
2099
  import * as React22 from "react";
2013
2100
  import * as PopoverPrimitive2 from "@radix-ui/react-popover";
2014
- import { Fragment as Fragment5, jsx as jsx23, jsxs as jsxs15 } from "react/jsx-runtime";
2101
+ import { Fragment as Fragment5, jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
2015
2102
  var plural = (n, one, many) => `${n} ${n === 1 ? one : many}`;
2016
2103
  function IssuesButton({
2017
2104
  issues,
@@ -2035,7 +2122,7 @@ function IssuesButton({
2035
2122
  warnings.length ? plural(warnings.length, "suggestion", "suggestions") : ""
2036
2123
  ].filter(Boolean).join(", ");
2037
2124
  if (issues.length === 0) {
2038
- return showWhenEmpty ? /* @__PURE__ */ jsxs15(
2125
+ return showWhenEmpty ? /* @__PURE__ */ jsxs16(
2039
2126
  "span",
2040
2127
  {
2041
2128
  className: cn(
@@ -2049,9 +2136,9 @@ function IssuesButton({
2049
2136
  }
2050
2137
  ) : null;
2051
2138
  }
2052
- const group = (list, heading, error) => list.length > 0 && /* @__PURE__ */ jsxs15(Fragment5, { children: [
2139
+ const group = (list, heading, error) => list.length > 0 && /* @__PURE__ */ jsxs16(Fragment5, { children: [
2053
2140
  /* @__PURE__ */ jsx23("p", { className: "px-3 pb-1 pt-2 text-xs font-medium uppercase tracking-wide text-muted-foreground", children: heading }),
2054
- /* @__PURE__ */ jsx23("ul", { className: "pb-1", children: list.map((issue) => /* @__PURE__ */ jsx23("li", { children: /* @__PURE__ */ jsxs15(
2141
+ /* @__PURE__ */ jsx23("ul", { className: "pb-1", children: list.map((issue) => /* @__PURE__ */ jsx23("li", { children: /* @__PURE__ */ jsxs16(
2055
2142
  "button",
2056
2143
  {
2057
2144
  type: "button",
@@ -2068,7 +2155,7 @@ function IssuesButton({
2068
2155
  className: cn("mt-0.5", error ? "text-destructive" : "text-warning")
2069
2156
  }
2070
2157
  ),
2071
- /* @__PURE__ */ jsxs15("span", { className: "min-w-0 flex-1", children: [
2158
+ /* @__PURE__ */ jsxs16("span", { className: "min-w-0 flex-1", children: [
2072
2159
  issue.location && /* @__PURE__ */ jsx23("span", { className: "block text-xs text-muted-foreground", children: issue.location }),
2073
2160
  issue.message
2074
2161
  ] })
@@ -2076,8 +2163,8 @@ function IssuesButton({
2076
2163
  }
2077
2164
  ) }, issue.id)) })
2078
2165
  ] });
2079
- return /* @__PURE__ */ jsxs15(PopoverPrimitive2.Root, { open, onOpenChange: setOpen, children: [
2080
- /* @__PURE__ */ jsxs15(
2166
+ return /* @__PURE__ */ jsxs16(PopoverPrimitive2.Root, { open, onOpenChange: setOpen, children: [
2167
+ /* @__PURE__ */ jsxs16(
2081
2168
  PopoverPrimitive2.Trigger,
2082
2169
  {
2083
2170
  "aria-label": countLabel,
@@ -2097,7 +2184,7 @@ function IssuesButton({
2097
2184
  ]
2098
2185
  }
2099
2186
  ),
2100
- /* @__PURE__ */ jsx23(PopoverPrimitive2.Portal, { children: /* @__PURE__ */ jsxs15(
2187
+ /* @__PURE__ */ jsx23(PopoverPrimitive2.Portal, { children: /* @__PURE__ */ jsxs16(
2101
2188
  PopoverPrimitive2.Content,
2102
2189
  {
2103
2190
  align: "end",
@@ -2105,11 +2192,11 @@ function IssuesButton({
2105
2192
  collisionPadding: 8,
2106
2193
  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",
2107
2194
  children: [
2108
- /* @__PURE__ */ jsxs15("div", { className: "border-b border-border px-3 py-2", children: [
2195
+ /* @__PURE__ */ jsxs16("div", { className: "border-b border-border px-3 py-2", children: [
2109
2196
  /* @__PURE__ */ jsx23("p", { className: "text-sm font-semibold", children: title }),
2110
2197
  /* @__PURE__ */ jsx23("p", { className: "text-xs text-muted-foreground", children: countLabel })
2111
2198
  ] }),
2112
- /* @__PURE__ */ jsxs15("div", { className: "overflow-y-auto", children: [
2199
+ /* @__PURE__ */ jsxs16("div", { className: "overflow-y-auto", children: [
2113
2200
  group(errors, "Must fix", true),
2114
2201
  group(warnings, "Suggestions", false)
2115
2202
  ] })
@@ -2121,7 +2208,7 @@ function IssuesButton({
2121
2208
 
2122
2209
  // src/components/studio/InsertPalette.tsx
2123
2210
  import * as React23 from "react";
2124
- import { jsx as jsx24, jsxs as jsxs16 } from "react/jsx-runtime";
2211
+ import { jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
2125
2212
  function InsertPalette({
2126
2213
  open,
2127
2214
  onOpenChange,
@@ -2160,7 +2247,7 @@ function InsertPalette({
2160
2247
  const entries = () => Array.from(
2161
2248
  listRef.current?.querySelectorAll("[data-palette-item]:not(:disabled)") ?? []
2162
2249
  );
2163
- return /* @__PURE__ */ jsx24(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs16(
2250
+ return /* @__PURE__ */ jsx24(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs17(
2164
2251
  DialogContent,
2165
2252
  {
2166
2253
  size: renderThumbnail ? "2xl" : "xl",
@@ -2176,7 +2263,7 @@ function InsertPalette({
2176
2263
  children: [
2177
2264
  /* @__PURE__ */ jsx24(DialogTitle, { children: title }),
2178
2265
  description && /* @__PURE__ */ jsx24(DialogDescription, { children: description }),
2179
- /* @__PURE__ */ jsxs16("div", { className: "relative", children: [
2266
+ /* @__PURE__ */ jsxs17("div", { className: "relative", children: [
2180
2267
  /* @__PURE__ */ jsx24(
2181
2268
  StudioIcon,
2182
2269
  {
@@ -2206,13 +2293,13 @@ function InsertPalette({
2206
2293
  }
2207
2294
  )
2208
2295
  ] }),
2209
- /* @__PURE__ */ jsxs16("div", { ref: listRef, className: "space-y-5", children: [
2210
- filtered.length === 0 && /* @__PURE__ */ jsxs16("p", { className: "py-8 text-center text-sm text-muted-foreground", children: [
2296
+ /* @__PURE__ */ jsxs17("div", { ref: listRef, className: "space-y-5", children: [
2297
+ filtered.length === 0 && /* @__PURE__ */ jsxs17("p", { className: "py-8 text-center text-sm text-muted-foreground", children: [
2211
2298
  "Nothing matches \u201C",
2212
2299
  query,
2213
2300
  "\u201D."
2214
2301
  ] }),
2215
- filtered.map((group) => /* @__PURE__ */ jsxs16("section", { "aria-label": group.label, children: [
2302
+ filtered.map((group) => /* @__PURE__ */ jsxs17("section", { "aria-label": group.label, children: [
2216
2303
  /* @__PURE__ */ jsx24("h3", { className: "mb-2 text-xs font-medium uppercase tracking-wide text-muted-foreground", children: group.label }),
2217
2304
  /* @__PURE__ */ jsx24(
2218
2305
  "ul",
@@ -2221,7 +2308,7 @@ function InsertPalette({
2221
2308
  "grid gap-2",
2222
2309
  renderThumbnail ? "grid-cols-2 sm:grid-cols-3" : "grid-cols-1 sm:grid-cols-2"
2223
2310
  ),
2224
- children: group.items.map((item) => /* @__PURE__ */ jsx24("li", { children: /* @__PURE__ */ jsxs16(
2311
+ children: group.items.map((item) => /* @__PURE__ */ jsx24("li", { children: /* @__PURE__ */ jsxs17(
2225
2312
  "button",
2226
2313
  {
2227
2314
  type: "button",
@@ -2251,7 +2338,7 @@ function InsertPalette({
2251
2338
  children: item.icon
2252
2339
  }
2253
2340
  ),
2254
- /* @__PURE__ */ jsxs16("span", { className: "min-w-0", children: [
2341
+ /* @__PURE__ */ jsxs17("span", { className: "min-w-0", children: [
2255
2342
  /* @__PURE__ */ jsx24("span", { className: "block text-sm font-medium", children: item.label }),
2256
2343
  item.description && /* @__PURE__ */ jsx24("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: item.description })
2257
2344
  ] })
@@ -2272,7 +2359,7 @@ import * as React25 from "react";
2272
2359
  import * as DropdownMenuPrimitive2 from "@radix-ui/react-dropdown-menu";
2273
2360
 
2274
2361
  // src/hooks/useFocusTrap.ts
2275
- import { useEffect as useEffect8, useRef as useRef8, useCallback as useCallback3 } from "react";
2362
+ import { useEffect as useEffect8, useRef as useRef9, useCallback as useCallback4 } from "react";
2276
2363
  var FOCUSABLE_SELECTOR = [
2277
2364
  "a[href]",
2278
2365
  "area[href]",
@@ -2283,35 +2370,49 @@ var FOCUSABLE_SELECTOR = [
2283
2370
  "iframe",
2284
2371
  "object",
2285
2372
  "embed",
2286
- "[contenteditable]",
2373
+ '[contenteditable]:not([contenteditable="false"])',
2287
2374
  '[tabindex]:not([tabindex="-1"])'
2288
2375
  ].join(",");
2289
2376
  function getFocusableElements(container) {
2290
2377
  const elements = container.querySelectorAll(FOCUSABLE_SELECTOR);
2291
2378
  return Array.from(elements).filter(
2292
- (el) => el.offsetParent !== null && getComputedStyle(el).visibility !== "hidden"
2379
+ (el) => el.tabIndex >= 0 && !el.matches(":disabled") && !el.closest("[inert],[hidden]") && el.offsetParent !== null && getComputedStyle(el).visibility !== "hidden"
2293
2380
  );
2294
2381
  }
2382
+ function precedes(a, b) {
2383
+ return Boolean(a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING);
2384
+ }
2295
2385
  function useFocusTrap(options = {}) {
2296
2386
  const { active = true, returnFocusTo, initialFocus, preventScroll = false } = options;
2297
- const containerRef = useRef8(null);
2298
- const previousActiveElementRef = useRef8(null);
2299
- const handleKeyDown = useCallback3(
2387
+ const containerRef = useRef9(null);
2388
+ const previousActiveElementRef = useRef9(null);
2389
+ const handleKeyDown = useCallback4(
2300
2390
  (event) => {
2301
2391
  if (!active || event.key !== "Tab") return;
2302
2392
  const container = containerRef.current;
2303
2393
  if (!container) return;
2394
+ const current = document.activeElement;
2395
+ if (!current || !container.contains(current)) return;
2304
2396
  const focusableElements = getFocusableElements(container);
2305
- if (focusableElements.length === 0) return;
2397
+ if (focusableElements.length === 0) {
2398
+ event.preventDefault();
2399
+ container.focus({ preventScroll });
2400
+ return;
2401
+ }
2306
2402
  const firstElement = focusableElements[0];
2307
2403
  const lastElement = focusableElements[focusableElements.length - 1];
2404
+ if (current === container) {
2405
+ event.preventDefault();
2406
+ (event.shiftKey ? lastElement : firstElement).focus({ preventScroll });
2407
+ return;
2408
+ }
2308
2409
  if (event.shiftKey) {
2309
- if (document.activeElement === firstElement) {
2410
+ if (current === firstElement || precedes(current, firstElement)) {
2310
2411
  event.preventDefault();
2311
2412
  lastElement.focus({ preventScroll });
2312
2413
  }
2313
2414
  } else {
2314
- if (document.activeElement === lastElement) {
2415
+ if (current === lastElement || precedes(lastElement, current)) {
2315
2416
  event.preventDefault();
2316
2417
  firstElement.focus({ preventScroll });
2317
2418
  }
@@ -2324,24 +2425,30 @@ function useFocusTrap(options = {}) {
2324
2425
  const container = containerRef.current;
2325
2426
  if (!container) return;
2326
2427
  previousActiveElementRef.current = document.activeElement;
2428
+ let addedTabIndex = false;
2327
2429
  const focusableElements = getFocusableElements(container);
2328
- let focusFrame = 0;
2329
- if (focusableElements.length > 0) {
2330
- let elementToFocus = null;
2331
- if (initialFocus) {
2332
- elementToFocus = container.querySelector(initialFocus);
2333
- }
2334
- if (!elementToFocus) {
2335
- elementToFocus = focusableElements[0];
2430
+ let elementToFocus = null;
2431
+ if (initialFocus) {
2432
+ elementToFocus = container.querySelector(initialFocus);
2433
+ }
2434
+ if (!elementToFocus) {
2435
+ elementToFocus = focusableElements[0] ?? null;
2436
+ }
2437
+ if (!elementToFocus) {
2438
+ if (!container.hasAttribute("tabindex")) {
2439
+ container.setAttribute("tabindex", "-1");
2440
+ addedTabIndex = true;
2336
2441
  }
2337
- focusFrame = requestAnimationFrame(() => {
2338
- elementToFocus?.focus({ preventScroll });
2339
- });
2442
+ elementToFocus = container;
2340
2443
  }
2444
+ const focusFrame = requestAnimationFrame(() => {
2445
+ elementToFocus?.focus({ preventScroll });
2446
+ });
2341
2447
  document.addEventListener("keydown", handleKeyDown);
2342
2448
  return () => {
2343
2449
  cancelAnimationFrame(focusFrame);
2344
2450
  document.removeEventListener("keydown", handleKeyDown);
2451
+ if (addedTabIndex) container.removeAttribute("tabindex");
2345
2452
  const elementToReturn = returnFocusTo ?? previousActiveElementRef.current;
2346
2453
  if (elementToReturn && typeof elementToReturn.focus === "function") {
2347
2454
  elementToReturn.focus({ preventScroll });
@@ -2413,7 +2520,7 @@ import {
2413
2520
  calculateDetachedPositionFromPinned,
2414
2521
  getPinnedPullTransform
2415
2522
  } from "@classic-homes/data-panel-core";
2416
- import { Fragment as Fragment6, jsx as jsx25, jsxs as jsxs17 } from "react/jsx-runtime";
2523
+ import { Fragment as Fragment6, jsx as jsx25, jsxs as jsxs18 } from "react/jsx-runtime";
2417
2524
  function layoutViewportWidth() {
2418
2525
  return document.documentElement.clientWidth;
2419
2526
  }
@@ -2558,7 +2665,7 @@ var ChevronUpIcon = () => /* @__PURE__ */ jsx25(
2558
2665
  children: /* @__PURE__ */ jsx25("path", { d: "m18 15-6-6-6 6" })
2559
2666
  }
2560
2667
  );
2561
- var MoreVerticalIcon = () => /* @__PURE__ */ jsxs17(
2668
+ var MoreVerticalIcon = () => /* @__PURE__ */ jsxs18(
2562
2669
  "svg",
2563
2670
  {
2564
2671
  xmlns: "http://www.w3.org/2000/svg",
@@ -2577,7 +2684,7 @@ var MoreVerticalIcon = () => /* @__PURE__ */ jsxs17(
2577
2684
  ]
2578
2685
  }
2579
2686
  );
2580
- var CloseIcon = () => /* @__PURE__ */ jsxs17(
2687
+ var CloseIcon = () => /* @__PURE__ */ jsxs18(
2581
2688
  "svg",
2582
2689
  {
2583
2690
  xmlns: "http://www.w3.org/2000/svg",
@@ -2595,7 +2702,7 @@ var CloseIcon = () => /* @__PURE__ */ jsxs17(
2595
2702
  ]
2596
2703
  }
2597
2704
  );
2598
- var GripIcon = () => /* @__PURE__ */ jsxs17(
2705
+ var GripIcon = () => /* @__PURE__ */ jsxs18(
2599
2706
  "svg",
2600
2707
  {
2601
2708
  xmlns: "http://www.w3.org/2000/svg",
@@ -2638,7 +2745,7 @@ var DataPanelHeader = React25.forwardRef(
2638
2745
  className,
2639
2746
  draggable = false
2640
2747
  }, ref) => {
2641
- return /* @__PURE__ */ jsxs17(
2748
+ return /* @__PURE__ */ jsxs18(
2642
2749
  "div",
2643
2750
  {
2644
2751
  ref,
@@ -2650,11 +2757,11 @@ var DataPanelHeader = React25.forwardRef(
2650
2757
  ),
2651
2758
  "data-panel-header": true,
2652
2759
  children: [
2653
- /* @__PURE__ */ jsx25("div", { className: "flex flex-col min-w-0 flex-1", children: headerContent ? headerContent : /* @__PURE__ */ jsxs17(Fragment6, { children: [
2760
+ /* @__PURE__ */ jsx25("div", { className: "flex flex-col min-w-0 flex-1", children: headerContent ? headerContent : /* @__PURE__ */ jsxs18(Fragment6, { children: [
2654
2761
  title && /* @__PURE__ */ jsx25("h3", { id: titleId, className: "text-sm font-semibold leading-none truncate", children: title }),
2655
2762
  subtitle && /* @__PURE__ */ jsx25("p", { className: "text-xs text-muted-foreground mt-1 truncate", children: subtitle })
2656
2763
  ] }) }),
2657
- /* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-1 shrink-0", children: [
2764
+ /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-1 shrink-0", children: [
2658
2765
  headerActions,
2659
2766
  /* @__PURE__ */ jsx25(
2660
2767
  "button",
@@ -2684,7 +2791,7 @@ var DataPanelHeader = React25.forwardRef(
2684
2791
  )
2685
2792
  }
2686
2793
  ),
2687
- !disableModeSwitch && /* @__PURE__ */ jsxs17(DropdownMenuPrimitive2.Root, { children: [
2794
+ !disableModeSwitch && /* @__PURE__ */ jsxs18(DropdownMenuPrimitive2.Root, { children: [
2688
2795
  /* @__PURE__ */ jsx25(DropdownTrigger, { asChild: true, children: /* @__PURE__ */ jsx25(
2689
2796
  "button",
2690
2797
  {
@@ -2694,7 +2801,7 @@ var DataPanelHeader = React25.forwardRef(
2694
2801
  children: /* @__PURE__ */ jsx25(MoreVerticalIcon, {})
2695
2802
  }
2696
2803
  ) }),
2697
- /* @__PURE__ */ jsx25(DropdownMenuPrimitive2.Portal, { children: /* @__PURE__ */ jsxs17(
2804
+ /* @__PURE__ */ jsx25(DropdownMenuPrimitive2.Portal, { children: /* @__PURE__ */ jsxs18(
2698
2805
  DropdownContent,
2699
2806
  {
2700
2807
  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",
@@ -2702,7 +2809,7 @@ var DataPanelHeader = React25.forwardRef(
2702
2809
  align: "end",
2703
2810
  children: [
2704
2811
  /* @__PURE__ */ jsx25(DropdownLabel, { className: "px-2 py-1.5 text-sm font-semibold", children: "Panel Position" }),
2705
- /* @__PURE__ */ jsxs17(
2812
+ /* @__PURE__ */ jsxs18(
2706
2813
  DropdownRadioGroup,
2707
2814
  {
2708
2815
  value: mode === "detached" ? "detached" : edge,
@@ -2715,12 +2822,12 @@ var DataPanelHeader = React25.forwardRef(
2715
2822
  onEdgeChange?.(value);
2716
2823
  },
2717
2824
  children: [
2718
- ["left", "right", "top", "bottom"].map((e) => /* @__PURE__ */ jsxs17(DropdownRadioItem, { value: e, className: menuRadioItemClass, children: [
2825
+ ["left", "right", "top", "bottom"].map((e) => /* @__PURE__ */ jsxs18(DropdownRadioItem, { value: e, className: menuRadioItemClass, children: [
2719
2826
  edgeLabels[e],
2720
2827
  /* @__PURE__ */ jsx25(DropdownItemIndicator, { className: "ml-auto text-xs", children: "\u2713" })
2721
2828
  ] }, e)),
2722
2829
  /* @__PURE__ */ jsx25(DropdownSeparator, { className: "-mx-1 my-1 h-px bg-muted" }),
2723
- /* @__PURE__ */ jsxs17(DropdownRadioItem, { value: "detached", className: menuRadioItemClass, children: [
2830
+ /* @__PURE__ */ jsxs18(DropdownRadioItem, { value: "detached", className: menuRadioItemClass, children: [
2724
2831
  "Detach",
2725
2832
  /* @__PURE__ */ jsx25(DropdownItemIndicator, { className: "ml-auto text-xs", children: "\u2713" })
2726
2833
  ] })
@@ -2767,7 +2874,7 @@ function DataPanelCardHeader({
2767
2874
  e.preventDefault();
2768
2875
  onToggleExpand();
2769
2876
  };
2770
- return /* @__PURE__ */ jsxs17(
2877
+ return /* @__PURE__ */ jsxs18(
2771
2878
  "div",
2772
2879
  {
2773
2880
  "data-panel-header": true,
@@ -2794,13 +2901,13 @@ function DataPanelCardHeader({
2794
2901
  tabIndex: 0,
2795
2902
  "aria-expanded": isExpanded,
2796
2903
  onKeyDown: onToggleKeyDown,
2797
- children: headerContent ? headerContent : /* @__PURE__ */ jsxs17(Fragment6, { children: [
2904
+ children: headerContent ? headerContent : /* @__PURE__ */ jsxs18(Fragment6, { children: [
2798
2905
  subtitle && /* @__PURE__ */ jsx25("p", { className: "text-sm text-muted-foreground truncate", children: subtitle }),
2799
2906
  title && /* @__PURE__ */ jsx25("h3", { id: titleId, className: "text-lg font-semibold truncate", children: title })
2800
2907
  ] })
2801
2908
  }
2802
2909
  ),
2803
- /* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-1 shrink-0", children: [
2910
+ /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-1 shrink-0", children: [
2804
2911
  headerActions,
2805
2912
  !isMobile && /* @__PURE__ */ jsx25(
2806
2913
  "button",
@@ -2873,7 +2980,7 @@ var DataPanelFooter = React25.forwardRef(
2873
2980
  "flex items-center justify-end gap-2 border-t border-border bg-muted/30 px-4 py-3",
2874
2981
  className
2875
2982
  ),
2876
- children: footerContent ? footerContent : /* @__PURE__ */ jsxs17(Fragment6, { children: [
2983
+ children: footerContent ? footerContent : /* @__PURE__ */ jsxs18(Fragment6, { children: [
2877
2984
  footerActions,
2878
2985
  actions.map((action, index) => /* @__PURE__ */ jsx25(
2879
2986
  Button,
@@ -3016,7 +3123,7 @@ var DataPanelTab = React25.forwardRef(
3016
3123
  window.addEventListener("resize", reclamp);
3017
3124
  return () => window.removeEventListener("resize", reclamp);
3018
3125
  }, [edge, tabWidth, offset, onOffsetChange, dragOffset]);
3019
- return /* @__PURE__ */ jsxs17(
3126
+ return /* @__PURE__ */ jsxs18(
3020
3127
  "div",
3021
3128
  {
3022
3129
  ref: setRefs,
@@ -3042,7 +3149,7 @@ var DataPanelTab = React25.forwardRef(
3042
3149
  onPointerUp: draggable ? handlePointerUp : void 0,
3043
3150
  onPointerCancel: draggable ? handlePointerCancel : void 0,
3044
3151
  children: [
3045
- /* @__PURE__ */ jsxs17(
3152
+ /* @__PURE__ */ jsxs18(
3046
3153
  "button",
3047
3154
  {
3048
3155
  type: "button",
@@ -4169,7 +4276,7 @@ var DataPanel = React25.forwardRef(
4169
4276
  }
4170
4277
  );
4171
4278
  }
4172
- return /* @__PURE__ */ jsxs17(Fragment6, { children: [
4279
+ return /* @__PURE__ */ jsxs18(Fragment6, { children: [
4173
4280
  snapPreview && /* @__PURE__ */ jsx25(
4174
4281
  "div",
4175
4282
  {
@@ -4190,7 +4297,7 @@ var DataPanel = React25.forwardRef(
4190
4297
  onClick: handleToggleExpand
4191
4298
  }
4192
4299
  ),
4193
- /* @__PURE__ */ jsxs17(
4300
+ /* @__PURE__ */ jsxs18(
4194
4301
  "div",
4195
4302
  {
4196
4303
  ref: setPanelRef,
@@ -4247,7 +4354,7 @@ var DataPanel = React25.forwardRef(
4247
4354
  draggable: !disableDrag && (mode === "detached" || mode === "pinned" && detachThreshold > 0)
4248
4355
  }
4249
4356
  ),
4250
- showContent && /* @__PURE__ */ jsxs17(Fragment6, { children: [
4357
+ showContent && /* @__PURE__ */ jsxs18(Fragment6, { children: [
4251
4358
  /* @__PURE__ */ jsx25(
4252
4359
  DataPanelContent,
4253
4360
  {
@@ -4295,7 +4402,7 @@ var DataPanel = React25.forwardRef(
4295
4402
  constraints: resolvedConstraints
4296
4403
  }
4297
4404
  ),
4298
- variant === "card" && isExpanded && !disableResize && !isMobile && /* @__PURE__ */ jsxs17(Fragment6, { children: [
4405
+ variant === "card" && isExpanded && !disableResize && !isMobile && /* @__PURE__ */ jsxs18(Fragment6, { children: [
4299
4406
  /* @__PURE__ */ jsx25(
4300
4407
  "div",
4301
4408
  {
@@ -4390,7 +4497,7 @@ Skeleton.displayName = "Skeleton";
4390
4497
  // src/components/Spinner.tsx
4391
4498
  import * as React27 from "react";
4392
4499
  import { cva as cva7 } from "class-variance-authority";
4393
- import { jsx as jsx27, jsxs as jsxs18 } from "react/jsx-runtime";
4500
+ import { jsx as jsx27, jsxs as jsxs19 } from "react/jsx-runtime";
4394
4501
  var spinnerVariants = cva7("animate-spin text-current", {
4395
4502
  variants: {
4396
4503
  size: {
@@ -4406,7 +4513,7 @@ var spinnerVariants = cva7("animate-spin text-current", {
4406
4513
  });
4407
4514
  var Spinner = React27.forwardRef(
4408
4515
  ({ className, size, label = "Loading...", ...props }, ref) => {
4409
- return /* @__PURE__ */ jsxs18(
4516
+ return /* @__PURE__ */ jsxs19(
4410
4517
  "svg",
4411
4518
  {
4412
4519
  ref,
@@ -4447,7 +4554,7 @@ Spinner.displayName = "Spinner";
4447
4554
 
4448
4555
  // src/components/LoadingLogo.tsx
4449
4556
  import * as React28 from "react";
4450
- import { jsx as jsx28, jsxs as jsxs19 } from "react/jsx-runtime";
4557
+ import { jsx as jsx28, jsxs as jsxs20 } from "react/jsx-runtime";
4451
4558
  var logoPaths = [
4452
4559
  "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",
4453
4560
  "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",
@@ -4474,7 +4581,7 @@ var LoadingLogo = React28.forwardRef(
4474
4581
  const currentColors = colors[variant];
4475
4582
  const fillColor = loading ? currentColors.fillLoading : currentColors.fill;
4476
4583
  const strokeColor = currentColors.stroke;
4477
- return /* @__PURE__ */ jsxs19(
4584
+ return /* @__PURE__ */ jsxs20(
4478
4585
  "div",
4479
4586
  {
4480
4587
  ref,
@@ -4484,7 +4591,7 @@ var LoadingLogo = React28.forwardRef(
4484
4591
  "aria-label": loading ? "Loading" : "Classic Homes",
4485
4592
  ...props,
4486
4593
  children: [
4487
- /* @__PURE__ */ jsxs19(
4594
+ /* @__PURE__ */ jsxs20(
4488
4595
  "svg",
4489
4596
  {
4490
4597
  width: "100%",
@@ -4520,7 +4627,7 @@ LoadingLogo.displayName = "LoadingLogo";
4520
4627
  // src/components/ProgressBar.tsx
4521
4628
  import * as React29 from "react";
4522
4629
  import { cva as cva8 } from "class-variance-authority";
4523
- import { jsx as jsx29, jsxs as jsxs20 } from "react/jsx-runtime";
4630
+ import { jsx as jsx29, jsxs as jsxs21 } from "react/jsx-runtime";
4524
4631
  var progressBarVariants = cva8("w-full overflow-hidden rounded-full bg-muted", {
4525
4632
  variants: {
4526
4633
  size: {
@@ -4551,7 +4658,7 @@ var ProgressBar = React29.forwardRef(
4551
4658
  const isIndeterminate = value === void 0;
4552
4659
  const clampedValue = isIndeterminate ? 0 : Math.min(Math.max(0, value), max);
4553
4660
  const percentage = isIndeterminate ? 0 : Math.round(clampedValue / max * 100);
4554
- return /* @__PURE__ */ jsxs20(
4661
+ return /* @__PURE__ */ jsxs21(
4555
4662
  "div",
4556
4663
  {
4557
4664
  ref,
@@ -4573,7 +4680,7 @@ var ProgressBar = React29.forwardRef(
4573
4680
  style: isIndeterminate ? void 0 : { width: `${percentage}%` }
4574
4681
  }
4575
4682
  ) }),
4576
- showValue && !isIndeterminate && /* @__PURE__ */ jsxs20("span", { className: "text-sm tabular-nums text-muted-foreground", children: [
4683
+ showValue && !isIndeterminate && /* @__PURE__ */ jsxs21("span", { className: "text-sm tabular-nums text-muted-foreground", children: [
4577
4684
  percentage,
4578
4685
  "%"
4579
4686
  ] })
@@ -4586,7 +4693,7 @@ ProgressBar.displayName = "ProgressBar";
4586
4693
 
4587
4694
  // src/components/LoadingOverlay.tsx
4588
4695
  import * as React30 from "react";
4589
- import { Fragment as Fragment7, jsx as jsx30, jsxs as jsxs21 } from "react/jsx-runtime";
4696
+ import { Fragment as Fragment7, jsx as jsx30, jsxs as jsxs22 } from "react/jsx-runtime";
4590
4697
  var spinnerSizeMap = { sm: "sm", md: "md", lg: "lg", xl: "xl" };
4591
4698
  var logoSizeMap = { sm: 32, md: 40, lg: 56, xl: 80 };
4592
4699
  var LoadingOverlay = React30.forwardRef(
@@ -4621,16 +4728,16 @@ var LoadingOverlay = React30.forwardRef(
4621
4728
  return null;
4622
4729
  }
4623
4730
  if (!visible) {
4624
- return /* @__PURE__ */ jsxs21(Fragment7, { children: [
4731
+ return /* @__PURE__ */ jsxs22(Fragment7, { children: [
4625
4732
  children,
4626
4733
  null
4627
4734
  ] });
4628
4735
  }
4629
- const indicator = /* @__PURE__ */ jsxs21(Fragment7, { children: [
4736
+ const indicator = /* @__PURE__ */ jsxs22(Fragment7, { children: [
4630
4737
  variant === "spinner" && /* @__PURE__ */ jsx30(Spinner, { size: spinnerSizeMap[size] }),
4631
4738
  variant === "logo" && /* @__PURE__ */ jsx30(LoadingLogo, { loading: true, width: logoSizeMap[size], height: logoSizeMap[size] }),
4632
4739
  variant === "progress" && /* @__PURE__ */ jsx30(ProgressBar, { value: progress, className: "w-48 max-w-full" }),
4633
- variant === "skeleton" && /* @__PURE__ */ jsxs21("div", { className: "w-full space-y-3", children: [
4740
+ variant === "skeleton" && /* @__PURE__ */ jsxs22("div", { className: "w-full space-y-3", children: [
4634
4741
  /* @__PURE__ */ jsx30(Skeleton, { variant: "title" }),
4635
4742
  /* @__PURE__ */ jsx30(Skeleton, { variant: "text" }),
4636
4743
  /* @__PURE__ */ jsx30(Skeleton, { variant: "text" }),
@@ -4654,7 +4761,7 @@ var LoadingOverlay = React30.forwardRef(
4654
4761
  }
4655
4762
  const bgClass = opaque ? "bg-background" : mode === "fullscreen" ? "bg-background/80" : "bg-background/60";
4656
4763
  const positionClass = mode === "fullscreen" ? "fixed inset-0 z-50" : "absolute inset-0 z-10";
4657
- return /* @__PURE__ */ jsxs21(Fragment7, { children: [
4764
+ return /* @__PURE__ */ jsxs22(Fragment7, { children: [
4658
4765
  children,
4659
4766
  /* @__PURE__ */ jsx30(
4660
4767
  "div",
@@ -4680,7 +4787,7 @@ LoadingOverlay.displayName = "LoadingOverlay";
4680
4787
 
4681
4788
  // src/components/LoadingPage.tsx
4682
4789
  import * as React31 from "react";
4683
- import { jsx as jsx31, jsxs as jsxs22 } from "react/jsx-runtime";
4790
+ import { jsx as jsx31, jsxs as jsxs23 } from "react/jsx-runtime";
4684
4791
  var LoadingPage = React31.forwardRef(
4685
4792
  ({
4686
4793
  loading = true,
@@ -4706,7 +4813,7 @@ var LoadingPage = React31.forwardRef(
4706
4813
  return () => clearTimeout(timer);
4707
4814
  }, [loading, delay]);
4708
4815
  if (!visible) return null;
4709
- return /* @__PURE__ */ jsxs22(
4816
+ return /* @__PURE__ */ jsxs23(
4710
4817
  "div",
4711
4818
  {
4712
4819
  ref,
@@ -4721,7 +4828,7 @@ var LoadingPage = React31.forwardRef(
4721
4828
  showLogo ? /* @__PURE__ */ jsx31(LoadingLogo, { loading: true, width: 64, height: 64, variant: logoVariant }) : /* @__PURE__ */ jsx31(Spinner, { size: "xl" }),
4722
4829
  progress !== void 0 && /* @__PURE__ */ jsx31(ProgressBar, { value: progress, className: "mt-6 w-48 max-w-full" }),
4723
4830
  message && /* @__PURE__ */ jsx31("p", { className: "mt-4 text-sm text-muted-foreground animate-pulse-subtle", children: message }),
4724
- /* @__PURE__ */ jsxs22("span", { className: "sr-only", children: [
4831
+ /* @__PURE__ */ jsxs23("span", { className: "sr-only", children: [
4725
4832
  message || "Loading",
4726
4833
  progress !== void 0 && `, ${Math.round(progress)}% complete`
4727
4834
  ] })
@@ -4734,7 +4841,7 @@ LoadingPage.displayName = "LoadingPage";
4734
4841
 
4735
4842
  // src/components/LoadingSection.tsx
4736
4843
  import * as React32 from "react";
4737
- import { jsx as jsx32, jsxs as jsxs23 } from "react/jsx-runtime";
4844
+ import { jsx as jsx32, jsxs as jsxs24 } from "react/jsx-runtime";
4738
4845
  var LoadingSection = React32.forwardRef(
4739
4846
  ({
4740
4847
  loading = false,
@@ -4748,7 +4855,7 @@ var LoadingSection = React32.forwardRef(
4748
4855
  children,
4749
4856
  ...props
4750
4857
  }, ref) => {
4751
- return /* @__PURE__ */ jsxs23(
4858
+ return /* @__PURE__ */ jsxs24(
4752
4859
  "div",
4753
4860
  {
4754
4861
  ref,
@@ -4836,10 +4943,10 @@ var SkipLink = React34.forwardRef(
4836
4943
  SkipLink.displayName = "SkipLink";
4837
4944
 
4838
4945
  // src/hooks/useFocusRef.ts
4839
- import { useRef as useRef11, useEffect as useEffect13 } from "react";
4946
+ import { useRef as useRef12, useEffect as useEffect13 } from "react";
4840
4947
  function useFocusRef(options = {}) {
4841
4948
  const { focusOnMount = false, preventScroll = false, delay = 0 } = options;
4842
- const ref = useRef11(null);
4949
+ const ref = useRef12(null);
4843
4950
  useEffect13(() => {
4844
4951
  if (!focusOnMount) return;
4845
4952
  const focus = () => {
@@ -4859,9 +4966,9 @@ function useFocusRef(options = {}) {
4859
4966
  }
4860
4967
 
4861
4968
  // src/hooks/useReducedMotion.ts
4862
- import { useState as useState13, useEffect as useEffect14 } from "react";
4969
+ import { useState as useState14, useEffect as useEffect14 } from "react";
4863
4970
  function useReducedMotion() {
4864
- const [reducedMotion, setReducedMotion] = useState13(false);
4971
+ const [reducedMotion, setReducedMotion] = useState14(false);
4865
4972
  useEffect14(() => {
4866
4973
  const mediaQuery = window.matchMedia("(prefers-reduced-motion: reduce)");
4867
4974
  setReducedMotion(mediaQuery.matches);
@@ -4877,7 +4984,7 @@ function useReducedMotion() {
4877
4984
  }
4878
4985
 
4879
4986
  // src/hooks/useArrowNavigation.ts
4880
- import { useCallback as useCallback5, useRef as useRef12, useState as useState14 } from "react";
4987
+ import { useCallback as useCallback6, useRef as useRef13, useState as useState15 } from "react";
4881
4988
  var DEFAULT_SELECTOR = '[data-arrow-nav-item], [role="menuitem"], [role="option"], [role="tab"], button, a, [tabindex]:not([tabindex="-1"])';
4882
4989
  function useArrowNavigation(options = {}) {
4883
4990
  const {
@@ -4886,18 +4993,18 @@ function useArrowNavigation(options = {}) {
4886
4993
  itemSelector = DEFAULT_SELECTOR,
4887
4994
  onFocusChange
4888
4995
  } = options;
4889
- const containerRef = useRef12(null);
4890
- const focusedIndexRef = useRef12(-1);
4891
- const [focusedIndex, setFocusedIndexState] = useState14(-1);
4892
- const setFocusedIndex = useCallback5((index) => {
4996
+ const containerRef = useRef13(null);
4997
+ const focusedIndexRef = useRef13(-1);
4998
+ const [focusedIndex, setFocusedIndexState] = useState15(-1);
4999
+ const setFocusedIndex = useCallback6((index) => {
4893
5000
  focusedIndexRef.current = index;
4894
5001
  setFocusedIndexState(index);
4895
5002
  }, []);
4896
- const getFocusableItems = useCallback5(() => {
5003
+ const getFocusableItems = useCallback6(() => {
4897
5004
  if (!containerRef.current) return [];
4898
5005
  return Array.from(containerRef.current.querySelectorAll(itemSelector));
4899
5006
  }, [itemSelector]);
4900
- const focusItem = useCallback5(
5007
+ const focusItem = useCallback6(
4901
5008
  (index) => {
4902
5009
  const items = getFocusableItems();
4903
5010
  if (items.length === 0) return;
@@ -4917,7 +5024,7 @@ function useArrowNavigation(options = {}) {
4917
5024
  },
4918
5025
  [getFocusableItems, loop, onFocusChange, setFocusedIndex]
4919
5026
  );
4920
- const handleKeyDown = useCallback5(
5027
+ const handleKeyDown = useCallback6(
4921
5028
  (event) => {
4922
5029
  const items = getFocusableItems();
4923
5030
  if (items.length === 0) return;
@@ -4964,7 +5071,7 @@ function useArrowNavigation(options = {}) {
4964
5071
  },
4965
5072
  [orientation, focusItem, getFocusableItems]
4966
5073
  );
4967
- const handleFocus = useCallback5(
5074
+ const handleFocus = useCallback6(
4968
5075
  (event) => {
4969
5076
  const items = getFocusableItems();
4970
5077
  const index = items.indexOf(event.target);
@@ -4982,7 +5089,7 @@ function useArrowNavigation(options = {}) {
4982
5089
  onFocus: handleFocus
4983
5090
  };
4984
5091
  const tabStopIndex = focusedIndex === -1 ? 0 : focusedIndex;
4985
- const getItemProps = useCallback5(
5092
+ const getItemProps = useCallback6(
4986
5093
  (index) => ({
4987
5094
  "data-arrow-nav-item": true,
4988
5095
  tabIndex: index === tabStopIndex ? 0 : -1,
@@ -5001,20 +5108,20 @@ function useArrowNavigation(options = {}) {
5001
5108
  }
5002
5109
 
5003
5110
  // src/hooks/useRovingTabindex.ts
5004
- import { useState as useState15, useCallback as useCallback6, useRef as useRef13 } from "react";
5111
+ import { useState as useState16, useCallback as useCallback7, useRef as useRef14 } from "react";
5005
5112
  var DEFAULT_SELECTOR2 = "[data-roving-tabindex-item]";
5006
5113
  function useRovingTabindex(options = {}) {
5007
5114
  const { loop = true, itemSelector = DEFAULT_SELECTOR2, initialIndex = 0, onIndexChange } = options;
5008
- const [activeIndex, setActiveIndex] = useState15(initialIndex);
5009
- const containerRef = useRef13(null);
5010
- const itemsRef = useRef13(/* @__PURE__ */ new Map());
5011
- const getItems = useCallback6(() => {
5115
+ const [activeIndex, setActiveIndex] = useState16(initialIndex);
5116
+ const containerRef = useRef14(null);
5117
+ const itemsRef = useRef14(/* @__PURE__ */ new Map());
5118
+ const getItems = useCallback7(() => {
5012
5119
  if (!containerRef.current) {
5013
5120
  return Array.from(itemsRef.current.values());
5014
5121
  }
5015
5122
  return Array.from(containerRef.current.querySelectorAll(itemSelector));
5016
5123
  }, [itemSelector]);
5017
- const focusIndex = useCallback6(
5124
+ const focusIndex = useCallback7(
5018
5125
  (index) => {
5019
5126
  const items = getItems();
5020
5127
  if (items.length === 0) return;
@@ -5034,7 +5141,7 @@ function useRovingTabindex(options = {}) {
5034
5141
  },
5035
5142
  [getItems, loop, onIndexChange]
5036
5143
  );
5037
- const handleKeyDown = useCallback6(
5144
+ const handleKeyDown = useCallback7(
5038
5145
  (event) => {
5039
5146
  const items = getItems();
5040
5147
  if (items.length === 0) return;
@@ -5072,7 +5179,7 @@ function useRovingTabindex(options = {}) {
5072
5179
  },
5073
5180
  onKeyDown: handleKeyDown
5074
5181
  };
5075
- const getItemProps = useCallback6(
5182
+ const getItemProps = useCallback7(
5076
5183
  (index, handlers = {}) => ({
5077
5184
  "data-roving-tabindex-item": true,
5078
5185
  tabIndex: index === activeIndex ? 0 : -1,
@@ -5214,6 +5321,7 @@ export {
5214
5321
  pageHeaderSubtitleVariants,
5215
5322
  pageHeaderTitleVariants,
5216
5323
  progressBarVariants,
5324
+ setTextUndoable,
5217
5325
  skeletonVariants,
5218
5326
  spinnerVariants,
5219
5327
  useAnnounce,