@classic-homes/theme-react 0.5.2 → 0.6.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.d.mts +41 -1
- package/dist/index.d.ts +41 -1
- package/dist/index.js +92 -3
- package/dist/index.mjs +245 -157
- package/package.json +4 -3
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
|
-
|
|
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__ */
|
|
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__ */
|
|
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
|
|
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__ */
|
|
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
|
|
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__ */
|
|
643
|
+
var DialogContent = React12.forwardRef(({ className, children, size = "md", showClose = false, ...props }, ref) => /* @__PURE__ */ jsxs4(DialogPortal, { children: [
|
|
557
644
|
/* @__PURE__ */ jsx10(DialogOverlay, {}),
|
|
558
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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
|
|
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__ */
|
|
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
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
851
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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
|
|
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__ */
|
|
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
|
|
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__ */
|
|
1116
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
1222
|
+
/* @__PURE__ */ jsxs8("div", { className: "relative min-w-0 flex-1 overflow-hidden bg-muted/40", children: [
|
|
1136
1223
|
canvas,
|
|
1137
|
-
(railInSheet || inspectorInSheet) && /* @__PURE__ */
|
|
1138
|
-
railInSheet ? /* @__PURE__ */
|
|
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__ */
|
|
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
|
|
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__ */
|
|
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__ */
|
|
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
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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
|
|
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__ */
|
|
1622
|
-
(showDevices || toolbar) && /* @__PURE__ */
|
|
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__ */
|
|
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
|
|
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__ */
|
|
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__ */
|
|
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
|
|
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__ */
|
|
1818
|
-
(title || headerActions) && /* @__PURE__ */
|
|
1819
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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
|
|
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__ */
|
|
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__ */
|
|
1966
|
-
detail || canRetry ? /* @__PURE__ */
|
|
1967
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
2080
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
2210
|
-
filtered.length === 0 && /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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
|
|
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]",
|
|
@@ -2297,9 +2384,9 @@ function precedes(a, b) {
|
|
|
2297
2384
|
}
|
|
2298
2385
|
function useFocusTrap(options = {}) {
|
|
2299
2386
|
const { active = true, returnFocusTo, initialFocus, preventScroll = false } = options;
|
|
2300
|
-
const containerRef =
|
|
2301
|
-
const previousActiveElementRef =
|
|
2302
|
-
const handleKeyDown =
|
|
2387
|
+
const containerRef = useRef9(null);
|
|
2388
|
+
const previousActiveElementRef = useRef9(null);
|
|
2389
|
+
const handleKeyDown = useCallback4(
|
|
2303
2390
|
(event) => {
|
|
2304
2391
|
if (!active || event.key !== "Tab") return;
|
|
2305
2392
|
const container = containerRef.current;
|
|
@@ -2433,7 +2520,7 @@ import {
|
|
|
2433
2520
|
calculateDetachedPositionFromPinned,
|
|
2434
2521
|
getPinnedPullTransform
|
|
2435
2522
|
} from "@classic-homes/data-panel-core";
|
|
2436
|
-
import { Fragment as Fragment6, jsx as jsx25, jsxs as
|
|
2523
|
+
import { Fragment as Fragment6, jsx as jsx25, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2437
2524
|
function layoutViewportWidth() {
|
|
2438
2525
|
return document.documentElement.clientWidth;
|
|
2439
2526
|
}
|
|
@@ -2578,7 +2665,7 @@ var ChevronUpIcon = () => /* @__PURE__ */ jsx25(
|
|
|
2578
2665
|
children: /* @__PURE__ */ jsx25("path", { d: "m18 15-6-6-6 6" })
|
|
2579
2666
|
}
|
|
2580
2667
|
);
|
|
2581
|
-
var MoreVerticalIcon = () => /* @__PURE__ */
|
|
2668
|
+
var MoreVerticalIcon = () => /* @__PURE__ */ jsxs18(
|
|
2582
2669
|
"svg",
|
|
2583
2670
|
{
|
|
2584
2671
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2597,7 +2684,7 @@ var MoreVerticalIcon = () => /* @__PURE__ */ jsxs17(
|
|
|
2597
2684
|
]
|
|
2598
2685
|
}
|
|
2599
2686
|
);
|
|
2600
|
-
var CloseIcon = () => /* @__PURE__ */
|
|
2687
|
+
var CloseIcon = () => /* @__PURE__ */ jsxs18(
|
|
2601
2688
|
"svg",
|
|
2602
2689
|
{
|
|
2603
2690
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2615,7 +2702,7 @@ var CloseIcon = () => /* @__PURE__ */ jsxs17(
|
|
|
2615
2702
|
]
|
|
2616
2703
|
}
|
|
2617
2704
|
);
|
|
2618
|
-
var GripIcon = () => /* @__PURE__ */
|
|
2705
|
+
var GripIcon = () => /* @__PURE__ */ jsxs18(
|
|
2619
2706
|
"svg",
|
|
2620
2707
|
{
|
|
2621
2708
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2658,7 +2745,7 @@ var DataPanelHeader = React25.forwardRef(
|
|
|
2658
2745
|
className,
|
|
2659
2746
|
draggable = false
|
|
2660
2747
|
}, ref) => {
|
|
2661
|
-
return /* @__PURE__ */
|
|
2748
|
+
return /* @__PURE__ */ jsxs18(
|
|
2662
2749
|
"div",
|
|
2663
2750
|
{
|
|
2664
2751
|
ref,
|
|
@@ -2670,11 +2757,11 @@ var DataPanelHeader = React25.forwardRef(
|
|
|
2670
2757
|
),
|
|
2671
2758
|
"data-panel-header": true,
|
|
2672
2759
|
children: [
|
|
2673
|
-
/* @__PURE__ */ jsx25("div", { className: "flex flex-col min-w-0 flex-1", children: headerContent ? headerContent : /* @__PURE__ */
|
|
2760
|
+
/* @__PURE__ */ jsx25("div", { className: "flex flex-col min-w-0 flex-1", children: headerContent ? headerContent : /* @__PURE__ */ jsxs18(Fragment6, { children: [
|
|
2674
2761
|
title && /* @__PURE__ */ jsx25("h3", { id: titleId, className: "text-sm font-semibold leading-none truncate", children: title }),
|
|
2675
2762
|
subtitle && /* @__PURE__ */ jsx25("p", { className: "text-xs text-muted-foreground mt-1 truncate", children: subtitle })
|
|
2676
2763
|
] }) }),
|
|
2677
|
-
/* @__PURE__ */
|
|
2764
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
2678
2765
|
headerActions,
|
|
2679
2766
|
/* @__PURE__ */ jsx25(
|
|
2680
2767
|
"button",
|
|
@@ -2704,7 +2791,7 @@ var DataPanelHeader = React25.forwardRef(
|
|
|
2704
2791
|
)
|
|
2705
2792
|
}
|
|
2706
2793
|
),
|
|
2707
|
-
!disableModeSwitch && /* @__PURE__ */
|
|
2794
|
+
!disableModeSwitch && /* @__PURE__ */ jsxs18(DropdownMenuPrimitive2.Root, { children: [
|
|
2708
2795
|
/* @__PURE__ */ jsx25(DropdownTrigger, { asChild: true, children: /* @__PURE__ */ jsx25(
|
|
2709
2796
|
"button",
|
|
2710
2797
|
{
|
|
@@ -2714,7 +2801,7 @@ var DataPanelHeader = React25.forwardRef(
|
|
|
2714
2801
|
children: /* @__PURE__ */ jsx25(MoreVerticalIcon, {})
|
|
2715
2802
|
}
|
|
2716
2803
|
) }),
|
|
2717
|
-
/* @__PURE__ */ jsx25(DropdownMenuPrimitive2.Portal, { children: /* @__PURE__ */
|
|
2804
|
+
/* @__PURE__ */ jsx25(DropdownMenuPrimitive2.Portal, { children: /* @__PURE__ */ jsxs18(
|
|
2718
2805
|
DropdownContent,
|
|
2719
2806
|
{
|
|
2720
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",
|
|
@@ -2722,7 +2809,7 @@ var DataPanelHeader = React25.forwardRef(
|
|
|
2722
2809
|
align: "end",
|
|
2723
2810
|
children: [
|
|
2724
2811
|
/* @__PURE__ */ jsx25(DropdownLabel, { className: "px-2 py-1.5 text-sm font-semibold", children: "Panel Position" }),
|
|
2725
|
-
/* @__PURE__ */
|
|
2812
|
+
/* @__PURE__ */ jsxs18(
|
|
2726
2813
|
DropdownRadioGroup,
|
|
2727
2814
|
{
|
|
2728
2815
|
value: mode === "detached" ? "detached" : edge,
|
|
@@ -2735,12 +2822,12 @@ var DataPanelHeader = React25.forwardRef(
|
|
|
2735
2822
|
onEdgeChange?.(value);
|
|
2736
2823
|
},
|
|
2737
2824
|
children: [
|
|
2738
|
-
["left", "right", "top", "bottom"].map((e) => /* @__PURE__ */
|
|
2825
|
+
["left", "right", "top", "bottom"].map((e) => /* @__PURE__ */ jsxs18(DropdownRadioItem, { value: e, className: menuRadioItemClass, children: [
|
|
2739
2826
|
edgeLabels[e],
|
|
2740
2827
|
/* @__PURE__ */ jsx25(DropdownItemIndicator, { className: "ml-auto text-xs", children: "\u2713" })
|
|
2741
2828
|
] }, e)),
|
|
2742
2829
|
/* @__PURE__ */ jsx25(DropdownSeparator, { className: "-mx-1 my-1 h-px bg-muted" }),
|
|
2743
|
-
/* @__PURE__ */
|
|
2830
|
+
/* @__PURE__ */ jsxs18(DropdownRadioItem, { value: "detached", className: menuRadioItemClass, children: [
|
|
2744
2831
|
"Detach",
|
|
2745
2832
|
/* @__PURE__ */ jsx25(DropdownItemIndicator, { className: "ml-auto text-xs", children: "\u2713" })
|
|
2746
2833
|
] })
|
|
@@ -2787,7 +2874,7 @@ function DataPanelCardHeader({
|
|
|
2787
2874
|
e.preventDefault();
|
|
2788
2875
|
onToggleExpand();
|
|
2789
2876
|
};
|
|
2790
|
-
return /* @__PURE__ */
|
|
2877
|
+
return /* @__PURE__ */ jsxs18(
|
|
2791
2878
|
"div",
|
|
2792
2879
|
{
|
|
2793
2880
|
"data-panel-header": true,
|
|
@@ -2814,13 +2901,13 @@ function DataPanelCardHeader({
|
|
|
2814
2901
|
tabIndex: 0,
|
|
2815
2902
|
"aria-expanded": isExpanded,
|
|
2816
2903
|
onKeyDown: onToggleKeyDown,
|
|
2817
|
-
children: headerContent ? headerContent : /* @__PURE__ */
|
|
2904
|
+
children: headerContent ? headerContent : /* @__PURE__ */ jsxs18(Fragment6, { children: [
|
|
2818
2905
|
subtitle && /* @__PURE__ */ jsx25("p", { className: "text-sm text-muted-foreground truncate", children: subtitle }),
|
|
2819
2906
|
title && /* @__PURE__ */ jsx25("h3", { id: titleId, className: "text-lg font-semibold truncate", children: title })
|
|
2820
2907
|
] })
|
|
2821
2908
|
}
|
|
2822
2909
|
),
|
|
2823
|
-
/* @__PURE__ */
|
|
2910
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
2824
2911
|
headerActions,
|
|
2825
2912
|
!isMobile && /* @__PURE__ */ jsx25(
|
|
2826
2913
|
"button",
|
|
@@ -2893,7 +2980,7 @@ var DataPanelFooter = React25.forwardRef(
|
|
|
2893
2980
|
"flex items-center justify-end gap-2 border-t border-border bg-muted/30 px-4 py-3",
|
|
2894
2981
|
className
|
|
2895
2982
|
),
|
|
2896
|
-
children: footerContent ? footerContent : /* @__PURE__ */
|
|
2983
|
+
children: footerContent ? footerContent : /* @__PURE__ */ jsxs18(Fragment6, { children: [
|
|
2897
2984
|
footerActions,
|
|
2898
2985
|
actions.map((action, index) => /* @__PURE__ */ jsx25(
|
|
2899
2986
|
Button,
|
|
@@ -3036,7 +3123,7 @@ var DataPanelTab = React25.forwardRef(
|
|
|
3036
3123
|
window.addEventListener("resize", reclamp);
|
|
3037
3124
|
return () => window.removeEventListener("resize", reclamp);
|
|
3038
3125
|
}, [edge, tabWidth, offset, onOffsetChange, dragOffset]);
|
|
3039
|
-
return /* @__PURE__ */
|
|
3126
|
+
return /* @__PURE__ */ jsxs18(
|
|
3040
3127
|
"div",
|
|
3041
3128
|
{
|
|
3042
3129
|
ref: setRefs,
|
|
@@ -3062,7 +3149,7 @@ var DataPanelTab = React25.forwardRef(
|
|
|
3062
3149
|
onPointerUp: draggable ? handlePointerUp : void 0,
|
|
3063
3150
|
onPointerCancel: draggable ? handlePointerCancel : void 0,
|
|
3064
3151
|
children: [
|
|
3065
|
-
/* @__PURE__ */
|
|
3152
|
+
/* @__PURE__ */ jsxs18(
|
|
3066
3153
|
"button",
|
|
3067
3154
|
{
|
|
3068
3155
|
type: "button",
|
|
@@ -4189,7 +4276,7 @@ var DataPanel = React25.forwardRef(
|
|
|
4189
4276
|
}
|
|
4190
4277
|
);
|
|
4191
4278
|
}
|
|
4192
|
-
return /* @__PURE__ */
|
|
4279
|
+
return /* @__PURE__ */ jsxs18(Fragment6, { children: [
|
|
4193
4280
|
snapPreview && /* @__PURE__ */ jsx25(
|
|
4194
4281
|
"div",
|
|
4195
4282
|
{
|
|
@@ -4210,7 +4297,7 @@ var DataPanel = React25.forwardRef(
|
|
|
4210
4297
|
onClick: handleToggleExpand
|
|
4211
4298
|
}
|
|
4212
4299
|
),
|
|
4213
|
-
/* @__PURE__ */
|
|
4300
|
+
/* @__PURE__ */ jsxs18(
|
|
4214
4301
|
"div",
|
|
4215
4302
|
{
|
|
4216
4303
|
ref: setPanelRef,
|
|
@@ -4267,7 +4354,7 @@ var DataPanel = React25.forwardRef(
|
|
|
4267
4354
|
draggable: !disableDrag && (mode === "detached" || mode === "pinned" && detachThreshold > 0)
|
|
4268
4355
|
}
|
|
4269
4356
|
),
|
|
4270
|
-
showContent && /* @__PURE__ */
|
|
4357
|
+
showContent && /* @__PURE__ */ jsxs18(Fragment6, { children: [
|
|
4271
4358
|
/* @__PURE__ */ jsx25(
|
|
4272
4359
|
DataPanelContent,
|
|
4273
4360
|
{
|
|
@@ -4315,7 +4402,7 @@ var DataPanel = React25.forwardRef(
|
|
|
4315
4402
|
constraints: resolvedConstraints
|
|
4316
4403
|
}
|
|
4317
4404
|
),
|
|
4318
|
-
variant === "card" && isExpanded && !disableResize && !isMobile && /* @__PURE__ */
|
|
4405
|
+
variant === "card" && isExpanded && !disableResize && !isMobile && /* @__PURE__ */ jsxs18(Fragment6, { children: [
|
|
4319
4406
|
/* @__PURE__ */ jsx25(
|
|
4320
4407
|
"div",
|
|
4321
4408
|
{
|
|
@@ -4410,7 +4497,7 @@ Skeleton.displayName = "Skeleton";
|
|
|
4410
4497
|
// src/components/Spinner.tsx
|
|
4411
4498
|
import * as React27 from "react";
|
|
4412
4499
|
import { cva as cva7 } from "class-variance-authority";
|
|
4413
|
-
import { jsx as jsx27, jsxs as
|
|
4500
|
+
import { jsx as jsx27, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4414
4501
|
var spinnerVariants = cva7("animate-spin text-current", {
|
|
4415
4502
|
variants: {
|
|
4416
4503
|
size: {
|
|
@@ -4426,7 +4513,7 @@ var spinnerVariants = cva7("animate-spin text-current", {
|
|
|
4426
4513
|
});
|
|
4427
4514
|
var Spinner = React27.forwardRef(
|
|
4428
4515
|
({ className, size, label = "Loading...", ...props }, ref) => {
|
|
4429
|
-
return /* @__PURE__ */
|
|
4516
|
+
return /* @__PURE__ */ jsxs19(
|
|
4430
4517
|
"svg",
|
|
4431
4518
|
{
|
|
4432
4519
|
ref,
|
|
@@ -4467,7 +4554,7 @@ Spinner.displayName = "Spinner";
|
|
|
4467
4554
|
|
|
4468
4555
|
// src/components/LoadingLogo.tsx
|
|
4469
4556
|
import * as React28 from "react";
|
|
4470
|
-
import { jsx as jsx28, jsxs as
|
|
4557
|
+
import { jsx as jsx28, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4471
4558
|
var logoPaths = [
|
|
4472
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",
|
|
4473
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",
|
|
@@ -4494,7 +4581,7 @@ var LoadingLogo = React28.forwardRef(
|
|
|
4494
4581
|
const currentColors = colors[variant];
|
|
4495
4582
|
const fillColor = loading ? currentColors.fillLoading : currentColors.fill;
|
|
4496
4583
|
const strokeColor = currentColors.stroke;
|
|
4497
|
-
return /* @__PURE__ */
|
|
4584
|
+
return /* @__PURE__ */ jsxs20(
|
|
4498
4585
|
"div",
|
|
4499
4586
|
{
|
|
4500
4587
|
ref,
|
|
@@ -4504,7 +4591,7 @@ var LoadingLogo = React28.forwardRef(
|
|
|
4504
4591
|
"aria-label": loading ? "Loading" : "Classic Homes",
|
|
4505
4592
|
...props,
|
|
4506
4593
|
children: [
|
|
4507
|
-
/* @__PURE__ */
|
|
4594
|
+
/* @__PURE__ */ jsxs20(
|
|
4508
4595
|
"svg",
|
|
4509
4596
|
{
|
|
4510
4597
|
width: "100%",
|
|
@@ -4540,7 +4627,7 @@ LoadingLogo.displayName = "LoadingLogo";
|
|
|
4540
4627
|
// src/components/ProgressBar.tsx
|
|
4541
4628
|
import * as React29 from "react";
|
|
4542
4629
|
import { cva as cva8 } from "class-variance-authority";
|
|
4543
|
-
import { jsx as jsx29, jsxs as
|
|
4630
|
+
import { jsx as jsx29, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4544
4631
|
var progressBarVariants = cva8("w-full overflow-hidden rounded-full bg-muted", {
|
|
4545
4632
|
variants: {
|
|
4546
4633
|
size: {
|
|
@@ -4571,7 +4658,7 @@ var ProgressBar = React29.forwardRef(
|
|
|
4571
4658
|
const isIndeterminate = value === void 0;
|
|
4572
4659
|
const clampedValue = isIndeterminate ? 0 : Math.min(Math.max(0, value), max);
|
|
4573
4660
|
const percentage = isIndeterminate ? 0 : Math.round(clampedValue / max * 100);
|
|
4574
|
-
return /* @__PURE__ */
|
|
4661
|
+
return /* @__PURE__ */ jsxs21(
|
|
4575
4662
|
"div",
|
|
4576
4663
|
{
|
|
4577
4664
|
ref,
|
|
@@ -4593,7 +4680,7 @@ var ProgressBar = React29.forwardRef(
|
|
|
4593
4680
|
style: isIndeterminate ? void 0 : { width: `${percentage}%` }
|
|
4594
4681
|
}
|
|
4595
4682
|
) }),
|
|
4596
|
-
showValue && !isIndeterminate && /* @__PURE__ */
|
|
4683
|
+
showValue && !isIndeterminate && /* @__PURE__ */ jsxs21("span", { className: "text-sm tabular-nums text-muted-foreground", children: [
|
|
4597
4684
|
percentage,
|
|
4598
4685
|
"%"
|
|
4599
4686
|
] })
|
|
@@ -4606,7 +4693,7 @@ ProgressBar.displayName = "ProgressBar";
|
|
|
4606
4693
|
|
|
4607
4694
|
// src/components/LoadingOverlay.tsx
|
|
4608
4695
|
import * as React30 from "react";
|
|
4609
|
-
import { Fragment as Fragment7, jsx as jsx30, jsxs as
|
|
4696
|
+
import { Fragment as Fragment7, jsx as jsx30, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4610
4697
|
var spinnerSizeMap = { sm: "sm", md: "md", lg: "lg", xl: "xl" };
|
|
4611
4698
|
var logoSizeMap = { sm: 32, md: 40, lg: 56, xl: 80 };
|
|
4612
4699
|
var LoadingOverlay = React30.forwardRef(
|
|
@@ -4641,16 +4728,16 @@ var LoadingOverlay = React30.forwardRef(
|
|
|
4641
4728
|
return null;
|
|
4642
4729
|
}
|
|
4643
4730
|
if (!visible) {
|
|
4644
|
-
return /* @__PURE__ */
|
|
4731
|
+
return /* @__PURE__ */ jsxs22(Fragment7, { children: [
|
|
4645
4732
|
children,
|
|
4646
4733
|
null
|
|
4647
4734
|
] });
|
|
4648
4735
|
}
|
|
4649
|
-
const indicator = /* @__PURE__ */
|
|
4736
|
+
const indicator = /* @__PURE__ */ jsxs22(Fragment7, { children: [
|
|
4650
4737
|
variant === "spinner" && /* @__PURE__ */ jsx30(Spinner, { size: spinnerSizeMap[size] }),
|
|
4651
4738
|
variant === "logo" && /* @__PURE__ */ jsx30(LoadingLogo, { loading: true, width: logoSizeMap[size], height: logoSizeMap[size] }),
|
|
4652
4739
|
variant === "progress" && /* @__PURE__ */ jsx30(ProgressBar, { value: progress, className: "w-48 max-w-full" }),
|
|
4653
|
-
variant === "skeleton" && /* @__PURE__ */
|
|
4740
|
+
variant === "skeleton" && /* @__PURE__ */ jsxs22("div", { className: "w-full space-y-3", children: [
|
|
4654
4741
|
/* @__PURE__ */ jsx30(Skeleton, { variant: "title" }),
|
|
4655
4742
|
/* @__PURE__ */ jsx30(Skeleton, { variant: "text" }),
|
|
4656
4743
|
/* @__PURE__ */ jsx30(Skeleton, { variant: "text" }),
|
|
@@ -4674,7 +4761,7 @@ var LoadingOverlay = React30.forwardRef(
|
|
|
4674
4761
|
}
|
|
4675
4762
|
const bgClass = opaque ? "bg-background" : mode === "fullscreen" ? "bg-background/80" : "bg-background/60";
|
|
4676
4763
|
const positionClass = mode === "fullscreen" ? "fixed inset-0 z-50" : "absolute inset-0 z-10";
|
|
4677
|
-
return /* @__PURE__ */
|
|
4764
|
+
return /* @__PURE__ */ jsxs22(Fragment7, { children: [
|
|
4678
4765
|
children,
|
|
4679
4766
|
/* @__PURE__ */ jsx30(
|
|
4680
4767
|
"div",
|
|
@@ -4700,7 +4787,7 @@ LoadingOverlay.displayName = "LoadingOverlay";
|
|
|
4700
4787
|
|
|
4701
4788
|
// src/components/LoadingPage.tsx
|
|
4702
4789
|
import * as React31 from "react";
|
|
4703
|
-
import { jsx as jsx31, jsxs as
|
|
4790
|
+
import { jsx as jsx31, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4704
4791
|
var LoadingPage = React31.forwardRef(
|
|
4705
4792
|
({
|
|
4706
4793
|
loading = true,
|
|
@@ -4726,7 +4813,7 @@ var LoadingPage = React31.forwardRef(
|
|
|
4726
4813
|
return () => clearTimeout(timer);
|
|
4727
4814
|
}, [loading, delay]);
|
|
4728
4815
|
if (!visible) return null;
|
|
4729
|
-
return /* @__PURE__ */
|
|
4816
|
+
return /* @__PURE__ */ jsxs23(
|
|
4730
4817
|
"div",
|
|
4731
4818
|
{
|
|
4732
4819
|
ref,
|
|
@@ -4741,7 +4828,7 @@ var LoadingPage = React31.forwardRef(
|
|
|
4741
4828
|
showLogo ? /* @__PURE__ */ jsx31(LoadingLogo, { loading: true, width: 64, height: 64, variant: logoVariant }) : /* @__PURE__ */ jsx31(Spinner, { size: "xl" }),
|
|
4742
4829
|
progress !== void 0 && /* @__PURE__ */ jsx31(ProgressBar, { value: progress, className: "mt-6 w-48 max-w-full" }),
|
|
4743
4830
|
message && /* @__PURE__ */ jsx31("p", { className: "mt-4 text-sm text-muted-foreground animate-pulse-subtle", children: message }),
|
|
4744
|
-
/* @__PURE__ */
|
|
4831
|
+
/* @__PURE__ */ jsxs23("span", { className: "sr-only", children: [
|
|
4745
4832
|
message || "Loading",
|
|
4746
4833
|
progress !== void 0 && `, ${Math.round(progress)}% complete`
|
|
4747
4834
|
] })
|
|
@@ -4754,7 +4841,7 @@ LoadingPage.displayName = "LoadingPage";
|
|
|
4754
4841
|
|
|
4755
4842
|
// src/components/LoadingSection.tsx
|
|
4756
4843
|
import * as React32 from "react";
|
|
4757
|
-
import { jsx as jsx32, jsxs as
|
|
4844
|
+
import { jsx as jsx32, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
4758
4845
|
var LoadingSection = React32.forwardRef(
|
|
4759
4846
|
({
|
|
4760
4847
|
loading = false,
|
|
@@ -4768,7 +4855,7 @@ var LoadingSection = React32.forwardRef(
|
|
|
4768
4855
|
children,
|
|
4769
4856
|
...props
|
|
4770
4857
|
}, ref) => {
|
|
4771
|
-
return /* @__PURE__ */
|
|
4858
|
+
return /* @__PURE__ */ jsxs24(
|
|
4772
4859
|
"div",
|
|
4773
4860
|
{
|
|
4774
4861
|
ref,
|
|
@@ -4856,10 +4943,10 @@ var SkipLink = React34.forwardRef(
|
|
|
4856
4943
|
SkipLink.displayName = "SkipLink";
|
|
4857
4944
|
|
|
4858
4945
|
// src/hooks/useFocusRef.ts
|
|
4859
|
-
import { useRef as
|
|
4946
|
+
import { useRef as useRef12, useEffect as useEffect13 } from "react";
|
|
4860
4947
|
function useFocusRef(options = {}) {
|
|
4861
4948
|
const { focusOnMount = false, preventScroll = false, delay = 0 } = options;
|
|
4862
|
-
const ref =
|
|
4949
|
+
const ref = useRef12(null);
|
|
4863
4950
|
useEffect13(() => {
|
|
4864
4951
|
if (!focusOnMount) return;
|
|
4865
4952
|
const focus = () => {
|
|
@@ -4879,9 +4966,9 @@ function useFocusRef(options = {}) {
|
|
|
4879
4966
|
}
|
|
4880
4967
|
|
|
4881
4968
|
// src/hooks/useReducedMotion.ts
|
|
4882
|
-
import { useState as
|
|
4969
|
+
import { useState as useState14, useEffect as useEffect14 } from "react";
|
|
4883
4970
|
function useReducedMotion() {
|
|
4884
|
-
const [reducedMotion, setReducedMotion] =
|
|
4971
|
+
const [reducedMotion, setReducedMotion] = useState14(false);
|
|
4885
4972
|
useEffect14(() => {
|
|
4886
4973
|
const mediaQuery = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
4887
4974
|
setReducedMotion(mediaQuery.matches);
|
|
@@ -4897,7 +4984,7 @@ function useReducedMotion() {
|
|
|
4897
4984
|
}
|
|
4898
4985
|
|
|
4899
4986
|
// src/hooks/useArrowNavigation.ts
|
|
4900
|
-
import { useCallback as
|
|
4987
|
+
import { useCallback as useCallback6, useRef as useRef13, useState as useState15 } from "react";
|
|
4901
4988
|
var DEFAULT_SELECTOR = '[data-arrow-nav-item], [role="menuitem"], [role="option"], [role="tab"], button, a, [tabindex]:not([tabindex="-1"])';
|
|
4902
4989
|
function useArrowNavigation(options = {}) {
|
|
4903
4990
|
const {
|
|
@@ -4906,18 +4993,18 @@ function useArrowNavigation(options = {}) {
|
|
|
4906
4993
|
itemSelector = DEFAULT_SELECTOR,
|
|
4907
4994
|
onFocusChange
|
|
4908
4995
|
} = options;
|
|
4909
|
-
const containerRef =
|
|
4910
|
-
const focusedIndexRef =
|
|
4911
|
-
const [focusedIndex, setFocusedIndexState] =
|
|
4912
|
-
const setFocusedIndex =
|
|
4996
|
+
const containerRef = useRef13(null);
|
|
4997
|
+
const focusedIndexRef = useRef13(-1);
|
|
4998
|
+
const [focusedIndex, setFocusedIndexState] = useState15(-1);
|
|
4999
|
+
const setFocusedIndex = useCallback6((index) => {
|
|
4913
5000
|
focusedIndexRef.current = index;
|
|
4914
5001
|
setFocusedIndexState(index);
|
|
4915
5002
|
}, []);
|
|
4916
|
-
const getFocusableItems =
|
|
5003
|
+
const getFocusableItems = useCallback6(() => {
|
|
4917
5004
|
if (!containerRef.current) return [];
|
|
4918
5005
|
return Array.from(containerRef.current.querySelectorAll(itemSelector));
|
|
4919
5006
|
}, [itemSelector]);
|
|
4920
|
-
const focusItem =
|
|
5007
|
+
const focusItem = useCallback6(
|
|
4921
5008
|
(index) => {
|
|
4922
5009
|
const items = getFocusableItems();
|
|
4923
5010
|
if (items.length === 0) return;
|
|
@@ -4937,7 +5024,7 @@ function useArrowNavigation(options = {}) {
|
|
|
4937
5024
|
},
|
|
4938
5025
|
[getFocusableItems, loop, onFocusChange, setFocusedIndex]
|
|
4939
5026
|
);
|
|
4940
|
-
const handleKeyDown =
|
|
5027
|
+
const handleKeyDown = useCallback6(
|
|
4941
5028
|
(event) => {
|
|
4942
5029
|
const items = getFocusableItems();
|
|
4943
5030
|
if (items.length === 0) return;
|
|
@@ -4984,7 +5071,7 @@ function useArrowNavigation(options = {}) {
|
|
|
4984
5071
|
},
|
|
4985
5072
|
[orientation, focusItem, getFocusableItems]
|
|
4986
5073
|
);
|
|
4987
|
-
const handleFocus =
|
|
5074
|
+
const handleFocus = useCallback6(
|
|
4988
5075
|
(event) => {
|
|
4989
5076
|
const items = getFocusableItems();
|
|
4990
5077
|
const index = items.indexOf(event.target);
|
|
@@ -5002,7 +5089,7 @@ function useArrowNavigation(options = {}) {
|
|
|
5002
5089
|
onFocus: handleFocus
|
|
5003
5090
|
};
|
|
5004
5091
|
const tabStopIndex = focusedIndex === -1 ? 0 : focusedIndex;
|
|
5005
|
-
const getItemProps =
|
|
5092
|
+
const getItemProps = useCallback6(
|
|
5006
5093
|
(index) => ({
|
|
5007
5094
|
"data-arrow-nav-item": true,
|
|
5008
5095
|
tabIndex: index === tabStopIndex ? 0 : -1,
|
|
@@ -5021,20 +5108,20 @@ function useArrowNavigation(options = {}) {
|
|
|
5021
5108
|
}
|
|
5022
5109
|
|
|
5023
5110
|
// src/hooks/useRovingTabindex.ts
|
|
5024
|
-
import { useState as
|
|
5111
|
+
import { useState as useState16, useCallback as useCallback7, useRef as useRef14 } from "react";
|
|
5025
5112
|
var DEFAULT_SELECTOR2 = "[data-roving-tabindex-item]";
|
|
5026
5113
|
function useRovingTabindex(options = {}) {
|
|
5027
5114
|
const { loop = true, itemSelector = DEFAULT_SELECTOR2, initialIndex = 0, onIndexChange } = options;
|
|
5028
|
-
const [activeIndex, setActiveIndex] =
|
|
5029
|
-
const containerRef =
|
|
5030
|
-
const itemsRef =
|
|
5031
|
-
const getItems =
|
|
5115
|
+
const [activeIndex, setActiveIndex] = useState16(initialIndex);
|
|
5116
|
+
const containerRef = useRef14(null);
|
|
5117
|
+
const itemsRef = useRef14(/* @__PURE__ */ new Map());
|
|
5118
|
+
const getItems = useCallback7(() => {
|
|
5032
5119
|
if (!containerRef.current) {
|
|
5033
5120
|
return Array.from(itemsRef.current.values());
|
|
5034
5121
|
}
|
|
5035
5122
|
return Array.from(containerRef.current.querySelectorAll(itemSelector));
|
|
5036
5123
|
}, [itemSelector]);
|
|
5037
|
-
const focusIndex =
|
|
5124
|
+
const focusIndex = useCallback7(
|
|
5038
5125
|
(index) => {
|
|
5039
5126
|
const items = getItems();
|
|
5040
5127
|
if (items.length === 0) return;
|
|
@@ -5054,7 +5141,7 @@ function useRovingTabindex(options = {}) {
|
|
|
5054
5141
|
},
|
|
5055
5142
|
[getItems, loop, onIndexChange]
|
|
5056
5143
|
);
|
|
5057
|
-
const handleKeyDown =
|
|
5144
|
+
const handleKeyDown = useCallback7(
|
|
5058
5145
|
(event) => {
|
|
5059
5146
|
const items = getItems();
|
|
5060
5147
|
if (items.length === 0) return;
|
|
@@ -5092,7 +5179,7 @@ function useRovingTabindex(options = {}) {
|
|
|
5092
5179
|
},
|
|
5093
5180
|
onKeyDown: handleKeyDown
|
|
5094
5181
|
};
|
|
5095
|
-
const getItemProps =
|
|
5182
|
+
const getItemProps = useCallback7(
|
|
5096
5183
|
(index, handlers = {}) => ({
|
|
5097
5184
|
"data-roving-tabindex-item": true,
|
|
5098
5185
|
tabIndex: index === activeIndex ? 0 : -1,
|
|
@@ -5234,6 +5321,7 @@ export {
|
|
|
5234
5321
|
pageHeaderSubtitleVariants,
|
|
5235
5322
|
pageHeaderTitleVariants,
|
|
5236
5323
|
progressBarVariants,
|
|
5324
|
+
setTextUndoable,
|
|
5237
5325
|
skeletonVariants,
|
|
5238
5326
|
spinnerVariants,
|
|
5239
5327
|
useAnnounce,
|