@discuss-ds/ui 0.1.0 → 0.3.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 +16 -0
- package/dist/index.cjs +547 -412
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -5
- package/dist/index.d.ts +40 -5
- package/dist/index.js +522 -388
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -35,6 +35,7 @@ __export(index_exports, {
|
|
|
35
35
|
ActivityStructure: () => ActivityStructure,
|
|
36
36
|
AskAiInput: () => AskAiInput,
|
|
37
37
|
AskAiToggle: () => AskAiToggle,
|
|
38
|
+
Badge: () => Badge,
|
|
38
39
|
Button: () => Button,
|
|
39
40
|
Calendar: () => Calendar,
|
|
40
41
|
ChatChoices: () => ChatChoices,
|
|
@@ -80,6 +81,7 @@ __export(index_exports, {
|
|
|
80
81
|
FormMessage: () => FormMessage,
|
|
81
82
|
ImagePreview: () => ImagePreview,
|
|
82
83
|
ImageThumbnails: () => ImageThumbnails,
|
|
84
|
+
InlineEdit: () => InlineEdit,
|
|
83
85
|
Input: () => Input,
|
|
84
86
|
InputWithAction: () => InputWithAction,
|
|
85
87
|
Label: () => Label,
|
|
@@ -102,7 +104,6 @@ __export(index_exports, {
|
|
|
102
104
|
RadioGroupItem: () => RadioGroupItem,
|
|
103
105
|
RankList: () => RankList,
|
|
104
106
|
RatingScale: () => RatingScale,
|
|
105
|
-
RoleTag: () => RoleTag,
|
|
106
107
|
SearchBar: () => SearchBar,
|
|
107
108
|
Select: () => Select,
|
|
108
109
|
SelectContent: () => SelectContent,
|
|
@@ -1514,18 +1515,138 @@ var FormMessage = React23.forwardRef(
|
|
|
1514
1515
|
);
|
|
1515
1516
|
FormMessage.displayName = "FormMessage";
|
|
1516
1517
|
|
|
1517
|
-
// src/components/Forms & Data Entry/
|
|
1518
|
+
// src/components/Forms & Data Entry/InlineEdit.tsx
|
|
1518
1519
|
var React24 = __toESM(require("react"), 1);
|
|
1520
|
+
var import_react11 = require("@phosphor-icons/react");
|
|
1519
1521
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1522
|
+
var InlineEdit = React24.forwardRef(
|
|
1523
|
+
({
|
|
1524
|
+
className,
|
|
1525
|
+
textClassName,
|
|
1526
|
+
value: valueProp,
|
|
1527
|
+
defaultValue = "",
|
|
1528
|
+
onValueChange,
|
|
1529
|
+
placeholder = "Click to edit",
|
|
1530
|
+
multiline,
|
|
1531
|
+
maxLength,
|
|
1532
|
+
disabled,
|
|
1533
|
+
onEditingChange,
|
|
1534
|
+
onDraftChange,
|
|
1535
|
+
variant = "default",
|
|
1536
|
+
selected,
|
|
1537
|
+
"aria-label": ariaLabel,
|
|
1538
|
+
...props
|
|
1539
|
+
}, ref) => {
|
|
1540
|
+
const [internal, setInternal] = React24.useState(defaultValue);
|
|
1541
|
+
const value = valueProp ?? internal;
|
|
1542
|
+
const [editing, setEditing] = React24.useState(false);
|
|
1543
|
+
const [draft, setDraft] = React24.useState(value);
|
|
1544
|
+
const fieldRef = React24.useRef(null);
|
|
1545
|
+
const readRef = React24.useRef(null);
|
|
1546
|
+
const cancelled = React24.useRef(false);
|
|
1547
|
+
const restoreFocus = React24.useRef(false);
|
|
1548
|
+
React24.useEffect(() => {
|
|
1549
|
+
if (editing) {
|
|
1550
|
+
fieldRef.current?.focus();
|
|
1551
|
+
fieldRef.current?.select();
|
|
1552
|
+
} else if (restoreFocus.current) {
|
|
1553
|
+
restoreFocus.current = false;
|
|
1554
|
+
readRef.current?.focus();
|
|
1555
|
+
}
|
|
1556
|
+
}, [editing]);
|
|
1557
|
+
const start = () => {
|
|
1558
|
+
if (disabled) return;
|
|
1559
|
+
setDraft(value);
|
|
1560
|
+
cancelled.current = false;
|
|
1561
|
+
setEditing(true);
|
|
1562
|
+
onEditingChange?.(true);
|
|
1563
|
+
};
|
|
1564
|
+
const finish = (commit, refocus) => {
|
|
1565
|
+
restoreFocus.current = refocus;
|
|
1566
|
+
if (commit && draft !== value) {
|
|
1567
|
+
if (valueProp === void 0) setInternal(draft);
|
|
1568
|
+
onValueChange?.(draft);
|
|
1569
|
+
}
|
|
1570
|
+
setEditing(false);
|
|
1571
|
+
onEditingChange?.(false);
|
|
1572
|
+
onDraftChange?.(commit ? draft : value);
|
|
1573
|
+
};
|
|
1574
|
+
const textClasses = cn("text-ui-input-value text-surface-foreground", textClassName);
|
|
1575
|
+
const question = variant === "question";
|
|
1576
|
+
const fill = multiline || question;
|
|
1577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { ref, className: cn(fill ? "flex w-full min-w-0" : "inline-flex min-w-0 max-w-full", className), ...props, children: editing ? React24.createElement(multiline ? "textarea" : "input", {
|
|
1578
|
+
ref: fieldRef,
|
|
1579
|
+
value: draft,
|
|
1580
|
+
maxLength,
|
|
1581
|
+
"aria-label": ariaLabel,
|
|
1582
|
+
...multiline ? { rows: 1 } : { type: "text" },
|
|
1583
|
+
className: cn(
|
|
1584
|
+
"w-full px-3 py-1 outline-none",
|
|
1585
|
+
multiline && "field-sizing-content resize-none",
|
|
1586
|
+
question ? "rounded-none border-0 border-b-2 border-input-accent bg-transparent" : cn("rounded-md focus-visible:border-input-accent", fieldSurfaceClasses("default")),
|
|
1587
|
+
textClasses
|
|
1588
|
+
),
|
|
1589
|
+
onChange: (event) => {
|
|
1590
|
+
setDraft(event.target.value);
|
|
1591
|
+
onDraftChange?.(event.target.value);
|
|
1592
|
+
},
|
|
1593
|
+
onKeyDown: (event) => {
|
|
1594
|
+
if (event.key === "Escape") {
|
|
1595
|
+
cancelled.current = true;
|
|
1596
|
+
finish(false, true);
|
|
1597
|
+
} else if (event.key === "Enter" && (!multiline || event.metaKey || event.ctrlKey || question && !event.shiftKey)) {
|
|
1598
|
+
event.preventDefault();
|
|
1599
|
+
finish(true, true);
|
|
1600
|
+
}
|
|
1601
|
+
},
|
|
1602
|
+
onBlur: () => {
|
|
1603
|
+
if (!cancelled.current) finish(true, false);
|
|
1604
|
+
}
|
|
1605
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
1606
|
+
"button",
|
|
1607
|
+
{
|
|
1608
|
+
ref: readRef,
|
|
1609
|
+
type: "button",
|
|
1610
|
+
disabled,
|
|
1611
|
+
"aria-label": `${ariaLabel}: ${value || placeholder}. Edit`,
|
|
1612
|
+
onClick: start,
|
|
1613
|
+
className: cn(
|
|
1614
|
+
"group inline-flex min-w-0 max-w-full items-center gap-2 px-3 py-1 text-left outline-none",
|
|
1615
|
+
fill && "w-full",
|
|
1616
|
+
question ? cn("rounded-none border-b-2", selected ? "border-input-accent" : "border-transparent") : "rounded-md border border-transparent",
|
|
1617
|
+
"enabled:hover:bg-secondary enabled:focus-visible:border-input-accent disabled:cursor-not-allowed disabled:opacity-50",
|
|
1618
|
+
question && "enabled:hover:border-input-accent",
|
|
1619
|
+
textClasses
|
|
1620
|
+
),
|
|
1621
|
+
children: [
|
|
1622
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: cn("min-w-0", multiline ? "whitespace-pre-wrap" : "truncate", fill && "flex-1", !value && "text-muted-foreground"), children: value || placeholder }),
|
|
1623
|
+
!fill && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1624
|
+
import_react11.PencilSimple,
|
|
1625
|
+
{
|
|
1626
|
+
size: 16,
|
|
1627
|
+
"aria-hidden": true,
|
|
1628
|
+
className: "shrink-0 text-secondary-muted-foreground opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100"
|
|
1629
|
+
}
|
|
1630
|
+
)
|
|
1631
|
+
]
|
|
1632
|
+
}
|
|
1633
|
+
) });
|
|
1634
|
+
}
|
|
1635
|
+
);
|
|
1636
|
+
InlineEdit.displayName = "InlineEdit";
|
|
1637
|
+
|
|
1638
|
+
// src/components/Forms & Data Entry/Input.tsx
|
|
1639
|
+
var React25 = __toESM(require("react"), 1);
|
|
1640
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1520
1641
|
var inputClasses = (status, className) => cn(
|
|
1521
1642
|
"flex h-10 w-full rounded-md px-3 py-2 text-ui-input-value placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
1522
1643
|
fieldSurfaceClasses(status),
|
|
1523
1644
|
className
|
|
1524
1645
|
);
|
|
1525
|
-
var Input =
|
|
1646
|
+
var Input = React25.forwardRef(
|
|
1526
1647
|
({ className, status = "default", label, description, message, id, ...props }, ref) => {
|
|
1527
1648
|
if (label == null && description == null && message == null) {
|
|
1528
|
-
return /* @__PURE__ */ (0,
|
|
1649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1529
1650
|
"input",
|
|
1530
1651
|
{
|
|
1531
1652
|
ref,
|
|
@@ -1536,16 +1657,16 @@ var Input = React24.forwardRef(
|
|
|
1536
1657
|
}
|
|
1537
1658
|
);
|
|
1538
1659
|
}
|
|
1539
|
-
return /* @__PURE__ */ (0,
|
|
1660
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Field, { label, description, message, status, id, children: (control) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("input", { ref, className: inputClasses(status, className), ...control, ...props }) });
|
|
1540
1661
|
}
|
|
1541
1662
|
);
|
|
1542
1663
|
Input.displayName = "Input";
|
|
1543
1664
|
|
|
1544
1665
|
// src/components/Forms & Data Entry/InputWithAction.tsx
|
|
1545
|
-
var
|
|
1546
|
-
var
|
|
1547
|
-
var InputWithAction =
|
|
1548
|
-
({ className, actionLabel, onAction, tags, status = "default", label, description, message, id, disabled, placeholder, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1666
|
+
var React26 = __toESM(require("react"), 1);
|
|
1667
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1668
|
+
var InputWithAction = React26.forwardRef(
|
|
1669
|
+
({ className, actionLabel, onAction, tags, status = "default", label, description, message, id, disabled, placeholder, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Field, { label, description, message, status, id, children: (control) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
1549
1670
|
"div",
|
|
1550
1671
|
{
|
|
1551
1672
|
className: cn(
|
|
@@ -1557,8 +1678,8 @@ var InputWithAction = React25.forwardRef(
|
|
|
1557
1678
|
className
|
|
1558
1679
|
),
|
|
1559
1680
|
children: [
|
|
1560
|
-
tags && /* @__PURE__ */ (0,
|
|
1561
|
-
/* @__PURE__ */ (0,
|
|
1681
|
+
tags && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex shrink-0 items-center gap-1", children: tags }),
|
|
1682
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1562
1683
|
"input",
|
|
1563
1684
|
{
|
|
1564
1685
|
ref,
|
|
@@ -1569,7 +1690,7 @@ var InputWithAction = React25.forwardRef(
|
|
|
1569
1690
|
...props
|
|
1570
1691
|
}
|
|
1571
1692
|
),
|
|
1572
|
-
/* @__PURE__ */ (0,
|
|
1693
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button, { type: "button", variant: "subtle", size: "sm", disabled, onClick: onAction, children: actionLabel })
|
|
1573
1694
|
]
|
|
1574
1695
|
}
|
|
1575
1696
|
) })
|
|
@@ -1577,10 +1698,10 @@ var InputWithAction = React25.forwardRef(
|
|
|
1577
1698
|
InputWithAction.displayName = "InputWithAction";
|
|
1578
1699
|
|
|
1579
1700
|
// src/components/Forms & Data Entry/NumberInput.tsx
|
|
1580
|
-
var
|
|
1581
|
-
var
|
|
1582
|
-
var
|
|
1583
|
-
var NumberInput =
|
|
1701
|
+
var React27 = __toESM(require("react"), 1);
|
|
1702
|
+
var import_react12 = require("@phosphor-icons/react");
|
|
1703
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1704
|
+
var NumberInput = React27.forwardRef(
|
|
1584
1705
|
({
|
|
1585
1706
|
className,
|
|
1586
1707
|
value,
|
|
@@ -1598,7 +1719,7 @@ var NumberInput = React26.forwardRef(
|
|
|
1598
1719
|
disabled,
|
|
1599
1720
|
...props
|
|
1600
1721
|
}, ref) => {
|
|
1601
|
-
const [internal, setInternal] =
|
|
1722
|
+
const [internal, setInternal] = React27.useState(defaultValue);
|
|
1602
1723
|
const current = value ?? internal;
|
|
1603
1724
|
const clamp = (next) => Math.min(max, Math.max(min, next));
|
|
1604
1725
|
const commit = (next) => {
|
|
@@ -1606,7 +1727,7 @@ var NumberInput = React26.forwardRef(
|
|
|
1606
1727
|
setInternal(clamped);
|
|
1607
1728
|
onValueChange?.(clamped);
|
|
1608
1729
|
};
|
|
1609
|
-
return /* @__PURE__ */ (0,
|
|
1730
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Field, { label, description, message, status, id, className: "w-50", children: (control) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
1610
1731
|
"div",
|
|
1611
1732
|
{
|
|
1612
1733
|
className: cn(
|
|
@@ -1617,7 +1738,7 @@ var NumberInput = React26.forwardRef(
|
|
|
1617
1738
|
className
|
|
1618
1739
|
),
|
|
1619
1740
|
children: [
|
|
1620
|
-
/* @__PURE__ */ (0,
|
|
1741
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1621
1742
|
Button,
|
|
1622
1743
|
{
|
|
1623
1744
|
type: "button",
|
|
@@ -1626,11 +1747,11 @@ var NumberInput = React26.forwardRef(
|
|
|
1626
1747
|
"aria-label": "Decrease",
|
|
1627
1748
|
disabled: disabled || current <= min,
|
|
1628
1749
|
onClick: () => commit(current - step),
|
|
1629
|
-
children: /* @__PURE__ */ (0,
|
|
1750
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react12.Minus, { size: 16, "aria-hidden": true })
|
|
1630
1751
|
}
|
|
1631
1752
|
),
|
|
1632
|
-
/* @__PURE__ */ (0,
|
|
1633
|
-
/* @__PURE__ */ (0,
|
|
1753
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center justify-center gap-1 text-center", children: [
|
|
1754
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1634
1755
|
"input",
|
|
1635
1756
|
{
|
|
1636
1757
|
ref,
|
|
@@ -1660,9 +1781,9 @@ var NumberInput = React26.forwardRef(
|
|
|
1660
1781
|
...props
|
|
1661
1782
|
}
|
|
1662
1783
|
),
|
|
1663
|
-
unit && /* @__PURE__ */ (0,
|
|
1784
|
+
unit && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-body-small text-secondary-muted-foreground", children: unit })
|
|
1664
1785
|
] }),
|
|
1665
|
-
/* @__PURE__ */ (0,
|
|
1786
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1666
1787
|
Button,
|
|
1667
1788
|
{
|
|
1668
1789
|
type: "button",
|
|
@@ -1671,7 +1792,7 @@ var NumberInput = React26.forwardRef(
|
|
|
1671
1792
|
"aria-label": "Increase",
|
|
1672
1793
|
disabled: disabled || current >= max,
|
|
1673
1794
|
onClick: () => commit(current + step),
|
|
1674
|
-
children: /* @__PURE__ */ (0,
|
|
1795
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react12.Plus, { size: 16, "aria-hidden": true })
|
|
1675
1796
|
}
|
|
1676
1797
|
)
|
|
1677
1798
|
]
|
|
@@ -1682,14 +1803,14 @@ var NumberInput = React26.forwardRef(
|
|
|
1682
1803
|
NumberInput.displayName = "NumberInput";
|
|
1683
1804
|
|
|
1684
1805
|
// src/components/Forms & Data Entry/SearchBar.tsx
|
|
1685
|
-
var
|
|
1686
|
-
var
|
|
1687
|
-
var
|
|
1688
|
-
var SearchBar =
|
|
1806
|
+
var React28 = __toESM(require("react"), 1);
|
|
1807
|
+
var import_react13 = require("@phosphor-icons/react");
|
|
1808
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1809
|
+
var SearchBar = React28.forwardRef(
|
|
1689
1810
|
({ className, value, defaultValue, onChange, onClear, clearLabel = "Clear search", disabled, ...props }, ref) => {
|
|
1690
|
-
const innerRef =
|
|
1691
|
-
|
|
1692
|
-
const [uncontrolled, setUncontrolled] =
|
|
1811
|
+
const innerRef = React28.useRef(null);
|
|
1812
|
+
React28.useImperativeHandle(ref, () => innerRef.current);
|
|
1813
|
+
const [uncontrolled, setUncontrolled] = React28.useState(String(defaultValue ?? ""));
|
|
1693
1814
|
const current = value !== void 0 ? String(value) : uncontrolled;
|
|
1694
1815
|
const clear = () => {
|
|
1695
1816
|
const input = innerRef.current;
|
|
@@ -1701,7 +1822,7 @@ var SearchBar = React27.forwardRef(
|
|
|
1701
1822
|
}
|
|
1702
1823
|
onClear?.();
|
|
1703
1824
|
};
|
|
1704
|
-
return /* @__PURE__ */ (0,
|
|
1825
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
1705
1826
|
"div",
|
|
1706
1827
|
{
|
|
1707
1828
|
className: cn(
|
|
@@ -1712,8 +1833,8 @@ var SearchBar = React27.forwardRef(
|
|
|
1712
1833
|
className
|
|
1713
1834
|
),
|
|
1714
1835
|
children: [
|
|
1715
|
-
/* @__PURE__ */ (0,
|
|
1716
|
-
/* @__PURE__ */ (0,
|
|
1836
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react13.MagnifyingGlass, { size: 16, "aria-hidden": true, className: "shrink-0 text-surface-foreground" }),
|
|
1837
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1717
1838
|
"input",
|
|
1718
1839
|
{
|
|
1719
1840
|
ref: innerRef,
|
|
@@ -1730,14 +1851,14 @@ var SearchBar = React27.forwardRef(
|
|
|
1730
1851
|
...props
|
|
1731
1852
|
}
|
|
1732
1853
|
),
|
|
1733
|
-
current !== "" && !disabled && /* @__PURE__ */ (0,
|
|
1854
|
+
current !== "" && !disabled && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1734
1855
|
"button",
|
|
1735
1856
|
{
|
|
1736
1857
|
type: "button",
|
|
1737
1858
|
"aria-label": clearLabel,
|
|
1738
1859
|
onClick: clear,
|
|
1739
1860
|
className: "inline-flex size-4 shrink-0 items-center justify-center rounded-xs text-surface-foreground",
|
|
1740
|
-
children: /* @__PURE__ */ (0,
|
|
1861
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react13.X, { size: 16, "aria-hidden": true })
|
|
1741
1862
|
}
|
|
1742
1863
|
)
|
|
1743
1864
|
]
|
|
@@ -1748,16 +1869,16 @@ var SearchBar = React27.forwardRef(
|
|
|
1748
1869
|
SearchBar.displayName = "SearchBar";
|
|
1749
1870
|
|
|
1750
1871
|
// src/components/Forms & Data Entry/Select.tsx
|
|
1751
|
-
var
|
|
1752
|
-
var
|
|
1872
|
+
var React29 = __toESM(require("react"), 1);
|
|
1873
|
+
var import_react14 = require("@phosphor-icons/react");
|
|
1753
1874
|
var import_radix_ui14 = require("radix-ui");
|
|
1754
|
-
var
|
|
1875
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1755
1876
|
var Select = import_radix_ui14.Select.Root;
|
|
1756
1877
|
var SelectValue = import_radix_ui14.Select.Value;
|
|
1757
1878
|
var SelectGroup = import_radix_ui14.Select.Group;
|
|
1758
|
-
var CheckIcon = () => /* @__PURE__ */ (0,
|
|
1759
|
-
var SelectTrigger =
|
|
1760
|
-
({ className, children, icon, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1879
|
+
var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("svg", { width: "10", height: "8", viewBox: "0 0 10 8", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("path", { d: "M1 4L3.5 6.5L9 1", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1880
|
+
var SelectTrigger = React29.forwardRef(
|
|
1881
|
+
({ className, children, icon, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
1761
1882
|
import_radix_ui14.Select.Trigger,
|
|
1762
1883
|
{
|
|
1763
1884
|
ref,
|
|
@@ -1770,16 +1891,16 @@ var SelectTrigger = React28.forwardRef(
|
|
|
1770
1891
|
),
|
|
1771
1892
|
...props,
|
|
1772
1893
|
children: [
|
|
1773
|
-
icon && /* @__PURE__ */ (0,
|
|
1774
|
-
/* @__PURE__ */ (0,
|
|
1775
|
-
/* @__PURE__ */ (0,
|
|
1894
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "flex shrink-0 text-surface-foreground", children: icon }),
|
|
1895
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "min-w-0 flex-1 truncate", children }),
|
|
1896
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_radix_ui14.Select.Icon, { className: "shrink-0 text-surface-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react14.CaretDown, { size: 16, "aria-hidden": true }) })
|
|
1776
1897
|
]
|
|
1777
1898
|
}
|
|
1778
1899
|
)
|
|
1779
1900
|
);
|
|
1780
1901
|
SelectTrigger.displayName = "SelectTrigger";
|
|
1781
|
-
var SelectContent =
|
|
1782
|
-
({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ (0,
|
|
1902
|
+
var SelectContent = React29.forwardRef(
|
|
1903
|
+
({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_radix_ui14.Select.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1783
1904
|
import_radix_ui14.Select.Content,
|
|
1784
1905
|
{
|
|
1785
1906
|
ref,
|
|
@@ -1793,13 +1914,13 @@ var SelectContent = React28.forwardRef(
|
|
|
1793
1914
|
className
|
|
1794
1915
|
),
|
|
1795
1916
|
...props,
|
|
1796
|
-
children: /* @__PURE__ */ (0,
|
|
1917
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_radix_ui14.Select.Viewport, { className: "p-1", children })
|
|
1797
1918
|
}
|
|
1798
1919
|
) })
|
|
1799
1920
|
);
|
|
1800
1921
|
SelectContent.displayName = "SelectContent";
|
|
1801
|
-
var SelectItem =
|
|
1802
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1922
|
+
var SelectItem = React29.forwardRef(
|
|
1923
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
1803
1924
|
import_radix_ui14.Select.Item,
|
|
1804
1925
|
{
|
|
1805
1926
|
ref,
|
|
@@ -1810,8 +1931,8 @@ var SelectItem = React28.forwardRef(
|
|
|
1810
1931
|
),
|
|
1811
1932
|
...props,
|
|
1812
1933
|
children: [
|
|
1813
|
-
/* @__PURE__ */ (0,
|
|
1814
|
-
/* @__PURE__ */ (0,
|
|
1934
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "absolute left-2 flex h-4 w-4 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_radix_ui14.Select.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CheckIcon, {}) }) }),
|
|
1935
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_radix_ui14.Select.ItemText, { children })
|
|
1815
1936
|
]
|
|
1816
1937
|
}
|
|
1817
1938
|
)
|
|
@@ -1819,10 +1940,10 @@ var SelectItem = React28.forwardRef(
|
|
|
1819
1940
|
SelectItem.displayName = "SelectItem";
|
|
1820
1941
|
|
|
1821
1942
|
// src/components/Forms & Data Entry/Slider.tsx
|
|
1822
|
-
var
|
|
1943
|
+
var React30 = __toESM(require("react"), 1);
|
|
1823
1944
|
var import_radix_ui15 = require("radix-ui");
|
|
1824
|
-
var
|
|
1825
|
-
var Slider =
|
|
1945
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1946
|
+
var Slider = React30.forwardRef(
|
|
1826
1947
|
({
|
|
1827
1948
|
className,
|
|
1828
1949
|
value,
|
|
@@ -1837,15 +1958,15 @@ var Slider = React29.forwardRef(
|
|
|
1837
1958
|
"aria-labelledby": ariaLabelledBy,
|
|
1838
1959
|
...props
|
|
1839
1960
|
}, ref) => {
|
|
1840
|
-
const [internal, setInternal] =
|
|
1961
|
+
const [internal, setInternal] = React30.useState(defaultValue ?? [min]);
|
|
1841
1962
|
const thumbValues = value ?? internal;
|
|
1842
1963
|
const hasHeader = label != null || showRange;
|
|
1843
|
-
return /* @__PURE__ */ (0,
|
|
1844
|
-
hasHeader && /* @__PURE__ */ (0,
|
|
1845
|
-
label != null ? /* @__PURE__ */ (0,
|
|
1846
|
-
/* @__PURE__ */ (0,
|
|
1964
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: cn("flex w-full flex-col gap-2", className), children: [
|
|
1965
|
+
hasHeader && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex items-center justify-between text-secondary-muted-foreground", children: [
|
|
1966
|
+
label != null ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-ui-label text-surface-foreground", children: label }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-ui-caption", children: min }),
|
|
1967
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-body-small", children: max })
|
|
1847
1968
|
] }),
|
|
1848
|
-
/* @__PURE__ */ (0,
|
|
1969
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
1849
1970
|
import_radix_ui15.Slider.Root,
|
|
1850
1971
|
{
|
|
1851
1972
|
ref,
|
|
@@ -1860,19 +1981,19 @@ var Slider = React29.forwardRef(
|
|
|
1860
1981
|
className: "relative flex h-4 w-full touch-none items-center select-none",
|
|
1861
1982
|
...props,
|
|
1862
1983
|
children: [
|
|
1863
|
-
/* @__PURE__ */ (0,
|
|
1984
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_radix_ui15.Slider.Track, { className: "relative h-1 w-full grow overflow-hidden rounded-xxs bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_radix_ui15.Slider.Range, { className: "absolute h-full bg-input-accent" }) }),
|
|
1864
1985
|
thumbValues.map((thumbValue, index) => (
|
|
1865
1986
|
// The accessible name belongs on each individual thumb (the actual
|
|
1866
1987
|
// role="slider" element) — Root is just a group container. With
|
|
1867
1988
|
// more than one thumb this applies the same label to each; give a
|
|
1868
1989
|
// range slider distinct per-thumb labels via aria-labelledby instead.
|
|
1869
|
-
/* @__PURE__ */ (0,
|
|
1990
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1870
1991
|
import_radix_ui15.Slider.Thumb,
|
|
1871
1992
|
{
|
|
1872
1993
|
"aria-label": ariaLabel,
|
|
1873
1994
|
"aria-labelledby": ariaLabelledBy,
|
|
1874
1995
|
className: "group relative block size-4 rounded-full border-2 border-surface bg-input-accent shadow-sm transition-colors disabled:pointer-events-none disabled:opacity-50",
|
|
1875
|
-
children: showValue && /* @__PURE__ */ (0,
|
|
1996
|
+
children: showValue && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1876
1997
|
"span",
|
|
1877
1998
|
{
|
|
1878
1999
|
"aria-hidden": "true",
|
|
@@ -1896,17 +2017,17 @@ var Slider = React29.forwardRef(
|
|
|
1896
2017
|
Slider.displayName = "Slider";
|
|
1897
2018
|
|
|
1898
2019
|
// src/components/Forms & Data Entry/Textarea.tsx
|
|
1899
|
-
var
|
|
1900
|
-
var
|
|
2020
|
+
var React31 = __toESM(require("react"), 1);
|
|
2021
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1901
2022
|
var textareaClasses = (status, className) => cn(
|
|
1902
2023
|
"flex field-sizing-content min-h-25 w-full rounded-md px-3 py-2.5 text-body-base placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
1903
2024
|
fieldSurfaceClasses(status),
|
|
1904
2025
|
className
|
|
1905
2026
|
);
|
|
1906
|
-
var Textarea =
|
|
2027
|
+
var Textarea = React31.forwardRef(
|
|
1907
2028
|
({ className, status = "default", label, description, message, id, ...props }, ref) => {
|
|
1908
2029
|
if (label == null && description == null && message == null) {
|
|
1909
|
-
return /* @__PURE__ */ (0,
|
|
2030
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1910
2031
|
"textarea",
|
|
1911
2032
|
{
|
|
1912
2033
|
ref,
|
|
@@ -1917,29 +2038,29 @@ var Textarea = React30.forwardRef(
|
|
|
1917
2038
|
}
|
|
1918
2039
|
);
|
|
1919
2040
|
}
|
|
1920
|
-
return /* @__PURE__ */ (0,
|
|
2041
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Field, { label, description, message, status, id, children: (control) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("textarea", { ref, className: textareaClasses(status, className), ...control, ...props }) });
|
|
1921
2042
|
}
|
|
1922
2043
|
);
|
|
1923
2044
|
Textarea.displayName = "Textarea";
|
|
1924
2045
|
|
|
1925
2046
|
// src/components/Overlays & Feedback/Dialog.tsx
|
|
1926
|
-
var
|
|
1927
|
-
var
|
|
2047
|
+
var React32 = __toESM(require("react"), 1);
|
|
2048
|
+
var import_react15 = require("@phosphor-icons/react");
|
|
1928
2049
|
var import_radix_ui16 = require("radix-ui");
|
|
1929
|
-
var
|
|
2050
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1930
2051
|
var Dialog = import_radix_ui16.Dialog.Root;
|
|
1931
2052
|
var DialogTrigger = import_radix_ui16.Dialog.Trigger;
|
|
1932
2053
|
var DialogClose = import_radix_ui16.Dialog.Close;
|
|
1933
|
-
var DialogContent =
|
|
1934
|
-
({ className, children, closeLabel = "Close", hideClose, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1935
|
-
/* @__PURE__ */ (0,
|
|
2054
|
+
var DialogContent = React32.forwardRef(
|
|
2055
|
+
({ className, children, closeLabel = "Close", hideClose, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_radix_ui16.Dialog.Portal, { children: [
|
|
2056
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1936
2057
|
import_radix_ui16.Dialog.Overlay,
|
|
1937
2058
|
{
|
|
1938
2059
|
style: { zIndex: "var(--sys-z-30)" },
|
|
1939
2060
|
className: "fixed inset-0 bg-primary/30"
|
|
1940
2061
|
}
|
|
1941
2062
|
),
|
|
1942
|
-
/* @__PURE__ */ (0,
|
|
2063
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
1943
2064
|
import_radix_ui16.Dialog.Content,
|
|
1944
2065
|
{
|
|
1945
2066
|
ref,
|
|
@@ -1951,15 +2072,15 @@ var DialogContent = React31.forwardRef(
|
|
|
1951
2072
|
...props,
|
|
1952
2073
|
children: [
|
|
1953
2074
|
children,
|
|
1954
|
-
!hideClose && /* @__PURE__ */ (0,
|
|
2075
|
+
!hideClose && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_radix_ui16.Dialog.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Button, { variant: "ghost", size: "icon-sm", "aria-label": closeLabel, className: "absolute top-4 right-6", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react15.X, { size: 16, "aria-hidden": true }) }) })
|
|
1955
2076
|
]
|
|
1956
2077
|
}
|
|
1957
2078
|
)
|
|
1958
2079
|
] })
|
|
1959
2080
|
);
|
|
1960
2081
|
DialogContent.displayName = "DialogContent";
|
|
1961
|
-
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ (0,
|
|
1962
|
-
var DialogTitle =
|
|
2082
|
+
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: cn("flex flex-col gap-1.5 border-b border-border px-6 py-4 pr-16", className), ...props });
|
|
2083
|
+
var DialogTitle = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1963
2084
|
import_radix_ui16.Dialog.Title,
|
|
1964
2085
|
{
|
|
1965
2086
|
ref,
|
|
@@ -1968,7 +2089,7 @@ var DialogTitle = React31.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
1968
2089
|
}
|
|
1969
2090
|
));
|
|
1970
2091
|
DialogTitle.displayName = "DialogTitle";
|
|
1971
|
-
var DialogDescription =
|
|
2092
|
+
var DialogDescription = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1972
2093
|
import_radix_ui16.Dialog.Description,
|
|
1973
2094
|
{
|
|
1974
2095
|
ref,
|
|
@@ -1977,15 +2098,15 @@ var DialogDescription = React31.forwardRef(({ className, ...props }, ref) => /*
|
|
|
1977
2098
|
}
|
|
1978
2099
|
));
|
|
1979
2100
|
DialogDescription.displayName = "DialogDescription";
|
|
1980
|
-
var DialogBody = ({ className, ...props }) => /* @__PURE__ */ (0,
|
|
1981
|
-
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ (0,
|
|
2101
|
+
var DialogBody = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: cn("flex flex-col gap-4 p-6", className), ...props });
|
|
2102
|
+
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: cn("flex items-center justify-end gap-3 border-t border-border px-6 py-4", className), ...props });
|
|
1982
2103
|
|
|
1983
2104
|
// src/components/Overlays & Feedback/Toast.tsx
|
|
1984
|
-
var
|
|
1985
|
-
var
|
|
2105
|
+
var React33 = __toESM(require("react"), 1);
|
|
2106
|
+
var import_react16 = require("@phosphor-icons/react");
|
|
1986
2107
|
var import_class_variance_authority4 = require("class-variance-authority");
|
|
1987
2108
|
var import_radix_ui17 = require("radix-ui");
|
|
1988
|
-
var
|
|
2109
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1989
2110
|
var toastVariants = (0, import_class_variance_authority4.cva)("border", {
|
|
1990
2111
|
variants: {
|
|
1991
2112
|
variant: {
|
|
@@ -2011,13 +2132,13 @@ var titleColour = {
|
|
|
2011
2132
|
};
|
|
2012
2133
|
function VariantIcon({ variant, size }) {
|
|
2013
2134
|
const props = { size, "aria-hidden": true, className: cn("shrink-0", iconColour[variant]) };
|
|
2014
|
-
if (variant === "success") return /* @__PURE__ */ (0,
|
|
2015
|
-
if (variant === "warning") return /* @__PURE__ */ (0,
|
|
2016
|
-
if (variant === "destructive") return /* @__PURE__ */ (0,
|
|
2017
|
-
return /* @__PURE__ */ (0,
|
|
2135
|
+
if (variant === "success") return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react16.CheckCircle, { ...props });
|
|
2136
|
+
if (variant === "warning") return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react16.Warning, { ...props });
|
|
2137
|
+
if (variant === "destructive") return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react16.WarningCircle, { ...props });
|
|
2138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react16.Info, { ...props });
|
|
2018
2139
|
}
|
|
2019
2140
|
var ToastProvider = import_radix_ui17.Toast.Provider;
|
|
2020
|
-
var ToastViewport =
|
|
2141
|
+
var ToastViewport = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2021
2142
|
import_radix_ui17.Toast.Viewport,
|
|
2022
2143
|
{
|
|
2023
2144
|
ref,
|
|
@@ -2027,10 +2148,10 @@ var ToastViewport = React32.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
2027
2148
|
}
|
|
2028
2149
|
));
|
|
2029
2150
|
ToastViewport.displayName = "ToastViewport";
|
|
2030
|
-
var Toast =
|
|
2151
|
+
var Toast = React33.forwardRef(
|
|
2031
2152
|
({ className, variant = "info", title, description, action, closeLabel = "Close", children, ...props }, ref) => {
|
|
2032
2153
|
const v = variant ?? "info";
|
|
2033
|
-
return /* @__PURE__ */ (0,
|
|
2154
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
2034
2155
|
import_radix_ui17.Toast.Root,
|
|
2035
2156
|
{
|
|
2036
2157
|
ref,
|
|
@@ -2038,19 +2159,19 @@ var Toast = React32.forwardRef(
|
|
|
2038
2159
|
className: cn("flex items-start gap-3 rounded-lg p-4 shadow-lg", toastVariants({ variant: v }), className),
|
|
2039
2160
|
...props,
|
|
2040
2161
|
children: [
|
|
2041
|
-
/* @__PURE__ */ (0,
|
|
2042
|
-
/* @__PURE__ */ (0,
|
|
2043
|
-
title != null && /* @__PURE__ */ (0,
|
|
2044
|
-
description != null && /* @__PURE__ */ (0,
|
|
2162
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(VariantIcon, { variant: v, size: 20 }),
|
|
2163
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1 text-body-small", children: [
|
|
2164
|
+
title != null && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_radix_ui17.Toast.Title, { className: cn("font-semibold", titleColour[v]), children: title }),
|
|
2165
|
+
description != null && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_radix_ui17.Toast.Description, { className: "text-secondary-muted-foreground", children: description }),
|
|
2045
2166
|
children,
|
|
2046
2167
|
action
|
|
2047
2168
|
] }),
|
|
2048
|
-
/* @__PURE__ */ (0,
|
|
2169
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2049
2170
|
import_radix_ui17.Toast.Close,
|
|
2050
2171
|
{
|
|
2051
2172
|
"aria-label": closeLabel,
|
|
2052
2173
|
className: "inline-flex size-4 shrink-0 items-center justify-center rounded-xs text-surface-foreground",
|
|
2053
|
-
children: /* @__PURE__ */ (0,
|
|
2174
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react16.X, { size: 16, "aria-hidden": true })
|
|
2054
2175
|
}
|
|
2055
2176
|
)
|
|
2056
2177
|
]
|
|
@@ -2060,10 +2181,10 @@ var Toast = React32.forwardRef(
|
|
|
2060
2181
|
);
|
|
2061
2182
|
Toast.displayName = "Toast";
|
|
2062
2183
|
var ToastAction = import_radix_ui17.Toast.Action;
|
|
2063
|
-
var ToastInline =
|
|
2184
|
+
var ToastInline = React33.forwardRef(
|
|
2064
2185
|
({ className, variant = "info", onClose, closeLabel = "Close", children, ...props }, ref) => {
|
|
2065
2186
|
const v = variant ?? "info";
|
|
2066
|
-
return /* @__PURE__ */ (0,
|
|
2187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
2067
2188
|
"div",
|
|
2068
2189
|
{
|
|
2069
2190
|
ref,
|
|
@@ -2071,9 +2192,9 @@ var ToastInline = React32.forwardRef(
|
|
|
2071
2192
|
className: cn("flex items-center gap-2 rounded-sm px-2 py-1.5", toastVariants({ variant: v }), className),
|
|
2072
2193
|
...props,
|
|
2073
2194
|
children: [
|
|
2074
|
-
/* @__PURE__ */ (0,
|
|
2075
|
-
/* @__PURE__ */ (0,
|
|
2076
|
-
onClose && /* @__PURE__ */ (0,
|
|
2195
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(VariantIcon, { variant: v, size: 16 }),
|
|
2196
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "min-w-0 flex-1 text-body-small text-secondary-muted-foreground", children }),
|
|
2197
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": closeLabel, onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react16.X, { size: 16, "aria-hidden": true }) })
|
|
2077
2198
|
]
|
|
2078
2199
|
}
|
|
2079
2200
|
);
|
|
@@ -2082,16 +2203,16 @@ var ToastInline = React32.forwardRef(
|
|
|
2082
2203
|
ToastInline.displayName = "ToastInline";
|
|
2083
2204
|
|
|
2084
2205
|
// src/components/Overlays & Feedback/Tooltip.tsx
|
|
2085
|
-
var
|
|
2206
|
+
var React34 = __toESM(require("react"), 1);
|
|
2086
2207
|
var import_radix_ui18 = require("radix-ui");
|
|
2087
|
-
var
|
|
2208
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2088
2209
|
var TooltipProvider = import_radix_ui18.Tooltip.Provider;
|
|
2089
2210
|
var Tooltip = import_radix_ui18.Tooltip.Root;
|
|
2090
2211
|
var TooltipTrigger = import_radix_ui18.Tooltip.Trigger;
|
|
2091
|
-
var TooltipContent =
|
|
2212
|
+
var TooltipContent = React34.forwardRef(
|
|
2092
2213
|
({ className, sideOffset = 4, title, description, action, arrow = true, children, ...props }, ref) => {
|
|
2093
2214
|
const detailed = title != null || description != null;
|
|
2094
|
-
return /* @__PURE__ */ (0,
|
|
2215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_radix_ui18.Tooltip.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
2095
2216
|
import_radix_ui18.Tooltip.Content,
|
|
2096
2217
|
{
|
|
2097
2218
|
ref,
|
|
@@ -2105,12 +2226,12 @@ var TooltipContent = React33.forwardRef(
|
|
|
2105
2226
|
),
|
|
2106
2227
|
...props,
|
|
2107
2228
|
children: [
|
|
2108
|
-
detailed ? /* @__PURE__ */ (0,
|
|
2109
|
-
title != null && /* @__PURE__ */ (0,
|
|
2110
|
-
description != null && /* @__PURE__ */ (0,
|
|
2111
|
-
action != null && /* @__PURE__ */ (0,
|
|
2229
|
+
detailed ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
2230
|
+
title != null && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-xs leading-4 font-semibold text-label", children: title }),
|
|
2231
|
+
description != null && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-xs leading-4.5 text-plum-200", children: description }),
|
|
2232
|
+
action != null && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "mt-1 text-ui-caption text-plum-300 underline *:underline", children: action })
|
|
2112
2233
|
] }) : children,
|
|
2113
|
-
arrow && /* @__PURE__ */ (0,
|
|
2234
|
+
arrow && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_radix_ui18.Tooltip.Arrow, { width: 12, height: 8, className: "fill-primary-soft-foreground" })
|
|
2114
2235
|
]
|
|
2115
2236
|
}
|
|
2116
2237
|
) });
|
|
@@ -2119,14 +2240,14 @@ var TooltipContent = React33.forwardRef(
|
|
|
2119
2240
|
TooltipContent.displayName = "TooltipContent";
|
|
2120
2241
|
|
|
2121
2242
|
// src/components/Question Types/FileUpload.tsx
|
|
2122
|
-
var
|
|
2123
|
-
var
|
|
2243
|
+
var React36 = __toESM(require("react"), 1);
|
|
2244
|
+
var import_react17 = require("@phosphor-icons/react");
|
|
2124
2245
|
var import_radix_ui19 = require("radix-ui");
|
|
2125
2246
|
|
|
2126
2247
|
// src/components/Tags & Badges/Tag.tsx
|
|
2127
|
-
var
|
|
2248
|
+
var React35 = __toESM(require("react"), 1);
|
|
2128
2249
|
var import_class_variance_authority5 = require("class-variance-authority");
|
|
2129
|
-
var
|
|
2250
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2130
2251
|
var tagVariants = (0, import_class_variance_authority5.cva)(
|
|
2131
2252
|
"inline-flex items-center gap-1.5 whitespace-nowrap rounded-sm border px-2.5 py-1 text-ui-caption",
|
|
2132
2253
|
{
|
|
@@ -2142,7 +2263,7 @@ var tagVariants = (0, import_class_variance_authority5.cva)(
|
|
|
2142
2263
|
defaultVariants: { variant: "neutral" }
|
|
2143
2264
|
}
|
|
2144
2265
|
);
|
|
2145
|
-
var Tag =
|
|
2266
|
+
var Tag = React35.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { ref, className: cn(tagVariants({ variant }), className), ...props }));
|
|
2146
2267
|
Tag.displayName = "Tag";
|
|
2147
2268
|
var statusDotVariants = (0, import_class_variance_authority5.cva)("size-1.5 shrink-0 rounded-full", {
|
|
2148
2269
|
variants: {
|
|
@@ -2155,20 +2276,20 @@ var statusDotVariants = (0, import_class_variance_authority5.cva)("size-1.5 shri
|
|
|
2155
2276
|
},
|
|
2156
2277
|
defaultVariants: { status: "active" }
|
|
2157
2278
|
});
|
|
2158
|
-
var StatusTag =
|
|
2159
|
-
({ className, status, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2160
|
-
/* @__PURE__ */ (0,
|
|
2279
|
+
var StatusTag = React35.forwardRef(
|
|
2280
|
+
({ className, status, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { ref, className: cn(tagVariants({ variant: "default" }), className), ...props, children: [
|
|
2281
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: statusDotVariants({ status }), "aria-hidden": "true" }),
|
|
2161
2282
|
children
|
|
2162
2283
|
] })
|
|
2163
2284
|
);
|
|
2164
2285
|
StatusTag.displayName = "StatusTag";
|
|
2165
2286
|
|
|
2166
2287
|
// src/components/Question Types/FileUpload.tsx
|
|
2167
|
-
var
|
|
2168
|
-
var FileUploadZone =
|
|
2288
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2289
|
+
var FileUploadZone = React36.forwardRef(
|
|
2169
2290
|
({ className, title = "Upload document", hint, icon, onFiles, ...props }, ref) => {
|
|
2170
|
-
const [over, setOver] =
|
|
2171
|
-
return /* @__PURE__ */ (0,
|
|
2291
|
+
const [over, setOver] = React36.useState(false);
|
|
2292
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
2172
2293
|
"label",
|
|
2173
2294
|
{
|
|
2174
2295
|
className: cn(
|
|
@@ -2188,12 +2309,12 @@ var FileUploadZone = React35.forwardRef(
|
|
|
2188
2309
|
onFiles?.(Array.from(event.dataTransfer.files));
|
|
2189
2310
|
},
|
|
2190
2311
|
children: [
|
|
2191
|
-
/* @__PURE__ */ (0,
|
|
2192
|
-
/* @__PURE__ */ (0,
|
|
2193
|
-
/* @__PURE__ */ (0,
|
|
2194
|
-
hint && /* @__PURE__ */ (0,
|
|
2312
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("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__ */ (0, import_jsx_runtime37.jsx)(import_react17.FileText, { size: 24, "aria-hidden": true }) }),
|
|
2313
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "flex flex-col gap-1", children: [
|
|
2314
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "text-body-small text-surface-foreground", children: title }),
|
|
2315
|
+
hint && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "text-ui-caption text-secondary-muted-foreground", children: hint })
|
|
2195
2316
|
] }),
|
|
2196
|
-
/* @__PURE__ */ (0,
|
|
2317
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2197
2318
|
"input",
|
|
2198
2319
|
{
|
|
2199
2320
|
ref,
|
|
@@ -2209,49 +2330,49 @@ var FileUploadZone = React35.forwardRef(
|
|
|
2209
2330
|
}
|
|
2210
2331
|
);
|
|
2211
2332
|
FileUploadZone.displayName = "FileUploadZone";
|
|
2212
|
-
var FileUploadItem =
|
|
2333
|
+
var FileUploadItem = React36.forwardRef(
|
|
2213
2334
|
({ className, name, size, status = "uploading", progress = 0, timeLeft, icon, onRemove, removeLabel, ...props }, ref) => {
|
|
2214
2335
|
const uploading = status === "uploading";
|
|
2215
|
-
return /* @__PURE__ */ (0,
|
|
2336
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
2216
2337
|
"div",
|
|
2217
2338
|
{
|
|
2218
2339
|
ref,
|
|
2219
2340
|
className: cn("flex w-full flex-col justify-center gap-2 overflow-hidden rounded-sm border border-border p-2", className),
|
|
2220
2341
|
...props,
|
|
2221
2342
|
children: [
|
|
2222
|
-
/* @__PURE__ */ (0,
|
|
2223
|
-
/* @__PURE__ */ (0,
|
|
2224
|
-
/* @__PURE__ */ (0,
|
|
2225
|
-
/* @__PURE__ */ (0,
|
|
2226
|
-
/* @__PURE__ */ (0,
|
|
2227
|
-
/* @__PURE__ */ (0,
|
|
2228
|
-
status === "complete" && /* @__PURE__ */ (0,
|
|
2229
|
-
status === "error" && /* @__PURE__ */ (0,
|
|
2343
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
2344
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("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__ */ (0, import_jsx_runtime37.jsx)(import_react17.FileText, { size: 24, "aria-hidden": true }) }),
|
|
2345
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
2346
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
2347
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2348
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "truncate text-ui-label text-surface-foreground", children: name }),
|
|
2349
|
+
status === "complete" && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Tag, { variant: "success", children: "Complete" }),
|
|
2350
|
+
status === "error" && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Tag, { variant: "destructive", children: "Error" })
|
|
2230
2351
|
] }),
|
|
2231
|
-
onRemove && /* @__PURE__ */ (0,
|
|
2352
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": removeLabel ?? `Remove ${name}`, onClick: onRemove, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react17.X, { size: 16, "aria-hidden": true }) })
|
|
2232
2353
|
] }),
|
|
2233
|
-
/* @__PURE__ */ (0,
|
|
2234
|
-
/* @__PURE__ */ (0,
|
|
2354
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex items-center justify-between text-ui-caption text-secondary-muted-foreground", children: [
|
|
2355
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "flex items-center gap-2", children: [
|
|
2235
2356
|
size,
|
|
2236
|
-
uploading && timeLeft && /* @__PURE__ */ (0,
|
|
2237
|
-
/* @__PURE__ */ (0,
|
|
2357
|
+
uploading && timeLeft && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
2358
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { "aria-hidden": "true", className: "size-0.5 rounded-full bg-secondary-muted-foreground" }),
|
|
2238
2359
|
timeLeft
|
|
2239
2360
|
] })
|
|
2240
2361
|
] }),
|
|
2241
|
-
uploading && /* @__PURE__ */ (0,
|
|
2362
|
+
uploading && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "text-body-xxs font-normal", children: [
|
|
2242
2363
|
Math.round(progress),
|
|
2243
2364
|
"%"
|
|
2244
2365
|
] })
|
|
2245
2366
|
] })
|
|
2246
2367
|
] })
|
|
2247
2368
|
] }),
|
|
2248
|
-
uploading && /* @__PURE__ */ (0,
|
|
2369
|
+
uploading && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2249
2370
|
import_radix_ui19.Progress.Root,
|
|
2250
2371
|
{
|
|
2251
2372
|
value: progress,
|
|
2252
2373
|
"aria-label": `Uploading ${name}`,
|
|
2253
2374
|
className: "h-0.75 w-full overflow-hidden rounded-sm bg-background bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5",
|
|
2254
|
-
children: /* @__PURE__ */ (0,
|
|
2375
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_radix_ui19.Progress.Indicator, { className: "h-full bg-accent transition-[width]", style: { width: `${progress}%` } })
|
|
2255
2376
|
}
|
|
2256
2377
|
)
|
|
2257
2378
|
]
|
|
@@ -2262,31 +2383,31 @@ var FileUploadItem = React35.forwardRef(
|
|
|
2262
2383
|
FileUploadItem.displayName = "FileUploadItem";
|
|
2263
2384
|
|
|
2264
2385
|
// src/components/Question Types/Media.tsx
|
|
2265
|
-
var
|
|
2266
|
-
var
|
|
2386
|
+
var React37 = __toESM(require("react"), 1);
|
|
2387
|
+
var import_react18 = require("@phosphor-icons/react");
|
|
2267
2388
|
var import_radix_ui20 = require("radix-ui");
|
|
2268
|
-
var
|
|
2389
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2269
2390
|
function MediaInfo({ name, details, onRemove, removeLabel, large, className, ...props }) {
|
|
2270
|
-
return /* @__PURE__ */ (0,
|
|
2271
|
-
/* @__PURE__ */ (0,
|
|
2272
|
-
/* @__PURE__ */ (0,
|
|
2273
|
-
details && /* @__PURE__ */ (0,
|
|
2274
|
-
index > 0 && /* @__PURE__ */ (0,
|
|
2391
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: cn("flex items-center justify-between border-t border-border bg-surface px-6 py-4", className), ...props, children: [
|
|
2392
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
2393
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: cn("truncate text-surface-foreground", large ? "text-body-section" : "text-ui-label"), children: name }),
|
|
2394
|
+
details && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("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__ */ (0, import_jsx_runtime38.jsxs)(React37.Fragment, { children: [
|
|
2395
|
+
index > 0 && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { "aria-hidden": "true", className: "size-0.5 rounded-full bg-secondary-muted-foreground" }),
|
|
2275
2396
|
part
|
|
2276
2397
|
] }, part)) })
|
|
2277
2398
|
] }),
|
|
2278
|
-
onRemove && /* @__PURE__ */ (0,
|
|
2399
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Button, { type: "button", variant: "destructive", size: "icon", "aria-label": removeLabel ?? `Remove ${name}`, onClick: onRemove, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react18.Trash, { size: 16, "aria-hidden": true }) })
|
|
2279
2400
|
] });
|
|
2280
2401
|
}
|
|
2281
|
-
var ImagePreview =
|
|
2282
|
-
({ className, children, name, details, onRemove, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2283
|
-
/* @__PURE__ */ (0,
|
|
2284
|
-
/* @__PURE__ */ (0,
|
|
2402
|
+
var ImagePreview = React37.forwardRef(
|
|
2403
|
+
({ className, children, name, details, onRemove, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { ref, className: cn("flex w-full flex-col overflow-hidden rounded-lg border border-border", className), ...props, children: [
|
|
2404
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "flex h-84 w-full items-center justify-center bg-accent-soft [&>img]:size-full [&>img]:object-contain", children }),
|
|
2405
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MediaInfo, { name, details, onRemove, large: true })
|
|
2285
2406
|
] })
|
|
2286
2407
|
);
|
|
2287
2408
|
ImagePreview.displayName = "ImagePreview";
|
|
2288
|
-
var ImageThumbnails =
|
|
2289
|
-
({ className, max, images, value, onValueChange, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2409
|
+
var ImageThumbnails = React37.forwardRef(
|
|
2410
|
+
({ className, max, images, value, onValueChange, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2290
2411
|
import_radix_ui20.ToggleGroup.Root,
|
|
2291
2412
|
{
|
|
2292
2413
|
ref,
|
|
@@ -2298,17 +2419,17 @@ var ImageThumbnails = React36.forwardRef(
|
|
|
2298
2419
|
children: Array.from({ length: max }, (_, index) => {
|
|
2299
2420
|
const image = images[index];
|
|
2300
2421
|
if (!image) {
|
|
2301
|
-
return /* @__PURE__ */ (0,
|
|
2422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2302
2423
|
"span",
|
|
2303
2424
|
{
|
|
2304
2425
|
"aria-hidden": "true",
|
|
2305
2426
|
className: "flex h-20 min-w-0 flex-1 items-center justify-center rounded-sm border border-dashed border-border text-accent-foreground",
|
|
2306
|
-
children: /* @__PURE__ */ (0,
|
|
2427
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react18.Image, { size: 24 })
|
|
2307
2428
|
},
|
|
2308
2429
|
`empty-${index}`
|
|
2309
2430
|
);
|
|
2310
2431
|
}
|
|
2311
|
-
return /* @__PURE__ */ (0,
|
|
2432
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2312
2433
|
import_radix_ui20.ToggleGroup.Item,
|
|
2313
2434
|
{
|
|
2314
2435
|
value: image.id,
|
|
@@ -2318,7 +2439,7 @@ var ImageThumbnails = React36.forwardRef(
|
|
|
2318
2439
|
"hover:bg-accent-soft hover:bg-none",
|
|
2319
2440
|
"data-[state=on]:border-accent-foreground data-[state=on]:bg-accent-soft data-[state=on]:bg-none data-[state=on]:text-accent-foreground"
|
|
2320
2441
|
),
|
|
2321
|
-
children: image.src ? /* @__PURE__ */ (0,
|
|
2442
|
+
children: image.src ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("img", { src: image.src, alt: "", className: "size-full object-cover" }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react18.Image, { size: 24, "aria-hidden": true })
|
|
2322
2443
|
},
|
|
2323
2444
|
image.id
|
|
2324
2445
|
);
|
|
@@ -2331,13 +2452,13 @@ var formatTime = (seconds) => {
|
|
|
2331
2452
|
const total = Math.max(0, Math.floor(Number.isFinite(seconds) ? seconds : 0));
|
|
2332
2453
|
return `${Math.floor(total / 60)}:${String(total % 60).padStart(2, "0")}`;
|
|
2333
2454
|
};
|
|
2334
|
-
var VideoPlayer =
|
|
2455
|
+
var VideoPlayer = React37.forwardRef(
|
|
2335
2456
|
({ className, src, name, details, onRemove, onMore, initialTime = 0, initialDuration = 0, ...props }, ref) => {
|
|
2336
|
-
const video =
|
|
2337
|
-
const [playing, setPlaying] =
|
|
2338
|
-
const [time, setTime] =
|
|
2339
|
-
const [duration, setDuration] =
|
|
2340
|
-
const [volume, setVolume] =
|
|
2457
|
+
const video = React37.useRef(null);
|
|
2458
|
+
const [playing, setPlaying] = React37.useState(false);
|
|
2459
|
+
const [time, setTime] = React37.useState(initialTime);
|
|
2460
|
+
const [duration, setDuration] = React37.useState(initialDuration);
|
|
2461
|
+
const [volume, setVolume] = React37.useState(1);
|
|
2341
2462
|
const muted = volume === 0;
|
|
2342
2463
|
const toggle2 = () => {
|
|
2343
2464
|
const el = video.current;
|
|
@@ -2345,9 +2466,9 @@ var VideoPlayer = React36.forwardRef(
|
|
|
2345
2466
|
if (el.paused) void el.play();
|
|
2346
2467
|
else el.pause();
|
|
2347
2468
|
};
|
|
2348
|
-
return /* @__PURE__ */ (0,
|
|
2349
|
-
/* @__PURE__ */ (0,
|
|
2350
|
-
src && /* @__PURE__ */ (0,
|
|
2469
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { ref, className: cn("flex w-full flex-col overflow-hidden rounded-lg border border-border bg-surface", className), ...props, children: [
|
|
2470
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "relative flex h-60.5 w-full items-end bg-accent-soft", children: [
|
|
2471
|
+
src && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2351
2472
|
"video",
|
|
2352
2473
|
{
|
|
2353
2474
|
ref: video,
|
|
@@ -2360,8 +2481,8 @@ var VideoPlayer = React36.forwardRef(
|
|
|
2360
2481
|
onVolumeChange: (event) => setVolume(event.currentTarget.muted ? 0 : event.currentTarget.volume)
|
|
2361
2482
|
}
|
|
2362
2483
|
),
|
|
2363
|
-
/* @__PURE__ */ (0,
|
|
2364
|
-
/* @__PURE__ */ (0,
|
|
2484
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("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: [
|
|
2485
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
2365
2486
|
import_radix_ui20.Slider.Root,
|
|
2366
2487
|
{
|
|
2367
2488
|
min: 0,
|
|
@@ -2375,31 +2496,31 @@ var VideoPlayer = React36.forwardRef(
|
|
|
2375
2496
|
},
|
|
2376
2497
|
className: "relative flex h-4 w-full touch-none items-center select-none",
|
|
2377
2498
|
children: [
|
|
2378
|
-
/* @__PURE__ */ (0,
|
|
2379
|
-
/* @__PURE__ */ (0,
|
|
2499
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_radix_ui20.Slider.Track, { className: "relative h-1 w-full grow overflow-hidden rounded-xxs bg-surface/20", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_radix_ui20.Slider.Range, { className: "absolute h-full bg-accent-foreground" }) }),
|
|
2500
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_radix_ui20.Slider.Thumb, { "aria-label": "Seek", className: "block size-3 rounded-full border-2 border-surface bg-surface shadow-sm" })
|
|
2380
2501
|
]
|
|
2381
2502
|
}
|
|
2382
2503
|
),
|
|
2383
|
-
/* @__PURE__ */ (0,
|
|
2384
|
-
/* @__PURE__ */ (0,
|
|
2385
|
-
/* @__PURE__ */ (0,
|
|
2504
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
2505
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-4", children: [
|
|
2506
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2386
2507
|
"button",
|
|
2387
2508
|
{
|
|
2388
2509
|
type: "button",
|
|
2389
2510
|
"aria-label": playing ? "Pause" : "Play",
|
|
2390
2511
|
onClick: toggle2,
|
|
2391
2512
|
className: "inline-flex size-10 items-center justify-center rounded-full bg-surface/12 text-surface transition-colors hover:bg-surface/20",
|
|
2392
|
-
children: playing ? /* @__PURE__ */ (0,
|
|
2513
|
+
children: playing ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react18.Pause, { size: 16, weight: "fill", "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react18.Play, { size: 16, weight: "fill", "aria-hidden": true })
|
|
2393
2514
|
}
|
|
2394
2515
|
),
|
|
2395
|
-
/* @__PURE__ */ (0,
|
|
2516
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "text-ui-label whitespace-nowrap text-surface/80", children: [
|
|
2396
2517
|
formatTime(time),
|
|
2397
2518
|
" / ",
|
|
2398
2519
|
formatTime(duration)
|
|
2399
2520
|
] })
|
|
2400
2521
|
] }),
|
|
2401
|
-
/* @__PURE__ */ (0,
|
|
2402
|
-
/* @__PURE__ */ (0,
|
|
2522
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
2523
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2403
2524
|
VolumeControl,
|
|
2404
2525
|
{
|
|
2405
2526
|
volume,
|
|
@@ -2412,41 +2533,41 @@ var VideoPlayer = React36.forwardRef(
|
|
|
2412
2533
|
}
|
|
2413
2534
|
}
|
|
2414
2535
|
),
|
|
2415
|
-
/* @__PURE__ */ (0,
|
|
2536
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2416
2537
|
"button",
|
|
2417
2538
|
{
|
|
2418
2539
|
type: "button",
|
|
2419
2540
|
"aria-label": "Full screen",
|
|
2420
2541
|
onClick: () => void video.current?.requestFullscreen?.(),
|
|
2421
2542
|
className: "inline-flex size-10 items-center justify-center rounded-md text-surface transition-colors hover:bg-surface/12",
|
|
2422
|
-
children: /* @__PURE__ */ (0,
|
|
2543
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react18.CornersOut, { size: 16, "aria-hidden": true })
|
|
2423
2544
|
}
|
|
2424
2545
|
),
|
|
2425
|
-
/* @__PURE__ */ (0,
|
|
2546
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2426
2547
|
"button",
|
|
2427
2548
|
{
|
|
2428
2549
|
type: "button",
|
|
2429
2550
|
"aria-label": "More",
|
|
2430
2551
|
onClick: onMore,
|
|
2431
2552
|
className: "inline-flex size-10 items-center justify-center rounded-md text-surface transition-colors hover:bg-surface/12",
|
|
2432
|
-
children: /* @__PURE__ */ (0,
|
|
2553
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react18.DotsThree, { size: 16, "aria-hidden": true })
|
|
2433
2554
|
}
|
|
2434
2555
|
)
|
|
2435
2556
|
] })
|
|
2436
2557
|
] })
|
|
2437
2558
|
] })
|
|
2438
2559
|
] }),
|
|
2439
|
-
name && /* @__PURE__ */ (0,
|
|
2440
|
-
/* @__PURE__ */ (0,
|
|
2560
|
+
name && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MediaInfo, { name, details, onRemove }),
|
|
2561
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "sr-only", "aria-live": "polite", children: muted ? "Muted" : "" })
|
|
2441
2562
|
] });
|
|
2442
2563
|
}
|
|
2443
2564
|
);
|
|
2444
2565
|
VideoPlayer.displayName = "VideoPlayer";
|
|
2445
2566
|
function VolumeControl({ volume, onVolumeChange, className }) {
|
|
2446
|
-
const last =
|
|
2567
|
+
const last = React37.useRef(volume || 1);
|
|
2447
2568
|
if (volume > 0) last.current = volume;
|
|
2448
|
-
return /* @__PURE__ */ (0,
|
|
2449
|
-
/* @__PURE__ */ (0,
|
|
2569
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: cn("group/volume flex items-center", className), children: [
|
|
2570
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("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__ */ (0, import_jsx_runtime38.jsxs)(
|
|
2450
2571
|
import_radix_ui20.Slider.Root,
|
|
2451
2572
|
{
|
|
2452
2573
|
min: 0,
|
|
@@ -2456,32 +2577,32 @@ function VolumeControl({ volume, onVolumeChange, className }) {
|
|
|
2456
2577
|
onValueChange: ([next]) => next !== void 0 && onVolumeChange(next),
|
|
2457
2578
|
className: "relative flex h-4 w-14 touch-none items-center select-none",
|
|
2458
2579
|
children: [
|
|
2459
|
-
/* @__PURE__ */ (0,
|
|
2460
|
-
/* @__PURE__ */ (0,
|
|
2580
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_radix_ui20.Slider.Track, { className: "relative h-1 w-full grow overflow-hidden rounded-xxs bg-surface/20", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_radix_ui20.Slider.Range, { className: "absolute h-full bg-surface" }) }),
|
|
2581
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_radix_ui20.Slider.Thumb, { "aria-label": "Volume", className: "block size-3 rounded-full bg-surface shadow-sm" })
|
|
2461
2582
|
]
|
|
2462
2583
|
}
|
|
2463
2584
|
) }),
|
|
2464
|
-
/* @__PURE__ */ (0,
|
|
2585
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2465
2586
|
"button",
|
|
2466
2587
|
{
|
|
2467
2588
|
type: "button",
|
|
2468
2589
|
"aria-label": volume === 0 ? "Unmute" : "Mute",
|
|
2469
2590
|
onClick: () => onVolumeChange(volume === 0 ? last.current : 0),
|
|
2470
2591
|
className: "inline-flex size-10 items-center justify-center rounded-md text-surface transition-colors hover:bg-surface/12",
|
|
2471
|
-
children: volume === 0 ? /* @__PURE__ */ (0,
|
|
2592
|
+
children: volume === 0 ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react18.SpeakerSimpleX, { size: 16, "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react18.SpeakerSimpleHigh, { size: 16, "aria-hidden": true })
|
|
2472
2593
|
}
|
|
2473
2594
|
)
|
|
2474
2595
|
] });
|
|
2475
2596
|
}
|
|
2476
2597
|
|
|
2477
2598
|
// src/components/Question Types/OpenEndAnswer.tsx
|
|
2478
|
-
var
|
|
2479
|
-
var
|
|
2480
|
-
var OpenEndAnswer =
|
|
2599
|
+
var React38 = __toESM(require("react"), 1);
|
|
2600
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2601
|
+
var OpenEndAnswer = React38.forwardRef(
|
|
2481
2602
|
({ value, defaultValue, onChange, maxLength = 1e3, placeholder = "Write your answer", ...props }, ref) => {
|
|
2482
|
-
const [internal, setInternal] =
|
|
2603
|
+
const [internal, setInternal] = React38.useState(String(defaultValue ?? ""));
|
|
2483
2604
|
const text = value !== void 0 ? String(value) : internal;
|
|
2484
|
-
return /* @__PURE__ */ (0,
|
|
2605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2485
2606
|
Textarea,
|
|
2486
2607
|
{
|
|
2487
2608
|
ref,
|
|
@@ -2501,10 +2622,10 @@ var OpenEndAnswer = React37.forwardRef(
|
|
|
2501
2622
|
OpenEndAnswer.displayName = "OpenEndAnswer";
|
|
2502
2623
|
|
|
2503
2624
|
// src/components/Question Types/QuestionCard.tsx
|
|
2504
|
-
var
|
|
2505
|
-
var
|
|
2506
|
-
var QuestionCard =
|
|
2507
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2625
|
+
var React39 = __toESM(require("react"), 1);
|
|
2626
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2627
|
+
var QuestionCard = React39.forwardRef(
|
|
2628
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2508
2629
|
"div",
|
|
2509
2630
|
{
|
|
2510
2631
|
ref,
|
|
@@ -2516,23 +2637,25 @@ var QuestionCard = React38.forwardRef(
|
|
|
2516
2637
|
QuestionCard.displayName = "QuestionCard";
|
|
2517
2638
|
|
|
2518
2639
|
// src/components/Question Types/QuestionEditorCard.tsx
|
|
2519
|
-
var
|
|
2520
|
-
var
|
|
2640
|
+
var React41 = __toESM(require("react"), 1);
|
|
2641
|
+
var import_react20 = require("@phosphor-icons/react");
|
|
2521
2642
|
|
|
2522
2643
|
// src/components/Question Types/QuestionHeader.tsx
|
|
2523
|
-
var
|
|
2524
|
-
var
|
|
2525
|
-
var
|
|
2644
|
+
var React40 = __toESM(require("react"), 1);
|
|
2645
|
+
var import_react19 = require("@phosphor-icons/react");
|
|
2646
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2526
2647
|
var eyebrow = "text-ui-caption uppercase text-secondary-muted-foreground";
|
|
2527
|
-
var QuestionHeader =
|
|
2648
|
+
var QuestionHeader = React40.forwardRef(
|
|
2528
2649
|
({ className, number, title, required, error, onDismissError, editor, onTitleChange, actions, maxLength = 2e3, active, showCounter = true, ...props }, ref) => {
|
|
2650
|
+
const [draft, setDraft] = React40.useState(null);
|
|
2529
2651
|
const label = String(number).padStart(2, "0");
|
|
2530
2652
|
const showError = error !== void 0 && error !== false;
|
|
2531
2653
|
if (editor) {
|
|
2532
2654
|
const text = typeof title === "string" ? title : "";
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2655
|
+
const count = (draft ?? text).length;
|
|
2656
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { ref, className: cn("group/header flex w-full flex-col gap-2", className), ...props, children: [
|
|
2657
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
2658
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
2536
2659
|
"span",
|
|
2537
2660
|
{
|
|
2538
2661
|
className: cn(
|
|
@@ -2540,43 +2663,51 @@ var QuestionHeader = React39.forwardRef(
|
|
|
2540
2663
|
active ? "bg-accent-soft text-accent-soft-foreground" : "bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-surface-foreground"
|
|
2541
2664
|
),
|
|
2542
2665
|
children: [
|
|
2543
|
-
/* @__PURE__ */ (0,
|
|
2666
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react19.DotsSixVertical, { size: 16, "aria-hidden": true, className: "hidden shrink-0 group-hover/handle:block" }),
|
|
2544
2667
|
"Question ",
|
|
2545
2668
|
number
|
|
2546
2669
|
]
|
|
2547
2670
|
}
|
|
2548
2671
|
),
|
|
2549
|
-
actions && /* @__PURE__ */ (0,
|
|
2672
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "flex items-center gap-2 opacity-0 transition-opacity group-focus-within/header:opacity-100 group-hover/header:opacity-100", children: actions })
|
|
2550
2673
|
] }),
|
|
2551
|
-
/* @__PURE__ */ (0,
|
|
2552
|
-
|
|
2674
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2675
|
+
InlineEdit,
|
|
2553
2676
|
{
|
|
2554
|
-
|
|
2677
|
+
variant: "question",
|
|
2678
|
+
multiline: true,
|
|
2679
|
+
selected: active,
|
|
2680
|
+
className: "-mx-3 w-auto",
|
|
2555
2681
|
"aria-label": "Question title",
|
|
2682
|
+
placeholder: "Click to write the question text",
|
|
2556
2683
|
value: text,
|
|
2557
2684
|
maxLength,
|
|
2558
|
-
|
|
2559
|
-
|
|
2685
|
+
onValueChange: onTitleChange,
|
|
2686
|
+
onDraftChange: setDraft,
|
|
2687
|
+
onEditingChange: (editing) => {
|
|
2688
|
+
if (!editing) setDraft(null);
|
|
2689
|
+
},
|
|
2690
|
+
textClassName: "text-heading-h4"
|
|
2560
2691
|
}
|
|
2561
2692
|
),
|
|
2562
|
-
showCounter && /* @__PURE__ */ (0,
|
|
2563
|
-
|
|
2693
|
+
showCounter && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("p", { className: "text-ui-caption text-secondary-muted-foreground", children: [
|
|
2694
|
+
count,
|
|
2564
2695
|
"/",
|
|
2565
2696
|
maxLength,
|
|
2566
2697
|
" characters"
|
|
2567
2698
|
] })
|
|
2568
2699
|
] });
|
|
2569
2700
|
}
|
|
2570
|
-
return /* @__PURE__ */ (0,
|
|
2571
|
-
showError && /* @__PURE__ */ (0,
|
|
2572
|
-
/* @__PURE__ */ (0,
|
|
2701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { ref, className: cn("flex w-full flex-col gap-2", className), ...props, children: [
|
|
2702
|
+
showError && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ToastInline, { variant: "destructive", onClose: onDismissError, className: "min-h-10", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-ui-label text-destructive", children: error === true ? "This question is mandatory." : error }) }),
|
|
2703
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("p", { className: eyebrow, children: [
|
|
2573
2704
|
"Question ",
|
|
2574
2705
|
label
|
|
2575
2706
|
] }),
|
|
2576
|
-
/* @__PURE__ */ (0,
|
|
2707
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("h3", { className: "text-heading-h4 text-surface-foreground", children: [
|
|
2577
2708
|
title,
|
|
2578
|
-
required && /* @__PURE__ */ (0,
|
|
2579
|
-
required && /* @__PURE__ */ (0,
|
|
2709
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { "aria-hidden": "true", className: "text-destructive", children: "*" }),
|
|
2710
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "sr-only", children: " (required)" })
|
|
2580
2711
|
] })
|
|
2581
2712
|
] });
|
|
2582
2713
|
}
|
|
@@ -2584,8 +2715,8 @@ var QuestionHeader = React39.forwardRef(
|
|
|
2584
2715
|
QuestionHeader.displayName = "QuestionHeader";
|
|
2585
2716
|
|
|
2586
2717
|
// src/components/Question Types/QuestionEditorCard.tsx
|
|
2587
|
-
var
|
|
2588
|
-
var QuestionEditorCard =
|
|
2718
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2719
|
+
var QuestionEditorCard = React41.forwardRef(
|
|
2589
2720
|
({
|
|
2590
2721
|
className,
|
|
2591
2722
|
number,
|
|
@@ -2606,14 +2737,14 @@ var QuestionEditorCard = React40.forwardRef(
|
|
|
2606
2737
|
...props
|
|
2607
2738
|
}, ref) => {
|
|
2608
2739
|
const footer = active && (countLabel != null || onAdd || onPaste);
|
|
2609
|
-
return /* @__PURE__ */ (0,
|
|
2740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
2610
2741
|
"div",
|
|
2611
2742
|
{
|
|
2612
2743
|
ref,
|
|
2613
2744
|
className: cn("group/editor flex w-full items-start gap-2", className),
|
|
2614
2745
|
...props,
|
|
2615
2746
|
children: [
|
|
2616
|
-
/* @__PURE__ */ (0,
|
|
2747
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
2617
2748
|
"div",
|
|
2618
2749
|
{
|
|
2619
2750
|
className: cn(
|
|
@@ -2621,9 +2752,9 @@ var QuestionEditorCard = React40.forwardRef(
|
|
|
2621
2752
|
active ? "border-accent" : "border-border"
|
|
2622
2753
|
),
|
|
2623
2754
|
children: [
|
|
2624
|
-
/* @__PURE__ */ (0,
|
|
2625
|
-
/* @__PURE__ */ (0,
|
|
2626
|
-
/* @__PURE__ */ (0,
|
|
2755
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: cn("flex flex-col p-6", footer ? "gap-5" : "gap-4"), children: [
|
|
2756
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
2757
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2627
2758
|
QuestionHeader,
|
|
2628
2759
|
{
|
|
2629
2760
|
editor: true,
|
|
@@ -2633,8 +2764,8 @@ var QuestionEditorCard = React40.forwardRef(
|
|
|
2633
2764
|
active,
|
|
2634
2765
|
showCounter: !!active,
|
|
2635
2766
|
maxLength,
|
|
2636
|
-
actions: actions ?? /* @__PURE__ */ (0,
|
|
2637
|
-
/* @__PURE__ */ (0,
|
|
2767
|
+
actions: actions ?? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
|
|
2768
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2638
2769
|
Button,
|
|
2639
2770
|
{
|
|
2640
2771
|
type: "button",
|
|
@@ -2642,10 +2773,10 @@ var QuestionEditorCard = React40.forwardRef(
|
|
|
2642
2773
|
size: "icon-sm",
|
|
2643
2774
|
"aria-label": "Duplicate question",
|
|
2644
2775
|
onClick: onDuplicate,
|
|
2645
|
-
children: /* @__PURE__ */ (0,
|
|
2776
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react20.Copy, { size: 16, "aria-hidden": true })
|
|
2646
2777
|
}
|
|
2647
2778
|
),
|
|
2648
|
-
/* @__PURE__ */ (0,
|
|
2779
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2649
2780
|
Button,
|
|
2650
2781
|
{
|
|
2651
2782
|
type: "button",
|
|
@@ -2653,10 +2784,10 @@ var QuestionEditorCard = React40.forwardRef(
|
|
|
2653
2784
|
size: "icon-sm",
|
|
2654
2785
|
"aria-label": "Delete question",
|
|
2655
2786
|
onClick: onDelete,
|
|
2656
|
-
children: /* @__PURE__ */ (0,
|
|
2787
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react20.Trash, { size: 16, "aria-hidden": true })
|
|
2657
2788
|
}
|
|
2658
2789
|
),
|
|
2659
|
-
/* @__PURE__ */ (0,
|
|
2790
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2660
2791
|
Button,
|
|
2661
2792
|
{
|
|
2662
2793
|
type: "button",
|
|
@@ -2664,7 +2795,7 @@ var QuestionEditorCard = React40.forwardRef(
|
|
|
2664
2795
|
size: "icon-sm",
|
|
2665
2796
|
"aria-label": "Preview question",
|
|
2666
2797
|
onClick: onPreview,
|
|
2667
|
-
children: /* @__PURE__ */ (0,
|
|
2798
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react20.Eye, { size: 16, "aria-hidden": true })
|
|
2668
2799
|
}
|
|
2669
2800
|
)
|
|
2670
2801
|
] })
|
|
@@ -2672,10 +2803,10 @@ var QuestionEditorCard = React40.forwardRef(
|
|
|
2672
2803
|
),
|
|
2673
2804
|
children
|
|
2674
2805
|
] }),
|
|
2675
|
-
footer && /* @__PURE__ */ (0,
|
|
2676
|
-
/* @__PURE__ */ (0,
|
|
2677
|
-
/* @__PURE__ */ (0,
|
|
2678
|
-
onAdd && /* @__PURE__ */ (0,
|
|
2806
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
2807
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-ui-caption text-secondary-muted-foreground", children: countLabel }),
|
|
2808
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
2809
|
+
onAdd && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2679
2810
|
Button,
|
|
2680
2811
|
{
|
|
2681
2812
|
type: "button",
|
|
@@ -2683,10 +2814,10 @@ var QuestionEditorCard = React40.forwardRef(
|
|
|
2683
2814
|
size: "icon",
|
|
2684
2815
|
"aria-label": "Add choice",
|
|
2685
2816
|
onClick: onAdd,
|
|
2686
|
-
children: /* @__PURE__ */ (0,
|
|
2817
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react20.Plus, { size: 16, "aria-hidden": true })
|
|
2687
2818
|
}
|
|
2688
2819
|
),
|
|
2689
|
-
onPaste && /* @__PURE__ */ (0,
|
|
2820
|
+
onPaste && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2690
2821
|
Button,
|
|
2691
2822
|
{
|
|
2692
2823
|
type: "button",
|
|
@@ -2694,17 +2825,17 @@ var QuestionEditorCard = React40.forwardRef(
|
|
|
2694
2825
|
size: "icon",
|
|
2695
2826
|
"aria-label": "Paste choices",
|
|
2696
2827
|
onClick: onPaste,
|
|
2697
|
-
children: /* @__PURE__ */ (0,
|
|
2828
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react20.Clipboard, { size: 16, "aria-hidden": true })
|
|
2698
2829
|
}
|
|
2699
2830
|
)
|
|
2700
2831
|
] })
|
|
2701
2832
|
] })
|
|
2702
2833
|
] }),
|
|
2703
|
-
note && /* @__PURE__ */ (0,
|
|
2834
|
+
note && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "border-t border-border px-2 py-2 text-body-small text-surface-foreground", children: note })
|
|
2704
2835
|
]
|
|
2705
2836
|
}
|
|
2706
2837
|
),
|
|
2707
|
-
onAskAi && /* @__PURE__ */ (0,
|
|
2838
|
+
onAskAi && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2708
2839
|
Button,
|
|
2709
2840
|
{
|
|
2710
2841
|
type: "button",
|
|
@@ -2713,7 +2844,7 @@ var QuestionEditorCard = React40.forwardRef(
|
|
|
2713
2844
|
"aria-label": "Ask AI",
|
|
2714
2845
|
onClick: onAskAi,
|
|
2715
2846
|
className: "shrink-0 opacity-0 transition-opacity group-hover/editor:opacity-100 group-focus-within/editor:opacity-100 focus-visible:opacity-100",
|
|
2716
|
-
children: /* @__PURE__ */ (0,
|
|
2847
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react20.Sparkle, { size: 16, "aria-hidden": true })
|
|
2717
2848
|
}
|
|
2718
2849
|
)
|
|
2719
2850
|
]
|
|
@@ -2724,33 +2855,33 @@ var QuestionEditorCard = React40.forwardRef(
|
|
|
2724
2855
|
QuestionEditorCard.displayName = "QuestionEditorCard";
|
|
2725
2856
|
|
|
2726
2857
|
// src/components/Question Types/QuestionNavItem.tsx
|
|
2727
|
-
var
|
|
2728
|
-
var
|
|
2858
|
+
var React43 = __toESM(require("react"), 1);
|
|
2859
|
+
var import_react22 = require("@phosphor-icons/react");
|
|
2729
2860
|
var import_radix_ui21 = require("radix-ui");
|
|
2730
2861
|
|
|
2731
2862
|
// src/components/Question Types/QuestionTypeIcon.tsx
|
|
2732
|
-
var
|
|
2733
|
-
var
|
|
2734
|
-
var
|
|
2863
|
+
var React42 = require("react");
|
|
2864
|
+
var import_react21 = require("@phosphor-icons/react");
|
|
2865
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2735
2866
|
var icons = {
|
|
2736
|
-
"select-one":
|
|
2737
|
-
"select-multiple":
|
|
2738
|
-
ranking:
|
|
2739
|
-
upload:
|
|
2740
|
-
rating:
|
|
2741
|
-
"open-end":
|
|
2867
|
+
"select-one": import_react21.RadioButton,
|
|
2868
|
+
"select-multiple": import_react21.CheckSquare,
|
|
2869
|
+
ranking: import_react21.ListNumbers,
|
|
2870
|
+
upload: import_react21.FileArrowUp,
|
|
2871
|
+
rating: import_react21.StarHalf,
|
|
2872
|
+
"open-end": import_react21.ChatsCircle
|
|
2742
2873
|
};
|
|
2743
2874
|
function QuestionTypeIcon({ type, size = 22.5, className, ...props }) {
|
|
2744
2875
|
const Icon = icons[type];
|
|
2745
|
-
return /* @__PURE__ */ (0,
|
|
2876
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Icon, { size, weight: "duotone", "aria-hidden": true, className: className ?? "text-accent-foreground", ...props });
|
|
2746
2877
|
}
|
|
2747
2878
|
|
|
2748
2879
|
// src/components/Question Types/QuestionNavItem.tsx
|
|
2749
|
-
var
|
|
2750
|
-
var QuestionNavItem =
|
|
2880
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
2881
|
+
var QuestionNavItem = React43.forwardRef(
|
|
2751
2882
|
({ className, questionType = "select-one", selected, error, asChild, children, ...props }, ref) => {
|
|
2752
2883
|
const Comp = asChild ? import_radix_ui21.Slot.Root : "button";
|
|
2753
|
-
return /* @__PURE__ */ (0,
|
|
2884
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
2754
2885
|
Comp,
|
|
2755
2886
|
{
|
|
2756
2887
|
ref,
|
|
@@ -2766,12 +2897,12 @@ var QuestionNavItem = React42.forwardRef(
|
|
|
2766
2897
|
),
|
|
2767
2898
|
...props,
|
|
2768
2899
|
children: [
|
|
2769
|
-
/* @__PURE__ */ (0,
|
|
2770
|
-
/* @__PURE__ */ (0,
|
|
2771
|
-
/* @__PURE__ */ (0,
|
|
2900
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { "aria-hidden": "true", className: "relative flex size-4 shrink-0 items-center justify-center", children: [
|
|
2901
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react22.DotsSixVertical, { size: 16, className: "hidden group-hover/nav:block" }),
|
|
2902
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "group-hover/nav:hidden", children: error ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react22.Warning, { size: 16, className: "text-destructive" }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(QuestionTypeIcon, { type: questionType, size: 16 }) })
|
|
2772
2903
|
] }),
|
|
2773
|
-
/* @__PURE__ */ (0,
|
|
2774
|
-
error && /* @__PURE__ */ (0,
|
|
2904
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "min-w-0 flex-1 truncate", children }),
|
|
2905
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "sr-only", children: ", has errors" })
|
|
2775
2906
|
]
|
|
2776
2907
|
}
|
|
2777
2908
|
);
|
|
@@ -2780,14 +2911,14 @@ var QuestionNavItem = React42.forwardRef(
|
|
|
2780
2911
|
QuestionNavItem.displayName = "QuestionNavItem";
|
|
2781
2912
|
|
|
2782
2913
|
// src/components/Question Types/QuestionOption.tsx
|
|
2783
|
-
var
|
|
2784
|
-
var
|
|
2785
|
-
var
|
|
2914
|
+
var React44 = __toESM(require("react"), 1);
|
|
2915
|
+
var import_react23 = require("@phosphor-icons/react");
|
|
2916
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
2786
2917
|
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:border-input hover:bg-accent-soft hover:shadow-md has-[[data-state=checked]]:border-accent-foreground has-[[data-state=checked]]:hover:border-accent-foreground has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-50";
|
|
2787
2918
|
function QuestionOption(props) {
|
|
2788
|
-
const id =
|
|
2789
|
-
return /* @__PURE__ */ (0,
|
|
2790
|
-
props.kind === "checkbox" ? /* @__PURE__ */ (0,
|
|
2919
|
+
const id = React44.useId();
|
|
2920
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { htmlFor: id, className: cn(optionClasses, props.className), children: [
|
|
2921
|
+
props.kind === "checkbox" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
2791
2922
|
Checkbox,
|
|
2792
2923
|
{
|
|
2793
2924
|
id,
|
|
@@ -2796,16 +2927,16 @@ function QuestionOption(props) {
|
|
|
2796
2927
|
onCheckedChange: (next) => props.onCheckedChange?.(next === true),
|
|
2797
2928
|
disabled: props.disabled
|
|
2798
2929
|
}
|
|
2799
|
-
) : /* @__PURE__ */ (0,
|
|
2800
|
-
/* @__PURE__ */ (0,
|
|
2930
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(RadioGroupItem, { id, value: props.value, disabled: props.disabled }),
|
|
2931
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "min-w-0 flex-1", children: props.label })
|
|
2801
2932
|
] });
|
|
2802
2933
|
}
|
|
2803
|
-
var QuestionOtherOption =
|
|
2934
|
+
var QuestionOtherOption = React44.forwardRef(
|
|
2804
2935
|
({ className, onSubmit, confirmLabel = "Confirm answer", placeholder = "Type your answer", ...props }, ref) => {
|
|
2805
|
-
const inner =
|
|
2806
|
-
|
|
2936
|
+
const inner = React44.useRef(null);
|
|
2937
|
+
React44.useImperativeHandle(ref, () => inner.current);
|
|
2807
2938
|
const submit = () => onSubmit?.(inner.current?.value ?? "");
|
|
2808
|
-
return /* @__PURE__ */ (0,
|
|
2939
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
2809
2940
|
"div",
|
|
2810
2941
|
{
|
|
2811
2942
|
className: cn(
|
|
@@ -2813,7 +2944,7 @@ var QuestionOtherOption = React43.forwardRef(
|
|
|
2813
2944
|
className
|
|
2814
2945
|
),
|
|
2815
2946
|
children: [
|
|
2816
|
-
/* @__PURE__ */ (0,
|
|
2947
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
2817
2948
|
"input",
|
|
2818
2949
|
{
|
|
2819
2950
|
ref: inner,
|
|
@@ -2829,7 +2960,7 @@ var QuestionOtherOption = React43.forwardRef(
|
|
|
2829
2960
|
...props
|
|
2830
2961
|
}
|
|
2831
2962
|
),
|
|
2832
|
-
/* @__PURE__ */ (0,
|
|
2963
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Button, { type: "button", variant: "subtle", size: "icon-sm", "aria-label": confirmLabel, onClick: submit, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.Check, { size: 16, "aria-hidden": true }) })
|
|
2833
2964
|
]
|
|
2834
2965
|
}
|
|
2835
2966
|
);
|
|
@@ -2837,10 +2968,10 @@ var QuestionOtherOption = React43.forwardRef(
|
|
|
2837
2968
|
);
|
|
2838
2969
|
QuestionOtherOption.displayName = "QuestionOtherOption";
|
|
2839
2970
|
function QuestionOptionEditor({ label, onLabelChange, onRemove, onAdd, className }) {
|
|
2840
|
-
return /* @__PURE__ */ (0,
|
|
2841
|
-
/* @__PURE__ */ (0,
|
|
2842
|
-
/* @__PURE__ */ (0,
|
|
2843
|
-
/* @__PURE__ */ (0,
|
|
2971
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: cn("flex w-full items-center gap-2", className), children: [
|
|
2972
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex h-11.5 min-w-0 flex-1 items-center gap-2 rounded-md border border-border bg-surface px-4 py-2 focus-within:border-input-accent hover:border-input hover:shadow-md", children: [
|
|
2973
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.DotsSixVertical, { size: 20, "aria-hidden": true, className: "shrink-0 text-surface-foreground" }),
|
|
2974
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
2844
2975
|
"input",
|
|
2845
2976
|
{
|
|
2846
2977
|
"aria-label": "Option label",
|
|
@@ -2850,15 +2981,15 @@ function QuestionOptionEditor({ label, onLabelChange, onRemove, onAdd, className
|
|
|
2850
2981
|
}
|
|
2851
2982
|
)
|
|
2852
2983
|
] }),
|
|
2853
|
-
/* @__PURE__ */ (0,
|
|
2854
|
-
/* @__PURE__ */ (0,
|
|
2984
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Button, { type: "button", variant: "destructive", size: "icon-sm", "aria-label": "Remove option", onClick: onRemove, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.Trash, { size: 16, "aria-hidden": true }) }),
|
|
2985
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": "Add option", onClick: onAdd, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.Plus, { size: 16, "aria-hidden": true }) })
|
|
2855
2986
|
] });
|
|
2856
2987
|
}
|
|
2857
2988
|
|
|
2858
2989
|
// src/components/Question Types/RankList.tsx
|
|
2859
|
-
var
|
|
2860
|
-
var
|
|
2861
|
-
var
|
|
2990
|
+
var React45 = __toESM(require("react"), 1);
|
|
2991
|
+
var import_react24 = require("@phosphor-icons/react");
|
|
2992
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
2862
2993
|
function move(list, from, to) {
|
|
2863
2994
|
if (from === to || to < 0 || to >= list.length) return list;
|
|
2864
2995
|
const next = list.slice();
|
|
@@ -2866,13 +2997,13 @@ function move(list, from, to) {
|
|
|
2866
2997
|
next.splice(to, 0, item);
|
|
2867
2998
|
return next;
|
|
2868
2999
|
}
|
|
2869
|
-
var RankList =
|
|
3000
|
+
var RankList = React45.forwardRef(
|
|
2870
3001
|
({ className, items, onItemsChange, ...props }, ref) => {
|
|
2871
|
-
const [dragIndex, setDragIndex] =
|
|
2872
|
-
const [announcement, setAnnouncement] =
|
|
2873
|
-
const handles =
|
|
2874
|
-
const refocus =
|
|
2875
|
-
|
|
3002
|
+
const [dragIndex, setDragIndex] = React45.useState(null);
|
|
3003
|
+
const [announcement, setAnnouncement] = React45.useState("");
|
|
3004
|
+
const handles = React45.useRef(/* @__PURE__ */ new Map());
|
|
3005
|
+
const refocus = React45.useRef(null);
|
|
3006
|
+
React45.useEffect(() => {
|
|
2876
3007
|
if (refocus.current) {
|
|
2877
3008
|
handles.current.get(refocus.current)?.focus();
|
|
2878
3009
|
refocus.current = null;
|
|
@@ -2885,8 +3016,8 @@ var RankList = React44.forwardRef(
|
|
|
2885
3016
|
setAnnouncement(`Moved to position ${to + 1} of ${items.length}`);
|
|
2886
3017
|
onItemsChange(next);
|
|
2887
3018
|
};
|
|
2888
|
-
return /* @__PURE__ */ (0,
|
|
2889
|
-
/* @__PURE__ */ (0,
|
|
3019
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
3020
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("ol", { ref, className: cn("flex w-full max-w-150 flex-col gap-4", className), ...props, children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
2890
3021
|
"li",
|
|
2891
3022
|
{
|
|
2892
3023
|
draggable: true,
|
|
@@ -2903,7 +3034,7 @@ var RankList = React44.forwardRef(
|
|
|
2903
3034
|
dragIndex === index && "opacity-50"
|
|
2904
3035
|
),
|
|
2905
3036
|
children: [
|
|
2906
|
-
/* @__PURE__ */ (0,
|
|
3037
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
2907
3038
|
"button",
|
|
2908
3039
|
{
|
|
2909
3040
|
type: "button",
|
|
@@ -2922,10 +3053,10 @@ var RankList = React44.forwardRef(
|
|
|
2922
3053
|
}
|
|
2923
3054
|
},
|
|
2924
3055
|
className: "inline-flex shrink-0 cursor-grab rounded-xs text-surface-foreground",
|
|
2925
|
-
children: /* @__PURE__ */ (0,
|
|
3056
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react24.DotsSixVertical, { size: 16, "aria-hidden": true })
|
|
2926
3057
|
}
|
|
2927
3058
|
),
|
|
2928
|
-
/* @__PURE__ */ (0,
|
|
3059
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
2929
3060
|
"span",
|
|
2930
3061
|
{
|
|
2931
3062
|
"aria-hidden": "true",
|
|
@@ -2933,27 +3064,27 @@ var RankList = React44.forwardRef(
|
|
|
2933
3064
|
children: index + 1
|
|
2934
3065
|
}
|
|
2935
3066
|
),
|
|
2936
|
-
/* @__PURE__ */ (0,
|
|
3067
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "min-w-0 flex-1", children: item.label })
|
|
2937
3068
|
]
|
|
2938
3069
|
},
|
|
2939
3070
|
item.id
|
|
2940
3071
|
)) }),
|
|
2941
|
-
/* @__PURE__ */ (0,
|
|
3072
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { role: "status", "aria-live": "polite", className: "sr-only", children: announcement })
|
|
2942
3073
|
] });
|
|
2943
3074
|
}
|
|
2944
3075
|
);
|
|
2945
3076
|
RankList.displayName = "RankList";
|
|
2946
3077
|
|
|
2947
3078
|
// src/components/Question Types/RatingScale.tsx
|
|
2948
|
-
var
|
|
3079
|
+
var React46 = __toESM(require("react"), 1);
|
|
2949
3080
|
var import_radix_ui22 = require("radix-ui");
|
|
2950
|
-
var
|
|
2951
|
-
var RatingScale =
|
|
3081
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
3082
|
+
var RatingScale = React46.forwardRef(
|
|
2952
3083
|
({ className, max = 5, value, defaultValue, onValueChange, lowLabel, highLabel, ...props }, ref) => {
|
|
2953
|
-
const [internal, setInternal] =
|
|
3084
|
+
const [internal, setInternal] = React46.useState(defaultValue);
|
|
2954
3085
|
const current = value !== void 0 ? value : internal;
|
|
2955
|
-
return /* @__PURE__ */ (0,
|
|
2956
|
-
/* @__PURE__ */ (0,
|
|
3086
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: cn("flex w-full max-w-150 flex-col gap-2", className), children: [
|
|
3087
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
2957
3088
|
import_radix_ui22.ToggleGroup.Root,
|
|
2958
3089
|
{
|
|
2959
3090
|
ref,
|
|
@@ -2966,7 +3097,7 @@ var RatingScale = React45.forwardRef(
|
|
|
2966
3097
|
},
|
|
2967
3098
|
className: "flex gap-2",
|
|
2968
3099
|
...props,
|
|
2969
|
-
children: Array.from({ length: max }, (_, i) => i + 1).map((n) => /* @__PURE__ */ (0,
|
|
3100
|
+
children: Array.from({ length: max }, (_, i) => i + 1).map((n) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
2970
3101
|
import_radix_ui22.ToggleGroup.Item,
|
|
2971
3102
|
{
|
|
2972
3103
|
value: String(n),
|
|
@@ -2982,9 +3113,9 @@ var RatingScale = React45.forwardRef(
|
|
|
2982
3113
|
))
|
|
2983
3114
|
}
|
|
2984
3115
|
),
|
|
2985
|
-
(lowLabel != null || highLabel != null) && /* @__PURE__ */ (0,
|
|
2986
|
-
/* @__PURE__ */ (0,
|
|
2987
|
-
/* @__PURE__ */ (0,
|
|
3116
|
+
(lowLabel != null || highLabel != null) && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex justify-between text-ui-caption text-secondary-muted-foreground", "aria-hidden": "true", children: [
|
|
3117
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { children: lowLabel }),
|
|
3118
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { children: highLabel })
|
|
2988
3119
|
] })
|
|
2989
3120
|
] });
|
|
2990
3121
|
}
|
|
@@ -2992,27 +3123,27 @@ var RatingScale = React45.forwardRef(
|
|
|
2992
3123
|
RatingScale.displayName = "RatingScale";
|
|
2993
3124
|
|
|
2994
3125
|
// src/components/Data Display/Progress.tsx
|
|
2995
|
-
var
|
|
3126
|
+
var React47 = __toESM(require("react"), 1);
|
|
2996
3127
|
var import_radix_ui23 = require("radix-ui");
|
|
2997
|
-
var
|
|
2998
|
-
var Progress =
|
|
3128
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3129
|
+
var Progress = React47.forwardRef(
|
|
2999
3130
|
({ className, value = 0, label, valueLabel, detailsStart, detailsEnd, ...props }, ref) => {
|
|
3000
3131
|
const hasHeader = label != null || valueLabel != null;
|
|
3001
3132
|
const hasDetails = detailsStart != null || detailsEnd != null;
|
|
3002
3133
|
const clamped = Math.min(100, Math.max(0, value ?? 0));
|
|
3003
|
-
return /* @__PURE__ */ (0,
|
|
3004
|
-
hasHeader && /* @__PURE__ */ (0,
|
|
3005
|
-
/* @__PURE__ */ (0,
|
|
3006
|
-
/* @__PURE__ */ (0,
|
|
3134
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: cn("flex w-full flex-col gap-2", className), children: [
|
|
3135
|
+
hasHeader && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-center justify-between text-ui-label text-surface-foreground", children: [
|
|
3136
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { children: label }),
|
|
3137
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { children: valueLabel === true ? `${Math.round(clamped)}%` : valueLabel })
|
|
3007
3138
|
] }),
|
|
3008
|
-
/* @__PURE__ */ (0,
|
|
3139
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3009
3140
|
import_radix_ui23.Progress.Root,
|
|
3010
3141
|
{
|
|
3011
3142
|
ref,
|
|
3012
3143
|
value: clamped,
|
|
3013
3144
|
className: "relative h-2 w-full overflow-hidden rounded-full bg-secondary",
|
|
3014
3145
|
...props,
|
|
3015
|
-
children: /* @__PURE__ */ (0,
|
|
3146
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3016
3147
|
import_radix_ui23.Progress.Indicator,
|
|
3017
3148
|
{
|
|
3018
3149
|
className: "h-full rounded-full bg-accent transition-[width]",
|
|
@@ -3021,9 +3152,9 @@ var Progress = React46.forwardRef(
|
|
|
3021
3152
|
)
|
|
3022
3153
|
}
|
|
3023
3154
|
),
|
|
3024
|
-
hasDetails && /* @__PURE__ */ (0,
|
|
3025
|
-
/* @__PURE__ */ (0,
|
|
3026
|
-
/* @__PURE__ */ (0,
|
|
3155
|
+
hasDetails && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-start justify-between text-ui-label leading-5 text-secondary-muted-foreground", children: [
|
|
3156
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { children: detailsStart }),
|
|
3157
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { children: detailsEnd })
|
|
3027
3158
|
] })
|
|
3028
3159
|
] });
|
|
3029
3160
|
}
|
|
@@ -3031,11 +3162,11 @@ var Progress = React46.forwardRef(
|
|
|
3031
3162
|
Progress.displayName = "Progress";
|
|
3032
3163
|
|
|
3033
3164
|
// src/components/Data Display/Table.tsx
|
|
3034
|
-
var
|
|
3035
|
-
var
|
|
3036
|
-
var
|
|
3037
|
-
var Table =
|
|
3038
|
-
({ className, containerClassName, striped, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3165
|
+
var React48 = __toESM(require("react"), 1);
|
|
3166
|
+
var import_react25 = require("@phosphor-icons/react");
|
|
3167
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3168
|
+
var Table = React48.forwardRef(
|
|
3169
|
+
({ className, containerClassName, striped, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: cn("relative w-full overflow-auto rounded-lg border border-border bg-surface", containerClassName), children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3039
3170
|
"table",
|
|
3040
3171
|
{
|
|
3041
3172
|
ref,
|
|
@@ -3046,16 +3177,16 @@ var Table = React47.forwardRef(
|
|
|
3046
3177
|
) })
|
|
3047
3178
|
);
|
|
3048
3179
|
Table.displayName = "Table";
|
|
3049
|
-
var TableHeader =
|
|
3050
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3180
|
+
var TableHeader = React48.forwardRef(
|
|
3181
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("thead", { ref, className, ...props })
|
|
3051
3182
|
);
|
|
3052
3183
|
TableHeader.displayName = "TableHeader";
|
|
3053
|
-
var TableBody =
|
|
3054
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3184
|
+
var TableBody = React48.forwardRef(
|
|
3185
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("tbody", { ref, className, ...props })
|
|
3055
3186
|
);
|
|
3056
3187
|
TableBody.displayName = "TableBody";
|
|
3057
|
-
var TableRow =
|
|
3058
|
-
({ className, selected, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3188
|
+
var TableRow = React48.forwardRef(
|
|
3189
|
+
({ className, selected, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3059
3190
|
"tr",
|
|
3060
3191
|
{
|
|
3061
3192
|
ref,
|
|
@@ -3072,10 +3203,10 @@ var TableRow = React47.forwardRef(
|
|
|
3072
3203
|
);
|
|
3073
3204
|
TableRow.displayName = "TableRow";
|
|
3074
3205
|
var ariaSort = { none: "none", asc: "ascending", desc: "descending" };
|
|
3075
|
-
var TableHead =
|
|
3206
|
+
var TableHead = React48.forwardRef(
|
|
3076
3207
|
({ className, align = "left", sortable, sort = "none", onSort, checkbox, children, ...props }, ref) => {
|
|
3077
|
-
const caret = sort === "asc" ? /* @__PURE__ */ (0,
|
|
3078
|
-
return /* @__PURE__ */ (0,
|
|
3208
|
+
const caret = sort === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_react25.CaretUp, { size: 16, "aria-hidden": true, className: "shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_react25.CaretDown, { size: 16, "aria-hidden": true, className: "shrink-0" });
|
|
3209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3079
3210
|
"th",
|
|
3080
3211
|
{
|
|
3081
3212
|
ref,
|
|
@@ -3088,7 +3219,7 @@ var TableHead = React47.forwardRef(
|
|
|
3088
3219
|
className
|
|
3089
3220
|
),
|
|
3090
3221
|
...props,
|
|
3091
|
-
children: sortable ? /* @__PURE__ */ (0,
|
|
3222
|
+
children: sortable ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
3092
3223
|
"button",
|
|
3093
3224
|
{
|
|
3094
3225
|
type: "button",
|
|
@@ -3099,14 +3230,14 @@ var TableHead = React47.forwardRef(
|
|
|
3099
3230
|
caret
|
|
3100
3231
|
]
|
|
3101
3232
|
}
|
|
3102
|
-
) : checkbox ? /* @__PURE__ */ (0,
|
|
3233
|
+
) : checkbox ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "flex items-center justify-center", children }) : children
|
|
3103
3234
|
}
|
|
3104
3235
|
);
|
|
3105
3236
|
}
|
|
3106
3237
|
);
|
|
3107
3238
|
TableHead.displayName = "TableHead";
|
|
3108
|
-
var TableCell =
|
|
3109
|
-
({ className, align = "left", muted, checkbox, actions, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3239
|
+
var TableCell = React48.forwardRef(
|
|
3240
|
+
({ className, align = "left", muted, checkbox, actions, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3110
3241
|
"td",
|
|
3111
3242
|
{
|
|
3112
3243
|
ref,
|
|
@@ -3119,25 +3250,25 @@ var TableCell = React47.forwardRef(
|
|
|
3119
3250
|
className
|
|
3120
3251
|
),
|
|
3121
3252
|
...props,
|
|
3122
|
-
children: checkbox ? /* @__PURE__ */ (0,
|
|
3253
|
+
children: checkbox ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "flex items-center justify-center", children }) : actions ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "flex items-start justify-end gap-1", children }) : children
|
|
3123
3254
|
}
|
|
3124
3255
|
)
|
|
3125
3256
|
);
|
|
3126
3257
|
TableCell.displayName = "TableCell";
|
|
3127
3258
|
function TableCellTwoLines({ primary, secondary, avatar, className, ...props }) {
|
|
3128
|
-
return /* @__PURE__ */ (0,
|
|
3259
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: cn("flex items-center gap-2", className), ...props, children: [
|
|
3129
3260
|
avatar,
|
|
3130
|
-
/* @__PURE__ */ (0,
|
|
3131
|
-
/* @__PURE__ */ (0,
|
|
3132
|
-
secondary && /* @__PURE__ */ (0,
|
|
3261
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-col gap-0.5 whitespace-nowrap", children: [
|
|
3262
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "text-ui-label text-surface-foreground", children: primary }),
|
|
3263
|
+
secondary && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "text-ui-caption text-secondary-muted-foreground", children: secondary })
|
|
3133
3264
|
] })
|
|
3134
3265
|
] });
|
|
3135
3266
|
}
|
|
3136
3267
|
|
|
3137
3268
|
// src/components/Data Display/StatCard.tsx
|
|
3138
|
-
var
|
|
3269
|
+
var React49 = __toESM(require("react"), 1);
|
|
3139
3270
|
var import_class_variance_authority6 = require("class-variance-authority");
|
|
3140
|
-
var
|
|
3271
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3141
3272
|
var statCardVariants = (0, import_class_variance_authority6.cva)("flex min-w-0 flex-col gap-2 rounded-md border p-3", {
|
|
3142
3273
|
variants: {
|
|
3143
3274
|
variant: {
|
|
@@ -3147,11 +3278,11 @@ var statCardVariants = (0, import_class_variance_authority6.cva)("flex min-w-0 f
|
|
|
3147
3278
|
},
|
|
3148
3279
|
defaultVariants: { variant: "default" }
|
|
3149
3280
|
});
|
|
3150
|
-
var StatCard =
|
|
3151
|
-
({ className, variant, label, value, icon, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3152
|
-
/* @__PURE__ */ (0,
|
|
3153
|
-
/* @__PURE__ */ (0,
|
|
3154
|
-
icon && /* @__PURE__ */ (0,
|
|
3281
|
+
var StatCard = React49.forwardRef(
|
|
3282
|
+
({ className, variant, label, value, icon, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { ref, className: cn(statCardVariants({ variant }), className), ...props, children: [
|
|
3283
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { className: "truncate text-ui-caption text-secondary-muted-foreground", children: label }),
|
|
3284
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("p", { className: "flex items-center gap-2 text-body-base text-surface-foreground", children: [
|
|
3285
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { "aria-hidden": "true", className: "inline-flex size-6 shrink-0 items-center justify-center", children: icon }),
|
|
3155
3286
|
value
|
|
3156
3287
|
] })
|
|
3157
3288
|
] })
|
|
@@ -3159,13 +3290,13 @@ var StatCard = React48.forwardRef(
|
|
|
3159
3290
|
StatCard.displayName = "StatCard";
|
|
3160
3291
|
|
|
3161
3292
|
// src/components/Research-Specific/ActivityStructure.tsx
|
|
3162
|
-
var
|
|
3293
|
+
var React51 = __toESM(require("react"), 1);
|
|
3163
3294
|
|
|
3164
3295
|
// src/components/Tags & Badges/EditableTag.tsx
|
|
3165
|
-
var
|
|
3166
|
-
var
|
|
3296
|
+
var React50 = __toESM(require("react"), 1);
|
|
3297
|
+
var import_react26 = require("@phosphor-icons/react");
|
|
3167
3298
|
var import_class_variance_authority7 = require("class-variance-authority");
|
|
3168
|
-
var
|
|
3299
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
3169
3300
|
var editableTagVariants = (0, import_class_variance_authority7.cva)(
|
|
3170
3301
|
"inline-flex h-6.5 items-center whitespace-nowrap rounded-sm py-1 text-ui-caption transition-colors",
|
|
3171
3302
|
{
|
|
@@ -3180,27 +3311,27 @@ var editableTagVariants = (0, import_class_variance_authority7.cva)(
|
|
|
3180
3311
|
defaultVariants: { type: "default" }
|
|
3181
3312
|
}
|
|
3182
3313
|
);
|
|
3183
|
-
var EditableTag =
|
|
3314
|
+
var EditableTag = React50.forwardRef(
|
|
3184
3315
|
({ className, type = "default", icon, onRemove, onClick, children, ...props }, ref) => {
|
|
3185
3316
|
const classes = cn(editableTagVariants({ type }), className);
|
|
3186
|
-
const leading = type === "add" ? /* @__PURE__ */ (0,
|
|
3317
|
+
const leading = type === "add" ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react26.Plus, { size: 12, "aria-hidden": true }) : icon !== void 0 ? icon : type === "default" ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react26.Crown, { size: 12, weight: "fill", "aria-hidden": true }) : null;
|
|
3187
3318
|
if (type === "add" || type === "multiple" && onClick) {
|
|
3188
|
-
return /* @__PURE__ */ (0,
|
|
3319
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("button", { ref, type: "button", className: classes, onClick, ...props, children: [
|
|
3189
3320
|
leading,
|
|
3190
3321
|
children
|
|
3191
3322
|
] });
|
|
3192
3323
|
}
|
|
3193
|
-
return /* @__PURE__ */ (0,
|
|
3324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("span", { ref, className: classes, ...props, children: [
|
|
3194
3325
|
leading,
|
|
3195
3326
|
children,
|
|
3196
|
-
onRemove && /* @__PURE__ */ (0,
|
|
3327
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3197
3328
|
"button",
|
|
3198
3329
|
{
|
|
3199
3330
|
type: "button",
|
|
3200
3331
|
"aria-label": typeof children === "string" ? `Remove ${children}` : "Remove",
|
|
3201
3332
|
onClick: onRemove,
|
|
3202
3333
|
className: "inline-flex size-3 items-center justify-center rounded-xs",
|
|
3203
|
-
children: /* @__PURE__ */ (0,
|
|
3334
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react26.X, { size: 12, "aria-hidden": true })
|
|
3204
3335
|
}
|
|
3205
3336
|
)
|
|
3206
3337
|
] });
|
|
@@ -3209,23 +3340,23 @@ var EditableTag = React49.forwardRef(
|
|
|
3209
3340
|
EditableTag.displayName = "EditableTag";
|
|
3210
3341
|
|
|
3211
3342
|
// src/components/Research-Specific/ActivityStructure.tsx
|
|
3212
|
-
var
|
|
3213
|
-
var ActivityStructure =
|
|
3214
|
-
({ className, title = "Activity Structure", stats, sections, onRemoveTag, onAddTag, addTagLabel = "Add tag", ...props }, ref) => /* @__PURE__ */ (0,
|
|
3343
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3344
|
+
var ActivityStructure = React51.forwardRef(
|
|
3345
|
+
({ className, title = "Activity Structure", stats, sections, onRemoveTag, onAddTag, addTagLabel = "Add tag", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
3215
3346
|
"section",
|
|
3216
3347
|
{
|
|
3217
3348
|
ref,
|
|
3218
3349
|
className: cn("flex w-full max-w-96.5 flex-col gap-4 rounded-2xl border border-border bg-surface p-4", className),
|
|
3219
3350
|
...props,
|
|
3220
3351
|
children: [
|
|
3221
|
-
/* @__PURE__ */ (0,
|
|
3222
|
-
/* @__PURE__ */ (0,
|
|
3223
|
-
sections?.map(({ id, heading, body, tags }) => /* @__PURE__ */ (0,
|
|
3224
|
-
/* @__PURE__ */ (0,
|
|
3225
|
-
/* @__PURE__ */ (0,
|
|
3226
|
-
(tags?.length || onAddTag) && /* @__PURE__ */ (0,
|
|
3227
|
-
tags?.map((tag) => /* @__PURE__ */ (0,
|
|
3228
|
-
onAddTag && /* @__PURE__ */ (0,
|
|
3352
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("h3", { className: "text-heading-h3 text-surface-foreground", children: title }),
|
|
3353
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "grid grid-cols-2 gap-3", children: stats.map(({ id, ...stat }) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(StatCard, { ...stat }, id)) }),
|
|
3354
|
+
sections?.map(({ id, heading, body, tags }) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
3355
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("h4", { className: "text-heading-h4 text-surface-foreground", children: heading }),
|
|
3356
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "text-body-base text-surface-foreground", children: body }),
|
|
3357
|
+
(tags?.length || onAddTag) && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
3358
|
+
tags?.map((tag) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(EditableTag, { type: "editable", onRemove: onRemoveTag && (() => onRemoveTag(id, tag)), children: tag }, tag)),
|
|
3359
|
+
onAddTag && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(EditableTag, { type: "add", onClick: () => onAddTag(id), children: addTagLabel })
|
|
3229
3360
|
] })
|
|
3230
3361
|
] }, id))
|
|
3231
3362
|
]
|
|
@@ -3234,11 +3365,11 @@ var ActivityStructure = React50.forwardRef(
|
|
|
3234
3365
|
);
|
|
3235
3366
|
ActivityStructure.displayName = "ActivityStructure";
|
|
3236
3367
|
|
|
3237
|
-
// src/components/Tags & Badges/
|
|
3238
|
-
var
|
|
3239
|
-
var
|
|
3368
|
+
// src/components/Tags & Badges/Badge.tsx
|
|
3369
|
+
var React52 = __toESM(require("react"), 1);
|
|
3370
|
+
var import_react27 = require("@phosphor-icons/react");
|
|
3240
3371
|
var import_class_variance_authority8 = require("class-variance-authority");
|
|
3241
|
-
var
|
|
3372
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3242
3373
|
var roleTagVariants = (0, import_class_variance_authority8.cva)(
|
|
3243
3374
|
"group inline-flex h-6 items-center whitespace-nowrap rounded-sm py-1 text-ui-caption transition-colors",
|
|
3244
3375
|
{
|
|
@@ -3247,7 +3378,9 @@ var roleTagVariants = (0, import_class_variance_authority8.cva)(
|
|
|
3247
3378
|
primary: "bg-primary-soft px-2.5 text-primary-soft-foreground",
|
|
3248
3379
|
secondary: "bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 px-2.5 text-secondary-muted-foreground",
|
|
3249
3380
|
question: "gap-1 bg-primary-soft pl-1 pr-2.5 text-plum-500",
|
|
3250
|
-
interactable: "gap-1 pl-2.5 pr-2.5 hover:pl-1"
|
|
3381
|
+
interactable: "gap-1 pl-2.5 pr-2.5 hover:pl-1",
|
|
3382
|
+
id: "gap-1 bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 px-2.5 tabular-nums text-surface-foreground",
|
|
3383
|
+
count: "min-w-6 justify-center rounded-full bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 px-2 tabular-nums text-surface-foreground"
|
|
3251
3384
|
},
|
|
3252
3385
|
selected: { true: "", false: "" }
|
|
3253
3386
|
},
|
|
@@ -3262,11 +3395,11 @@ var roleTagVariants = (0, import_class_variance_authority8.cva)(
|
|
|
3262
3395
|
defaultVariants: { type: "primary", selected: false }
|
|
3263
3396
|
}
|
|
3264
3397
|
);
|
|
3265
|
-
var
|
|
3398
|
+
var Badge = React52.forwardRef(
|
|
3266
3399
|
({ className, type = "primary", selected = false, onClick, children, ...props }, ref) => {
|
|
3267
3400
|
const classes = cn(roleTagVariants({ type, selected: type === "interactable" ? selected : false }), className);
|
|
3268
3401
|
if (type === "interactable") {
|
|
3269
|
-
return /* @__PURE__ */ (0,
|
|
3402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
3270
3403
|
"button",
|
|
3271
3404
|
{
|
|
3272
3405
|
ref,
|
|
@@ -3276,24 +3409,25 @@ var RoleTag = React51.forwardRef(
|
|
|
3276
3409
|
onClick,
|
|
3277
3410
|
...props,
|
|
3278
3411
|
children: [
|
|
3279
|
-
/* @__PURE__ */ (0,
|
|
3412
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react27.DotsSixVertical, { size: 16, "aria-hidden": true, className: "hidden shrink-0 group-hover:block" }),
|
|
3280
3413
|
children
|
|
3281
3414
|
]
|
|
3282
3415
|
}
|
|
3283
3416
|
);
|
|
3284
3417
|
}
|
|
3285
|
-
return /* @__PURE__ */ (0,
|
|
3286
|
-
type === "question" && /* @__PURE__ */ (0,
|
|
3418
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("span", { ref, className: classes, ...props, children: [
|
|
3419
|
+
type === "question" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react27.RadioButton, { size: 16, weight: "fill", "aria-hidden": true }),
|
|
3420
|
+
type === "id" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "text-secondary-muted-foreground", children: "ID" }),
|
|
3287
3421
|
children
|
|
3288
3422
|
] });
|
|
3289
3423
|
}
|
|
3290
3424
|
);
|
|
3291
|
-
|
|
3425
|
+
Badge.displayName = "Badge";
|
|
3292
3426
|
|
|
3293
3427
|
// src/components/Utility/Pagination.tsx
|
|
3294
|
-
var
|
|
3295
|
-
var
|
|
3296
|
-
var
|
|
3428
|
+
var React53 = __toESM(require("react"), 1);
|
|
3429
|
+
var import_react28 = require("@phosphor-icons/react");
|
|
3430
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
3297
3431
|
function getPaginationItems(page, pageCount, siblings = 1) {
|
|
3298
3432
|
const keep = /* @__PURE__ */ new Set([1, pageCount]);
|
|
3299
3433
|
for (let p = page - siblings; p <= page + siblings; p++) if (p >= 1 && p <= pageCount) keep.add(p);
|
|
@@ -3307,10 +3441,10 @@ function getPaginationItems(page, pageCount, siblings = 1) {
|
|
|
3307
3441
|
});
|
|
3308
3442
|
return items;
|
|
3309
3443
|
}
|
|
3310
|
-
var Pagination =
|
|
3444
|
+
var Pagination = React53.forwardRef(
|
|
3311
3445
|
({ className, page, pageCount, onPageChange, variant = "full", siblings = 1, ...props }, ref) => {
|
|
3312
3446
|
const go = (next2) => onPageChange(Math.min(pageCount, Math.max(1, next2)));
|
|
3313
|
-
const previous = /* @__PURE__ */ (0,
|
|
3447
|
+
const previous = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3314
3448
|
Button,
|
|
3315
3449
|
{
|
|
3316
3450
|
type: "button",
|
|
@@ -3319,10 +3453,10 @@ var Pagination = React52.forwardRef(
|
|
|
3319
3453
|
"aria-label": "Previous page",
|
|
3320
3454
|
disabled: page <= 1,
|
|
3321
3455
|
onClick: () => go(page - 1),
|
|
3322
|
-
children: /* @__PURE__ */ (0,
|
|
3456
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_react28.ArrowLeft, { size: 16, "aria-hidden": true })
|
|
3323
3457
|
}
|
|
3324
3458
|
);
|
|
3325
|
-
const next = /* @__PURE__ */ (0,
|
|
3459
|
+
const next = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3326
3460
|
Button,
|
|
3327
3461
|
{
|
|
3328
3462
|
type: "button",
|
|
@@ -3331,10 +3465,10 @@ var Pagination = React52.forwardRef(
|
|
|
3331
3465
|
"aria-label": "Next page",
|
|
3332
3466
|
disabled: page >= pageCount,
|
|
3333
3467
|
onClick: () => go(page + 1),
|
|
3334
|
-
children: /* @__PURE__ */ (0,
|
|
3468
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_react28.ArrowRight, { size: 16, "aria-hidden": true })
|
|
3335
3469
|
}
|
|
3336
3470
|
);
|
|
3337
|
-
return /* @__PURE__ */ (0,
|
|
3471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
3338
3472
|
"nav",
|
|
3339
3473
|
{
|
|
3340
3474
|
ref,
|
|
@@ -3343,14 +3477,14 @@ var Pagination = React52.forwardRef(
|
|
|
3343
3477
|
...props,
|
|
3344
3478
|
children: [
|
|
3345
3479
|
previous,
|
|
3346
|
-
variant === "compact" ? /* @__PURE__ */ (0,
|
|
3480
|
+
variant === "compact" ? /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { className: "text-body-small text-surface-foreground", "aria-live": "polite", children: [
|
|
3347
3481
|
page,
|
|
3348
3482
|
"/",
|
|
3349
3483
|
pageCount
|
|
3350
|
-
] }) : /* @__PURE__ */ (0,
|
|
3351
|
-
/* @__PURE__ */ (0,
|
|
3352
|
-
/* @__PURE__ */ (0,
|
|
3353
|
-
] }) : /* @__PURE__ */ (0,
|
|
3484
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("ul", { className: "flex items-center gap-2", children: getPaginationItems(page, pageCount, siblings).map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("li", { children: item === "ellipsis" ? /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { className: "inline-flex size-8 items-center justify-center rounded-sm border border-border bg-surface text-surface-foreground", children: [
|
|
3485
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_react28.DotsThree, { size: 16, "aria-hidden": true }),
|
|
3486
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "sr-only", children: "More pages" })
|
|
3487
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3354
3488
|
Button,
|
|
3355
3489
|
{
|
|
3356
3490
|
type: "button",
|
|
@@ -3376,6 +3510,7 @@ Pagination.displayName = "Pagination";
|
|
|
3376
3510
|
ActivityStructure,
|
|
3377
3511
|
AskAiInput,
|
|
3378
3512
|
AskAiToggle,
|
|
3513
|
+
Badge,
|
|
3379
3514
|
Button,
|
|
3380
3515
|
Calendar,
|
|
3381
3516
|
ChatChoices,
|
|
@@ -3421,6 +3556,7 @@ Pagination.displayName = "Pagination";
|
|
|
3421
3556
|
FormMessage,
|
|
3422
3557
|
ImagePreview,
|
|
3423
3558
|
ImageThumbnails,
|
|
3559
|
+
InlineEdit,
|
|
3424
3560
|
Input,
|
|
3425
3561
|
InputWithAction,
|
|
3426
3562
|
Label,
|
|
@@ -3443,7 +3579,6 @@ Pagination.displayName = "Pagination";
|
|
|
3443
3579
|
RadioGroupItem,
|
|
3444
3580
|
RankList,
|
|
3445
3581
|
RatingScale,
|
|
3446
|
-
RoleTag,
|
|
3447
3582
|
SearchBar,
|
|
3448
3583
|
Select,
|
|
3449
3584
|
SelectContent,
|