@discuss-ds/ui 0.39.0 → 0.40.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 +12 -0
- package/dist/index.cjs +509 -467
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -1
- package/dist/index.d.ts +23 -1
- package/dist/index.js +507 -467
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -335,9 +335,9 @@ var Checkbox = React8.forwardRef(
|
|
|
335
335
|
className: cn(
|
|
336
336
|
"peer inline-flex size-4 shrink-0 items-center justify-center rounded-xxs border-2 border-input bg-surface transition-colors",
|
|
337
337
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
338
|
-
//
|
|
339
|
-
"data-[state=checked]:border-
|
|
340
|
-
"data-[state=indeterminate]:border-
|
|
338
|
+
// Selected controls use the accent foreground, the same colour as the other accent icons and text (they used the lighter `ring` before).
|
|
339
|
+
"data-[state=checked]:border-accent-foreground data-[state=checked]:bg-accent-foreground data-[state=checked]:text-label",
|
|
340
|
+
"data-[state=indeterminate]:border-accent-foreground data-[state=indeterminate]:bg-accent-foreground data-[state=indeterminate]:text-label",
|
|
341
341
|
className
|
|
342
342
|
),
|
|
343
343
|
...props,
|
|
@@ -393,12 +393,12 @@ var RadioGroupItem = React9.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
393
393
|
className: cn(
|
|
394
394
|
"peer inline-flex size-4 shrink-0 items-center justify-center rounded-full border-2 border-input bg-surface transition-colors",
|
|
395
395
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
396
|
-
//
|
|
397
|
-
"data-[state=checked]:border-
|
|
396
|
+
// Selected controls use the accent foreground, the same colour as the other accent icons and text (they used the lighter `ring` before).
|
|
397
|
+
"data-[state=checked]:border-accent-foreground",
|
|
398
398
|
className
|
|
399
399
|
),
|
|
400
400
|
...props,
|
|
401
|
-
children: /* @__PURE__ */ jsx9(RadioGroupPrimitive.Indicator, { className: "size-2 rounded-full bg-
|
|
401
|
+
children: /* @__PURE__ */ jsx9(RadioGroupPrimitive.Indicator, { className: "size-2 rounded-full bg-accent-foreground" })
|
|
402
402
|
}
|
|
403
403
|
));
|
|
404
404
|
RadioGroupItem.displayName = "RadioGroupItem";
|
|
@@ -2351,24 +2351,62 @@ var Stepper = React33.forwardRef(({ steps, current, orientation = "horizontal",
|
|
|
2351
2351
|
});
|
|
2352
2352
|
Stepper.displayName = "Stepper";
|
|
2353
2353
|
|
|
2354
|
-
// src/components/
|
|
2354
|
+
// src/components/Navigation/NavRail.tsx
|
|
2355
2355
|
import * as React34 from "react";
|
|
2356
|
+
import { jsx as jsx35, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2357
|
+
var NavRail = React34.forwardRef(({ className, children, footer, ...props }, ref) => /* @__PURE__ */ jsxs25("nav", { ref, className: cn("flex h-full w-16 shrink-0 flex-col border-r border-border", className), ...props, children: [
|
|
2358
|
+
/* @__PURE__ */ jsx35("ul", { className: "flex flex-col items-center gap-2 px-2 pt-3", children }),
|
|
2359
|
+
footer && /* @__PURE__ */ jsx35("div", { className: "mt-auto flex flex-col items-center px-2 pb-3", children: footer })
|
|
2360
|
+
] }));
|
|
2361
|
+
NavRail.displayName = "NavRail";
|
|
2362
|
+
var NavRailItem = React34.forwardRef(({ className, icon, label, selected = false, type = "button", ...props }, ref) => /* @__PURE__ */ jsx35("li", { className: "w-full", children: /* @__PURE__ */ jsxs25(
|
|
2363
|
+
"button",
|
|
2364
|
+
{
|
|
2365
|
+
ref,
|
|
2366
|
+
type,
|
|
2367
|
+
"aria-current": selected ? "page" : void 0,
|
|
2368
|
+
className: cn(
|
|
2369
|
+
"group flex w-full cursor-pointer flex-col items-center gap-1 rounded-md text-body-xxs outline-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
2370
|
+
selected ? "text-surface-foreground" : "text-secondary-muted-foreground hover:text-surface-foreground",
|
|
2371
|
+
className
|
|
2372
|
+
),
|
|
2373
|
+
...props,
|
|
2374
|
+
children: [
|
|
2375
|
+
/* @__PURE__ */ jsx35(
|
|
2376
|
+
"span",
|
|
2377
|
+
{
|
|
2378
|
+
"aria-hidden": "true",
|
|
2379
|
+
className: cn(
|
|
2380
|
+
"flex size-9 items-center justify-center rounded-md transition-colors [&>svg]:size-4",
|
|
2381
|
+
selected ? "bg-secondary text-surface-foreground" : "group-hover:bg-secondary"
|
|
2382
|
+
),
|
|
2383
|
+
children: icon
|
|
2384
|
+
}
|
|
2385
|
+
),
|
|
2386
|
+
/* @__PURE__ */ jsx35("span", { children: label })
|
|
2387
|
+
]
|
|
2388
|
+
}
|
|
2389
|
+
) }));
|
|
2390
|
+
NavRailItem.displayName = "NavRailItem";
|
|
2391
|
+
|
|
2392
|
+
// src/components/Overlays & Feedback/Dialog.tsx
|
|
2393
|
+
import * as React35 from "react";
|
|
2356
2394
|
import { X as X3 } from "@phosphor-icons/react";
|
|
2357
2395
|
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
2358
|
-
import { jsx as
|
|
2396
|
+
import { jsx as jsx36, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2359
2397
|
var Dialog = DialogPrimitive.Root;
|
|
2360
2398
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
2361
2399
|
var DialogClose = DialogPrimitive.Close;
|
|
2362
|
-
var DialogContent =
|
|
2363
|
-
({ className, children, closeLabel = "Close", hideClose, ...props }, ref) => /* @__PURE__ */
|
|
2364
|
-
/* @__PURE__ */
|
|
2400
|
+
var DialogContent = React35.forwardRef(
|
|
2401
|
+
({ className, children, closeLabel = "Close", hideClose, ...props }, ref) => /* @__PURE__ */ jsxs26(DialogPrimitive.Portal, { children: [
|
|
2402
|
+
/* @__PURE__ */ jsx36(
|
|
2365
2403
|
DialogPrimitive.Overlay,
|
|
2366
2404
|
{
|
|
2367
2405
|
style: { zIndex: "var(--sys-z-30)" },
|
|
2368
2406
|
className: "fixed inset-0 bg-primary/30"
|
|
2369
2407
|
}
|
|
2370
2408
|
),
|
|
2371
|
-
/* @__PURE__ */
|
|
2409
|
+
/* @__PURE__ */ jsxs26(
|
|
2372
2410
|
DialogPrimitive.Content,
|
|
2373
2411
|
{
|
|
2374
2412
|
ref,
|
|
@@ -2380,15 +2418,15 @@ var DialogContent = React34.forwardRef(
|
|
|
2380
2418
|
...props,
|
|
2381
2419
|
children: [
|
|
2382
2420
|
children,
|
|
2383
|
-
!hideClose && /* @__PURE__ */
|
|
2421
|
+
!hideClose && /* @__PURE__ */ jsx36(DialogPrimitive.Close, { asChild: true, children: /* @__PURE__ */ jsx36(Button, { variant: "ghost", size: "icon-sm", "aria-label": closeLabel, className: "absolute top-4 right-6", children: /* @__PURE__ */ jsx36(X3, { size: 16, "aria-hidden": true }) }) })
|
|
2384
2422
|
]
|
|
2385
2423
|
}
|
|
2386
2424
|
)
|
|
2387
2425
|
] })
|
|
2388
2426
|
);
|
|
2389
2427
|
DialogContent.displayName = "DialogContent";
|
|
2390
|
-
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */
|
|
2391
|
-
var DialogTitle =
|
|
2428
|
+
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx36("div", { className: cn("flex flex-col gap-1.5 border-b border-border px-6 py-4 pr-16", className), ...props });
|
|
2429
|
+
var DialogTitle = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx36(
|
|
2392
2430
|
DialogPrimitive.Title,
|
|
2393
2431
|
{
|
|
2394
2432
|
ref,
|
|
@@ -2397,7 +2435,7 @@ var DialogTitle = React34.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
2397
2435
|
}
|
|
2398
2436
|
));
|
|
2399
2437
|
DialogTitle.displayName = "DialogTitle";
|
|
2400
|
-
var DialogDescription =
|
|
2438
|
+
var DialogDescription = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx36(
|
|
2401
2439
|
DialogPrimitive.Description,
|
|
2402
2440
|
{
|
|
2403
2441
|
ref,
|
|
@@ -2406,15 +2444,15 @@ var DialogDescription = React34.forwardRef(({ className, ...props }, ref) => /*
|
|
|
2406
2444
|
}
|
|
2407
2445
|
));
|
|
2408
2446
|
DialogDescription.displayName = "DialogDescription";
|
|
2409
|
-
var DialogBody = ({ className, ...props }) => /* @__PURE__ */
|
|
2410
|
-
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */
|
|
2447
|
+
var DialogBody = ({ className, ...props }) => /* @__PURE__ */ jsx36("div", { className: cn("flex flex-col gap-4 p-6", className), ...props });
|
|
2448
|
+
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx36("div", { className: cn("flex items-center justify-end gap-3 border-t border-border px-6 py-4", className), ...props });
|
|
2411
2449
|
|
|
2412
2450
|
// src/components/Overlays & Feedback/Toast.tsx
|
|
2413
|
-
import * as
|
|
2451
|
+
import * as React36 from "react";
|
|
2414
2452
|
import { CheckCircle as CheckCircle3, Info, Warning, WarningCircle as WarningCircle4, X as X4 } from "@phosphor-icons/react";
|
|
2415
2453
|
import { cva as cva4 } from "class-variance-authority";
|
|
2416
2454
|
import { Toast as ToastPrimitive } from "radix-ui";
|
|
2417
|
-
import { Fragment as Fragment7, jsx as
|
|
2455
|
+
import { Fragment as Fragment7, jsx as jsx37, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2418
2456
|
var toastVariants = cva4("border", {
|
|
2419
2457
|
variants: {
|
|
2420
2458
|
variant: {
|
|
@@ -2452,13 +2490,13 @@ var titleColour = {
|
|
|
2452
2490
|
};
|
|
2453
2491
|
function VariantIcon({ variant, size }) {
|
|
2454
2492
|
const props = { size, "aria-hidden": true, className: cn("shrink-0", iconColour[variant]) };
|
|
2455
|
-
if (variant === "success") return /* @__PURE__ */
|
|
2456
|
-
if (variant === "warning") return /* @__PURE__ */
|
|
2457
|
-
if (variant === "destructive") return /* @__PURE__ */
|
|
2458
|
-
return /* @__PURE__ */
|
|
2493
|
+
if (variant === "success") return /* @__PURE__ */ jsx37(CheckCircle3, { ...props });
|
|
2494
|
+
if (variant === "warning") return /* @__PURE__ */ jsx37(Warning, { ...props });
|
|
2495
|
+
if (variant === "destructive") return /* @__PURE__ */ jsx37(WarningCircle4, { ...props });
|
|
2496
|
+
return /* @__PURE__ */ jsx37(Info, { ...props });
|
|
2459
2497
|
}
|
|
2460
2498
|
var ToastProvider = ToastPrimitive.Provider;
|
|
2461
|
-
var ToastViewport =
|
|
2499
|
+
var ToastViewport = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx37(
|
|
2462
2500
|
ToastPrimitive.Viewport,
|
|
2463
2501
|
{
|
|
2464
2502
|
ref,
|
|
@@ -2468,10 +2506,10 @@ var ToastViewport = React35.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
2468
2506
|
}
|
|
2469
2507
|
));
|
|
2470
2508
|
ToastViewport.displayName = "ToastViewport";
|
|
2471
|
-
var Toast =
|
|
2509
|
+
var Toast = React36.forwardRef(
|
|
2472
2510
|
({ className, variant = "info", title, description, action, closeLabel = "Close", children, ...props }, ref) => {
|
|
2473
2511
|
const v = variant ?? "info";
|
|
2474
|
-
return /* @__PURE__ */
|
|
2512
|
+
return /* @__PURE__ */ jsxs27(
|
|
2475
2513
|
ToastPrimitive.Root,
|
|
2476
2514
|
{
|
|
2477
2515
|
ref,
|
|
@@ -2479,19 +2517,19 @@ var Toast = React35.forwardRef(
|
|
|
2479
2517
|
className: cn("flex items-start gap-3 rounded-lg p-4 shadow-lg", toastVariants({ variant: v }), className),
|
|
2480
2518
|
...props,
|
|
2481
2519
|
children: [
|
|
2482
|
-
/* @__PURE__ */
|
|
2483
|
-
/* @__PURE__ */
|
|
2484
|
-
title != null && /* @__PURE__ */
|
|
2485
|
-
description != null && /* @__PURE__ */
|
|
2520
|
+
/* @__PURE__ */ jsx37(VariantIcon, { variant: v, size: 20 }),
|
|
2521
|
+
/* @__PURE__ */ jsxs27("div", { className: "flex min-w-0 flex-1 flex-col gap-1 text-body-small", children: [
|
|
2522
|
+
title != null && /* @__PURE__ */ jsx37(ToastPrimitive.Title, { className: cn("font-semibold", titleColour[v]), children: title }),
|
|
2523
|
+
description != null && /* @__PURE__ */ jsx37(ToastPrimitive.Description, { className: "text-secondary-muted-foreground", children: description }),
|
|
2486
2524
|
children,
|
|
2487
2525
|
action
|
|
2488
2526
|
] }),
|
|
2489
|
-
/* @__PURE__ */
|
|
2527
|
+
/* @__PURE__ */ jsx37(
|
|
2490
2528
|
ToastPrimitive.Close,
|
|
2491
2529
|
{
|
|
2492
2530
|
"aria-label": closeLabel,
|
|
2493
2531
|
className: "inline-flex size-4 shrink-0 items-center justify-center rounded-xs text-surface-foreground",
|
|
2494
|
-
children: /* @__PURE__ */
|
|
2532
|
+
children: /* @__PURE__ */ jsx37(X4, { size: 16, "aria-hidden": true })
|
|
2495
2533
|
}
|
|
2496
2534
|
)
|
|
2497
2535
|
]
|
|
@@ -2501,11 +2539,11 @@ var Toast = React35.forwardRef(
|
|
|
2501
2539
|
);
|
|
2502
2540
|
Toast.displayName = "Toast";
|
|
2503
2541
|
var ToastAction = ToastPrimitive.Action;
|
|
2504
|
-
var ToastInline =
|
|
2542
|
+
var ToastInline = React36.forwardRef(
|
|
2505
2543
|
({ className, variant = "info", actions, actionsPlacement = "end", onClose, closeLabel = "Close", children, ...props }, ref) => {
|
|
2506
2544
|
const v = variant ?? "info";
|
|
2507
2545
|
const below = actionsPlacement === "bottom" && !!actions;
|
|
2508
|
-
return /* @__PURE__ */
|
|
2546
|
+
return /* @__PURE__ */ jsxs27(
|
|
2509
2547
|
"div",
|
|
2510
2548
|
{
|
|
2511
2549
|
ref,
|
|
@@ -2513,15 +2551,15 @@ var ToastInline = React35.forwardRef(
|
|
|
2513
2551
|
className: cn("flex gap-2 rounded-sm px-2 py-1.5", below ? "items-start" : "items-center", inlineVariants({ variant: v }), className),
|
|
2514
2552
|
...props,
|
|
2515
2553
|
children: [
|
|
2516
|
-
/* @__PURE__ */
|
|
2517
|
-
below ? /* @__PURE__ */
|
|
2518
|
-
/* @__PURE__ */
|
|
2519
|
-
/* @__PURE__ */
|
|
2520
|
-
] }) : /* @__PURE__ */
|
|
2521
|
-
/* @__PURE__ */
|
|
2522
|
-
actions && /* @__PURE__ */
|
|
2554
|
+
/* @__PURE__ */ jsx37("span", { className: cn("inline-flex shrink-0", below && "mt-0.5"), children: /* @__PURE__ */ jsx37(VariantIcon, { variant: v === "neutral" ? "info" : v, size: 16 }) }),
|
|
2555
|
+
below ? /* @__PURE__ */ jsxs27("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
2556
|
+
/* @__PURE__ */ jsx37("p", { className: "text-body-small text-secondary-muted-foreground", children }),
|
|
2557
|
+
/* @__PURE__ */ jsx37("div", { className: "flex items-center gap-2", children: actions })
|
|
2558
|
+
] }) : /* @__PURE__ */ jsxs27(Fragment7, { children: [
|
|
2559
|
+
/* @__PURE__ */ jsx37("p", { className: "min-w-0 flex-1 text-body-small text-secondary-muted-foreground", children }),
|
|
2560
|
+
actions && /* @__PURE__ */ jsx37("div", { className: "flex shrink-0 items-center gap-2", children: actions })
|
|
2523
2561
|
] }),
|
|
2524
|
-
onClose && /* @__PURE__ */
|
|
2562
|
+
onClose && /* @__PURE__ */ jsx37(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": closeLabel, onClick: onClose, children: /* @__PURE__ */ jsx37(X4, { size: 16, "aria-hidden": true }) })
|
|
2525
2563
|
]
|
|
2526
2564
|
}
|
|
2527
2565
|
);
|
|
@@ -2530,16 +2568,16 @@ var ToastInline = React35.forwardRef(
|
|
|
2530
2568
|
ToastInline.displayName = "ToastInline";
|
|
2531
2569
|
|
|
2532
2570
|
// src/components/Overlays & Feedback/Tooltip.tsx
|
|
2533
|
-
import * as
|
|
2571
|
+
import * as React37 from "react";
|
|
2534
2572
|
import { Tooltip as TooltipPrimitive } from "radix-ui";
|
|
2535
|
-
import { Fragment as Fragment8, jsx as
|
|
2573
|
+
import { Fragment as Fragment8, jsx as jsx38, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2536
2574
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
2537
2575
|
var Tooltip = TooltipPrimitive.Root;
|
|
2538
2576
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
2539
|
-
var TooltipContent =
|
|
2577
|
+
var TooltipContent = React37.forwardRef(
|
|
2540
2578
|
({ className, sideOffset = 4, title, description, action, arrow = true, children, ...props }, ref) => {
|
|
2541
2579
|
const detailed = title != null || description != null;
|
|
2542
|
-
return /* @__PURE__ */
|
|
2580
|
+
return /* @__PURE__ */ jsx38(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs28(
|
|
2543
2581
|
TooltipPrimitive.Content,
|
|
2544
2582
|
{
|
|
2545
2583
|
ref,
|
|
@@ -2553,12 +2591,12 @@ var TooltipContent = React36.forwardRef(
|
|
|
2553
2591
|
),
|
|
2554
2592
|
...props,
|
|
2555
2593
|
children: [
|
|
2556
|
-
detailed ? /* @__PURE__ */
|
|
2557
|
-
title != null && /* @__PURE__ */
|
|
2558
|
-
description != null && /* @__PURE__ */
|
|
2559
|
-
action != null && /* @__PURE__ */
|
|
2594
|
+
detailed ? /* @__PURE__ */ jsxs28(Fragment8, { children: [
|
|
2595
|
+
title != null && /* @__PURE__ */ jsx38("p", { className: "text-xs leading-4 font-semibold text-label", children: title }),
|
|
2596
|
+
description != null && /* @__PURE__ */ jsx38("p", { className: "text-xs leading-4.5 text-plum-200", children: description }),
|
|
2597
|
+
action != null && /* @__PURE__ */ jsx38("div", { className: "mt-1 text-ui-caption text-plum-300 underline *:underline", children: action })
|
|
2560
2598
|
] }) : children,
|
|
2561
|
-
arrow && /* @__PURE__ */
|
|
2599
|
+
arrow && /* @__PURE__ */ jsx38(TooltipPrimitive.Arrow, { width: 12, height: 8, className: "fill-primary-soft-foreground" })
|
|
2562
2600
|
]
|
|
2563
2601
|
}
|
|
2564
2602
|
) });
|
|
@@ -2567,14 +2605,14 @@ var TooltipContent = React36.forwardRef(
|
|
|
2567
2605
|
TooltipContent.displayName = "TooltipContent";
|
|
2568
2606
|
|
|
2569
2607
|
// src/components/Question Types/FileUpload.tsx
|
|
2570
|
-
import * as
|
|
2608
|
+
import * as React39 from "react";
|
|
2571
2609
|
import { FileText, X as X5 } from "@phosphor-icons/react";
|
|
2572
2610
|
import { Progress as ProgressPrimitive } from "radix-ui";
|
|
2573
2611
|
|
|
2574
2612
|
// src/components/Tags & Badges/Tag.tsx
|
|
2575
|
-
import * as
|
|
2613
|
+
import * as React38 from "react";
|
|
2576
2614
|
import { cva as cva5 } from "class-variance-authority";
|
|
2577
|
-
import { jsx as
|
|
2615
|
+
import { jsx as jsx39, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2578
2616
|
var tagVariants = cva5(
|
|
2579
2617
|
"inline-flex items-center gap-1.5 whitespace-nowrap rounded-sm border px-2.5 py-1 text-ui-caption",
|
|
2580
2618
|
{
|
|
@@ -2590,7 +2628,7 @@ var tagVariants = cva5(
|
|
|
2590
2628
|
defaultVariants: { variant: "neutral" }
|
|
2591
2629
|
}
|
|
2592
2630
|
);
|
|
2593
|
-
var Tag =
|
|
2631
|
+
var Tag = React38.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx39("span", { ref, className: cn(tagVariants({ variant }), className), ...props }));
|
|
2594
2632
|
Tag.displayName = "Tag";
|
|
2595
2633
|
var statusDotVariants = cva5("size-1.5 shrink-0 rounded-full", {
|
|
2596
2634
|
variants: {
|
|
@@ -2603,20 +2641,20 @@ var statusDotVariants = cva5("size-1.5 shrink-0 rounded-full", {
|
|
|
2603
2641
|
},
|
|
2604
2642
|
defaultVariants: { status: "active" }
|
|
2605
2643
|
});
|
|
2606
|
-
var StatusTag =
|
|
2607
|
-
({ className, status, children, ...props }, ref) => /* @__PURE__ */
|
|
2608
|
-
/* @__PURE__ */
|
|
2644
|
+
var StatusTag = React38.forwardRef(
|
|
2645
|
+
({ className, status, children, ...props }, ref) => /* @__PURE__ */ jsxs29("span", { ref, className: cn(tagVariants({ variant: "default" }), className), ...props, children: [
|
|
2646
|
+
/* @__PURE__ */ jsx39("span", { className: statusDotVariants({ status }), "aria-hidden": "true" }),
|
|
2609
2647
|
children
|
|
2610
2648
|
] })
|
|
2611
2649
|
);
|
|
2612
2650
|
StatusTag.displayName = "StatusTag";
|
|
2613
2651
|
|
|
2614
2652
|
// src/components/Question Types/FileUpload.tsx
|
|
2615
|
-
import { Fragment as Fragment9, jsx as
|
|
2616
|
-
var FileUploadZone =
|
|
2653
|
+
import { Fragment as Fragment9, jsx as jsx40, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2654
|
+
var FileUploadZone = React39.forwardRef(
|
|
2617
2655
|
({ className, title = "Upload document", hint, icon, onFiles, ...props }, ref) => {
|
|
2618
|
-
const [over, setOver] =
|
|
2619
|
-
return /* @__PURE__ */
|
|
2656
|
+
const [over, setOver] = React39.useState(false);
|
|
2657
|
+
return /* @__PURE__ */ jsxs30(
|
|
2620
2658
|
"label",
|
|
2621
2659
|
{
|
|
2622
2660
|
className: cn(
|
|
@@ -2636,12 +2674,12 @@ var FileUploadZone = React38.forwardRef(
|
|
|
2636
2674
|
onFiles?.(Array.from(event.dataTransfer.files));
|
|
2637
2675
|
},
|
|
2638
2676
|
children: [
|
|
2639
|
-
/* @__PURE__ */
|
|
2640
|
-
/* @__PURE__ */
|
|
2641
|
-
/* @__PURE__ */
|
|
2642
|
-
hint && /* @__PURE__ */
|
|
2677
|
+
/* @__PURE__ */ jsx40("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__ */ jsx40(FileText, { size: 24, "aria-hidden": true }) }),
|
|
2678
|
+
/* @__PURE__ */ jsxs30("span", { className: "flex flex-col gap-1", children: [
|
|
2679
|
+
/* @__PURE__ */ jsx40("span", { className: "text-body-small text-surface-foreground", children: title }),
|
|
2680
|
+
hint && /* @__PURE__ */ jsx40("span", { className: "text-ui-caption text-secondary-muted-foreground", children: hint })
|
|
2643
2681
|
] }),
|
|
2644
|
-
/* @__PURE__ */
|
|
2682
|
+
/* @__PURE__ */ jsx40(
|
|
2645
2683
|
"input",
|
|
2646
2684
|
{
|
|
2647
2685
|
ref,
|
|
@@ -2657,47 +2695,47 @@ var FileUploadZone = React38.forwardRef(
|
|
|
2657
2695
|
}
|
|
2658
2696
|
);
|
|
2659
2697
|
FileUploadZone.displayName = "FileUploadZone";
|
|
2660
|
-
var FileUploadItem =
|
|
2698
|
+
var FileUploadItem = React39.forwardRef(
|
|
2661
2699
|
({ className, name, size, status = "uploading", progress = 0, timeLeft, icon, onRemove, removeLabel, ...props }, ref) => {
|
|
2662
2700
|
const uploading = status === "uploading";
|
|
2663
|
-
return /* @__PURE__ */
|
|
2701
|
+
return /* @__PURE__ */ jsxs30(
|
|
2664
2702
|
"div",
|
|
2665
2703
|
{
|
|
2666
2704
|
ref,
|
|
2667
2705
|
className: cn("flex w-full flex-col justify-center gap-2 overflow-hidden rounded-sm border border-border p-2", className),
|
|
2668
2706
|
...props,
|
|
2669
2707
|
children: [
|
|
2670
|
-
/* @__PURE__ */
|
|
2671
|
-
/* @__PURE__ */
|
|
2672
|
-
/* @__PURE__ */
|
|
2673
|
-
/* @__PURE__ */
|
|
2674
|
-
/* @__PURE__ */
|
|
2675
|
-
onRemove && /* @__PURE__ */
|
|
2708
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-2", children: [
|
|
2709
|
+
/* @__PURE__ */ jsx40("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__ */ jsx40(FileText, { size: 24, "aria-hidden": true }) }),
|
|
2710
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
2711
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex items-center justify-between gap-2", children: [
|
|
2712
|
+
/* @__PURE__ */ jsx40("p", { className: "min-w-0 truncate text-ui-label text-surface-foreground", children: name }),
|
|
2713
|
+
onRemove && /* @__PURE__ */ jsx40(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": removeLabel ?? `Remove ${name}`, onClick: onRemove, children: /* @__PURE__ */ jsx40(X5, { size: 16, "aria-hidden": true }) })
|
|
2676
2714
|
] }),
|
|
2677
|
-
/* @__PURE__ */
|
|
2678
|
-
/* @__PURE__ */
|
|
2715
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex items-center justify-between text-ui-caption text-secondary-muted-foreground", children: [
|
|
2716
|
+
/* @__PURE__ */ jsxs30("span", { className: "flex items-center gap-2", children: [
|
|
2679
2717
|
size,
|
|
2680
|
-
status === "complete" && /* @__PURE__ */
|
|
2681
|
-
status === "error" && /* @__PURE__ */
|
|
2682
|
-
uploading && timeLeft && /* @__PURE__ */
|
|
2683
|
-
/* @__PURE__ */
|
|
2718
|
+
status === "complete" && /* @__PURE__ */ jsx40(Tag, { variant: "success", children: "Complete" }),
|
|
2719
|
+
status === "error" && /* @__PURE__ */ jsx40(Tag, { variant: "destructive", children: "Error" }),
|
|
2720
|
+
uploading && timeLeft && /* @__PURE__ */ jsxs30(Fragment9, { children: [
|
|
2721
|
+
/* @__PURE__ */ jsx40("span", { "aria-hidden": "true", className: "size-0.5 rounded-full bg-secondary-muted-foreground" }),
|
|
2684
2722
|
timeLeft
|
|
2685
2723
|
] })
|
|
2686
2724
|
] }),
|
|
2687
|
-
uploading && /* @__PURE__ */
|
|
2725
|
+
uploading && /* @__PURE__ */ jsxs30("span", { className: "text-body-xxs font-normal", children: [
|
|
2688
2726
|
Math.round(progress),
|
|
2689
2727
|
"%"
|
|
2690
2728
|
] })
|
|
2691
2729
|
] })
|
|
2692
2730
|
] })
|
|
2693
2731
|
] }),
|
|
2694
|
-
uploading && /* @__PURE__ */
|
|
2732
|
+
uploading && /* @__PURE__ */ jsx40(
|
|
2695
2733
|
ProgressPrimitive.Root,
|
|
2696
2734
|
{
|
|
2697
2735
|
value: progress,
|
|
2698
2736
|
"aria-label": `Uploading ${name}`,
|
|
2699
2737
|
className: "h-0.75 w-full overflow-hidden rounded-sm bg-background bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5",
|
|
2700
|
-
children: /* @__PURE__ */
|
|
2738
|
+
children: /* @__PURE__ */ jsx40(ProgressPrimitive.Indicator, { className: "h-full bg-accent transition-[width]", style: { width: `${progress}%` } })
|
|
2701
2739
|
}
|
|
2702
2740
|
)
|
|
2703
2741
|
]
|
|
@@ -2708,25 +2746,25 @@ var FileUploadItem = React38.forwardRef(
|
|
|
2708
2746
|
FileUploadItem.displayName = "FileUploadItem";
|
|
2709
2747
|
|
|
2710
2748
|
// src/components/Question Types/Media.tsx
|
|
2711
|
-
import * as
|
|
2749
|
+
import * as React40 from "react";
|
|
2712
2750
|
import { CornersOut, DotsThree, Image as ImageIcon, Pause, Play, SpeakerSimpleHigh, SpeakerSimpleX, Trash as Trash3 } from "@phosphor-icons/react";
|
|
2713
2751
|
import { Slider as SliderPrimitive2, ToggleGroup as ToggleGroupPrimitive2 } from "radix-ui";
|
|
2714
|
-
import { jsx as
|
|
2752
|
+
import { jsx as jsx41, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
2715
2753
|
function MediaInfo({ name, details, onRemove, removeLabel, large, className, ...props }) {
|
|
2716
|
-
return /* @__PURE__ */
|
|
2717
|
-
/* @__PURE__ */
|
|
2718
|
-
/* @__PURE__ */
|
|
2719
|
-
details && /* @__PURE__ */
|
|
2720
|
-
index > 0 && /* @__PURE__ */
|
|
2754
|
+
return /* @__PURE__ */ jsxs31("div", { className: cn("flex items-center justify-between border-t border-border bg-surface px-6 py-4", className), ...props, children: [
|
|
2755
|
+
/* @__PURE__ */ jsxs31("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
2756
|
+
/* @__PURE__ */ jsx41("p", { className: cn("truncate text-surface-foreground", large ? "text-body-section" : "text-ui-label"), children: name }),
|
|
2757
|
+
details && /* @__PURE__ */ jsx41("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__ */ jsxs31(React40.Fragment, { children: [
|
|
2758
|
+
index > 0 && /* @__PURE__ */ jsx41("span", { "aria-hidden": "true", className: "size-0.5 rounded-full bg-secondary-muted-foreground" }),
|
|
2721
2759
|
part
|
|
2722
2760
|
] }, part)) })
|
|
2723
2761
|
] }),
|
|
2724
|
-
onRemove && /* @__PURE__ */
|
|
2762
|
+
onRemove && /* @__PURE__ */ jsx41(Button, { type: "button", variant: "destructive", size: "icon", "aria-label": removeLabel ?? `Remove ${name}`, onClick: onRemove, children: /* @__PURE__ */ jsx41(Trash3, { size: 16, "aria-hidden": true }) })
|
|
2725
2763
|
] });
|
|
2726
2764
|
}
|
|
2727
|
-
var ImagePreview =
|
|
2728
|
-
({ className, children, name, details, onRemove, ...props }, ref) => /* @__PURE__ */
|
|
2729
|
-
/* @__PURE__ */
|
|
2765
|
+
var ImagePreview = React40.forwardRef(
|
|
2766
|
+
({ className, children, name, details, onRemove, ...props }, ref) => /* @__PURE__ */ jsxs31("div", { ref, className: cn("flex w-full flex-col overflow-hidden rounded-lg border border-border", className), ...props, children: [
|
|
2767
|
+
/* @__PURE__ */ jsx41(
|
|
2730
2768
|
"div",
|
|
2731
2769
|
{
|
|
2732
2770
|
className: cn(
|
|
@@ -2737,12 +2775,12 @@ var ImagePreview = React39.forwardRef(
|
|
|
2737
2775
|
children
|
|
2738
2776
|
}
|
|
2739
2777
|
),
|
|
2740
|
-
/* @__PURE__ */
|
|
2778
|
+
/* @__PURE__ */ jsx41(MediaInfo, { name, details, onRemove, large: true })
|
|
2741
2779
|
] })
|
|
2742
2780
|
);
|
|
2743
2781
|
ImagePreview.displayName = "ImagePreview";
|
|
2744
|
-
var ImageThumbnails =
|
|
2745
|
-
({ className, max, images, value, onValueChange, ...props }, ref) => /* @__PURE__ */
|
|
2782
|
+
var ImageThumbnails = React40.forwardRef(
|
|
2783
|
+
({ className, max, images, value, onValueChange, ...props }, ref) => /* @__PURE__ */ jsx41(
|
|
2746
2784
|
ToggleGroupPrimitive2.Root,
|
|
2747
2785
|
{
|
|
2748
2786
|
ref,
|
|
@@ -2754,17 +2792,17 @@ var ImageThumbnails = React39.forwardRef(
|
|
|
2754
2792
|
children: Array.from({ length: max }, (_, index) => {
|
|
2755
2793
|
const image = images[index];
|
|
2756
2794
|
if (!image) {
|
|
2757
|
-
return /* @__PURE__ */
|
|
2795
|
+
return /* @__PURE__ */ jsx41(
|
|
2758
2796
|
"span",
|
|
2759
2797
|
{
|
|
2760
2798
|
"aria-hidden": "true",
|
|
2761
2799
|
className: "flex h-20 min-w-0 flex-1 items-center justify-center rounded-sm border border-dashed border-border text-accent-foreground",
|
|
2762
|
-
children: /* @__PURE__ */
|
|
2800
|
+
children: /* @__PURE__ */ jsx41(ImageIcon, { size: 24 })
|
|
2763
2801
|
},
|
|
2764
2802
|
`empty-${index}`
|
|
2765
2803
|
);
|
|
2766
2804
|
}
|
|
2767
|
-
return /* @__PURE__ */
|
|
2805
|
+
return /* @__PURE__ */ jsx41(
|
|
2768
2806
|
ToggleGroupPrimitive2.Item,
|
|
2769
2807
|
{
|
|
2770
2808
|
value: image.id,
|
|
@@ -2774,7 +2812,7 @@ var ImageThumbnails = React39.forwardRef(
|
|
|
2774
2812
|
"hover:bg-accent-soft hover:bg-none",
|
|
2775
2813
|
"data-[state=on]:border-accent-foreground data-[state=on]:bg-accent-soft data-[state=on]:bg-none data-[state=on]:text-accent-foreground"
|
|
2776
2814
|
),
|
|
2777
|
-
children: image.src ? /* @__PURE__ */
|
|
2815
|
+
children: image.src ? /* @__PURE__ */ jsx41("img", { src: image.src, alt: "", className: "size-full object-cover" }) : /* @__PURE__ */ jsx41(ImageIcon, { size: 24, "aria-hidden": true })
|
|
2778
2816
|
},
|
|
2779
2817
|
image.id
|
|
2780
2818
|
);
|
|
@@ -2787,13 +2825,13 @@ var formatTime = (seconds) => {
|
|
|
2787
2825
|
const total = Math.max(0, Math.floor(Number.isFinite(seconds) ? seconds : 0));
|
|
2788
2826
|
return `${Math.floor(total / 60)}:${String(total % 60).padStart(2, "0")}`;
|
|
2789
2827
|
};
|
|
2790
|
-
var VideoPlayer =
|
|
2828
|
+
var VideoPlayer = React40.forwardRef(
|
|
2791
2829
|
({ className, src, name, details, onRemove, onMore, initialTime = 0, initialDuration = 0, ...props }, ref) => {
|
|
2792
|
-
const video =
|
|
2793
|
-
const [playing, setPlaying] =
|
|
2794
|
-
const [time, setTime] =
|
|
2795
|
-
const [duration, setDuration] =
|
|
2796
|
-
const [volume, setVolume] =
|
|
2830
|
+
const video = React40.useRef(null);
|
|
2831
|
+
const [playing, setPlaying] = React40.useState(false);
|
|
2832
|
+
const [time, setTime] = React40.useState(initialTime);
|
|
2833
|
+
const [duration, setDuration] = React40.useState(initialDuration);
|
|
2834
|
+
const [volume, setVolume] = React40.useState(1);
|
|
2797
2835
|
const muted = volume === 0;
|
|
2798
2836
|
const toggle2 = () => {
|
|
2799
2837
|
const el = video.current;
|
|
@@ -2801,9 +2839,9 @@ var VideoPlayer = React39.forwardRef(
|
|
|
2801
2839
|
if (el.paused) void el.play();
|
|
2802
2840
|
else el.pause();
|
|
2803
2841
|
};
|
|
2804
|
-
return /* @__PURE__ */
|
|
2805
|
-
/* @__PURE__ */
|
|
2806
|
-
src && /* @__PURE__ */
|
|
2842
|
+
return /* @__PURE__ */ jsxs31("div", { ref, className: cn("flex w-full flex-col overflow-hidden rounded-lg border border-border bg-surface", className), ...props, children: [
|
|
2843
|
+
/* @__PURE__ */ jsxs31("div", { className: "relative flex h-60.5 w-full items-end bg-accent-soft", children: [
|
|
2844
|
+
src && /* @__PURE__ */ jsx41(
|
|
2807
2845
|
"video",
|
|
2808
2846
|
{
|
|
2809
2847
|
ref: video,
|
|
@@ -2816,8 +2854,8 @@ var VideoPlayer = React39.forwardRef(
|
|
|
2816
2854
|
onVolumeChange: (event) => setVolume(event.currentTarget.muted ? 0 : event.currentTarget.volume)
|
|
2817
2855
|
}
|
|
2818
2856
|
),
|
|
2819
|
-
/* @__PURE__ */
|
|
2820
|
-
/* @__PURE__ */
|
|
2857
|
+
/* @__PURE__ */ jsxs31("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: [
|
|
2858
|
+
/* @__PURE__ */ jsxs31(
|
|
2821
2859
|
SliderPrimitive2.Root,
|
|
2822
2860
|
{
|
|
2823
2861
|
min: 0,
|
|
@@ -2831,31 +2869,31 @@ var VideoPlayer = React39.forwardRef(
|
|
|
2831
2869
|
},
|
|
2832
2870
|
className: "relative flex h-4 w-full touch-none items-center select-none",
|
|
2833
2871
|
children: [
|
|
2834
|
-
/* @__PURE__ */
|
|
2835
|
-
/* @__PURE__ */
|
|
2872
|
+
/* @__PURE__ */ jsx41(SliderPrimitive2.Track, { className: "relative h-1 w-full grow overflow-hidden rounded-xxs bg-surface/20", children: /* @__PURE__ */ jsx41(SliderPrimitive2.Range, { className: "absolute h-full bg-accent-foreground" }) }),
|
|
2873
|
+
/* @__PURE__ */ jsx41(SliderPrimitive2.Thumb, { "aria-label": "Seek", className: "block size-3 rounded-full border-2 border-surface bg-surface shadow-sm" })
|
|
2836
2874
|
]
|
|
2837
2875
|
}
|
|
2838
2876
|
),
|
|
2839
|
-
/* @__PURE__ */
|
|
2840
|
-
/* @__PURE__ */
|
|
2841
|
-
/* @__PURE__ */
|
|
2877
|
+
/* @__PURE__ */ jsxs31("div", { className: "flex items-center justify-between", children: [
|
|
2878
|
+
/* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-4", children: [
|
|
2879
|
+
/* @__PURE__ */ jsx41(
|
|
2842
2880
|
"button",
|
|
2843
2881
|
{
|
|
2844
2882
|
type: "button",
|
|
2845
2883
|
"aria-label": playing ? "Pause" : "Play",
|
|
2846
2884
|
onClick: toggle2,
|
|
2847
2885
|
className: "inline-flex size-10 items-center justify-center rounded-full bg-surface/12 text-surface transition-colors hover:bg-surface/20",
|
|
2848
|
-
children: playing ? /* @__PURE__ */
|
|
2886
|
+
children: playing ? /* @__PURE__ */ jsx41(Pause, { size: 16, weight: "fill", "aria-hidden": true }) : /* @__PURE__ */ jsx41(Play, { size: 16, weight: "fill", "aria-hidden": true })
|
|
2849
2887
|
}
|
|
2850
2888
|
),
|
|
2851
|
-
/* @__PURE__ */
|
|
2889
|
+
/* @__PURE__ */ jsxs31("span", { className: "text-ui-label whitespace-nowrap text-surface/80", children: [
|
|
2852
2890
|
formatTime(time),
|
|
2853
2891
|
" / ",
|
|
2854
2892
|
formatTime(duration)
|
|
2855
2893
|
] })
|
|
2856
2894
|
] }),
|
|
2857
|
-
/* @__PURE__ */
|
|
2858
|
-
/* @__PURE__ */
|
|
2895
|
+
/* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-2", children: [
|
|
2896
|
+
/* @__PURE__ */ jsx41(
|
|
2859
2897
|
VolumeControl,
|
|
2860
2898
|
{
|
|
2861
2899
|
volume,
|
|
@@ -2868,41 +2906,41 @@ var VideoPlayer = React39.forwardRef(
|
|
|
2868
2906
|
}
|
|
2869
2907
|
}
|
|
2870
2908
|
),
|
|
2871
|
-
/* @__PURE__ */
|
|
2909
|
+
/* @__PURE__ */ jsx41(
|
|
2872
2910
|
"button",
|
|
2873
2911
|
{
|
|
2874
2912
|
type: "button",
|
|
2875
2913
|
"aria-label": "Full screen",
|
|
2876
2914
|
onClick: () => void video.current?.requestFullscreen?.(),
|
|
2877
2915
|
className: "inline-flex size-10 items-center justify-center rounded-md text-surface transition-colors hover:bg-surface/12",
|
|
2878
|
-
children: /* @__PURE__ */
|
|
2916
|
+
children: /* @__PURE__ */ jsx41(CornersOut, { size: 16, "aria-hidden": true })
|
|
2879
2917
|
}
|
|
2880
2918
|
),
|
|
2881
|
-
/* @__PURE__ */
|
|
2919
|
+
/* @__PURE__ */ jsx41(
|
|
2882
2920
|
"button",
|
|
2883
2921
|
{
|
|
2884
2922
|
type: "button",
|
|
2885
2923
|
"aria-label": "More",
|
|
2886
2924
|
onClick: onMore,
|
|
2887
2925
|
className: "inline-flex size-10 items-center justify-center rounded-md text-surface transition-colors hover:bg-surface/12",
|
|
2888
|
-
children: /* @__PURE__ */
|
|
2926
|
+
children: /* @__PURE__ */ jsx41(DotsThree, { size: 16, "aria-hidden": true })
|
|
2889
2927
|
}
|
|
2890
2928
|
)
|
|
2891
2929
|
] })
|
|
2892
2930
|
] })
|
|
2893
2931
|
] })
|
|
2894
2932
|
] }),
|
|
2895
|
-
name && /* @__PURE__ */
|
|
2896
|
-
/* @__PURE__ */
|
|
2933
|
+
name && /* @__PURE__ */ jsx41(MediaInfo, { name, details, onRemove }),
|
|
2934
|
+
/* @__PURE__ */ jsx41("span", { className: "sr-only", "aria-live": "polite", children: muted ? "Muted" : "" })
|
|
2897
2935
|
] });
|
|
2898
2936
|
}
|
|
2899
2937
|
);
|
|
2900
2938
|
VideoPlayer.displayName = "VideoPlayer";
|
|
2901
2939
|
function VolumeControl({ volume, onVolumeChange, className }) {
|
|
2902
|
-
const last =
|
|
2940
|
+
const last = React40.useRef(volume || 1);
|
|
2903
2941
|
if (volume > 0) last.current = volume;
|
|
2904
|
-
return /* @__PURE__ */
|
|
2905
|
-
/* @__PURE__ */
|
|
2942
|
+
return /* @__PURE__ */ jsxs31("div", { className: cn("group/volume flex items-center", className), children: [
|
|
2943
|
+
/* @__PURE__ */ jsx41("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__ */ jsxs31(
|
|
2906
2944
|
SliderPrimitive2.Root,
|
|
2907
2945
|
{
|
|
2908
2946
|
min: 0,
|
|
@@ -2912,32 +2950,32 @@ function VolumeControl({ volume, onVolumeChange, className }) {
|
|
|
2912
2950
|
onValueChange: ([next]) => next !== void 0 && onVolumeChange(next),
|
|
2913
2951
|
className: "relative flex h-4 w-14 touch-none items-center select-none",
|
|
2914
2952
|
children: [
|
|
2915
|
-
/* @__PURE__ */
|
|
2916
|
-
/* @__PURE__ */
|
|
2953
|
+
/* @__PURE__ */ jsx41(SliderPrimitive2.Track, { className: "relative h-1 w-full grow overflow-hidden rounded-xxs bg-surface/20", children: /* @__PURE__ */ jsx41(SliderPrimitive2.Range, { className: "absolute h-full bg-surface" }) }),
|
|
2954
|
+
/* @__PURE__ */ jsx41(SliderPrimitive2.Thumb, { "aria-label": "Volume", className: "block size-3 rounded-full bg-surface shadow-sm" })
|
|
2917
2955
|
]
|
|
2918
2956
|
}
|
|
2919
2957
|
) }),
|
|
2920
|
-
/* @__PURE__ */
|
|
2958
|
+
/* @__PURE__ */ jsx41(
|
|
2921
2959
|
"button",
|
|
2922
2960
|
{
|
|
2923
2961
|
type: "button",
|
|
2924
2962
|
"aria-label": volume === 0 ? "Unmute" : "Mute",
|
|
2925
2963
|
onClick: () => onVolumeChange(volume === 0 ? last.current : 0),
|
|
2926
2964
|
className: "inline-flex size-10 items-center justify-center rounded-md text-surface transition-colors hover:bg-surface/12",
|
|
2927
|
-
children: volume === 0 ? /* @__PURE__ */
|
|
2965
|
+
children: volume === 0 ? /* @__PURE__ */ jsx41(SpeakerSimpleX, { size: 16, "aria-hidden": true }) : /* @__PURE__ */ jsx41(SpeakerSimpleHigh, { size: 16, "aria-hidden": true })
|
|
2928
2966
|
}
|
|
2929
2967
|
)
|
|
2930
2968
|
] });
|
|
2931
2969
|
}
|
|
2932
2970
|
|
|
2933
2971
|
// src/components/Question Types/OpenEndAnswer.tsx
|
|
2934
|
-
import * as
|
|
2935
|
-
import { jsx as
|
|
2936
|
-
var OpenEndAnswer =
|
|
2972
|
+
import * as React41 from "react";
|
|
2973
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
2974
|
+
var OpenEndAnswer = React41.forwardRef(
|
|
2937
2975
|
({ value, defaultValue, onChange, maxLength = 1e3, placeholder = "Write your answer", ...props }, ref) => {
|
|
2938
|
-
const [internal, setInternal] =
|
|
2976
|
+
const [internal, setInternal] = React41.useState(String(defaultValue ?? ""));
|
|
2939
2977
|
const text = value !== void 0 ? String(value) : internal;
|
|
2940
|
-
return /* @__PURE__ */
|
|
2978
|
+
return /* @__PURE__ */ jsx42(
|
|
2941
2979
|
Textarea,
|
|
2942
2980
|
{
|
|
2943
2981
|
ref,
|
|
@@ -2957,10 +2995,10 @@ var OpenEndAnswer = React40.forwardRef(
|
|
|
2957
2995
|
OpenEndAnswer.displayName = "OpenEndAnswer";
|
|
2958
2996
|
|
|
2959
2997
|
// src/components/Question Types/QuestionCard.tsx
|
|
2960
|
-
import * as
|
|
2961
|
-
import { jsx as
|
|
2962
|
-
var QuestionCard =
|
|
2963
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
2998
|
+
import * as React42 from "react";
|
|
2999
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
3000
|
+
var QuestionCard = React42.forwardRef(
|
|
3001
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx43(
|
|
2964
3002
|
"div",
|
|
2965
3003
|
{
|
|
2966
3004
|
ref,
|
|
@@ -2972,7 +3010,7 @@ var QuestionCard = React41.forwardRef(
|
|
|
2972
3010
|
QuestionCard.displayName = "QuestionCard";
|
|
2973
3011
|
|
|
2974
3012
|
// src/components/Question Types/QuestionEditorCard.tsx
|
|
2975
|
-
import * as
|
|
3013
|
+
import * as React46 from "react";
|
|
2976
3014
|
import {
|
|
2977
3015
|
Clipboard,
|
|
2978
3016
|
Copy,
|
|
@@ -2992,16 +3030,16 @@ function keepEditingFocus(event) {
|
|
|
2992
3030
|
}
|
|
2993
3031
|
|
|
2994
3032
|
// src/components/Question Types/QuestionHeader.tsx
|
|
2995
|
-
import * as
|
|
3033
|
+
import * as React45 from "react";
|
|
2996
3034
|
|
|
2997
3035
|
// src/components/Question Types/QuestionNumberTag.tsx
|
|
2998
|
-
import * as
|
|
3036
|
+
import * as React44 from "react";
|
|
2999
3037
|
import { DotsSixVertical } from "@phosphor-icons/react";
|
|
3000
3038
|
|
|
3001
3039
|
// src/components/Question Types/QuestionTypeIcon.tsx
|
|
3002
3040
|
import "react";
|
|
3003
3041
|
import { ChatsCircle, CheckSquare, FileArrowUp, FileText as FileText2, Image, ListNumbers, RadioButton as RadioButton2, StarHalf, VideoCamera } from "@phosphor-icons/react";
|
|
3004
|
-
import { jsx as
|
|
3042
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
3005
3043
|
var icons = {
|
|
3006
3044
|
"select-one": RadioButton2,
|
|
3007
3045
|
"select-multiple": CheckSquare,
|
|
@@ -3016,13 +3054,13 @@ var icons = {
|
|
|
3016
3054
|
};
|
|
3017
3055
|
function QuestionTypeIcon({ type, size = 22.5, className, ...props }) {
|
|
3018
3056
|
const Icon = icons[type];
|
|
3019
|
-
return /* @__PURE__ */
|
|
3057
|
+
return /* @__PURE__ */ jsx44(Icon, { size, weight: "duotone", "aria-hidden": true, className: className ?? "text-accent-foreground", ...props });
|
|
3020
3058
|
}
|
|
3021
3059
|
|
|
3022
3060
|
// src/components/Question Types/QuestionNumberTag.tsx
|
|
3023
|
-
import { jsx as
|
|
3024
|
-
var QuestionNumberTag =
|
|
3025
|
-
({ number, active, questionType, showDragHandle = true, dragHandleProps, className, ...props }, ref) => /* @__PURE__ */
|
|
3061
|
+
import { jsx as jsx45, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3062
|
+
var QuestionNumberTag = React44.forwardRef(
|
|
3063
|
+
({ number, active, questionType, showDragHandle = true, dragHandleProps, className, ...props }, ref) => /* @__PURE__ */ jsxs32(
|
|
3026
3064
|
"span",
|
|
3027
3065
|
{
|
|
3028
3066
|
ref,
|
|
@@ -3041,7 +3079,7 @@ var QuestionNumberTag = React43.forwardRef(
|
|
|
3041
3079
|
dragHandleProps?.className
|
|
3042
3080
|
),
|
|
3043
3081
|
children: [
|
|
3044
|
-
questionType && /* @__PURE__ */
|
|
3082
|
+
questionType && /* @__PURE__ */ jsx45(
|
|
3045
3083
|
QuestionTypeIcon,
|
|
3046
3084
|
{
|
|
3047
3085
|
type: questionType,
|
|
@@ -3049,7 +3087,7 @@ var QuestionNumberTag = React43.forwardRef(
|
|
|
3049
3087
|
className: cn("shrink-0", showDragHandle && "group-hover/editor:hidden group-data-[hovered]/editor:hidden group-hover/handle:hidden group-focus-visible/handle:hidden")
|
|
3050
3088
|
}
|
|
3051
3089
|
),
|
|
3052
|
-
showDragHandle && /* @__PURE__ */
|
|
3090
|
+
showDragHandle && /* @__PURE__ */ jsx45(
|
|
3053
3091
|
DotsSixVertical,
|
|
3054
3092
|
{
|
|
3055
3093
|
size: 16,
|
|
@@ -3066,30 +3104,30 @@ var QuestionNumberTag = React43.forwardRef(
|
|
|
3066
3104
|
QuestionNumberTag.displayName = "QuestionNumberTag";
|
|
3067
3105
|
|
|
3068
3106
|
// src/components/Question Types/QuestionHeader.tsx
|
|
3069
|
-
import { jsx as
|
|
3107
|
+
import { jsx as jsx46, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
3070
3108
|
var eyebrow = "text-ui-caption uppercase text-secondary-muted-foreground";
|
|
3071
|
-
var QuestionHeader =
|
|
3109
|
+
var QuestionHeader = React45.forwardRef(
|
|
3072
3110
|
({ 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, titleEditing, ...props }, ref) => {
|
|
3073
|
-
const [draft, setDraft] =
|
|
3111
|
+
const [draft, setDraft] = React45.useState(null);
|
|
3074
3112
|
const label = String(number).padStart(2, "0");
|
|
3075
3113
|
const showError = error !== void 0 && error !== false;
|
|
3076
3114
|
if (editor) {
|
|
3077
3115
|
const text = typeof title === "string" ? title : "";
|
|
3078
3116
|
const count = (draft ?? text).length;
|
|
3079
3117
|
const long = titleRecommendedMax !== void 0 && count > titleRecommendedMax;
|
|
3080
|
-
return /* @__PURE__ */
|
|
3081
|
-
/* @__PURE__ */
|
|
3082
|
-
/* @__PURE__ */
|
|
3083
|
-
/* @__PURE__ */
|
|
3118
|
+
return /* @__PURE__ */ jsxs33("div", { ref, className: cn("group/header flex w-full flex-col gap-2", className), ...props, children: [
|
|
3119
|
+
/* @__PURE__ */ jsxs33("div", { className: "flex items-center justify-between", children: [
|
|
3120
|
+
/* @__PURE__ */ jsxs33("div", { className: "flex items-center gap-2", children: [
|
|
3121
|
+
/* @__PURE__ */ jsx46(QuestionNumberTag, { number, active, questionType, showDragHandle, dragHandleProps }),
|
|
3084
3122
|
meta
|
|
3085
3123
|
] }),
|
|
3086
|
-
actions && /* @__PURE__ */
|
|
3124
|
+
actions && /* @__PURE__ */ jsx46("div", { className: cn(
|
|
3087
3125
|
"flex items-center gap-2 opacity-0 transition-opacity group-focus-within/header:opacity-100 group-hover/header:opacity-100",
|
|
3088
3126
|
// Inside a QuestionEditorCard, hovering or focusing anywhere on the card reveals them too.
|
|
3089
3127
|
"group-focus-within/editor:opacity-100 group-hover/editor:opacity-100 group-data-[hovered]/editor:opacity-100"
|
|
3090
3128
|
), children: actions })
|
|
3091
3129
|
] }),
|
|
3092
|
-
/* @__PURE__ */
|
|
3130
|
+
/* @__PURE__ */ jsx46(
|
|
3093
3131
|
InlineEdit,
|
|
3094
3132
|
{
|
|
3095
3133
|
variant: "question",
|
|
@@ -3115,8 +3153,8 @@ var QuestionHeader = React44.forwardRef(
|
|
|
3115
3153
|
textClassName: long ? "text-body-base" : "text-heading-h4"
|
|
3116
3154
|
}
|
|
3117
3155
|
),
|
|
3118
|
-
long && titleRecommendedNote != null && /* @__PURE__ */
|
|
3119
|
-
showCounter && titleMinLength === void 0 && maxLength !== void 0 && count > maxLength && /* @__PURE__ */
|
|
3156
|
+
long && titleRecommendedNote != null && /* @__PURE__ */ jsx46("p", { className: "text-ui-caption text-secondary-muted-foreground", children: titleRecommendedNote }),
|
|
3157
|
+
showCounter && titleMinLength === void 0 && maxLength !== void 0 && count > maxLength && /* @__PURE__ */ jsxs33("p", { className: "text-ui-caption text-secondary-muted-foreground", children: [
|
|
3120
3158
|
count,
|
|
3121
3159
|
"/",
|
|
3122
3160
|
maxLength,
|
|
@@ -3124,16 +3162,16 @@ var QuestionHeader = React44.forwardRef(
|
|
|
3124
3162
|
] })
|
|
3125
3163
|
] });
|
|
3126
3164
|
}
|
|
3127
|
-
return /* @__PURE__ */
|
|
3128
|
-
showError && /* @__PURE__ */
|
|
3129
|
-
/* @__PURE__ */
|
|
3165
|
+
return /* @__PURE__ */ jsxs33("div", { ref, className: cn("flex w-full flex-col gap-2", className), ...props, children: [
|
|
3166
|
+
showError && /* @__PURE__ */ jsx46(ToastInline, { variant: "destructive", onClose: onDismissError, className: "min-h-10", children: /* @__PURE__ */ jsx46("span", { className: "text-ui-label text-destructive", children: error === true ? "This question is mandatory." : error }) }),
|
|
3167
|
+
/* @__PURE__ */ jsxs33("p", { className: eyebrow, children: [
|
|
3130
3168
|
"Question ",
|
|
3131
3169
|
label
|
|
3132
3170
|
] }),
|
|
3133
|
-
/* @__PURE__ */
|
|
3171
|
+
/* @__PURE__ */ jsxs33("h3", { className: "text-heading-h4 text-surface-foreground", children: [
|
|
3134
3172
|
title,
|
|
3135
|
-
required && /* @__PURE__ */
|
|
3136
|
-
required && /* @__PURE__ */
|
|
3173
|
+
required && /* @__PURE__ */ jsx46("span", { "aria-hidden": "true", className: "text-destructive", children: "*" }),
|
|
3174
|
+
required && /* @__PURE__ */ jsx46("span", { className: "sr-only", children: " (required)" })
|
|
3137
3175
|
] })
|
|
3138
3176
|
] });
|
|
3139
3177
|
}
|
|
@@ -3141,8 +3179,8 @@ var QuestionHeader = React44.forwardRef(
|
|
|
3141
3179
|
QuestionHeader.displayName = "QuestionHeader";
|
|
3142
3180
|
|
|
3143
3181
|
// src/components/Question Types/QuestionEditorCard.tsx
|
|
3144
|
-
import { Fragment as Fragment11, jsx as
|
|
3145
|
-
var QuestionEditorCard =
|
|
3182
|
+
import { Fragment as Fragment11, jsx as jsx47, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
3183
|
+
var QuestionEditorCard = React46.forwardRef(
|
|
3146
3184
|
({
|
|
3147
3185
|
className,
|
|
3148
3186
|
number,
|
|
@@ -3178,7 +3216,7 @@ var QuestionEditorCard = React45.forwardRef(
|
|
|
3178
3216
|
...props
|
|
3179
3217
|
}, ref) => {
|
|
3180
3218
|
const footer = active && (countLabel != null || onAdd || onPaste);
|
|
3181
|
-
return /* @__PURE__ */
|
|
3219
|
+
return /* @__PURE__ */ jsxs34(
|
|
3182
3220
|
"div",
|
|
3183
3221
|
{
|
|
3184
3222
|
ref,
|
|
@@ -3190,7 +3228,7 @@ var QuestionEditorCard = React45.forwardRef(
|
|
|
3190
3228
|
props.onMouseDown?.(event);
|
|
3191
3229
|
},
|
|
3192
3230
|
children: [
|
|
3193
|
-
/* @__PURE__ */
|
|
3231
|
+
/* @__PURE__ */ jsxs34(
|
|
3194
3232
|
"div",
|
|
3195
3233
|
{
|
|
3196
3234
|
className: cn(
|
|
@@ -3198,9 +3236,9 @@ var QuestionEditorCard = React45.forwardRef(
|
|
|
3198
3236
|
active ? "border-accent" : "border-border"
|
|
3199
3237
|
),
|
|
3200
3238
|
children: [
|
|
3201
|
-
/* @__PURE__ */
|
|
3202
|
-
/* @__PURE__ */
|
|
3203
|
-
/* @__PURE__ */
|
|
3239
|
+
/* @__PURE__ */ jsxs34("div", { className: cn("flex flex-col p-6", footer ? "gap-5" : "gap-4"), children: [
|
|
3240
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex flex-col gap-4", children: [
|
|
3241
|
+
/* @__PURE__ */ jsx47(
|
|
3204
3242
|
QuestionHeader,
|
|
3205
3243
|
{
|
|
3206
3244
|
editor: true,
|
|
@@ -3223,8 +3261,8 @@ var QuestionEditorCard = React45.forwardRef(
|
|
|
3223
3261
|
titleEditing,
|
|
3224
3262
|
meta,
|
|
3225
3263
|
maxLength,
|
|
3226
|
-
actions: actions ?? /* @__PURE__ */
|
|
3227
|
-
/* @__PURE__ */
|
|
3264
|
+
actions: actions ?? /* @__PURE__ */ jsxs34(Fragment11, { children: [
|
|
3265
|
+
/* @__PURE__ */ jsx47(
|
|
3228
3266
|
Button,
|
|
3229
3267
|
{
|
|
3230
3268
|
type: "button",
|
|
@@ -3232,10 +3270,10 @@ var QuestionEditorCard = React45.forwardRef(
|
|
|
3232
3270
|
size: "icon-sm",
|
|
3233
3271
|
"aria-label": "Duplicate question",
|
|
3234
3272
|
onClick: onDuplicate,
|
|
3235
|
-
children: /* @__PURE__ */
|
|
3273
|
+
children: /* @__PURE__ */ jsx47(Copy, { size: 16, "aria-hidden": true })
|
|
3236
3274
|
}
|
|
3237
3275
|
),
|
|
3238
|
-
/* @__PURE__ */
|
|
3276
|
+
/* @__PURE__ */ jsx47(
|
|
3239
3277
|
Button,
|
|
3240
3278
|
{
|
|
3241
3279
|
type: "button",
|
|
@@ -3243,10 +3281,10 @@ var QuestionEditorCard = React45.forwardRef(
|
|
|
3243
3281
|
size: "icon-sm",
|
|
3244
3282
|
"aria-label": "Delete question",
|
|
3245
3283
|
onClick: onDelete,
|
|
3246
|
-
children: /* @__PURE__ */
|
|
3284
|
+
children: /* @__PURE__ */ jsx47(Trash4, { size: 16, "aria-hidden": true })
|
|
3247
3285
|
}
|
|
3248
3286
|
),
|
|
3249
|
-
/* @__PURE__ */
|
|
3287
|
+
/* @__PURE__ */ jsx47(
|
|
3250
3288
|
Button,
|
|
3251
3289
|
{
|
|
3252
3290
|
type: "button",
|
|
@@ -3254,7 +3292,7 @@ var QuestionEditorCard = React45.forwardRef(
|
|
|
3254
3292
|
size: "icon-sm",
|
|
3255
3293
|
"aria-label": "Preview question",
|
|
3256
3294
|
onClick: onPreview,
|
|
3257
|
-
children: /* @__PURE__ */
|
|
3295
|
+
children: /* @__PURE__ */ jsx47(Eye, { size: 16, "aria-hidden": true })
|
|
3258
3296
|
}
|
|
3259
3297
|
)
|
|
3260
3298
|
] })
|
|
@@ -3262,18 +3300,18 @@ var QuestionEditorCard = React45.forwardRef(
|
|
|
3262
3300
|
),
|
|
3263
3301
|
children
|
|
3264
3302
|
] }),
|
|
3265
|
-
error && /* @__PURE__ */
|
|
3266
|
-
/* @__PURE__ */
|
|
3303
|
+
error && /* @__PURE__ */ jsxs34("p", { className: "flex items-center gap-1 text-ui-caption text-destructive-foreground", children: [
|
|
3304
|
+
/* @__PURE__ */ jsx47(Warning2, { size: 16, "aria-hidden": true, className: "shrink-0" }),
|
|
3267
3305
|
error
|
|
3268
3306
|
] }),
|
|
3269
|
-
footer && /* @__PURE__ */
|
|
3270
|
-
/* @__PURE__ */
|
|
3271
|
-
/* @__PURE__ */
|
|
3272
|
-
onAdd && /* @__PURE__ */
|
|
3273
|
-
/* @__PURE__ */
|
|
3307
|
+
footer && /* @__PURE__ */ jsxs34("div", { className: "flex items-center justify-between", children: [
|
|
3308
|
+
/* @__PURE__ */ jsx47("p", { className: "text-ui-caption text-secondary-muted-foreground", children: countLabel }),
|
|
3309
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex items-center gap-2", children: [
|
|
3310
|
+
onAdd && /* @__PURE__ */ jsxs34(Button, { type: "button", variant: "outline", onClick: onAdd, children: [
|
|
3311
|
+
/* @__PURE__ */ jsx47(Plus3, { size: 16, "aria-hidden": true }),
|
|
3274
3312
|
"Add choice"
|
|
3275
3313
|
] }),
|
|
3276
|
-
onPaste && /* @__PURE__ */
|
|
3314
|
+
onPaste && /* @__PURE__ */ jsx47(
|
|
3277
3315
|
Button,
|
|
3278
3316
|
{
|
|
3279
3317
|
type: "button",
|
|
@@ -3281,17 +3319,17 @@ var QuestionEditorCard = React45.forwardRef(
|
|
|
3281
3319
|
size: "icon",
|
|
3282
3320
|
"aria-label": "Paste choices",
|
|
3283
3321
|
onClick: onPaste,
|
|
3284
|
-
children: /* @__PURE__ */
|
|
3322
|
+
children: /* @__PURE__ */ jsx47(Clipboard, { size: 16, "aria-hidden": true })
|
|
3285
3323
|
}
|
|
3286
3324
|
)
|
|
3287
3325
|
] })
|
|
3288
3326
|
] })
|
|
3289
3327
|
] }),
|
|
3290
|
-
note && /* @__PURE__ */
|
|
3328
|
+
note && /* @__PURE__ */ jsx47("div", { className: "border-t border-border px-2 py-2 text-body-small text-surface-foreground", children: note })
|
|
3291
3329
|
]
|
|
3292
3330
|
}
|
|
3293
3331
|
),
|
|
3294
|
-
onAskAi && /* @__PURE__ */
|
|
3332
|
+
onAskAi && /* @__PURE__ */ jsx47(
|
|
3295
3333
|
Button,
|
|
3296
3334
|
{
|
|
3297
3335
|
type: "button",
|
|
@@ -3300,7 +3338,7 @@ var QuestionEditorCard = React45.forwardRef(
|
|
|
3300
3338
|
"aria-label": "Ask AI",
|
|
3301
3339
|
onClick: onAskAi,
|
|
3302
3340
|
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",
|
|
3303
|
-
children: /* @__PURE__ */
|
|
3341
|
+
children: /* @__PURE__ */ jsx47(Sparkle2, { size: 16, "aria-hidden": true })
|
|
3304
3342
|
}
|
|
3305
3343
|
)
|
|
3306
3344
|
]
|
|
@@ -3311,15 +3349,15 @@ var QuestionEditorCard = React45.forwardRef(
|
|
|
3311
3349
|
QuestionEditorCard.displayName = "QuestionEditorCard";
|
|
3312
3350
|
|
|
3313
3351
|
// src/components/Question Types/QuestionNavItem.tsx
|
|
3314
|
-
import * as
|
|
3352
|
+
import * as React47 from "react";
|
|
3315
3353
|
import { DotsSixVertical as DotsSixVertical2, Warning as Warning3, WarningCircle as WarningCircle5 } from "@phosphor-icons/react";
|
|
3316
3354
|
import { Slot as Slot3 } from "radix-ui";
|
|
3317
|
-
import { jsx as
|
|
3318
|
-
var QuestionNavItem =
|
|
3355
|
+
import { jsx as jsx48, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
3356
|
+
var QuestionNavItem = React47.forwardRef(
|
|
3319
3357
|
({ className, questionType = "select-one", selected, error, warning, asChild, showDragHandle = true, hovered, children, ...props }, ref) => {
|
|
3320
3358
|
const Comp = asChild ? Slot3.Root : "button";
|
|
3321
3359
|
const warn = !error && !!warning;
|
|
3322
|
-
return /* @__PURE__ */
|
|
3360
|
+
return /* @__PURE__ */ jsxs35(
|
|
3323
3361
|
Comp,
|
|
3324
3362
|
{
|
|
3325
3363
|
ref,
|
|
@@ -3338,9 +3376,9 @@ var QuestionNavItem = React46.forwardRef(
|
|
|
3338
3376
|
),
|
|
3339
3377
|
...props,
|
|
3340
3378
|
children: [
|
|
3341
|
-
/* @__PURE__ */
|
|
3342
|
-
showDragHandle && /* @__PURE__ */
|
|
3343
|
-
/* @__PURE__ */
|
|
3379
|
+
/* @__PURE__ */ jsxs35("span", { "aria-hidden": "true", className: "relative flex size-4 shrink-0 items-center justify-center", children: [
|
|
3380
|
+
showDragHandle && /* @__PURE__ */ jsx48(DotsSixVertical2, { size: 16, className: "hidden group-hover/nav:block group-data-[hovered]/nav:block" }),
|
|
3381
|
+
/* @__PURE__ */ jsx48("span", { className: showDragHandle ? "group-hover/nav:hidden group-data-[hovered]/nav:hidden" : void 0, children: error ? /* @__PURE__ */ jsx48(WarningCircle5, { size: 16, className: "text-destructive-foreground" }) : warn ? /* @__PURE__ */ jsx48(Warning3, { size: 16, className: "text-warning-foreground" }) : /* @__PURE__ */ jsx48(
|
|
3344
3382
|
QuestionTypeIcon,
|
|
3345
3383
|
{
|
|
3346
3384
|
type: questionType,
|
|
@@ -3349,9 +3387,9 @@ var QuestionNavItem = React46.forwardRef(
|
|
|
3349
3387
|
}
|
|
3350
3388
|
) })
|
|
3351
3389
|
] }),
|
|
3352
|
-
/* @__PURE__ */
|
|
3353
|
-
error && /* @__PURE__ */
|
|
3354
|
-
warn && /* @__PURE__ */
|
|
3390
|
+
/* @__PURE__ */ jsx48("span", { className: "min-w-0 flex-1 truncate", children }),
|
|
3391
|
+
error && /* @__PURE__ */ jsx48("span", { className: "sr-only", children: ", has errors" }),
|
|
3392
|
+
warn && /* @__PURE__ */ jsx48("span", { className: "sr-only", children: ", has warnings" })
|
|
3355
3393
|
]
|
|
3356
3394
|
}
|
|
3357
3395
|
);
|
|
@@ -3360,14 +3398,14 @@ var QuestionNavItem = React46.forwardRef(
|
|
|
3360
3398
|
QuestionNavItem.displayName = "QuestionNavItem";
|
|
3361
3399
|
|
|
3362
3400
|
// src/components/Question Types/QuestionOption.tsx
|
|
3363
|
-
import * as
|
|
3401
|
+
import * as React48 from "react";
|
|
3364
3402
|
import { Check as Check4, DotsSixVertical as DotsSixVertical3, Plus as Plus4, Trash as Trash5, WarningCircle as WarningCircle6 } from "@phosphor-icons/react";
|
|
3365
|
-
import { Fragment as Fragment12, jsx as
|
|
3403
|
+
import { Fragment as Fragment12, jsx as jsx49, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
3366
3404
|
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";
|
|
3367
3405
|
function QuestionOption(props) {
|
|
3368
|
-
const id =
|
|
3369
|
-
return /* @__PURE__ */
|
|
3370
|
-
props.kind === "checkbox" ? /* @__PURE__ */
|
|
3406
|
+
const id = React48.useId();
|
|
3407
|
+
return /* @__PURE__ */ jsxs36("label", { htmlFor: id, className: cn(optionClasses, props.className), children: [
|
|
3408
|
+
props.kind === "checkbox" ? /* @__PURE__ */ jsx49(
|
|
3371
3409
|
Checkbox,
|
|
3372
3410
|
{
|
|
3373
3411
|
id,
|
|
@@ -3376,16 +3414,16 @@ function QuestionOption(props) {
|
|
|
3376
3414
|
onCheckedChange: (next) => props.onCheckedChange?.(next === true),
|
|
3377
3415
|
disabled: props.disabled
|
|
3378
3416
|
}
|
|
3379
|
-
) : /* @__PURE__ */
|
|
3380
|
-
/* @__PURE__ */
|
|
3417
|
+
) : /* @__PURE__ */ jsx49(RadioGroupItem, { id, value: props.value, disabled: props.disabled }),
|
|
3418
|
+
/* @__PURE__ */ jsx49("span", { className: "min-w-0 flex-1", children: props.label })
|
|
3381
3419
|
] });
|
|
3382
3420
|
}
|
|
3383
|
-
var QuestionOtherOption =
|
|
3421
|
+
var QuestionOtherOption = React48.forwardRef(
|
|
3384
3422
|
({ className, onSubmit, confirmLabel = "Confirm answer", placeholder = "Type your answer", ...props }, ref) => {
|
|
3385
|
-
const inner =
|
|
3386
|
-
|
|
3423
|
+
const inner = React48.useRef(null);
|
|
3424
|
+
React48.useImperativeHandle(ref, () => inner.current);
|
|
3387
3425
|
const submit = () => onSubmit?.(inner.current?.value ?? "");
|
|
3388
|
-
return /* @__PURE__ */
|
|
3426
|
+
return /* @__PURE__ */ jsxs36(
|
|
3389
3427
|
"div",
|
|
3390
3428
|
{
|
|
3391
3429
|
className: cn(
|
|
@@ -3393,7 +3431,7 @@ var QuestionOtherOption = React47.forwardRef(
|
|
|
3393
3431
|
className
|
|
3394
3432
|
),
|
|
3395
3433
|
children: [
|
|
3396
|
-
/* @__PURE__ */
|
|
3434
|
+
/* @__PURE__ */ jsx49(
|
|
3397
3435
|
"input",
|
|
3398
3436
|
{
|
|
3399
3437
|
ref: inner,
|
|
@@ -3409,7 +3447,7 @@ var QuestionOtherOption = React47.forwardRef(
|
|
|
3409
3447
|
...props
|
|
3410
3448
|
}
|
|
3411
3449
|
),
|
|
3412
|
-
/* @__PURE__ */
|
|
3450
|
+
/* @__PURE__ */ jsx49(Button, { type: "button", variant: "subtle", size: "icon-sm", "aria-label": confirmLabel, onClick: submit, children: /* @__PURE__ */ jsx49(Check4, { size: 16, "aria-hidden": true }) })
|
|
3413
3451
|
]
|
|
3414
3452
|
}
|
|
3415
3453
|
);
|
|
@@ -3424,16 +3462,16 @@ function limitsText2(min, max) {
|
|
|
3424
3462
|
function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTone = "muted", minLength, maxLength, onRemove, onAdd, removeDisabled, addDisabled, className, kind, rank, dragHandleProps, lifted, locked, marks, onMarkApply, onMarkDismiss }) {
|
|
3425
3463
|
const reveal = kind !== void 0;
|
|
3426
3464
|
const guarded = minLength !== void 0 || maxLength !== void 0;
|
|
3427
|
-
const [draft, setDraft] =
|
|
3428
|
-
const [error, setError] =
|
|
3429
|
-
const helperId =
|
|
3430
|
-
const [focused, setFocused] =
|
|
3465
|
+
const [draft, setDraft] = React48.useState(null);
|
|
3466
|
+
const [error, setError] = React48.useState(null);
|
|
3467
|
+
const helperId = React48.useId();
|
|
3468
|
+
const [focused, setFocused] = React48.useState(false);
|
|
3431
3469
|
const showMarks = !!marks?.length && !focused && draft === null;
|
|
3432
|
-
const fieldRef =
|
|
3433
|
-
const [editMarks, setEditMarks] =
|
|
3434
|
-
const [scroll, setScroll] =
|
|
3470
|
+
const fieldRef = React48.useRef(null);
|
|
3471
|
+
const [editMarks, setEditMarks] = React48.useState([]);
|
|
3472
|
+
const [scroll, setScroll] = React48.useState(0);
|
|
3435
3473
|
const typed = guarded ? draft ?? label : label;
|
|
3436
|
-
const skipBlur =
|
|
3474
|
+
const skipBlur = React48.useRef(false);
|
|
3437
3475
|
const problemWith = (text) => minLength !== void 0 && text.trim().length < minLength ? `Enter at least ${minLength} ${minLength === 1 ? "character" : "characters"}.` : null;
|
|
3438
3476
|
const save = () => {
|
|
3439
3477
|
if (draft === null) return true;
|
|
@@ -3454,9 +3492,9 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
|
|
|
3454
3492
|
...dragHandleProps,
|
|
3455
3493
|
className: cn("cursor-grab touch-none select-none", dragHandleProps.className)
|
|
3456
3494
|
} : { "aria-hidden": true };
|
|
3457
|
-
const grip = dragHandleProps ? /* @__PURE__ */
|
|
3458
|
-
return /* @__PURE__ */
|
|
3459
|
-
/* @__PURE__ */
|
|
3495
|
+
const grip = dragHandleProps ? /* @__PURE__ */ jsx49("span", { ...gripProps, className: cn("shrink-0", gripProps.className), children: /* @__PURE__ */ jsx49(DotsSixVertical3, { size: 20, "aria-hidden": true, className: "text-surface-foreground" }) }) : /* @__PURE__ */ jsx49(DotsSixVertical3, { size: 20, "aria-hidden": true, className: "shrink-0 text-surface-foreground" });
|
|
3496
|
+
return /* @__PURE__ */ jsxs36("div", { className: cn("group/option flex w-full items-center gap-2", className), children: [
|
|
3497
|
+
/* @__PURE__ */ jsx49(
|
|
3460
3498
|
"div",
|
|
3461
3499
|
{
|
|
3462
3500
|
className: cn(
|
|
@@ -3466,10 +3504,10 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
|
|
|
3466
3504
|
cn("border-border group-hover/option:shadow-md group-focus-within/option:shadow-md", lifted && "shadow-md")
|
|
3467
3505
|
) : "border-border hover:border-input-muted hover:shadow-md"
|
|
3468
3506
|
),
|
|
3469
|
-
children: /* @__PURE__ */
|
|
3470
|
-
(kind !== void 0 || !locked) && /* @__PURE__ */
|
|
3507
|
+
children: /* @__PURE__ */ jsxs36("div", { className: "flex min-w-0 items-start gap-2", children: [
|
|
3508
|
+
(kind !== void 0 || !locked) && /* @__PURE__ */ jsx49("div", { className: "flex h-7 shrink-0 items-center gap-2", children: kind === "rank" ? /* @__PURE__ */ jsxs36(Fragment12, { children: [
|
|
3471
3509
|
!locked && grip,
|
|
3472
|
-
/* @__PURE__ */
|
|
3510
|
+
/* @__PURE__ */ jsx49(
|
|
3473
3511
|
"span",
|
|
3474
3512
|
{
|
|
3475
3513
|
"aria-hidden": "true",
|
|
@@ -3477,8 +3515,8 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
|
|
|
3477
3515
|
children: rank
|
|
3478
3516
|
}
|
|
3479
3517
|
)
|
|
3480
|
-
] }) : reveal && locked ? /* @__PURE__ */
|
|
3481
|
-
/* @__PURE__ */
|
|
3518
|
+
] }) : reveal && locked ? /* @__PURE__ */ jsx49("span", { "aria-hidden": "true", className: "relative flex size-5 shrink-0 items-center justify-center", children: /* @__PURE__ */ jsx49("span", { className: cn("inline-flex size-4 border-2 border-input bg-surface", kind === "radio" ? "rounded-full" : "rounded-xxs") }) }) : reveal ? /* @__PURE__ */ jsxs36("span", { ...gripProps, className: cn("relative flex size-5 shrink-0 items-center justify-center", gripProps.className), children: [
|
|
3519
|
+
/* @__PURE__ */ jsx49(
|
|
3482
3520
|
"span",
|
|
3483
3521
|
{
|
|
3484
3522
|
"aria-hidden": "true",
|
|
@@ -3489,7 +3527,7 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
|
|
|
3489
3527
|
)
|
|
3490
3528
|
}
|
|
3491
3529
|
),
|
|
3492
|
-
/* @__PURE__ */
|
|
3530
|
+
/* @__PURE__ */ jsx49(
|
|
3493
3531
|
DotsSixVertical3,
|
|
3494
3532
|
{
|
|
3495
3533
|
size: 20,
|
|
@@ -3501,10 +3539,10 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
|
|
|
3501
3539
|
}
|
|
3502
3540
|
)
|
|
3503
3541
|
] }) : locked ? null : grip }),
|
|
3504
|
-
/* @__PURE__ */
|
|
3505
|
-
/* @__PURE__ */
|
|
3506
|
-
focused && editMarks.length > 0 && /* @__PURE__ */
|
|
3507
|
-
/* @__PURE__ */
|
|
3542
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
3543
|
+
/* @__PURE__ */ jsxs36("div", { className: "relative min-w-0", children: [
|
|
3544
|
+
focused && editMarks.length > 0 && /* @__PURE__ */ jsx49(DraftMarks, { layer: "behind", singleLine: true, text: typed, marks: editMarks, scrollLeft: scroll, className: "flex items-center whitespace-pre text-body-base" }),
|
|
3545
|
+
/* @__PURE__ */ jsx49(
|
|
3508
3546
|
"input",
|
|
3509
3547
|
{
|
|
3510
3548
|
ref: fieldRef,
|
|
@@ -3559,24 +3597,24 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
|
|
|
3559
3597
|
)
|
|
3560
3598
|
}
|
|
3561
3599
|
),
|
|
3562
|
-
focused && editMarks.length > 0 && /* @__PURE__ */
|
|
3563
|
-
showMarks && /* @__PURE__ */
|
|
3564
|
-
(piece, i) => piece.mark ? /* @__PURE__ */
|
|
3600
|
+
focused && editMarks.length > 0 && /* @__PURE__ */ jsx49(DraftMarks, { layer: "over", singleLine: true, text: typed, marks: editMarks, scrollLeft: scroll, className: "flex items-center whitespace-pre text-body-base" }),
|
|
3601
|
+
showMarks && /* @__PURE__ */ jsx49("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(
|
|
3602
|
+
(piece, i) => piece.mark ? /* @__PURE__ */ jsx49(MarkedText, { mark: piece.mark, text: piece.text, onApply: onMarkApply, onDismiss: onMarkDismiss }, `${piece.mark.start}:${piece.text}`) : /* @__PURE__ */ jsx49("span", { children: piece.text }, i)
|
|
3565
3603
|
) })
|
|
3566
3604
|
] }),
|
|
3567
|
-
guarded && draft !== null && (error || lengthOutOfRange(draft, minLength, maxLength)) && /* @__PURE__ */
|
|
3605
|
+
guarded && draft !== null && (error || lengthOutOfRange(draft, minLength, maxLength)) && /* @__PURE__ */ jsxs36(
|
|
3568
3606
|
"p",
|
|
3569
3607
|
{
|
|
3570
3608
|
id: helperId,
|
|
3571
3609
|
role: error ? "alert" : void 0,
|
|
3572
3610
|
className: cn("flex items-start justify-between gap-2 text-ui-caption", error ? "text-destructive" : "text-secondary-muted-foreground"),
|
|
3573
3611
|
children: [
|
|
3574
|
-
/* @__PURE__ */
|
|
3575
|
-
error && /* @__PURE__ */
|
|
3612
|
+
/* @__PURE__ */ jsxs36("span", { className: "flex items-start gap-2", children: [
|
|
3613
|
+
error && /* @__PURE__ */ jsx49(WarningCircle6, { size: 16, "aria-hidden": true, className: "shrink-0" }),
|
|
3576
3614
|
limitsText2(minLength, maxLength),
|
|
3577
|
-
error && /* @__PURE__ */
|
|
3615
|
+
error && /* @__PURE__ */ jsx49("span", { className: "sr-only", children: error })
|
|
3578
3616
|
] }),
|
|
3579
|
-
/* @__PURE__ */
|
|
3617
|
+
/* @__PURE__ */ jsxs36("span", { "aria-hidden": true, className: "shrink-0 tabular-nums", children: [
|
|
3580
3618
|
draft.length,
|
|
3581
3619
|
maxLength !== void 0 && `/${maxLength}`
|
|
3582
3620
|
] })
|
|
@@ -3587,7 +3625,7 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
|
|
|
3587
3625
|
] })
|
|
3588
3626
|
}
|
|
3589
3627
|
),
|
|
3590
|
-
!locked && /* @__PURE__ */
|
|
3628
|
+
!locked && /* @__PURE__ */ jsxs36(
|
|
3591
3629
|
"div",
|
|
3592
3630
|
{
|
|
3593
3631
|
className: cn(
|
|
@@ -3595,8 +3633,8 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
|
|
|
3595
3633
|
reveal && "opacity-0 transition-opacity group-hover/option:opacity-100 group-focus-within/option:opacity-100"
|
|
3596
3634
|
),
|
|
3597
3635
|
children: [
|
|
3598
|
-
/* @__PURE__ */
|
|
3599
|
-
/* @__PURE__ */
|
|
3636
|
+
/* @__PURE__ */ jsx49(Button, { type: "button", variant: "destructive", size: "icon-sm", "aria-label": "Remove option", disabled: removeDisabled, onClick: onRemove, children: /* @__PURE__ */ jsx49(Trash5, { size: 16, "aria-hidden": true }) }),
|
|
3637
|
+
/* @__PURE__ */ jsx49(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": "Add option", disabled: addDisabled, onClick: onAdd, children: /* @__PURE__ */ jsx49(Plus4, { size: 16, "aria-hidden": true }) })
|
|
3600
3638
|
]
|
|
3601
3639
|
}
|
|
3602
3640
|
)
|
|
@@ -3604,9 +3642,9 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
|
|
|
3604
3642
|
}
|
|
3605
3643
|
|
|
3606
3644
|
// src/components/Question Types/RankList.tsx
|
|
3607
|
-
import * as
|
|
3645
|
+
import * as React49 from "react";
|
|
3608
3646
|
import { DotsSixVertical as DotsSixVertical4 } from "@phosphor-icons/react";
|
|
3609
|
-
import { Fragment as Fragment13, jsx as
|
|
3647
|
+
import { Fragment as Fragment13, jsx as jsx50, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
3610
3648
|
function move(list, from, to) {
|
|
3611
3649
|
if (from === to || to < 0 || to >= list.length) return list;
|
|
3612
3650
|
const next = list.slice();
|
|
@@ -3614,13 +3652,13 @@ function move(list, from, to) {
|
|
|
3614
3652
|
next.splice(to, 0, item);
|
|
3615
3653
|
return next;
|
|
3616
3654
|
}
|
|
3617
|
-
var RankList =
|
|
3655
|
+
var RankList = React49.forwardRef(
|
|
3618
3656
|
({ className, items, onItemsChange, ...props }, ref) => {
|
|
3619
|
-
const [dragIndex, setDragIndex] =
|
|
3620
|
-
const [announcement, setAnnouncement] =
|
|
3621
|
-
const handles =
|
|
3622
|
-
const refocus =
|
|
3623
|
-
|
|
3657
|
+
const [dragIndex, setDragIndex] = React49.useState(null);
|
|
3658
|
+
const [announcement, setAnnouncement] = React49.useState("");
|
|
3659
|
+
const handles = React49.useRef(/* @__PURE__ */ new Map());
|
|
3660
|
+
const refocus = React49.useRef(null);
|
|
3661
|
+
React49.useEffect(() => {
|
|
3624
3662
|
if (refocus.current) {
|
|
3625
3663
|
handles.current.get(refocus.current)?.focus();
|
|
3626
3664
|
refocus.current = null;
|
|
@@ -3633,8 +3671,8 @@ var RankList = React48.forwardRef(
|
|
|
3633
3671
|
setAnnouncement(`Moved to position ${to + 1} of ${items.length}`);
|
|
3634
3672
|
onItemsChange(next);
|
|
3635
3673
|
};
|
|
3636
|
-
return /* @__PURE__ */
|
|
3637
|
-
/* @__PURE__ */
|
|
3674
|
+
return /* @__PURE__ */ jsxs37(Fragment13, { children: [
|
|
3675
|
+
/* @__PURE__ */ jsx50("ol", { ref, className: cn("flex w-full max-w-150 flex-col gap-4", className), ...props, children: items.map((item, index) => /* @__PURE__ */ jsxs37(
|
|
3638
3676
|
"li",
|
|
3639
3677
|
{
|
|
3640
3678
|
draggable: true,
|
|
@@ -3651,7 +3689,7 @@ var RankList = React48.forwardRef(
|
|
|
3651
3689
|
dragIndex === index && "opacity-50"
|
|
3652
3690
|
),
|
|
3653
3691
|
children: [
|
|
3654
|
-
/* @__PURE__ */
|
|
3692
|
+
/* @__PURE__ */ jsx50(
|
|
3655
3693
|
"button",
|
|
3656
3694
|
{
|
|
3657
3695
|
type: "button",
|
|
@@ -3670,10 +3708,10 @@ var RankList = React48.forwardRef(
|
|
|
3670
3708
|
}
|
|
3671
3709
|
},
|
|
3672
3710
|
className: "inline-flex shrink-0 cursor-grab rounded-xs text-surface-foreground",
|
|
3673
|
-
children: /* @__PURE__ */
|
|
3711
|
+
children: /* @__PURE__ */ jsx50(DotsSixVertical4, { size: 16, "aria-hidden": true })
|
|
3674
3712
|
}
|
|
3675
3713
|
),
|
|
3676
|
-
/* @__PURE__ */
|
|
3714
|
+
/* @__PURE__ */ jsx50(
|
|
3677
3715
|
"span",
|
|
3678
3716
|
{
|
|
3679
3717
|
"aria-hidden": "true",
|
|
@@ -3681,27 +3719,27 @@ var RankList = React48.forwardRef(
|
|
|
3681
3719
|
children: index + 1
|
|
3682
3720
|
}
|
|
3683
3721
|
),
|
|
3684
|
-
/* @__PURE__ */
|
|
3722
|
+
/* @__PURE__ */ jsx50("span", { className: "min-w-0 flex-1", children: item.label })
|
|
3685
3723
|
]
|
|
3686
3724
|
},
|
|
3687
3725
|
item.id
|
|
3688
3726
|
)) }),
|
|
3689
|
-
/* @__PURE__ */
|
|
3727
|
+
/* @__PURE__ */ jsx50("span", { role: "status", "aria-live": "polite", className: "sr-only", children: announcement })
|
|
3690
3728
|
] });
|
|
3691
3729
|
}
|
|
3692
3730
|
);
|
|
3693
3731
|
RankList.displayName = "RankList";
|
|
3694
3732
|
|
|
3695
3733
|
// src/components/Question Types/RatingScale.tsx
|
|
3696
|
-
import * as
|
|
3734
|
+
import * as React50 from "react";
|
|
3697
3735
|
import { ToggleGroup as ToggleGroupPrimitive3 } from "radix-ui";
|
|
3698
|
-
import { jsx as
|
|
3699
|
-
var RatingScale =
|
|
3736
|
+
import { jsx as jsx51, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
3737
|
+
var RatingScale = React50.forwardRef(
|
|
3700
3738
|
({ className, max = 5, value, defaultValue, onValueChange, lowLabel, highLabel, ...props }, ref) => {
|
|
3701
|
-
const [internal, setInternal] =
|
|
3739
|
+
const [internal, setInternal] = React50.useState(defaultValue);
|
|
3702
3740
|
const current = value !== void 0 ? value : internal;
|
|
3703
|
-
return /* @__PURE__ */
|
|
3704
|
-
/* @__PURE__ */
|
|
3741
|
+
return /* @__PURE__ */ jsxs38("div", { className: cn("flex w-full max-w-150 flex-col gap-2", className), children: [
|
|
3742
|
+
/* @__PURE__ */ jsx51(
|
|
3705
3743
|
ToggleGroupPrimitive3.Root,
|
|
3706
3744
|
{
|
|
3707
3745
|
ref,
|
|
@@ -3714,7 +3752,7 @@ var RatingScale = React49.forwardRef(
|
|
|
3714
3752
|
},
|
|
3715
3753
|
className: "flex gap-2",
|
|
3716
3754
|
...props,
|
|
3717
|
-
children: Array.from({ length: max }, (_, i) => i + 1).map((n) => /* @__PURE__ */
|
|
3755
|
+
children: Array.from({ length: max }, (_, i) => i + 1).map((n) => /* @__PURE__ */ jsx51(
|
|
3718
3756
|
ToggleGroupPrimitive3.Item,
|
|
3719
3757
|
{
|
|
3720
3758
|
value: String(n),
|
|
@@ -3730,9 +3768,9 @@ var RatingScale = React49.forwardRef(
|
|
|
3730
3768
|
))
|
|
3731
3769
|
}
|
|
3732
3770
|
),
|
|
3733
|
-
(lowLabel != null || highLabel != null) && /* @__PURE__ */
|
|
3734
|
-
/* @__PURE__ */
|
|
3735
|
-
/* @__PURE__ */
|
|
3771
|
+
(lowLabel != null || highLabel != null) && /* @__PURE__ */ jsxs38("div", { className: "flex justify-between text-ui-caption text-secondary-muted-foreground", "aria-hidden": "true", children: [
|
|
3772
|
+
/* @__PURE__ */ jsx51("span", { children: lowLabel }),
|
|
3773
|
+
/* @__PURE__ */ jsx51("span", { children: highLabel })
|
|
3736
3774
|
] })
|
|
3737
3775
|
] });
|
|
3738
3776
|
}
|
|
@@ -3740,12 +3778,12 @@ var RatingScale = React49.forwardRef(
|
|
|
3740
3778
|
RatingScale.displayName = "RatingScale";
|
|
3741
3779
|
|
|
3742
3780
|
// src/components/Question Types/StimulusCard.tsx
|
|
3743
|
-
import * as
|
|
3781
|
+
import * as React51 from "react";
|
|
3744
3782
|
import { Image as ImageIcon2, ImageBroken, Trash as Trash6 } from "@phosphor-icons/react";
|
|
3745
|
-
import { jsx as
|
|
3783
|
+
import { jsx as jsx52, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
3746
3784
|
var MIN_THUMBNAIL = 92;
|
|
3747
3785
|
var MAX_THUMBNAIL = 240;
|
|
3748
|
-
var StimulusCard =
|
|
3786
|
+
var StimulusCard = React51.forwardRef(
|
|
3749
3787
|
({
|
|
3750
3788
|
className,
|
|
3751
3789
|
thumbnail,
|
|
@@ -3762,14 +3800,14 @@ var StimulusCard = React50.forwardRef(
|
|
|
3762
3800
|
removeLabel = "Remove stimulus",
|
|
3763
3801
|
...props
|
|
3764
3802
|
}, ref) => {
|
|
3765
|
-
const [failedSrc, setFailedSrc] =
|
|
3803
|
+
const [failedSrc, setFailedSrc] = React51.useState();
|
|
3766
3804
|
const error = status === "error" || thumbnail !== void 0 && failedSrc === thumbnail;
|
|
3767
3805
|
const showImage = thumbnail !== void 0 && !error;
|
|
3768
|
-
const [draft, setDraft] =
|
|
3806
|
+
const [draft, setDraft] = React51.useState(null);
|
|
3769
3807
|
const count = (draft ?? caption ?? "").length;
|
|
3770
|
-
const textRef =
|
|
3771
|
-
const [thumbnailSize, setThumbnailSize] =
|
|
3772
|
-
|
|
3808
|
+
const textRef = React51.useRef(null);
|
|
3809
|
+
const [thumbnailSize, setThumbnailSize] = React51.useState(MIN_THUMBNAIL);
|
|
3810
|
+
React51.useEffect(() => {
|
|
3773
3811
|
const el = textRef.current;
|
|
3774
3812
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
3775
3813
|
const observer = new ResizeObserver(() => {
|
|
@@ -3778,7 +3816,7 @@ var StimulusCard = React50.forwardRef(
|
|
|
3778
3816
|
observer.observe(el);
|
|
3779
3817
|
return () => observer.disconnect();
|
|
3780
3818
|
}, []);
|
|
3781
|
-
return /* @__PURE__ */
|
|
3819
|
+
return /* @__PURE__ */ jsxs39(
|
|
3782
3820
|
"div",
|
|
3783
3821
|
{
|
|
3784
3822
|
ref,
|
|
@@ -3786,8 +3824,8 @@ var StimulusCard = React50.forwardRef(
|
|
|
3786
3824
|
className: cn("flex min-h-24.5 w-full items-center gap-4 rounded-md border border-border p-0.5 pr-4", className),
|
|
3787
3825
|
...props,
|
|
3788
3826
|
children: [
|
|
3789
|
-
/* @__PURE__ */
|
|
3790
|
-
/* @__PURE__ */
|
|
3827
|
+
/* @__PURE__ */ jsxs39("div", { className: "flex min-w-0 flex-1 items-center gap-4", children: [
|
|
3828
|
+
/* @__PURE__ */ jsx52(
|
|
3791
3829
|
"span",
|
|
3792
3830
|
{
|
|
3793
3831
|
style: { width: thumbnailSize, height: thumbnailSize },
|
|
@@ -3798,13 +3836,13 @@ var StimulusCard = React50.forwardRef(
|
|
|
3798
3836
|
),
|
|
3799
3837
|
children: showImage ? (
|
|
3800
3838
|
// Out of flow, so the image's own size never sets the thumbnail's size.
|
|
3801
|
-
/* @__PURE__ */
|
|
3802
|
-
) : error ? /* @__PURE__ */
|
|
3839
|
+
/* @__PURE__ */ jsx52("img", { src: thumbnail, alt: thumbnailAlt, className: "absolute inset-0 size-full object-cover", onError: () => setFailedSrc(thumbnail) })
|
|
3840
|
+
) : error ? /* @__PURE__ */ jsx52(ImageBroken, { size: 24, "aria-hidden": true }) : icon ?? /* @__PURE__ */ jsx52(ImageIcon2, { size: 24, "aria-hidden": true })
|
|
3803
3841
|
}
|
|
3804
3842
|
),
|
|
3805
|
-
/* @__PURE__ */
|
|
3806
|
-
/* @__PURE__ */
|
|
3807
|
-
onCaptionChange ? /* @__PURE__ */
|
|
3843
|
+
/* @__PURE__ */ jsxs39("div", { ref: textRef, className: "flex min-w-0 flex-1 flex-col justify-center gap-2 py-2 text-surface-foreground", children: [
|
|
3844
|
+
/* @__PURE__ */ jsx52("p", { className: "w-full text-ui-label", children: label }),
|
|
3845
|
+
onCaptionChange ? /* @__PURE__ */ jsx52(
|
|
3808
3846
|
InlineEdit,
|
|
3809
3847
|
{
|
|
3810
3848
|
variant: "question",
|
|
@@ -3821,8 +3859,8 @@ var StimulusCard = React50.forwardRef(
|
|
|
3821
3859
|
},
|
|
3822
3860
|
textClassName: "text-body-base"
|
|
3823
3861
|
}
|
|
3824
|
-
) : /* @__PURE__ */
|
|
3825
|
-
onCaptionChange && showCounter && maxLength !== void 0 && count > maxLength && /* @__PURE__ */
|
|
3862
|
+
) : /* @__PURE__ */ jsx52("p", { className: "w-full text-body-base [word-break:break-word]", children: caption }),
|
|
3863
|
+
onCaptionChange && showCounter && maxLength !== void 0 && count > maxLength && /* @__PURE__ */ jsxs39("p", { className: "text-ui-caption text-secondary-muted-foreground", children: [
|
|
3826
3864
|
count,
|
|
3827
3865
|
"/",
|
|
3828
3866
|
maxLength,
|
|
@@ -3830,7 +3868,7 @@ var StimulusCard = React50.forwardRef(
|
|
|
3830
3868
|
] })
|
|
3831
3869
|
] })
|
|
3832
3870
|
] }),
|
|
3833
|
-
onRemove && /* @__PURE__ */
|
|
3871
|
+
onRemove && /* @__PURE__ */ jsx52(Button, { type: "button", variant: "destructive", size: "icon-sm", "aria-label": removeLabel, onClick: onRemove, children: /* @__PURE__ */ jsx52(Trash6, { size: 16, "aria-hidden": true }) })
|
|
3834
3872
|
]
|
|
3835
3873
|
}
|
|
3836
3874
|
);
|
|
@@ -3839,27 +3877,27 @@ var StimulusCard = React50.forwardRef(
|
|
|
3839
3877
|
StimulusCard.displayName = "StimulusCard";
|
|
3840
3878
|
|
|
3841
3879
|
// src/components/Data Display/Progress.tsx
|
|
3842
|
-
import * as
|
|
3880
|
+
import * as React52 from "react";
|
|
3843
3881
|
import { Progress as ProgressPrimitive2 } from "radix-ui";
|
|
3844
|
-
import { jsx as
|
|
3845
|
-
var Progress =
|
|
3882
|
+
import { jsx as jsx53, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
3883
|
+
var Progress = React52.forwardRef(
|
|
3846
3884
|
({ className, value = 0, label, valueLabel, detailsStart, detailsEnd, ...props }, ref) => {
|
|
3847
3885
|
const hasHeader = label != null || valueLabel != null;
|
|
3848
3886
|
const hasDetails = detailsStart != null || detailsEnd != null;
|
|
3849
3887
|
const clamped = Math.min(100, Math.max(0, value ?? 0));
|
|
3850
|
-
return /* @__PURE__ */
|
|
3851
|
-
hasHeader && /* @__PURE__ */
|
|
3852
|
-
/* @__PURE__ */
|
|
3853
|
-
/* @__PURE__ */
|
|
3888
|
+
return /* @__PURE__ */ jsxs40("div", { className: cn("flex w-full flex-col gap-2", className), children: [
|
|
3889
|
+
hasHeader && /* @__PURE__ */ jsxs40("div", { className: "flex items-center justify-between text-ui-label text-surface-foreground", children: [
|
|
3890
|
+
/* @__PURE__ */ jsx53("span", { children: label }),
|
|
3891
|
+
/* @__PURE__ */ jsx53("span", { children: valueLabel === true ? `${Math.round(clamped)}%` : valueLabel })
|
|
3854
3892
|
] }),
|
|
3855
|
-
/* @__PURE__ */
|
|
3893
|
+
/* @__PURE__ */ jsx53(
|
|
3856
3894
|
ProgressPrimitive2.Root,
|
|
3857
3895
|
{
|
|
3858
3896
|
ref,
|
|
3859
3897
|
value: clamped,
|
|
3860
3898
|
className: "relative h-2 w-full overflow-hidden rounded-full bg-secondary",
|
|
3861
3899
|
...props,
|
|
3862
|
-
children: /* @__PURE__ */
|
|
3900
|
+
children: /* @__PURE__ */ jsx53(
|
|
3863
3901
|
ProgressPrimitive2.Indicator,
|
|
3864
3902
|
{
|
|
3865
3903
|
className: "h-full rounded-full bg-accent transition-[width]",
|
|
@@ -3868,9 +3906,9 @@ var Progress = React51.forwardRef(
|
|
|
3868
3906
|
)
|
|
3869
3907
|
}
|
|
3870
3908
|
),
|
|
3871
|
-
hasDetails && /* @__PURE__ */
|
|
3872
|
-
/* @__PURE__ */
|
|
3873
|
-
/* @__PURE__ */
|
|
3909
|
+
hasDetails && /* @__PURE__ */ jsxs40("div", { className: "flex items-start justify-between text-ui-label leading-5 text-secondary-muted-foreground", children: [
|
|
3910
|
+
/* @__PURE__ */ jsx53("span", { children: detailsStart }),
|
|
3911
|
+
/* @__PURE__ */ jsx53("span", { children: detailsEnd })
|
|
3874
3912
|
] })
|
|
3875
3913
|
] });
|
|
3876
3914
|
}
|
|
@@ -3878,11 +3916,11 @@ var Progress = React51.forwardRef(
|
|
|
3878
3916
|
Progress.displayName = "Progress";
|
|
3879
3917
|
|
|
3880
3918
|
// src/components/Data Display/Table.tsx
|
|
3881
|
-
import * as
|
|
3919
|
+
import * as React53 from "react";
|
|
3882
3920
|
import { CaretDown as CaretDown4, CaretUp } from "@phosphor-icons/react";
|
|
3883
|
-
import { jsx as
|
|
3884
|
-
var Table =
|
|
3885
|
-
({ className, containerClassName, containerRef, striped, ...props }, ref) => /* @__PURE__ */
|
|
3921
|
+
import { jsx as jsx54, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
3922
|
+
var Table = React53.forwardRef(
|
|
3923
|
+
({ className, containerClassName, containerRef, striped, ...props }, ref) => /* @__PURE__ */ jsx54("div", { ref: containerRef, className: cn("relative w-full overflow-auto rounded-lg border border-border bg-surface", containerClassName), children: /* @__PURE__ */ jsx54(
|
|
3886
3924
|
"table",
|
|
3887
3925
|
{
|
|
3888
3926
|
ref,
|
|
@@ -3893,20 +3931,20 @@ var Table = React52.forwardRef(
|
|
|
3893
3931
|
) })
|
|
3894
3932
|
);
|
|
3895
3933
|
Table.displayName = "Table";
|
|
3896
|
-
var TableHeader =
|
|
3897
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
3934
|
+
var TableHeader = React53.forwardRef(
|
|
3935
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx54("thead", { ref, className, ...props })
|
|
3898
3936
|
);
|
|
3899
3937
|
TableHeader.displayName = "TableHeader";
|
|
3900
|
-
var TableFooter =
|
|
3901
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
3938
|
+
var TableFooter = React53.forwardRef(
|
|
3939
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx54("tfoot", { ref, className: cn("border-t border-border bg-background text-ui-label", className), ...props })
|
|
3902
3940
|
);
|
|
3903
3941
|
TableFooter.displayName = "TableFooter";
|
|
3904
|
-
var TableBody =
|
|
3905
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
3942
|
+
var TableBody = React53.forwardRef(
|
|
3943
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx54("tbody", { ref, className, ...props })
|
|
3906
3944
|
);
|
|
3907
3945
|
TableBody.displayName = "TableBody";
|
|
3908
|
-
var TableRow =
|
|
3909
|
-
({ className, selected, ...props }, ref) => /* @__PURE__ */
|
|
3946
|
+
var TableRow = React53.forwardRef(
|
|
3947
|
+
({ className, selected, ...props }, ref) => /* @__PURE__ */ jsx54(
|
|
3910
3948
|
"tr",
|
|
3911
3949
|
{
|
|
3912
3950
|
ref,
|
|
@@ -3923,10 +3961,10 @@ var TableRow = React52.forwardRef(
|
|
|
3923
3961
|
);
|
|
3924
3962
|
TableRow.displayName = "TableRow";
|
|
3925
3963
|
var ariaSort = { none: "none", asc: "ascending", desc: "descending" };
|
|
3926
|
-
var TableHead =
|
|
3964
|
+
var TableHead = React53.forwardRef(
|
|
3927
3965
|
({ className, align = "left", sortable, sort = "none", onSort, checkbox, resizer, children, ...props }, ref) => {
|
|
3928
|
-
const caret = sort === "asc" ? /* @__PURE__ */
|
|
3929
|
-
return /* @__PURE__ */
|
|
3966
|
+
const caret = sort === "asc" ? /* @__PURE__ */ jsx54(CaretUp, { size: 16, "aria-hidden": true, className: "shrink-0" }) : /* @__PURE__ */ jsx54(CaretDown4, { size: 16, "aria-hidden": true, className: "shrink-0" });
|
|
3967
|
+
return /* @__PURE__ */ jsxs41(
|
|
3930
3968
|
"th",
|
|
3931
3969
|
{
|
|
3932
3970
|
ref,
|
|
@@ -3941,7 +3979,7 @@ var TableHead = React52.forwardRef(
|
|
|
3941
3979
|
),
|
|
3942
3980
|
...props,
|
|
3943
3981
|
children: [
|
|
3944
|
-
sortable ? /* @__PURE__ */
|
|
3982
|
+
sortable ? /* @__PURE__ */ jsxs41(
|
|
3945
3983
|
"button",
|
|
3946
3984
|
{
|
|
3947
3985
|
type: "button",
|
|
@@ -3952,7 +3990,7 @@ var TableHead = React52.forwardRef(
|
|
|
3952
3990
|
caret
|
|
3953
3991
|
]
|
|
3954
3992
|
}
|
|
3955
|
-
) : checkbox ? /* @__PURE__ */
|
|
3993
|
+
) : checkbox ? /* @__PURE__ */ jsx54("div", { className: "flex items-center justify-center", children }) : children,
|
|
3956
3994
|
resizer
|
|
3957
3995
|
]
|
|
3958
3996
|
}
|
|
@@ -3960,8 +3998,8 @@ var TableHead = React52.forwardRef(
|
|
|
3960
3998
|
}
|
|
3961
3999
|
);
|
|
3962
4000
|
TableHead.displayName = "TableHead";
|
|
3963
|
-
var TableCell =
|
|
3964
|
-
({ className, align = "left", muted, checkbox, actions, children, ...props }, ref) => /* @__PURE__ */
|
|
4001
|
+
var TableCell = React53.forwardRef(
|
|
4002
|
+
({ className, align = "left", muted, checkbox, actions, children, ...props }, ref) => /* @__PURE__ */ jsx54(
|
|
3965
4003
|
"td",
|
|
3966
4004
|
{
|
|
3967
4005
|
ref,
|
|
@@ -3974,23 +4012,23 @@ var TableCell = React52.forwardRef(
|
|
|
3974
4012
|
className
|
|
3975
4013
|
),
|
|
3976
4014
|
...props,
|
|
3977
|
-
children: checkbox ? /* @__PURE__ */
|
|
4015
|
+
children: checkbox ? /* @__PURE__ */ jsx54("div", { className: "flex items-center justify-center", children }) : actions ? /* @__PURE__ */ jsx54("div", { className: "flex items-start justify-end gap-1", children }) : children
|
|
3978
4016
|
}
|
|
3979
4017
|
)
|
|
3980
4018
|
);
|
|
3981
4019
|
TableCell.displayName = "TableCell";
|
|
3982
4020
|
function TableCellTwoLines({ primary, secondary, avatar, className, ...props }) {
|
|
3983
|
-
return /* @__PURE__ */
|
|
4021
|
+
return /* @__PURE__ */ jsxs41("div", { className: cn("flex items-center gap-2", className), ...props, children: [
|
|
3984
4022
|
avatar,
|
|
3985
|
-
/* @__PURE__ */
|
|
3986
|
-
/* @__PURE__ */
|
|
3987
|
-
secondary && /* @__PURE__ */
|
|
4023
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex flex-col gap-0.5 whitespace-nowrap", children: [
|
|
4024
|
+
/* @__PURE__ */ jsx54("span", { className: "text-ui-label text-surface-foreground", children: primary }),
|
|
4025
|
+
secondary && /* @__PURE__ */ jsx54("span", { className: "text-ui-caption text-secondary-muted-foreground", children: secondary })
|
|
3988
4026
|
] })
|
|
3989
4027
|
] });
|
|
3990
4028
|
}
|
|
3991
4029
|
|
|
3992
4030
|
// src/components/Data Display/DataTable.tsx
|
|
3993
|
-
import * as
|
|
4031
|
+
import * as React55 from "react";
|
|
3994
4032
|
import { CaretDown as CaretDown5, CaretRight as CaretRight4, PushPin, PushPinSlash, Rows, Sliders, Stack } from "@phosphor-icons/react";
|
|
3995
4033
|
import {
|
|
3996
4034
|
aggregationFn_count,
|
|
@@ -4043,9 +4081,9 @@ import {
|
|
|
4043
4081
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
4044
4082
|
|
|
4045
4083
|
// src/components/Utility/Pagination.tsx
|
|
4046
|
-
import * as
|
|
4084
|
+
import * as React54 from "react";
|
|
4047
4085
|
import { ArrowLeft, ArrowRight, DotsThree as DotsThree2 } from "@phosphor-icons/react";
|
|
4048
|
-
import { jsx as
|
|
4086
|
+
import { jsx as jsx55, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
4049
4087
|
function getPaginationItems(page, pageCount, siblings = 1) {
|
|
4050
4088
|
const keep = /* @__PURE__ */ new Set([1, pageCount]);
|
|
4051
4089
|
for (let p = page - siblings; p <= page + siblings; p++) if (p >= 1 && p <= pageCount) keep.add(p);
|
|
@@ -4059,10 +4097,10 @@ function getPaginationItems(page, pageCount, siblings = 1) {
|
|
|
4059
4097
|
});
|
|
4060
4098
|
return items;
|
|
4061
4099
|
}
|
|
4062
|
-
var Pagination =
|
|
4100
|
+
var Pagination = React54.forwardRef(
|
|
4063
4101
|
({ className, page, pageCount, onPageChange, variant = "full", siblings = 1, ...props }, ref) => {
|
|
4064
4102
|
const go = (next2) => onPageChange(Math.min(pageCount, Math.max(1, next2)));
|
|
4065
|
-
const previous = /* @__PURE__ */
|
|
4103
|
+
const previous = /* @__PURE__ */ jsx55(
|
|
4066
4104
|
Button,
|
|
4067
4105
|
{
|
|
4068
4106
|
type: "button",
|
|
@@ -4071,10 +4109,10 @@ var Pagination = React53.forwardRef(
|
|
|
4071
4109
|
"aria-label": "Previous page",
|
|
4072
4110
|
disabled: page <= 1,
|
|
4073
4111
|
onClick: () => go(page - 1),
|
|
4074
|
-
children: /* @__PURE__ */
|
|
4112
|
+
children: /* @__PURE__ */ jsx55(ArrowLeft, { size: 16, "aria-hidden": true })
|
|
4075
4113
|
}
|
|
4076
4114
|
);
|
|
4077
|
-
const next = /* @__PURE__ */
|
|
4115
|
+
const next = /* @__PURE__ */ jsx55(
|
|
4078
4116
|
Button,
|
|
4079
4117
|
{
|
|
4080
4118
|
type: "button",
|
|
@@ -4083,10 +4121,10 @@ var Pagination = React53.forwardRef(
|
|
|
4083
4121
|
"aria-label": "Next page",
|
|
4084
4122
|
disabled: page >= pageCount,
|
|
4085
4123
|
onClick: () => go(page + 1),
|
|
4086
|
-
children: /* @__PURE__ */
|
|
4124
|
+
children: /* @__PURE__ */ jsx55(ArrowRight, { size: 16, "aria-hidden": true })
|
|
4087
4125
|
}
|
|
4088
4126
|
);
|
|
4089
|
-
return /* @__PURE__ */
|
|
4127
|
+
return /* @__PURE__ */ jsxs42(
|
|
4090
4128
|
"nav",
|
|
4091
4129
|
{
|
|
4092
4130
|
ref,
|
|
@@ -4095,14 +4133,14 @@ var Pagination = React53.forwardRef(
|
|
|
4095
4133
|
...props,
|
|
4096
4134
|
children: [
|
|
4097
4135
|
previous,
|
|
4098
|
-
variant === "compact" ? /* @__PURE__ */
|
|
4136
|
+
variant === "compact" ? /* @__PURE__ */ jsxs42("span", { className: "text-body-small text-surface-foreground", "aria-live": "polite", children: [
|
|
4099
4137
|
page,
|
|
4100
4138
|
"/",
|
|
4101
4139
|
pageCount
|
|
4102
|
-
] }) : /* @__PURE__ */
|
|
4103
|
-
/* @__PURE__ */
|
|
4104
|
-
/* @__PURE__ */
|
|
4105
|
-
] }) : /* @__PURE__ */
|
|
4140
|
+
] }) : /* @__PURE__ */ jsx55("ul", { className: "flex items-center gap-2", children: getPaginationItems(page, pageCount, siblings).map((item, index) => /* @__PURE__ */ jsx55("li", { children: item === "ellipsis" ? /* @__PURE__ */ jsxs42("span", { className: "inline-flex size-8 items-center justify-center rounded-sm border border-border bg-surface text-surface-foreground", children: [
|
|
4141
|
+
/* @__PURE__ */ jsx55(DotsThree2, { size: 16, "aria-hidden": true }),
|
|
4142
|
+
/* @__PURE__ */ jsx55("span", { className: "sr-only", children: "More pages" })
|
|
4143
|
+
] }) : /* @__PURE__ */ jsx55(
|
|
4106
4144
|
Button,
|
|
4107
4145
|
{
|
|
4108
4146
|
type: "button",
|
|
@@ -4123,7 +4161,7 @@ var Pagination = React53.forwardRef(
|
|
|
4123
4161
|
Pagination.displayName = "Pagination";
|
|
4124
4162
|
|
|
4125
4163
|
// src/components/Data Display/DataTable.tsx
|
|
4126
|
-
import { Fragment as Fragment15, jsx as
|
|
4164
|
+
import { Fragment as Fragment15, jsx as jsx56, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
4127
4165
|
var features = tableFeatures({
|
|
4128
4166
|
rowSortingFeature,
|
|
4129
4167
|
rowPaginationFeature,
|
|
@@ -4178,9 +4216,9 @@ var features = tableFeatures({
|
|
|
4178
4216
|
});
|
|
4179
4217
|
var getMeta = (meta) => meta ?? {};
|
|
4180
4218
|
function useControllable(value, initial, onChange) {
|
|
4181
|
-
const [internal, setInternal] =
|
|
4219
|
+
const [internal, setInternal] = React55.useState(initial);
|
|
4182
4220
|
const current = value ?? internal;
|
|
4183
|
-
const update =
|
|
4221
|
+
const update = React55.useCallback(
|
|
4184
4222
|
(updater) => {
|
|
4185
4223
|
const next = typeof updater === "function" ? updater(current) : updater;
|
|
4186
4224
|
if (value === void 0) setInternal(next);
|
|
@@ -4219,16 +4257,16 @@ function ColumnFilter({ column }) {
|
|
|
4219
4257
|
const value = column.getFilterValue();
|
|
4220
4258
|
if (variant === "select") {
|
|
4221
4259
|
const options = [...column.getFacetedUniqueValues().entries()].sort((a, b) => String(a[0]).localeCompare(String(b[0])));
|
|
4222
|
-
return /* @__PURE__ */
|
|
4260
|
+
return /* @__PURE__ */ jsxs43(
|
|
4223
4261
|
Select,
|
|
4224
4262
|
{
|
|
4225
4263
|
value: typeof value === "string" ? value : ALL,
|
|
4226
4264
|
onValueChange: (next) => column.setFilterValue(next === ALL ? void 0 : next),
|
|
4227
4265
|
children: [
|
|
4228
|
-
/* @__PURE__ */
|
|
4229
|
-
/* @__PURE__ */
|
|
4230
|
-
/* @__PURE__ */
|
|
4231
|
-
options.map(([option, count]) => /* @__PURE__ */
|
|
4266
|
+
/* @__PURE__ */ jsx56(SelectTrigger, { "aria-label": `Filter ${label}`, className: "h-8 text-body-small", children: /* @__PURE__ */ jsx56(SelectValue, {}) }),
|
|
4267
|
+
/* @__PURE__ */ jsxs43(SelectContent, { children: [
|
|
4268
|
+
/* @__PURE__ */ jsx56(SelectItem, { value: ALL, children: "All" }),
|
|
4269
|
+
options.map(([option, count]) => /* @__PURE__ */ jsxs43(SelectItem, { value: String(option), children: [
|
|
4232
4270
|
String(option),
|
|
4233
4271
|
" (",
|
|
4234
4272
|
count,
|
|
@@ -4247,8 +4285,8 @@ function ColumnFilter({ column }) {
|
|
|
4247
4285
|
next[index] = raw === "" ? void 0 : Number(raw);
|
|
4248
4286
|
column.setFilterValue(next[0] === void 0 && next[1] === void 0 ? void 0 : next);
|
|
4249
4287
|
};
|
|
4250
|
-
return /* @__PURE__ */
|
|
4251
|
-
/* @__PURE__ */
|
|
4288
|
+
return /* @__PURE__ */ jsxs43("div", { className: "flex gap-1", children: [
|
|
4289
|
+
/* @__PURE__ */ jsx56(
|
|
4252
4290
|
Input,
|
|
4253
4291
|
{
|
|
4254
4292
|
type: "number",
|
|
@@ -4259,7 +4297,7 @@ function ColumnFilter({ column }) {
|
|
|
4259
4297
|
className: "h-8 text-body-small"
|
|
4260
4298
|
}
|
|
4261
4299
|
),
|
|
4262
|
-
/* @__PURE__ */
|
|
4300
|
+
/* @__PURE__ */ jsx56(
|
|
4263
4301
|
Input,
|
|
4264
4302
|
{
|
|
4265
4303
|
type: "number",
|
|
@@ -4272,7 +4310,7 @@ function ColumnFilter({ column }) {
|
|
|
4272
4310
|
)
|
|
4273
4311
|
] });
|
|
4274
4312
|
}
|
|
4275
|
-
return /* @__PURE__ */
|
|
4313
|
+
return /* @__PURE__ */ jsx56(
|
|
4276
4314
|
Input,
|
|
4277
4315
|
{
|
|
4278
4316
|
"aria-label": `Filter ${label}`,
|
|
@@ -4285,9 +4323,9 @@ function ColumnFilter({ column }) {
|
|
|
4285
4323
|
}
|
|
4286
4324
|
function EditableCell({ value, label, type, onCommit }) {
|
|
4287
4325
|
const initial = value == null ? "" : String(value);
|
|
4288
|
-
const [draft, setDraft] =
|
|
4289
|
-
const cancelled =
|
|
4290
|
-
return /* @__PURE__ */
|
|
4326
|
+
const [draft, setDraft] = React55.useState(null);
|
|
4327
|
+
const cancelled = React55.useRef(false);
|
|
4328
|
+
return /* @__PURE__ */ jsx56(
|
|
4291
4329
|
Input,
|
|
4292
4330
|
{
|
|
4293
4331
|
type,
|
|
@@ -4425,7 +4463,7 @@ function DataTableInner({
|
|
|
4425
4463
|
onPaginationChange
|
|
4426
4464
|
);
|
|
4427
4465
|
const [density, setDensity] = useControllable(densityProp, "default", onDensityChange);
|
|
4428
|
-
const [cellSelection, setCellSelection] =
|
|
4466
|
+
const [cellSelection, setCellSelection] = React55.useState([]);
|
|
4429
4467
|
const infinite = Boolean(onLoadMore);
|
|
4430
4468
|
const paginate = !virtualized && !infinite;
|
|
4431
4469
|
const compact = density === "compact";
|
|
@@ -4498,12 +4536,12 @@ function DataTableInner({
|
|
|
4498
4536
|
const cellDensity = compact ? "h-8 py-1.5" : void 0;
|
|
4499
4537
|
const allSelected = table.getIsAllPageRowsSelected();
|
|
4500
4538
|
const someSelected = table.getIsSomePageRowsSelected();
|
|
4501
|
-
const dragged =
|
|
4539
|
+
const dragged = React55.useRef(null);
|
|
4502
4540
|
const topRows = enableRowPinning ? table.getTopRows() : [];
|
|
4503
4541
|
const bottomRows = enableRowPinning ? table.getBottomRows() : [];
|
|
4504
4542
|
const bodyRows = enableRowPinning ? table.getCenterRows() : table.getRowModel().rows;
|
|
4505
|
-
const scrollRef =
|
|
4506
|
-
const setScrollRef =
|
|
4543
|
+
const scrollRef = React55.useRef(null);
|
|
4544
|
+
const setScrollRef = React55.useCallback(
|
|
4507
4545
|
(node) => {
|
|
4508
4546
|
scrollRef.current = node;
|
|
4509
4547
|
if (typeof containerRef === "function") containerRef(node);
|
|
@@ -4522,8 +4560,8 @@ function DataTableInner({
|
|
|
4522
4560
|
const virtualItems = virtualized ? virtualizer.getVirtualItems() : [];
|
|
4523
4561
|
const paddingTop = virtualItems.length > 0 ? virtualItems[0]?.start ?? 0 : 0;
|
|
4524
4562
|
const paddingBottom = virtualItems.length > 0 ? virtualizer.getTotalSize() - (virtualItems.at(-1)?.end ?? 0) : 0;
|
|
4525
|
-
const sentinelRef =
|
|
4526
|
-
|
|
4563
|
+
const sentinelRef = React55.useRef(null);
|
|
4564
|
+
React55.useEffect(() => {
|
|
4527
4565
|
const node = sentinelRef.current;
|
|
4528
4566
|
if (!node || !onLoadMore || !hasMore || loadingMore || typeof IntersectionObserver === "undefined") return;
|
|
4529
4567
|
const container = scrollRef.current;
|
|
@@ -4564,15 +4602,15 @@ function DataTableInner({
|
|
|
4564
4602
|
table.resetCellSelection(true);
|
|
4565
4603
|
}
|
|
4566
4604
|
};
|
|
4567
|
-
const skeletonRow = (rowKey) => /* @__PURE__ */
|
|
4605
|
+
const skeletonRow = (rowKey) => /* @__PURE__ */ jsx56(TableRow, { className: "hover:bg-transparent", children: Array.from({ length: columnSpan }, (_, cell) => /* @__PURE__ */ jsx56(TableCell, { checkbox: enableRowSelection && cell === 0, className: cellDensity, children: /* @__PURE__ */ jsx56("span", { "aria-hidden": true, className: "block h-4 w-3/4 animate-pulse rounded-xs bg-border" }) }, cell)) }, rowKey);
|
|
4568
4606
|
const renderRow = (row, options = {}) => {
|
|
4569
4607
|
const { pinned, pinnedIndex = 0, pinnedCount = 1, virtualIndex } = options;
|
|
4570
4608
|
const grouped = row.getIsGrouped();
|
|
4571
4609
|
const rowUnits = compact ? 8 : 10;
|
|
4572
4610
|
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;
|
|
4573
4611
|
const cells = row.getVisibleCells();
|
|
4574
|
-
return /* @__PURE__ */
|
|
4575
|
-
/* @__PURE__ */
|
|
4612
|
+
return /* @__PURE__ */ jsxs43(React55.Fragment, { children: [
|
|
4613
|
+
/* @__PURE__ */ jsxs43(
|
|
4576
4614
|
TableRow,
|
|
4577
4615
|
{
|
|
4578
4616
|
ref: virtualized && virtualIndex !== void 0 ? virtualizer.measureElement : void 0,
|
|
@@ -4582,7 +4620,7 @@ function DataTableInner({
|
|
|
4582
4620
|
onClick: onRowClick && !grouped ? () => onRowClick(row.original) : void 0,
|
|
4583
4621
|
className: cn(pinned && "z-20 bg-surface", grouped && "bg-background", onRowClick && !grouped && "cursor-pointer"),
|
|
4584
4622
|
children: [
|
|
4585
|
-
enableRowSelection && /* @__PURE__ */
|
|
4623
|
+
enableRowSelection && /* @__PURE__ */ jsx56(TableCell, { checkbox: true, className: cellDensity, onClick: (event) => event.stopPropagation(), children: !grouped && /* @__PURE__ */ jsx56(
|
|
4586
4624
|
Checkbox,
|
|
4587
4625
|
{
|
|
4588
4626
|
"aria-label": "Select row",
|
|
@@ -4591,7 +4629,7 @@ function DataTableInner({
|
|
|
4591
4629
|
onCheckedChange: (checked) => row.toggleSelected(Boolean(checked))
|
|
4592
4630
|
}
|
|
4593
4631
|
) }),
|
|
4594
|
-
hasExpander && /* @__PURE__ */
|
|
4632
|
+
hasExpander && /* @__PURE__ */ jsx56(TableCell, { checkbox: true, className: cellDensity, onClick: (event) => event.stopPropagation(), children: !grouped && row.getCanExpand() && /* @__PURE__ */ jsx56(
|
|
4595
4633
|
Button,
|
|
4596
4634
|
{
|
|
4597
4635
|
type: "button",
|
|
@@ -4600,10 +4638,10 @@ function DataTableInner({
|
|
|
4600
4638
|
"aria-label": row.getIsExpanded() ? "Collapse row" : "Expand row",
|
|
4601
4639
|
"aria-expanded": row.getIsExpanded(),
|
|
4602
4640
|
onClick: () => row.toggleExpanded(),
|
|
4603
|
-
children: row.getIsExpanded() ? /* @__PURE__ */
|
|
4641
|
+
children: row.getIsExpanded() ? /* @__PURE__ */ jsx56(CaretDown5, { size: 16, "aria-hidden": true }) : /* @__PURE__ */ jsx56(CaretRight4, { size: 16, "aria-hidden": true })
|
|
4604
4642
|
}
|
|
4605
4643
|
) }),
|
|
4606
|
-
enableRowPinning && /* @__PURE__ */
|
|
4644
|
+
enableRowPinning && /* @__PURE__ */ jsx56(TableCell, { checkbox: true, className: cellDensity, onClick: (event) => event.stopPropagation(), children: !grouped && /* @__PURE__ */ jsx56(
|
|
4607
4645
|
Button,
|
|
4608
4646
|
{
|
|
4609
4647
|
type: "button",
|
|
@@ -4612,7 +4650,7 @@ function DataTableInner({
|
|
|
4612
4650
|
"aria-label": row.getIsPinned() ? "Unpin row" : "Pin row to top",
|
|
4613
4651
|
"aria-pressed": Boolean(row.getIsPinned()),
|
|
4614
4652
|
onClick: () => row.pin(row.getIsPinned() ? false : "top"),
|
|
4615
|
-
children: row.getIsPinned() ? /* @__PURE__ */
|
|
4653
|
+
children: row.getIsPinned() ? /* @__PURE__ */ jsx56(PushPinSlash, { size: 16, "aria-hidden": true }) : /* @__PURE__ */ jsx56(PushPin, { size: 16, "aria-hidden": true })
|
|
4616
4654
|
}
|
|
4617
4655
|
) }),
|
|
4618
4656
|
cells.map((cell, index) => {
|
|
@@ -4625,7 +4663,7 @@ function DataTableInner({
|
|
|
4625
4663
|
const indent = index === 0 && hasExpander && row.depth > 0 ? row.depth * 4 : 0;
|
|
4626
4664
|
let content;
|
|
4627
4665
|
if (cell.getIsGrouped()) {
|
|
4628
|
-
content = /* @__PURE__ */
|
|
4666
|
+
content = /* @__PURE__ */ jsxs43(
|
|
4629
4667
|
"button",
|
|
4630
4668
|
{
|
|
4631
4669
|
type: "button",
|
|
@@ -4633,9 +4671,9 @@ function DataTableInner({
|
|
|
4633
4671
|
"aria-expanded": row.getIsExpanded(),
|
|
4634
4672
|
onClick: row.getToggleExpandedHandler(),
|
|
4635
4673
|
children: [
|
|
4636
|
-
row.getIsExpanded() ? /* @__PURE__ */
|
|
4674
|
+
row.getIsExpanded() ? /* @__PURE__ */ jsx56(CaretDown5, { size: 16, "aria-hidden": true }) : /* @__PURE__ */ jsx56(CaretRight4, { size: 16, "aria-hidden": true }),
|
|
4637
4675
|
flexRender(cell.column.columnDef.cell, cell.getContext()),
|
|
4638
|
-
/* @__PURE__ */
|
|
4676
|
+
/* @__PURE__ */ jsxs43("span", { className: "text-secondary-muted-foreground", children: [
|
|
4639
4677
|
"(",
|
|
4640
4678
|
row.subRows.length,
|
|
4641
4679
|
")"
|
|
@@ -4648,7 +4686,7 @@ function DataTableInner({
|
|
|
4648
4686
|
} else if (cell.getIsPlaceholder()) {
|
|
4649
4687
|
content = null;
|
|
4650
4688
|
} else if (meta.editable) {
|
|
4651
|
-
content = /* @__PURE__ */
|
|
4689
|
+
content = /* @__PURE__ */ jsx56(
|
|
4652
4690
|
EditableCell,
|
|
4653
4691
|
{
|
|
4654
4692
|
value: cell.getValue(),
|
|
@@ -4660,7 +4698,7 @@ function DataTableInner({
|
|
|
4660
4698
|
} else {
|
|
4661
4699
|
content = flexRender(cell.column.columnDef.cell, cell.getContext());
|
|
4662
4700
|
}
|
|
4663
|
-
return /* @__PURE__ */
|
|
4701
|
+
return /* @__PURE__ */ jsx56(
|
|
4664
4702
|
TableCell,
|
|
4665
4703
|
{
|
|
4666
4704
|
align: meta.align,
|
|
@@ -4693,7 +4731,7 @@ function DataTableInner({
|
|
|
4693
4731
|
]
|
|
4694
4732
|
}
|
|
4695
4733
|
),
|
|
4696
|
-
renderSubComponent && !grouped && row.getIsExpanded() && /* @__PURE__ */
|
|
4734
|
+
renderSubComponent && !grouped && row.getIsExpanded() && /* @__PURE__ */ jsx56(TableRow, { className: "bg-background hover:bg-background", children: /* @__PURE__ */ jsx56(TableCell, { colSpan: columnSpan, children: renderSubComponent(row.original) }) })
|
|
4697
4735
|
] }, row.id);
|
|
4698
4736
|
};
|
|
4699
4737
|
const renderHeaderCell = (header) => {
|
|
@@ -4704,7 +4742,7 @@ function DataTableInner({
|
|
|
4704
4742
|
const pin = pinning(column, sized, true);
|
|
4705
4743
|
const reorderable = enableColumnOrdering && leaf && !column.getIsPinned();
|
|
4706
4744
|
const label = labelOf(column);
|
|
4707
|
-
return /* @__PURE__ */
|
|
4745
|
+
return /* @__PURE__ */ jsx56(
|
|
4708
4746
|
TableHead,
|
|
4709
4747
|
{
|
|
4710
4748
|
colSpan: header.colSpan > 1 ? header.colSpan : void 0,
|
|
@@ -4740,7 +4778,7 @@ function DataTableInner({
|
|
|
4740
4778
|
reorderable && "cursor-grab",
|
|
4741
4779
|
!leaf && "text-center"
|
|
4742
4780
|
),
|
|
4743
|
-
resizer: enableColumnResizing && column.getCanResize() ? /* @__PURE__ */
|
|
4781
|
+
resizer: enableColumnResizing && column.getCanResize() ? /* @__PURE__ */ jsx56(
|
|
4744
4782
|
"div",
|
|
4745
4783
|
{
|
|
4746
4784
|
role: "separator",
|
|
@@ -4755,14 +4793,14 @@ function DataTableInner({
|
|
|
4755
4793
|
)
|
|
4756
4794
|
}
|
|
4757
4795
|
) : void 0,
|
|
4758
|
-
children: header.isPlaceholder ? null : /* @__PURE__ */
|
|
4796
|
+
children: header.isPlaceholder ? null : /* @__PURE__ */ jsx56(table.FlexRender, { header })
|
|
4759
4797
|
},
|
|
4760
4798
|
header.id
|
|
4761
4799
|
);
|
|
4762
4800
|
};
|
|
4763
4801
|
const stickyLeading = cn(cellDensity, sticky && "sticky top-0 z-20 bg-surface");
|
|
4764
|
-
const leadingHeaderCells = (rowSpan) => /* @__PURE__ */
|
|
4765
|
-
enableRowSelection && /* @__PURE__ */
|
|
4802
|
+
const leadingHeaderCells = (rowSpan) => /* @__PURE__ */ jsxs43(Fragment15, { children: [
|
|
4803
|
+
enableRowSelection && /* @__PURE__ */ jsx56(TableHead, { checkbox: true, rowSpan, className: stickyLeading, children: /* @__PURE__ */ jsx56(
|
|
4766
4804
|
Checkbox,
|
|
4767
4805
|
{
|
|
4768
4806
|
"aria-label": "Select all rows",
|
|
@@ -4771,15 +4809,15 @@ function DataTableInner({
|
|
|
4771
4809
|
onCheckedChange: (checked) => table.toggleAllPageRowsSelected(Boolean(checked))
|
|
4772
4810
|
}
|
|
4773
4811
|
) }),
|
|
4774
|
-
hasExpander && /* @__PURE__ */
|
|
4775
|
-
enableRowPinning && /* @__PURE__ */
|
|
4812
|
+
hasExpander && /* @__PURE__ */ jsx56(TableHead, { checkbox: true, rowSpan, className: stickyLeading, children: /* @__PURE__ */ jsx56("span", { className: "sr-only", children: "Expand" }) }),
|
|
4813
|
+
enableRowPinning && /* @__PURE__ */ jsx56(TableHead, { checkbox: true, rowSpan, className: stickyLeading, children: /* @__PURE__ */ jsx56("span", { className: "sr-only", children: "Pin" }) })
|
|
4776
4814
|
] });
|
|
4777
4815
|
const rowsToRender = virtualized ? virtualItems.map((item) => ({ row: bodyRows[item.index], index: item.index })) : null;
|
|
4778
4816
|
const totalRows = topRows.length + bodyRows.length + bottomRows.length;
|
|
4779
|
-
return /* @__PURE__ */
|
|
4780
|
-
showToolbar && /* @__PURE__ */
|
|
4781
|
-
/* @__PURE__ */
|
|
4782
|
-
enableGlobalFilter && /* @__PURE__ */
|
|
4817
|
+
return /* @__PURE__ */ jsxs43("div", { className: cn("flex w-full flex-col gap-2", wrapperClassName), children: [
|
|
4818
|
+
showToolbar && /* @__PURE__ */ jsxs43("div", { className: "flex items-center justify-between gap-2", children: [
|
|
4819
|
+
/* @__PURE__ */ jsxs43("div", { className: "flex items-center gap-2", children: [
|
|
4820
|
+
enableGlobalFilter && /* @__PURE__ */ jsx56(
|
|
4783
4821
|
SearchBar,
|
|
4784
4822
|
{
|
|
4785
4823
|
"aria-label": "Search table",
|
|
@@ -4792,8 +4830,8 @@ function DataTableInner({
|
|
|
4792
4830
|
),
|
|
4793
4831
|
toolbar
|
|
4794
4832
|
] }),
|
|
4795
|
-
/* @__PURE__ */
|
|
4796
|
-
enableDensityToggle && /* @__PURE__ */
|
|
4833
|
+
/* @__PURE__ */ jsxs43("div", { className: "flex items-center gap-2", children: [
|
|
4834
|
+
enableDensityToggle && /* @__PURE__ */ jsxs43(
|
|
4797
4835
|
Button,
|
|
4798
4836
|
{
|
|
4799
4837
|
type: "button",
|
|
@@ -4802,20 +4840,20 @@ function DataTableInner({
|
|
|
4802
4840
|
"aria-pressed": compact,
|
|
4803
4841
|
onClick: () => setDensity(compact ? "default" : "compact"),
|
|
4804
4842
|
children: [
|
|
4805
|
-
/* @__PURE__ */
|
|
4843
|
+
/* @__PURE__ */ jsx56(Rows, { size: 16, "aria-hidden": true }),
|
|
4806
4844
|
"Compact"
|
|
4807
4845
|
]
|
|
4808
4846
|
}
|
|
4809
4847
|
),
|
|
4810
|
-
enableGrouping && /* @__PURE__ */
|
|
4811
|
-
/* @__PURE__ */
|
|
4812
|
-
/* @__PURE__ */
|
|
4848
|
+
enableGrouping && /* @__PURE__ */ jsxs43(DropdownMenu, { children: [
|
|
4849
|
+
/* @__PURE__ */ jsx56(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs43(Button, { type: "button", variant: "outline", size: "sm", children: [
|
|
4850
|
+
/* @__PURE__ */ jsx56(Stack, { size: 16, "aria-hidden": true }),
|
|
4813
4851
|
"Group by"
|
|
4814
4852
|
] }) }),
|
|
4815
|
-
/* @__PURE__ */
|
|
4816
|
-
/* @__PURE__ */
|
|
4817
|
-
/* @__PURE__ */
|
|
4818
|
-
groupableColumns.map((column) => /* @__PURE__ */
|
|
4853
|
+
/* @__PURE__ */ jsxs43(DropdownMenuContent, { align: "end", children: [
|
|
4854
|
+
/* @__PURE__ */ jsx56(DropdownMenuLabel, { children: "Group rows by" }),
|
|
4855
|
+
/* @__PURE__ */ jsx56(DropdownMenuSeparator, {}),
|
|
4856
|
+
groupableColumns.map((column) => /* @__PURE__ */ jsx56(
|
|
4819
4857
|
DropdownMenuCheckboxItem,
|
|
4820
4858
|
{
|
|
4821
4859
|
checked: column.getIsGrouped(),
|
|
@@ -4826,15 +4864,15 @@ function DataTableInner({
|
|
|
4826
4864
|
))
|
|
4827
4865
|
] })
|
|
4828
4866
|
] }),
|
|
4829
|
-
enableColumnVisibility && /* @__PURE__ */
|
|
4830
|
-
/* @__PURE__ */
|
|
4831
|
-
/* @__PURE__ */
|
|
4867
|
+
enableColumnVisibility && /* @__PURE__ */ jsxs43(DropdownMenu, { children: [
|
|
4868
|
+
/* @__PURE__ */ jsx56(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs43(Button, { type: "button", variant: "outline", size: "sm", children: [
|
|
4869
|
+
/* @__PURE__ */ jsx56(Sliders, { size: 16, "aria-hidden": true }),
|
|
4832
4870
|
"Columns"
|
|
4833
4871
|
] }) }),
|
|
4834
|
-
/* @__PURE__ */
|
|
4835
|
-
/* @__PURE__ */
|
|
4836
|
-
/* @__PURE__ */
|
|
4837
|
-
hideableColumns.map((column) => /* @__PURE__ */
|
|
4872
|
+
/* @__PURE__ */ jsxs43(DropdownMenuContent, { align: "end", children: [
|
|
4873
|
+
/* @__PURE__ */ jsx56(DropdownMenuLabel, { children: "Toggle columns" }),
|
|
4874
|
+
/* @__PURE__ */ jsx56(DropdownMenuSeparator, {}),
|
|
4875
|
+
hideableColumns.map((column) => /* @__PURE__ */ jsx56(
|
|
4838
4876
|
DropdownMenuCheckboxItem,
|
|
4839
4877
|
{
|
|
4840
4878
|
checked: column.getIsVisible(),
|
|
@@ -4847,7 +4885,7 @@ function DataTableInner({
|
|
|
4847
4885
|
] })
|
|
4848
4886
|
] })
|
|
4849
4887
|
] }),
|
|
4850
|
-
/* @__PURE__ */
|
|
4888
|
+
/* @__PURE__ */ jsxs43(
|
|
4851
4889
|
Table,
|
|
4852
4890
|
{
|
|
4853
4891
|
ref,
|
|
@@ -4860,52 +4898,52 @@ function DataTableInner({
|
|
|
4860
4898
|
tabIndex: enableCellSelection ? 0 : void 0,
|
|
4861
4899
|
...tableProps,
|
|
4862
4900
|
children: [
|
|
4863
|
-
/* @__PURE__ */
|
|
4864
|
-
headerGroups.map((group, groupIndex) => /* @__PURE__ */
|
|
4901
|
+
/* @__PURE__ */ jsxs43(TableHeader, { children: [
|
|
4902
|
+
headerGroups.map((group, groupIndex) => /* @__PURE__ */ jsxs43(TableRow, { className: "hover:bg-transparent", children: [
|
|
4865
4903
|
groupIndex === 0 && leadingHeaderCells(headerGroups.length + (enableColumnFilters ? 1 : 0)),
|
|
4866
4904
|
group.headers.map(renderHeaderCell)
|
|
4867
4905
|
] }, group.id)),
|
|
4868
|
-
enableColumnFilters && /* @__PURE__ */
|
|
4906
|
+
enableColumnFilters && /* @__PURE__ */ jsx56(TableRow, { className: "hover:bg-transparent", children: leafColumns.map((column) => {
|
|
4869
4907
|
const pin = pinning(column, sized, true);
|
|
4870
|
-
return /* @__PURE__ */
|
|
4908
|
+
return /* @__PURE__ */ jsx56(
|
|
4871
4909
|
TableHead,
|
|
4872
4910
|
{
|
|
4873
4911
|
style: pin.style,
|
|
4874
4912
|
className: cn("h-auto py-2 font-normal", pin.className, sticky && !column.getIsPinned() && "bg-surface"),
|
|
4875
|
-
children: column.getCanFilter() ? /* @__PURE__ */
|
|
4913
|
+
children: column.getCanFilter() ? /* @__PURE__ */ jsx56(ColumnFilter, { column }) : null
|
|
4876
4914
|
},
|
|
4877
4915
|
column.id
|
|
4878
4916
|
);
|
|
4879
4917
|
}) })
|
|
4880
4918
|
] }),
|
|
4881
|
-
/* @__PURE__ */
|
|
4882
|
-
loading ? Array.from({ length: pageSize }, (_, index) => skeletonRow(`loading-${index}`)) : totalRows === 0 ? /* @__PURE__ */
|
|
4919
|
+
/* @__PURE__ */ jsxs43(TableBody, { children: [
|
|
4920
|
+
loading ? Array.from({ length: pageSize }, (_, index) => skeletonRow(`loading-${index}`)) : totalRows === 0 ? /* @__PURE__ */ jsx56(TableRow, { className: "hover:bg-transparent", children: /* @__PURE__ */ jsx56(TableCell, { colSpan: columnSpan, muted: true, className: "h-24 text-center", children: emptyState ?? "No results." }) }) : /* @__PURE__ */ jsxs43(Fragment15, { children: [
|
|
4883
4921
|
topRows.map((row, index) => renderRow(row, { pinned: "top", pinnedIndex: index, pinnedCount: topRows.length })),
|
|
4884
|
-
virtualized && paddingTop > 0 && /* @__PURE__ */
|
|
4922
|
+
virtualized && paddingTop > 0 && /* @__PURE__ */ jsx56("tr", { "aria-hidden": true, children: /* @__PURE__ */ jsx56("td", { colSpan: columnSpan, style: { height: paddingTop } }) }),
|
|
4885
4923
|
rowsToRender ? rowsToRender.map(({ row, index }) => renderRow(row, { virtualIndex: index })) : bodyRows.map((row) => renderRow(row)),
|
|
4886
|
-
virtualized && paddingBottom > 0 && /* @__PURE__ */
|
|
4924
|
+
virtualized && paddingBottom > 0 && /* @__PURE__ */ jsx56("tr", { "aria-hidden": true, children: /* @__PURE__ */ jsx56("td", { colSpan: columnSpan, style: { height: paddingBottom } }) }),
|
|
4887
4925
|
bottomRows.map(
|
|
4888
4926
|
(row, index) => renderRow(row, { pinned: "bottom", pinnedIndex: index, pinnedCount: bottomRows.length })
|
|
4889
4927
|
)
|
|
4890
4928
|
] }),
|
|
4891
|
-
infinite && /* @__PURE__ */
|
|
4929
|
+
infinite && /* @__PURE__ */ jsxs43(Fragment15, { children: [
|
|
4892
4930
|
loadingMore && Array.from({ length: 3 }, (_, index) => skeletonRow(`more-${index}`)),
|
|
4893
|
-
/* @__PURE__ */
|
|
4931
|
+
/* @__PURE__ */ jsx56("tr", { ref: sentinelRef, "aria-hidden": true, children: /* @__PURE__ */ jsx56("td", { colSpan: columnSpan, className: "h-px p-0" }) })
|
|
4894
4932
|
] })
|
|
4895
4933
|
] }),
|
|
4896
|
-
showFooter && /* @__PURE__ */
|
|
4897
|
-
leadingCount > 0 && /* @__PURE__ */
|
|
4934
|
+
showFooter && /* @__PURE__ */ jsx56(TableFooter, { children: table.getFooterGroups().map((group) => /* @__PURE__ */ jsxs43(TableRow, { className: "hover:bg-transparent", children: [
|
|
4935
|
+
leadingCount > 0 && /* @__PURE__ */ jsx56(TableCell, { colSpan: leadingCount, className: cellDensity }),
|
|
4898
4936
|
group.headers.map((header) => {
|
|
4899
4937
|
const { align } = getMeta(header.column.columnDef.meta);
|
|
4900
4938
|
const pin = pinning(header.column, sized);
|
|
4901
|
-
return /* @__PURE__ */
|
|
4939
|
+
return /* @__PURE__ */ jsx56(
|
|
4902
4940
|
TableCell,
|
|
4903
4941
|
{
|
|
4904
4942
|
align,
|
|
4905
4943
|
colSpan: header.colSpan > 1 ? header.colSpan : void 0,
|
|
4906
4944
|
style: pin.style,
|
|
4907
4945
|
className: cn("text-ui-label", pin.className, cellDensity),
|
|
4908
|
-
children: header.isPlaceholder ? null : /* @__PURE__ */
|
|
4946
|
+
children: header.isPlaceholder ? null : /* @__PURE__ */ jsx56(table.FlexRender, { footer: header })
|
|
4909
4947
|
},
|
|
4910
4948
|
header.id
|
|
4911
4949
|
);
|
|
@@ -4914,9 +4952,9 @@ function DataTableInner({
|
|
|
4914
4952
|
]
|
|
4915
4953
|
}
|
|
4916
4954
|
),
|
|
4917
|
-
(enableRowSelection || paginate && pageCount > 1) && /* @__PURE__ */
|
|
4918
|
-
/* @__PURE__ */
|
|
4919
|
-
paginate && pageCount > 1 && /* @__PURE__ */
|
|
4955
|
+
(enableRowSelection || paginate && pageCount > 1) && /* @__PURE__ */ jsxs43("div", { className: "flex items-center justify-between gap-2", children: [
|
|
4956
|
+
/* @__PURE__ */ jsx56("span", { className: "text-body-small text-secondary-muted-foreground", "aria-live": "polite", children: enableRowSelection ? `${selectedCount} of ${table.getCoreRowModel().rows.length} row(s) selected` : null }),
|
|
4957
|
+
paginate && pageCount > 1 && /* @__PURE__ */ jsx56(
|
|
4920
4958
|
Pagination,
|
|
4921
4959
|
{
|
|
4922
4960
|
page: pagination.pageIndex + 1,
|
|
@@ -4927,13 +4965,13 @@ function DataTableInner({
|
|
|
4927
4965
|
] })
|
|
4928
4966
|
] });
|
|
4929
4967
|
}
|
|
4930
|
-
var DataTable =
|
|
4968
|
+
var DataTable = React55.forwardRef(DataTableInner);
|
|
4931
4969
|
DataTable.displayName = "DataTable";
|
|
4932
4970
|
|
|
4933
4971
|
// src/components/Data Display/StatCard.tsx
|
|
4934
|
-
import * as
|
|
4972
|
+
import * as React56 from "react";
|
|
4935
4973
|
import { cva as cva6 } from "class-variance-authority";
|
|
4936
|
-
import { jsx as
|
|
4974
|
+
import { jsx as jsx57, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
4937
4975
|
var statCardVariants = cva6("flex min-w-0 flex-col gap-2 rounded-md border p-3", {
|
|
4938
4976
|
variants: {
|
|
4939
4977
|
variant: {
|
|
@@ -4947,26 +4985,26 @@ var statCardVariants = cva6("flex min-w-0 flex-col gap-2 rounded-md border p-3",
|
|
|
4947
4985
|
},
|
|
4948
4986
|
defaultVariants: { variant: "default" }
|
|
4949
4987
|
});
|
|
4950
|
-
var StatCard =
|
|
4951
|
-
({ className, variant, label, value, icon, caption, ...props }, ref) => /* @__PURE__ */
|
|
4952
|
-
/* @__PURE__ */
|
|
4953
|
-
/* @__PURE__ */
|
|
4954
|
-
icon && /* @__PURE__ */
|
|
4988
|
+
var StatCard = React56.forwardRef(
|
|
4989
|
+
({ className, variant, label, value, icon, caption, ...props }, ref) => /* @__PURE__ */ jsxs44("div", { ref, className: cn(statCardVariants({ variant }), className), ...props, children: [
|
|
4990
|
+
/* @__PURE__ */ jsx57("p", { className: "truncate text-ui-caption text-secondary-muted-foreground", children: label }),
|
|
4991
|
+
/* @__PURE__ */ jsxs44("p", { className: "flex items-center gap-2 text-body-base text-surface-foreground", children: [
|
|
4992
|
+
icon && /* @__PURE__ */ jsx57("span", { "aria-hidden": "true", className: "inline-flex size-6 shrink-0 items-center justify-center", children: icon }),
|
|
4955
4993
|
value
|
|
4956
4994
|
] }),
|
|
4957
|
-
caption && /* @__PURE__ */
|
|
4995
|
+
caption && /* @__PURE__ */ jsx57("p", { className: "text-ui-caption text-secondary-muted-foreground", children: caption })
|
|
4958
4996
|
] })
|
|
4959
4997
|
);
|
|
4960
4998
|
StatCard.displayName = "StatCard";
|
|
4961
4999
|
|
|
4962
5000
|
// src/components/Research-Specific/ActivityStructure.tsx
|
|
4963
|
-
import * as
|
|
5001
|
+
import * as React58 from "react";
|
|
4964
5002
|
|
|
4965
5003
|
// src/components/Tags & Badges/EditableTag.tsx
|
|
4966
|
-
import * as
|
|
5004
|
+
import * as React57 from "react";
|
|
4967
5005
|
import { Crown, Plus as Plus5, X as X6 } from "@phosphor-icons/react";
|
|
4968
5006
|
import { cva as cva7 } from "class-variance-authority";
|
|
4969
|
-
import { jsx as
|
|
5007
|
+
import { jsx as jsx58, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
4970
5008
|
var editableTagVariants = cva7(
|
|
4971
5009
|
"inline-flex h-6.5 items-center whitespace-nowrap rounded-sm py-1 text-ui-caption transition-colors",
|
|
4972
5010
|
{
|
|
@@ -4981,27 +5019,27 @@ var editableTagVariants = cva7(
|
|
|
4981
5019
|
defaultVariants: { type: "default" }
|
|
4982
5020
|
}
|
|
4983
5021
|
);
|
|
4984
|
-
var EditableTag =
|
|
5022
|
+
var EditableTag = React57.forwardRef(
|
|
4985
5023
|
({ className, type = "default", icon, onRemove, onClick, children, ...props }, ref) => {
|
|
4986
5024
|
const classes = cn(editableTagVariants({ type }), className);
|
|
4987
|
-
const leading = type === "add" ? /* @__PURE__ */
|
|
5025
|
+
const leading = type === "add" ? /* @__PURE__ */ jsx58(Plus5, { size: 12, "aria-hidden": true }) : icon !== void 0 ? icon : type === "default" ? /* @__PURE__ */ jsx58(Crown, { size: 12, weight: "fill", "aria-hidden": true }) : null;
|
|
4988
5026
|
if (type === "add" || type === "multiple" && onClick) {
|
|
4989
|
-
return /* @__PURE__ */
|
|
5027
|
+
return /* @__PURE__ */ jsxs45("button", { ref, type: "button", className: classes, onClick, ...props, children: [
|
|
4990
5028
|
leading,
|
|
4991
5029
|
children
|
|
4992
5030
|
] });
|
|
4993
5031
|
}
|
|
4994
|
-
return /* @__PURE__ */
|
|
5032
|
+
return /* @__PURE__ */ jsxs45("span", { ref, className: classes, ...props, children: [
|
|
4995
5033
|
leading,
|
|
4996
5034
|
children,
|
|
4997
|
-
onRemove && /* @__PURE__ */
|
|
5035
|
+
onRemove && /* @__PURE__ */ jsx58(
|
|
4998
5036
|
"button",
|
|
4999
5037
|
{
|
|
5000
5038
|
type: "button",
|
|
5001
5039
|
"aria-label": typeof children === "string" ? `Remove ${children}` : "Remove",
|
|
5002
5040
|
onClick: onRemove,
|
|
5003
5041
|
className: "inline-flex size-3 items-center justify-center rounded-xs",
|
|
5004
|
-
children: /* @__PURE__ */
|
|
5042
|
+
children: /* @__PURE__ */ jsx58(X6, { size: 12, "aria-hidden": true })
|
|
5005
5043
|
}
|
|
5006
5044
|
)
|
|
5007
5045
|
] });
|
|
@@ -5010,26 +5048,26 @@ var EditableTag = React56.forwardRef(
|
|
|
5010
5048
|
EditableTag.displayName = "EditableTag";
|
|
5011
5049
|
|
|
5012
5050
|
// src/components/Research-Specific/ActivityStructure.tsx
|
|
5013
|
-
import { jsx as
|
|
5014
|
-
var ActivityStructure =
|
|
5015
|
-
({ className, title = "Activity Structure", stats, sections, onRemoveTag, onAddTag, addTagLabel = "Add tag", action, children, ...props }, ref) => /* @__PURE__ */
|
|
5051
|
+
import { jsx as jsx59, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
5052
|
+
var ActivityStructure = React58.forwardRef(
|
|
5053
|
+
({ className, title = "Activity Structure", stats, sections, onRemoveTag, onAddTag, addTagLabel = "Add tag", action, children, ...props }, ref) => /* @__PURE__ */ jsxs46(
|
|
5016
5054
|
"section",
|
|
5017
5055
|
{
|
|
5018
5056
|
ref,
|
|
5019
5057
|
className: cn("flex w-full max-w-96.5 flex-col gap-4 rounded-xl bg-surface p-4", className),
|
|
5020
5058
|
...props,
|
|
5021
5059
|
children: [
|
|
5022
|
-
/* @__PURE__ */
|
|
5023
|
-
/* @__PURE__ */
|
|
5060
|
+
/* @__PURE__ */ jsxs46("div", { className: "flex items-center justify-between gap-2", children: [
|
|
5061
|
+
/* @__PURE__ */ jsx59("h3", { className: "text-body-section text-surface-foreground", children: title }),
|
|
5024
5062
|
action
|
|
5025
5063
|
] }),
|
|
5026
|
-
stats.length > 0 && /* @__PURE__ */
|
|
5027
|
-
sections?.map(({ id, heading, body, tags }) => /* @__PURE__ */
|
|
5028
|
-
/* @__PURE__ */
|
|
5029
|
-
/* @__PURE__ */
|
|
5030
|
-
(tags?.length || onAddTag) && /* @__PURE__ */
|
|
5031
|
-
tags?.map((tag) => /* @__PURE__ */
|
|
5032
|
-
onAddTag && /* @__PURE__ */
|
|
5064
|
+
stats.length > 0 && /* @__PURE__ */ jsx59("div", { className: "grid grid-cols-2 gap-3", children: stats.map(({ id, ...stat }) => /* @__PURE__ */ jsx59(StatCard, { ...stat }, id)) }),
|
|
5065
|
+
sections?.map(({ id, heading, body, tags }) => /* @__PURE__ */ jsxs46("div", { className: "flex flex-col gap-2", children: [
|
|
5066
|
+
/* @__PURE__ */ jsx59("h4", { className: "text-heading-h4 text-surface-foreground", children: heading }),
|
|
5067
|
+
/* @__PURE__ */ jsx59("div", { className: "text-body-base text-surface-foreground", children: body }),
|
|
5068
|
+
(tags?.length || onAddTag) && /* @__PURE__ */ jsxs46("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
5069
|
+
tags?.map((tag) => /* @__PURE__ */ jsx59(EditableTag, { type: "editable", onRemove: onRemoveTag && (() => onRemoveTag(id, tag)), children: tag }, tag)),
|
|
5070
|
+
onAddTag && /* @__PURE__ */ jsx59(EditableTag, { type: "add", onClick: () => onAddTag(id), children: addTagLabel })
|
|
5033
5071
|
] })
|
|
5034
5072
|
] }, id)),
|
|
5035
5073
|
children
|
|
@@ -5040,10 +5078,10 @@ var ActivityStructure = React57.forwardRef(
|
|
|
5040
5078
|
ActivityStructure.displayName = "ActivityStructure";
|
|
5041
5079
|
|
|
5042
5080
|
// src/components/Tags & Badges/Badge.tsx
|
|
5043
|
-
import * as
|
|
5081
|
+
import * as React59 from "react";
|
|
5044
5082
|
import { DotsSixVertical as DotsSixVertical5, RadioButton as RadioButton3 } from "@phosphor-icons/react";
|
|
5045
5083
|
import { cva as cva8 } from "class-variance-authority";
|
|
5046
|
-
import { jsx as
|
|
5084
|
+
import { jsx as jsx60, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
5047
5085
|
var roleTagVariants = cva8(
|
|
5048
5086
|
"group inline-flex h-6 items-center whitespace-nowrap rounded-sm py-1 text-ui-caption transition-colors",
|
|
5049
5087
|
{
|
|
@@ -5069,11 +5107,11 @@ var roleTagVariants = cva8(
|
|
|
5069
5107
|
defaultVariants: { type: "primary", selected: false }
|
|
5070
5108
|
}
|
|
5071
5109
|
);
|
|
5072
|
-
var Badge =
|
|
5110
|
+
var Badge = React59.forwardRef(
|
|
5073
5111
|
({ className, type = "primary", selected = false, onClick, children, ...props }, ref) => {
|
|
5074
5112
|
const classes = cn(roleTagVariants({ type, selected: type === "interactable" ? selected : false }), className);
|
|
5075
5113
|
if (type === "interactable") {
|
|
5076
|
-
return /* @__PURE__ */
|
|
5114
|
+
return /* @__PURE__ */ jsxs47(
|
|
5077
5115
|
"button",
|
|
5078
5116
|
{
|
|
5079
5117
|
ref,
|
|
@@ -5083,15 +5121,15 @@ var Badge = React58.forwardRef(
|
|
|
5083
5121
|
onClick,
|
|
5084
5122
|
...props,
|
|
5085
5123
|
children: [
|
|
5086
|
-
/* @__PURE__ */
|
|
5124
|
+
/* @__PURE__ */ jsx60(DotsSixVertical5, { size: 16, "aria-hidden": true, className: "hidden shrink-0 group-hover:block" }),
|
|
5087
5125
|
children
|
|
5088
5126
|
]
|
|
5089
5127
|
}
|
|
5090
5128
|
);
|
|
5091
5129
|
}
|
|
5092
|
-
return /* @__PURE__ */
|
|
5093
|
-
type === "question" && /* @__PURE__ */
|
|
5094
|
-
type === "id" && /* @__PURE__ */
|
|
5130
|
+
return /* @__PURE__ */ jsxs47("span", { ref, className: classes, ...props, children: [
|
|
5131
|
+
type === "question" && /* @__PURE__ */ jsx60(RadioButton3, { size: 16, weight: "fill", "aria-hidden": true }),
|
|
5132
|
+
type === "id" && /* @__PURE__ */ jsx60("span", { className: "text-secondary-muted-foreground", children: "ID" }),
|
|
5095
5133
|
children
|
|
5096
5134
|
] });
|
|
5097
5135
|
}
|
|
@@ -5155,6 +5193,8 @@ export {
|
|
|
5155
5193
|
InputWithAction,
|
|
5156
5194
|
Label,
|
|
5157
5195
|
MediaInfo,
|
|
5196
|
+
NavRail,
|
|
5197
|
+
NavRailItem,
|
|
5158
5198
|
NumberInput,
|
|
5159
5199
|
OpenEndAnswer,
|
|
5160
5200
|
Pagination,
|