@discuss-ds/ui 0.24.1 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/index.cjs +60 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +196 -141
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1046,13 +1046,14 @@ import { Tabs as TabsPrimitive2 } from "radix-ui";
|
|
|
1046
1046
|
import * as React19 from "react";
|
|
1047
1047
|
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
1048
1048
|
import { cva as cva3 } from "class-variance-authority";
|
|
1049
|
-
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1049
|
+
import { jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1050
1050
|
var TabNavigationContext = React19.createContext("filter");
|
|
1051
1051
|
var tabNavigationVariants = cva3("inline-flex items-start gap-1 p-0.5", {
|
|
1052
1052
|
variants: {
|
|
1053
1053
|
variant: {
|
|
1054
|
-
|
|
1055
|
-
|
|
1054
|
+
// `relative`: the sliding indicator is positioned against the list.
|
|
1055
|
+
filter: "relative rounded-full border border-border bg-surface",
|
|
1056
|
+
toggle: "relative rounded-md bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5",
|
|
1056
1057
|
underline: "items-stretch p-0"
|
|
1057
1058
|
}
|
|
1058
1059
|
},
|
|
@@ -1060,16 +1061,70 @@ var tabNavigationVariants = cva3("inline-flex items-start gap-1 p-0.5", {
|
|
|
1060
1061
|
});
|
|
1061
1062
|
var Tabs = TabsPrimitive.Root;
|
|
1062
1063
|
var TabsContent = TabsPrimitive.Content;
|
|
1064
|
+
var indicatorClasses = {
|
|
1065
|
+
filter: "rounded-full bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5",
|
|
1066
|
+
toggle: "rounded-sm bg-surface"
|
|
1067
|
+
};
|
|
1063
1068
|
var TabNavigation = React19.forwardRef(
|
|
1064
|
-
({ className, variant = "filter", ...props },
|
|
1069
|
+
({ className, variant = "filter", children, ...props }, forwardedRef) => {
|
|
1070
|
+
const kind = variant ?? "filter";
|
|
1071
|
+
const slides = kind !== "underline";
|
|
1072
|
+
const listRef = React19.useRef(null);
|
|
1073
|
+
const [box, setBox] = React19.useState(null);
|
|
1074
|
+
const [animate, setAnimate] = React19.useState(false);
|
|
1075
|
+
const setRefs = React19.useCallback(
|
|
1076
|
+
(node) => {
|
|
1077
|
+
listRef.current = node;
|
|
1078
|
+
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
1079
|
+
else if (forwardedRef) forwardedRef.current = node;
|
|
1080
|
+
},
|
|
1081
|
+
[forwardedRef]
|
|
1082
|
+
);
|
|
1083
|
+
React19.useLayoutEffect(() => {
|
|
1084
|
+
const list = listRef.current;
|
|
1085
|
+
if (!slides || !list) return;
|
|
1086
|
+
const measure = () => {
|
|
1087
|
+
const active = list.querySelector('[role="tab"][data-state="active"]');
|
|
1088
|
+
const next = active ? { left: active.offsetLeft, top: active.offsetTop, width: active.offsetWidth, height: active.offsetHeight } : null;
|
|
1089
|
+
setBox((prev) => prev && next && prev.left === next.left && prev.top === next.top && prev.width === next.width && prev.height === next.height ? prev : next);
|
|
1090
|
+
};
|
|
1091
|
+
measure();
|
|
1092
|
+
const mutations = new MutationObserver(measure);
|
|
1093
|
+
mutations.observe(list, { attributes: true, attributeFilter: ["data-state"], subtree: true, childList: true });
|
|
1094
|
+
const resizes = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(measure);
|
|
1095
|
+
resizes?.observe(list);
|
|
1096
|
+
const frame = requestAnimationFrame(() => setAnimate(true));
|
|
1097
|
+
return () => {
|
|
1098
|
+
mutations.disconnect();
|
|
1099
|
+
resizes?.disconnect();
|
|
1100
|
+
cancelAnimationFrame(frame);
|
|
1101
|
+
};
|
|
1102
|
+
}, [slides]);
|
|
1103
|
+
return /* @__PURE__ */ jsx20(TabNavigationContext.Provider, { value: kind, children: /* @__PURE__ */ jsxs14(TabsPrimitive.List, { ref: setRefs, className: cn(tabNavigationVariants({ variant }), className), ...props, children: [
|
|
1104
|
+
slides && box && /* @__PURE__ */ jsx20(
|
|
1105
|
+
"span",
|
|
1106
|
+
{
|
|
1107
|
+
"aria-hidden": true,
|
|
1108
|
+
"data-slot": "tab-indicator",
|
|
1109
|
+
className: cn(
|
|
1110
|
+
"pointer-events-none absolute",
|
|
1111
|
+
indicatorClasses[kind],
|
|
1112
|
+
animate && "transition-[left,top,width,height] duration-200 ease-out motion-reduce:transition-none"
|
|
1113
|
+
),
|
|
1114
|
+
style: { left: box.left, top: box.top, width: box.width, height: box.height }
|
|
1115
|
+
}
|
|
1116
|
+
),
|
|
1117
|
+
children
|
|
1118
|
+
] }) });
|
|
1119
|
+
}
|
|
1065
1120
|
);
|
|
1066
1121
|
TabNavigation.displayName = "TabNavigation";
|
|
1067
1122
|
|
|
1068
1123
|
// src/components/Navigation/TabItem.tsx
|
|
1069
1124
|
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1070
1125
|
var base = "inline-flex h-7 items-center justify-center gap-1 whitespace-nowrap px-2.5 py-1 text-ui-label transition-colors disabled:pointer-events-none disabled:opacity-50";
|
|
1071
|
-
var filter = "rounded-full text-surface-foreground hover:text-accent data-[state=active]:
|
|
1072
|
-
var toggle = "rounded-sm text-secondary-muted-foreground hover:text-surface-foreground data-[state=active]:
|
|
1126
|
+
var filter = "relative rounded-full text-surface-foreground hover:text-accent data-[state=active]:hover:bg-accent-soft data-[state=active]:hover:text-accent-soft-foreground disabled:text-muted-foreground";
|
|
1127
|
+
var toggle = "relative rounded-sm text-secondary-muted-foreground hover:text-surface-foreground data-[state=active]:text-surface-foreground";
|
|
1073
1128
|
var underline = "relative h-full rounded-none px-4 py-3 font-medium text-secondary-muted-foreground hover:text-surface-foreground data-[state=active]:font-semibold data-[state=active]:text-surface-foreground after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 data-[state=active]:after:bg-accent";
|
|
1074
1129
|
var TabItem = React20.forwardRef(
|
|
1075
1130
|
({ className, ...props }, ref) => {
|
|
@@ -1087,7 +1142,7 @@ var TabItem = React20.forwardRef(
|
|
|
1087
1142
|
TabItem.displayName = "TabItem";
|
|
1088
1143
|
|
|
1089
1144
|
// src/components/Forms & Data Entry/TimePicker.tsx
|
|
1090
|
-
import { jsx as jsx22, jsxs as
|
|
1145
|
+
import { jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1091
1146
|
var TimeItem = React21.forwardRef(
|
|
1092
1147
|
({ className, recommended, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
1093
1148
|
ToggleGroupPrimitive.Item,
|
|
@@ -1128,7 +1183,7 @@ function TimePicker({
|
|
|
1128
1183
|
}, []);
|
|
1129
1184
|
const hours = Array.from({ length: 12 }, (_, i) => i + 1);
|
|
1130
1185
|
const minutes = Array.from({ length: Math.ceil(60 / minuteStep) }, (_, i) => i * minuteStep);
|
|
1131
|
-
return /* @__PURE__ */
|
|
1186
|
+
return /* @__PURE__ */ jsxs15("div", { ref: root, className: cn("flex w-45 flex-col gap-4 pt-2", className), children: [
|
|
1132
1187
|
/* @__PURE__ */ jsx22("p", { className: "text-ui-label text-surface-foreground", children: "Select Time" }),
|
|
1133
1188
|
/* @__PURE__ */ jsx22(
|
|
1134
1189
|
Tabs,
|
|
@@ -1138,7 +1193,7 @@ function TimePicker({
|
|
|
1138
1193
|
children: /* @__PURE__ */ jsx22(TabNavigation, { variant: "toggle", "aria-label": "AM or PM", className: "self-start", children: ["AM", "PM"].map((period) => /* @__PURE__ */ jsx22(TabItem, { value: period, children: period }, period)) })
|
|
1139
1194
|
}
|
|
1140
1195
|
),
|
|
1141
|
-
/* @__PURE__ */
|
|
1196
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex h-47.5 w-full items-start gap-3", children: [
|
|
1142
1197
|
/* @__PURE__ */ jsx22(
|
|
1143
1198
|
ToggleGroupPrimitive.Root,
|
|
1144
1199
|
{
|
|
@@ -1185,7 +1240,7 @@ function TimePicker({
|
|
|
1185
1240
|
}
|
|
1186
1241
|
|
|
1187
1242
|
// src/components/Forms & Data Entry/DateTimePicker.tsx
|
|
1188
|
-
import { Fragment as Fragment3, jsx as jsx23, jsxs as
|
|
1243
|
+
import { Fragment as Fragment3, jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1189
1244
|
function toTimeValue(date) {
|
|
1190
1245
|
if (!date) return void 0;
|
|
1191
1246
|
const hours = date.getHours();
|
|
@@ -1212,7 +1267,7 @@ function DateTimePicker({
|
|
|
1212
1267
|
if (!date) return onApply?.(void 0);
|
|
1213
1268
|
onApply?.(showTime ? combine(date, time ?? { hour: 12, minute: 0, period: "AM" }) : date);
|
|
1214
1269
|
};
|
|
1215
|
-
return /* @__PURE__ */
|
|
1270
|
+
return /* @__PURE__ */ jsxs16(
|
|
1216
1271
|
"div",
|
|
1217
1272
|
{
|
|
1218
1273
|
className: cn(
|
|
@@ -1220,14 +1275,14 @@ function DateTimePicker({
|
|
|
1220
1275
|
className
|
|
1221
1276
|
),
|
|
1222
1277
|
children: [
|
|
1223
|
-
/* @__PURE__ */
|
|
1278
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-6", children: [
|
|
1224
1279
|
/* @__PURE__ */ jsx23(Calendar, { mode: "single", selected: date, onSelect: setDate, defaultMonth: date, ...calendarProps }),
|
|
1225
|
-
showTime && /* @__PURE__ */
|
|
1280
|
+
showTime && /* @__PURE__ */ jsxs16(Fragment3, { children: [
|
|
1226
1281
|
/* @__PURE__ */ jsx23("div", { className: "h-70 w-px self-center bg-border", "aria-hidden": "true" }),
|
|
1227
1282
|
/* @__PURE__ */ jsx23(TimePicker, { value: time, onValueChange: setTime, ...timePickerProps })
|
|
1228
1283
|
] })
|
|
1229
1284
|
] }),
|
|
1230
|
-
/* @__PURE__ */
|
|
1285
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex items-center justify-end gap-2", children: [
|
|
1231
1286
|
/* @__PURE__ */ jsx23(
|
|
1232
1287
|
Button,
|
|
1233
1288
|
{
|
|
@@ -1253,8 +1308,8 @@ var DatePicker = React22.forwardRef(
|
|
|
1253
1308
|
const [open, setOpen] = React22.useState(false);
|
|
1254
1309
|
const [internal, setInternal] = React22.useState(defaultValue);
|
|
1255
1310
|
const current = value ?? internal;
|
|
1256
|
-
return /* @__PURE__ */ jsx23(Field, { label, className: cn("w-75", className), children: (control) => /* @__PURE__ */
|
|
1257
|
-
/* @__PURE__ */ jsx23(PopoverPrimitive.Trigger, { asChild: true, children: /* @__PURE__ */
|
|
1311
|
+
return /* @__PURE__ */ jsx23(Field, { label, className: cn("w-75", className), children: (control) => /* @__PURE__ */ jsxs16(PopoverPrimitive.Root, { open, onOpenChange: setOpen, children: [
|
|
1312
|
+
/* @__PURE__ */ jsx23(PopoverPrimitive.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs16(
|
|
1258
1313
|
"button",
|
|
1259
1314
|
{
|
|
1260
1315
|
ref,
|
|
@@ -1387,7 +1442,7 @@ FormMessage.displayName = "FormMessage";
|
|
|
1387
1442
|
// src/components/Forms & Data Entry/InlineEdit.tsx
|
|
1388
1443
|
import * as React24 from "react";
|
|
1389
1444
|
import { PencilSimple, WarningCircle as WarningCircle2 } from "@phosphor-icons/react";
|
|
1390
|
-
import { Fragment as Fragment4, jsx as jsx25, jsxs as
|
|
1445
|
+
import { Fragment as Fragment4, jsx as jsx25, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1391
1446
|
function limitsText(min, max) {
|
|
1392
1447
|
if (min !== void 0 && max !== void 0) return `${min}\u2013${max} characters`;
|
|
1393
1448
|
if (min !== void 0) return `At least ${min} characters`;
|
|
@@ -1476,7 +1531,7 @@ var InlineEdit = React24.forwardRef(
|
|
|
1476
1531
|
ref,
|
|
1477
1532
|
className: cn(fill ? "flex w-full min-w-0" : "inline-flex min-w-0 max-w-full", editing && (error || showLimits) && "flex-col gap-1.5", className),
|
|
1478
1533
|
...props,
|
|
1479
|
-
children: editing ? /* @__PURE__ */
|
|
1534
|
+
children: editing ? /* @__PURE__ */ jsxs17(Fragment4, { children: [
|
|
1480
1535
|
React24.createElement(multiline ? "textarea" : "input", {
|
|
1481
1536
|
ref: fieldRef,
|
|
1482
1537
|
value: draft,
|
|
@@ -1510,26 +1565,26 @@ var InlineEdit = React24.forwardRef(
|
|
|
1510
1565
|
if (!cancelled.current) finish(true, false);
|
|
1511
1566
|
}
|
|
1512
1567
|
}),
|
|
1513
|
-
(error || showLimits) && /* @__PURE__ */
|
|
1568
|
+
(error || showLimits) && /* @__PURE__ */ jsxs17(
|
|
1514
1569
|
"p",
|
|
1515
1570
|
{
|
|
1516
1571
|
id: errorId,
|
|
1517
1572
|
role: error ? "alert" : void 0,
|
|
1518
1573
|
className: cn("flex items-start justify-between gap-2 px-3 text-ui-caption", error ? "text-destructive" : "text-secondary-muted-foreground"),
|
|
1519
1574
|
children: [
|
|
1520
|
-
/* @__PURE__ */
|
|
1575
|
+
/* @__PURE__ */ jsxs17("span", { className: "flex items-start gap-2", children: [
|
|
1521
1576
|
error && /* @__PURE__ */ jsx25(WarningCircle2, { size: 16, "aria-hidden": true, className: "shrink-0" }),
|
|
1522
1577
|
showLimits ? limitsText(minLength, maxLength) : error,
|
|
1523
1578
|
showLimits && error && /* @__PURE__ */ jsx25("span", { className: "sr-only", children: error })
|
|
1524
1579
|
] }),
|
|
1525
|
-
showLimits && /* @__PURE__ */
|
|
1580
|
+
showLimits && /* @__PURE__ */ jsxs17("span", { "aria-hidden": true, className: "shrink-0 tabular-nums", children: [
|
|
1526
1581
|
draft.length,
|
|
1527
1582
|
maxLength !== void 0 && `/${maxLength}`
|
|
1528
1583
|
] })
|
|
1529
1584
|
]
|
|
1530
1585
|
}
|
|
1531
1586
|
)
|
|
1532
|
-
] }) : /* @__PURE__ */
|
|
1587
|
+
] }) : /* @__PURE__ */ jsxs17(
|
|
1533
1588
|
"button",
|
|
1534
1589
|
{
|
|
1535
1590
|
ref: readRef,
|
|
@@ -1597,9 +1652,9 @@ Input.displayName = "Input";
|
|
|
1597
1652
|
|
|
1598
1653
|
// src/components/Forms & Data Entry/InputWithAction.tsx
|
|
1599
1654
|
import * as React26 from "react";
|
|
1600
|
-
import { jsx as jsx27, jsxs as
|
|
1655
|
+
import { jsx as jsx27, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1601
1656
|
var InputWithAction = React26.forwardRef(
|
|
1602
|
-
({ className, actionLabel, onAction, tags, status = "default", label, description, message, id, disabled, placeholder, ...props }, ref) => /* @__PURE__ */ jsx27(Field, { label, description, message, status, id, children: (control) => /* @__PURE__ */
|
|
1657
|
+
({ className, actionLabel, onAction, tags, status = "default", label, description, message, id, disabled, placeholder, ...props }, ref) => /* @__PURE__ */ jsx27(Field, { label, description, message, status, id, children: (control) => /* @__PURE__ */ jsxs18(
|
|
1603
1658
|
"div",
|
|
1604
1659
|
{
|
|
1605
1660
|
className: cn(
|
|
@@ -1633,7 +1688,7 @@ InputWithAction.displayName = "InputWithAction";
|
|
|
1633
1688
|
// src/components/Forms & Data Entry/NumberInput.tsx
|
|
1634
1689
|
import * as React27 from "react";
|
|
1635
1690
|
import { Minus as Minus2, Plus as Plus2 } from "@phosphor-icons/react";
|
|
1636
|
-
import { jsx as jsx28, jsxs as
|
|
1691
|
+
import { jsx as jsx28, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1637
1692
|
var NumberInput = React27.forwardRef(
|
|
1638
1693
|
({
|
|
1639
1694
|
className,
|
|
@@ -1660,7 +1715,7 @@ var NumberInput = React27.forwardRef(
|
|
|
1660
1715
|
setInternal(clamped);
|
|
1661
1716
|
onValueChange?.(clamped);
|
|
1662
1717
|
};
|
|
1663
|
-
return /* @__PURE__ */ jsx28(Field, { label, description, message, status, id, className: "w-50", children: (control) => /* @__PURE__ */
|
|
1718
|
+
return /* @__PURE__ */ jsx28(Field, { label, description, message, status, id, className: "w-50", children: (control) => /* @__PURE__ */ jsxs19(
|
|
1664
1719
|
"div",
|
|
1665
1720
|
{
|
|
1666
1721
|
className: cn(
|
|
@@ -1683,7 +1738,7 @@ var NumberInput = React27.forwardRef(
|
|
|
1683
1738
|
children: /* @__PURE__ */ jsx28(Minus2, { size: 16, "aria-hidden": true })
|
|
1684
1739
|
}
|
|
1685
1740
|
),
|
|
1686
|
-
/* @__PURE__ */
|
|
1741
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center justify-center gap-1 text-center", children: [
|
|
1687
1742
|
/* @__PURE__ */ jsx28(
|
|
1688
1743
|
"input",
|
|
1689
1744
|
{
|
|
@@ -1738,7 +1793,7 @@ NumberInput.displayName = "NumberInput";
|
|
|
1738
1793
|
// src/components/Forms & Data Entry/SearchBar.tsx
|
|
1739
1794
|
import * as React28 from "react";
|
|
1740
1795
|
import { MagnifyingGlass, X as X2 } from "@phosphor-icons/react";
|
|
1741
|
-
import { jsx as jsx29, jsxs as
|
|
1796
|
+
import { jsx as jsx29, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1742
1797
|
var SearchBar = React28.forwardRef(
|
|
1743
1798
|
({ className, value, defaultValue, onChange, onClear, clearLabel = "Clear search", disabled, ...props }, ref) => {
|
|
1744
1799
|
const innerRef = React28.useRef(null);
|
|
@@ -1755,7 +1810,7 @@ var SearchBar = React28.forwardRef(
|
|
|
1755
1810
|
}
|
|
1756
1811
|
onClear?.();
|
|
1757
1812
|
};
|
|
1758
|
-
return /* @__PURE__ */
|
|
1813
|
+
return /* @__PURE__ */ jsxs20(
|
|
1759
1814
|
"div",
|
|
1760
1815
|
{
|
|
1761
1816
|
className: cn(
|
|
@@ -1805,13 +1860,13 @@ SearchBar.displayName = "SearchBar";
|
|
|
1805
1860
|
import * as React29 from "react";
|
|
1806
1861
|
import { CaretDown as CaretDown3 } from "@phosphor-icons/react";
|
|
1807
1862
|
import { Select as SelectPrimitive } from "radix-ui";
|
|
1808
|
-
import { jsx as jsx30, jsxs as
|
|
1863
|
+
import { jsx as jsx30, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1809
1864
|
var Select = SelectPrimitive.Root;
|
|
1810
1865
|
var SelectValue = SelectPrimitive.Value;
|
|
1811
1866
|
var SelectGroup = SelectPrimitive.Group;
|
|
1812
1867
|
var CheckIcon = () => /* @__PURE__ */ jsx30("svg", { width: "10", height: "8", viewBox: "0 0 10 8", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx30("path", { d: "M1 4L3.5 6.5L9 1", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1813
1868
|
var SelectTrigger = React29.forwardRef(
|
|
1814
|
-
({ className, children, icon, ...props }, ref) => /* @__PURE__ */
|
|
1869
|
+
({ className, children, icon, ...props }, ref) => /* @__PURE__ */ jsxs21(
|
|
1815
1870
|
SelectPrimitive.Trigger,
|
|
1816
1871
|
{
|
|
1817
1872
|
ref,
|
|
@@ -1853,7 +1908,7 @@ var SelectContent = React29.forwardRef(
|
|
|
1853
1908
|
);
|
|
1854
1909
|
SelectContent.displayName = "SelectContent";
|
|
1855
1910
|
var SelectItem = React29.forwardRef(
|
|
1856
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
1911
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs21(
|
|
1857
1912
|
SelectPrimitive.Item,
|
|
1858
1913
|
{
|
|
1859
1914
|
ref,
|
|
@@ -1875,7 +1930,7 @@ SelectItem.displayName = "SelectItem";
|
|
|
1875
1930
|
// src/components/Forms & Data Entry/Slider.tsx
|
|
1876
1931
|
import * as React30 from "react";
|
|
1877
1932
|
import { Slider as SliderPrimitive } from "radix-ui";
|
|
1878
|
-
import { jsx as jsx31, jsxs as
|
|
1933
|
+
import { jsx as jsx31, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1879
1934
|
var Slider = React30.forwardRef(
|
|
1880
1935
|
({
|
|
1881
1936
|
className,
|
|
@@ -1894,12 +1949,12 @@ var Slider = React30.forwardRef(
|
|
|
1894
1949
|
const [internal, setInternal] = React30.useState(defaultValue ?? [min]);
|
|
1895
1950
|
const thumbValues = value ?? internal;
|
|
1896
1951
|
const hasHeader = label != null || showRange;
|
|
1897
|
-
return /* @__PURE__ */
|
|
1898
|
-
hasHeader && /* @__PURE__ */
|
|
1952
|
+
return /* @__PURE__ */ jsxs22("div", { className: cn("flex w-full flex-col gap-2", className), children: [
|
|
1953
|
+
hasHeader && /* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between text-secondary-muted-foreground", children: [
|
|
1899
1954
|
label != null ? /* @__PURE__ */ jsx31("span", { className: "text-ui-label text-surface-foreground", children: label }) : /* @__PURE__ */ jsx31("span", { className: "text-ui-caption", children: min }),
|
|
1900
1955
|
/* @__PURE__ */ jsx31("span", { className: "text-body-small", children: max })
|
|
1901
1956
|
] }),
|
|
1902
|
-
/* @__PURE__ */
|
|
1957
|
+
/* @__PURE__ */ jsxs22(
|
|
1903
1958
|
SliderPrimitive.Root,
|
|
1904
1959
|
{
|
|
1905
1960
|
ref,
|
|
@@ -1980,12 +2035,12 @@ Textarea.displayName = "Textarea";
|
|
|
1980
2035
|
import * as React32 from "react";
|
|
1981
2036
|
import { X as X3 } from "@phosphor-icons/react";
|
|
1982
2037
|
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
1983
|
-
import { jsx as jsx33, jsxs as
|
|
2038
|
+
import { jsx as jsx33, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
1984
2039
|
var Dialog = DialogPrimitive.Root;
|
|
1985
2040
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
1986
2041
|
var DialogClose = DialogPrimitive.Close;
|
|
1987
2042
|
var DialogContent = React32.forwardRef(
|
|
1988
|
-
({ className, children, closeLabel = "Close", hideClose, ...props }, ref) => /* @__PURE__ */
|
|
2043
|
+
({ className, children, closeLabel = "Close", hideClose, ...props }, ref) => /* @__PURE__ */ jsxs23(DialogPrimitive.Portal, { children: [
|
|
1989
2044
|
/* @__PURE__ */ jsx33(
|
|
1990
2045
|
DialogPrimitive.Overlay,
|
|
1991
2046
|
{
|
|
@@ -1993,7 +2048,7 @@ var DialogContent = React32.forwardRef(
|
|
|
1993
2048
|
className: "fixed inset-0 bg-primary/30"
|
|
1994
2049
|
}
|
|
1995
2050
|
),
|
|
1996
|
-
/* @__PURE__ */
|
|
2051
|
+
/* @__PURE__ */ jsxs23(
|
|
1997
2052
|
DialogPrimitive.Content,
|
|
1998
2053
|
{
|
|
1999
2054
|
ref,
|
|
@@ -2039,7 +2094,7 @@ import * as React33 from "react";
|
|
|
2039
2094
|
import { CheckCircle as CheckCircle2, Info, Warning, WarningCircle as WarningCircle3, X as X4 } from "@phosphor-icons/react";
|
|
2040
2095
|
import { cva as cva4 } from "class-variance-authority";
|
|
2041
2096
|
import { Toast as ToastPrimitive } from "radix-ui";
|
|
2042
|
-
import { jsx as jsx34, jsxs as
|
|
2097
|
+
import { jsx as jsx34, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2043
2098
|
var toastVariants = cva4("border", {
|
|
2044
2099
|
variants: {
|
|
2045
2100
|
variant: {
|
|
@@ -2084,7 +2139,7 @@ ToastViewport.displayName = "ToastViewport";
|
|
|
2084
2139
|
var Toast = React33.forwardRef(
|
|
2085
2140
|
({ className, variant = "info", title, description, action, closeLabel = "Close", children, ...props }, ref) => {
|
|
2086
2141
|
const v = variant ?? "info";
|
|
2087
|
-
return /* @__PURE__ */
|
|
2142
|
+
return /* @__PURE__ */ jsxs24(
|
|
2088
2143
|
ToastPrimitive.Root,
|
|
2089
2144
|
{
|
|
2090
2145
|
ref,
|
|
@@ -2093,7 +2148,7 @@ var Toast = React33.forwardRef(
|
|
|
2093
2148
|
...props,
|
|
2094
2149
|
children: [
|
|
2095
2150
|
/* @__PURE__ */ jsx34(VariantIcon, { variant: v, size: 20 }),
|
|
2096
|
-
/* @__PURE__ */
|
|
2151
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex min-w-0 flex-1 flex-col gap-1 text-body-small", children: [
|
|
2097
2152
|
title != null && /* @__PURE__ */ jsx34(ToastPrimitive.Title, { className: cn("font-semibold", titleColour[v]), children: title }),
|
|
2098
2153
|
description != null && /* @__PURE__ */ jsx34(ToastPrimitive.Description, { className: "text-secondary-muted-foreground", children: description }),
|
|
2099
2154
|
children,
|
|
@@ -2117,7 +2172,7 @@ var ToastAction = ToastPrimitive.Action;
|
|
|
2117
2172
|
var ToastInline = React33.forwardRef(
|
|
2118
2173
|
({ className, variant = "info", onClose, closeLabel = "Close", children, ...props }, ref) => {
|
|
2119
2174
|
const v = variant ?? "info";
|
|
2120
|
-
return /* @__PURE__ */
|
|
2175
|
+
return /* @__PURE__ */ jsxs24(
|
|
2121
2176
|
"div",
|
|
2122
2177
|
{
|
|
2123
2178
|
ref,
|
|
@@ -2138,14 +2193,14 @@ ToastInline.displayName = "ToastInline";
|
|
|
2138
2193
|
// src/components/Overlays & Feedback/Tooltip.tsx
|
|
2139
2194
|
import * as React34 from "react";
|
|
2140
2195
|
import { Tooltip as TooltipPrimitive } from "radix-ui";
|
|
2141
|
-
import { Fragment as Fragment5, jsx as jsx35, jsxs as
|
|
2196
|
+
import { Fragment as Fragment5, jsx as jsx35, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2142
2197
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
2143
2198
|
var Tooltip = TooltipPrimitive.Root;
|
|
2144
2199
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
2145
2200
|
var TooltipContent = React34.forwardRef(
|
|
2146
2201
|
({ className, sideOffset = 4, title, description, action, arrow = true, children, ...props }, ref) => {
|
|
2147
2202
|
const detailed = title != null || description != null;
|
|
2148
|
-
return /* @__PURE__ */ jsx35(TooltipPrimitive.Portal, { children: /* @__PURE__ */
|
|
2203
|
+
return /* @__PURE__ */ jsx35(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs25(
|
|
2149
2204
|
TooltipPrimitive.Content,
|
|
2150
2205
|
{
|
|
2151
2206
|
ref,
|
|
@@ -2159,7 +2214,7 @@ var TooltipContent = React34.forwardRef(
|
|
|
2159
2214
|
),
|
|
2160
2215
|
...props,
|
|
2161
2216
|
children: [
|
|
2162
|
-
detailed ? /* @__PURE__ */
|
|
2217
|
+
detailed ? /* @__PURE__ */ jsxs25(Fragment5, { children: [
|
|
2163
2218
|
title != null && /* @__PURE__ */ jsx35("p", { className: "text-xs leading-4 font-semibold text-label", children: title }),
|
|
2164
2219
|
description != null && /* @__PURE__ */ jsx35("p", { className: "text-xs leading-4.5 text-plum-200", children: description }),
|
|
2165
2220
|
action != null && /* @__PURE__ */ jsx35("div", { className: "mt-1 text-ui-caption text-plum-300 underline *:underline", children: action })
|
|
@@ -2180,7 +2235,7 @@ import { Progress as ProgressPrimitive } from "radix-ui";
|
|
|
2180
2235
|
// src/components/Tags & Badges/Tag.tsx
|
|
2181
2236
|
import * as React35 from "react";
|
|
2182
2237
|
import { cva as cva5 } from "class-variance-authority";
|
|
2183
|
-
import { jsx as jsx36, jsxs as
|
|
2238
|
+
import { jsx as jsx36, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2184
2239
|
var tagVariants = cva5(
|
|
2185
2240
|
"inline-flex items-center gap-1.5 whitespace-nowrap rounded-sm border px-2.5 py-1 text-ui-caption",
|
|
2186
2241
|
{
|
|
@@ -2210,7 +2265,7 @@ var statusDotVariants = cva5("size-1.5 shrink-0 rounded-full", {
|
|
|
2210
2265
|
defaultVariants: { status: "active" }
|
|
2211
2266
|
});
|
|
2212
2267
|
var StatusTag = React35.forwardRef(
|
|
2213
|
-
({ className, status, children, ...props }, ref) => /* @__PURE__ */
|
|
2268
|
+
({ className, status, children, ...props }, ref) => /* @__PURE__ */ jsxs26("span", { ref, className: cn(tagVariants({ variant: "default" }), className), ...props, children: [
|
|
2214
2269
|
/* @__PURE__ */ jsx36("span", { className: statusDotVariants({ status }), "aria-hidden": "true" }),
|
|
2215
2270
|
children
|
|
2216
2271
|
] })
|
|
@@ -2218,11 +2273,11 @@ var StatusTag = React35.forwardRef(
|
|
|
2218
2273
|
StatusTag.displayName = "StatusTag";
|
|
2219
2274
|
|
|
2220
2275
|
// src/components/Question Types/FileUpload.tsx
|
|
2221
|
-
import { Fragment as Fragment6, jsx as jsx37, jsxs as
|
|
2276
|
+
import { Fragment as Fragment6, jsx as jsx37, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2222
2277
|
var FileUploadZone = React36.forwardRef(
|
|
2223
2278
|
({ className, title = "Upload document", hint, icon, onFiles, ...props }, ref) => {
|
|
2224
2279
|
const [over, setOver] = React36.useState(false);
|
|
2225
|
-
return /* @__PURE__ */
|
|
2280
|
+
return /* @__PURE__ */ jsxs27(
|
|
2226
2281
|
"label",
|
|
2227
2282
|
{
|
|
2228
2283
|
className: cn(
|
|
@@ -2243,7 +2298,7 @@ var FileUploadZone = React36.forwardRef(
|
|
|
2243
2298
|
},
|
|
2244
2299
|
children: [
|
|
2245
2300
|
/* @__PURE__ */ jsx37("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__ */ jsx37(FileText, { size: 24, "aria-hidden": true }) }),
|
|
2246
|
-
/* @__PURE__ */
|
|
2301
|
+
/* @__PURE__ */ jsxs27("span", { className: "flex flex-col gap-1", children: [
|
|
2247
2302
|
/* @__PURE__ */ jsx37("span", { className: "text-body-small text-surface-foreground", children: title }),
|
|
2248
2303
|
hint && /* @__PURE__ */ jsx37("span", { className: "text-ui-caption text-secondary-muted-foreground", children: hint })
|
|
2249
2304
|
] }),
|
|
@@ -2266,31 +2321,31 @@ FileUploadZone.displayName = "FileUploadZone";
|
|
|
2266
2321
|
var FileUploadItem = React36.forwardRef(
|
|
2267
2322
|
({ className, name, size, status = "uploading", progress = 0, timeLeft, icon, onRemove, removeLabel, ...props }, ref) => {
|
|
2268
2323
|
const uploading = status === "uploading";
|
|
2269
|
-
return /* @__PURE__ */
|
|
2324
|
+
return /* @__PURE__ */ jsxs27(
|
|
2270
2325
|
"div",
|
|
2271
2326
|
{
|
|
2272
2327
|
ref,
|
|
2273
2328
|
className: cn("flex w-full flex-col justify-center gap-2 overflow-hidden rounded-sm border border-border p-2", className),
|
|
2274
2329
|
...props,
|
|
2275
2330
|
children: [
|
|
2276
|
-
/* @__PURE__ */
|
|
2331
|
+
/* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-2", children: [
|
|
2277
2332
|
/* @__PURE__ */ jsx37("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__ */ jsx37(FileText, { size: 24, "aria-hidden": true }) }),
|
|
2278
|
-
/* @__PURE__ */
|
|
2279
|
-
/* @__PURE__ */
|
|
2333
|
+
/* @__PURE__ */ jsxs27("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
2334
|
+
/* @__PURE__ */ jsxs27("div", { className: "flex items-center justify-between gap-2", children: [
|
|
2280
2335
|
/* @__PURE__ */ jsx37("p", { className: "min-w-0 truncate text-ui-label text-surface-foreground", children: name }),
|
|
2281
2336
|
onRemove && /* @__PURE__ */ jsx37(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": removeLabel ?? `Remove ${name}`, onClick: onRemove, children: /* @__PURE__ */ jsx37(X5, { size: 16, "aria-hidden": true }) })
|
|
2282
2337
|
] }),
|
|
2283
|
-
/* @__PURE__ */
|
|
2284
|
-
/* @__PURE__ */
|
|
2338
|
+
/* @__PURE__ */ jsxs27("div", { className: "flex items-center justify-between text-ui-caption text-secondary-muted-foreground", children: [
|
|
2339
|
+
/* @__PURE__ */ jsxs27("span", { className: "flex items-center gap-2", children: [
|
|
2285
2340
|
size,
|
|
2286
2341
|
status === "complete" && /* @__PURE__ */ jsx37(Tag, { variant: "success", children: "Complete" }),
|
|
2287
2342
|
status === "error" && /* @__PURE__ */ jsx37(Tag, { variant: "destructive", children: "Error" }),
|
|
2288
|
-
uploading && timeLeft && /* @__PURE__ */
|
|
2343
|
+
uploading && timeLeft && /* @__PURE__ */ jsxs27(Fragment6, { children: [
|
|
2289
2344
|
/* @__PURE__ */ jsx37("span", { "aria-hidden": "true", className: "size-0.5 rounded-full bg-secondary-muted-foreground" }),
|
|
2290
2345
|
timeLeft
|
|
2291
2346
|
] })
|
|
2292
2347
|
] }),
|
|
2293
|
-
uploading && /* @__PURE__ */
|
|
2348
|
+
uploading && /* @__PURE__ */ jsxs27("span", { className: "text-body-xxs font-normal", children: [
|
|
2294
2349
|
Math.round(progress),
|
|
2295
2350
|
"%"
|
|
2296
2351
|
] })
|
|
@@ -2317,12 +2372,12 @@ FileUploadItem.displayName = "FileUploadItem";
|
|
|
2317
2372
|
import * as React37 from "react";
|
|
2318
2373
|
import { CornersOut, DotsThree, Image as ImageIcon, Pause, Play, SpeakerSimpleHigh, SpeakerSimpleX, Trash as Trash2 } from "@phosphor-icons/react";
|
|
2319
2374
|
import { Slider as SliderPrimitive2, ToggleGroup as ToggleGroupPrimitive2 } from "radix-ui";
|
|
2320
|
-
import { jsx as jsx38, jsxs as
|
|
2375
|
+
import { jsx as jsx38, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2321
2376
|
function MediaInfo({ name, details, onRemove, removeLabel, large, className, ...props }) {
|
|
2322
|
-
return /* @__PURE__ */
|
|
2323
|
-
/* @__PURE__ */
|
|
2377
|
+
return /* @__PURE__ */ jsxs28("div", { className: cn("flex items-center justify-between border-t border-border bg-surface px-6 py-4", className), ...props, children: [
|
|
2378
|
+
/* @__PURE__ */ jsxs28("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
2324
2379
|
/* @__PURE__ */ jsx38("p", { className: cn("truncate text-surface-foreground", large ? "text-body-section" : "text-ui-label"), children: name }),
|
|
2325
|
-
details && /* @__PURE__ */ jsx38("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__ */
|
|
2380
|
+
details && /* @__PURE__ */ jsx38("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__ */ jsxs28(React37.Fragment, { children: [
|
|
2326
2381
|
index > 0 && /* @__PURE__ */ jsx38("span", { "aria-hidden": "true", className: "size-0.5 rounded-full bg-secondary-muted-foreground" }),
|
|
2327
2382
|
part
|
|
2328
2383
|
] }, part)) })
|
|
@@ -2331,7 +2386,7 @@ function MediaInfo({ name, details, onRemove, removeLabel, large, className, ...
|
|
|
2331
2386
|
] });
|
|
2332
2387
|
}
|
|
2333
2388
|
var ImagePreview = React37.forwardRef(
|
|
2334
|
-
({ className, children, name, details, onRemove, ...props }, ref) => /* @__PURE__ */
|
|
2389
|
+
({ className, children, name, details, onRemove, ...props }, ref) => /* @__PURE__ */ jsxs28("div", { ref, className: cn("flex w-full flex-col overflow-hidden rounded-lg border border-border", className), ...props, children: [
|
|
2335
2390
|
/* @__PURE__ */ jsx38(
|
|
2336
2391
|
"div",
|
|
2337
2392
|
{
|
|
@@ -2407,8 +2462,8 @@ var VideoPlayer = React37.forwardRef(
|
|
|
2407
2462
|
if (el.paused) void el.play();
|
|
2408
2463
|
else el.pause();
|
|
2409
2464
|
};
|
|
2410
|
-
return /* @__PURE__ */
|
|
2411
|
-
/* @__PURE__ */
|
|
2465
|
+
return /* @__PURE__ */ jsxs28("div", { ref, className: cn("flex w-full flex-col overflow-hidden rounded-lg border border-border bg-surface", className), ...props, children: [
|
|
2466
|
+
/* @__PURE__ */ jsxs28("div", { className: "relative flex h-60.5 w-full items-end bg-accent-soft", children: [
|
|
2412
2467
|
src && /* @__PURE__ */ jsx38(
|
|
2413
2468
|
"video",
|
|
2414
2469
|
{
|
|
@@ -2422,8 +2477,8 @@ var VideoPlayer = React37.forwardRef(
|
|
|
2422
2477
|
onVolumeChange: (event) => setVolume(event.currentTarget.muted ? 0 : event.currentTarget.volume)
|
|
2423
2478
|
}
|
|
2424
2479
|
),
|
|
2425
|
-
/* @__PURE__ */
|
|
2426
|
-
/* @__PURE__ */
|
|
2480
|
+
/* @__PURE__ */ jsxs28("div", { className: "relative flex w-full flex-col gap-2 bg-surface-foreground bg-linear-to-r from-primary/30 to-primary/30 px-4 pt-3 pb-4 text-surface", children: [
|
|
2481
|
+
/* @__PURE__ */ jsxs28(
|
|
2427
2482
|
SliderPrimitive2.Root,
|
|
2428
2483
|
{
|
|
2429
2484
|
min: 0,
|
|
@@ -2442,8 +2497,8 @@ var VideoPlayer = React37.forwardRef(
|
|
|
2442
2497
|
]
|
|
2443
2498
|
}
|
|
2444
2499
|
),
|
|
2445
|
-
/* @__PURE__ */
|
|
2446
|
-
/* @__PURE__ */
|
|
2500
|
+
/* @__PURE__ */ jsxs28("div", { className: "flex items-center justify-between", children: [
|
|
2501
|
+
/* @__PURE__ */ jsxs28("div", { className: "flex items-center gap-4", children: [
|
|
2447
2502
|
/* @__PURE__ */ jsx38(
|
|
2448
2503
|
"button",
|
|
2449
2504
|
{
|
|
@@ -2454,13 +2509,13 @@ var VideoPlayer = React37.forwardRef(
|
|
|
2454
2509
|
children: playing ? /* @__PURE__ */ jsx38(Pause, { size: 16, weight: "fill", "aria-hidden": true }) : /* @__PURE__ */ jsx38(Play, { size: 16, weight: "fill", "aria-hidden": true })
|
|
2455
2510
|
}
|
|
2456
2511
|
),
|
|
2457
|
-
/* @__PURE__ */
|
|
2512
|
+
/* @__PURE__ */ jsxs28("span", { className: "text-ui-label whitespace-nowrap text-surface/80", children: [
|
|
2458
2513
|
formatTime(time),
|
|
2459
2514
|
" / ",
|
|
2460
2515
|
formatTime(duration)
|
|
2461
2516
|
] })
|
|
2462
2517
|
] }),
|
|
2463
|
-
/* @__PURE__ */
|
|
2518
|
+
/* @__PURE__ */ jsxs28("div", { className: "flex items-center gap-2", children: [
|
|
2464
2519
|
/* @__PURE__ */ jsx38(
|
|
2465
2520
|
VolumeControl,
|
|
2466
2521
|
{
|
|
@@ -2507,8 +2562,8 @@ VideoPlayer.displayName = "VideoPlayer";
|
|
|
2507
2562
|
function VolumeControl({ volume, onVolumeChange, className }) {
|
|
2508
2563
|
const last = React37.useRef(volume || 1);
|
|
2509
2564
|
if (volume > 0) last.current = volume;
|
|
2510
|
-
return /* @__PURE__ */
|
|
2511
|
-
/* @__PURE__ */ jsx38("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__ */
|
|
2565
|
+
return /* @__PURE__ */ jsxs28("div", { className: cn("group/volume flex items-center", className), children: [
|
|
2566
|
+
/* @__PURE__ */ jsx38("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__ */ jsxs28(
|
|
2512
2567
|
SliderPrimitive2.Root,
|
|
2513
2568
|
{
|
|
2514
2569
|
min: 0,
|
|
@@ -2592,7 +2647,7 @@ import {
|
|
|
2592
2647
|
// src/components/Question Types/QuestionHeader.tsx
|
|
2593
2648
|
import * as React40 from "react";
|
|
2594
2649
|
import { DotsSixVertical } from "@phosphor-icons/react";
|
|
2595
|
-
import { jsx as jsx41, jsxs as
|
|
2650
|
+
import { jsx as jsx41, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2596
2651
|
var eyebrow = "text-ui-caption uppercase text-secondary-muted-foreground";
|
|
2597
2652
|
var QuestionHeader = React40.forwardRef(
|
|
2598
2653
|
({ className, number, title, required, error, onDismissError, editor, onTitleChange, actions, meta, maxLength = 2e3, active, showCounter = true, dragHandleProps, showDragHandle = true, ...props }, ref) => {
|
|
@@ -2602,10 +2657,10 @@ var QuestionHeader = React40.forwardRef(
|
|
|
2602
2657
|
if (editor) {
|
|
2603
2658
|
const text = typeof title === "string" ? title : "";
|
|
2604
2659
|
const count = (draft ?? text).length;
|
|
2605
|
-
return /* @__PURE__ */
|
|
2606
|
-
/* @__PURE__ */
|
|
2607
|
-
/* @__PURE__ */
|
|
2608
|
-
/* @__PURE__ */
|
|
2660
|
+
return /* @__PURE__ */ jsxs29("div", { ref, className: cn("group/header flex w-full flex-col gap-2", className), ...props, children: [
|
|
2661
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex items-center justify-between", children: [
|
|
2662
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex items-center gap-2", children: [
|
|
2663
|
+
/* @__PURE__ */ jsxs29(
|
|
2609
2664
|
"span",
|
|
2610
2665
|
{
|
|
2611
2666
|
"aria-label": dragHandleProps ? `Reorder question ${number}` : void 0,
|
|
@@ -2660,7 +2715,7 @@ var QuestionHeader = React40.forwardRef(
|
|
|
2660
2715
|
textClassName: "text-heading-h4"
|
|
2661
2716
|
}
|
|
2662
2717
|
),
|
|
2663
|
-
showCounter && /* @__PURE__ */
|
|
2718
|
+
showCounter && /* @__PURE__ */ jsxs29("p", { className: "text-ui-caption text-secondary-muted-foreground", children: [
|
|
2664
2719
|
count,
|
|
2665
2720
|
"/",
|
|
2666
2721
|
maxLength,
|
|
@@ -2668,13 +2723,13 @@ var QuestionHeader = React40.forwardRef(
|
|
|
2668
2723
|
] })
|
|
2669
2724
|
] });
|
|
2670
2725
|
}
|
|
2671
|
-
return /* @__PURE__ */
|
|
2726
|
+
return /* @__PURE__ */ jsxs29("div", { ref, className: cn("flex w-full flex-col gap-2", className), ...props, children: [
|
|
2672
2727
|
showError && /* @__PURE__ */ jsx41(ToastInline, { variant: "destructive", onClose: onDismissError, className: "min-h-10", children: /* @__PURE__ */ jsx41("span", { className: "text-ui-label text-destructive", children: error === true ? "This question is mandatory." : error }) }),
|
|
2673
|
-
/* @__PURE__ */
|
|
2728
|
+
/* @__PURE__ */ jsxs29("p", { className: eyebrow, children: [
|
|
2674
2729
|
"Question ",
|
|
2675
2730
|
label
|
|
2676
2731
|
] }),
|
|
2677
|
-
/* @__PURE__ */
|
|
2732
|
+
/* @__PURE__ */ jsxs29("h3", { className: "text-heading-h4 text-surface-foreground", children: [
|
|
2678
2733
|
title,
|
|
2679
2734
|
required && /* @__PURE__ */ jsx41("span", { "aria-hidden": "true", className: "text-destructive", children: "*" }),
|
|
2680
2735
|
required && /* @__PURE__ */ jsx41("span", { className: "sr-only", children: " (required)" })
|
|
@@ -2685,7 +2740,7 @@ var QuestionHeader = React40.forwardRef(
|
|
|
2685
2740
|
QuestionHeader.displayName = "QuestionHeader";
|
|
2686
2741
|
|
|
2687
2742
|
// src/components/Question Types/QuestionEditorCard.tsx
|
|
2688
|
-
import { Fragment as Fragment8, jsx as jsx42, jsxs as
|
|
2743
|
+
import { Fragment as Fragment8, jsx as jsx42, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2689
2744
|
var QuestionEditorCard = React41.forwardRef(
|
|
2690
2745
|
({
|
|
2691
2746
|
className,
|
|
@@ -2712,7 +2767,7 @@ var QuestionEditorCard = React41.forwardRef(
|
|
|
2712
2767
|
...props
|
|
2713
2768
|
}, ref) => {
|
|
2714
2769
|
const footer = active && (countLabel != null || onAdd || onPaste);
|
|
2715
|
-
return /* @__PURE__ */
|
|
2770
|
+
return /* @__PURE__ */ jsxs30(
|
|
2716
2771
|
"div",
|
|
2717
2772
|
{
|
|
2718
2773
|
ref,
|
|
@@ -2720,7 +2775,7 @@ var QuestionEditorCard = React41.forwardRef(
|
|
|
2720
2775
|
"data-hovered": hovered ? "" : void 0,
|
|
2721
2776
|
...props,
|
|
2722
2777
|
children: [
|
|
2723
|
-
/* @__PURE__ */
|
|
2778
|
+
/* @__PURE__ */ jsxs30(
|
|
2724
2779
|
"div",
|
|
2725
2780
|
{
|
|
2726
2781
|
className: cn(
|
|
@@ -2728,8 +2783,8 @@ var QuestionEditorCard = React41.forwardRef(
|
|
|
2728
2783
|
active ? "border-accent" : "border-border"
|
|
2729
2784
|
),
|
|
2730
2785
|
children: [
|
|
2731
|
-
/* @__PURE__ */
|
|
2732
|
-
/* @__PURE__ */
|
|
2786
|
+
/* @__PURE__ */ jsxs30("div", { className: cn("flex flex-col p-6", footer ? "gap-5" : "gap-4"), children: [
|
|
2787
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex flex-col gap-4", children: [
|
|
2733
2788
|
/* @__PURE__ */ jsx42(
|
|
2734
2789
|
QuestionHeader,
|
|
2735
2790
|
{
|
|
@@ -2743,7 +2798,7 @@ var QuestionEditorCard = React41.forwardRef(
|
|
|
2743
2798
|
showDragHandle,
|
|
2744
2799
|
meta,
|
|
2745
2800
|
maxLength,
|
|
2746
|
-
actions: actions ?? /* @__PURE__ */
|
|
2801
|
+
actions: actions ?? /* @__PURE__ */ jsxs30(Fragment8, { children: [
|
|
2747
2802
|
/* @__PURE__ */ jsx42(
|
|
2748
2803
|
Button,
|
|
2749
2804
|
{
|
|
@@ -2782,14 +2837,14 @@ var QuestionEditorCard = React41.forwardRef(
|
|
|
2782
2837
|
),
|
|
2783
2838
|
children
|
|
2784
2839
|
] }),
|
|
2785
|
-
error && /* @__PURE__ */
|
|
2840
|
+
error && /* @__PURE__ */ jsxs30("p", { className: "flex items-center gap-1 text-ui-caption text-destructive-foreground", children: [
|
|
2786
2841
|
/* @__PURE__ */ jsx42(Warning2, { size: 16, "aria-hidden": true, className: "shrink-0" }),
|
|
2787
2842
|
error
|
|
2788
2843
|
] }),
|
|
2789
|
-
footer && /* @__PURE__ */
|
|
2844
|
+
footer && /* @__PURE__ */ jsxs30("div", { className: "flex items-center justify-between", children: [
|
|
2790
2845
|
/* @__PURE__ */ jsx42("p", { className: "text-ui-caption text-secondary-muted-foreground", children: countLabel }),
|
|
2791
|
-
/* @__PURE__ */
|
|
2792
|
-
onAdd && /* @__PURE__ */
|
|
2846
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-2", children: [
|
|
2847
|
+
onAdd && /* @__PURE__ */ jsxs30(Button, { type: "button", variant: "outline", onClick: onAdd, children: [
|
|
2793
2848
|
/* @__PURE__ */ jsx42(Plus3, { size: 16, "aria-hidden": true }),
|
|
2794
2849
|
"Add choice"
|
|
2795
2850
|
] }),
|
|
@@ -2854,11 +2909,11 @@ function QuestionTypeIcon({ type, size = 22.5, className, ...props }) {
|
|
|
2854
2909
|
}
|
|
2855
2910
|
|
|
2856
2911
|
// src/components/Question Types/QuestionNavItem.tsx
|
|
2857
|
-
import { jsx as jsx44, jsxs as
|
|
2912
|
+
import { jsx as jsx44, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
2858
2913
|
var QuestionNavItem = React43.forwardRef(
|
|
2859
2914
|
({ className, questionType = "select-one", selected, error, asChild, showDragHandle = true, hovered, children, ...props }, ref) => {
|
|
2860
2915
|
const Comp = asChild ? Slot3.Root : "button";
|
|
2861
|
-
return /* @__PURE__ */
|
|
2916
|
+
return /* @__PURE__ */ jsxs31(
|
|
2862
2917
|
Comp,
|
|
2863
2918
|
{
|
|
2864
2919
|
ref,
|
|
@@ -2877,7 +2932,7 @@ var QuestionNavItem = React43.forwardRef(
|
|
|
2877
2932
|
),
|
|
2878
2933
|
...props,
|
|
2879
2934
|
children: [
|
|
2880
|
-
/* @__PURE__ */
|
|
2935
|
+
/* @__PURE__ */ jsxs31("span", { "aria-hidden": "true", className: "relative flex size-4 shrink-0 items-center justify-center", children: [
|
|
2881
2936
|
showDragHandle && /* @__PURE__ */ jsx44(DotsSixVertical2, { size: 16, className: "hidden group-hover/nav:block group-data-[hovered]/nav:block" }),
|
|
2882
2937
|
/* @__PURE__ */ jsx44("span", { className: showDragHandle ? "group-hover/nav:hidden group-data-[hovered]/nav:hidden" : void 0, children: error ? /* @__PURE__ */ jsx44(Warning3, { size: 16, className: "text-destructive-foreground" }) : /* @__PURE__ */ jsx44(
|
|
2883
2938
|
QuestionTypeIcon,
|
|
@@ -2900,11 +2955,11 @@ QuestionNavItem.displayName = "QuestionNavItem";
|
|
|
2900
2955
|
// src/components/Question Types/QuestionOption.tsx
|
|
2901
2956
|
import * as React44 from "react";
|
|
2902
2957
|
import { Check as Check4, DotsSixVertical as DotsSixVertical3, Plus as Plus4, Trash as Trash4 } from "@phosphor-icons/react";
|
|
2903
|
-
import { Fragment as Fragment9, jsx as jsx45, jsxs as
|
|
2958
|
+
import { Fragment as Fragment9, jsx as jsx45, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
2904
2959
|
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";
|
|
2905
2960
|
function QuestionOption(props) {
|
|
2906
2961
|
const id = React44.useId();
|
|
2907
|
-
return /* @__PURE__ */
|
|
2962
|
+
return /* @__PURE__ */ jsxs32("label", { htmlFor: id, className: cn(optionClasses, props.className), children: [
|
|
2908
2963
|
props.kind === "checkbox" ? /* @__PURE__ */ jsx45(
|
|
2909
2964
|
Checkbox,
|
|
2910
2965
|
{
|
|
@@ -2923,7 +2978,7 @@ var QuestionOtherOption = React44.forwardRef(
|
|
|
2923
2978
|
const inner = React44.useRef(null);
|
|
2924
2979
|
React44.useImperativeHandle(ref, () => inner.current);
|
|
2925
2980
|
const submit = () => onSubmit?.(inner.current?.value ?? "");
|
|
2926
|
-
return /* @__PURE__ */
|
|
2981
|
+
return /* @__PURE__ */ jsxs32(
|
|
2927
2982
|
"div",
|
|
2928
2983
|
{
|
|
2929
2984
|
className: cn(
|
|
@@ -2962,8 +3017,8 @@ function QuestionOptionEditor({ label, onLabelChange, onRemove, onAdd, className
|
|
|
2962
3017
|
className: cn("cursor-grab touch-none select-none", dragHandleProps.className)
|
|
2963
3018
|
} : { "aria-hidden": true };
|
|
2964
3019
|
const grip = dragHandleProps ? /* @__PURE__ */ jsx45("span", { ...gripProps, className: cn("shrink-0", gripProps.className), children: /* @__PURE__ */ jsx45(DotsSixVertical3, { size: 20, "aria-hidden": true, className: "text-surface-foreground" }) }) : /* @__PURE__ */ jsx45(DotsSixVertical3, { size: 20, "aria-hidden": true, className: "shrink-0 text-surface-foreground" });
|
|
2965
|
-
return /* @__PURE__ */
|
|
2966
|
-
/* @__PURE__ */
|
|
3020
|
+
return /* @__PURE__ */ jsxs32("div", { className: cn("group/option flex w-full items-center gap-2", className), children: [
|
|
3021
|
+
/* @__PURE__ */ jsxs32(
|
|
2967
3022
|
"div",
|
|
2968
3023
|
{
|
|
2969
3024
|
className: cn(
|
|
@@ -2974,7 +3029,7 @@ function QuestionOptionEditor({ label, onLabelChange, onRemove, onAdd, className
|
|
|
2974
3029
|
) : "border-border hover:border-input-muted hover:shadow-md"
|
|
2975
3030
|
),
|
|
2976
3031
|
children: [
|
|
2977
|
-
kind === "rank" ? /* @__PURE__ */
|
|
3032
|
+
kind === "rank" ? /* @__PURE__ */ jsxs32(Fragment9, { children: [
|
|
2978
3033
|
!locked && grip,
|
|
2979
3034
|
/* @__PURE__ */ jsx45(
|
|
2980
3035
|
"span",
|
|
@@ -2984,7 +3039,7 @@ function QuestionOptionEditor({ label, onLabelChange, onRemove, onAdd, className
|
|
|
2984
3039
|
children: rank
|
|
2985
3040
|
}
|
|
2986
3041
|
)
|
|
2987
|
-
] }) : reveal && locked ? /* @__PURE__ */ jsx45("span", { "aria-hidden": "true", className: "relative flex size-5 shrink-0 items-center justify-center", children: /* @__PURE__ */ jsx45("span", { className: cn("inline-flex size-4 border-2 border-input bg-surface", kind === "radio" ? "rounded-full" : "rounded-xxs") }) }) : reveal ? /* @__PURE__ */
|
|
3042
|
+
] }) : reveal && locked ? /* @__PURE__ */ jsx45("span", { "aria-hidden": "true", className: "relative flex size-5 shrink-0 items-center justify-center", children: /* @__PURE__ */ jsx45("span", { className: cn("inline-flex size-4 border-2 border-input bg-surface", kind === "radio" ? "rounded-full" : "rounded-xxs") }) }) : reveal ? /* @__PURE__ */ jsxs32("span", { ...gripProps, className: cn("relative flex size-5 shrink-0 items-center justify-center", gripProps.className), children: [
|
|
2988
3043
|
/* @__PURE__ */ jsx45(
|
|
2989
3044
|
"span",
|
|
2990
3045
|
{
|
|
@@ -3020,7 +3075,7 @@ function QuestionOptionEditor({ label, onLabelChange, onRemove, onAdd, className
|
|
|
3020
3075
|
]
|
|
3021
3076
|
}
|
|
3022
3077
|
),
|
|
3023
|
-
!locked && /* @__PURE__ */
|
|
3078
|
+
!locked && /* @__PURE__ */ jsxs32(
|
|
3024
3079
|
"div",
|
|
3025
3080
|
{
|
|
3026
3081
|
className: cn(
|
|
@@ -3039,7 +3094,7 @@ function QuestionOptionEditor({ label, onLabelChange, onRemove, onAdd, className
|
|
|
3039
3094
|
// src/components/Question Types/RankList.tsx
|
|
3040
3095
|
import * as React45 from "react";
|
|
3041
3096
|
import { DotsSixVertical as DotsSixVertical4 } from "@phosphor-icons/react";
|
|
3042
|
-
import { Fragment as Fragment10, jsx as jsx46, jsxs as
|
|
3097
|
+
import { Fragment as Fragment10, jsx as jsx46, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
3043
3098
|
function move(list, from, to) {
|
|
3044
3099
|
if (from === to || to < 0 || to >= list.length) return list;
|
|
3045
3100
|
const next = list.slice();
|
|
@@ -3066,8 +3121,8 @@ var RankList = React45.forwardRef(
|
|
|
3066
3121
|
setAnnouncement(`Moved to position ${to + 1} of ${items.length}`);
|
|
3067
3122
|
onItemsChange(next);
|
|
3068
3123
|
};
|
|
3069
|
-
return /* @__PURE__ */
|
|
3070
|
-
/* @__PURE__ */ jsx46("ol", { ref, className: cn("flex w-full max-w-150 flex-col gap-4", className), ...props, children: items.map((item, index) => /* @__PURE__ */
|
|
3124
|
+
return /* @__PURE__ */ jsxs33(Fragment10, { children: [
|
|
3125
|
+
/* @__PURE__ */ jsx46("ol", { ref, className: cn("flex w-full max-w-150 flex-col gap-4", className), ...props, children: items.map((item, index) => /* @__PURE__ */ jsxs33(
|
|
3071
3126
|
"li",
|
|
3072
3127
|
{
|
|
3073
3128
|
draggable: true,
|
|
@@ -3128,12 +3183,12 @@ RankList.displayName = "RankList";
|
|
|
3128
3183
|
// src/components/Question Types/RatingScale.tsx
|
|
3129
3184
|
import * as React46 from "react";
|
|
3130
3185
|
import { ToggleGroup as ToggleGroupPrimitive3 } from "radix-ui";
|
|
3131
|
-
import { jsx as jsx47, jsxs as
|
|
3186
|
+
import { jsx as jsx47, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
3132
3187
|
var RatingScale = React46.forwardRef(
|
|
3133
3188
|
({ className, max = 5, value, defaultValue, onValueChange, lowLabel, highLabel, ...props }, ref) => {
|
|
3134
3189
|
const [internal, setInternal] = React46.useState(defaultValue);
|
|
3135
3190
|
const current = value !== void 0 ? value : internal;
|
|
3136
|
-
return /* @__PURE__ */
|
|
3191
|
+
return /* @__PURE__ */ jsxs34("div", { className: cn("flex w-full max-w-150 flex-col gap-2", className), children: [
|
|
3137
3192
|
/* @__PURE__ */ jsx47(
|
|
3138
3193
|
ToggleGroupPrimitive3.Root,
|
|
3139
3194
|
{
|
|
@@ -3163,7 +3218,7 @@ var RatingScale = React46.forwardRef(
|
|
|
3163
3218
|
))
|
|
3164
3219
|
}
|
|
3165
3220
|
),
|
|
3166
|
-
(lowLabel != null || highLabel != null) && /* @__PURE__ */
|
|
3221
|
+
(lowLabel != null || highLabel != null) && /* @__PURE__ */ jsxs34("div", { className: "flex justify-between text-ui-caption text-secondary-muted-foreground", "aria-hidden": "true", children: [
|
|
3167
3222
|
/* @__PURE__ */ jsx47("span", { children: lowLabel }),
|
|
3168
3223
|
/* @__PURE__ */ jsx47("span", { children: highLabel })
|
|
3169
3224
|
] })
|
|
@@ -3175,7 +3230,7 @@ RatingScale.displayName = "RatingScale";
|
|
|
3175
3230
|
// src/components/Question Types/StimulusCard.tsx
|
|
3176
3231
|
import * as React47 from "react";
|
|
3177
3232
|
import { Image as ImageIcon2, ImageBroken, Trash as Trash5 } from "@phosphor-icons/react";
|
|
3178
|
-
import { jsx as jsx48, jsxs as
|
|
3233
|
+
import { jsx as jsx48, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
3179
3234
|
var MIN_THUMBNAIL = 92;
|
|
3180
3235
|
var MAX_THUMBNAIL = 240;
|
|
3181
3236
|
var StimulusCard = React47.forwardRef(
|
|
@@ -3211,7 +3266,7 @@ var StimulusCard = React47.forwardRef(
|
|
|
3211
3266
|
observer.observe(el);
|
|
3212
3267
|
return () => observer.disconnect();
|
|
3213
3268
|
}, []);
|
|
3214
|
-
return /* @__PURE__ */
|
|
3269
|
+
return /* @__PURE__ */ jsxs35(
|
|
3215
3270
|
"div",
|
|
3216
3271
|
{
|
|
3217
3272
|
ref,
|
|
@@ -3219,7 +3274,7 @@ var StimulusCard = React47.forwardRef(
|
|
|
3219
3274
|
className: cn("flex min-h-24.5 w-full items-center gap-4 rounded-md border border-border p-0.5 pr-4", className),
|
|
3220
3275
|
...props,
|
|
3221
3276
|
children: [
|
|
3222
|
-
/* @__PURE__ */
|
|
3277
|
+
/* @__PURE__ */ jsxs35("div", { className: "flex min-w-0 flex-1 items-center gap-4", children: [
|
|
3223
3278
|
/* @__PURE__ */ jsx48(
|
|
3224
3279
|
"span",
|
|
3225
3280
|
{
|
|
@@ -3235,7 +3290,7 @@ var StimulusCard = React47.forwardRef(
|
|
|
3235
3290
|
) : error ? /* @__PURE__ */ jsx48(ImageBroken, { size: 24, "aria-hidden": true }) : icon ?? /* @__PURE__ */ jsx48(ImageIcon2, { size: 24, "aria-hidden": true })
|
|
3236
3291
|
}
|
|
3237
3292
|
),
|
|
3238
|
-
/* @__PURE__ */
|
|
3293
|
+
/* @__PURE__ */ jsxs35("div", { ref: textRef, className: "flex min-w-0 flex-1 flex-col justify-center gap-2 py-2 text-surface-foreground", children: [
|
|
3239
3294
|
/* @__PURE__ */ jsx48("p", { className: "w-full text-ui-label", children: label }),
|
|
3240
3295
|
onCaptionChange ? /* @__PURE__ */ jsx48(
|
|
3241
3296
|
InlineEdit,
|
|
@@ -3255,7 +3310,7 @@ var StimulusCard = React47.forwardRef(
|
|
|
3255
3310
|
textClassName: "text-body-base"
|
|
3256
3311
|
}
|
|
3257
3312
|
) : /* @__PURE__ */ jsx48("p", { className: "w-full text-body-base [word-break:break-word]", children: caption }),
|
|
3258
|
-
onCaptionChange && showCounter && maxLength !== void 0 && /* @__PURE__ */
|
|
3313
|
+
onCaptionChange && showCounter && maxLength !== void 0 && /* @__PURE__ */ jsxs35("p", { className: "text-ui-caption text-secondary-muted-foreground", children: [
|
|
3259
3314
|
count,
|
|
3260
3315
|
"/",
|
|
3261
3316
|
maxLength,
|
|
@@ -3274,14 +3329,14 @@ StimulusCard.displayName = "StimulusCard";
|
|
|
3274
3329
|
// src/components/Data Display/Progress.tsx
|
|
3275
3330
|
import * as React48 from "react";
|
|
3276
3331
|
import { Progress as ProgressPrimitive2 } from "radix-ui";
|
|
3277
|
-
import { jsx as jsx49, jsxs as
|
|
3332
|
+
import { jsx as jsx49, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
3278
3333
|
var Progress = React48.forwardRef(
|
|
3279
3334
|
({ className, value = 0, label, valueLabel, detailsStart, detailsEnd, ...props }, ref) => {
|
|
3280
3335
|
const hasHeader = label != null || valueLabel != null;
|
|
3281
3336
|
const hasDetails = detailsStart != null || detailsEnd != null;
|
|
3282
3337
|
const clamped = Math.min(100, Math.max(0, value ?? 0));
|
|
3283
|
-
return /* @__PURE__ */
|
|
3284
|
-
hasHeader && /* @__PURE__ */
|
|
3338
|
+
return /* @__PURE__ */ jsxs36("div", { className: cn("flex w-full flex-col gap-2", className), children: [
|
|
3339
|
+
hasHeader && /* @__PURE__ */ jsxs36("div", { className: "flex items-center justify-between text-ui-label text-surface-foreground", children: [
|
|
3285
3340
|
/* @__PURE__ */ jsx49("span", { children: label }),
|
|
3286
3341
|
/* @__PURE__ */ jsx49("span", { children: valueLabel === true ? `${Math.round(clamped)}%` : valueLabel })
|
|
3287
3342
|
] }),
|
|
@@ -3301,7 +3356,7 @@ var Progress = React48.forwardRef(
|
|
|
3301
3356
|
)
|
|
3302
3357
|
}
|
|
3303
3358
|
),
|
|
3304
|
-
hasDetails && /* @__PURE__ */
|
|
3359
|
+
hasDetails && /* @__PURE__ */ jsxs36("div", { className: "flex items-start justify-between text-ui-label leading-5 text-secondary-muted-foreground", children: [
|
|
3305
3360
|
/* @__PURE__ */ jsx49("span", { children: detailsStart }),
|
|
3306
3361
|
/* @__PURE__ */ jsx49("span", { children: detailsEnd })
|
|
3307
3362
|
] })
|
|
@@ -3313,7 +3368,7 @@ Progress.displayName = "Progress";
|
|
|
3313
3368
|
// src/components/Data Display/Table.tsx
|
|
3314
3369
|
import * as React49 from "react";
|
|
3315
3370
|
import { CaretDown as CaretDown4, CaretUp } from "@phosphor-icons/react";
|
|
3316
|
-
import { jsx as jsx50, jsxs as
|
|
3371
|
+
import { jsx as jsx50, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
3317
3372
|
var Table = React49.forwardRef(
|
|
3318
3373
|
({ className, containerClassName, striped, ...props }, ref) => /* @__PURE__ */ jsx50("div", { className: cn("relative w-full overflow-auto rounded-lg border border-border bg-surface", containerClassName), children: /* @__PURE__ */ jsx50(
|
|
3319
3374
|
"table",
|
|
@@ -3368,7 +3423,7 @@ var TableHead = React49.forwardRef(
|
|
|
3368
3423
|
className
|
|
3369
3424
|
),
|
|
3370
3425
|
...props,
|
|
3371
|
-
children: sortable ? /* @__PURE__ */
|
|
3426
|
+
children: sortable ? /* @__PURE__ */ jsxs37(
|
|
3372
3427
|
"button",
|
|
3373
3428
|
{
|
|
3374
3429
|
type: "button",
|
|
@@ -3405,9 +3460,9 @@ var TableCell = React49.forwardRef(
|
|
|
3405
3460
|
);
|
|
3406
3461
|
TableCell.displayName = "TableCell";
|
|
3407
3462
|
function TableCellTwoLines({ primary, secondary, avatar, className, ...props }) {
|
|
3408
|
-
return /* @__PURE__ */
|
|
3463
|
+
return /* @__PURE__ */ jsxs37("div", { className: cn("flex items-center gap-2", className), ...props, children: [
|
|
3409
3464
|
avatar,
|
|
3410
|
-
/* @__PURE__ */
|
|
3465
|
+
/* @__PURE__ */ jsxs37("div", { className: "flex flex-col gap-0.5 whitespace-nowrap", children: [
|
|
3411
3466
|
/* @__PURE__ */ jsx50("span", { className: "text-ui-label text-surface-foreground", children: primary }),
|
|
3412
3467
|
secondary && /* @__PURE__ */ jsx50("span", { className: "text-ui-caption text-secondary-muted-foreground", children: secondary })
|
|
3413
3468
|
] })
|
|
@@ -3417,7 +3472,7 @@ function TableCellTwoLines({ primary, secondary, avatar, className, ...props })
|
|
|
3417
3472
|
// src/components/Data Display/StatCard.tsx
|
|
3418
3473
|
import * as React50 from "react";
|
|
3419
3474
|
import { cva as cva6 } from "class-variance-authority";
|
|
3420
|
-
import { jsx as jsx51, jsxs as
|
|
3475
|
+
import { jsx as jsx51, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
3421
3476
|
var statCardVariants = cva6("flex min-w-0 flex-col gap-2 rounded-md border p-3", {
|
|
3422
3477
|
variants: {
|
|
3423
3478
|
variant: {
|
|
@@ -3432,9 +3487,9 @@ var statCardVariants = cva6("flex min-w-0 flex-col gap-2 rounded-md border p-3",
|
|
|
3432
3487
|
defaultVariants: { variant: "default" }
|
|
3433
3488
|
});
|
|
3434
3489
|
var StatCard = React50.forwardRef(
|
|
3435
|
-
({ className, variant, label, value, icon, ...props }, ref) => /* @__PURE__ */
|
|
3490
|
+
({ className, variant, label, value, icon, ...props }, ref) => /* @__PURE__ */ jsxs38("div", { ref, className: cn(statCardVariants({ variant }), className), ...props, children: [
|
|
3436
3491
|
/* @__PURE__ */ jsx51("p", { className: "truncate text-ui-caption text-secondary-muted-foreground", children: label }),
|
|
3437
|
-
/* @__PURE__ */
|
|
3492
|
+
/* @__PURE__ */ jsxs38("p", { className: "flex items-center gap-2 text-body-base text-surface-foreground", children: [
|
|
3438
3493
|
icon && /* @__PURE__ */ jsx51("span", { "aria-hidden": "true", className: "inline-flex size-6 shrink-0 items-center justify-center", children: icon }),
|
|
3439
3494
|
value
|
|
3440
3495
|
] })
|
|
@@ -3449,7 +3504,7 @@ import * as React52 from "react";
|
|
|
3449
3504
|
import * as React51 from "react";
|
|
3450
3505
|
import { Crown, Plus as Plus5, X as X6 } from "@phosphor-icons/react";
|
|
3451
3506
|
import { cva as cva7 } from "class-variance-authority";
|
|
3452
|
-
import { jsx as jsx52, jsxs as
|
|
3507
|
+
import { jsx as jsx52, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
3453
3508
|
var editableTagVariants = cva7(
|
|
3454
3509
|
"inline-flex h-6.5 items-center whitespace-nowrap rounded-sm py-1 text-ui-caption transition-colors",
|
|
3455
3510
|
{
|
|
@@ -3469,12 +3524,12 @@ var EditableTag = React51.forwardRef(
|
|
|
3469
3524
|
const classes = cn(editableTagVariants({ type }), className);
|
|
3470
3525
|
const leading = type === "add" ? /* @__PURE__ */ jsx52(Plus5, { size: 12, "aria-hidden": true }) : icon !== void 0 ? icon : type === "default" ? /* @__PURE__ */ jsx52(Crown, { size: 12, weight: "fill", "aria-hidden": true }) : null;
|
|
3471
3526
|
if (type === "add" || type === "multiple" && onClick) {
|
|
3472
|
-
return /* @__PURE__ */
|
|
3527
|
+
return /* @__PURE__ */ jsxs39("button", { ref, type: "button", className: classes, onClick, ...props, children: [
|
|
3473
3528
|
leading,
|
|
3474
3529
|
children
|
|
3475
3530
|
] });
|
|
3476
3531
|
}
|
|
3477
|
-
return /* @__PURE__ */
|
|
3532
|
+
return /* @__PURE__ */ jsxs39("span", { ref, className: classes, ...props, children: [
|
|
3478
3533
|
leading,
|
|
3479
3534
|
children,
|
|
3480
3535
|
onRemove && /* @__PURE__ */ jsx52(
|
|
@@ -3493,24 +3548,24 @@ var EditableTag = React51.forwardRef(
|
|
|
3493
3548
|
EditableTag.displayName = "EditableTag";
|
|
3494
3549
|
|
|
3495
3550
|
// src/components/Research-Specific/ActivityStructure.tsx
|
|
3496
|
-
import { jsx as jsx53, jsxs as
|
|
3551
|
+
import { jsx as jsx53, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
3497
3552
|
var ActivityStructure = React52.forwardRef(
|
|
3498
|
-
({ className, title = "Activity Structure", stats, sections, onRemoveTag, onAddTag, addTagLabel = "Add tag", action, children, ...props }, ref) => /* @__PURE__ */
|
|
3553
|
+
({ className, title = "Activity Structure", stats, sections, onRemoveTag, onAddTag, addTagLabel = "Add tag", action, children, ...props }, ref) => /* @__PURE__ */ jsxs40(
|
|
3499
3554
|
"section",
|
|
3500
3555
|
{
|
|
3501
3556
|
ref,
|
|
3502
3557
|
className: cn("flex w-full max-w-96.5 flex-col gap-4 rounded-xl bg-surface p-4", className),
|
|
3503
3558
|
...props,
|
|
3504
3559
|
children: [
|
|
3505
|
-
/* @__PURE__ */
|
|
3560
|
+
/* @__PURE__ */ jsxs40("div", { className: "flex items-center justify-between gap-2", children: [
|
|
3506
3561
|
/* @__PURE__ */ jsx53("h3", { className: "text-body-section text-surface-foreground", children: title }),
|
|
3507
3562
|
action
|
|
3508
3563
|
] }),
|
|
3509
3564
|
stats.length > 0 && /* @__PURE__ */ jsx53("div", { className: "grid grid-cols-2 gap-3", children: stats.map(({ id, ...stat }) => /* @__PURE__ */ jsx53(StatCard, { ...stat }, id)) }),
|
|
3510
|
-
sections?.map(({ id, heading, body, tags }) => /* @__PURE__ */
|
|
3565
|
+
sections?.map(({ id, heading, body, tags }) => /* @__PURE__ */ jsxs40("div", { className: "flex flex-col gap-2", children: [
|
|
3511
3566
|
/* @__PURE__ */ jsx53("h4", { className: "text-heading-h4 text-surface-foreground", children: heading }),
|
|
3512
3567
|
/* @__PURE__ */ jsx53("div", { className: "text-body-base text-surface-foreground", children: body }),
|
|
3513
|
-
(tags?.length || onAddTag) && /* @__PURE__ */
|
|
3568
|
+
(tags?.length || onAddTag) && /* @__PURE__ */ jsxs40("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
3514
3569
|
tags?.map((tag) => /* @__PURE__ */ jsx53(EditableTag, { type: "editable", onRemove: onRemoveTag && (() => onRemoveTag(id, tag)), children: tag }, tag)),
|
|
3515
3570
|
onAddTag && /* @__PURE__ */ jsx53(EditableTag, { type: "add", onClick: () => onAddTag(id), children: addTagLabel })
|
|
3516
3571
|
] })
|
|
@@ -3526,7 +3581,7 @@ ActivityStructure.displayName = "ActivityStructure";
|
|
|
3526
3581
|
import * as React53 from "react";
|
|
3527
3582
|
import { DotsSixVertical as DotsSixVertical5, RadioButton as RadioButton2 } from "@phosphor-icons/react";
|
|
3528
3583
|
import { cva as cva8 } from "class-variance-authority";
|
|
3529
|
-
import { jsx as jsx54, jsxs as
|
|
3584
|
+
import { jsx as jsx54, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
3530
3585
|
var roleTagVariants = cva8(
|
|
3531
3586
|
"group inline-flex h-6 items-center whitespace-nowrap rounded-sm py-1 text-ui-caption transition-colors",
|
|
3532
3587
|
{
|
|
@@ -3556,7 +3611,7 @@ var Badge = React53.forwardRef(
|
|
|
3556
3611
|
({ className, type = "primary", selected = false, onClick, children, ...props }, ref) => {
|
|
3557
3612
|
const classes = cn(roleTagVariants({ type, selected: type === "interactable" ? selected : false }), className);
|
|
3558
3613
|
if (type === "interactable") {
|
|
3559
|
-
return /* @__PURE__ */
|
|
3614
|
+
return /* @__PURE__ */ jsxs41(
|
|
3560
3615
|
"button",
|
|
3561
3616
|
{
|
|
3562
3617
|
ref,
|
|
@@ -3572,7 +3627,7 @@ var Badge = React53.forwardRef(
|
|
|
3572
3627
|
}
|
|
3573
3628
|
);
|
|
3574
3629
|
}
|
|
3575
|
-
return /* @__PURE__ */
|
|
3630
|
+
return /* @__PURE__ */ jsxs41("span", { ref, className: classes, ...props, children: [
|
|
3576
3631
|
type === "question" && /* @__PURE__ */ jsx54(RadioButton2, { size: 16, weight: "fill", "aria-hidden": true }),
|
|
3577
3632
|
type === "id" && /* @__PURE__ */ jsx54("span", { className: "text-secondary-muted-foreground", children: "ID" }),
|
|
3578
3633
|
children
|
|
@@ -3584,7 +3639,7 @@ Badge.displayName = "Badge";
|
|
|
3584
3639
|
// src/components/Utility/Pagination.tsx
|
|
3585
3640
|
import * as React54 from "react";
|
|
3586
3641
|
import { ArrowLeft, ArrowRight, DotsThree as DotsThree2 } from "@phosphor-icons/react";
|
|
3587
|
-
import { jsx as jsx55, jsxs as
|
|
3642
|
+
import { jsx as jsx55, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
3588
3643
|
function getPaginationItems(page, pageCount, siblings = 1) {
|
|
3589
3644
|
const keep = /* @__PURE__ */ new Set([1, pageCount]);
|
|
3590
3645
|
for (let p = page - siblings; p <= page + siblings; p++) if (p >= 1 && p <= pageCount) keep.add(p);
|
|
@@ -3625,7 +3680,7 @@ var Pagination = React54.forwardRef(
|
|
|
3625
3680
|
children: /* @__PURE__ */ jsx55(ArrowRight, { size: 16, "aria-hidden": true })
|
|
3626
3681
|
}
|
|
3627
3682
|
);
|
|
3628
|
-
return /* @__PURE__ */
|
|
3683
|
+
return /* @__PURE__ */ jsxs42(
|
|
3629
3684
|
"nav",
|
|
3630
3685
|
{
|
|
3631
3686
|
ref,
|
|
@@ -3634,11 +3689,11 @@ var Pagination = React54.forwardRef(
|
|
|
3634
3689
|
...props,
|
|
3635
3690
|
children: [
|
|
3636
3691
|
previous,
|
|
3637
|
-
variant === "compact" ? /* @__PURE__ */
|
|
3692
|
+
variant === "compact" ? /* @__PURE__ */ jsxs42("span", { className: "text-body-small text-surface-foreground", "aria-live": "polite", children: [
|
|
3638
3693
|
page,
|
|
3639
3694
|
"/",
|
|
3640
3695
|
pageCount
|
|
3641
|
-
] }) : /* @__PURE__ */ jsx55("ul", { className: "flex items-center gap-2", children: getPaginationItems(page, pageCount, siblings).map((item, index) => /* @__PURE__ */ jsx55("li", { children: item === "ellipsis" ? /* @__PURE__ */
|
|
3696
|
+
] }) : /* @__PURE__ */ jsx55("ul", { className: "flex items-center gap-2", children: getPaginationItems(page, pageCount, siblings).map((item, index) => /* @__PURE__ */ jsx55("li", { children: item === "ellipsis" ? /* @__PURE__ */ jsxs42("span", { className: "inline-flex size-8 items-center justify-center rounded-sm border border-border bg-surface text-surface-foreground", children: [
|
|
3642
3697
|
/* @__PURE__ */ jsx55(DotsThree2, { size: 16, "aria-hidden": true }),
|
|
3643
3698
|
/* @__PURE__ */ jsx55("span", { className: "sr-only", children: "More pages" })
|
|
3644
3699
|
] }) : /* @__PURE__ */ jsx55(
|