@discuss-ds/ui 0.36.0 → 0.37.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/CHANGELOG.md +6 -0
- package/dist/index.cjs +556 -484
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +36 -1
- package/dist/index.d.ts +36 -1
- package/dist/index.js +532 -463
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2276,24 +2276,90 @@ var Textarea = React32.forwardRef(
|
|
|
2276
2276
|
);
|
|
2277
2277
|
Textarea.displayName = "Textarea";
|
|
2278
2278
|
|
|
2279
|
-
// src/components/
|
|
2279
|
+
// src/components/Navigation/Stepper.tsx
|
|
2280
2280
|
import * as React33 from "react";
|
|
2281
|
+
import { CheckCircle as CheckCircle2, Circle, RadioButton, WarningCircle as WarningCircle3 } from "@phosphor-icons/react";
|
|
2282
|
+
import { jsx as jsx34, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2283
|
+
var STATUS_TEXT = { "not-completed": "not completed", completed: "completed", error: "error" };
|
|
2284
|
+
function StepIndicator({ status, selected }) {
|
|
2285
|
+
const props = { size: 24, "aria-hidden": true, className: "shrink-0" };
|
|
2286
|
+
if (status === "completed") return /* @__PURE__ */ jsx34(CheckCircle2, { ...props, weight: selected ? "fill" : "regular", className: "shrink-0 text-success-foreground" });
|
|
2287
|
+
if (status === "error") return /* @__PURE__ */ jsx34(WarningCircle3, { ...props, weight: selected ? "fill" : "regular", className: "shrink-0 text-destructive-foreground" });
|
|
2288
|
+
if (selected) return /* @__PURE__ */ jsx34(RadioButton, { ...props, weight: "fill", className: "shrink-0 text-accent-foreground" });
|
|
2289
|
+
return /* @__PURE__ */ jsx34(Circle, { ...props, className: "shrink-0 text-input-muted" });
|
|
2290
|
+
}
|
|
2291
|
+
var Step = React33.forwardRef(
|
|
2292
|
+
({ label, status = "not-completed", selected = false, orientation = "horizontal", className, ...props }, ref) => {
|
|
2293
|
+
const vertical = orientation === "vertical";
|
|
2294
|
+
return /* @__PURE__ */ jsxs24(
|
|
2295
|
+
"div",
|
|
2296
|
+
{
|
|
2297
|
+
ref,
|
|
2298
|
+
className: cn(
|
|
2299
|
+
"flex min-h-16 w-34 shrink-0",
|
|
2300
|
+
// The horizontal indicator sits 6px from the top, so a path beside it lines up whatever the label's length.
|
|
2301
|
+
vertical ? "items-center justify-end gap-4 p-2" : "flex-col items-center gap-2 pt-1.5",
|
|
2302
|
+
className
|
|
2303
|
+
),
|
|
2304
|
+
...props,
|
|
2305
|
+
children: [
|
|
2306
|
+
!vertical && /* @__PURE__ */ jsx34(StepIndicator, { status, selected }),
|
|
2307
|
+
/* @__PURE__ */ jsxs24(
|
|
2308
|
+
"span",
|
|
2309
|
+
{
|
|
2310
|
+
className: cn(
|
|
2311
|
+
vertical ? "min-w-0 flex-1 text-right" : "w-full text-center",
|
|
2312
|
+
selected ? "text-ui-label text-foreground" : "text-body-small text-secondary-muted-foreground"
|
|
2313
|
+
),
|
|
2314
|
+
children: [
|
|
2315
|
+
label,
|
|
2316
|
+
status !== "not-completed" && /* @__PURE__ */ jsx34("span", { className: "sr-only", children: `, ${STATUS_TEXT[status]}` })
|
|
2317
|
+
]
|
|
2318
|
+
}
|
|
2319
|
+
),
|
|
2320
|
+
vertical && /* @__PURE__ */ jsx34(StepIndicator, { status, selected })
|
|
2321
|
+
]
|
|
2322
|
+
}
|
|
2323
|
+
);
|
|
2324
|
+
}
|
|
2325
|
+
);
|
|
2326
|
+
Step.displayName = "Step";
|
|
2327
|
+
var StepPath = React33.forwardRef(
|
|
2328
|
+
({ orientation = "horizontal", completed = false, className, ...props }, ref) => {
|
|
2329
|
+
const vertical = orientation === "vertical";
|
|
2330
|
+
return /* @__PURE__ */ jsx34("div", { ref, "aria-hidden": true, className: cn("flex items-center justify-center", vertical ? "h-8 w-8 flex-col" : "h-8 flex-1", className), ...props, children: /* @__PURE__ */ jsx34("div", { className: cn(vertical ? "w-px flex-1" : "h-px flex-1", completed ? "bg-success-foreground" : "bg-border") }) });
|
|
2331
|
+
}
|
|
2332
|
+
);
|
|
2333
|
+
StepPath.displayName = "StepPath";
|
|
2334
|
+
var Stepper = React33.forwardRef(({ steps, current, orientation = "horizontal", className, ...props }, ref) => {
|
|
2335
|
+
const vertical = orientation === "vertical";
|
|
2336
|
+
const statusOf = (i, step) => step.error ? "error" : i < current ? "completed" : "not-completed";
|
|
2337
|
+
return /* @__PURE__ */ jsx34("ol", { ref, className: cn("flex", vertical ? "flex-col items-end" : "w-full items-start", className), ...props, children: steps.map((step, i) => /* @__PURE__ */ jsxs24(React33.Fragment, { children: [
|
|
2338
|
+
i > 0 && // Horizontal: the path runs from one indicator's edge to the next (it reaches 56px into each 136px step), level with the indicators' centre.
|
|
2339
|
+
/* @__PURE__ */ jsx34("li", { "aria-hidden": true, className: cn("flex", vertical ? "pr-1" : "-mx-14 flex-1 pt-1.5"), children: /* @__PURE__ */ jsx34(StepPath, { orientation, completed: i < current, className: vertical ? void 0 : "h-6" }) }),
|
|
2340
|
+
/* @__PURE__ */ jsx34("li", { "aria-current": i === current ? "step" : void 0, className: "flex", children: /* @__PURE__ */ jsx34(Step, { label: step.label, status: statusOf(i, step), selected: i === current, orientation }) })
|
|
2341
|
+
] }, i)) });
|
|
2342
|
+
});
|
|
2343
|
+
Stepper.displayName = "Stepper";
|
|
2344
|
+
|
|
2345
|
+
// src/components/Overlays & Feedback/Dialog.tsx
|
|
2346
|
+
import * as React34 from "react";
|
|
2281
2347
|
import { X as X3 } from "@phosphor-icons/react";
|
|
2282
2348
|
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
2283
|
-
import { jsx as
|
|
2349
|
+
import { jsx as jsx35, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2284
2350
|
var Dialog = DialogPrimitive.Root;
|
|
2285
2351
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
2286
2352
|
var DialogClose = DialogPrimitive.Close;
|
|
2287
|
-
var DialogContent =
|
|
2288
|
-
({ className, children, closeLabel = "Close", hideClose, ...props }, ref) => /* @__PURE__ */
|
|
2289
|
-
/* @__PURE__ */
|
|
2353
|
+
var DialogContent = React34.forwardRef(
|
|
2354
|
+
({ className, children, closeLabel = "Close", hideClose, ...props }, ref) => /* @__PURE__ */ jsxs25(DialogPrimitive.Portal, { children: [
|
|
2355
|
+
/* @__PURE__ */ jsx35(
|
|
2290
2356
|
DialogPrimitive.Overlay,
|
|
2291
2357
|
{
|
|
2292
2358
|
style: { zIndex: "var(--sys-z-30)" },
|
|
2293
2359
|
className: "fixed inset-0 bg-primary/30"
|
|
2294
2360
|
}
|
|
2295
2361
|
),
|
|
2296
|
-
/* @__PURE__ */
|
|
2362
|
+
/* @__PURE__ */ jsxs25(
|
|
2297
2363
|
DialogPrimitive.Content,
|
|
2298
2364
|
{
|
|
2299
2365
|
ref,
|
|
@@ -2305,15 +2371,15 @@ var DialogContent = React33.forwardRef(
|
|
|
2305
2371
|
...props,
|
|
2306
2372
|
children: [
|
|
2307
2373
|
children,
|
|
2308
|
-
!hideClose && /* @__PURE__ */
|
|
2374
|
+
!hideClose && /* @__PURE__ */ jsx35(DialogPrimitive.Close, { asChild: true, children: /* @__PURE__ */ jsx35(Button, { variant: "ghost", size: "icon-sm", "aria-label": closeLabel, className: "absolute top-4 right-6", children: /* @__PURE__ */ jsx35(X3, { size: 16, "aria-hidden": true }) }) })
|
|
2309
2375
|
]
|
|
2310
2376
|
}
|
|
2311
2377
|
)
|
|
2312
2378
|
] })
|
|
2313
2379
|
);
|
|
2314
2380
|
DialogContent.displayName = "DialogContent";
|
|
2315
|
-
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */
|
|
2316
|
-
var DialogTitle =
|
|
2381
|
+
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx35("div", { className: cn("flex flex-col gap-1.5 border-b border-border px-6 py-4 pr-16", className), ...props });
|
|
2382
|
+
var DialogTitle = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx35(
|
|
2317
2383
|
DialogPrimitive.Title,
|
|
2318
2384
|
{
|
|
2319
2385
|
ref,
|
|
@@ -2322,7 +2388,7 @@ var DialogTitle = React33.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
2322
2388
|
}
|
|
2323
2389
|
));
|
|
2324
2390
|
DialogTitle.displayName = "DialogTitle";
|
|
2325
|
-
var DialogDescription =
|
|
2391
|
+
var DialogDescription = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx35(
|
|
2326
2392
|
DialogPrimitive.Description,
|
|
2327
2393
|
{
|
|
2328
2394
|
ref,
|
|
@@ -2331,15 +2397,15 @@ var DialogDescription = React33.forwardRef(({ className, ...props }, ref) => /*
|
|
|
2331
2397
|
}
|
|
2332
2398
|
));
|
|
2333
2399
|
DialogDescription.displayName = "DialogDescription";
|
|
2334
|
-
var DialogBody = ({ className, ...props }) => /* @__PURE__ */
|
|
2335
|
-
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */
|
|
2400
|
+
var DialogBody = ({ className, ...props }) => /* @__PURE__ */ jsx35("div", { className: cn("flex flex-col gap-4 p-6", className), ...props });
|
|
2401
|
+
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx35("div", { className: cn("flex items-center justify-end gap-3 border-t border-border px-6 py-4", className), ...props });
|
|
2336
2402
|
|
|
2337
2403
|
// src/components/Overlays & Feedback/Toast.tsx
|
|
2338
|
-
import * as
|
|
2339
|
-
import { CheckCircle as
|
|
2404
|
+
import * as React35 from "react";
|
|
2405
|
+
import { CheckCircle as CheckCircle3, Info, Warning, WarningCircle as WarningCircle4, X as X4 } from "@phosphor-icons/react";
|
|
2340
2406
|
import { cva as cva4 } from "class-variance-authority";
|
|
2341
2407
|
import { Toast as ToastPrimitive } from "radix-ui";
|
|
2342
|
-
import { Fragment as
|
|
2408
|
+
import { Fragment as Fragment7, jsx as jsx36, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2343
2409
|
var toastVariants = cva4("border", {
|
|
2344
2410
|
variants: {
|
|
2345
2411
|
variant: {
|
|
@@ -2377,13 +2443,13 @@ var titleColour = {
|
|
|
2377
2443
|
};
|
|
2378
2444
|
function VariantIcon({ variant, size }) {
|
|
2379
2445
|
const props = { size, "aria-hidden": true, className: cn("shrink-0", iconColour[variant]) };
|
|
2380
|
-
if (variant === "success") return /* @__PURE__ */
|
|
2381
|
-
if (variant === "warning") return /* @__PURE__ */
|
|
2382
|
-
if (variant === "destructive") return /* @__PURE__ */
|
|
2383
|
-
return /* @__PURE__ */
|
|
2446
|
+
if (variant === "success") return /* @__PURE__ */ jsx36(CheckCircle3, { ...props });
|
|
2447
|
+
if (variant === "warning") return /* @__PURE__ */ jsx36(Warning, { ...props });
|
|
2448
|
+
if (variant === "destructive") return /* @__PURE__ */ jsx36(WarningCircle4, { ...props });
|
|
2449
|
+
return /* @__PURE__ */ jsx36(Info, { ...props });
|
|
2384
2450
|
}
|
|
2385
2451
|
var ToastProvider = ToastPrimitive.Provider;
|
|
2386
|
-
var ToastViewport =
|
|
2452
|
+
var ToastViewport = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx36(
|
|
2387
2453
|
ToastPrimitive.Viewport,
|
|
2388
2454
|
{
|
|
2389
2455
|
ref,
|
|
@@ -2393,10 +2459,10 @@ var ToastViewport = React34.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
2393
2459
|
}
|
|
2394
2460
|
));
|
|
2395
2461
|
ToastViewport.displayName = "ToastViewport";
|
|
2396
|
-
var Toast =
|
|
2462
|
+
var Toast = React35.forwardRef(
|
|
2397
2463
|
({ className, variant = "info", title, description, action, closeLabel = "Close", children, ...props }, ref) => {
|
|
2398
2464
|
const v = variant ?? "info";
|
|
2399
|
-
return /* @__PURE__ */
|
|
2465
|
+
return /* @__PURE__ */ jsxs26(
|
|
2400
2466
|
ToastPrimitive.Root,
|
|
2401
2467
|
{
|
|
2402
2468
|
ref,
|
|
@@ -2404,19 +2470,19 @@ var Toast = React34.forwardRef(
|
|
|
2404
2470
|
className: cn("flex items-start gap-3 rounded-lg p-4 shadow-lg", toastVariants({ variant: v }), className),
|
|
2405
2471
|
...props,
|
|
2406
2472
|
children: [
|
|
2407
|
-
/* @__PURE__ */
|
|
2408
|
-
/* @__PURE__ */
|
|
2409
|
-
title != null && /* @__PURE__ */
|
|
2410
|
-
description != null && /* @__PURE__ */
|
|
2473
|
+
/* @__PURE__ */ jsx36(VariantIcon, { variant: v, size: 20 }),
|
|
2474
|
+
/* @__PURE__ */ jsxs26("div", { className: "flex min-w-0 flex-1 flex-col gap-1 text-body-small", children: [
|
|
2475
|
+
title != null && /* @__PURE__ */ jsx36(ToastPrimitive.Title, { className: cn("font-semibold", titleColour[v]), children: title }),
|
|
2476
|
+
description != null && /* @__PURE__ */ jsx36(ToastPrimitive.Description, { className: "text-secondary-muted-foreground", children: description }),
|
|
2411
2477
|
children,
|
|
2412
2478
|
action
|
|
2413
2479
|
] }),
|
|
2414
|
-
/* @__PURE__ */
|
|
2480
|
+
/* @__PURE__ */ jsx36(
|
|
2415
2481
|
ToastPrimitive.Close,
|
|
2416
2482
|
{
|
|
2417
2483
|
"aria-label": closeLabel,
|
|
2418
2484
|
className: "inline-flex size-4 shrink-0 items-center justify-center rounded-xs text-surface-foreground",
|
|
2419
|
-
children: /* @__PURE__ */
|
|
2485
|
+
children: /* @__PURE__ */ jsx36(X4, { size: 16, "aria-hidden": true })
|
|
2420
2486
|
}
|
|
2421
2487
|
)
|
|
2422
2488
|
]
|
|
@@ -2426,11 +2492,11 @@ var Toast = React34.forwardRef(
|
|
|
2426
2492
|
);
|
|
2427
2493
|
Toast.displayName = "Toast";
|
|
2428
2494
|
var ToastAction = ToastPrimitive.Action;
|
|
2429
|
-
var ToastInline =
|
|
2495
|
+
var ToastInline = React35.forwardRef(
|
|
2430
2496
|
({ className, variant = "info", actions, actionsPlacement = "end", onClose, closeLabel = "Close", children, ...props }, ref) => {
|
|
2431
2497
|
const v = variant ?? "info";
|
|
2432
2498
|
const below = actionsPlacement === "bottom" && !!actions;
|
|
2433
|
-
return /* @__PURE__ */
|
|
2499
|
+
return /* @__PURE__ */ jsxs26(
|
|
2434
2500
|
"div",
|
|
2435
2501
|
{
|
|
2436
2502
|
ref,
|
|
@@ -2438,15 +2504,15 @@ var ToastInline = React34.forwardRef(
|
|
|
2438
2504
|
className: cn("flex gap-2 rounded-sm px-2 py-1.5", below ? "items-start" : "items-center", inlineVariants({ variant: v }), className),
|
|
2439
2505
|
...props,
|
|
2440
2506
|
children: [
|
|
2441
|
-
/* @__PURE__ */
|
|
2442
|
-
below ? /* @__PURE__ */
|
|
2443
|
-
/* @__PURE__ */
|
|
2444
|
-
/* @__PURE__ */
|
|
2445
|
-
] }) : /* @__PURE__ */
|
|
2446
|
-
/* @__PURE__ */
|
|
2447
|
-
actions && /* @__PURE__ */
|
|
2507
|
+
/* @__PURE__ */ jsx36("span", { className: cn("inline-flex shrink-0", below && "mt-0.5"), children: /* @__PURE__ */ jsx36(VariantIcon, { variant: v === "neutral" ? "info" : v, size: 16 }) }),
|
|
2508
|
+
below ? /* @__PURE__ */ jsxs26("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
2509
|
+
/* @__PURE__ */ jsx36("p", { className: "text-body-small text-secondary-muted-foreground", children }),
|
|
2510
|
+
/* @__PURE__ */ jsx36("div", { className: "flex items-center gap-2", children: actions })
|
|
2511
|
+
] }) : /* @__PURE__ */ jsxs26(Fragment7, { children: [
|
|
2512
|
+
/* @__PURE__ */ jsx36("p", { className: "min-w-0 flex-1 text-body-small text-secondary-muted-foreground", children }),
|
|
2513
|
+
actions && /* @__PURE__ */ jsx36("div", { className: "flex shrink-0 items-center gap-2", children: actions })
|
|
2448
2514
|
] }),
|
|
2449
|
-
onClose && /* @__PURE__ */
|
|
2515
|
+
onClose && /* @__PURE__ */ jsx36(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": closeLabel, onClick: onClose, children: /* @__PURE__ */ jsx36(X4, { size: 16, "aria-hidden": true }) })
|
|
2450
2516
|
]
|
|
2451
2517
|
}
|
|
2452
2518
|
);
|
|
@@ -2455,16 +2521,16 @@ var ToastInline = React34.forwardRef(
|
|
|
2455
2521
|
ToastInline.displayName = "ToastInline";
|
|
2456
2522
|
|
|
2457
2523
|
// src/components/Overlays & Feedback/Tooltip.tsx
|
|
2458
|
-
import * as
|
|
2524
|
+
import * as React36 from "react";
|
|
2459
2525
|
import { Tooltip as TooltipPrimitive } from "radix-ui";
|
|
2460
|
-
import { Fragment as
|
|
2526
|
+
import { Fragment as Fragment8, jsx as jsx37, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2461
2527
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
2462
2528
|
var Tooltip = TooltipPrimitive.Root;
|
|
2463
2529
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
2464
|
-
var TooltipContent =
|
|
2530
|
+
var TooltipContent = React36.forwardRef(
|
|
2465
2531
|
({ className, sideOffset = 4, title, description, action, arrow = true, children, ...props }, ref) => {
|
|
2466
2532
|
const detailed = title != null || description != null;
|
|
2467
|
-
return /* @__PURE__ */
|
|
2533
|
+
return /* @__PURE__ */ jsx37(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs27(
|
|
2468
2534
|
TooltipPrimitive.Content,
|
|
2469
2535
|
{
|
|
2470
2536
|
ref,
|
|
@@ -2478,12 +2544,12 @@ var TooltipContent = React35.forwardRef(
|
|
|
2478
2544
|
),
|
|
2479
2545
|
...props,
|
|
2480
2546
|
children: [
|
|
2481
|
-
detailed ? /* @__PURE__ */
|
|
2482
|
-
title != null && /* @__PURE__ */
|
|
2483
|
-
description != null && /* @__PURE__ */
|
|
2484
|
-
action != null && /* @__PURE__ */
|
|
2547
|
+
detailed ? /* @__PURE__ */ jsxs27(Fragment8, { children: [
|
|
2548
|
+
title != null && /* @__PURE__ */ jsx37("p", { className: "text-xs leading-4 font-semibold text-label", children: title }),
|
|
2549
|
+
description != null && /* @__PURE__ */ jsx37("p", { className: "text-xs leading-4.5 text-plum-200", children: description }),
|
|
2550
|
+
action != null && /* @__PURE__ */ jsx37("div", { className: "mt-1 text-ui-caption text-plum-300 underline *:underline", children: action })
|
|
2485
2551
|
] }) : children,
|
|
2486
|
-
arrow && /* @__PURE__ */
|
|
2552
|
+
arrow && /* @__PURE__ */ jsx37(TooltipPrimitive.Arrow, { width: 12, height: 8, className: "fill-primary-soft-foreground" })
|
|
2487
2553
|
]
|
|
2488
2554
|
}
|
|
2489
2555
|
) });
|
|
@@ -2492,14 +2558,14 @@ var TooltipContent = React35.forwardRef(
|
|
|
2492
2558
|
TooltipContent.displayName = "TooltipContent";
|
|
2493
2559
|
|
|
2494
2560
|
// src/components/Question Types/FileUpload.tsx
|
|
2495
|
-
import * as
|
|
2561
|
+
import * as React38 from "react";
|
|
2496
2562
|
import { FileText, X as X5 } from "@phosphor-icons/react";
|
|
2497
2563
|
import { Progress as ProgressPrimitive } from "radix-ui";
|
|
2498
2564
|
|
|
2499
2565
|
// src/components/Tags & Badges/Tag.tsx
|
|
2500
|
-
import * as
|
|
2566
|
+
import * as React37 from "react";
|
|
2501
2567
|
import { cva as cva5 } from "class-variance-authority";
|
|
2502
|
-
import { jsx as
|
|
2568
|
+
import { jsx as jsx38, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2503
2569
|
var tagVariants = cva5(
|
|
2504
2570
|
"inline-flex items-center gap-1.5 whitespace-nowrap rounded-sm border px-2.5 py-1 text-ui-caption",
|
|
2505
2571
|
{
|
|
@@ -2515,7 +2581,7 @@ var tagVariants = cva5(
|
|
|
2515
2581
|
defaultVariants: { variant: "neutral" }
|
|
2516
2582
|
}
|
|
2517
2583
|
);
|
|
2518
|
-
var Tag =
|
|
2584
|
+
var Tag = React37.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx38("span", { ref, className: cn(tagVariants({ variant }), className), ...props }));
|
|
2519
2585
|
Tag.displayName = "Tag";
|
|
2520
2586
|
var statusDotVariants = cva5("size-1.5 shrink-0 rounded-full", {
|
|
2521
2587
|
variants: {
|
|
@@ -2528,20 +2594,20 @@ var statusDotVariants = cva5("size-1.5 shrink-0 rounded-full", {
|
|
|
2528
2594
|
},
|
|
2529
2595
|
defaultVariants: { status: "active" }
|
|
2530
2596
|
});
|
|
2531
|
-
var StatusTag =
|
|
2532
|
-
({ className, status, children, ...props }, ref) => /* @__PURE__ */
|
|
2533
|
-
/* @__PURE__ */
|
|
2597
|
+
var StatusTag = React37.forwardRef(
|
|
2598
|
+
({ className, status, children, ...props }, ref) => /* @__PURE__ */ jsxs28("span", { ref, className: cn(tagVariants({ variant: "default" }), className), ...props, children: [
|
|
2599
|
+
/* @__PURE__ */ jsx38("span", { className: statusDotVariants({ status }), "aria-hidden": "true" }),
|
|
2534
2600
|
children
|
|
2535
2601
|
] })
|
|
2536
2602
|
);
|
|
2537
2603
|
StatusTag.displayName = "StatusTag";
|
|
2538
2604
|
|
|
2539
2605
|
// src/components/Question Types/FileUpload.tsx
|
|
2540
|
-
import { Fragment as
|
|
2541
|
-
var FileUploadZone =
|
|
2606
|
+
import { Fragment as Fragment9, jsx as jsx39, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2607
|
+
var FileUploadZone = React38.forwardRef(
|
|
2542
2608
|
({ className, title = "Upload document", hint, icon, onFiles, ...props }, ref) => {
|
|
2543
|
-
const [over, setOver] =
|
|
2544
|
-
return /* @__PURE__ */
|
|
2609
|
+
const [over, setOver] = React38.useState(false);
|
|
2610
|
+
return /* @__PURE__ */ jsxs29(
|
|
2545
2611
|
"label",
|
|
2546
2612
|
{
|
|
2547
2613
|
className: cn(
|
|
@@ -2561,12 +2627,12 @@ var FileUploadZone = React37.forwardRef(
|
|
|
2561
2627
|
onFiles?.(Array.from(event.dataTransfer.files));
|
|
2562
2628
|
},
|
|
2563
2629
|
children: [
|
|
2564
|
-
/* @__PURE__ */
|
|
2565
|
-
/* @__PURE__ */
|
|
2566
|
-
/* @__PURE__ */
|
|
2567
|
-
hint && /* @__PURE__ */
|
|
2630
|
+
/* @__PURE__ */ jsx39("span", { className: "flex size-10 items-center justify-center rounded-full bg-background bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-surface-foreground", children: icon ?? /* @__PURE__ */ jsx39(FileText, { size: 24, "aria-hidden": true }) }),
|
|
2631
|
+
/* @__PURE__ */ jsxs29("span", { className: "flex flex-col gap-1", children: [
|
|
2632
|
+
/* @__PURE__ */ jsx39("span", { className: "text-body-small text-surface-foreground", children: title }),
|
|
2633
|
+
hint && /* @__PURE__ */ jsx39("span", { className: "text-ui-caption text-secondary-muted-foreground", children: hint })
|
|
2568
2634
|
] }),
|
|
2569
|
-
/* @__PURE__ */
|
|
2635
|
+
/* @__PURE__ */ jsx39(
|
|
2570
2636
|
"input",
|
|
2571
2637
|
{
|
|
2572
2638
|
ref,
|
|
@@ -2582,47 +2648,47 @@ var FileUploadZone = React37.forwardRef(
|
|
|
2582
2648
|
}
|
|
2583
2649
|
);
|
|
2584
2650
|
FileUploadZone.displayName = "FileUploadZone";
|
|
2585
|
-
var FileUploadItem =
|
|
2651
|
+
var FileUploadItem = React38.forwardRef(
|
|
2586
2652
|
({ className, name, size, status = "uploading", progress = 0, timeLeft, icon, onRemove, removeLabel, ...props }, ref) => {
|
|
2587
2653
|
const uploading = status === "uploading";
|
|
2588
|
-
return /* @__PURE__ */
|
|
2654
|
+
return /* @__PURE__ */ jsxs29(
|
|
2589
2655
|
"div",
|
|
2590
2656
|
{
|
|
2591
2657
|
ref,
|
|
2592
2658
|
className: cn("flex w-full flex-col justify-center gap-2 overflow-hidden rounded-sm border border-border p-2", className),
|
|
2593
2659
|
...props,
|
|
2594
2660
|
children: [
|
|
2595
|
-
/* @__PURE__ */
|
|
2596
|
-
/* @__PURE__ */
|
|
2597
|
-
/* @__PURE__ */
|
|
2598
|
-
/* @__PURE__ */
|
|
2599
|
-
/* @__PURE__ */
|
|
2600
|
-
onRemove && /* @__PURE__ */
|
|
2661
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex items-center gap-2", children: [
|
|
2662
|
+
/* @__PURE__ */ jsx39("span", { className: "flex size-10 shrink-0 items-center justify-center rounded-full bg-background bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-surface-foreground", children: icon ?? /* @__PURE__ */ jsx39(FileText, { size: 24, "aria-hidden": true }) }),
|
|
2663
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
2664
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex items-center justify-between gap-2", children: [
|
|
2665
|
+
/* @__PURE__ */ jsx39("p", { className: "min-w-0 truncate text-ui-label text-surface-foreground", children: name }),
|
|
2666
|
+
onRemove && /* @__PURE__ */ jsx39(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": removeLabel ?? `Remove ${name}`, onClick: onRemove, children: /* @__PURE__ */ jsx39(X5, { size: 16, "aria-hidden": true }) })
|
|
2601
2667
|
] }),
|
|
2602
|
-
/* @__PURE__ */
|
|
2603
|
-
/* @__PURE__ */
|
|
2668
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex items-center justify-between text-ui-caption text-secondary-muted-foreground", children: [
|
|
2669
|
+
/* @__PURE__ */ jsxs29("span", { className: "flex items-center gap-2", children: [
|
|
2604
2670
|
size,
|
|
2605
|
-
status === "complete" && /* @__PURE__ */
|
|
2606
|
-
status === "error" && /* @__PURE__ */
|
|
2607
|
-
uploading && timeLeft && /* @__PURE__ */
|
|
2608
|
-
/* @__PURE__ */
|
|
2671
|
+
status === "complete" && /* @__PURE__ */ jsx39(Tag, { variant: "success", children: "Complete" }),
|
|
2672
|
+
status === "error" && /* @__PURE__ */ jsx39(Tag, { variant: "destructive", children: "Error" }),
|
|
2673
|
+
uploading && timeLeft && /* @__PURE__ */ jsxs29(Fragment9, { children: [
|
|
2674
|
+
/* @__PURE__ */ jsx39("span", { "aria-hidden": "true", className: "size-0.5 rounded-full bg-secondary-muted-foreground" }),
|
|
2609
2675
|
timeLeft
|
|
2610
2676
|
] })
|
|
2611
2677
|
] }),
|
|
2612
|
-
uploading && /* @__PURE__ */
|
|
2678
|
+
uploading && /* @__PURE__ */ jsxs29("span", { className: "text-body-xxs font-normal", children: [
|
|
2613
2679
|
Math.round(progress),
|
|
2614
2680
|
"%"
|
|
2615
2681
|
] })
|
|
2616
2682
|
] })
|
|
2617
2683
|
] })
|
|
2618
2684
|
] }),
|
|
2619
|
-
uploading && /* @__PURE__ */
|
|
2685
|
+
uploading && /* @__PURE__ */ jsx39(
|
|
2620
2686
|
ProgressPrimitive.Root,
|
|
2621
2687
|
{
|
|
2622
2688
|
value: progress,
|
|
2623
2689
|
"aria-label": `Uploading ${name}`,
|
|
2624
2690
|
className: "h-0.75 w-full overflow-hidden rounded-sm bg-background bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5",
|
|
2625
|
-
children: /* @__PURE__ */
|
|
2691
|
+
children: /* @__PURE__ */ jsx39(ProgressPrimitive.Indicator, { className: "h-full bg-accent transition-[width]", style: { width: `${progress}%` } })
|
|
2626
2692
|
}
|
|
2627
2693
|
)
|
|
2628
2694
|
]
|
|
@@ -2633,25 +2699,25 @@ var FileUploadItem = React37.forwardRef(
|
|
|
2633
2699
|
FileUploadItem.displayName = "FileUploadItem";
|
|
2634
2700
|
|
|
2635
2701
|
// src/components/Question Types/Media.tsx
|
|
2636
|
-
import * as
|
|
2702
|
+
import * as React39 from "react";
|
|
2637
2703
|
import { CornersOut, DotsThree, Image as ImageIcon, Pause, Play, SpeakerSimpleHigh, SpeakerSimpleX, Trash as Trash3 } from "@phosphor-icons/react";
|
|
2638
2704
|
import { Slider as SliderPrimitive2, ToggleGroup as ToggleGroupPrimitive2 } from "radix-ui";
|
|
2639
|
-
import { jsx as
|
|
2705
|
+
import { jsx as jsx40, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2640
2706
|
function MediaInfo({ name, details, onRemove, removeLabel, large, className, ...props }) {
|
|
2641
|
-
return /* @__PURE__ */
|
|
2642
|
-
/* @__PURE__ */
|
|
2643
|
-
/* @__PURE__ */
|
|
2644
|
-
details && /* @__PURE__ */
|
|
2645
|
-
index > 0 && /* @__PURE__ */
|
|
2707
|
+
return /* @__PURE__ */ jsxs30("div", { className: cn("flex items-center justify-between border-t border-border bg-surface px-6 py-4", className), ...props, children: [
|
|
2708
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
2709
|
+
/* @__PURE__ */ jsx40("p", { className: cn("truncate text-surface-foreground", large ? "text-body-section" : "text-ui-label"), children: name }),
|
|
2710
|
+
details && /* @__PURE__ */ jsx40("p", { className: cn("flex items-center gap-2 text-secondary-muted-foreground", large ? "text-body-small" : "text-ui-caption"), children: details.map((part, index) => /* @__PURE__ */ jsxs30(React39.Fragment, { children: [
|
|
2711
|
+
index > 0 && /* @__PURE__ */ jsx40("span", { "aria-hidden": "true", className: "size-0.5 rounded-full bg-secondary-muted-foreground" }),
|
|
2646
2712
|
part
|
|
2647
2713
|
] }, part)) })
|
|
2648
2714
|
] }),
|
|
2649
|
-
onRemove && /* @__PURE__ */
|
|
2715
|
+
onRemove && /* @__PURE__ */ jsx40(Button, { type: "button", variant: "destructive", size: "icon", "aria-label": removeLabel ?? `Remove ${name}`, onClick: onRemove, children: /* @__PURE__ */ jsx40(Trash3, { size: 16, "aria-hidden": true }) })
|
|
2650
2716
|
] });
|
|
2651
2717
|
}
|
|
2652
|
-
var ImagePreview =
|
|
2653
|
-
({ className, children, name, details, onRemove, ...props }, ref) => /* @__PURE__ */
|
|
2654
|
-
/* @__PURE__ */
|
|
2718
|
+
var ImagePreview = React39.forwardRef(
|
|
2719
|
+
({ className, children, name, details, onRemove, ...props }, ref) => /* @__PURE__ */ jsxs30("div", { ref, className: cn("flex w-full flex-col overflow-hidden rounded-lg border border-border", className), ...props, children: [
|
|
2720
|
+
/* @__PURE__ */ jsx40(
|
|
2655
2721
|
"div",
|
|
2656
2722
|
{
|
|
2657
2723
|
className: cn(
|
|
@@ -2662,12 +2728,12 @@ var ImagePreview = React38.forwardRef(
|
|
|
2662
2728
|
children
|
|
2663
2729
|
}
|
|
2664
2730
|
),
|
|
2665
|
-
/* @__PURE__ */
|
|
2731
|
+
/* @__PURE__ */ jsx40(MediaInfo, { name, details, onRemove, large: true })
|
|
2666
2732
|
] })
|
|
2667
2733
|
);
|
|
2668
2734
|
ImagePreview.displayName = "ImagePreview";
|
|
2669
|
-
var ImageThumbnails =
|
|
2670
|
-
({ className, max, images, value, onValueChange, ...props }, ref) => /* @__PURE__ */
|
|
2735
|
+
var ImageThumbnails = React39.forwardRef(
|
|
2736
|
+
({ className, max, images, value, onValueChange, ...props }, ref) => /* @__PURE__ */ jsx40(
|
|
2671
2737
|
ToggleGroupPrimitive2.Root,
|
|
2672
2738
|
{
|
|
2673
2739
|
ref,
|
|
@@ -2679,17 +2745,17 @@ var ImageThumbnails = React38.forwardRef(
|
|
|
2679
2745
|
children: Array.from({ length: max }, (_, index) => {
|
|
2680
2746
|
const image = images[index];
|
|
2681
2747
|
if (!image) {
|
|
2682
|
-
return /* @__PURE__ */
|
|
2748
|
+
return /* @__PURE__ */ jsx40(
|
|
2683
2749
|
"span",
|
|
2684
2750
|
{
|
|
2685
2751
|
"aria-hidden": "true",
|
|
2686
2752
|
className: "flex h-20 min-w-0 flex-1 items-center justify-center rounded-sm border border-dashed border-border text-accent-foreground",
|
|
2687
|
-
children: /* @__PURE__ */
|
|
2753
|
+
children: /* @__PURE__ */ jsx40(ImageIcon, { size: 24 })
|
|
2688
2754
|
},
|
|
2689
2755
|
`empty-${index}`
|
|
2690
2756
|
);
|
|
2691
2757
|
}
|
|
2692
|
-
return /* @__PURE__ */
|
|
2758
|
+
return /* @__PURE__ */ jsx40(
|
|
2693
2759
|
ToggleGroupPrimitive2.Item,
|
|
2694
2760
|
{
|
|
2695
2761
|
value: image.id,
|
|
@@ -2699,7 +2765,7 @@ var ImageThumbnails = React38.forwardRef(
|
|
|
2699
2765
|
"hover:bg-accent-soft hover:bg-none",
|
|
2700
2766
|
"data-[state=on]:border-accent-foreground data-[state=on]:bg-accent-soft data-[state=on]:bg-none data-[state=on]:text-accent-foreground"
|
|
2701
2767
|
),
|
|
2702
|
-
children: image.src ? /* @__PURE__ */
|
|
2768
|
+
children: image.src ? /* @__PURE__ */ jsx40("img", { src: image.src, alt: "", className: "size-full object-cover" }) : /* @__PURE__ */ jsx40(ImageIcon, { size: 24, "aria-hidden": true })
|
|
2703
2769
|
},
|
|
2704
2770
|
image.id
|
|
2705
2771
|
);
|
|
@@ -2712,13 +2778,13 @@ var formatTime = (seconds) => {
|
|
|
2712
2778
|
const total = Math.max(0, Math.floor(Number.isFinite(seconds) ? seconds : 0));
|
|
2713
2779
|
return `${Math.floor(total / 60)}:${String(total % 60).padStart(2, "0")}`;
|
|
2714
2780
|
};
|
|
2715
|
-
var VideoPlayer =
|
|
2781
|
+
var VideoPlayer = React39.forwardRef(
|
|
2716
2782
|
({ className, src, name, details, onRemove, onMore, initialTime = 0, initialDuration = 0, ...props }, ref) => {
|
|
2717
|
-
const video =
|
|
2718
|
-
const [playing, setPlaying] =
|
|
2719
|
-
const [time, setTime] =
|
|
2720
|
-
const [duration, setDuration] =
|
|
2721
|
-
const [volume, setVolume] =
|
|
2783
|
+
const video = React39.useRef(null);
|
|
2784
|
+
const [playing, setPlaying] = React39.useState(false);
|
|
2785
|
+
const [time, setTime] = React39.useState(initialTime);
|
|
2786
|
+
const [duration, setDuration] = React39.useState(initialDuration);
|
|
2787
|
+
const [volume, setVolume] = React39.useState(1);
|
|
2722
2788
|
const muted = volume === 0;
|
|
2723
2789
|
const toggle2 = () => {
|
|
2724
2790
|
const el = video.current;
|
|
@@ -2726,9 +2792,9 @@ var VideoPlayer = React38.forwardRef(
|
|
|
2726
2792
|
if (el.paused) void el.play();
|
|
2727
2793
|
else el.pause();
|
|
2728
2794
|
};
|
|
2729
|
-
return /* @__PURE__ */
|
|
2730
|
-
/* @__PURE__ */
|
|
2731
|
-
src && /* @__PURE__ */
|
|
2795
|
+
return /* @__PURE__ */ jsxs30("div", { ref, className: cn("flex w-full flex-col overflow-hidden rounded-lg border border-border bg-surface", className), ...props, children: [
|
|
2796
|
+
/* @__PURE__ */ jsxs30("div", { className: "relative flex h-60.5 w-full items-end bg-accent-soft", children: [
|
|
2797
|
+
src && /* @__PURE__ */ jsx40(
|
|
2732
2798
|
"video",
|
|
2733
2799
|
{
|
|
2734
2800
|
ref: video,
|
|
@@ -2741,8 +2807,8 @@ var VideoPlayer = React38.forwardRef(
|
|
|
2741
2807
|
onVolumeChange: (event) => setVolume(event.currentTarget.muted ? 0 : event.currentTarget.volume)
|
|
2742
2808
|
}
|
|
2743
2809
|
),
|
|
2744
|
-
/* @__PURE__ */
|
|
2745
|
-
/* @__PURE__ */
|
|
2810
|
+
/* @__PURE__ */ jsxs30("div", { className: "relative flex w-full flex-col gap-2 bg-surface-foreground bg-linear-to-r from-primary/30 to-primary/30 px-4 pt-3 pb-4 text-surface", children: [
|
|
2811
|
+
/* @__PURE__ */ jsxs30(
|
|
2746
2812
|
SliderPrimitive2.Root,
|
|
2747
2813
|
{
|
|
2748
2814
|
min: 0,
|
|
@@ -2756,31 +2822,31 @@ var VideoPlayer = React38.forwardRef(
|
|
|
2756
2822
|
},
|
|
2757
2823
|
className: "relative flex h-4 w-full touch-none items-center select-none",
|
|
2758
2824
|
children: [
|
|
2759
|
-
/* @__PURE__ */
|
|
2760
|
-
/* @__PURE__ */
|
|
2825
|
+
/* @__PURE__ */ jsx40(SliderPrimitive2.Track, { className: "relative h-1 w-full grow overflow-hidden rounded-xxs bg-surface/20", children: /* @__PURE__ */ jsx40(SliderPrimitive2.Range, { className: "absolute h-full bg-accent-foreground" }) }),
|
|
2826
|
+
/* @__PURE__ */ jsx40(SliderPrimitive2.Thumb, { "aria-label": "Seek", className: "block size-3 rounded-full border-2 border-surface bg-surface shadow-sm" })
|
|
2761
2827
|
]
|
|
2762
2828
|
}
|
|
2763
2829
|
),
|
|
2764
|
-
/* @__PURE__ */
|
|
2765
|
-
/* @__PURE__ */
|
|
2766
|
-
/* @__PURE__ */
|
|
2830
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex items-center justify-between", children: [
|
|
2831
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-4", children: [
|
|
2832
|
+
/* @__PURE__ */ jsx40(
|
|
2767
2833
|
"button",
|
|
2768
2834
|
{
|
|
2769
2835
|
type: "button",
|
|
2770
2836
|
"aria-label": playing ? "Pause" : "Play",
|
|
2771
2837
|
onClick: toggle2,
|
|
2772
2838
|
className: "inline-flex size-10 items-center justify-center rounded-full bg-surface/12 text-surface transition-colors hover:bg-surface/20",
|
|
2773
|
-
children: playing ? /* @__PURE__ */
|
|
2839
|
+
children: playing ? /* @__PURE__ */ jsx40(Pause, { size: 16, weight: "fill", "aria-hidden": true }) : /* @__PURE__ */ jsx40(Play, { size: 16, weight: "fill", "aria-hidden": true })
|
|
2774
2840
|
}
|
|
2775
2841
|
),
|
|
2776
|
-
/* @__PURE__ */
|
|
2842
|
+
/* @__PURE__ */ jsxs30("span", { className: "text-ui-label whitespace-nowrap text-surface/80", children: [
|
|
2777
2843
|
formatTime(time),
|
|
2778
2844
|
" / ",
|
|
2779
2845
|
formatTime(duration)
|
|
2780
2846
|
] })
|
|
2781
2847
|
] }),
|
|
2782
|
-
/* @__PURE__ */
|
|
2783
|
-
/* @__PURE__ */
|
|
2848
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-2", children: [
|
|
2849
|
+
/* @__PURE__ */ jsx40(
|
|
2784
2850
|
VolumeControl,
|
|
2785
2851
|
{
|
|
2786
2852
|
volume,
|
|
@@ -2793,41 +2859,41 @@ var VideoPlayer = React38.forwardRef(
|
|
|
2793
2859
|
}
|
|
2794
2860
|
}
|
|
2795
2861
|
),
|
|
2796
|
-
/* @__PURE__ */
|
|
2862
|
+
/* @__PURE__ */ jsx40(
|
|
2797
2863
|
"button",
|
|
2798
2864
|
{
|
|
2799
2865
|
type: "button",
|
|
2800
2866
|
"aria-label": "Full screen",
|
|
2801
2867
|
onClick: () => void video.current?.requestFullscreen?.(),
|
|
2802
2868
|
className: "inline-flex size-10 items-center justify-center rounded-md text-surface transition-colors hover:bg-surface/12",
|
|
2803
|
-
children: /* @__PURE__ */
|
|
2869
|
+
children: /* @__PURE__ */ jsx40(CornersOut, { size: 16, "aria-hidden": true })
|
|
2804
2870
|
}
|
|
2805
2871
|
),
|
|
2806
|
-
/* @__PURE__ */
|
|
2872
|
+
/* @__PURE__ */ jsx40(
|
|
2807
2873
|
"button",
|
|
2808
2874
|
{
|
|
2809
2875
|
type: "button",
|
|
2810
2876
|
"aria-label": "More",
|
|
2811
2877
|
onClick: onMore,
|
|
2812
2878
|
className: "inline-flex size-10 items-center justify-center rounded-md text-surface transition-colors hover:bg-surface/12",
|
|
2813
|
-
children: /* @__PURE__ */
|
|
2879
|
+
children: /* @__PURE__ */ jsx40(DotsThree, { size: 16, "aria-hidden": true })
|
|
2814
2880
|
}
|
|
2815
2881
|
)
|
|
2816
2882
|
] })
|
|
2817
2883
|
] })
|
|
2818
2884
|
] })
|
|
2819
2885
|
] }),
|
|
2820
|
-
name && /* @__PURE__ */
|
|
2821
|
-
/* @__PURE__ */
|
|
2886
|
+
name && /* @__PURE__ */ jsx40(MediaInfo, { name, details, onRemove }),
|
|
2887
|
+
/* @__PURE__ */ jsx40("span", { className: "sr-only", "aria-live": "polite", children: muted ? "Muted" : "" })
|
|
2822
2888
|
] });
|
|
2823
2889
|
}
|
|
2824
2890
|
);
|
|
2825
2891
|
VideoPlayer.displayName = "VideoPlayer";
|
|
2826
2892
|
function VolumeControl({ volume, onVolumeChange, className }) {
|
|
2827
|
-
const last =
|
|
2893
|
+
const last = React39.useRef(volume || 1);
|
|
2828
2894
|
if (volume > 0) last.current = volume;
|
|
2829
|
-
return /* @__PURE__ */
|
|
2830
|
-
/* @__PURE__ */
|
|
2895
|
+
return /* @__PURE__ */ jsxs30("div", { className: cn("group/volume flex items-center", className), children: [
|
|
2896
|
+
/* @__PURE__ */ jsx40("div", { className: "w-0 overflow-hidden opacity-0 transition-all group-focus-within/volume:w-16 group-focus-within/volume:opacity-100 group-hover/volume:w-16 group-hover/volume:opacity-100", children: /* @__PURE__ */ jsxs30(
|
|
2831
2897
|
SliderPrimitive2.Root,
|
|
2832
2898
|
{
|
|
2833
2899
|
min: 0,
|
|
@@ -2837,32 +2903,32 @@ function VolumeControl({ volume, onVolumeChange, className }) {
|
|
|
2837
2903
|
onValueChange: ([next]) => next !== void 0 && onVolumeChange(next),
|
|
2838
2904
|
className: "relative flex h-4 w-14 touch-none items-center select-none",
|
|
2839
2905
|
children: [
|
|
2840
|
-
/* @__PURE__ */
|
|
2841
|
-
/* @__PURE__ */
|
|
2906
|
+
/* @__PURE__ */ jsx40(SliderPrimitive2.Track, { className: "relative h-1 w-full grow overflow-hidden rounded-xxs bg-surface/20", children: /* @__PURE__ */ jsx40(SliderPrimitive2.Range, { className: "absolute h-full bg-surface" }) }),
|
|
2907
|
+
/* @__PURE__ */ jsx40(SliderPrimitive2.Thumb, { "aria-label": "Volume", className: "block size-3 rounded-full bg-surface shadow-sm" })
|
|
2842
2908
|
]
|
|
2843
2909
|
}
|
|
2844
2910
|
) }),
|
|
2845
|
-
/* @__PURE__ */
|
|
2911
|
+
/* @__PURE__ */ jsx40(
|
|
2846
2912
|
"button",
|
|
2847
2913
|
{
|
|
2848
2914
|
type: "button",
|
|
2849
2915
|
"aria-label": volume === 0 ? "Unmute" : "Mute",
|
|
2850
2916
|
onClick: () => onVolumeChange(volume === 0 ? last.current : 0),
|
|
2851
2917
|
className: "inline-flex size-10 items-center justify-center rounded-md text-surface transition-colors hover:bg-surface/12",
|
|
2852
|
-
children: volume === 0 ? /* @__PURE__ */
|
|
2918
|
+
children: volume === 0 ? /* @__PURE__ */ jsx40(SpeakerSimpleX, { size: 16, "aria-hidden": true }) : /* @__PURE__ */ jsx40(SpeakerSimpleHigh, { size: 16, "aria-hidden": true })
|
|
2853
2919
|
}
|
|
2854
2920
|
)
|
|
2855
2921
|
] });
|
|
2856
2922
|
}
|
|
2857
2923
|
|
|
2858
2924
|
// src/components/Question Types/OpenEndAnswer.tsx
|
|
2859
|
-
import * as
|
|
2860
|
-
import { jsx as
|
|
2861
|
-
var OpenEndAnswer =
|
|
2925
|
+
import * as React40 from "react";
|
|
2926
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
2927
|
+
var OpenEndAnswer = React40.forwardRef(
|
|
2862
2928
|
({ value, defaultValue, onChange, maxLength = 1e3, placeholder = "Write your answer", ...props }, ref) => {
|
|
2863
|
-
const [internal, setInternal] =
|
|
2929
|
+
const [internal, setInternal] = React40.useState(String(defaultValue ?? ""));
|
|
2864
2930
|
const text = value !== void 0 ? String(value) : internal;
|
|
2865
|
-
return /* @__PURE__ */
|
|
2931
|
+
return /* @__PURE__ */ jsx41(
|
|
2866
2932
|
Textarea,
|
|
2867
2933
|
{
|
|
2868
2934
|
ref,
|
|
@@ -2882,10 +2948,10 @@ var OpenEndAnswer = React39.forwardRef(
|
|
|
2882
2948
|
OpenEndAnswer.displayName = "OpenEndAnswer";
|
|
2883
2949
|
|
|
2884
2950
|
// src/components/Question Types/QuestionCard.tsx
|
|
2885
|
-
import * as
|
|
2886
|
-
import { jsx as
|
|
2887
|
-
var QuestionCard =
|
|
2888
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
2951
|
+
import * as React41 from "react";
|
|
2952
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
2953
|
+
var QuestionCard = React41.forwardRef(
|
|
2954
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx42(
|
|
2889
2955
|
"div",
|
|
2890
2956
|
{
|
|
2891
2957
|
ref,
|
|
@@ -2897,7 +2963,7 @@ var QuestionCard = React40.forwardRef(
|
|
|
2897
2963
|
QuestionCard.displayName = "QuestionCard";
|
|
2898
2964
|
|
|
2899
2965
|
// src/components/Question Types/QuestionEditorCard.tsx
|
|
2900
|
-
import * as
|
|
2966
|
+
import * as React44 from "react";
|
|
2901
2967
|
import {
|
|
2902
2968
|
Clipboard,
|
|
2903
2969
|
Copy,
|
|
@@ -2917,15 +2983,15 @@ function keepEditingFocus(event) {
|
|
|
2917
2983
|
}
|
|
2918
2984
|
|
|
2919
2985
|
// src/components/Question Types/QuestionHeader.tsx
|
|
2920
|
-
import * as
|
|
2986
|
+
import * as React43 from "react";
|
|
2921
2987
|
import { DotsSixVertical } from "@phosphor-icons/react";
|
|
2922
2988
|
|
|
2923
2989
|
// src/components/Question Types/QuestionTypeIcon.tsx
|
|
2924
2990
|
import "react";
|
|
2925
|
-
import { ChatsCircle, CheckSquare, FileArrowUp, FileText as FileText2, Image, ListNumbers, RadioButton, StarHalf, VideoCamera } from "@phosphor-icons/react";
|
|
2926
|
-
import { jsx as
|
|
2991
|
+
import { ChatsCircle, CheckSquare, FileArrowUp, FileText as FileText2, Image, ListNumbers, RadioButton as RadioButton2, StarHalf, VideoCamera } from "@phosphor-icons/react";
|
|
2992
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
2927
2993
|
var icons = {
|
|
2928
|
-
"select-one":
|
|
2994
|
+
"select-one": RadioButton2,
|
|
2929
2995
|
"select-multiple": CheckSquare,
|
|
2930
2996
|
ranking: ListNumbers,
|
|
2931
2997
|
upload: FileArrowUp,
|
|
@@ -2938,25 +3004,25 @@ var icons = {
|
|
|
2938
3004
|
};
|
|
2939
3005
|
function QuestionTypeIcon({ type, size = 22.5, className, ...props }) {
|
|
2940
3006
|
const Icon = icons[type];
|
|
2941
|
-
return /* @__PURE__ */
|
|
3007
|
+
return /* @__PURE__ */ jsx43(Icon, { size, weight: "duotone", "aria-hidden": true, className: className ?? "text-accent-foreground", ...props });
|
|
2942
3008
|
}
|
|
2943
3009
|
|
|
2944
3010
|
// src/components/Question Types/QuestionHeader.tsx
|
|
2945
|
-
import { jsx as
|
|
3011
|
+
import { jsx as jsx44, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
2946
3012
|
var eyebrow = "text-ui-caption uppercase text-secondary-muted-foreground";
|
|
2947
|
-
var QuestionHeader =
|
|
3013
|
+
var QuestionHeader = React43.forwardRef(
|
|
2948
3014
|
({ className, number, title, required, error, onDismissError, editor, onTitleChange, titlePlaceholder = "Click to write the question text", titlePlaceholderTone, titleMinLength, titleRecommendedMax, titleRecommendedNote, actions, meta, maxLength = 2e3, active, showCounter = true, dragHandleProps, showDragHandle = true, questionType, titleMarks, onTitleMarkApply, onTitleMarkDismiss, ...props }, ref) => {
|
|
2949
|
-
const [draft, setDraft] =
|
|
3015
|
+
const [draft, setDraft] = React43.useState(null);
|
|
2950
3016
|
const label = String(number).padStart(2, "0");
|
|
2951
3017
|
const showError = error !== void 0 && error !== false;
|
|
2952
3018
|
if (editor) {
|
|
2953
3019
|
const text = typeof title === "string" ? title : "";
|
|
2954
3020
|
const count = (draft ?? text).length;
|
|
2955
3021
|
const long = titleRecommendedMax !== void 0 && count > titleRecommendedMax;
|
|
2956
|
-
return /* @__PURE__ */
|
|
2957
|
-
/* @__PURE__ */
|
|
2958
|
-
/* @__PURE__ */
|
|
2959
|
-
/* @__PURE__ */
|
|
3022
|
+
return /* @__PURE__ */ jsxs31("div", { ref, className: cn("group/header flex w-full flex-col gap-2", className), ...props, children: [
|
|
3023
|
+
/* @__PURE__ */ jsxs31("div", { className: "flex items-center justify-between", children: [
|
|
3024
|
+
/* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-2", children: [
|
|
3025
|
+
/* @__PURE__ */ jsxs31(
|
|
2960
3026
|
"span",
|
|
2961
3027
|
{
|
|
2962
3028
|
"aria-label": dragHandleProps ? `Reorder question ${number}` : void 0,
|
|
@@ -2972,7 +3038,7 @@ var QuestionHeader = React42.forwardRef(
|
|
|
2972
3038
|
dragHandleProps?.className
|
|
2973
3039
|
),
|
|
2974
3040
|
children: [
|
|
2975
|
-
questionType && /* @__PURE__ */
|
|
3041
|
+
questionType && /* @__PURE__ */ jsx44(
|
|
2976
3042
|
QuestionTypeIcon,
|
|
2977
3043
|
{
|
|
2978
3044
|
type: questionType,
|
|
@@ -2980,7 +3046,7 @@ var QuestionHeader = React42.forwardRef(
|
|
|
2980
3046
|
className: cn("shrink-0", showDragHandle && "group-hover/editor:hidden group-data-[hovered]/editor:hidden group-hover/handle:hidden group-focus-visible/handle:hidden")
|
|
2981
3047
|
}
|
|
2982
3048
|
),
|
|
2983
|
-
showDragHandle && /* @__PURE__ */
|
|
3049
|
+
showDragHandle && /* @__PURE__ */ jsx44(
|
|
2984
3050
|
DotsSixVertical,
|
|
2985
3051
|
{
|
|
2986
3052
|
size: 16,
|
|
@@ -2995,13 +3061,13 @@ var QuestionHeader = React42.forwardRef(
|
|
|
2995
3061
|
),
|
|
2996
3062
|
meta
|
|
2997
3063
|
] }),
|
|
2998
|
-
actions && /* @__PURE__ */
|
|
3064
|
+
actions && /* @__PURE__ */ jsx44("div", { className: cn(
|
|
2999
3065
|
"flex items-center gap-2 opacity-0 transition-opacity group-focus-within/header:opacity-100 group-hover/header:opacity-100",
|
|
3000
3066
|
// Inside a QuestionEditorCard, hovering or focusing anywhere on the card reveals them too.
|
|
3001
3067
|
"group-focus-within/editor:opacity-100 group-hover/editor:opacity-100 group-data-[hovered]/editor:opacity-100"
|
|
3002
3068
|
), children: actions })
|
|
3003
3069
|
] }),
|
|
3004
|
-
/* @__PURE__ */
|
|
3070
|
+
/* @__PURE__ */ jsx44(
|
|
3005
3071
|
InlineEdit,
|
|
3006
3072
|
{
|
|
3007
3073
|
variant: "question",
|
|
@@ -3026,8 +3092,8 @@ var QuestionHeader = React42.forwardRef(
|
|
|
3026
3092
|
textClassName: long ? "text-body-base" : "text-heading-h4"
|
|
3027
3093
|
}
|
|
3028
3094
|
),
|
|
3029
|
-
long && titleRecommendedNote != null && /* @__PURE__ */
|
|
3030
|
-
showCounter && titleMinLength === void 0 && maxLength !== void 0 && count > maxLength && /* @__PURE__ */
|
|
3095
|
+
long && titleRecommendedNote != null && /* @__PURE__ */ jsx44("p", { className: "text-ui-caption text-secondary-muted-foreground", children: titleRecommendedNote }),
|
|
3096
|
+
showCounter && titleMinLength === void 0 && maxLength !== void 0 && count > maxLength && /* @__PURE__ */ jsxs31("p", { className: "text-ui-caption text-secondary-muted-foreground", children: [
|
|
3031
3097
|
count,
|
|
3032
3098
|
"/",
|
|
3033
3099
|
maxLength,
|
|
@@ -3035,16 +3101,16 @@ var QuestionHeader = React42.forwardRef(
|
|
|
3035
3101
|
] })
|
|
3036
3102
|
] });
|
|
3037
3103
|
}
|
|
3038
|
-
return /* @__PURE__ */
|
|
3039
|
-
showError && /* @__PURE__ */
|
|
3040
|
-
/* @__PURE__ */
|
|
3104
|
+
return /* @__PURE__ */ jsxs31("div", { ref, className: cn("flex w-full flex-col gap-2", className), ...props, children: [
|
|
3105
|
+
showError && /* @__PURE__ */ jsx44(ToastInline, { variant: "destructive", onClose: onDismissError, className: "min-h-10", children: /* @__PURE__ */ jsx44("span", { className: "text-ui-label text-destructive", children: error === true ? "This question is mandatory." : error }) }),
|
|
3106
|
+
/* @__PURE__ */ jsxs31("p", { className: eyebrow, children: [
|
|
3041
3107
|
"Question ",
|
|
3042
3108
|
label
|
|
3043
3109
|
] }),
|
|
3044
|
-
/* @__PURE__ */
|
|
3110
|
+
/* @__PURE__ */ jsxs31("h3", { className: "text-heading-h4 text-surface-foreground", children: [
|
|
3045
3111
|
title,
|
|
3046
|
-
required && /* @__PURE__ */
|
|
3047
|
-
required && /* @__PURE__ */
|
|
3112
|
+
required && /* @__PURE__ */ jsx44("span", { "aria-hidden": "true", className: "text-destructive", children: "*" }),
|
|
3113
|
+
required && /* @__PURE__ */ jsx44("span", { className: "sr-only", children: " (required)" })
|
|
3048
3114
|
] })
|
|
3049
3115
|
] });
|
|
3050
3116
|
}
|
|
@@ -3052,8 +3118,8 @@ var QuestionHeader = React42.forwardRef(
|
|
|
3052
3118
|
QuestionHeader.displayName = "QuestionHeader";
|
|
3053
3119
|
|
|
3054
3120
|
// src/components/Question Types/QuestionEditorCard.tsx
|
|
3055
|
-
import { Fragment as
|
|
3056
|
-
var QuestionEditorCard =
|
|
3121
|
+
import { Fragment as Fragment11, jsx as jsx45, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3122
|
+
var QuestionEditorCard = React44.forwardRef(
|
|
3057
3123
|
({
|
|
3058
3124
|
className,
|
|
3059
3125
|
number,
|
|
@@ -3088,7 +3154,7 @@ var QuestionEditorCard = React43.forwardRef(
|
|
|
3088
3154
|
...props
|
|
3089
3155
|
}, ref) => {
|
|
3090
3156
|
const footer = active && (countLabel != null || onAdd || onPaste);
|
|
3091
|
-
return /* @__PURE__ */
|
|
3157
|
+
return /* @__PURE__ */ jsxs32(
|
|
3092
3158
|
"div",
|
|
3093
3159
|
{
|
|
3094
3160
|
ref,
|
|
@@ -3100,7 +3166,7 @@ var QuestionEditorCard = React43.forwardRef(
|
|
|
3100
3166
|
props.onMouseDown?.(event);
|
|
3101
3167
|
},
|
|
3102
3168
|
children: [
|
|
3103
|
-
/* @__PURE__ */
|
|
3169
|
+
/* @__PURE__ */ jsxs32(
|
|
3104
3170
|
"div",
|
|
3105
3171
|
{
|
|
3106
3172
|
className: cn(
|
|
@@ -3108,9 +3174,9 @@ var QuestionEditorCard = React43.forwardRef(
|
|
|
3108
3174
|
active ? "border-accent" : "border-border"
|
|
3109
3175
|
),
|
|
3110
3176
|
children: [
|
|
3111
|
-
/* @__PURE__ */
|
|
3112
|
-
/* @__PURE__ */
|
|
3113
|
-
/* @__PURE__ */
|
|
3177
|
+
/* @__PURE__ */ jsxs32("div", { className: cn("flex flex-col p-6", footer ? "gap-5" : "gap-4"), children: [
|
|
3178
|
+
/* @__PURE__ */ jsxs32("div", { className: "flex flex-col gap-4", children: [
|
|
3179
|
+
/* @__PURE__ */ jsx45(
|
|
3114
3180
|
QuestionHeader,
|
|
3115
3181
|
{
|
|
3116
3182
|
editor: true,
|
|
@@ -3132,8 +3198,8 @@ var QuestionEditorCard = React43.forwardRef(
|
|
|
3132
3198
|
onTitleMarkDismiss,
|
|
3133
3199
|
meta,
|
|
3134
3200
|
maxLength,
|
|
3135
|
-
actions: actions ?? /* @__PURE__ */
|
|
3136
|
-
/* @__PURE__ */
|
|
3201
|
+
actions: actions ?? /* @__PURE__ */ jsxs32(Fragment11, { children: [
|
|
3202
|
+
/* @__PURE__ */ jsx45(
|
|
3137
3203
|
Button,
|
|
3138
3204
|
{
|
|
3139
3205
|
type: "button",
|
|
@@ -3141,10 +3207,10 @@ var QuestionEditorCard = React43.forwardRef(
|
|
|
3141
3207
|
size: "icon-sm",
|
|
3142
3208
|
"aria-label": "Duplicate question",
|
|
3143
3209
|
onClick: onDuplicate,
|
|
3144
|
-
children: /* @__PURE__ */
|
|
3210
|
+
children: /* @__PURE__ */ jsx45(Copy, { size: 16, "aria-hidden": true })
|
|
3145
3211
|
}
|
|
3146
3212
|
),
|
|
3147
|
-
/* @__PURE__ */
|
|
3213
|
+
/* @__PURE__ */ jsx45(
|
|
3148
3214
|
Button,
|
|
3149
3215
|
{
|
|
3150
3216
|
type: "button",
|
|
@@ -3152,10 +3218,10 @@ var QuestionEditorCard = React43.forwardRef(
|
|
|
3152
3218
|
size: "icon-sm",
|
|
3153
3219
|
"aria-label": "Delete question",
|
|
3154
3220
|
onClick: onDelete,
|
|
3155
|
-
children: /* @__PURE__ */
|
|
3221
|
+
children: /* @__PURE__ */ jsx45(Trash4, { size: 16, "aria-hidden": true })
|
|
3156
3222
|
}
|
|
3157
3223
|
),
|
|
3158
|
-
/* @__PURE__ */
|
|
3224
|
+
/* @__PURE__ */ jsx45(
|
|
3159
3225
|
Button,
|
|
3160
3226
|
{
|
|
3161
3227
|
type: "button",
|
|
@@ -3163,7 +3229,7 @@ var QuestionEditorCard = React43.forwardRef(
|
|
|
3163
3229
|
size: "icon-sm",
|
|
3164
3230
|
"aria-label": "Preview question",
|
|
3165
3231
|
onClick: onPreview,
|
|
3166
|
-
children: /* @__PURE__ */
|
|
3232
|
+
children: /* @__PURE__ */ jsx45(Eye, { size: 16, "aria-hidden": true })
|
|
3167
3233
|
}
|
|
3168
3234
|
)
|
|
3169
3235
|
] })
|
|
@@ -3171,18 +3237,18 @@ var QuestionEditorCard = React43.forwardRef(
|
|
|
3171
3237
|
),
|
|
3172
3238
|
children
|
|
3173
3239
|
] }),
|
|
3174
|
-
error && /* @__PURE__ */
|
|
3175
|
-
/* @__PURE__ */
|
|
3240
|
+
error && /* @__PURE__ */ jsxs32("p", { className: "flex items-center gap-1 text-ui-caption text-destructive-foreground", children: [
|
|
3241
|
+
/* @__PURE__ */ jsx45(Warning2, { size: 16, "aria-hidden": true, className: "shrink-0" }),
|
|
3176
3242
|
error
|
|
3177
3243
|
] }),
|
|
3178
|
-
footer && /* @__PURE__ */
|
|
3179
|
-
/* @__PURE__ */
|
|
3180
|
-
/* @__PURE__ */
|
|
3181
|
-
onAdd && /* @__PURE__ */
|
|
3182
|
-
/* @__PURE__ */
|
|
3244
|
+
footer && /* @__PURE__ */ jsxs32("div", { className: "flex items-center justify-between", children: [
|
|
3245
|
+
/* @__PURE__ */ jsx45("p", { className: "text-ui-caption text-secondary-muted-foreground", children: countLabel }),
|
|
3246
|
+
/* @__PURE__ */ jsxs32("div", { className: "flex items-center gap-2", children: [
|
|
3247
|
+
onAdd && /* @__PURE__ */ jsxs32(Button, { type: "button", variant: "outline", onClick: onAdd, children: [
|
|
3248
|
+
/* @__PURE__ */ jsx45(Plus3, { size: 16, "aria-hidden": true }),
|
|
3183
3249
|
"Add choice"
|
|
3184
3250
|
] }),
|
|
3185
|
-
onPaste && /* @__PURE__ */
|
|
3251
|
+
onPaste && /* @__PURE__ */ jsx45(
|
|
3186
3252
|
Button,
|
|
3187
3253
|
{
|
|
3188
3254
|
type: "button",
|
|
@@ -3190,17 +3256,17 @@ var QuestionEditorCard = React43.forwardRef(
|
|
|
3190
3256
|
size: "icon",
|
|
3191
3257
|
"aria-label": "Paste choices",
|
|
3192
3258
|
onClick: onPaste,
|
|
3193
|
-
children: /* @__PURE__ */
|
|
3259
|
+
children: /* @__PURE__ */ jsx45(Clipboard, { size: 16, "aria-hidden": true })
|
|
3194
3260
|
}
|
|
3195
3261
|
)
|
|
3196
3262
|
] })
|
|
3197
3263
|
] })
|
|
3198
3264
|
] }),
|
|
3199
|
-
note && /* @__PURE__ */
|
|
3265
|
+
note && /* @__PURE__ */ jsx45("div", { className: "border-t border-border px-2 py-2 text-body-small text-surface-foreground", children: note })
|
|
3200
3266
|
]
|
|
3201
3267
|
}
|
|
3202
3268
|
),
|
|
3203
|
-
onAskAi && /* @__PURE__ */
|
|
3269
|
+
onAskAi && /* @__PURE__ */ jsx45(
|
|
3204
3270
|
Button,
|
|
3205
3271
|
{
|
|
3206
3272
|
type: "button",
|
|
@@ -3209,7 +3275,7 @@ var QuestionEditorCard = React43.forwardRef(
|
|
|
3209
3275
|
"aria-label": "Ask AI",
|
|
3210
3276
|
onClick: onAskAi,
|
|
3211
3277
|
className: "shrink-0 opacity-0 transition-opacity group-hover/editor:opacity-100 group-focus-within/editor:opacity-100 group-data-[hovered]/editor:opacity-100 focus-visible:opacity-100",
|
|
3212
|
-
children: /* @__PURE__ */
|
|
3278
|
+
children: /* @__PURE__ */ jsx45(Sparkle2, { size: 16, "aria-hidden": true })
|
|
3213
3279
|
}
|
|
3214
3280
|
)
|
|
3215
3281
|
]
|
|
@@ -3220,15 +3286,15 @@ var QuestionEditorCard = React43.forwardRef(
|
|
|
3220
3286
|
QuestionEditorCard.displayName = "QuestionEditorCard";
|
|
3221
3287
|
|
|
3222
3288
|
// src/components/Question Types/QuestionNavItem.tsx
|
|
3223
|
-
import * as
|
|
3224
|
-
import { DotsSixVertical as DotsSixVertical2, Warning as Warning3, WarningCircle as
|
|
3289
|
+
import * as React45 from "react";
|
|
3290
|
+
import { DotsSixVertical as DotsSixVertical2, Warning as Warning3, WarningCircle as WarningCircle5 } from "@phosphor-icons/react";
|
|
3225
3291
|
import { Slot as Slot3 } from "radix-ui";
|
|
3226
|
-
import { jsx as
|
|
3227
|
-
var QuestionNavItem =
|
|
3292
|
+
import { jsx as jsx46, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
3293
|
+
var QuestionNavItem = React45.forwardRef(
|
|
3228
3294
|
({ className, questionType = "select-one", selected, error, warning, asChild, showDragHandle = true, hovered, children, ...props }, ref) => {
|
|
3229
3295
|
const Comp = asChild ? Slot3.Root : "button";
|
|
3230
3296
|
const warn = !error && !!warning;
|
|
3231
|
-
return /* @__PURE__ */
|
|
3297
|
+
return /* @__PURE__ */ jsxs33(
|
|
3232
3298
|
Comp,
|
|
3233
3299
|
{
|
|
3234
3300
|
ref,
|
|
@@ -3247,9 +3313,9 @@ var QuestionNavItem = React44.forwardRef(
|
|
|
3247
3313
|
),
|
|
3248
3314
|
...props,
|
|
3249
3315
|
children: [
|
|
3250
|
-
/* @__PURE__ */
|
|
3251
|
-
showDragHandle && /* @__PURE__ */
|
|
3252
|
-
/* @__PURE__ */
|
|
3316
|
+
/* @__PURE__ */ jsxs33("span", { "aria-hidden": "true", className: "relative flex size-4 shrink-0 items-center justify-center", children: [
|
|
3317
|
+
showDragHandle && /* @__PURE__ */ jsx46(DotsSixVertical2, { size: 16, className: "hidden group-hover/nav:block group-data-[hovered]/nav:block" }),
|
|
3318
|
+
/* @__PURE__ */ jsx46("span", { className: showDragHandle ? "group-hover/nav:hidden group-data-[hovered]/nav:hidden" : void 0, children: error ? /* @__PURE__ */ jsx46(WarningCircle5, { size: 16, className: "text-destructive-foreground" }) : warn ? /* @__PURE__ */ jsx46(Warning3, { size: 16, className: "text-warning-foreground" }) : /* @__PURE__ */ jsx46(
|
|
3253
3319
|
QuestionTypeIcon,
|
|
3254
3320
|
{
|
|
3255
3321
|
type: questionType,
|
|
@@ -3258,9 +3324,9 @@ var QuestionNavItem = React44.forwardRef(
|
|
|
3258
3324
|
}
|
|
3259
3325
|
) })
|
|
3260
3326
|
] }),
|
|
3261
|
-
/* @__PURE__ */
|
|
3262
|
-
error && /* @__PURE__ */
|
|
3263
|
-
warn && /* @__PURE__ */
|
|
3327
|
+
/* @__PURE__ */ jsx46("span", { className: "min-w-0 flex-1 truncate", children }),
|
|
3328
|
+
error && /* @__PURE__ */ jsx46("span", { className: "sr-only", children: ", has errors" }),
|
|
3329
|
+
warn && /* @__PURE__ */ jsx46("span", { className: "sr-only", children: ", has warnings" })
|
|
3264
3330
|
]
|
|
3265
3331
|
}
|
|
3266
3332
|
);
|
|
@@ -3269,14 +3335,14 @@ var QuestionNavItem = React44.forwardRef(
|
|
|
3269
3335
|
QuestionNavItem.displayName = "QuestionNavItem";
|
|
3270
3336
|
|
|
3271
3337
|
// src/components/Question Types/QuestionOption.tsx
|
|
3272
|
-
import * as
|
|
3273
|
-
import { Check as Check4, DotsSixVertical as DotsSixVertical3, Plus as Plus4, Trash as Trash5, WarningCircle as
|
|
3274
|
-
import { Fragment as
|
|
3338
|
+
import * as React46 from "react";
|
|
3339
|
+
import { Check as Check4, DotsSixVertical as DotsSixVertical3, Plus as Plus4, Trash as Trash5, WarningCircle as WarningCircle6 } from "@phosphor-icons/react";
|
|
3340
|
+
import { Fragment as Fragment12, jsx as jsx47, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
3275
3341
|
var optionClasses = "flex w-full max-w-150 cursor-pointer items-center gap-2 rounded-md border border-border bg-surface px-4 py-2 text-body-base text-surface-foreground transition-colors hover:bg-accent-soft hover:shadow-md has-[[data-state=checked]]:border-accent-foreground has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-50";
|
|
3276
3342
|
function QuestionOption(props) {
|
|
3277
|
-
const id =
|
|
3278
|
-
return /* @__PURE__ */
|
|
3279
|
-
props.kind === "checkbox" ? /* @__PURE__ */
|
|
3343
|
+
const id = React46.useId();
|
|
3344
|
+
return /* @__PURE__ */ jsxs34("label", { htmlFor: id, className: cn(optionClasses, props.className), children: [
|
|
3345
|
+
props.kind === "checkbox" ? /* @__PURE__ */ jsx47(
|
|
3280
3346
|
Checkbox,
|
|
3281
3347
|
{
|
|
3282
3348
|
id,
|
|
@@ -3285,16 +3351,16 @@ function QuestionOption(props) {
|
|
|
3285
3351
|
onCheckedChange: (next) => props.onCheckedChange?.(next === true),
|
|
3286
3352
|
disabled: props.disabled
|
|
3287
3353
|
}
|
|
3288
|
-
) : /* @__PURE__ */
|
|
3289
|
-
/* @__PURE__ */
|
|
3354
|
+
) : /* @__PURE__ */ jsx47(RadioGroupItem, { id, value: props.value, disabled: props.disabled }),
|
|
3355
|
+
/* @__PURE__ */ jsx47("span", { className: "min-w-0 flex-1", children: props.label })
|
|
3290
3356
|
] });
|
|
3291
3357
|
}
|
|
3292
|
-
var QuestionOtherOption =
|
|
3358
|
+
var QuestionOtherOption = React46.forwardRef(
|
|
3293
3359
|
({ className, onSubmit, confirmLabel = "Confirm answer", placeholder = "Type your answer", ...props }, ref) => {
|
|
3294
|
-
const inner =
|
|
3295
|
-
|
|
3360
|
+
const inner = React46.useRef(null);
|
|
3361
|
+
React46.useImperativeHandle(ref, () => inner.current);
|
|
3296
3362
|
const submit = () => onSubmit?.(inner.current?.value ?? "");
|
|
3297
|
-
return /* @__PURE__ */
|
|
3363
|
+
return /* @__PURE__ */ jsxs34(
|
|
3298
3364
|
"div",
|
|
3299
3365
|
{
|
|
3300
3366
|
className: cn(
|
|
@@ -3302,7 +3368,7 @@ var QuestionOtherOption = React45.forwardRef(
|
|
|
3302
3368
|
className
|
|
3303
3369
|
),
|
|
3304
3370
|
children: [
|
|
3305
|
-
/* @__PURE__ */
|
|
3371
|
+
/* @__PURE__ */ jsx47(
|
|
3306
3372
|
"input",
|
|
3307
3373
|
{
|
|
3308
3374
|
ref: inner,
|
|
@@ -3318,7 +3384,7 @@ var QuestionOtherOption = React45.forwardRef(
|
|
|
3318
3384
|
...props
|
|
3319
3385
|
}
|
|
3320
3386
|
),
|
|
3321
|
-
/* @__PURE__ */
|
|
3387
|
+
/* @__PURE__ */ jsx47(Button, { type: "button", variant: "subtle", size: "icon-sm", "aria-label": confirmLabel, onClick: submit, children: /* @__PURE__ */ jsx47(Check4, { size: 16, "aria-hidden": true }) })
|
|
3322
3388
|
]
|
|
3323
3389
|
}
|
|
3324
3390
|
);
|
|
@@ -3333,16 +3399,16 @@ function limitsText2(min, max) {
|
|
|
3333
3399
|
function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTone = "muted", minLength, maxLength, onRemove, onAdd, removeDisabled, addDisabled, className, kind, rank, dragHandleProps, lifted, locked, marks, onMarkApply, onMarkDismiss }) {
|
|
3334
3400
|
const reveal = kind !== void 0;
|
|
3335
3401
|
const guarded = minLength !== void 0 || maxLength !== void 0;
|
|
3336
|
-
const [draft, setDraft] =
|
|
3337
|
-
const [error, setError] =
|
|
3338
|
-
const helperId =
|
|
3339
|
-
const [focused, setFocused] =
|
|
3402
|
+
const [draft, setDraft] = React46.useState(null);
|
|
3403
|
+
const [error, setError] = React46.useState(null);
|
|
3404
|
+
const helperId = React46.useId();
|
|
3405
|
+
const [focused, setFocused] = React46.useState(false);
|
|
3340
3406
|
const showMarks = !!marks?.length && !focused && draft === null;
|
|
3341
|
-
const fieldRef =
|
|
3342
|
-
const [editMarks, setEditMarks] =
|
|
3343
|
-
const [scroll, setScroll] =
|
|
3407
|
+
const fieldRef = React46.useRef(null);
|
|
3408
|
+
const [editMarks, setEditMarks] = React46.useState([]);
|
|
3409
|
+
const [scroll, setScroll] = React46.useState(0);
|
|
3344
3410
|
const typed = guarded ? draft ?? label : label;
|
|
3345
|
-
const skipBlur =
|
|
3411
|
+
const skipBlur = React46.useRef(false);
|
|
3346
3412
|
const problemWith = (text) => minLength !== void 0 && text.trim().length < minLength ? `Enter at least ${minLength} ${minLength === 1 ? "character" : "characters"}.` : null;
|
|
3347
3413
|
const save = () => {
|
|
3348
3414
|
if (draft === null) return true;
|
|
@@ -3363,9 +3429,9 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
|
|
|
3363
3429
|
...dragHandleProps,
|
|
3364
3430
|
className: cn("cursor-grab touch-none select-none", dragHandleProps.className)
|
|
3365
3431
|
} : { "aria-hidden": true };
|
|
3366
|
-
const grip = dragHandleProps ? /* @__PURE__ */
|
|
3367
|
-
return /* @__PURE__ */
|
|
3368
|
-
/* @__PURE__ */
|
|
3432
|
+
const grip = dragHandleProps ? /* @__PURE__ */ jsx47("span", { ...gripProps, className: cn("shrink-0", gripProps.className), children: /* @__PURE__ */ jsx47(DotsSixVertical3, { size: 20, "aria-hidden": true, className: "text-surface-foreground" }) }) : /* @__PURE__ */ jsx47(DotsSixVertical3, { size: 20, "aria-hidden": true, className: "shrink-0 text-surface-foreground" });
|
|
3433
|
+
return /* @__PURE__ */ jsxs34("div", { className: cn("group/option flex w-full items-center gap-2", className), children: [
|
|
3434
|
+
/* @__PURE__ */ jsx47(
|
|
3369
3435
|
"div",
|
|
3370
3436
|
{
|
|
3371
3437
|
className: cn(
|
|
@@ -3375,10 +3441,10 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
|
|
|
3375
3441
|
cn("border-border group-hover/option:shadow-md group-focus-within/option:shadow-md", lifted && "shadow-md")
|
|
3376
3442
|
) : "border-border hover:border-input-muted hover:shadow-md"
|
|
3377
3443
|
),
|
|
3378
|
-
children: /* @__PURE__ */
|
|
3379
|
-
(kind !== void 0 || !locked) && /* @__PURE__ */
|
|
3444
|
+
children: /* @__PURE__ */ jsxs34("div", { className: "flex min-w-0 items-start gap-2", children: [
|
|
3445
|
+
(kind !== void 0 || !locked) && /* @__PURE__ */ jsx47("div", { className: "flex h-7 shrink-0 items-center gap-2", children: kind === "rank" ? /* @__PURE__ */ jsxs34(Fragment12, { children: [
|
|
3380
3446
|
!locked && grip,
|
|
3381
|
-
/* @__PURE__ */
|
|
3447
|
+
/* @__PURE__ */ jsx47(
|
|
3382
3448
|
"span",
|
|
3383
3449
|
{
|
|
3384
3450
|
"aria-hidden": "true",
|
|
@@ -3386,8 +3452,8 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
|
|
|
3386
3452
|
children: rank
|
|
3387
3453
|
}
|
|
3388
3454
|
)
|
|
3389
|
-
] }) : reveal && locked ? /* @__PURE__ */
|
|
3390
|
-
/* @__PURE__ */
|
|
3455
|
+
] }) : reveal && locked ? /* @__PURE__ */ jsx47("span", { "aria-hidden": "true", className: "relative flex size-5 shrink-0 items-center justify-center", children: /* @__PURE__ */ jsx47("span", { className: cn("inline-flex size-4 border-2 border-input bg-surface", kind === "radio" ? "rounded-full" : "rounded-xxs") }) }) : reveal ? /* @__PURE__ */ jsxs34("span", { ...gripProps, className: cn("relative flex size-5 shrink-0 items-center justify-center", gripProps.className), children: [
|
|
3456
|
+
/* @__PURE__ */ jsx47(
|
|
3391
3457
|
"span",
|
|
3392
3458
|
{
|
|
3393
3459
|
"aria-hidden": "true",
|
|
@@ -3398,7 +3464,7 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
|
|
|
3398
3464
|
)
|
|
3399
3465
|
}
|
|
3400
3466
|
),
|
|
3401
|
-
/* @__PURE__ */
|
|
3467
|
+
/* @__PURE__ */ jsx47(
|
|
3402
3468
|
DotsSixVertical3,
|
|
3403
3469
|
{
|
|
3404
3470
|
size: 20,
|
|
@@ -3410,10 +3476,10 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
|
|
|
3410
3476
|
}
|
|
3411
3477
|
)
|
|
3412
3478
|
] }) : locked ? null : grip }),
|
|
3413
|
-
/* @__PURE__ */
|
|
3414
|
-
/* @__PURE__ */
|
|
3415
|
-
focused && editMarks.length > 0 && /* @__PURE__ */
|
|
3416
|
-
/* @__PURE__ */
|
|
3479
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
3480
|
+
/* @__PURE__ */ jsxs34("div", { className: "relative min-w-0", children: [
|
|
3481
|
+
focused && editMarks.length > 0 && /* @__PURE__ */ jsx47(DraftMarks, { layer: "behind", singleLine: true, text: typed, marks: editMarks, scrollLeft: scroll, className: "flex items-center whitespace-pre text-body-base" }),
|
|
3482
|
+
/* @__PURE__ */ jsx47(
|
|
3417
3483
|
"input",
|
|
3418
3484
|
{
|
|
3419
3485
|
ref: fieldRef,
|
|
@@ -3468,24 +3534,24 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
|
|
|
3468
3534
|
)
|
|
3469
3535
|
}
|
|
3470
3536
|
),
|
|
3471
|
-
focused && editMarks.length > 0 && /* @__PURE__ */
|
|
3472
|
-
showMarks && /* @__PURE__ */
|
|
3473
|
-
(piece, i) => piece.mark ? /* @__PURE__ */
|
|
3537
|
+
focused && editMarks.length > 0 && /* @__PURE__ */ jsx47(DraftMarks, { layer: "over", singleLine: true, text: typed, marks: editMarks, scrollLeft: scroll, className: "flex items-center whitespace-pre text-body-base" }),
|
|
3538
|
+
showMarks && /* @__PURE__ */ jsx47("div", { "aria-hidden": true, className: "pointer-events-none absolute inset-0 flex items-center overflow-hidden whitespace-pre text-body-base text-surface-foreground [&_[data-mark]]:pointer-events-auto", children: splitMarks(label, marks).map(
|
|
3539
|
+
(piece, i) => piece.mark ? /* @__PURE__ */ jsx47(MarkedText, { mark: piece.mark, text: piece.text, onApply: onMarkApply, onDismiss: onMarkDismiss }, `${piece.mark.start}:${piece.text}`) : /* @__PURE__ */ jsx47("span", { children: piece.text }, i)
|
|
3474
3540
|
) })
|
|
3475
3541
|
] }),
|
|
3476
|
-
guarded && draft !== null && (error || lengthOutOfRange(draft, minLength, maxLength)) && /* @__PURE__ */
|
|
3542
|
+
guarded && draft !== null && (error || lengthOutOfRange(draft, minLength, maxLength)) && /* @__PURE__ */ jsxs34(
|
|
3477
3543
|
"p",
|
|
3478
3544
|
{
|
|
3479
3545
|
id: helperId,
|
|
3480
3546
|
role: error ? "alert" : void 0,
|
|
3481
3547
|
className: cn("flex items-start justify-between gap-2 text-ui-caption", error ? "text-destructive" : "text-secondary-muted-foreground"),
|
|
3482
3548
|
children: [
|
|
3483
|
-
/* @__PURE__ */
|
|
3484
|
-
error && /* @__PURE__ */
|
|
3549
|
+
/* @__PURE__ */ jsxs34("span", { className: "flex items-start gap-2", children: [
|
|
3550
|
+
error && /* @__PURE__ */ jsx47(WarningCircle6, { size: 16, "aria-hidden": true, className: "shrink-0" }),
|
|
3485
3551
|
limitsText2(minLength, maxLength),
|
|
3486
|
-
error && /* @__PURE__ */
|
|
3552
|
+
error && /* @__PURE__ */ jsx47("span", { className: "sr-only", children: error })
|
|
3487
3553
|
] }),
|
|
3488
|
-
/* @__PURE__ */
|
|
3554
|
+
/* @__PURE__ */ jsxs34("span", { "aria-hidden": true, className: "shrink-0 tabular-nums", children: [
|
|
3489
3555
|
draft.length,
|
|
3490
3556
|
maxLength !== void 0 && `/${maxLength}`
|
|
3491
3557
|
] })
|
|
@@ -3496,7 +3562,7 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
|
|
|
3496
3562
|
] })
|
|
3497
3563
|
}
|
|
3498
3564
|
),
|
|
3499
|
-
!locked && /* @__PURE__ */
|
|
3565
|
+
!locked && /* @__PURE__ */ jsxs34(
|
|
3500
3566
|
"div",
|
|
3501
3567
|
{
|
|
3502
3568
|
className: cn(
|
|
@@ -3504,8 +3570,8 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
|
|
|
3504
3570
|
reveal && "opacity-0 transition-opacity group-hover/option:opacity-100 group-focus-within/option:opacity-100"
|
|
3505
3571
|
),
|
|
3506
3572
|
children: [
|
|
3507
|
-
/* @__PURE__ */
|
|
3508
|
-
/* @__PURE__ */
|
|
3573
|
+
/* @__PURE__ */ jsx47(Button, { type: "button", variant: "destructive", size: "icon-sm", "aria-label": "Remove option", disabled: removeDisabled, onClick: onRemove, children: /* @__PURE__ */ jsx47(Trash5, { size: 16, "aria-hidden": true }) }),
|
|
3574
|
+
/* @__PURE__ */ jsx47(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": "Add option", disabled: addDisabled, onClick: onAdd, children: /* @__PURE__ */ jsx47(Plus4, { size: 16, "aria-hidden": true }) })
|
|
3509
3575
|
]
|
|
3510
3576
|
}
|
|
3511
3577
|
)
|
|
@@ -3513,9 +3579,9 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
|
|
|
3513
3579
|
}
|
|
3514
3580
|
|
|
3515
3581
|
// src/components/Question Types/RankList.tsx
|
|
3516
|
-
import * as
|
|
3582
|
+
import * as React47 from "react";
|
|
3517
3583
|
import { DotsSixVertical as DotsSixVertical4 } from "@phosphor-icons/react";
|
|
3518
|
-
import { Fragment as
|
|
3584
|
+
import { Fragment as Fragment13, jsx as jsx48, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
3519
3585
|
function move(list, from, to) {
|
|
3520
3586
|
if (from === to || to < 0 || to >= list.length) return list;
|
|
3521
3587
|
const next = list.slice();
|
|
@@ -3523,13 +3589,13 @@ function move(list, from, to) {
|
|
|
3523
3589
|
next.splice(to, 0, item);
|
|
3524
3590
|
return next;
|
|
3525
3591
|
}
|
|
3526
|
-
var RankList =
|
|
3592
|
+
var RankList = React47.forwardRef(
|
|
3527
3593
|
({ className, items, onItemsChange, ...props }, ref) => {
|
|
3528
|
-
const [dragIndex, setDragIndex] =
|
|
3529
|
-
const [announcement, setAnnouncement] =
|
|
3530
|
-
const handles =
|
|
3531
|
-
const refocus =
|
|
3532
|
-
|
|
3594
|
+
const [dragIndex, setDragIndex] = React47.useState(null);
|
|
3595
|
+
const [announcement, setAnnouncement] = React47.useState("");
|
|
3596
|
+
const handles = React47.useRef(/* @__PURE__ */ new Map());
|
|
3597
|
+
const refocus = React47.useRef(null);
|
|
3598
|
+
React47.useEffect(() => {
|
|
3533
3599
|
if (refocus.current) {
|
|
3534
3600
|
handles.current.get(refocus.current)?.focus();
|
|
3535
3601
|
refocus.current = null;
|
|
@@ -3542,8 +3608,8 @@ var RankList = React46.forwardRef(
|
|
|
3542
3608
|
setAnnouncement(`Moved to position ${to + 1} of ${items.length}`);
|
|
3543
3609
|
onItemsChange(next);
|
|
3544
3610
|
};
|
|
3545
|
-
return /* @__PURE__ */
|
|
3546
|
-
/* @__PURE__ */
|
|
3611
|
+
return /* @__PURE__ */ jsxs35(Fragment13, { children: [
|
|
3612
|
+
/* @__PURE__ */ jsx48("ol", { ref, className: cn("flex w-full max-w-150 flex-col gap-4", className), ...props, children: items.map((item, index) => /* @__PURE__ */ jsxs35(
|
|
3547
3613
|
"li",
|
|
3548
3614
|
{
|
|
3549
3615
|
draggable: true,
|
|
@@ -3560,7 +3626,7 @@ var RankList = React46.forwardRef(
|
|
|
3560
3626
|
dragIndex === index && "opacity-50"
|
|
3561
3627
|
),
|
|
3562
3628
|
children: [
|
|
3563
|
-
/* @__PURE__ */
|
|
3629
|
+
/* @__PURE__ */ jsx48(
|
|
3564
3630
|
"button",
|
|
3565
3631
|
{
|
|
3566
3632
|
type: "button",
|
|
@@ -3579,10 +3645,10 @@ var RankList = React46.forwardRef(
|
|
|
3579
3645
|
}
|
|
3580
3646
|
},
|
|
3581
3647
|
className: "inline-flex shrink-0 cursor-grab rounded-xs text-surface-foreground",
|
|
3582
|
-
children: /* @__PURE__ */
|
|
3648
|
+
children: /* @__PURE__ */ jsx48(DotsSixVertical4, { size: 16, "aria-hidden": true })
|
|
3583
3649
|
}
|
|
3584
3650
|
),
|
|
3585
|
-
/* @__PURE__ */
|
|
3651
|
+
/* @__PURE__ */ jsx48(
|
|
3586
3652
|
"span",
|
|
3587
3653
|
{
|
|
3588
3654
|
"aria-hidden": "true",
|
|
@@ -3590,27 +3656,27 @@ var RankList = React46.forwardRef(
|
|
|
3590
3656
|
children: index + 1
|
|
3591
3657
|
}
|
|
3592
3658
|
),
|
|
3593
|
-
/* @__PURE__ */
|
|
3659
|
+
/* @__PURE__ */ jsx48("span", { className: "min-w-0 flex-1", children: item.label })
|
|
3594
3660
|
]
|
|
3595
3661
|
},
|
|
3596
3662
|
item.id
|
|
3597
3663
|
)) }),
|
|
3598
|
-
/* @__PURE__ */
|
|
3664
|
+
/* @__PURE__ */ jsx48("span", { role: "status", "aria-live": "polite", className: "sr-only", children: announcement })
|
|
3599
3665
|
] });
|
|
3600
3666
|
}
|
|
3601
3667
|
);
|
|
3602
3668
|
RankList.displayName = "RankList";
|
|
3603
3669
|
|
|
3604
3670
|
// src/components/Question Types/RatingScale.tsx
|
|
3605
|
-
import * as
|
|
3671
|
+
import * as React48 from "react";
|
|
3606
3672
|
import { ToggleGroup as ToggleGroupPrimitive3 } from "radix-ui";
|
|
3607
|
-
import { jsx as
|
|
3608
|
-
var RatingScale =
|
|
3673
|
+
import { jsx as jsx49, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
3674
|
+
var RatingScale = React48.forwardRef(
|
|
3609
3675
|
({ className, max = 5, value, defaultValue, onValueChange, lowLabel, highLabel, ...props }, ref) => {
|
|
3610
|
-
const [internal, setInternal] =
|
|
3676
|
+
const [internal, setInternal] = React48.useState(defaultValue);
|
|
3611
3677
|
const current = value !== void 0 ? value : internal;
|
|
3612
|
-
return /* @__PURE__ */
|
|
3613
|
-
/* @__PURE__ */
|
|
3678
|
+
return /* @__PURE__ */ jsxs36("div", { className: cn("flex w-full max-w-150 flex-col gap-2", className), children: [
|
|
3679
|
+
/* @__PURE__ */ jsx49(
|
|
3614
3680
|
ToggleGroupPrimitive3.Root,
|
|
3615
3681
|
{
|
|
3616
3682
|
ref,
|
|
@@ -3623,7 +3689,7 @@ var RatingScale = React47.forwardRef(
|
|
|
3623
3689
|
},
|
|
3624
3690
|
className: "flex gap-2",
|
|
3625
3691
|
...props,
|
|
3626
|
-
children: Array.from({ length: max }, (_, i) => i + 1).map((n) => /* @__PURE__ */
|
|
3692
|
+
children: Array.from({ length: max }, (_, i) => i + 1).map((n) => /* @__PURE__ */ jsx49(
|
|
3627
3693
|
ToggleGroupPrimitive3.Item,
|
|
3628
3694
|
{
|
|
3629
3695
|
value: String(n),
|
|
@@ -3639,9 +3705,9 @@ var RatingScale = React47.forwardRef(
|
|
|
3639
3705
|
))
|
|
3640
3706
|
}
|
|
3641
3707
|
),
|
|
3642
|
-
(lowLabel != null || highLabel != null) && /* @__PURE__ */
|
|
3643
|
-
/* @__PURE__ */
|
|
3644
|
-
/* @__PURE__ */
|
|
3708
|
+
(lowLabel != null || highLabel != null) && /* @__PURE__ */ jsxs36("div", { className: "flex justify-between text-ui-caption text-secondary-muted-foreground", "aria-hidden": "true", children: [
|
|
3709
|
+
/* @__PURE__ */ jsx49("span", { children: lowLabel }),
|
|
3710
|
+
/* @__PURE__ */ jsx49("span", { children: highLabel })
|
|
3645
3711
|
] })
|
|
3646
3712
|
] });
|
|
3647
3713
|
}
|
|
@@ -3649,12 +3715,12 @@ var RatingScale = React47.forwardRef(
|
|
|
3649
3715
|
RatingScale.displayName = "RatingScale";
|
|
3650
3716
|
|
|
3651
3717
|
// src/components/Question Types/StimulusCard.tsx
|
|
3652
|
-
import * as
|
|
3718
|
+
import * as React49 from "react";
|
|
3653
3719
|
import { Image as ImageIcon2, ImageBroken, Trash as Trash6 } from "@phosphor-icons/react";
|
|
3654
|
-
import { jsx as
|
|
3720
|
+
import { jsx as jsx50, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
3655
3721
|
var MIN_THUMBNAIL = 92;
|
|
3656
3722
|
var MAX_THUMBNAIL = 240;
|
|
3657
|
-
var StimulusCard =
|
|
3723
|
+
var StimulusCard = React49.forwardRef(
|
|
3658
3724
|
({
|
|
3659
3725
|
className,
|
|
3660
3726
|
thumbnail,
|
|
@@ -3671,14 +3737,14 @@ var StimulusCard = React48.forwardRef(
|
|
|
3671
3737
|
removeLabel = "Remove stimulus",
|
|
3672
3738
|
...props
|
|
3673
3739
|
}, ref) => {
|
|
3674
|
-
const [failedSrc, setFailedSrc] =
|
|
3740
|
+
const [failedSrc, setFailedSrc] = React49.useState();
|
|
3675
3741
|
const error = status === "error" || thumbnail !== void 0 && failedSrc === thumbnail;
|
|
3676
3742
|
const showImage = thumbnail !== void 0 && !error;
|
|
3677
|
-
const [draft, setDraft] =
|
|
3743
|
+
const [draft, setDraft] = React49.useState(null);
|
|
3678
3744
|
const count = (draft ?? caption ?? "").length;
|
|
3679
|
-
const textRef =
|
|
3680
|
-
const [thumbnailSize, setThumbnailSize] =
|
|
3681
|
-
|
|
3745
|
+
const textRef = React49.useRef(null);
|
|
3746
|
+
const [thumbnailSize, setThumbnailSize] = React49.useState(MIN_THUMBNAIL);
|
|
3747
|
+
React49.useEffect(() => {
|
|
3682
3748
|
const el = textRef.current;
|
|
3683
3749
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
3684
3750
|
const observer = new ResizeObserver(() => {
|
|
@@ -3687,7 +3753,7 @@ var StimulusCard = React48.forwardRef(
|
|
|
3687
3753
|
observer.observe(el);
|
|
3688
3754
|
return () => observer.disconnect();
|
|
3689
3755
|
}, []);
|
|
3690
|
-
return /* @__PURE__ */
|
|
3756
|
+
return /* @__PURE__ */ jsxs37(
|
|
3691
3757
|
"div",
|
|
3692
3758
|
{
|
|
3693
3759
|
ref,
|
|
@@ -3695,8 +3761,8 @@ var StimulusCard = React48.forwardRef(
|
|
|
3695
3761
|
className: cn("flex min-h-24.5 w-full items-center gap-4 rounded-md border border-border p-0.5 pr-4", className),
|
|
3696
3762
|
...props,
|
|
3697
3763
|
children: [
|
|
3698
|
-
/* @__PURE__ */
|
|
3699
|
-
/* @__PURE__ */
|
|
3764
|
+
/* @__PURE__ */ jsxs37("div", { className: "flex min-w-0 flex-1 items-center gap-4", children: [
|
|
3765
|
+
/* @__PURE__ */ jsx50(
|
|
3700
3766
|
"span",
|
|
3701
3767
|
{
|
|
3702
3768
|
style: { width: thumbnailSize, height: thumbnailSize },
|
|
@@ -3707,13 +3773,13 @@ var StimulusCard = React48.forwardRef(
|
|
|
3707
3773
|
),
|
|
3708
3774
|
children: showImage ? (
|
|
3709
3775
|
// Out of flow, so the image's own size never sets the thumbnail's size.
|
|
3710
|
-
/* @__PURE__ */
|
|
3711
|
-
) : error ? /* @__PURE__ */
|
|
3776
|
+
/* @__PURE__ */ jsx50("img", { src: thumbnail, alt: thumbnailAlt, className: "absolute inset-0 size-full object-cover", onError: () => setFailedSrc(thumbnail) })
|
|
3777
|
+
) : error ? /* @__PURE__ */ jsx50(ImageBroken, { size: 24, "aria-hidden": true }) : icon ?? /* @__PURE__ */ jsx50(ImageIcon2, { size: 24, "aria-hidden": true })
|
|
3712
3778
|
}
|
|
3713
3779
|
),
|
|
3714
|
-
/* @__PURE__ */
|
|
3715
|
-
/* @__PURE__ */
|
|
3716
|
-
onCaptionChange ? /* @__PURE__ */
|
|
3780
|
+
/* @__PURE__ */ jsxs37("div", { ref: textRef, className: "flex min-w-0 flex-1 flex-col justify-center gap-2 py-2 text-surface-foreground", children: [
|
|
3781
|
+
/* @__PURE__ */ jsx50("p", { className: "w-full text-ui-label", children: label }),
|
|
3782
|
+
onCaptionChange ? /* @__PURE__ */ jsx50(
|
|
3717
3783
|
InlineEdit,
|
|
3718
3784
|
{
|
|
3719
3785
|
variant: "question",
|
|
@@ -3730,8 +3796,8 @@ var StimulusCard = React48.forwardRef(
|
|
|
3730
3796
|
},
|
|
3731
3797
|
textClassName: "text-body-base"
|
|
3732
3798
|
}
|
|
3733
|
-
) : /* @__PURE__ */
|
|
3734
|
-
onCaptionChange && showCounter && maxLength !== void 0 && count > maxLength && /* @__PURE__ */
|
|
3799
|
+
) : /* @__PURE__ */ jsx50("p", { className: "w-full text-body-base [word-break:break-word]", children: caption }),
|
|
3800
|
+
onCaptionChange && showCounter && maxLength !== void 0 && count > maxLength && /* @__PURE__ */ jsxs37("p", { className: "text-ui-caption text-secondary-muted-foreground", children: [
|
|
3735
3801
|
count,
|
|
3736
3802
|
"/",
|
|
3737
3803
|
maxLength,
|
|
@@ -3739,7 +3805,7 @@ var StimulusCard = React48.forwardRef(
|
|
|
3739
3805
|
] })
|
|
3740
3806
|
] })
|
|
3741
3807
|
] }),
|
|
3742
|
-
onRemove && /* @__PURE__ */
|
|
3808
|
+
onRemove && /* @__PURE__ */ jsx50(Button, { type: "button", variant: "destructive", size: "icon-sm", "aria-label": removeLabel, onClick: onRemove, children: /* @__PURE__ */ jsx50(Trash6, { size: 16, "aria-hidden": true }) })
|
|
3743
3809
|
]
|
|
3744
3810
|
}
|
|
3745
3811
|
);
|
|
@@ -3748,27 +3814,27 @@ var StimulusCard = React48.forwardRef(
|
|
|
3748
3814
|
StimulusCard.displayName = "StimulusCard";
|
|
3749
3815
|
|
|
3750
3816
|
// src/components/Data Display/Progress.tsx
|
|
3751
|
-
import * as
|
|
3817
|
+
import * as React50 from "react";
|
|
3752
3818
|
import { Progress as ProgressPrimitive2 } from "radix-ui";
|
|
3753
|
-
import { jsx as
|
|
3754
|
-
var Progress =
|
|
3819
|
+
import { jsx as jsx51, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
3820
|
+
var Progress = React50.forwardRef(
|
|
3755
3821
|
({ className, value = 0, label, valueLabel, detailsStart, detailsEnd, ...props }, ref) => {
|
|
3756
3822
|
const hasHeader = label != null || valueLabel != null;
|
|
3757
3823
|
const hasDetails = detailsStart != null || detailsEnd != null;
|
|
3758
3824
|
const clamped = Math.min(100, Math.max(0, value ?? 0));
|
|
3759
|
-
return /* @__PURE__ */
|
|
3760
|
-
hasHeader && /* @__PURE__ */
|
|
3761
|
-
/* @__PURE__ */
|
|
3762
|
-
/* @__PURE__ */
|
|
3825
|
+
return /* @__PURE__ */ jsxs38("div", { className: cn("flex w-full flex-col gap-2", className), children: [
|
|
3826
|
+
hasHeader && /* @__PURE__ */ jsxs38("div", { className: "flex items-center justify-between text-ui-label text-surface-foreground", children: [
|
|
3827
|
+
/* @__PURE__ */ jsx51("span", { children: label }),
|
|
3828
|
+
/* @__PURE__ */ jsx51("span", { children: valueLabel === true ? `${Math.round(clamped)}%` : valueLabel })
|
|
3763
3829
|
] }),
|
|
3764
|
-
/* @__PURE__ */
|
|
3830
|
+
/* @__PURE__ */ jsx51(
|
|
3765
3831
|
ProgressPrimitive2.Root,
|
|
3766
3832
|
{
|
|
3767
3833
|
ref,
|
|
3768
3834
|
value: clamped,
|
|
3769
3835
|
className: "relative h-2 w-full overflow-hidden rounded-full bg-secondary",
|
|
3770
3836
|
...props,
|
|
3771
|
-
children: /* @__PURE__ */
|
|
3837
|
+
children: /* @__PURE__ */ jsx51(
|
|
3772
3838
|
ProgressPrimitive2.Indicator,
|
|
3773
3839
|
{
|
|
3774
3840
|
className: "h-full rounded-full bg-accent transition-[width]",
|
|
@@ -3777,9 +3843,9 @@ var Progress = React49.forwardRef(
|
|
|
3777
3843
|
)
|
|
3778
3844
|
}
|
|
3779
3845
|
),
|
|
3780
|
-
hasDetails && /* @__PURE__ */
|
|
3781
|
-
/* @__PURE__ */
|
|
3782
|
-
/* @__PURE__ */
|
|
3846
|
+
hasDetails && /* @__PURE__ */ jsxs38("div", { className: "flex items-start justify-between text-ui-label leading-5 text-secondary-muted-foreground", children: [
|
|
3847
|
+
/* @__PURE__ */ jsx51("span", { children: detailsStart }),
|
|
3848
|
+
/* @__PURE__ */ jsx51("span", { children: detailsEnd })
|
|
3783
3849
|
] })
|
|
3784
3850
|
] });
|
|
3785
3851
|
}
|
|
@@ -3787,11 +3853,11 @@ var Progress = React49.forwardRef(
|
|
|
3787
3853
|
Progress.displayName = "Progress";
|
|
3788
3854
|
|
|
3789
3855
|
// src/components/Data Display/Table.tsx
|
|
3790
|
-
import * as
|
|
3856
|
+
import * as React51 from "react";
|
|
3791
3857
|
import { CaretDown as CaretDown4, CaretUp } from "@phosphor-icons/react";
|
|
3792
|
-
import { jsx as
|
|
3793
|
-
var Table =
|
|
3794
|
-
({ className, containerClassName, containerRef, striped, ...props }, ref) => /* @__PURE__ */
|
|
3858
|
+
import { jsx as jsx52, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
3859
|
+
var Table = React51.forwardRef(
|
|
3860
|
+
({ className, containerClassName, containerRef, striped, ...props }, ref) => /* @__PURE__ */ jsx52("div", { ref: containerRef, className: cn("relative w-full overflow-auto rounded-lg border border-border bg-surface", containerClassName), children: /* @__PURE__ */ jsx52(
|
|
3795
3861
|
"table",
|
|
3796
3862
|
{
|
|
3797
3863
|
ref,
|
|
@@ -3802,20 +3868,20 @@ var Table = React50.forwardRef(
|
|
|
3802
3868
|
) })
|
|
3803
3869
|
);
|
|
3804
3870
|
Table.displayName = "Table";
|
|
3805
|
-
var TableHeader =
|
|
3806
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
3871
|
+
var TableHeader = React51.forwardRef(
|
|
3872
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx52("thead", { ref, className, ...props })
|
|
3807
3873
|
);
|
|
3808
3874
|
TableHeader.displayName = "TableHeader";
|
|
3809
|
-
var TableFooter =
|
|
3810
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
3875
|
+
var TableFooter = React51.forwardRef(
|
|
3876
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx52("tfoot", { ref, className: cn("border-t border-border bg-background text-ui-label", className), ...props })
|
|
3811
3877
|
);
|
|
3812
3878
|
TableFooter.displayName = "TableFooter";
|
|
3813
|
-
var TableBody =
|
|
3814
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
3879
|
+
var TableBody = React51.forwardRef(
|
|
3880
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx52("tbody", { ref, className, ...props })
|
|
3815
3881
|
);
|
|
3816
3882
|
TableBody.displayName = "TableBody";
|
|
3817
|
-
var TableRow =
|
|
3818
|
-
({ className, selected, ...props }, ref) => /* @__PURE__ */
|
|
3883
|
+
var TableRow = React51.forwardRef(
|
|
3884
|
+
({ className, selected, ...props }, ref) => /* @__PURE__ */ jsx52(
|
|
3819
3885
|
"tr",
|
|
3820
3886
|
{
|
|
3821
3887
|
ref,
|
|
@@ -3832,10 +3898,10 @@ var TableRow = React50.forwardRef(
|
|
|
3832
3898
|
);
|
|
3833
3899
|
TableRow.displayName = "TableRow";
|
|
3834
3900
|
var ariaSort = { none: "none", asc: "ascending", desc: "descending" };
|
|
3835
|
-
var TableHead =
|
|
3901
|
+
var TableHead = React51.forwardRef(
|
|
3836
3902
|
({ className, align = "left", sortable, sort = "none", onSort, checkbox, resizer, children, ...props }, ref) => {
|
|
3837
|
-
const caret = sort === "asc" ? /* @__PURE__ */
|
|
3838
|
-
return /* @__PURE__ */
|
|
3903
|
+
const caret = sort === "asc" ? /* @__PURE__ */ jsx52(CaretUp, { size: 16, "aria-hidden": true, className: "shrink-0" }) : /* @__PURE__ */ jsx52(CaretDown4, { size: 16, "aria-hidden": true, className: "shrink-0" });
|
|
3904
|
+
return /* @__PURE__ */ jsxs39(
|
|
3839
3905
|
"th",
|
|
3840
3906
|
{
|
|
3841
3907
|
ref,
|
|
@@ -3850,7 +3916,7 @@ var TableHead = React50.forwardRef(
|
|
|
3850
3916
|
),
|
|
3851
3917
|
...props,
|
|
3852
3918
|
children: [
|
|
3853
|
-
sortable ? /* @__PURE__ */
|
|
3919
|
+
sortable ? /* @__PURE__ */ jsxs39(
|
|
3854
3920
|
"button",
|
|
3855
3921
|
{
|
|
3856
3922
|
type: "button",
|
|
@@ -3861,7 +3927,7 @@ var TableHead = React50.forwardRef(
|
|
|
3861
3927
|
caret
|
|
3862
3928
|
]
|
|
3863
3929
|
}
|
|
3864
|
-
) : checkbox ? /* @__PURE__ */
|
|
3930
|
+
) : checkbox ? /* @__PURE__ */ jsx52("div", { className: "flex items-center justify-center", children }) : children,
|
|
3865
3931
|
resizer
|
|
3866
3932
|
]
|
|
3867
3933
|
}
|
|
@@ -3869,8 +3935,8 @@ var TableHead = React50.forwardRef(
|
|
|
3869
3935
|
}
|
|
3870
3936
|
);
|
|
3871
3937
|
TableHead.displayName = "TableHead";
|
|
3872
|
-
var TableCell =
|
|
3873
|
-
({ className, align = "left", muted, checkbox, actions, children, ...props }, ref) => /* @__PURE__ */
|
|
3938
|
+
var TableCell = React51.forwardRef(
|
|
3939
|
+
({ className, align = "left", muted, checkbox, actions, children, ...props }, ref) => /* @__PURE__ */ jsx52(
|
|
3874
3940
|
"td",
|
|
3875
3941
|
{
|
|
3876
3942
|
ref,
|
|
@@ -3883,23 +3949,23 @@ var TableCell = React50.forwardRef(
|
|
|
3883
3949
|
className
|
|
3884
3950
|
),
|
|
3885
3951
|
...props,
|
|
3886
|
-
children: checkbox ? /* @__PURE__ */
|
|
3952
|
+
children: checkbox ? /* @__PURE__ */ jsx52("div", { className: "flex items-center justify-center", children }) : actions ? /* @__PURE__ */ jsx52("div", { className: "flex items-start justify-end gap-1", children }) : children
|
|
3887
3953
|
}
|
|
3888
3954
|
)
|
|
3889
3955
|
);
|
|
3890
3956
|
TableCell.displayName = "TableCell";
|
|
3891
3957
|
function TableCellTwoLines({ primary, secondary, avatar, className, ...props }) {
|
|
3892
|
-
return /* @__PURE__ */
|
|
3958
|
+
return /* @__PURE__ */ jsxs39("div", { className: cn("flex items-center gap-2", className), ...props, children: [
|
|
3893
3959
|
avatar,
|
|
3894
|
-
/* @__PURE__ */
|
|
3895
|
-
/* @__PURE__ */
|
|
3896
|
-
secondary && /* @__PURE__ */
|
|
3960
|
+
/* @__PURE__ */ jsxs39("div", { className: "flex flex-col gap-0.5 whitespace-nowrap", children: [
|
|
3961
|
+
/* @__PURE__ */ jsx52("span", { className: "text-ui-label text-surface-foreground", children: primary }),
|
|
3962
|
+
secondary && /* @__PURE__ */ jsx52("span", { className: "text-ui-caption text-secondary-muted-foreground", children: secondary })
|
|
3897
3963
|
] })
|
|
3898
3964
|
] });
|
|
3899
3965
|
}
|
|
3900
3966
|
|
|
3901
3967
|
// src/components/Data Display/DataTable.tsx
|
|
3902
|
-
import * as
|
|
3968
|
+
import * as React53 from "react";
|
|
3903
3969
|
import { CaretDown as CaretDown5, CaretRight as CaretRight4, PushPin, PushPinSlash, Rows, Sliders, Stack } from "@phosphor-icons/react";
|
|
3904
3970
|
import {
|
|
3905
3971
|
aggregationFn_count,
|
|
@@ -3952,9 +4018,9 @@ import {
|
|
|
3952
4018
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
3953
4019
|
|
|
3954
4020
|
// src/components/Utility/Pagination.tsx
|
|
3955
|
-
import * as
|
|
4021
|
+
import * as React52 from "react";
|
|
3956
4022
|
import { ArrowLeft, ArrowRight, DotsThree as DotsThree2 } from "@phosphor-icons/react";
|
|
3957
|
-
import { jsx as
|
|
4023
|
+
import { jsx as jsx53, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
3958
4024
|
function getPaginationItems(page, pageCount, siblings = 1) {
|
|
3959
4025
|
const keep = /* @__PURE__ */ new Set([1, pageCount]);
|
|
3960
4026
|
for (let p = page - siblings; p <= page + siblings; p++) if (p >= 1 && p <= pageCount) keep.add(p);
|
|
@@ -3968,10 +4034,10 @@ function getPaginationItems(page, pageCount, siblings = 1) {
|
|
|
3968
4034
|
});
|
|
3969
4035
|
return items;
|
|
3970
4036
|
}
|
|
3971
|
-
var Pagination =
|
|
4037
|
+
var Pagination = React52.forwardRef(
|
|
3972
4038
|
({ className, page, pageCount, onPageChange, variant = "full", siblings = 1, ...props }, ref) => {
|
|
3973
4039
|
const go = (next2) => onPageChange(Math.min(pageCount, Math.max(1, next2)));
|
|
3974
|
-
const previous = /* @__PURE__ */
|
|
4040
|
+
const previous = /* @__PURE__ */ jsx53(
|
|
3975
4041
|
Button,
|
|
3976
4042
|
{
|
|
3977
4043
|
type: "button",
|
|
@@ -3980,10 +4046,10 @@ var Pagination = React51.forwardRef(
|
|
|
3980
4046
|
"aria-label": "Previous page",
|
|
3981
4047
|
disabled: page <= 1,
|
|
3982
4048
|
onClick: () => go(page - 1),
|
|
3983
|
-
children: /* @__PURE__ */
|
|
4049
|
+
children: /* @__PURE__ */ jsx53(ArrowLeft, { size: 16, "aria-hidden": true })
|
|
3984
4050
|
}
|
|
3985
4051
|
);
|
|
3986
|
-
const next = /* @__PURE__ */
|
|
4052
|
+
const next = /* @__PURE__ */ jsx53(
|
|
3987
4053
|
Button,
|
|
3988
4054
|
{
|
|
3989
4055
|
type: "button",
|
|
@@ -3992,10 +4058,10 @@ var Pagination = React51.forwardRef(
|
|
|
3992
4058
|
"aria-label": "Next page",
|
|
3993
4059
|
disabled: page >= pageCount,
|
|
3994
4060
|
onClick: () => go(page + 1),
|
|
3995
|
-
children: /* @__PURE__ */
|
|
4061
|
+
children: /* @__PURE__ */ jsx53(ArrowRight, { size: 16, "aria-hidden": true })
|
|
3996
4062
|
}
|
|
3997
4063
|
);
|
|
3998
|
-
return /* @__PURE__ */
|
|
4064
|
+
return /* @__PURE__ */ jsxs40(
|
|
3999
4065
|
"nav",
|
|
4000
4066
|
{
|
|
4001
4067
|
ref,
|
|
@@ -4004,14 +4070,14 @@ var Pagination = React51.forwardRef(
|
|
|
4004
4070
|
...props,
|
|
4005
4071
|
children: [
|
|
4006
4072
|
previous,
|
|
4007
|
-
variant === "compact" ? /* @__PURE__ */
|
|
4073
|
+
variant === "compact" ? /* @__PURE__ */ jsxs40("span", { className: "text-body-small text-surface-foreground", "aria-live": "polite", children: [
|
|
4008
4074
|
page,
|
|
4009
4075
|
"/",
|
|
4010
4076
|
pageCount
|
|
4011
|
-
] }) : /* @__PURE__ */
|
|
4012
|
-
/* @__PURE__ */
|
|
4013
|
-
/* @__PURE__ */
|
|
4014
|
-
] }) : /* @__PURE__ */
|
|
4077
|
+
] }) : /* @__PURE__ */ jsx53("ul", { className: "flex items-center gap-2", children: getPaginationItems(page, pageCount, siblings).map((item, index) => /* @__PURE__ */ jsx53("li", { children: item === "ellipsis" ? /* @__PURE__ */ jsxs40("span", { className: "inline-flex size-8 items-center justify-center rounded-sm border border-border bg-surface text-surface-foreground", children: [
|
|
4078
|
+
/* @__PURE__ */ jsx53(DotsThree2, { size: 16, "aria-hidden": true }),
|
|
4079
|
+
/* @__PURE__ */ jsx53("span", { className: "sr-only", children: "More pages" })
|
|
4080
|
+
] }) : /* @__PURE__ */ jsx53(
|
|
4015
4081
|
Button,
|
|
4016
4082
|
{
|
|
4017
4083
|
type: "button",
|
|
@@ -4032,7 +4098,7 @@ var Pagination = React51.forwardRef(
|
|
|
4032
4098
|
Pagination.displayName = "Pagination";
|
|
4033
4099
|
|
|
4034
4100
|
// src/components/Data Display/DataTable.tsx
|
|
4035
|
-
import { Fragment as
|
|
4101
|
+
import { Fragment as Fragment15, jsx as jsx54, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
4036
4102
|
var features = tableFeatures({
|
|
4037
4103
|
rowSortingFeature,
|
|
4038
4104
|
rowPaginationFeature,
|
|
@@ -4087,9 +4153,9 @@ var features = tableFeatures({
|
|
|
4087
4153
|
});
|
|
4088
4154
|
var getMeta = (meta) => meta ?? {};
|
|
4089
4155
|
function useControllable(value, initial, onChange) {
|
|
4090
|
-
const [internal, setInternal] =
|
|
4156
|
+
const [internal, setInternal] = React53.useState(initial);
|
|
4091
4157
|
const current = value ?? internal;
|
|
4092
|
-
const update =
|
|
4158
|
+
const update = React53.useCallback(
|
|
4093
4159
|
(updater) => {
|
|
4094
4160
|
const next = typeof updater === "function" ? updater(current) : updater;
|
|
4095
4161
|
if (value === void 0) setInternal(next);
|
|
@@ -4128,16 +4194,16 @@ function ColumnFilter({ column }) {
|
|
|
4128
4194
|
const value = column.getFilterValue();
|
|
4129
4195
|
if (variant === "select") {
|
|
4130
4196
|
const options = [...column.getFacetedUniqueValues().entries()].sort((a, b) => String(a[0]).localeCompare(String(b[0])));
|
|
4131
|
-
return /* @__PURE__ */
|
|
4197
|
+
return /* @__PURE__ */ jsxs41(
|
|
4132
4198
|
Select,
|
|
4133
4199
|
{
|
|
4134
4200
|
value: typeof value === "string" ? value : ALL,
|
|
4135
4201
|
onValueChange: (next) => column.setFilterValue(next === ALL ? void 0 : next),
|
|
4136
4202
|
children: [
|
|
4137
|
-
/* @__PURE__ */
|
|
4138
|
-
/* @__PURE__ */
|
|
4139
|
-
/* @__PURE__ */
|
|
4140
|
-
options.map(([option, count]) => /* @__PURE__ */
|
|
4203
|
+
/* @__PURE__ */ jsx54(SelectTrigger, { "aria-label": `Filter ${label}`, className: "h-8 text-body-small", children: /* @__PURE__ */ jsx54(SelectValue, {}) }),
|
|
4204
|
+
/* @__PURE__ */ jsxs41(SelectContent, { children: [
|
|
4205
|
+
/* @__PURE__ */ jsx54(SelectItem, { value: ALL, children: "All" }),
|
|
4206
|
+
options.map(([option, count]) => /* @__PURE__ */ jsxs41(SelectItem, { value: String(option), children: [
|
|
4141
4207
|
String(option),
|
|
4142
4208
|
" (",
|
|
4143
4209
|
count,
|
|
@@ -4156,8 +4222,8 @@ function ColumnFilter({ column }) {
|
|
|
4156
4222
|
next[index] = raw === "" ? void 0 : Number(raw);
|
|
4157
4223
|
column.setFilterValue(next[0] === void 0 && next[1] === void 0 ? void 0 : next);
|
|
4158
4224
|
};
|
|
4159
|
-
return /* @__PURE__ */
|
|
4160
|
-
/* @__PURE__ */
|
|
4225
|
+
return /* @__PURE__ */ jsxs41("div", { className: "flex gap-1", children: [
|
|
4226
|
+
/* @__PURE__ */ jsx54(
|
|
4161
4227
|
Input,
|
|
4162
4228
|
{
|
|
4163
4229
|
type: "number",
|
|
@@ -4168,7 +4234,7 @@ function ColumnFilter({ column }) {
|
|
|
4168
4234
|
className: "h-8 text-body-small"
|
|
4169
4235
|
}
|
|
4170
4236
|
),
|
|
4171
|
-
/* @__PURE__ */
|
|
4237
|
+
/* @__PURE__ */ jsx54(
|
|
4172
4238
|
Input,
|
|
4173
4239
|
{
|
|
4174
4240
|
type: "number",
|
|
@@ -4181,7 +4247,7 @@ function ColumnFilter({ column }) {
|
|
|
4181
4247
|
)
|
|
4182
4248
|
] });
|
|
4183
4249
|
}
|
|
4184
|
-
return /* @__PURE__ */
|
|
4250
|
+
return /* @__PURE__ */ jsx54(
|
|
4185
4251
|
Input,
|
|
4186
4252
|
{
|
|
4187
4253
|
"aria-label": `Filter ${label}`,
|
|
@@ -4194,9 +4260,9 @@ function ColumnFilter({ column }) {
|
|
|
4194
4260
|
}
|
|
4195
4261
|
function EditableCell({ value, label, type, onCommit }) {
|
|
4196
4262
|
const initial = value == null ? "" : String(value);
|
|
4197
|
-
const [draft, setDraft] =
|
|
4198
|
-
const cancelled =
|
|
4199
|
-
return /* @__PURE__ */
|
|
4263
|
+
const [draft, setDraft] = React53.useState(null);
|
|
4264
|
+
const cancelled = React53.useRef(false);
|
|
4265
|
+
return /* @__PURE__ */ jsx54(
|
|
4200
4266
|
Input,
|
|
4201
4267
|
{
|
|
4202
4268
|
type,
|
|
@@ -4334,7 +4400,7 @@ function DataTableInner({
|
|
|
4334
4400
|
onPaginationChange
|
|
4335
4401
|
);
|
|
4336
4402
|
const [density, setDensity] = useControllable(densityProp, "default", onDensityChange);
|
|
4337
|
-
const [cellSelection, setCellSelection] =
|
|
4403
|
+
const [cellSelection, setCellSelection] = React53.useState([]);
|
|
4338
4404
|
const infinite = Boolean(onLoadMore);
|
|
4339
4405
|
const paginate = !virtualized && !infinite;
|
|
4340
4406
|
const compact = density === "compact";
|
|
@@ -4407,12 +4473,12 @@ function DataTableInner({
|
|
|
4407
4473
|
const cellDensity = compact ? "h-8 py-1.5" : void 0;
|
|
4408
4474
|
const allSelected = table.getIsAllPageRowsSelected();
|
|
4409
4475
|
const someSelected = table.getIsSomePageRowsSelected();
|
|
4410
|
-
const dragged =
|
|
4476
|
+
const dragged = React53.useRef(null);
|
|
4411
4477
|
const topRows = enableRowPinning ? table.getTopRows() : [];
|
|
4412
4478
|
const bottomRows = enableRowPinning ? table.getBottomRows() : [];
|
|
4413
4479
|
const bodyRows = enableRowPinning ? table.getCenterRows() : table.getRowModel().rows;
|
|
4414
|
-
const scrollRef =
|
|
4415
|
-
const setScrollRef =
|
|
4480
|
+
const scrollRef = React53.useRef(null);
|
|
4481
|
+
const setScrollRef = React53.useCallback(
|
|
4416
4482
|
(node) => {
|
|
4417
4483
|
scrollRef.current = node;
|
|
4418
4484
|
if (typeof containerRef === "function") containerRef(node);
|
|
@@ -4431,8 +4497,8 @@ function DataTableInner({
|
|
|
4431
4497
|
const virtualItems = virtualized ? virtualizer.getVirtualItems() : [];
|
|
4432
4498
|
const paddingTop = virtualItems.length > 0 ? virtualItems[0]?.start ?? 0 : 0;
|
|
4433
4499
|
const paddingBottom = virtualItems.length > 0 ? virtualizer.getTotalSize() - (virtualItems.at(-1)?.end ?? 0) : 0;
|
|
4434
|
-
const sentinelRef =
|
|
4435
|
-
|
|
4500
|
+
const sentinelRef = React53.useRef(null);
|
|
4501
|
+
React53.useEffect(() => {
|
|
4436
4502
|
const node = sentinelRef.current;
|
|
4437
4503
|
if (!node || !onLoadMore || !hasMore || loadingMore || typeof IntersectionObserver === "undefined") return;
|
|
4438
4504
|
const container = scrollRef.current;
|
|
@@ -4473,15 +4539,15 @@ function DataTableInner({
|
|
|
4473
4539
|
table.resetCellSelection(true);
|
|
4474
4540
|
}
|
|
4475
4541
|
};
|
|
4476
|
-
const skeletonRow = (rowKey) => /* @__PURE__ */
|
|
4542
|
+
const skeletonRow = (rowKey) => /* @__PURE__ */ jsx54(TableRow, { className: "hover:bg-transparent", children: Array.from({ length: columnSpan }, (_, cell) => /* @__PURE__ */ jsx54(TableCell, { checkbox: enableRowSelection && cell === 0, className: cellDensity, children: /* @__PURE__ */ jsx54("span", { "aria-hidden": true, className: "block h-4 w-3/4 animate-pulse rounded-xs bg-border" }) }, cell)) }, rowKey);
|
|
4477
4543
|
const renderRow = (row, options = {}) => {
|
|
4478
4544
|
const { pinned, pinnedIndex = 0, pinnedCount = 1, virtualIndex } = options;
|
|
4479
4545
|
const grouped = row.getIsGrouped();
|
|
4480
4546
|
const rowUnits = compact ? 8 : 10;
|
|
4481
4547
|
const pinStyle = pinned ? pinned === "top" ? { position: "sticky", top: `calc(var(--spacing) * ${rowUnits * (pinnedIndex + 1)})` } : { position: "sticky", bottom: `calc(var(--spacing) * ${rowUnits * (pinnedCount - 1 - pinnedIndex)})` } : void 0;
|
|
4482
4548
|
const cells = row.getVisibleCells();
|
|
4483
|
-
return /* @__PURE__ */
|
|
4484
|
-
/* @__PURE__ */
|
|
4549
|
+
return /* @__PURE__ */ jsxs41(React53.Fragment, { children: [
|
|
4550
|
+
/* @__PURE__ */ jsxs41(
|
|
4485
4551
|
TableRow,
|
|
4486
4552
|
{
|
|
4487
4553
|
ref: virtualized && virtualIndex !== void 0 ? virtualizer.measureElement : void 0,
|
|
@@ -4491,7 +4557,7 @@ function DataTableInner({
|
|
|
4491
4557
|
onClick: onRowClick && !grouped ? () => onRowClick(row.original) : void 0,
|
|
4492
4558
|
className: cn(pinned && "z-20 bg-surface", grouped && "bg-background", onRowClick && !grouped && "cursor-pointer"),
|
|
4493
4559
|
children: [
|
|
4494
|
-
enableRowSelection && /* @__PURE__ */
|
|
4560
|
+
enableRowSelection && /* @__PURE__ */ jsx54(TableCell, { checkbox: true, className: cellDensity, onClick: (event) => event.stopPropagation(), children: !grouped && /* @__PURE__ */ jsx54(
|
|
4495
4561
|
Checkbox,
|
|
4496
4562
|
{
|
|
4497
4563
|
"aria-label": "Select row",
|
|
@@ -4500,7 +4566,7 @@ function DataTableInner({
|
|
|
4500
4566
|
onCheckedChange: (checked) => row.toggleSelected(Boolean(checked))
|
|
4501
4567
|
}
|
|
4502
4568
|
) }),
|
|
4503
|
-
hasExpander && /* @__PURE__ */
|
|
4569
|
+
hasExpander && /* @__PURE__ */ jsx54(TableCell, { checkbox: true, className: cellDensity, onClick: (event) => event.stopPropagation(), children: !grouped && row.getCanExpand() && /* @__PURE__ */ jsx54(
|
|
4504
4570
|
Button,
|
|
4505
4571
|
{
|
|
4506
4572
|
type: "button",
|
|
@@ -4509,10 +4575,10 @@ function DataTableInner({
|
|
|
4509
4575
|
"aria-label": row.getIsExpanded() ? "Collapse row" : "Expand row",
|
|
4510
4576
|
"aria-expanded": row.getIsExpanded(),
|
|
4511
4577
|
onClick: () => row.toggleExpanded(),
|
|
4512
|
-
children: row.getIsExpanded() ? /* @__PURE__ */
|
|
4578
|
+
children: row.getIsExpanded() ? /* @__PURE__ */ jsx54(CaretDown5, { size: 16, "aria-hidden": true }) : /* @__PURE__ */ jsx54(CaretRight4, { size: 16, "aria-hidden": true })
|
|
4513
4579
|
}
|
|
4514
4580
|
) }),
|
|
4515
|
-
enableRowPinning && /* @__PURE__ */
|
|
4581
|
+
enableRowPinning && /* @__PURE__ */ jsx54(TableCell, { checkbox: true, className: cellDensity, onClick: (event) => event.stopPropagation(), children: !grouped && /* @__PURE__ */ jsx54(
|
|
4516
4582
|
Button,
|
|
4517
4583
|
{
|
|
4518
4584
|
type: "button",
|
|
@@ -4521,7 +4587,7 @@ function DataTableInner({
|
|
|
4521
4587
|
"aria-label": row.getIsPinned() ? "Unpin row" : "Pin row to top",
|
|
4522
4588
|
"aria-pressed": Boolean(row.getIsPinned()),
|
|
4523
4589
|
onClick: () => row.pin(row.getIsPinned() ? false : "top"),
|
|
4524
|
-
children: row.getIsPinned() ? /* @__PURE__ */
|
|
4590
|
+
children: row.getIsPinned() ? /* @__PURE__ */ jsx54(PushPinSlash, { size: 16, "aria-hidden": true }) : /* @__PURE__ */ jsx54(PushPin, { size: 16, "aria-hidden": true })
|
|
4525
4591
|
}
|
|
4526
4592
|
) }),
|
|
4527
4593
|
cells.map((cell, index) => {
|
|
@@ -4534,7 +4600,7 @@ function DataTableInner({
|
|
|
4534
4600
|
const indent = index === 0 && hasExpander && row.depth > 0 ? row.depth * 4 : 0;
|
|
4535
4601
|
let content;
|
|
4536
4602
|
if (cell.getIsGrouped()) {
|
|
4537
|
-
content = /* @__PURE__ */
|
|
4603
|
+
content = /* @__PURE__ */ jsxs41(
|
|
4538
4604
|
"button",
|
|
4539
4605
|
{
|
|
4540
4606
|
type: "button",
|
|
@@ -4542,9 +4608,9 @@ function DataTableInner({
|
|
|
4542
4608
|
"aria-expanded": row.getIsExpanded(),
|
|
4543
4609
|
onClick: row.getToggleExpandedHandler(),
|
|
4544
4610
|
children: [
|
|
4545
|
-
row.getIsExpanded() ? /* @__PURE__ */
|
|
4611
|
+
row.getIsExpanded() ? /* @__PURE__ */ jsx54(CaretDown5, { size: 16, "aria-hidden": true }) : /* @__PURE__ */ jsx54(CaretRight4, { size: 16, "aria-hidden": true }),
|
|
4546
4612
|
flexRender(cell.column.columnDef.cell, cell.getContext()),
|
|
4547
|
-
/* @__PURE__ */
|
|
4613
|
+
/* @__PURE__ */ jsxs41("span", { className: "text-secondary-muted-foreground", children: [
|
|
4548
4614
|
"(",
|
|
4549
4615
|
row.subRows.length,
|
|
4550
4616
|
")"
|
|
@@ -4557,7 +4623,7 @@ function DataTableInner({
|
|
|
4557
4623
|
} else if (cell.getIsPlaceholder()) {
|
|
4558
4624
|
content = null;
|
|
4559
4625
|
} else if (meta.editable) {
|
|
4560
|
-
content = /* @__PURE__ */
|
|
4626
|
+
content = /* @__PURE__ */ jsx54(
|
|
4561
4627
|
EditableCell,
|
|
4562
4628
|
{
|
|
4563
4629
|
value: cell.getValue(),
|
|
@@ -4569,7 +4635,7 @@ function DataTableInner({
|
|
|
4569
4635
|
} else {
|
|
4570
4636
|
content = flexRender(cell.column.columnDef.cell, cell.getContext());
|
|
4571
4637
|
}
|
|
4572
|
-
return /* @__PURE__ */
|
|
4638
|
+
return /* @__PURE__ */ jsx54(
|
|
4573
4639
|
TableCell,
|
|
4574
4640
|
{
|
|
4575
4641
|
align: meta.align,
|
|
@@ -4602,7 +4668,7 @@ function DataTableInner({
|
|
|
4602
4668
|
]
|
|
4603
4669
|
}
|
|
4604
4670
|
),
|
|
4605
|
-
renderSubComponent && !grouped && row.getIsExpanded() && /* @__PURE__ */
|
|
4671
|
+
renderSubComponent && !grouped && row.getIsExpanded() && /* @__PURE__ */ jsx54(TableRow, { className: "bg-background hover:bg-background", children: /* @__PURE__ */ jsx54(TableCell, { colSpan: columnSpan, children: renderSubComponent(row.original) }) })
|
|
4606
4672
|
] }, row.id);
|
|
4607
4673
|
};
|
|
4608
4674
|
const renderHeaderCell = (header) => {
|
|
@@ -4613,7 +4679,7 @@ function DataTableInner({
|
|
|
4613
4679
|
const pin = pinning(column, sized, true);
|
|
4614
4680
|
const reorderable = enableColumnOrdering && leaf && !column.getIsPinned();
|
|
4615
4681
|
const label = labelOf(column);
|
|
4616
|
-
return /* @__PURE__ */
|
|
4682
|
+
return /* @__PURE__ */ jsx54(
|
|
4617
4683
|
TableHead,
|
|
4618
4684
|
{
|
|
4619
4685
|
colSpan: header.colSpan > 1 ? header.colSpan : void 0,
|
|
@@ -4649,7 +4715,7 @@ function DataTableInner({
|
|
|
4649
4715
|
reorderable && "cursor-grab",
|
|
4650
4716
|
!leaf && "text-center"
|
|
4651
4717
|
),
|
|
4652
|
-
resizer: enableColumnResizing && column.getCanResize() ? /* @__PURE__ */
|
|
4718
|
+
resizer: enableColumnResizing && column.getCanResize() ? /* @__PURE__ */ jsx54(
|
|
4653
4719
|
"div",
|
|
4654
4720
|
{
|
|
4655
4721
|
role: "separator",
|
|
@@ -4664,14 +4730,14 @@ function DataTableInner({
|
|
|
4664
4730
|
)
|
|
4665
4731
|
}
|
|
4666
4732
|
) : void 0,
|
|
4667
|
-
children: header.isPlaceholder ? null : /* @__PURE__ */
|
|
4733
|
+
children: header.isPlaceholder ? null : /* @__PURE__ */ jsx54(table.FlexRender, { header })
|
|
4668
4734
|
},
|
|
4669
4735
|
header.id
|
|
4670
4736
|
);
|
|
4671
4737
|
};
|
|
4672
4738
|
const stickyLeading = cn(cellDensity, sticky && "sticky top-0 z-20 bg-surface");
|
|
4673
|
-
const leadingHeaderCells = (rowSpan) => /* @__PURE__ */
|
|
4674
|
-
enableRowSelection && /* @__PURE__ */
|
|
4739
|
+
const leadingHeaderCells = (rowSpan) => /* @__PURE__ */ jsxs41(Fragment15, { children: [
|
|
4740
|
+
enableRowSelection && /* @__PURE__ */ jsx54(TableHead, { checkbox: true, rowSpan, className: stickyLeading, children: /* @__PURE__ */ jsx54(
|
|
4675
4741
|
Checkbox,
|
|
4676
4742
|
{
|
|
4677
4743
|
"aria-label": "Select all rows",
|
|
@@ -4680,15 +4746,15 @@ function DataTableInner({
|
|
|
4680
4746
|
onCheckedChange: (checked) => table.toggleAllPageRowsSelected(Boolean(checked))
|
|
4681
4747
|
}
|
|
4682
4748
|
) }),
|
|
4683
|
-
hasExpander && /* @__PURE__ */
|
|
4684
|
-
enableRowPinning && /* @__PURE__ */
|
|
4749
|
+
hasExpander && /* @__PURE__ */ jsx54(TableHead, { checkbox: true, rowSpan, className: stickyLeading, children: /* @__PURE__ */ jsx54("span", { className: "sr-only", children: "Expand" }) }),
|
|
4750
|
+
enableRowPinning && /* @__PURE__ */ jsx54(TableHead, { checkbox: true, rowSpan, className: stickyLeading, children: /* @__PURE__ */ jsx54("span", { className: "sr-only", children: "Pin" }) })
|
|
4685
4751
|
] });
|
|
4686
4752
|
const rowsToRender = virtualized ? virtualItems.map((item) => ({ row: bodyRows[item.index], index: item.index })) : null;
|
|
4687
4753
|
const totalRows = topRows.length + bodyRows.length + bottomRows.length;
|
|
4688
|
-
return /* @__PURE__ */
|
|
4689
|
-
showToolbar && /* @__PURE__ */
|
|
4690
|
-
/* @__PURE__ */
|
|
4691
|
-
enableGlobalFilter && /* @__PURE__ */
|
|
4754
|
+
return /* @__PURE__ */ jsxs41("div", { className: cn("flex w-full flex-col gap-2", wrapperClassName), children: [
|
|
4755
|
+
showToolbar && /* @__PURE__ */ jsxs41("div", { className: "flex items-center justify-between gap-2", children: [
|
|
4756
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex items-center gap-2", children: [
|
|
4757
|
+
enableGlobalFilter && /* @__PURE__ */ jsx54(
|
|
4692
4758
|
SearchBar,
|
|
4693
4759
|
{
|
|
4694
4760
|
"aria-label": "Search table",
|
|
@@ -4701,8 +4767,8 @@ function DataTableInner({
|
|
|
4701
4767
|
),
|
|
4702
4768
|
toolbar
|
|
4703
4769
|
] }),
|
|
4704
|
-
/* @__PURE__ */
|
|
4705
|
-
enableDensityToggle && /* @__PURE__ */
|
|
4770
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex items-center gap-2", children: [
|
|
4771
|
+
enableDensityToggle && /* @__PURE__ */ jsxs41(
|
|
4706
4772
|
Button,
|
|
4707
4773
|
{
|
|
4708
4774
|
type: "button",
|
|
@@ -4711,20 +4777,20 @@ function DataTableInner({
|
|
|
4711
4777
|
"aria-pressed": compact,
|
|
4712
4778
|
onClick: () => setDensity(compact ? "default" : "compact"),
|
|
4713
4779
|
children: [
|
|
4714
|
-
/* @__PURE__ */
|
|
4780
|
+
/* @__PURE__ */ jsx54(Rows, { size: 16, "aria-hidden": true }),
|
|
4715
4781
|
"Compact"
|
|
4716
4782
|
]
|
|
4717
4783
|
}
|
|
4718
4784
|
),
|
|
4719
|
-
enableGrouping && /* @__PURE__ */
|
|
4720
|
-
/* @__PURE__ */
|
|
4721
|
-
/* @__PURE__ */
|
|
4785
|
+
enableGrouping && /* @__PURE__ */ jsxs41(DropdownMenu, { children: [
|
|
4786
|
+
/* @__PURE__ */ jsx54(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs41(Button, { type: "button", variant: "outline", size: "sm", children: [
|
|
4787
|
+
/* @__PURE__ */ jsx54(Stack, { size: 16, "aria-hidden": true }),
|
|
4722
4788
|
"Group by"
|
|
4723
4789
|
] }) }),
|
|
4724
|
-
/* @__PURE__ */
|
|
4725
|
-
/* @__PURE__ */
|
|
4726
|
-
/* @__PURE__ */
|
|
4727
|
-
groupableColumns.map((column) => /* @__PURE__ */
|
|
4790
|
+
/* @__PURE__ */ jsxs41(DropdownMenuContent, { align: "end", children: [
|
|
4791
|
+
/* @__PURE__ */ jsx54(DropdownMenuLabel, { children: "Group rows by" }),
|
|
4792
|
+
/* @__PURE__ */ jsx54(DropdownMenuSeparator, {}),
|
|
4793
|
+
groupableColumns.map((column) => /* @__PURE__ */ jsx54(
|
|
4728
4794
|
DropdownMenuCheckboxItem,
|
|
4729
4795
|
{
|
|
4730
4796
|
checked: column.getIsGrouped(),
|
|
@@ -4735,15 +4801,15 @@ function DataTableInner({
|
|
|
4735
4801
|
))
|
|
4736
4802
|
] })
|
|
4737
4803
|
] }),
|
|
4738
|
-
enableColumnVisibility && /* @__PURE__ */
|
|
4739
|
-
/* @__PURE__ */
|
|
4740
|
-
/* @__PURE__ */
|
|
4804
|
+
enableColumnVisibility && /* @__PURE__ */ jsxs41(DropdownMenu, { children: [
|
|
4805
|
+
/* @__PURE__ */ jsx54(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs41(Button, { type: "button", variant: "outline", size: "sm", children: [
|
|
4806
|
+
/* @__PURE__ */ jsx54(Sliders, { size: 16, "aria-hidden": true }),
|
|
4741
4807
|
"Columns"
|
|
4742
4808
|
] }) }),
|
|
4743
|
-
/* @__PURE__ */
|
|
4744
|
-
/* @__PURE__ */
|
|
4745
|
-
/* @__PURE__ */
|
|
4746
|
-
hideableColumns.map((column) => /* @__PURE__ */
|
|
4809
|
+
/* @__PURE__ */ jsxs41(DropdownMenuContent, { align: "end", children: [
|
|
4810
|
+
/* @__PURE__ */ jsx54(DropdownMenuLabel, { children: "Toggle columns" }),
|
|
4811
|
+
/* @__PURE__ */ jsx54(DropdownMenuSeparator, {}),
|
|
4812
|
+
hideableColumns.map((column) => /* @__PURE__ */ jsx54(
|
|
4747
4813
|
DropdownMenuCheckboxItem,
|
|
4748
4814
|
{
|
|
4749
4815
|
checked: column.getIsVisible(),
|
|
@@ -4756,7 +4822,7 @@ function DataTableInner({
|
|
|
4756
4822
|
] })
|
|
4757
4823
|
] })
|
|
4758
4824
|
] }),
|
|
4759
|
-
/* @__PURE__ */
|
|
4825
|
+
/* @__PURE__ */ jsxs41(
|
|
4760
4826
|
Table,
|
|
4761
4827
|
{
|
|
4762
4828
|
ref,
|
|
@@ -4769,52 +4835,52 @@ function DataTableInner({
|
|
|
4769
4835
|
tabIndex: enableCellSelection ? 0 : void 0,
|
|
4770
4836
|
...tableProps,
|
|
4771
4837
|
children: [
|
|
4772
|
-
/* @__PURE__ */
|
|
4773
|
-
headerGroups.map((group, groupIndex) => /* @__PURE__ */
|
|
4838
|
+
/* @__PURE__ */ jsxs41(TableHeader, { children: [
|
|
4839
|
+
headerGroups.map((group, groupIndex) => /* @__PURE__ */ jsxs41(TableRow, { className: "hover:bg-transparent", children: [
|
|
4774
4840
|
groupIndex === 0 && leadingHeaderCells(headerGroups.length + (enableColumnFilters ? 1 : 0)),
|
|
4775
4841
|
group.headers.map(renderHeaderCell)
|
|
4776
4842
|
] }, group.id)),
|
|
4777
|
-
enableColumnFilters && /* @__PURE__ */
|
|
4843
|
+
enableColumnFilters && /* @__PURE__ */ jsx54(TableRow, { className: "hover:bg-transparent", children: leafColumns.map((column) => {
|
|
4778
4844
|
const pin = pinning(column, sized, true);
|
|
4779
|
-
return /* @__PURE__ */
|
|
4845
|
+
return /* @__PURE__ */ jsx54(
|
|
4780
4846
|
TableHead,
|
|
4781
4847
|
{
|
|
4782
4848
|
style: pin.style,
|
|
4783
4849
|
className: cn("h-auto py-2 font-normal", pin.className, sticky && !column.getIsPinned() && "bg-surface"),
|
|
4784
|
-
children: column.getCanFilter() ? /* @__PURE__ */
|
|
4850
|
+
children: column.getCanFilter() ? /* @__PURE__ */ jsx54(ColumnFilter, { column }) : null
|
|
4785
4851
|
},
|
|
4786
4852
|
column.id
|
|
4787
4853
|
);
|
|
4788
4854
|
}) })
|
|
4789
4855
|
] }),
|
|
4790
|
-
/* @__PURE__ */
|
|
4791
|
-
loading ? Array.from({ length: pageSize }, (_, index) => skeletonRow(`loading-${index}`)) : totalRows === 0 ? /* @__PURE__ */
|
|
4856
|
+
/* @__PURE__ */ jsxs41(TableBody, { children: [
|
|
4857
|
+
loading ? Array.from({ length: pageSize }, (_, index) => skeletonRow(`loading-${index}`)) : totalRows === 0 ? /* @__PURE__ */ jsx54(TableRow, { className: "hover:bg-transparent", children: /* @__PURE__ */ jsx54(TableCell, { colSpan: columnSpan, muted: true, className: "h-24 text-center", children: emptyState ?? "No results." }) }) : /* @__PURE__ */ jsxs41(Fragment15, { children: [
|
|
4792
4858
|
topRows.map((row, index) => renderRow(row, { pinned: "top", pinnedIndex: index, pinnedCount: topRows.length })),
|
|
4793
|
-
virtualized && paddingTop > 0 && /* @__PURE__ */
|
|
4859
|
+
virtualized && paddingTop > 0 && /* @__PURE__ */ jsx54("tr", { "aria-hidden": true, children: /* @__PURE__ */ jsx54("td", { colSpan: columnSpan, style: { height: paddingTop } }) }),
|
|
4794
4860
|
rowsToRender ? rowsToRender.map(({ row, index }) => renderRow(row, { virtualIndex: index })) : bodyRows.map((row) => renderRow(row)),
|
|
4795
|
-
virtualized && paddingBottom > 0 && /* @__PURE__ */
|
|
4861
|
+
virtualized && paddingBottom > 0 && /* @__PURE__ */ jsx54("tr", { "aria-hidden": true, children: /* @__PURE__ */ jsx54("td", { colSpan: columnSpan, style: { height: paddingBottom } }) }),
|
|
4796
4862
|
bottomRows.map(
|
|
4797
4863
|
(row, index) => renderRow(row, { pinned: "bottom", pinnedIndex: index, pinnedCount: bottomRows.length })
|
|
4798
4864
|
)
|
|
4799
4865
|
] }),
|
|
4800
|
-
infinite && /* @__PURE__ */
|
|
4866
|
+
infinite && /* @__PURE__ */ jsxs41(Fragment15, { children: [
|
|
4801
4867
|
loadingMore && Array.from({ length: 3 }, (_, index) => skeletonRow(`more-${index}`)),
|
|
4802
|
-
/* @__PURE__ */
|
|
4868
|
+
/* @__PURE__ */ jsx54("tr", { ref: sentinelRef, "aria-hidden": true, children: /* @__PURE__ */ jsx54("td", { colSpan: columnSpan, className: "h-px p-0" }) })
|
|
4803
4869
|
] })
|
|
4804
4870
|
] }),
|
|
4805
|
-
showFooter && /* @__PURE__ */
|
|
4806
|
-
leadingCount > 0 && /* @__PURE__ */
|
|
4871
|
+
showFooter && /* @__PURE__ */ jsx54(TableFooter, { children: table.getFooterGroups().map((group) => /* @__PURE__ */ jsxs41(TableRow, { className: "hover:bg-transparent", children: [
|
|
4872
|
+
leadingCount > 0 && /* @__PURE__ */ jsx54(TableCell, { colSpan: leadingCount, className: cellDensity }),
|
|
4807
4873
|
group.headers.map((header) => {
|
|
4808
4874
|
const { align } = getMeta(header.column.columnDef.meta);
|
|
4809
4875
|
const pin = pinning(header.column, sized);
|
|
4810
|
-
return /* @__PURE__ */
|
|
4876
|
+
return /* @__PURE__ */ jsx54(
|
|
4811
4877
|
TableCell,
|
|
4812
4878
|
{
|
|
4813
4879
|
align,
|
|
4814
4880
|
colSpan: header.colSpan > 1 ? header.colSpan : void 0,
|
|
4815
4881
|
style: pin.style,
|
|
4816
4882
|
className: cn("text-ui-label", pin.className, cellDensity),
|
|
4817
|
-
children: header.isPlaceholder ? null : /* @__PURE__ */
|
|
4883
|
+
children: header.isPlaceholder ? null : /* @__PURE__ */ jsx54(table.FlexRender, { footer: header })
|
|
4818
4884
|
},
|
|
4819
4885
|
header.id
|
|
4820
4886
|
);
|
|
@@ -4823,9 +4889,9 @@ function DataTableInner({
|
|
|
4823
4889
|
]
|
|
4824
4890
|
}
|
|
4825
4891
|
),
|
|
4826
|
-
(enableRowSelection || paginate && pageCount > 1) && /* @__PURE__ */
|
|
4827
|
-
/* @__PURE__ */
|
|
4828
|
-
paginate && pageCount > 1 && /* @__PURE__ */
|
|
4892
|
+
(enableRowSelection || paginate && pageCount > 1) && /* @__PURE__ */ jsxs41("div", { className: "flex items-center justify-between gap-2", children: [
|
|
4893
|
+
/* @__PURE__ */ jsx54("span", { className: "text-body-small text-secondary-muted-foreground", "aria-live": "polite", children: enableRowSelection ? `${selectedCount} of ${table.getCoreRowModel().rows.length} row(s) selected` : null }),
|
|
4894
|
+
paginate && pageCount > 1 && /* @__PURE__ */ jsx54(
|
|
4829
4895
|
Pagination,
|
|
4830
4896
|
{
|
|
4831
4897
|
page: pagination.pageIndex + 1,
|
|
@@ -4836,13 +4902,13 @@ function DataTableInner({
|
|
|
4836
4902
|
] })
|
|
4837
4903
|
] });
|
|
4838
4904
|
}
|
|
4839
|
-
var DataTable =
|
|
4905
|
+
var DataTable = React53.forwardRef(DataTableInner);
|
|
4840
4906
|
DataTable.displayName = "DataTable";
|
|
4841
4907
|
|
|
4842
4908
|
// src/components/Data Display/StatCard.tsx
|
|
4843
|
-
import * as
|
|
4909
|
+
import * as React54 from "react";
|
|
4844
4910
|
import { cva as cva6 } from "class-variance-authority";
|
|
4845
|
-
import { jsx as
|
|
4911
|
+
import { jsx as jsx55, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
4846
4912
|
var statCardVariants = cva6("flex min-w-0 flex-col gap-2 rounded-md border p-3", {
|
|
4847
4913
|
variants: {
|
|
4848
4914
|
variant: {
|
|
@@ -4856,26 +4922,26 @@ var statCardVariants = cva6("flex min-w-0 flex-col gap-2 rounded-md border p-3",
|
|
|
4856
4922
|
},
|
|
4857
4923
|
defaultVariants: { variant: "default" }
|
|
4858
4924
|
});
|
|
4859
|
-
var StatCard =
|
|
4860
|
-
({ className, variant, label, value, icon, caption, ...props }, ref) => /* @__PURE__ */
|
|
4861
|
-
/* @__PURE__ */
|
|
4862
|
-
/* @__PURE__ */
|
|
4863
|
-
icon && /* @__PURE__ */
|
|
4925
|
+
var StatCard = React54.forwardRef(
|
|
4926
|
+
({ className, variant, label, value, icon, caption, ...props }, ref) => /* @__PURE__ */ jsxs42("div", { ref, className: cn(statCardVariants({ variant }), className), ...props, children: [
|
|
4927
|
+
/* @__PURE__ */ jsx55("p", { className: "truncate text-ui-caption text-secondary-muted-foreground", children: label }),
|
|
4928
|
+
/* @__PURE__ */ jsxs42("p", { className: "flex items-center gap-2 text-body-base text-surface-foreground", children: [
|
|
4929
|
+
icon && /* @__PURE__ */ jsx55("span", { "aria-hidden": "true", className: "inline-flex size-6 shrink-0 items-center justify-center", children: icon }),
|
|
4864
4930
|
value
|
|
4865
4931
|
] }),
|
|
4866
|
-
caption && /* @__PURE__ */
|
|
4932
|
+
caption && /* @__PURE__ */ jsx55("p", { className: "text-ui-caption text-secondary-muted-foreground", children: caption })
|
|
4867
4933
|
] })
|
|
4868
4934
|
);
|
|
4869
4935
|
StatCard.displayName = "StatCard";
|
|
4870
4936
|
|
|
4871
4937
|
// src/components/Research-Specific/ActivityStructure.tsx
|
|
4872
|
-
import * as
|
|
4938
|
+
import * as React56 from "react";
|
|
4873
4939
|
|
|
4874
4940
|
// src/components/Tags & Badges/EditableTag.tsx
|
|
4875
|
-
import * as
|
|
4941
|
+
import * as React55 from "react";
|
|
4876
4942
|
import { Crown, Plus as Plus5, X as X6 } from "@phosphor-icons/react";
|
|
4877
4943
|
import { cva as cva7 } from "class-variance-authority";
|
|
4878
|
-
import { jsx as
|
|
4944
|
+
import { jsx as jsx56, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
4879
4945
|
var editableTagVariants = cva7(
|
|
4880
4946
|
"inline-flex h-6.5 items-center whitespace-nowrap rounded-sm py-1 text-ui-caption transition-colors",
|
|
4881
4947
|
{
|
|
@@ -4890,27 +4956,27 @@ var editableTagVariants = cva7(
|
|
|
4890
4956
|
defaultVariants: { type: "default" }
|
|
4891
4957
|
}
|
|
4892
4958
|
);
|
|
4893
|
-
var EditableTag =
|
|
4959
|
+
var EditableTag = React55.forwardRef(
|
|
4894
4960
|
({ className, type = "default", icon, onRemove, onClick, children, ...props }, ref) => {
|
|
4895
4961
|
const classes = cn(editableTagVariants({ type }), className);
|
|
4896
|
-
const leading = type === "add" ? /* @__PURE__ */
|
|
4962
|
+
const leading = type === "add" ? /* @__PURE__ */ jsx56(Plus5, { size: 12, "aria-hidden": true }) : icon !== void 0 ? icon : type === "default" ? /* @__PURE__ */ jsx56(Crown, { size: 12, weight: "fill", "aria-hidden": true }) : null;
|
|
4897
4963
|
if (type === "add" || type === "multiple" && onClick) {
|
|
4898
|
-
return /* @__PURE__ */
|
|
4964
|
+
return /* @__PURE__ */ jsxs43("button", { ref, type: "button", className: classes, onClick, ...props, children: [
|
|
4899
4965
|
leading,
|
|
4900
4966
|
children
|
|
4901
4967
|
] });
|
|
4902
4968
|
}
|
|
4903
|
-
return /* @__PURE__ */
|
|
4969
|
+
return /* @__PURE__ */ jsxs43("span", { ref, className: classes, ...props, children: [
|
|
4904
4970
|
leading,
|
|
4905
4971
|
children,
|
|
4906
|
-
onRemove && /* @__PURE__ */
|
|
4972
|
+
onRemove && /* @__PURE__ */ jsx56(
|
|
4907
4973
|
"button",
|
|
4908
4974
|
{
|
|
4909
4975
|
type: "button",
|
|
4910
4976
|
"aria-label": typeof children === "string" ? `Remove ${children}` : "Remove",
|
|
4911
4977
|
onClick: onRemove,
|
|
4912
4978
|
className: "inline-flex size-3 items-center justify-center rounded-xs",
|
|
4913
|
-
children: /* @__PURE__ */
|
|
4979
|
+
children: /* @__PURE__ */ jsx56(X6, { size: 12, "aria-hidden": true })
|
|
4914
4980
|
}
|
|
4915
4981
|
)
|
|
4916
4982
|
] });
|
|
@@ -4919,26 +4985,26 @@ var EditableTag = React54.forwardRef(
|
|
|
4919
4985
|
EditableTag.displayName = "EditableTag";
|
|
4920
4986
|
|
|
4921
4987
|
// src/components/Research-Specific/ActivityStructure.tsx
|
|
4922
|
-
import { jsx as
|
|
4923
|
-
var ActivityStructure =
|
|
4924
|
-
({ className, title = "Activity Structure", stats, sections, onRemoveTag, onAddTag, addTagLabel = "Add tag", action, children, ...props }, ref) => /* @__PURE__ */
|
|
4988
|
+
import { jsx as jsx57, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
4989
|
+
var ActivityStructure = React56.forwardRef(
|
|
4990
|
+
({ className, title = "Activity Structure", stats, sections, onRemoveTag, onAddTag, addTagLabel = "Add tag", action, children, ...props }, ref) => /* @__PURE__ */ jsxs44(
|
|
4925
4991
|
"section",
|
|
4926
4992
|
{
|
|
4927
4993
|
ref,
|
|
4928
4994
|
className: cn("flex w-full max-w-96.5 flex-col gap-4 rounded-xl bg-surface p-4", className),
|
|
4929
4995
|
...props,
|
|
4930
4996
|
children: [
|
|
4931
|
-
/* @__PURE__ */
|
|
4932
|
-
/* @__PURE__ */
|
|
4997
|
+
/* @__PURE__ */ jsxs44("div", { className: "flex items-center justify-between gap-2", children: [
|
|
4998
|
+
/* @__PURE__ */ jsx57("h3", { className: "text-body-section text-surface-foreground", children: title }),
|
|
4933
4999
|
action
|
|
4934
5000
|
] }),
|
|
4935
|
-
stats.length > 0 && /* @__PURE__ */
|
|
4936
|
-
sections?.map(({ id, heading, body, tags }) => /* @__PURE__ */
|
|
4937
|
-
/* @__PURE__ */
|
|
4938
|
-
/* @__PURE__ */
|
|
4939
|
-
(tags?.length || onAddTag) && /* @__PURE__ */
|
|
4940
|
-
tags?.map((tag) => /* @__PURE__ */
|
|
4941
|
-
onAddTag && /* @__PURE__ */
|
|
5001
|
+
stats.length > 0 && /* @__PURE__ */ jsx57("div", { className: "grid grid-cols-2 gap-3", children: stats.map(({ id, ...stat }) => /* @__PURE__ */ jsx57(StatCard, { ...stat }, id)) }),
|
|
5002
|
+
sections?.map(({ id, heading, body, tags }) => /* @__PURE__ */ jsxs44("div", { className: "flex flex-col gap-2", children: [
|
|
5003
|
+
/* @__PURE__ */ jsx57("h4", { className: "text-heading-h4 text-surface-foreground", children: heading }),
|
|
5004
|
+
/* @__PURE__ */ jsx57("div", { className: "text-body-base text-surface-foreground", children: body }),
|
|
5005
|
+
(tags?.length || onAddTag) && /* @__PURE__ */ jsxs44("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
5006
|
+
tags?.map((tag) => /* @__PURE__ */ jsx57(EditableTag, { type: "editable", onRemove: onRemoveTag && (() => onRemoveTag(id, tag)), children: tag }, tag)),
|
|
5007
|
+
onAddTag && /* @__PURE__ */ jsx57(EditableTag, { type: "add", onClick: () => onAddTag(id), children: addTagLabel })
|
|
4942
5008
|
] })
|
|
4943
5009
|
] }, id)),
|
|
4944
5010
|
children
|
|
@@ -4949,10 +5015,10 @@ var ActivityStructure = React55.forwardRef(
|
|
|
4949
5015
|
ActivityStructure.displayName = "ActivityStructure";
|
|
4950
5016
|
|
|
4951
5017
|
// src/components/Tags & Badges/Badge.tsx
|
|
4952
|
-
import * as
|
|
4953
|
-
import { DotsSixVertical as DotsSixVertical5, RadioButton as
|
|
5018
|
+
import * as React57 from "react";
|
|
5019
|
+
import { DotsSixVertical as DotsSixVertical5, RadioButton as RadioButton3 } from "@phosphor-icons/react";
|
|
4954
5020
|
import { cva as cva8 } from "class-variance-authority";
|
|
4955
|
-
import { jsx as
|
|
5021
|
+
import { jsx as jsx58, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
4956
5022
|
var roleTagVariants = cva8(
|
|
4957
5023
|
"group inline-flex h-6 items-center whitespace-nowrap rounded-sm py-1 text-ui-caption transition-colors",
|
|
4958
5024
|
{
|
|
@@ -4978,11 +5044,11 @@ var roleTagVariants = cva8(
|
|
|
4978
5044
|
defaultVariants: { type: "primary", selected: false }
|
|
4979
5045
|
}
|
|
4980
5046
|
);
|
|
4981
|
-
var Badge =
|
|
5047
|
+
var Badge = React57.forwardRef(
|
|
4982
5048
|
({ className, type = "primary", selected = false, onClick, children, ...props }, ref) => {
|
|
4983
5049
|
const classes = cn(roleTagVariants({ type, selected: type === "interactable" ? selected : false }), className);
|
|
4984
5050
|
if (type === "interactable") {
|
|
4985
|
-
return /* @__PURE__ */
|
|
5051
|
+
return /* @__PURE__ */ jsxs45(
|
|
4986
5052
|
"button",
|
|
4987
5053
|
{
|
|
4988
5054
|
ref,
|
|
@@ -4992,15 +5058,15 @@ var Badge = React56.forwardRef(
|
|
|
4992
5058
|
onClick,
|
|
4993
5059
|
...props,
|
|
4994
5060
|
children: [
|
|
4995
|
-
/* @__PURE__ */
|
|
5061
|
+
/* @__PURE__ */ jsx58(DotsSixVertical5, { size: 16, "aria-hidden": true, className: "hidden shrink-0 group-hover:block" }),
|
|
4996
5062
|
children
|
|
4997
5063
|
]
|
|
4998
5064
|
}
|
|
4999
5065
|
);
|
|
5000
5066
|
}
|
|
5001
|
-
return /* @__PURE__ */
|
|
5002
|
-
type === "question" && /* @__PURE__ */
|
|
5003
|
-
type === "id" && /* @__PURE__ */
|
|
5067
|
+
return /* @__PURE__ */ jsxs45("span", { ref, className: classes, ...props, children: [
|
|
5068
|
+
type === "question" && /* @__PURE__ */ jsx58(RadioButton3, { size: 16, weight: "fill", "aria-hidden": true }),
|
|
5069
|
+
type === "id" && /* @__PURE__ */ jsx58("span", { className: "text-secondary-muted-foreground", children: "ID" }),
|
|
5004
5070
|
children
|
|
5005
5071
|
] });
|
|
5006
5072
|
}
|
|
@@ -5092,6 +5158,9 @@ export {
|
|
|
5092
5158
|
Slider,
|
|
5093
5159
|
StatCard,
|
|
5094
5160
|
StatusTag,
|
|
5161
|
+
Step,
|
|
5162
|
+
StepPath,
|
|
5163
|
+
Stepper,
|
|
5095
5164
|
StimulusCard,
|
|
5096
5165
|
Switch,
|
|
5097
5166
|
TabItem,
|