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