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