@discuss-ds/ui 0.42.0 → 0.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/index.cjs +999 -877
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +54 -1
- package/dist/index.d.ts +54 -1
- package/dist/index.js +907 -787
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -106,6 +106,7 @@ __export(index_exports, {
|
|
|
106
106
|
QuestionOptionEditor: () => QuestionOptionEditor,
|
|
107
107
|
QuestionOtherOption: () => QuestionOtherOption,
|
|
108
108
|
QuestionTypeIcon: () => QuestionTypeIcon,
|
|
109
|
+
QuoteChip: () => QuoteChip,
|
|
109
110
|
RadioGroup: () => RadioGroup,
|
|
110
111
|
RadioGroupFieldItem: () => RadioGroupFieldItem,
|
|
111
112
|
RadioGroupItem: () => RadioGroupItem,
|
|
@@ -118,6 +119,7 @@ __export(index_exports, {
|
|
|
118
119
|
SelectItem: () => SelectItem,
|
|
119
120
|
SelectTrigger: () => SelectTrigger,
|
|
120
121
|
SelectValue: () => SelectValue,
|
|
122
|
+
SelectionComment: () => SelectionComment,
|
|
121
123
|
SidebarNavItem: () => SidebarNavItem,
|
|
122
124
|
Slider: () => Slider,
|
|
123
125
|
StatCard: () => StatCard,
|
|
@@ -655,6 +657,7 @@ function ChatOption(props) {
|
|
|
655
657
|
var React11 = __toESM(require("react"), 1);
|
|
656
658
|
var import_react3 = require("@phosphor-icons/react");
|
|
657
659
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
660
|
+
var hasContent = (node) => React11.Children.toArray(node).length > 0;
|
|
658
661
|
var ChatInput = React11.forwardRef(
|
|
659
662
|
({
|
|
660
663
|
className,
|
|
@@ -665,6 +668,7 @@ var ChatInput = React11.forwardRef(
|
|
|
665
668
|
placeholder = "Add context or ask for changes...",
|
|
666
669
|
"aria-label": ariaLabel = "Message",
|
|
667
670
|
attachments,
|
|
671
|
+
quotes,
|
|
668
672
|
choices,
|
|
669
673
|
trailing,
|
|
670
674
|
onAdd,
|
|
@@ -675,9 +679,11 @@ var ChatInput = React11.forwardRef(
|
|
|
675
679
|
}, ref) => {
|
|
676
680
|
const [internal, setInternal] = React11.useState(defaultValue);
|
|
677
681
|
const text = value ?? internal;
|
|
678
|
-
const
|
|
682
|
+
const hasAttachments = hasContent(attachments);
|
|
683
|
+
const hasQuotes = hasContent(quotes);
|
|
684
|
+
const filled = text.trim() !== "" || hasAttachments || hasQuotes;
|
|
679
685
|
const submit = () => {
|
|
680
|
-
if (!
|
|
686
|
+
if (!filled) return;
|
|
681
687
|
onSubmit?.(text);
|
|
682
688
|
};
|
|
683
689
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
@@ -693,7 +699,8 @@ var ChatInput = React11.forwardRef(
|
|
|
693
699
|
children: [
|
|
694
700
|
choices,
|
|
695
701
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col gap-4 p-4", children: [
|
|
696
|
-
|
|
702
|
+
hasQuotes && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "flex flex-col gap-1.5", children: quotes }),
|
|
703
|
+
hasAttachments && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "flex flex-wrap gap-4", children: attachments }),
|
|
697
704
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
698
705
|
"textarea",
|
|
699
706
|
{
|
|
@@ -980,13 +987,126 @@ var ProjectSelector = React14.forwardRef(
|
|
|
980
987
|
);
|
|
981
988
|
ProjectSelector.displayName = "ProjectSelector";
|
|
982
989
|
|
|
983
|
-
// src/components/Conversation & AI Chat/
|
|
990
|
+
// src/components/Conversation & AI Chat/QuoteChip.tsx
|
|
984
991
|
var React15 = __toESM(require("react"), 1);
|
|
992
|
+
var import_react7 = require("@phosphor-icons/react");
|
|
985
993
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
986
|
-
var
|
|
994
|
+
var QuoteChip = React15.forwardRef(
|
|
995
|
+
({ className, quote, hasComment, onRemove, removeLabel = "Remove quote", commentLabel = "With reply", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
996
|
+
"div",
|
|
997
|
+
{
|
|
998
|
+
ref,
|
|
999
|
+
className: cn(
|
|
1000
|
+
"flex w-full min-w-0 items-center gap-2 rounded-md border border-border bg-secondary py-1 pr-1 pl-2.5 text-body-small text-surface-foreground",
|
|
1001
|
+
!onRemove && "pr-2.5",
|
|
1002
|
+
className
|
|
1003
|
+
),
|
|
1004
|
+
...props,
|
|
1005
|
+
children: [
|
|
1006
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react7.ArrowBendUpLeft, { size: 16, "aria-hidden": true, className: "shrink-0 text-muted-foreground" }),
|
|
1007
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "min-w-0 flex-1 truncate", title: quote, children: [
|
|
1008
|
+
"\u201C",
|
|
1009
|
+
quote,
|
|
1010
|
+
"\u201D"
|
|
1011
|
+
] }),
|
|
1012
|
+
hasComment && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "shrink-0 rounded-xs bg-accent-soft px-1.5 py-px text-body-xxs font-semibold text-accent-soft-foreground", children: commentLabel }),
|
|
1013
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": removeLabel, onClick: onRemove, className: "size-6 shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react7.X, { size: 14, "aria-hidden": true }) })
|
|
1014
|
+
]
|
|
1015
|
+
}
|
|
1016
|
+
)
|
|
1017
|
+
);
|
|
1018
|
+
QuoteChip.displayName = "QuoteChip";
|
|
1019
|
+
|
|
1020
|
+
// src/components/Conversation & AI Chat/SelectionComment.tsx
|
|
1021
|
+
var React16 = __toESM(require("react"), 1);
|
|
1022
|
+
var import_react8 = require("@phosphor-icons/react");
|
|
1023
|
+
var import_radix_ui9 = require("radix-ui");
|
|
1024
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1025
|
+
var emptyRect = { x: 0, y: 0, top: 0, left: 0, right: 0, bottom: 0, width: 0, height: 0 };
|
|
1026
|
+
function SelectionComment({
|
|
1027
|
+
open: openProp,
|
|
1028
|
+
defaultOpen = false,
|
|
1029
|
+
onOpenChange,
|
|
1030
|
+
onSubmit,
|
|
1031
|
+
anchorRect,
|
|
1032
|
+
children,
|
|
1033
|
+
placeholder = "Add a comment",
|
|
1034
|
+
"aria-label": ariaLabel = "Comment",
|
|
1035
|
+
sendLabel = "Send",
|
|
1036
|
+
side = "bottom",
|
|
1037
|
+
align = "start",
|
|
1038
|
+
sideOffset = 6,
|
|
1039
|
+
className
|
|
1040
|
+
}) {
|
|
1041
|
+
const [internalOpen, setInternalOpen] = React16.useState(defaultOpen);
|
|
1042
|
+
const [comment, setComment] = React16.useState("");
|
|
1043
|
+
const open = openProp ?? internalOpen;
|
|
1044
|
+
const rectRef = React16.useRef(anchorRect);
|
|
1045
|
+
React16.useLayoutEffect(() => {
|
|
1046
|
+
rectRef.current = anchorRect;
|
|
1047
|
+
}, [anchorRect]);
|
|
1048
|
+
const virtualRef = React16.useRef({
|
|
1049
|
+
getBoundingClientRect: () => {
|
|
1050
|
+
const rect = rectRef.current;
|
|
1051
|
+
const value = typeof rect === "function" ? rect() : rect;
|
|
1052
|
+
return value ?? emptyRect;
|
|
1053
|
+
}
|
|
1054
|
+
});
|
|
1055
|
+
const setOpen = (next) => {
|
|
1056
|
+
if (!next) setComment("");
|
|
1057
|
+
setInternalOpen(next);
|
|
1058
|
+
onOpenChange?.(next);
|
|
1059
|
+
};
|
|
1060
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_radix_ui9.Popover.Root, { open, onOpenChange: setOpen, children: [
|
|
1061
|
+
anchorRect != null && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_radix_ui9.Popover.Anchor, { virtualRef }),
|
|
1062
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_radix_ui9.Popover.Trigger, { asChild: true, children }),
|
|
1063
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_radix_ui9.Popover.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1064
|
+
import_radix_ui9.Popover.Content,
|
|
1065
|
+
{
|
|
1066
|
+
side,
|
|
1067
|
+
align,
|
|
1068
|
+
sideOffset,
|
|
1069
|
+
collisionPadding: 8,
|
|
1070
|
+
"aria-label": ariaLabel,
|
|
1071
|
+
style: { zIndex: "var(--sys-z-30)" },
|
|
1072
|
+
className: cn("w-80 rounded-xl border border-border bg-popover p-1.5 text-popover-foreground shadow-md", className),
|
|
1073
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
1074
|
+
"form",
|
|
1075
|
+
{
|
|
1076
|
+
className: "flex min-h-10 items-center gap-2 rounded-full border border-border bg-surface py-1 pr-1 pl-3 focus-within:border-input-accent",
|
|
1077
|
+
onSubmit: (event) => {
|
|
1078
|
+
event.preventDefault();
|
|
1079
|
+
onSubmit(comment);
|
|
1080
|
+
setOpen(false);
|
|
1081
|
+
},
|
|
1082
|
+
children: [
|
|
1083
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1084
|
+
"input",
|
|
1085
|
+
{
|
|
1086
|
+
"aria-label": ariaLabel,
|
|
1087
|
+
value: comment,
|
|
1088
|
+
placeholder,
|
|
1089
|
+
onChange: (event) => setComment(event.target.value),
|
|
1090
|
+
className: "min-w-0 flex-1 bg-transparent text-body-small text-surface-foreground outline-none placeholder:text-muted-foreground"
|
|
1091
|
+
}
|
|
1092
|
+
),
|
|
1093
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Button, { type: "submit", variant: "default", size: "icon-sm", "aria-label": sendLabel, className: "rounded-full", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react8.ArrowUp, { size: 14, "aria-hidden": true }) })
|
|
1094
|
+
]
|
|
1095
|
+
}
|
|
1096
|
+
)
|
|
1097
|
+
}
|
|
1098
|
+
) })
|
|
1099
|
+
] });
|
|
1100
|
+
}
|
|
1101
|
+
SelectionComment.displayName = "SelectionComment";
|
|
1102
|
+
|
|
1103
|
+
// src/components/Conversation & AI Chat/Timestamp.tsx
|
|
1104
|
+
var React17 = __toESM(require("react"), 1);
|
|
1105
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1106
|
+
var Timestamp = React17.forwardRef(
|
|
987
1107
|
({ className, time, children, timePosition = "before", ...props }, ref) => {
|
|
988
|
-
const timeNode = /* @__PURE__ */ (0,
|
|
989
|
-
return /* @__PURE__ */ (0,
|
|
1108
|
+
const timeNode = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("time", { className: "text-ui-caption whitespace-nowrap text-secondary-muted-foreground", children: time });
|
|
1109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
990
1110
|
"div",
|
|
991
1111
|
{
|
|
992
1112
|
ref,
|
|
@@ -994,7 +1114,7 @@ var Timestamp = React15.forwardRef(
|
|
|
994
1114
|
...props,
|
|
995
1115
|
children: [
|
|
996
1116
|
timePosition === "before" && timeNode,
|
|
997
|
-
children && /* @__PURE__ */ (0,
|
|
1117
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { role: "toolbar", "aria-label": "Message actions", className: "flex items-center", children }),
|
|
998
1118
|
timePosition === "after" && timeNode
|
|
999
1119
|
]
|
|
1000
1120
|
}
|
|
@@ -1004,40 +1124,40 @@ var Timestamp = React15.forwardRef(
|
|
|
1004
1124
|
Timestamp.displayName = "Timestamp";
|
|
1005
1125
|
|
|
1006
1126
|
// src/components/Conversation & AI Chat/TopicCard.tsx
|
|
1007
|
-
var
|
|
1008
|
-
var
|
|
1009
|
-
var
|
|
1010
|
-
var TopicCard =
|
|
1011
|
-
({ className, icon, title, badge, description, tags, meta, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1127
|
+
var React18 = __toESM(require("react"), 1);
|
|
1128
|
+
var import_react9 = require("@phosphor-icons/react");
|
|
1129
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1130
|
+
var TopicCard = React18.forwardRef(
|
|
1131
|
+
({ className, icon, title, badge, description, tags, meta, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1012
1132
|
"div",
|
|
1013
1133
|
{
|
|
1014
1134
|
ref,
|
|
1015
1135
|
className: cn("flex w-full flex-col gap-4 overflow-hidden rounded-xl border border-border bg-surface p-4", className),
|
|
1016
1136
|
...props,
|
|
1017
1137
|
children: [
|
|
1018
|
-
/* @__PURE__ */ (0,
|
|
1019
|
-
/* @__PURE__ */ (0,
|
|
1020
|
-
icon && /* @__PURE__ */ (0,
|
|
1021
|
-
/* @__PURE__ */ (0,
|
|
1138
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-4", children: [
|
|
1139
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-4 text-primary", children: [
|
|
1140
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "flex size-6 shrink-0 items-center justify-center [&>svg]:size-6", children: icon }),
|
|
1141
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("h3", { className: "text-heading-h3 whitespace-nowrap", children: title })
|
|
1022
1142
|
] }),
|
|
1023
1143
|
badge
|
|
1024
1144
|
] }),
|
|
1025
|
-
/* @__PURE__ */ (0,
|
|
1026
|
-
tags && /* @__PURE__ */ (0,
|
|
1027
|
-
meta && /* @__PURE__ */ (0,
|
|
1145
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-body-base text-surface-foreground", children: description }),
|
|
1146
|
+
tags && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex flex-wrap items-center gap-2", children: tags }),
|
|
1147
|
+
meta && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex items-center gap-2 text-ui-caption text-secondary-muted-foreground", children: meta })
|
|
1028
1148
|
]
|
|
1029
1149
|
}
|
|
1030
1150
|
)
|
|
1031
1151
|
);
|
|
1032
1152
|
TopicCard.displayName = "TopicCard";
|
|
1033
1153
|
function TopicCardMetaItem({ icon, children, className, ...props }) {
|
|
1034
|
-
return /* @__PURE__ */ (0,
|
|
1035
|
-
/* @__PURE__ */ (0,
|
|
1154
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: cn("flex items-center gap-1", className), ...props, children: [
|
|
1155
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { "aria-hidden": "true", className: "flex size-4 items-center justify-center [&>svg]:size-4", children: icon }),
|
|
1036
1156
|
children
|
|
1037
1157
|
] });
|
|
1038
1158
|
}
|
|
1039
1159
|
function TopicCardTag({ className, ...props }) {
|
|
1040
|
-
return /* @__PURE__ */ (0,
|
|
1160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1041
1161
|
"span",
|
|
1042
1162
|
{
|
|
1043
1163
|
className: cn(
|
|
@@ -1048,8 +1168,8 @@ function TopicCardTag({ className, ...props }) {
|
|
|
1048
1168
|
}
|
|
1049
1169
|
);
|
|
1050
1170
|
}
|
|
1051
|
-
var TopicActivityRow =
|
|
1052
|
-
({ className, status, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1171
|
+
var TopicActivityRow = React18.forwardRef(
|
|
1172
|
+
({ className, status, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1053
1173
|
"button",
|
|
1054
1174
|
{
|
|
1055
1175
|
ref,
|
|
@@ -1060,12 +1180,12 @@ var TopicActivityRow = React16.forwardRef(
|
|
|
1060
1180
|
),
|
|
1061
1181
|
...props,
|
|
1062
1182
|
children: [
|
|
1063
|
-
/* @__PURE__ */ (0,
|
|
1064
|
-
/* @__PURE__ */ (0,
|
|
1183
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "flex items-center gap-2 whitespace-nowrap", children: [
|
|
1184
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react9.Check, { size: 16, "aria-hidden": true, className: "text-accent" }),
|
|
1065
1185
|
status
|
|
1066
1186
|
] }),
|
|
1067
|
-
/* @__PURE__ */ (0,
|
|
1068
|
-
/* @__PURE__ */ (0,
|
|
1187
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "min-w-0 flex-1 truncate", children }),
|
|
1188
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react9.CaretRight, { size: 16, "aria-hidden": true })
|
|
1069
1189
|
]
|
|
1070
1190
|
}
|
|
1071
1191
|
)
|
|
@@ -1073,23 +1193,23 @@ var TopicActivityRow = React16.forwardRef(
|
|
|
1073
1193
|
TopicActivityRow.displayName = "TopicActivityRow";
|
|
1074
1194
|
|
|
1075
1195
|
// src/components/Conversation & AI Chat/UserMessageBubble.tsx
|
|
1076
|
-
var
|
|
1077
|
-
var
|
|
1078
|
-
var UserMessageBubble =
|
|
1079
|
-
({ className, children, attachments, footer, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1080
|
-
/* @__PURE__ */ (0,
|
|
1081
|
-
attachments && /* @__PURE__ */ (0,
|
|
1082
|
-
/* @__PURE__ */ (0,
|
|
1196
|
+
var React19 = __toESM(require("react"), 1);
|
|
1197
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1198
|
+
var UserMessageBubble = React19.forwardRef(
|
|
1199
|
+
({ className, children, attachments, footer, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { ref, className: cn("flex w-full max-w-125 flex-col items-end gap-2.5", className), ...props, children: [
|
|
1200
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex w-full flex-col gap-4 rounded-tl-xl rounded-tr-xl rounded-br-xs rounded-bl-xl bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 p-4 text-body-base text-surface-foreground", children: [
|
|
1201
|
+
attachments && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex flex-wrap gap-4", children: attachments }),
|
|
1202
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "break-words", children })
|
|
1083
1203
|
] }),
|
|
1084
|
-
footer && /* @__PURE__ */ (0,
|
|
1204
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "w-full", children: footer })
|
|
1085
1205
|
] })
|
|
1086
1206
|
);
|
|
1087
1207
|
UserMessageBubble.displayName = "UserMessageBubble";
|
|
1088
1208
|
|
|
1089
1209
|
// src/components/Forms & Data Entry/Calendar.tsx
|
|
1090
|
-
var
|
|
1210
|
+
var import_react10 = require("@phosphor-icons/react");
|
|
1091
1211
|
var import_react_day_picker = require("react-day-picker");
|
|
1092
|
-
var
|
|
1212
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1093
1213
|
var subtleFill = "bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5";
|
|
1094
1214
|
function Calendar({
|
|
1095
1215
|
className,
|
|
@@ -1104,7 +1224,7 @@ function Calendar({
|
|
|
1104
1224
|
...props
|
|
1105
1225
|
}) {
|
|
1106
1226
|
const year = (/* @__PURE__ */ new Date()).getFullYear();
|
|
1107
|
-
return /* @__PURE__ */ (0,
|
|
1227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1108
1228
|
import_react_day_picker.DayPicker,
|
|
1109
1229
|
{
|
|
1110
1230
|
showOutsideDays,
|
|
@@ -1144,7 +1264,7 @@ function Calendar({
|
|
|
1144
1264
|
...classNames
|
|
1145
1265
|
},
|
|
1146
1266
|
components: {
|
|
1147
|
-
Chevron: ({ orientation }) => orientation === "left" ? /* @__PURE__ */ (0,
|
|
1267
|
+
Chevron: ({ orientation }) => orientation === "left" ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react10.CaretLeft, { size: 16, "aria-hidden": true }) : orientation === "right" ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react10.CaretRight, { size: 16, "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react10.CaretDown, { size: 16, "aria-hidden": true })
|
|
1148
1268
|
},
|
|
1149
1269
|
...props
|
|
1150
1270
|
}
|
|
@@ -1153,14 +1273,14 @@ function Calendar({
|
|
|
1153
1273
|
Calendar.displayName = "Calendar";
|
|
1154
1274
|
|
|
1155
1275
|
// src/components/Forms & Data Entry/DateTimePicker.tsx
|
|
1156
|
-
var
|
|
1157
|
-
var
|
|
1158
|
-
var
|
|
1276
|
+
var React24 = __toESM(require("react"), 1);
|
|
1277
|
+
var import_react12 = require("@phosphor-icons/react");
|
|
1278
|
+
var import_radix_ui13 = require("radix-ui");
|
|
1159
1279
|
|
|
1160
1280
|
// src/components/Forms & Data Entry/Field.tsx
|
|
1161
|
-
var
|
|
1162
|
-
var
|
|
1163
|
-
var
|
|
1281
|
+
var React20 = __toESM(require("react"), 1);
|
|
1282
|
+
var import_react11 = require("@phosphor-icons/react");
|
|
1283
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1164
1284
|
function fieldSurfaceClasses(status = "default") {
|
|
1165
1285
|
return cn(
|
|
1166
1286
|
"border bg-surface text-surface-foreground transition-colors",
|
|
@@ -1170,19 +1290,19 @@ function fieldSurfaceClasses(status = "default") {
|
|
|
1170
1290
|
);
|
|
1171
1291
|
}
|
|
1172
1292
|
function Field({ label, description, message, status = "default", id, className, children }) {
|
|
1173
|
-
const generatedId =
|
|
1293
|
+
const generatedId = React20.useId();
|
|
1174
1294
|
const controlId = id ?? generatedId;
|
|
1175
1295
|
const messageId = `${controlId}-message`;
|
|
1176
1296
|
const showStatus = status !== "default" && message != null;
|
|
1177
1297
|
const text = showStatus ? message : description;
|
|
1178
|
-
return /* @__PURE__ */ (0,
|
|
1179
|
-
label != null && /* @__PURE__ */ (0,
|
|
1298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: cn("flex w-full flex-col gap-1.5", className), children: [
|
|
1299
|
+
label != null && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Label, { htmlFor: controlId, children: label }),
|
|
1180
1300
|
children({
|
|
1181
1301
|
id: controlId,
|
|
1182
1302
|
"aria-describedby": text != null ? messageId : void 0,
|
|
1183
1303
|
"aria-invalid": status === "error" ? true : void 0
|
|
1184
1304
|
}),
|
|
1185
|
-
text != null && /* @__PURE__ */ (0,
|
|
1305
|
+
text != null && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
1186
1306
|
"p",
|
|
1187
1307
|
{
|
|
1188
1308
|
id: messageId,
|
|
@@ -1193,7 +1313,7 @@ function Field({ label, description, message, status = "default", id, className,
|
|
|
1193
1313
|
status === "error" && "items-start text-destructive"
|
|
1194
1314
|
),
|
|
1195
1315
|
children: [
|
|
1196
|
-
showStatus && (status === "error" ? /* @__PURE__ */ (0,
|
|
1316
|
+
showStatus && (status === "error" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react11.WarningCircle, { size: 16, "aria-hidden": true, className: "shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react11.CheckCircle, { size: 16, "aria-hidden": true, className: "shrink-0" })),
|
|
1197
1317
|
text
|
|
1198
1318
|
]
|
|
1199
1319
|
}
|
|
@@ -1209,19 +1329,19 @@ function formatDateTime(date, showTime = true) {
|
|
|
1209
1329
|
}
|
|
1210
1330
|
|
|
1211
1331
|
// src/components/Forms & Data Entry/TimePicker.tsx
|
|
1212
|
-
var
|
|
1213
|
-
var
|
|
1332
|
+
var React23 = __toESM(require("react"), 1);
|
|
1333
|
+
var import_radix_ui12 = require("radix-ui");
|
|
1214
1334
|
|
|
1215
1335
|
// src/components/Navigation/TabItem.tsx
|
|
1216
|
-
var
|
|
1217
|
-
var
|
|
1336
|
+
var React22 = __toESM(require("react"), 1);
|
|
1337
|
+
var import_radix_ui11 = require("radix-ui");
|
|
1218
1338
|
|
|
1219
1339
|
// src/components/Navigation/TabNavigation.tsx
|
|
1220
|
-
var
|
|
1221
|
-
var
|
|
1340
|
+
var React21 = __toESM(require("react"), 1);
|
|
1341
|
+
var import_radix_ui10 = require("radix-ui");
|
|
1222
1342
|
var import_class_variance_authority3 = require("class-variance-authority");
|
|
1223
|
-
var
|
|
1224
|
-
var TabNavigationContext =
|
|
1343
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1344
|
+
var TabNavigationContext = React21.createContext("filter");
|
|
1225
1345
|
var tabNavigationVariants = (0, import_class_variance_authority3.cva)("inline-flex items-start gap-1 p-0.5", {
|
|
1226
1346
|
variants: {
|
|
1227
1347
|
variant: {
|
|
@@ -1233,20 +1353,20 @@ var tabNavigationVariants = (0, import_class_variance_authority3.cva)("inline-fl
|
|
|
1233
1353
|
},
|
|
1234
1354
|
defaultVariants: { variant: "filter" }
|
|
1235
1355
|
});
|
|
1236
|
-
var Tabs =
|
|
1237
|
-
var TabsContent =
|
|
1356
|
+
var Tabs = import_radix_ui10.Tabs.Root;
|
|
1357
|
+
var TabsContent = import_radix_ui10.Tabs.Content;
|
|
1238
1358
|
var indicatorClasses = {
|
|
1239
1359
|
filter: "rounded-full bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5",
|
|
1240
1360
|
toggle: "rounded-sm bg-surface"
|
|
1241
1361
|
};
|
|
1242
|
-
var TabNavigation =
|
|
1362
|
+
var TabNavigation = React21.forwardRef(
|
|
1243
1363
|
({ className, variant = "filter", children, ...props }, forwardedRef) => {
|
|
1244
1364
|
const kind = variant ?? "filter";
|
|
1245
1365
|
const slides = kind !== "underline";
|
|
1246
|
-
const listRef =
|
|
1247
|
-
const [box, setBox] =
|
|
1248
|
-
const [animate, setAnimate] =
|
|
1249
|
-
const setRefs =
|
|
1366
|
+
const listRef = React21.useRef(null);
|
|
1367
|
+
const [box, setBox] = React21.useState(null);
|
|
1368
|
+
const [animate, setAnimate] = React21.useState(false);
|
|
1369
|
+
const setRefs = React21.useCallback(
|
|
1250
1370
|
(node) => {
|
|
1251
1371
|
listRef.current = node;
|
|
1252
1372
|
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
@@ -1254,7 +1374,7 @@ var TabNavigation = React19.forwardRef(
|
|
|
1254
1374
|
},
|
|
1255
1375
|
[forwardedRef]
|
|
1256
1376
|
);
|
|
1257
|
-
|
|
1377
|
+
React21.useLayoutEffect(() => {
|
|
1258
1378
|
const list = listRef.current;
|
|
1259
1379
|
if (!slides || !list) return;
|
|
1260
1380
|
const measure = () => {
|
|
@@ -1274,8 +1394,8 @@ var TabNavigation = React19.forwardRef(
|
|
|
1274
1394
|
cancelAnimationFrame(frame);
|
|
1275
1395
|
};
|
|
1276
1396
|
}, [slides]);
|
|
1277
|
-
return /* @__PURE__ */ (0,
|
|
1278
|
-
slides && box && /* @__PURE__ */ (0,
|
|
1397
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TabNavigationContext.Provider, { value: kind, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_radix_ui10.Tabs.List, { ref: setRefs, className: cn(tabNavigationVariants({ variant }), className), ...props, children: [
|
|
1398
|
+
slides && box && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1279
1399
|
"span",
|
|
1280
1400
|
{
|
|
1281
1401
|
"aria-hidden": true,
|
|
@@ -1295,16 +1415,16 @@ var TabNavigation = React19.forwardRef(
|
|
|
1295
1415
|
TabNavigation.displayName = "TabNavigation";
|
|
1296
1416
|
|
|
1297
1417
|
// src/components/Navigation/TabItem.tsx
|
|
1298
|
-
var
|
|
1418
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1299
1419
|
var base = "inline-flex h-7 items-center justify-center gap-1 whitespace-nowrap px-2.5 py-1 text-ui-label transition-colors disabled:pointer-events-none disabled:opacity-50";
|
|
1300
|
-
var filter = "relative rounded-full text-surface-foreground hover:text-accent data-[state=active]:hover:bg-accent-soft data-[state=active]:hover:text-accent-soft-foreground disabled:text-muted-foreground";
|
|
1420
|
+
var filter = "relative rounded-full text-surface-foreground hover:text-accent-foreground data-[state=active]:hover:bg-accent-soft data-[state=active]:hover:text-accent-soft-foreground disabled:text-muted-foreground";
|
|
1301
1421
|
var toggle = "relative rounded-sm text-secondary-muted-foreground hover:text-surface-foreground data-[state=active]:text-surface-foreground";
|
|
1302
1422
|
var underline = "relative h-full rounded-none px-4 py-3 font-medium text-secondary-muted-foreground hover:text-surface-foreground data-[state=active]:font-semibold data-[state=active]:text-surface-foreground after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 data-[state=active]:after:bg-accent";
|
|
1303
|
-
var TabItem =
|
|
1423
|
+
var TabItem = React22.forwardRef(
|
|
1304
1424
|
({ className, ...props }, ref) => {
|
|
1305
|
-
const variant =
|
|
1306
|
-
return /* @__PURE__ */ (0,
|
|
1307
|
-
|
|
1425
|
+
const variant = React22.useContext(TabNavigationContext);
|
|
1426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1427
|
+
import_radix_ui11.Tabs.Trigger,
|
|
1308
1428
|
{
|
|
1309
1429
|
ref,
|
|
1310
1430
|
className: cn(base, variant === "toggle" ? toggle : variant === "underline" ? underline : filter, className),
|
|
@@ -1316,10 +1436,10 @@ var TabItem = React20.forwardRef(
|
|
|
1316
1436
|
TabItem.displayName = "TabItem";
|
|
1317
1437
|
|
|
1318
1438
|
// src/components/Forms & Data Entry/TimePicker.tsx
|
|
1319
|
-
var
|
|
1320
|
-
var TimeItem =
|
|
1321
|
-
({ className, recommended, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1322
|
-
|
|
1439
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1440
|
+
var TimeItem = React23.forwardRef(
|
|
1441
|
+
({ className, recommended, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1442
|
+
import_radix_ui12.ToggleGroup.Item,
|
|
1323
1443
|
{
|
|
1324
1444
|
ref,
|
|
1325
1445
|
className: cn(
|
|
@@ -1348,8 +1468,8 @@ function TimePicker({
|
|
|
1348
1468
|
className
|
|
1349
1469
|
}) {
|
|
1350
1470
|
const current = value ?? { hour: 12, minute: 0, period: "AM" };
|
|
1351
|
-
const root =
|
|
1352
|
-
|
|
1471
|
+
const root = React23.useRef(null);
|
|
1472
|
+
React23.useEffect(() => {
|
|
1353
1473
|
root.current?.querySelectorAll('[data-state="on"]').forEach((item) => {
|
|
1354
1474
|
const column = item.parentElement;
|
|
1355
1475
|
if (column) column.scrollTop = Math.max(0, item.offsetTop - column.offsetTop - column.clientHeight / 2 + item.clientHeight / 2);
|
|
@@ -1357,26 +1477,26 @@ function TimePicker({
|
|
|
1357
1477
|
}, []);
|
|
1358
1478
|
const hours = Array.from({ length: 12 }, (_, i) => i + 1);
|
|
1359
1479
|
const minutes = Array.from({ length: Math.ceil(60 / minuteStep) }, (_, i) => i * minuteStep);
|
|
1360
|
-
return /* @__PURE__ */ (0,
|
|
1361
|
-
/* @__PURE__ */ (0,
|
|
1362
|
-
/* @__PURE__ */ (0,
|
|
1480
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { ref: root, className: cn("flex w-45 flex-col gap-4 pt-2", className), children: [
|
|
1481
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-ui-label text-surface-foreground", children: "Select Time" }),
|
|
1482
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1363
1483
|
Tabs,
|
|
1364
1484
|
{
|
|
1365
1485
|
value: current.period,
|
|
1366
1486
|
onValueChange: (period) => onValueChange?.({ ...current, period }),
|
|
1367
|
-
children: /* @__PURE__ */ (0,
|
|
1487
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TabNavigation, { variant: "toggle", "aria-label": "AM or PM", className: "self-start", children: ["AM", "PM"].map((period) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TabItem, { value: period, children: period }, period)) })
|
|
1368
1488
|
}
|
|
1369
1489
|
),
|
|
1370
|
-
/* @__PURE__ */ (0,
|
|
1371
|
-
/* @__PURE__ */ (0,
|
|
1372
|
-
|
|
1490
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex h-47.5 w-full items-start gap-3", children: [
|
|
1491
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1492
|
+
import_radix_ui12.ToggleGroup.Root,
|
|
1373
1493
|
{
|
|
1374
1494
|
type: "single",
|
|
1375
1495
|
"aria-label": "Hour",
|
|
1376
1496
|
value: String(current.hour),
|
|
1377
1497
|
onValueChange: (next) => next && onValueChange?.({ ...current, hour: Number(next) }),
|
|
1378
1498
|
className: "flex h-full min-w-0 flex-1 flex-col gap-1 overflow-y-auto",
|
|
1379
|
-
children: hours.map((hour) => /* @__PURE__ */ (0,
|
|
1499
|
+
children: hours.map((hour) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1380
1500
|
TimeItem,
|
|
1381
1501
|
{
|
|
1382
1502
|
value: String(hour),
|
|
@@ -1388,16 +1508,16 @@ function TimePicker({
|
|
|
1388
1508
|
))
|
|
1389
1509
|
}
|
|
1390
1510
|
),
|
|
1391
|
-
/* @__PURE__ */ (0,
|
|
1392
|
-
/* @__PURE__ */ (0,
|
|
1393
|
-
|
|
1511
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex h-full items-center text-ui-label-large text-surface-foreground", "aria-hidden": "true", children: ":" }),
|
|
1512
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1513
|
+
import_radix_ui12.ToggleGroup.Root,
|
|
1394
1514
|
{
|
|
1395
1515
|
type: "single",
|
|
1396
1516
|
"aria-label": "Minute",
|
|
1397
1517
|
value: String(current.minute),
|
|
1398
1518
|
onValueChange: (next) => next && onValueChange?.({ ...current, minute: Number(next) }),
|
|
1399
1519
|
className: "flex h-full min-w-0 flex-1 flex-col gap-1 overflow-y-auto",
|
|
1400
|
-
children: minutes.map((minute) => /* @__PURE__ */ (0,
|
|
1520
|
+
children: minutes.map((minute) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1401
1521
|
TimeItem,
|
|
1402
1522
|
{
|
|
1403
1523
|
value: String(minute),
|
|
@@ -1414,7 +1534,7 @@ function TimePicker({
|
|
|
1414
1534
|
}
|
|
1415
1535
|
|
|
1416
1536
|
// src/components/Forms & Data Entry/DateTimePicker.tsx
|
|
1417
|
-
var
|
|
1537
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1418
1538
|
function toTimeValue(date) {
|
|
1419
1539
|
if (!date) return void 0;
|
|
1420
1540
|
const hours = date.getHours();
|
|
@@ -1435,13 +1555,13 @@ function DateTimePicker({
|
|
|
1435
1555
|
timePickerProps,
|
|
1436
1556
|
className
|
|
1437
1557
|
}) {
|
|
1438
|
-
const [date, setDate] =
|
|
1439
|
-
const [time, setTime] =
|
|
1558
|
+
const [date, setDate] = React24.useState(value ?? defaultValue);
|
|
1559
|
+
const [time, setTime] = React24.useState(toTimeValue(value ?? defaultValue));
|
|
1440
1560
|
const apply = () => {
|
|
1441
1561
|
if (!date) return onApply?.(void 0);
|
|
1442
1562
|
onApply?.(showTime ? combine(date, time ?? { hour: 12, minute: 0, period: "AM" }) : date);
|
|
1443
1563
|
};
|
|
1444
|
-
return /* @__PURE__ */ (0,
|
|
1564
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
1445
1565
|
"div",
|
|
1446
1566
|
{
|
|
1447
1567
|
className: cn(
|
|
@@ -1449,15 +1569,15 @@ function DateTimePicker({
|
|
|
1449
1569
|
className
|
|
1450
1570
|
),
|
|
1451
1571
|
children: [
|
|
1452
|
-
/* @__PURE__ */ (0,
|
|
1453
|
-
/* @__PURE__ */ (0,
|
|
1454
|
-
showTime && /* @__PURE__ */ (0,
|
|
1455
|
-
/* @__PURE__ */ (0,
|
|
1456
|
-
/* @__PURE__ */ (0,
|
|
1572
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center gap-6", children: [
|
|
1573
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Calendar, { mode: "single", selected: date, onSelect: setDate, defaultMonth: date, ...calendarProps }),
|
|
1574
|
+
showTime && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
1575
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "h-70 w-px self-center bg-border", "aria-hidden": "true" }),
|
|
1576
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TimePicker, { value: time, onValueChange: setTime, ...timePickerProps })
|
|
1457
1577
|
] })
|
|
1458
1578
|
] }),
|
|
1459
|
-
/* @__PURE__ */ (0,
|
|
1460
|
-
/* @__PURE__ */ (0,
|
|
1579
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center justify-end gap-2", children: [
|
|
1580
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1461
1581
|
Button,
|
|
1462
1582
|
{
|
|
1463
1583
|
type: "button",
|
|
@@ -1471,19 +1591,19 @@ function DateTimePicker({
|
|
|
1471
1591
|
children: "Reset"
|
|
1472
1592
|
}
|
|
1473
1593
|
),
|
|
1474
|
-
/* @__PURE__ */ (0,
|
|
1594
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Button, { type: "button", variant: "outline", size: "sm", onClick: apply, children: "Apply" })
|
|
1475
1595
|
] })
|
|
1476
1596
|
]
|
|
1477
1597
|
}
|
|
1478
1598
|
);
|
|
1479
1599
|
}
|
|
1480
|
-
var DatePicker =
|
|
1600
|
+
var DatePicker = React24.forwardRef(
|
|
1481
1601
|
({ label, placeholder = "Select date and time", value, defaultValue, onValueChange, showTime = true, className, ...pickerProps }, ref) => {
|
|
1482
|
-
const [open, setOpen] =
|
|
1483
|
-
const [internal, setInternal] =
|
|
1602
|
+
const [open, setOpen] = React24.useState(false);
|
|
1603
|
+
const [internal, setInternal] = React24.useState(defaultValue);
|
|
1484
1604
|
const current = value ?? internal;
|
|
1485
|
-
return /* @__PURE__ */ (0,
|
|
1486
|
-
/* @__PURE__ */ (0,
|
|
1605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Field, { label, className: cn("w-75", className), children: (control) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_radix_ui13.Popover.Root, { open, onOpenChange: setOpen, children: [
|
|
1606
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_radix_ui13.Popover.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
1487
1607
|
"button",
|
|
1488
1608
|
{
|
|
1489
1609
|
ref,
|
|
@@ -1491,12 +1611,12 @@ var DatePicker = React22.forwardRef(
|
|
|
1491
1611
|
...control,
|
|
1492
1612
|
className: "flex h-10 w-full items-center gap-3 rounded-md border border-input-muted bg-surface px-3 py-2.5 text-left shadow-xs transition-colors hover:border-input-accent data-[state=open]:border-input-accent",
|
|
1493
1613
|
children: [
|
|
1494
|
-
/* @__PURE__ */ (0,
|
|
1495
|
-
/* @__PURE__ */ (0,
|
|
1614
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react12.CalendarBlank, { size: 24, "aria-hidden": true, className: "shrink-0 text-surface-foreground" }),
|
|
1615
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: cn("truncate", current ? "text-ui-label-large text-surface-foreground" : "text-body-base text-muted-foreground"), children: current ? formatDateTime(current, showTime) : placeholder })
|
|
1496
1616
|
]
|
|
1497
1617
|
}
|
|
1498
1618
|
) }),
|
|
1499
|
-
/* @__PURE__ */ (0,
|
|
1619
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_radix_ui13.Popover.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_radix_ui13.Popover.Content, { align: "start", sideOffset: 8, style: { zIndex: "var(--sys-z-20)" }, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1500
1620
|
DateTimePicker,
|
|
1501
1621
|
{
|
|
1502
1622
|
...pickerProps,
|
|
@@ -1515,19 +1635,19 @@ var DatePicker = React22.forwardRef(
|
|
|
1515
1635
|
DatePicker.displayName = "DatePicker";
|
|
1516
1636
|
|
|
1517
1637
|
// src/components/Forms & Data Entry/Form.tsx
|
|
1518
|
-
var
|
|
1519
|
-
var
|
|
1638
|
+
var React25 = __toESM(require("react"), 1);
|
|
1639
|
+
var import_radix_ui14 = require("radix-ui");
|
|
1520
1640
|
var import_react_hook_form = require("react-hook-form");
|
|
1521
|
-
var
|
|
1641
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1522
1642
|
var Form = import_react_hook_form.FormProvider;
|
|
1523
|
-
var FormFieldContext =
|
|
1643
|
+
var FormFieldContext = React25.createContext(null);
|
|
1524
1644
|
function FormField(props) {
|
|
1525
|
-
return /* @__PURE__ */ (0,
|
|
1645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_hook_form.Controller, { ...props }) });
|
|
1526
1646
|
}
|
|
1527
|
-
var FormItemContext =
|
|
1647
|
+
var FormItemContext = React25.createContext(null);
|
|
1528
1648
|
function useFormField() {
|
|
1529
|
-
const fieldContext =
|
|
1530
|
-
const itemContext =
|
|
1649
|
+
const fieldContext = React25.useContext(FormFieldContext);
|
|
1650
|
+
const itemContext = React25.useContext(FormItemContext);
|
|
1531
1651
|
const { getFieldState } = (0, import_react_hook_form.useFormContext)();
|
|
1532
1652
|
const formState = (0, import_react_hook_form.useFormState)({ name: fieldContext?.name });
|
|
1533
1653
|
if (!fieldContext) {
|
|
@@ -1547,15 +1667,15 @@ function useFormField() {
|
|
|
1547
1667
|
...fieldState
|
|
1548
1668
|
};
|
|
1549
1669
|
}
|
|
1550
|
-
var FormItem =
|
|
1551
|
-
const id =
|
|
1552
|
-
return /* @__PURE__ */ (0,
|
|
1670
|
+
var FormItem = React25.forwardRef(({ className, ...props }, ref) => {
|
|
1671
|
+
const id = React25.useId();
|
|
1672
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { ref, className: cn("flex flex-col gap-2", className), ...props }) });
|
|
1553
1673
|
});
|
|
1554
1674
|
FormItem.displayName = "FormItem";
|
|
1555
|
-
var FormLabel =
|
|
1675
|
+
var FormLabel = React25.forwardRef(
|
|
1556
1676
|
({ className, ...props }, ref) => {
|
|
1557
1677
|
const { error, formItemId } = useFormField();
|
|
1558
|
-
return /* @__PURE__ */ (0,
|
|
1678
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1559
1679
|
Label,
|
|
1560
1680
|
{
|
|
1561
1681
|
ref,
|
|
@@ -1567,10 +1687,10 @@ var FormLabel = React23.forwardRef(
|
|
|
1567
1687
|
}
|
|
1568
1688
|
);
|
|
1569
1689
|
FormLabel.displayName = "FormLabel";
|
|
1570
|
-
var FormControl =
|
|
1690
|
+
var FormControl = React25.forwardRef((props, ref) => {
|
|
1571
1691
|
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
1572
|
-
return /* @__PURE__ */ (0,
|
|
1573
|
-
|
|
1692
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1693
|
+
import_radix_ui14.Slot.Root,
|
|
1574
1694
|
{
|
|
1575
1695
|
ref,
|
|
1576
1696
|
id: formItemId,
|
|
@@ -1581,10 +1701,10 @@ var FormControl = React23.forwardRef((props, ref) => {
|
|
|
1581
1701
|
);
|
|
1582
1702
|
});
|
|
1583
1703
|
FormControl.displayName = "FormControl";
|
|
1584
|
-
var FormDescription =
|
|
1704
|
+
var FormDescription = React25.forwardRef(
|
|
1585
1705
|
({ className, ...props }, ref) => {
|
|
1586
1706
|
const { formDescriptionId } = useFormField();
|
|
1587
|
-
return /* @__PURE__ */ (0,
|
|
1707
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1588
1708
|
"p",
|
|
1589
1709
|
{
|
|
1590
1710
|
ref,
|
|
@@ -1596,27 +1716,27 @@ var FormDescription = React23.forwardRef(
|
|
|
1596
1716
|
}
|
|
1597
1717
|
);
|
|
1598
1718
|
FormDescription.displayName = "FormDescription";
|
|
1599
|
-
var FormMessage =
|
|
1719
|
+
var FormMessage = React25.forwardRef(
|
|
1600
1720
|
({ className, children, ...props }, ref) => {
|
|
1601
1721
|
const { error, formMessageId } = useFormField();
|
|
1602
1722
|
const body = error ? String(error?.message ?? "") : children;
|
|
1603
1723
|
if (!body) {
|
|
1604
1724
|
return null;
|
|
1605
1725
|
}
|
|
1606
|
-
return /* @__PURE__ */ (0,
|
|
1726
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { ref, id: formMessageId, className: cn("text-sm text-destructive-foreground", className), ...props, children: body });
|
|
1607
1727
|
}
|
|
1608
1728
|
);
|
|
1609
1729
|
FormMessage.displayName = "FormMessage";
|
|
1610
1730
|
|
|
1611
1731
|
// src/components/Forms & Data Entry/InlineEdit.tsx
|
|
1612
|
-
var
|
|
1613
|
-
var
|
|
1732
|
+
var React27 = __toESM(require("react"), 1);
|
|
1733
|
+
var import_react14 = require("@phosphor-icons/react");
|
|
1614
1734
|
|
|
1615
1735
|
// src/components/Forms & Data Entry/MarkedText.tsx
|
|
1616
|
-
var
|
|
1617
|
-
var
|
|
1618
|
-
var
|
|
1619
|
-
var
|
|
1736
|
+
var React26 = __toESM(require("react"), 1);
|
|
1737
|
+
var import_react13 = require("@phosphor-icons/react");
|
|
1738
|
+
var import_radix_ui15 = require("radix-ui");
|
|
1739
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1620
1740
|
function splitMarks(text, marks) {
|
|
1621
1741
|
const valid = (marks ?? []).filter((m) => Number.isInteger(m.start) && Number.isInteger(m.end) && m.start >= 0 && m.end > m.start && m.end <= text.length).sort((a, b) => a.start - b.start);
|
|
1622
1742
|
const out = [];
|
|
@@ -1650,8 +1770,8 @@ function markLines(rects, origin, field) {
|
|
|
1650
1770
|
}
|
|
1651
1771
|
var sameLines = (a, b) => a.length === b.length && a.every((l, i) => Object.keys(l).every((k) => Math.abs(l[k] - b[i][k]) < 0.5));
|
|
1652
1772
|
function useMarkLines(anchorRef, markRef) {
|
|
1653
|
-
const [lines, setLines] =
|
|
1654
|
-
const measure =
|
|
1773
|
+
const [lines, setLines] = React26.useState([]);
|
|
1774
|
+
const measure = React26.useCallback(() => {
|
|
1655
1775
|
const anchor = anchorRef.current;
|
|
1656
1776
|
const mark = markRef.current;
|
|
1657
1777
|
if (!anchor || !mark) return;
|
|
@@ -1668,8 +1788,8 @@ function useMarkLines(anchorRef, markRef) {
|
|
|
1668
1788
|
const next = markLines([...mark.getClientRects()], a, field);
|
|
1669
1789
|
setLines((prev) => sameLines(prev, next) ? prev : next);
|
|
1670
1790
|
}, [anchorRef, markRef]);
|
|
1671
|
-
|
|
1672
|
-
|
|
1791
|
+
React26.useLayoutEffect(measure);
|
|
1792
|
+
React26.useLayoutEffect(() => {
|
|
1673
1793
|
const button = markRef.current?.closest("button");
|
|
1674
1794
|
if (!button) return;
|
|
1675
1795
|
const observer = new ResizeObserver(measure);
|
|
@@ -1691,13 +1811,13 @@ function remapMarks(saved, draft, marks) {
|
|
|
1691
1811
|
return marks.flatMap((m) => m.end <= before ? [m] : m.start >= editEnd ? [{ ...m, start: m.start + delta, end: m.end + delta }] : []);
|
|
1692
1812
|
}
|
|
1693
1813
|
function DraftMarks({ text, marks, layer, className, scrollLeft = 0, singleLine }) {
|
|
1694
|
-
const rootRef =
|
|
1695
|
-
const textRef =
|
|
1696
|
-
const [boxes, setBoxes] =
|
|
1697
|
-
|
|
1814
|
+
const rootRef = React26.useRef(null);
|
|
1815
|
+
const textRef = React26.useRef(null);
|
|
1816
|
+
const [boxes, setBoxes] = React26.useState([]);
|
|
1817
|
+
React26.useLayoutEffect(() => {
|
|
1698
1818
|
if (textRef.current) textRef.current.scrollLeft = scrollLeft;
|
|
1699
1819
|
}, [scrollLeft, text]);
|
|
1700
|
-
|
|
1820
|
+
React26.useLayoutEffect(() => {
|
|
1701
1821
|
const root = rootRef.current;
|
|
1702
1822
|
const mirror = textRef.current;
|
|
1703
1823
|
if (!root || !mirror) return;
|
|
@@ -1712,34 +1832,34 @@ function DraftMarks({ text, marks, layer, className, scrollLeft = 0, singleLine
|
|
|
1712
1832
|
);
|
|
1713
1833
|
setBoxes((prev) => prev.length === next.length && prev.every((p, i) => p.tone === next[i].tone && sameLines([p.box], [next[i].box])) ? prev : next);
|
|
1714
1834
|
});
|
|
1715
|
-
return /* @__PURE__ */ (0,
|
|
1716
|
-
/* @__PURE__ */ (0,
|
|
1717
|
-
(piece, i) => piece.mark ? /* @__PURE__ */ (0,
|
|
1835
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { ref: rootRef, "aria-hidden": true, "data-draft-marks": true, "data-layer": layer, className: "pointer-events-none absolute inset-0", children: [
|
|
1836
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { ref: textRef, className: cn(className, "absolute inset-0 overflow-hidden text-transparent"), children: splitMarks(text, marks).map(
|
|
1837
|
+
(piece, i) => piece.mark ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { "data-draft-mark": true, "data-tone": piece.mark.tone ?? "destructive", children: piece.text }, i) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: piece.text }, i)
|
|
1718
1838
|
) }),
|
|
1719
|
-
/* @__PURE__ */ (0,
|
|
1720
|
-
({ tone, box }, i) => layer === "behind" ? tone === "warning" && /* @__PURE__ */ (0,
|
|
1839
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "absolute inset-0", style: { clipPath: "inset(-4px 0)" }, children: boxes.map(
|
|
1840
|
+
({ tone, box }, i) => layer === "behind" ? tone === "warning" && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { "data-draft-box": true, className: "absolute rounded-xxs bg-warning-background-highlight", style: box }, i) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { "data-draft-box": true, className: cn("absolute rounded-xxs border-b-2", tone === "warning" ? "border-warning-foreground" : "border-destructive-foreground"), style: box }, i)
|
|
1721
1841
|
) })
|
|
1722
1842
|
] });
|
|
1723
1843
|
}
|
|
1724
1844
|
var closeOpenMarkCard = null;
|
|
1725
1845
|
function MarkedText({ mark, text, onApply, onDismiss }) {
|
|
1726
|
-
const ref =
|
|
1727
|
-
const [open, setOpen] =
|
|
1728
|
-
const close =
|
|
1729
|
-
|
|
1846
|
+
const ref = React26.useRef(null);
|
|
1847
|
+
const [open, setOpen] = React26.useState(false);
|
|
1848
|
+
const close = React26.useCallback(() => setOpen(false), []);
|
|
1849
|
+
React26.useEffect(
|
|
1730
1850
|
() => () => {
|
|
1731
1851
|
if (closeOpenMarkCard === close) closeOpenMarkCard = null;
|
|
1732
1852
|
},
|
|
1733
1853
|
[close]
|
|
1734
1854
|
);
|
|
1735
|
-
const anchorRef =
|
|
1736
|
-
const [hovered, setHovered] =
|
|
1855
|
+
const anchorRef = React26.useRef(null);
|
|
1856
|
+
const [hovered, setHovered] = React26.useState(false);
|
|
1737
1857
|
const lines = useMarkLines(anchorRef, ref);
|
|
1738
|
-
const layers = /* @__PURE__ */ (0,
|
|
1858
|
+
const layers = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { ref: anchorRef, "aria-hidden": true, className: "relative isolate", children: lines.map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { "data-mark-line": true, className: lineClasses(mark.tone, hovered), style: line }, i)) });
|
|
1739
1859
|
if (!onApply && !onDismiss) {
|
|
1740
|
-
return /* @__PURE__ */ (0,
|
|
1860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
|
|
1741
1861
|
layers,
|
|
1742
|
-
/* @__PURE__ */ (0,
|
|
1862
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { ref, "data-mark": true, "data-tone": mark.tone ?? "destructive", className: "relative", children: text })
|
|
1743
1863
|
] });
|
|
1744
1864
|
}
|
|
1745
1865
|
const suggestions = (mark.suggestions ?? []).slice(0, 3);
|
|
@@ -1755,9 +1875,9 @@ function MarkedText({ mark, text, onApply, onDismiss }) {
|
|
|
1755
1875
|
setOpen(next);
|
|
1756
1876
|
};
|
|
1757
1877
|
const stop = (event) => event.stopPropagation();
|
|
1758
|
-
return /* @__PURE__ */ (0,
|
|
1878
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_radix_ui15.Popover.Root, { open, onOpenChange: handleOpenChange, children: [
|
|
1759
1879
|
layers,
|
|
1760
|
-
/* @__PURE__ */ (0,
|
|
1880
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_radix_ui15.Popover.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1761
1881
|
"span",
|
|
1762
1882
|
{
|
|
1763
1883
|
ref,
|
|
@@ -1772,8 +1892,8 @@ function MarkedText({ mark, text, onApply, onDismiss }) {
|
|
|
1772
1892
|
children: text
|
|
1773
1893
|
}
|
|
1774
1894
|
) }),
|
|
1775
|
-
/* @__PURE__ */ (0,
|
|
1776
|
-
|
|
1895
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_radix_ui15.Popover.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
1896
|
+
import_radix_ui15.Popover.Content,
|
|
1777
1897
|
{
|
|
1778
1898
|
align: "start",
|
|
1779
1899
|
sideOffset: 8,
|
|
@@ -1785,25 +1905,25 @@ function MarkedText({ mark, text, onApply, onDismiss }) {
|
|
|
1785
1905
|
children: [
|
|
1786
1906
|
suggestions.length > 1 && onApply ? (
|
|
1787
1907
|
// Several possible fixes: each one is a choice, applied with a click, so there is no Apply button.
|
|
1788
|
-
/* @__PURE__ */ (0,
|
|
1789
|
-
/* @__PURE__ */ (0,
|
|
1908
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex flex-col gap-1", role: "group", "aria-label": "Choose a correction", children: suggestions.map((suggestion) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Button, { type: "button", size: "sm", variant: "ghost", className: "h-auto justify-start px-2 py-1 whitespace-normal", onClick: () => onApply(mark, suggestion), children: [
|
|
1909
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("s", { className: struck, children: text }),
|
|
1790
1910
|
" ",
|
|
1791
|
-
/* @__PURE__ */ (0,
|
|
1911
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "font-semibold text-accent-foreground", children: suggestion === "" ? "Remove" : suggestion })
|
|
1792
1912
|
] }, suggestion)) })
|
|
1793
|
-
) : suggestions.length > 0 && /* @__PURE__ */ (0,
|
|
1794
|
-
/* @__PURE__ */ (0,
|
|
1795
|
-
suggestions[0] !== "" && /* @__PURE__ */ (0,
|
|
1913
|
+
) : suggestions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("p", { className: "min-w-0 break-words", children: [
|
|
1914
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("s", { className: struck, children: text }),
|
|
1915
|
+
suggestions[0] !== "" && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
|
|
1796
1916
|
" ",
|
|
1797
|
-
/* @__PURE__ */ (0,
|
|
1917
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "font-semibold text-accent-foreground", children: suggestions[0] })
|
|
1798
1918
|
] })
|
|
1799
1919
|
] }),
|
|
1800
|
-
mark.message && /* @__PURE__ */ (0,
|
|
1801
|
-
/* @__PURE__ */ (0,
|
|
1802
|
-
onDismiss ? /* @__PURE__ */ (0,
|
|
1803
|
-
/* @__PURE__ */ (0,
|
|
1920
|
+
mark.message && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "min-w-0 break-words text-body-small text-surface-foreground", children: mark.message }),
|
|
1921
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: cn("flex items-center gap-3", warning ? "justify-end" : "justify-between"), children: [
|
|
1922
|
+
onDismiss ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Button, { type: "button", size: "sm", variant: "ghost", onClick: () => onDismiss(mark), children: [
|
|
1923
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react13.Trash, { size: 16, "aria-hidden": true }),
|
|
1804
1924
|
" Dismiss"
|
|
1805
|
-
] }) : /* @__PURE__ */ (0,
|
|
1806
|
-
onApply && suggestions.length === 1 && /* @__PURE__ */ (0,
|
|
1925
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", {}),
|
|
1926
|
+
onApply && suggestions.length === 1 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button, { type: "button", size: "sm", onClick: () => onApply(mark, suggestions[0]), children: suggestions[0] === "" ? "Remove" : "Apply" })
|
|
1807
1927
|
] })
|
|
1808
1928
|
]
|
|
1809
1929
|
}
|
|
@@ -1812,13 +1932,13 @@ function MarkedText({ mark, text, onApply, onDismiss }) {
|
|
|
1812
1932
|
}
|
|
1813
1933
|
|
|
1814
1934
|
// src/components/Forms & Data Entry/InlineEdit.tsx
|
|
1815
|
-
var
|
|
1935
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1816
1936
|
function limitsText(min, max) {
|
|
1817
1937
|
if (min !== void 0) return `${min} ${min === 1 ? "character" : "characters"} required`;
|
|
1818
1938
|
if (max !== void 0) return `Up to ${max} characters`;
|
|
1819
1939
|
return "";
|
|
1820
1940
|
}
|
|
1821
|
-
var InlineEdit =
|
|
1941
|
+
var InlineEdit = React27.forwardRef(
|
|
1822
1942
|
({
|
|
1823
1943
|
className,
|
|
1824
1944
|
textClassName,
|
|
@@ -1845,21 +1965,21 @@ var InlineEdit = React25.forwardRef(
|
|
|
1845
1965
|
"aria-label": ariaLabel,
|
|
1846
1966
|
...props
|
|
1847
1967
|
}, ref) => {
|
|
1848
|
-
const [internal, setInternal] =
|
|
1968
|
+
const [internal, setInternal] = React27.useState(defaultValue);
|
|
1849
1969
|
const value = valueProp ?? internal;
|
|
1850
|
-
const [editing, setEditing] =
|
|
1851
|
-
const [draft, setDraft] =
|
|
1852
|
-
const [error, setError] =
|
|
1853
|
-
const errorId =
|
|
1970
|
+
const [editing, setEditing] = React27.useState(false);
|
|
1971
|
+
const [draft, setDraft] = React27.useState(value);
|
|
1972
|
+
const [error, setError] = React27.useState(null);
|
|
1973
|
+
const errorId = React27.useId();
|
|
1854
1974
|
const limitsVisible = !!showLimits && (!!error || lengthOutOfRange(draft, minLength, maxLength));
|
|
1855
|
-
const fieldRef =
|
|
1856
|
-
const [scroll, setScroll] =
|
|
1857
|
-
const [draftMarks, setDraftMarks] =
|
|
1858
|
-
const readRef =
|
|
1859
|
-
const cancelled =
|
|
1860
|
-
const restoreFocus =
|
|
1861
|
-
const openedByProp =
|
|
1862
|
-
|
|
1975
|
+
const fieldRef = React27.useRef(null);
|
|
1976
|
+
const [scroll, setScroll] = React27.useState(0);
|
|
1977
|
+
const [draftMarks, setDraftMarks] = React27.useState([]);
|
|
1978
|
+
const readRef = React27.useRef(null);
|
|
1979
|
+
const cancelled = React27.useRef(false);
|
|
1980
|
+
const restoreFocus = React27.useRef(false);
|
|
1981
|
+
const openedByProp = React27.useRef(false);
|
|
1982
|
+
React27.useEffect(() => {
|
|
1863
1983
|
if (editing) {
|
|
1864
1984
|
fieldRef.current?.focus(openedByProp.current ? { preventScroll: true } : void 0);
|
|
1865
1985
|
openedByProp.current = false;
|
|
@@ -1884,7 +2004,7 @@ var InlineEdit = React25.forwardRef(
|
|
|
1884
2004
|
setEditing(true);
|
|
1885
2005
|
onEditingChange?.(true);
|
|
1886
2006
|
};
|
|
1887
|
-
|
|
2007
|
+
React27.useEffect(() => {
|
|
1888
2008
|
if (openRequested && !editing && !disabled) {
|
|
1889
2009
|
openedByProp.current = true;
|
|
1890
2010
|
start();
|
|
@@ -1912,15 +2032,15 @@ var InlineEdit = React25.forwardRef(
|
|
|
1912
2032
|
const question = variant === "question";
|
|
1913
2033
|
const draftMarksClass = cn("px-3 py-1", question ? "border-0 border-b-2 border-transparent" : "border border-transparent", multiline ? "whitespace-pre-wrap break-words" : "whitespace-pre", textClasses);
|
|
1914
2034
|
const fill = multiline || question;
|
|
1915
|
-
return /* @__PURE__ */ (0,
|
|
2035
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1916
2036
|
"div",
|
|
1917
2037
|
{
|
|
1918
2038
|
ref,
|
|
1919
2039
|
className: cn(fill ? "flex w-full min-w-0" : "inline-flex min-w-0 max-w-full", editing && (error || limitsVisible) && "flex-col gap-1.5", className),
|
|
1920
2040
|
...props,
|
|
1921
|
-
children: editing ? /* @__PURE__ */ (0,
|
|
1922
|
-
/* @__PURE__ */ (0,
|
|
1923
|
-
draftMarks.length > 0 && /* @__PURE__ */ (0,
|
|
2041
|
+
children: editing ? /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
2042
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: cn("relative flex w-full min-w-0", draftMarks.length > 0 && !question && "rounded-md bg-surface"), children: [
|
|
2043
|
+
draftMarks.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1924
2044
|
DraftMarks,
|
|
1925
2045
|
{
|
|
1926
2046
|
layer: "behind",
|
|
@@ -1931,7 +2051,7 @@ var InlineEdit = React25.forwardRef(
|
|
|
1931
2051
|
className: draftMarksClass
|
|
1932
2052
|
}
|
|
1933
2053
|
),
|
|
1934
|
-
|
|
2054
|
+
React27.createElement(multiline ? "textarea" : "input", {
|
|
1935
2055
|
ref: fieldRef,
|
|
1936
2056
|
value: draft,
|
|
1937
2057
|
maxLength,
|
|
@@ -1969,7 +2089,7 @@ var InlineEdit = React25.forwardRef(
|
|
|
1969
2089
|
if (!cancelled.current) finish(true, false);
|
|
1970
2090
|
}
|
|
1971
2091
|
}),
|
|
1972
|
-
draftMarks.length > 0 && /* @__PURE__ */ (0,
|
|
2092
|
+
draftMarks.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1973
2093
|
DraftMarks,
|
|
1974
2094
|
{
|
|
1975
2095
|
layer: "over",
|
|
@@ -1981,26 +2101,26 @@ var InlineEdit = React25.forwardRef(
|
|
|
1981
2101
|
}
|
|
1982
2102
|
)
|
|
1983
2103
|
] }),
|
|
1984
|
-
(error || limitsVisible) && /* @__PURE__ */ (0,
|
|
2104
|
+
(error || limitsVisible) && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
1985
2105
|
"p",
|
|
1986
2106
|
{
|
|
1987
2107
|
id: errorId,
|
|
1988
2108
|
role: error ? "alert" : void 0,
|
|
1989
2109
|
className: cn("flex items-start justify-between gap-2 px-3 text-ui-caption", error ? "text-destructive" : "text-secondary-muted-foreground"),
|
|
1990
2110
|
children: [
|
|
1991
|
-
/* @__PURE__ */ (0,
|
|
1992
|
-
error && /* @__PURE__ */ (0,
|
|
2111
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "flex items-start gap-2", children: [
|
|
2112
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react14.WarningCircle, { size: 16, "aria-hidden": true, className: "shrink-0" }),
|
|
1993
2113
|
limitsVisible ? limitsText(minLength, maxLength) : error,
|
|
1994
|
-
limitsVisible && error && /* @__PURE__ */ (0,
|
|
2114
|
+
limitsVisible && error && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "sr-only", children: error })
|
|
1995
2115
|
] }),
|
|
1996
|
-
limitsVisible && /* @__PURE__ */ (0,
|
|
2116
|
+
limitsVisible && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { "aria-hidden": true, className: "shrink-0 tabular-nums", children: [
|
|
1997
2117
|
draft.length,
|
|
1998
2118
|
maxLength !== void 0 && `/${maxLength}`
|
|
1999
2119
|
] })
|
|
2000
2120
|
]
|
|
2001
2121
|
}
|
|
2002
2122
|
)
|
|
2003
|
-
] }) : /* @__PURE__ */ (0,
|
|
2123
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
2004
2124
|
"button",
|
|
2005
2125
|
{
|
|
2006
2126
|
ref: readRef,
|
|
@@ -2023,11 +2143,11 @@ var InlineEdit = React25.forwardRef(
|
|
|
2023
2143
|
textClasses
|
|
2024
2144
|
),
|
|
2025
2145
|
children: [
|
|
2026
|
-
/* @__PURE__ */ (0,
|
|
2027
|
-
(piece) => piece.mark ? /* @__PURE__ */ (0,
|
|
2146
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: cn("min-w-0", multiline ? "whitespace-pre-wrap" : "truncate", fill && "flex-1", !value && placeholderTone === "muted" && "text-muted-foreground"), children: value ? splitMarks(value, marks).map(
|
|
2147
|
+
(piece) => piece.mark ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(MarkedText, { mark: piece.mark, text: piece.text, onApply: onMarkApply, onDismiss: onMarkDismiss }, `${piece.mark.start}:${piece.text}`) : piece.text
|
|
2028
2148
|
) : placeholder }),
|
|
2029
|
-
!fill && /* @__PURE__ */ (0,
|
|
2030
|
-
|
|
2149
|
+
!fill && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2150
|
+
import_react14.PencilSimple,
|
|
2031
2151
|
{
|
|
2032
2152
|
size: 16,
|
|
2033
2153
|
"aria-hidden": true,
|
|
@@ -2044,17 +2164,17 @@ var InlineEdit = React25.forwardRef(
|
|
|
2044
2164
|
InlineEdit.displayName = "InlineEdit";
|
|
2045
2165
|
|
|
2046
2166
|
// src/components/Forms & Data Entry/Input.tsx
|
|
2047
|
-
var
|
|
2048
|
-
var
|
|
2167
|
+
var React28 = __toESM(require("react"), 1);
|
|
2168
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2049
2169
|
var inputClasses = (status, className) => cn(
|
|
2050
2170
|
"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",
|
|
2051
2171
|
fieldSurfaceClasses(status),
|
|
2052
2172
|
className
|
|
2053
2173
|
);
|
|
2054
|
-
var Input =
|
|
2174
|
+
var Input = React28.forwardRef(
|
|
2055
2175
|
({ className, status = "default", label, description, message, id, ...props }, ref) => {
|
|
2056
2176
|
if (label == null && description == null && message == null) {
|
|
2057
|
-
return /* @__PURE__ */ (0,
|
|
2177
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2058
2178
|
"input",
|
|
2059
2179
|
{
|
|
2060
2180
|
ref,
|
|
@@ -2065,16 +2185,16 @@ var Input = React26.forwardRef(
|
|
|
2065
2185
|
}
|
|
2066
2186
|
);
|
|
2067
2187
|
}
|
|
2068
|
-
return /* @__PURE__ */ (0,
|
|
2188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Field, { label, description, message, status, id, children: (control) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("input", { ref, className: inputClasses(status, className), ...control, ...props }) });
|
|
2069
2189
|
}
|
|
2070
2190
|
);
|
|
2071
2191
|
Input.displayName = "Input";
|
|
2072
2192
|
|
|
2073
2193
|
// src/components/Forms & Data Entry/InputWithAction.tsx
|
|
2074
|
-
var
|
|
2075
|
-
var
|
|
2076
|
-
var InputWithAction =
|
|
2077
|
-
({ className, actionLabel, onAction, tags, status = "default", label, description, message, id, disabled, placeholder, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2194
|
+
var React29 = __toESM(require("react"), 1);
|
|
2195
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2196
|
+
var InputWithAction = React29.forwardRef(
|
|
2197
|
+
({ className, actionLabel, onAction, tags, status = "default", label, description, message, id, disabled, placeholder, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Field, { label, description, message, status, id, children: (control) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
2078
2198
|
"div",
|
|
2079
2199
|
{
|
|
2080
2200
|
className: cn(
|
|
@@ -2086,8 +2206,8 @@ var InputWithAction = React27.forwardRef(
|
|
|
2086
2206
|
className
|
|
2087
2207
|
),
|
|
2088
2208
|
children: [
|
|
2089
|
-
tags && /* @__PURE__ */ (0,
|
|
2090
|
-
/* @__PURE__ */ (0,
|
|
2209
|
+
tags && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex shrink-0 items-center gap-1", children: tags }),
|
|
2210
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2091
2211
|
"input",
|
|
2092
2212
|
{
|
|
2093
2213
|
ref,
|
|
@@ -2098,7 +2218,7 @@ var InputWithAction = React27.forwardRef(
|
|
|
2098
2218
|
...props
|
|
2099
2219
|
}
|
|
2100
2220
|
),
|
|
2101
|
-
/* @__PURE__ */ (0,
|
|
2221
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Button, { type: "button", variant: "subtle", size: "sm", disabled, onClick: onAction, children: actionLabel })
|
|
2102
2222
|
]
|
|
2103
2223
|
}
|
|
2104
2224
|
) })
|
|
@@ -2106,10 +2226,10 @@ var InputWithAction = React27.forwardRef(
|
|
|
2106
2226
|
InputWithAction.displayName = "InputWithAction";
|
|
2107
2227
|
|
|
2108
2228
|
// src/components/Forms & Data Entry/NumberInput.tsx
|
|
2109
|
-
var
|
|
2110
|
-
var
|
|
2111
|
-
var
|
|
2112
|
-
var NumberInput =
|
|
2229
|
+
var React30 = __toESM(require("react"), 1);
|
|
2230
|
+
var import_react15 = require("@phosphor-icons/react");
|
|
2231
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2232
|
+
var NumberInput = React30.forwardRef(
|
|
2113
2233
|
({
|
|
2114
2234
|
className,
|
|
2115
2235
|
value,
|
|
@@ -2127,7 +2247,7 @@ var NumberInput = React28.forwardRef(
|
|
|
2127
2247
|
disabled,
|
|
2128
2248
|
...props
|
|
2129
2249
|
}, ref) => {
|
|
2130
|
-
const [internal, setInternal] =
|
|
2250
|
+
const [internal, setInternal] = React30.useState(defaultValue);
|
|
2131
2251
|
const current = value ?? internal;
|
|
2132
2252
|
const clamp = (next) => Math.min(max, Math.max(min, next));
|
|
2133
2253
|
const commit = (next) => {
|
|
@@ -2135,7 +2255,7 @@ var NumberInput = React28.forwardRef(
|
|
|
2135
2255
|
setInternal(clamped);
|
|
2136
2256
|
onValueChange?.(clamped);
|
|
2137
2257
|
};
|
|
2138
|
-
return /* @__PURE__ */ (0,
|
|
2258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Field, { label, description, message, status, id, className: "w-50", children: (control) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
2139
2259
|
"div",
|
|
2140
2260
|
{
|
|
2141
2261
|
className: cn(
|
|
@@ -2146,7 +2266,7 @@ var NumberInput = React28.forwardRef(
|
|
|
2146
2266
|
className
|
|
2147
2267
|
),
|
|
2148
2268
|
children: [
|
|
2149
|
-
/* @__PURE__ */ (0,
|
|
2269
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2150
2270
|
Button,
|
|
2151
2271
|
{
|
|
2152
2272
|
type: "button",
|
|
@@ -2155,11 +2275,11 @@ var NumberInput = React28.forwardRef(
|
|
|
2155
2275
|
"aria-label": "Decrease",
|
|
2156
2276
|
disabled: disabled || current <= min,
|
|
2157
2277
|
onClick: () => commit(current - step),
|
|
2158
|
-
children: /* @__PURE__ */ (0,
|
|
2278
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react15.Minus, { size: 16, "aria-hidden": true })
|
|
2159
2279
|
}
|
|
2160
2280
|
),
|
|
2161
|
-
/* @__PURE__ */ (0,
|
|
2162
|
-
/* @__PURE__ */ (0,
|
|
2281
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex items-center justify-center gap-1 text-center", children: [
|
|
2282
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2163
2283
|
"input",
|
|
2164
2284
|
{
|
|
2165
2285
|
ref,
|
|
@@ -2189,9 +2309,9 @@ var NumberInput = React28.forwardRef(
|
|
|
2189
2309
|
...props
|
|
2190
2310
|
}
|
|
2191
2311
|
),
|
|
2192
|
-
unit && /* @__PURE__ */ (0,
|
|
2312
|
+
unit && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-body-small text-secondary-muted-foreground", children: unit })
|
|
2193
2313
|
] }),
|
|
2194
|
-
/* @__PURE__ */ (0,
|
|
2314
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2195
2315
|
Button,
|
|
2196
2316
|
{
|
|
2197
2317
|
type: "button",
|
|
@@ -2200,7 +2320,7 @@ var NumberInput = React28.forwardRef(
|
|
|
2200
2320
|
"aria-label": "Increase",
|
|
2201
2321
|
disabled: disabled || current >= max,
|
|
2202
2322
|
onClick: () => commit(current + step),
|
|
2203
|
-
children: /* @__PURE__ */ (0,
|
|
2323
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react15.Plus, { size: 16, "aria-hidden": true })
|
|
2204
2324
|
}
|
|
2205
2325
|
)
|
|
2206
2326
|
]
|
|
@@ -2211,14 +2331,14 @@ var NumberInput = React28.forwardRef(
|
|
|
2211
2331
|
NumberInput.displayName = "NumberInput";
|
|
2212
2332
|
|
|
2213
2333
|
// src/components/Forms & Data Entry/SearchBar.tsx
|
|
2214
|
-
var
|
|
2215
|
-
var
|
|
2216
|
-
var
|
|
2217
|
-
var SearchBar =
|
|
2334
|
+
var React31 = __toESM(require("react"), 1);
|
|
2335
|
+
var import_react16 = require("@phosphor-icons/react");
|
|
2336
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2337
|
+
var SearchBar = React31.forwardRef(
|
|
2218
2338
|
({ className, value, defaultValue, onChange, onClear, clearLabel = "Clear search", disabled, ...props }, ref) => {
|
|
2219
|
-
const innerRef =
|
|
2220
|
-
|
|
2221
|
-
const [uncontrolled, setUncontrolled] =
|
|
2339
|
+
const innerRef = React31.useRef(null);
|
|
2340
|
+
React31.useImperativeHandle(ref, () => innerRef.current);
|
|
2341
|
+
const [uncontrolled, setUncontrolled] = React31.useState(String(defaultValue ?? ""));
|
|
2222
2342
|
const current = value !== void 0 ? String(value) : uncontrolled;
|
|
2223
2343
|
const clear = () => {
|
|
2224
2344
|
const input = innerRef.current;
|
|
@@ -2230,7 +2350,7 @@ var SearchBar = React29.forwardRef(
|
|
|
2230
2350
|
}
|
|
2231
2351
|
onClear?.();
|
|
2232
2352
|
};
|
|
2233
|
-
return /* @__PURE__ */ (0,
|
|
2353
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
2234
2354
|
"div",
|
|
2235
2355
|
{
|
|
2236
2356
|
className: cn(
|
|
@@ -2241,8 +2361,8 @@ var SearchBar = React29.forwardRef(
|
|
|
2241
2361
|
className
|
|
2242
2362
|
),
|
|
2243
2363
|
children: [
|
|
2244
|
-
/* @__PURE__ */ (0,
|
|
2245
|
-
/* @__PURE__ */ (0,
|
|
2364
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react16.MagnifyingGlass, { size: 16, "aria-hidden": true, className: "shrink-0 text-surface-foreground" }),
|
|
2365
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2246
2366
|
"input",
|
|
2247
2367
|
{
|
|
2248
2368
|
ref: innerRef,
|
|
@@ -2259,14 +2379,14 @@ var SearchBar = React29.forwardRef(
|
|
|
2259
2379
|
...props
|
|
2260
2380
|
}
|
|
2261
2381
|
),
|
|
2262
|
-
current !== "" && !disabled && /* @__PURE__ */ (0,
|
|
2382
|
+
current !== "" && !disabled && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2263
2383
|
"button",
|
|
2264
2384
|
{
|
|
2265
2385
|
type: "button",
|
|
2266
2386
|
"aria-label": clearLabel,
|
|
2267
2387
|
onClick: clear,
|
|
2268
2388
|
className: "inline-flex size-4 shrink-0 items-center justify-center rounded-xs text-surface-foreground",
|
|
2269
|
-
children: /* @__PURE__ */ (0,
|
|
2389
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react16.X, { size: 16, "aria-hidden": true })
|
|
2270
2390
|
}
|
|
2271
2391
|
)
|
|
2272
2392
|
]
|
|
@@ -2277,17 +2397,17 @@ var SearchBar = React29.forwardRef(
|
|
|
2277
2397
|
SearchBar.displayName = "SearchBar";
|
|
2278
2398
|
|
|
2279
2399
|
// src/components/Forms & Data Entry/Select.tsx
|
|
2280
|
-
var
|
|
2281
|
-
var
|
|
2282
|
-
var
|
|
2283
|
-
var
|
|
2284
|
-
var Select =
|
|
2285
|
-
var SelectValue =
|
|
2286
|
-
var SelectGroup =
|
|
2287
|
-
var CheckIcon = () => /* @__PURE__ */ (0,
|
|
2288
|
-
var SelectTrigger =
|
|
2289
|
-
({ className, children, icon, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2290
|
-
|
|
2400
|
+
var React32 = __toESM(require("react"), 1);
|
|
2401
|
+
var import_react17 = require("@phosphor-icons/react");
|
|
2402
|
+
var import_radix_ui16 = require("radix-ui");
|
|
2403
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2404
|
+
var Select = import_radix_ui16.Select.Root;
|
|
2405
|
+
var SelectValue = import_radix_ui16.Select.Value;
|
|
2406
|
+
var SelectGroup = import_radix_ui16.Select.Group;
|
|
2407
|
+
var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("svg", { width: "10", height: "8", viewBox: "0 0 10 8", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("path", { d: "M1 4L3.5 6.5L9 1", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
2408
|
+
var SelectTrigger = React32.forwardRef(
|
|
2409
|
+
({ className, children, icon, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
2410
|
+
import_radix_ui16.Select.Trigger,
|
|
2291
2411
|
{
|
|
2292
2412
|
ref,
|
|
2293
2413
|
className: cn(
|
|
@@ -2299,17 +2419,17 @@ var SelectTrigger = React30.forwardRef(
|
|
|
2299
2419
|
),
|
|
2300
2420
|
...props,
|
|
2301
2421
|
children: [
|
|
2302
|
-
icon && /* @__PURE__ */ (0,
|
|
2303
|
-
/* @__PURE__ */ (0,
|
|
2304
|
-
/* @__PURE__ */ (0,
|
|
2422
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "flex shrink-0 text-surface-foreground", children: icon }),
|
|
2423
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "min-w-0 flex-1 truncate", children }),
|
|
2424
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_radix_ui16.Select.Icon, { className: "shrink-0 text-surface-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react17.CaretDown, { size: 16, "aria-hidden": true }) })
|
|
2305
2425
|
]
|
|
2306
2426
|
}
|
|
2307
2427
|
)
|
|
2308
2428
|
);
|
|
2309
2429
|
SelectTrigger.displayName = "SelectTrigger";
|
|
2310
|
-
var SelectContent =
|
|
2311
|
-
({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ (0,
|
|
2312
|
-
|
|
2430
|
+
var SelectContent = React32.forwardRef(
|
|
2431
|
+
({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_radix_ui16.Select.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2432
|
+
import_radix_ui16.Select.Content,
|
|
2313
2433
|
{
|
|
2314
2434
|
ref,
|
|
2315
2435
|
position,
|
|
@@ -2322,14 +2442,14 @@ var SelectContent = React30.forwardRef(
|
|
|
2322
2442
|
className
|
|
2323
2443
|
),
|
|
2324
2444
|
...props,
|
|
2325
|
-
children: /* @__PURE__ */ (0,
|
|
2445
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_radix_ui16.Select.Viewport, { className: "p-1", children })
|
|
2326
2446
|
}
|
|
2327
2447
|
) })
|
|
2328
2448
|
);
|
|
2329
2449
|
SelectContent.displayName = "SelectContent";
|
|
2330
|
-
var SelectItem =
|
|
2331
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2332
|
-
|
|
2450
|
+
var SelectItem = React32.forwardRef(
|
|
2451
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
2452
|
+
import_radix_ui16.Select.Item,
|
|
2333
2453
|
{
|
|
2334
2454
|
ref,
|
|
2335
2455
|
className: cn(
|
|
@@ -2339,8 +2459,8 @@ var SelectItem = React30.forwardRef(
|
|
|
2339
2459
|
),
|
|
2340
2460
|
...props,
|
|
2341
2461
|
children: [
|
|
2342
|
-
/* @__PURE__ */ (0,
|
|
2343
|
-
/* @__PURE__ */ (0,
|
|
2462
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "absolute left-2 flex h-4 w-4 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_radix_ui16.Select.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CheckIcon, {}) }) }),
|
|
2463
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_radix_ui16.Select.ItemText, { children })
|
|
2344
2464
|
]
|
|
2345
2465
|
}
|
|
2346
2466
|
)
|
|
@@ -2348,10 +2468,10 @@ var SelectItem = React30.forwardRef(
|
|
|
2348
2468
|
SelectItem.displayName = "SelectItem";
|
|
2349
2469
|
|
|
2350
2470
|
// src/components/Forms & Data Entry/Slider.tsx
|
|
2351
|
-
var
|
|
2352
|
-
var
|
|
2353
|
-
var
|
|
2354
|
-
var Slider =
|
|
2471
|
+
var React33 = __toESM(require("react"), 1);
|
|
2472
|
+
var import_radix_ui17 = require("radix-ui");
|
|
2473
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2474
|
+
var Slider = React33.forwardRef(
|
|
2355
2475
|
({
|
|
2356
2476
|
className,
|
|
2357
2477
|
value,
|
|
@@ -2366,16 +2486,16 @@ var Slider = React31.forwardRef(
|
|
|
2366
2486
|
"aria-labelledby": ariaLabelledBy,
|
|
2367
2487
|
...props
|
|
2368
2488
|
}, ref) => {
|
|
2369
|
-
const [internal, setInternal] =
|
|
2489
|
+
const [internal, setInternal] = React33.useState(defaultValue ?? [min]);
|
|
2370
2490
|
const thumbValues = value ?? internal;
|
|
2371
2491
|
const hasHeader = label != null || showRange;
|
|
2372
|
-
return /* @__PURE__ */ (0,
|
|
2373
|
-
hasHeader && /* @__PURE__ */ (0,
|
|
2374
|
-
label != null ? /* @__PURE__ */ (0,
|
|
2375
|
-
/* @__PURE__ */ (0,
|
|
2492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: cn("flex w-full flex-col gap-2", className), children: [
|
|
2493
|
+
hasHeader && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center justify-between text-secondary-muted-foreground", children: [
|
|
2494
|
+
label != null ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-ui-label text-surface-foreground", children: label }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-ui-caption", children: min }),
|
|
2495
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-body-small", children: max })
|
|
2376
2496
|
] }),
|
|
2377
|
-
/* @__PURE__ */ (0,
|
|
2378
|
-
|
|
2497
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
2498
|
+
import_radix_ui17.Slider.Root,
|
|
2379
2499
|
{
|
|
2380
2500
|
ref,
|
|
2381
2501
|
value,
|
|
@@ -2389,19 +2509,19 @@ var Slider = React31.forwardRef(
|
|
|
2389
2509
|
className: "relative flex h-4 w-full touch-none items-center select-none",
|
|
2390
2510
|
...props,
|
|
2391
2511
|
children: [
|
|
2392
|
-
/* @__PURE__ */ (0,
|
|
2512
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_radix_ui17.Slider.Track, { className: "relative h-1 w-full grow overflow-hidden rounded-xxs bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_radix_ui17.Slider.Range, { className: "absolute h-full bg-input-accent" }) }),
|
|
2393
2513
|
thumbValues.map((thumbValue, index) => (
|
|
2394
2514
|
// The accessible name belongs on each individual thumb (the actual
|
|
2395
2515
|
// role="slider" element) — Root is just a group container. With
|
|
2396
2516
|
// more than one thumb this applies the same label to each; give a
|
|
2397
2517
|
// range slider distinct per-thumb labels via aria-labelledby instead.
|
|
2398
|
-
/* @__PURE__ */ (0,
|
|
2399
|
-
|
|
2518
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2519
|
+
import_radix_ui17.Slider.Thumb,
|
|
2400
2520
|
{
|
|
2401
2521
|
"aria-label": ariaLabel,
|
|
2402
2522
|
"aria-labelledby": ariaLabelledBy,
|
|
2403
2523
|
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",
|
|
2404
|
-
children: showValue && /* @__PURE__ */ (0,
|
|
2524
|
+
children: showValue && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2405
2525
|
"span",
|
|
2406
2526
|
{
|
|
2407
2527
|
"aria-hidden": "true",
|
|
@@ -2425,17 +2545,17 @@ var Slider = React31.forwardRef(
|
|
|
2425
2545
|
Slider.displayName = "Slider";
|
|
2426
2546
|
|
|
2427
2547
|
// src/components/Forms & Data Entry/Textarea.tsx
|
|
2428
|
-
var
|
|
2429
|
-
var
|
|
2548
|
+
var React34 = __toESM(require("react"), 1);
|
|
2549
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2430
2550
|
var textareaClasses = (status, className) => cn(
|
|
2431
2551
|
"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",
|
|
2432
2552
|
fieldSurfaceClasses(status),
|
|
2433
2553
|
className
|
|
2434
2554
|
);
|
|
2435
|
-
var Textarea =
|
|
2555
|
+
var Textarea = React34.forwardRef(
|
|
2436
2556
|
({ className, status = "default", label, description, message, id, ...props }, ref) => {
|
|
2437
2557
|
if (label == null && description == null && message == null) {
|
|
2438
|
-
return /* @__PURE__ */ (0,
|
|
2558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2439
2559
|
"textarea",
|
|
2440
2560
|
{
|
|
2441
2561
|
ref,
|
|
@@ -2446,27 +2566,27 @@ var Textarea = React32.forwardRef(
|
|
|
2446
2566
|
}
|
|
2447
2567
|
);
|
|
2448
2568
|
}
|
|
2449
|
-
return /* @__PURE__ */ (0,
|
|
2569
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Field, { label, description, message, status, id, children: (control) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("textarea", { ref, className: textareaClasses(status, className), ...control, ...props }) });
|
|
2450
2570
|
}
|
|
2451
2571
|
);
|
|
2452
2572
|
Textarea.displayName = "Textarea";
|
|
2453
2573
|
|
|
2454
2574
|
// src/components/Navigation/Stepper.tsx
|
|
2455
|
-
var
|
|
2456
|
-
var
|
|
2457
|
-
var
|
|
2575
|
+
var React35 = __toESM(require("react"), 1);
|
|
2576
|
+
var import_react18 = require("@phosphor-icons/react");
|
|
2577
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2458
2578
|
var STATUS_TEXT = { "not-completed": "not completed", completed: "completed", error: "error" };
|
|
2459
2579
|
function StepIndicator({ status, selected }) {
|
|
2460
2580
|
const props = { size: 24, "aria-hidden": true, className: "shrink-0" };
|
|
2461
|
-
if (status === "completed") return /* @__PURE__ */ (0,
|
|
2462
|
-
if (status === "error") return /* @__PURE__ */ (0,
|
|
2463
|
-
if (selected) return /* @__PURE__ */ (0,
|
|
2464
|
-
return /* @__PURE__ */ (0,
|
|
2581
|
+
if (status === "completed") return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react18.CheckCircle, { ...props, weight: selected ? "fill" : "regular", className: "shrink-0 text-success-foreground" });
|
|
2582
|
+
if (status === "error") return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react18.WarningCircle, { ...props, weight: selected ? "fill" : "regular", className: "shrink-0 text-destructive-foreground" });
|
|
2583
|
+
if (selected) return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react18.RadioButton, { ...props, weight: "fill", className: "shrink-0 text-accent-foreground" });
|
|
2584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react18.Circle, { ...props, className: "shrink-0 text-input-muted" });
|
|
2465
2585
|
}
|
|
2466
|
-
var Step =
|
|
2586
|
+
var Step = React35.forwardRef(
|
|
2467
2587
|
({ label, status = "not-completed", selected = false, orientation = "horizontal", className, ...props }, ref) => {
|
|
2468
2588
|
const vertical = orientation === "vertical";
|
|
2469
|
-
return /* @__PURE__ */ (0,
|
|
2589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
2470
2590
|
"div",
|
|
2471
2591
|
{
|
|
2472
2592
|
ref,
|
|
@@ -2478,8 +2598,8 @@ var Step = React33.forwardRef(
|
|
|
2478
2598
|
),
|
|
2479
2599
|
...props,
|
|
2480
2600
|
children: [
|
|
2481
|
-
!vertical && /* @__PURE__ */ (0,
|
|
2482
|
-
/* @__PURE__ */ (0,
|
|
2601
|
+
!vertical && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(StepIndicator, { status, selected }),
|
|
2602
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
2483
2603
|
"span",
|
|
2484
2604
|
{
|
|
2485
2605
|
className: cn(
|
|
@@ -2488,48 +2608,48 @@ var Step = React33.forwardRef(
|
|
|
2488
2608
|
),
|
|
2489
2609
|
children: [
|
|
2490
2610
|
label,
|
|
2491
|
-
status !== "not-completed" && /* @__PURE__ */ (0,
|
|
2611
|
+
status !== "not-completed" && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "sr-only", children: `, ${STATUS_TEXT[status]}` })
|
|
2492
2612
|
]
|
|
2493
2613
|
}
|
|
2494
2614
|
),
|
|
2495
|
-
vertical && /* @__PURE__ */ (0,
|
|
2615
|
+
vertical && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(StepIndicator, { status, selected })
|
|
2496
2616
|
]
|
|
2497
2617
|
}
|
|
2498
2618
|
);
|
|
2499
2619
|
}
|
|
2500
2620
|
);
|
|
2501
2621
|
Step.displayName = "Step";
|
|
2502
|
-
var StepPath =
|
|
2622
|
+
var StepPath = React35.forwardRef(
|
|
2503
2623
|
({ orientation = "horizontal", completed = false, className, ...props }, ref) => {
|
|
2504
2624
|
const vertical = orientation === "vertical";
|
|
2505
|
-
return /* @__PURE__ */ (0,
|
|
2625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { ref, "aria-hidden": true, className: cn("flex items-center justify-center", vertical ? "h-8 w-8 flex-col" : "h-8 flex-1", className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: cn(vertical ? "w-px flex-1" : "h-px flex-1", completed ? "bg-success-foreground" : "bg-border") }) });
|
|
2506
2626
|
}
|
|
2507
2627
|
);
|
|
2508
2628
|
StepPath.displayName = "StepPath";
|
|
2509
|
-
var Stepper =
|
|
2629
|
+
var Stepper = React35.forwardRef(({ steps, current, orientation = "horizontal", className, ...props }, ref) => {
|
|
2510
2630
|
const vertical = orientation === "vertical";
|
|
2511
2631
|
const statusOf = (i, step) => step.error ? "error" : i < current ? "completed" : "not-completed";
|
|
2512
|
-
return /* @__PURE__ */ (0,
|
|
2632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("ol", { ref, className: cn("flex", vertical ? "flex-col items-end" : "w-full items-start", className), ...props, children: steps.map((step, i) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(React35.Fragment, { children: [
|
|
2513
2633
|
i > 0 && // Horizontal: the path runs from one indicator's edge to the next (it reaches 56px into each 136px step), level with the indicators' centre.
|
|
2514
|
-
/* @__PURE__ */ (0,
|
|
2515
|
-
/* @__PURE__ */ (0,
|
|
2634
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("li", { "aria-hidden": true, className: cn("flex", vertical ? "pr-1" : "-mx-14 flex-1 pt-1.5"), children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(StepPath, { orientation, completed: i < current, className: vertical ? void 0 : "h-6" }) }),
|
|
2635
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("li", { "aria-current": i === current ? "step" : void 0, className: "flex", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Step, { label: step.label, status: statusOf(i, step), selected: i === current, orientation }) })
|
|
2516
2636
|
] }, i)) });
|
|
2517
2637
|
});
|
|
2518
2638
|
Stepper.displayName = "Stepper";
|
|
2519
2639
|
|
|
2520
2640
|
// src/components/Navigation/NavRail.tsx
|
|
2521
|
-
var
|
|
2522
|
-
var
|
|
2523
|
-
var NavRailContext =
|
|
2524
|
-
var NavRail =
|
|
2525
|
-
header && /* @__PURE__ */ (0,
|
|
2526
|
-
/* @__PURE__ */ (0,
|
|
2527
|
-
footer && /* @__PURE__ */ (0,
|
|
2641
|
+
var React36 = __toESM(require("react"), 1);
|
|
2642
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2643
|
+
var NavRailContext = React36.createContext("secondary");
|
|
2644
|
+
var NavRail = React36.forwardRef(({ className, children, footer, header, hierarchy = "secondary", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(NavRailContext.Provider, { value: hierarchy, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("nav", { ref, className: cn("flex h-full shrink-0 flex-col border-r border-border", hierarchy === "primary" ? "w-18" : "w-16", className), ...props, children: [
|
|
2645
|
+
header && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "flex h-16 shrink-0 items-center justify-center border-b border-border", children: header }),
|
|
2646
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("ul", { className: "flex flex-col items-center gap-2 px-2 pt-3", children }),
|
|
2647
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: cn("mt-auto flex flex-col items-center px-2", hierarchy === "primary" ? "gap-3 py-4" : "pb-3"), children: footer })
|
|
2528
2648
|
] }) }));
|
|
2529
2649
|
NavRail.displayName = "NavRail";
|
|
2530
|
-
var NavRailItem =
|
|
2531
|
-
const primary =
|
|
2532
|
-
return /* @__PURE__ */ (0,
|
|
2650
|
+
var NavRailItem = React36.forwardRef(({ className, icon, label, selected = false, type = "button", ...props }, ref) => {
|
|
2651
|
+
const primary = React36.useContext(NavRailContext) === "primary";
|
|
2652
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("li", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
2533
2653
|
"button",
|
|
2534
2654
|
{
|
|
2535
2655
|
ref,
|
|
@@ -2545,7 +2665,7 @@ var NavRailItem = React34.forwardRef(({ className, icon, label, selected = false
|
|
|
2545
2665
|
),
|
|
2546
2666
|
...props,
|
|
2547
2667
|
children: [
|
|
2548
|
-
/* @__PURE__ */ (0,
|
|
2668
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2549
2669
|
"span",
|
|
2550
2670
|
{
|
|
2551
2671
|
"aria-hidden": "true",
|
|
@@ -2559,7 +2679,7 @@ var NavRailItem = React34.forwardRef(({ className, icon, label, selected = false
|
|
|
2559
2679
|
children: icon
|
|
2560
2680
|
}
|
|
2561
2681
|
),
|
|
2562
|
-
/* @__PURE__ */ (0,
|
|
2682
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { children: label })
|
|
2563
2683
|
]
|
|
2564
2684
|
}
|
|
2565
2685
|
) });
|
|
@@ -2567,29 +2687,29 @@ var NavRailItem = React34.forwardRef(({ className, icon, label, selected = false
|
|
|
2567
2687
|
NavRailItem.displayName = "NavRailItem";
|
|
2568
2688
|
|
|
2569
2689
|
// src/components/Navigation/ProjectSidebar.tsx
|
|
2570
|
-
var
|
|
2571
|
-
var
|
|
2572
|
-
var ProjectSidebar =
|
|
2573
|
-
const labelId =
|
|
2574
|
-
return /* @__PURE__ */ (0,
|
|
2575
|
-
/* @__PURE__ */ (0,
|
|
2576
|
-
/* @__PURE__ */ (0,
|
|
2690
|
+
var React37 = __toESM(require("react"), 1);
|
|
2691
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2692
|
+
var ProjectSidebar = React37.forwardRef(({ className, children, project, action, label, ...props }, ref) => {
|
|
2693
|
+
const labelId = React37.useId();
|
|
2694
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("nav", { ref, className: cn("flex h-full w-60 shrink-0 flex-col border-r border-border bg-surface", className), ...props, children: [
|
|
2695
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex h-16 shrink-0 items-center gap-2 border-b border-border px-3", children: [
|
|
2696
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "min-w-0 flex-1 truncate text-ui-label text-surface-foreground", children: project }),
|
|
2577
2697
|
action
|
|
2578
2698
|
] }),
|
|
2579
|
-
/* @__PURE__ */ (0,
|
|
2580
|
-
label && /* @__PURE__ */ (0,
|
|
2581
|
-
/* @__PURE__ */ (0,
|
|
2699
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex min-h-0 flex-col gap-2 overflow-y-auto p-3", children: [
|
|
2700
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { id: labelId, className: "px-2 pt-1 text-ui-caption text-secondary-muted-foreground", children: label }),
|
|
2701
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("ul", { className: "flex flex-col gap-2", "aria-labelledby": label ? labelId : void 0, children })
|
|
2582
2702
|
] })
|
|
2583
2703
|
] });
|
|
2584
2704
|
});
|
|
2585
2705
|
ProjectSidebar.displayName = "ProjectSidebar";
|
|
2586
2706
|
|
|
2587
2707
|
// src/components/Navigation/SidebarNavItem.tsx
|
|
2588
|
-
var
|
|
2589
|
-
var
|
|
2590
|
-
var
|
|
2591
|
-
var SidebarNavItem =
|
|
2592
|
-
({ className, icon, label, selected = false, expandable = false, expanded = false, type = "button", ...props }, ref) => /* @__PURE__ */ (0,
|
|
2708
|
+
var React38 = __toESM(require("react"), 1);
|
|
2709
|
+
var import_react19 = require("@phosphor-icons/react");
|
|
2710
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2711
|
+
var SidebarNavItem = React38.forwardRef(
|
|
2712
|
+
({ className, icon, label, selected = false, expandable = false, expanded = false, type = "button", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("li", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
2593
2713
|
"button",
|
|
2594
2714
|
{
|
|
2595
2715
|
ref,
|
|
@@ -2604,9 +2724,9 @@ var SidebarNavItem = React36.forwardRef(
|
|
|
2604
2724
|
),
|
|
2605
2725
|
...props,
|
|
2606
2726
|
children: [
|
|
2607
|
-
/* @__PURE__ */ (0,
|
|
2608
|
-
/* @__PURE__ */ (0,
|
|
2609
|
-
expandable && /* @__PURE__ */ (0,
|
|
2727
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { "aria-hidden": "true", className: "flex size-4 shrink-0 items-center justify-center [&>svg]:size-4", children: icon }),
|
|
2728
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "min-w-0 flex-1 truncate", children: label }),
|
|
2729
|
+
expandable && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react19.CaretDown, { "aria-hidden": "true", className: cn("transition-transform", expanded && "rotate-180") })
|
|
2610
2730
|
]
|
|
2611
2731
|
}
|
|
2612
2732
|
) })
|
|
@@ -2614,24 +2734,24 @@ var SidebarNavItem = React36.forwardRef(
|
|
|
2614
2734
|
SidebarNavItem.displayName = "SidebarNavItem";
|
|
2615
2735
|
|
|
2616
2736
|
// src/components/Overlays & Feedback/Dialog.tsx
|
|
2617
|
-
var
|
|
2618
|
-
var
|
|
2619
|
-
var
|
|
2620
|
-
var
|
|
2621
|
-
var Dialog =
|
|
2622
|
-
var DialogTrigger =
|
|
2623
|
-
var DialogClose =
|
|
2624
|
-
var DialogContent =
|
|
2625
|
-
({ className, children, closeLabel = "Close", hideClose, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2626
|
-
/* @__PURE__ */ (0,
|
|
2627
|
-
|
|
2737
|
+
var React39 = __toESM(require("react"), 1);
|
|
2738
|
+
var import_react20 = require("@phosphor-icons/react");
|
|
2739
|
+
var import_radix_ui18 = require("radix-ui");
|
|
2740
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2741
|
+
var Dialog = import_radix_ui18.Dialog.Root;
|
|
2742
|
+
var DialogTrigger = import_radix_ui18.Dialog.Trigger;
|
|
2743
|
+
var DialogClose = import_radix_ui18.Dialog.Close;
|
|
2744
|
+
var DialogContent = React39.forwardRef(
|
|
2745
|
+
({ className, children, closeLabel = "Close", hideClose, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_radix_ui18.Dialog.Portal, { children: [
|
|
2746
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2747
|
+
import_radix_ui18.Dialog.Overlay,
|
|
2628
2748
|
{
|
|
2629
2749
|
style: { zIndex: "var(--sys-z-30)" },
|
|
2630
2750
|
className: "fixed inset-0 bg-primary/30"
|
|
2631
2751
|
}
|
|
2632
2752
|
),
|
|
2633
|
-
/* @__PURE__ */ (0,
|
|
2634
|
-
|
|
2753
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
2754
|
+
import_radix_ui18.Dialog.Content,
|
|
2635
2755
|
{
|
|
2636
2756
|
ref,
|
|
2637
2757
|
style: { zIndex: "var(--sys-z-30)" },
|
|
@@ -2642,16 +2762,16 @@ var DialogContent = React37.forwardRef(
|
|
|
2642
2762
|
...props,
|
|
2643
2763
|
children: [
|
|
2644
2764
|
children,
|
|
2645
|
-
!hideClose && /* @__PURE__ */ (0,
|
|
2765
|
+
!hideClose && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_radix_ui18.Dialog.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Button, { variant: "ghost", size: "icon-sm", "aria-label": closeLabel, className: "absolute top-4 right-6", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react20.X, { size: 16, "aria-hidden": true }) }) })
|
|
2646
2766
|
]
|
|
2647
2767
|
}
|
|
2648
2768
|
)
|
|
2649
2769
|
] })
|
|
2650
2770
|
);
|
|
2651
2771
|
DialogContent.displayName = "DialogContent";
|
|
2652
|
-
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ (0,
|
|
2653
|
-
var DialogTitle =
|
|
2654
|
-
|
|
2772
|
+
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: cn("flex flex-col gap-1.5 border-b border-border px-6 py-4 pr-16", className), ...props });
|
|
2773
|
+
var DialogTitle = React39.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2774
|
+
import_radix_ui18.Dialog.Title,
|
|
2655
2775
|
{
|
|
2656
2776
|
ref,
|
|
2657
2777
|
className: cn("text-lg leading-6 font-semibold text-surface-foreground", className),
|
|
@@ -2659,8 +2779,8 @@ var DialogTitle = React37.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
2659
2779
|
}
|
|
2660
2780
|
));
|
|
2661
2781
|
DialogTitle.displayName = "DialogTitle";
|
|
2662
|
-
var DialogDescription =
|
|
2663
|
-
|
|
2782
|
+
var DialogDescription = React39.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2783
|
+
import_radix_ui18.Dialog.Description,
|
|
2664
2784
|
{
|
|
2665
2785
|
ref,
|
|
2666
2786
|
className: cn("text-body-small text-secondary-muted-foreground", className),
|
|
@@ -2668,15 +2788,15 @@ var DialogDescription = React37.forwardRef(({ className, ...props }, ref) => /*
|
|
|
2668
2788
|
}
|
|
2669
2789
|
));
|
|
2670
2790
|
DialogDescription.displayName = "DialogDescription";
|
|
2671
|
-
var DialogBody = ({ className, ...props }) => /* @__PURE__ */ (0,
|
|
2672
|
-
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ (0,
|
|
2791
|
+
var DialogBody = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: cn("flex flex-col gap-4 p-6", className), ...props });
|
|
2792
|
+
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: cn("flex items-center justify-end gap-3 border-t border-border px-6 py-4", className), ...props });
|
|
2673
2793
|
|
|
2674
2794
|
// src/components/Overlays & Feedback/Toast.tsx
|
|
2675
|
-
var
|
|
2676
|
-
var
|
|
2795
|
+
var React40 = __toESM(require("react"), 1);
|
|
2796
|
+
var import_react21 = require("@phosphor-icons/react");
|
|
2677
2797
|
var import_class_variance_authority4 = require("class-variance-authority");
|
|
2678
|
-
var
|
|
2679
|
-
var
|
|
2798
|
+
var import_radix_ui19 = require("radix-ui");
|
|
2799
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2680
2800
|
var toastVariants = (0, import_class_variance_authority4.cva)("border", {
|
|
2681
2801
|
variants: {
|
|
2682
2802
|
variant: {
|
|
@@ -2714,14 +2834,14 @@ var titleColour = {
|
|
|
2714
2834
|
};
|
|
2715
2835
|
function VariantIcon({ variant, size }) {
|
|
2716
2836
|
const props = { size, "aria-hidden": true, className: cn("shrink-0", iconColour[variant]) };
|
|
2717
|
-
if (variant === "success") return /* @__PURE__ */ (0,
|
|
2718
|
-
if (variant === "warning") return /* @__PURE__ */ (0,
|
|
2719
|
-
if (variant === "destructive") return /* @__PURE__ */ (0,
|
|
2720
|
-
return /* @__PURE__ */ (0,
|
|
2837
|
+
if (variant === "success") return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react21.CheckCircle, { ...props });
|
|
2838
|
+
if (variant === "warning") return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react21.Warning, { ...props });
|
|
2839
|
+
if (variant === "destructive") return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react21.WarningCircle, { ...props });
|
|
2840
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react21.Info, { ...props });
|
|
2721
2841
|
}
|
|
2722
|
-
var ToastProvider =
|
|
2723
|
-
var ToastViewport =
|
|
2724
|
-
|
|
2842
|
+
var ToastProvider = import_radix_ui19.Toast.Provider;
|
|
2843
|
+
var ToastViewport = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2844
|
+
import_radix_ui19.Toast.Viewport,
|
|
2725
2845
|
{
|
|
2726
2846
|
ref,
|
|
2727
2847
|
style: { zIndex: "var(--sys-z-50)" },
|
|
@@ -2730,30 +2850,30 @@ var ToastViewport = React38.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
2730
2850
|
}
|
|
2731
2851
|
));
|
|
2732
2852
|
ToastViewport.displayName = "ToastViewport";
|
|
2733
|
-
var Toast =
|
|
2853
|
+
var Toast = React40.forwardRef(
|
|
2734
2854
|
({ className, variant = "info", title, description, action, closeLabel = "Close", children, ...props }, ref) => {
|
|
2735
2855
|
const v = variant ?? "info";
|
|
2736
|
-
return /* @__PURE__ */ (0,
|
|
2737
|
-
|
|
2856
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
2857
|
+
import_radix_ui19.Toast.Root,
|
|
2738
2858
|
{
|
|
2739
2859
|
ref,
|
|
2740
2860
|
type: v === "destructive" ? "foreground" : "background",
|
|
2741
2861
|
className: cn("flex items-start gap-3 rounded-lg p-4 shadow-lg", toastVariants({ variant: v }), className),
|
|
2742
2862
|
...props,
|
|
2743
2863
|
children: [
|
|
2744
|
-
/* @__PURE__ */ (0,
|
|
2745
|
-
/* @__PURE__ */ (0,
|
|
2746
|
-
title != null && /* @__PURE__ */ (0,
|
|
2747
|
-
description != null && /* @__PURE__ */ (0,
|
|
2864
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(VariantIcon, { variant: v, size: 20 }),
|
|
2865
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1 text-body-small", children: [
|
|
2866
|
+
title != null && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_radix_ui19.Toast.Title, { className: cn("font-semibold", titleColour[v]), children: title }),
|
|
2867
|
+
description != null && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_radix_ui19.Toast.Description, { className: "text-secondary-muted-foreground", children: description }),
|
|
2748
2868
|
children,
|
|
2749
2869
|
action
|
|
2750
2870
|
] }),
|
|
2751
|
-
/* @__PURE__ */ (0,
|
|
2752
|
-
|
|
2871
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2872
|
+
import_radix_ui19.Toast.Close,
|
|
2753
2873
|
{
|
|
2754
2874
|
"aria-label": closeLabel,
|
|
2755
2875
|
className: "inline-flex size-4 shrink-0 items-center justify-center rounded-xs text-surface-foreground",
|
|
2756
|
-
children: /* @__PURE__ */ (0,
|
|
2876
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react21.X, { size: 16, "aria-hidden": true })
|
|
2757
2877
|
}
|
|
2758
2878
|
)
|
|
2759
2879
|
]
|
|
@@ -2762,12 +2882,12 @@ var Toast = React38.forwardRef(
|
|
|
2762
2882
|
}
|
|
2763
2883
|
);
|
|
2764
2884
|
Toast.displayName = "Toast";
|
|
2765
|
-
var ToastAction =
|
|
2766
|
-
var ToastInline =
|
|
2885
|
+
var ToastAction = import_radix_ui19.Toast.Action;
|
|
2886
|
+
var ToastInline = React40.forwardRef(
|
|
2767
2887
|
({ className, variant = "info", actions, actionsPlacement = "end", onClose, closeLabel = "Close", children, ...props }, ref) => {
|
|
2768
2888
|
const v = variant ?? "info";
|
|
2769
2889
|
const below = actionsPlacement === "bottom" && !!actions;
|
|
2770
|
-
return /* @__PURE__ */ (0,
|
|
2890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
2771
2891
|
"div",
|
|
2772
2892
|
{
|
|
2773
2893
|
ref,
|
|
@@ -2775,15 +2895,15 @@ var ToastInline = React38.forwardRef(
|
|
|
2775
2895
|
className: cn("flex gap-2 rounded-sm px-2 py-1.5", below ? "items-start" : "items-center", inlineVariants({ variant: v }), className),
|
|
2776
2896
|
...props,
|
|
2777
2897
|
children: [
|
|
2778
|
-
/* @__PURE__ */ (0,
|
|
2779
|
-
below ? /* @__PURE__ */ (0,
|
|
2780
|
-
/* @__PURE__ */ (0,
|
|
2781
|
-
/* @__PURE__ */ (0,
|
|
2782
|
-
] }) : /* @__PURE__ */ (0,
|
|
2783
|
-
/* @__PURE__ */ (0,
|
|
2784
|
-
actions && /* @__PURE__ */ (0,
|
|
2898
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: cn("inline-flex shrink-0", below && "mt-0.5"), children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(VariantIcon, { variant: v === "neutral" ? "info" : v, size: 16 }) }),
|
|
2899
|
+
below ? /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
2900
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "text-body-small text-secondary-muted-foreground", children }),
|
|
2901
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "flex items-center gap-2", children: actions })
|
|
2902
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
|
|
2903
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "min-w-0 flex-1 text-body-small text-secondary-muted-foreground", children }),
|
|
2904
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "flex shrink-0 items-center gap-2", children: actions })
|
|
2785
2905
|
] }),
|
|
2786
|
-
onClose && /* @__PURE__ */ (0,
|
|
2906
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": closeLabel, onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react21.X, { size: 16, "aria-hidden": true }) })
|
|
2787
2907
|
]
|
|
2788
2908
|
}
|
|
2789
2909
|
);
|
|
@@ -2792,17 +2912,17 @@ var ToastInline = React38.forwardRef(
|
|
|
2792
2912
|
ToastInline.displayName = "ToastInline";
|
|
2793
2913
|
|
|
2794
2914
|
// src/components/Overlays & Feedback/Tooltip.tsx
|
|
2795
|
-
var
|
|
2796
|
-
var
|
|
2797
|
-
var
|
|
2798
|
-
var TooltipProvider =
|
|
2799
|
-
var Tooltip =
|
|
2800
|
-
var TooltipTrigger =
|
|
2801
|
-
var TooltipContent =
|
|
2915
|
+
var React41 = __toESM(require("react"), 1);
|
|
2916
|
+
var import_radix_ui20 = require("radix-ui");
|
|
2917
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2918
|
+
var TooltipProvider = import_radix_ui20.Tooltip.Provider;
|
|
2919
|
+
var Tooltip = import_radix_ui20.Tooltip.Root;
|
|
2920
|
+
var TooltipTrigger = import_radix_ui20.Tooltip.Trigger;
|
|
2921
|
+
var TooltipContent = React41.forwardRef(
|
|
2802
2922
|
({ className, sideOffset = 4, title, description, action, arrow = true, children, ...props }, ref) => {
|
|
2803
2923
|
const detailed = title != null || description != null;
|
|
2804
|
-
return /* @__PURE__ */ (0,
|
|
2805
|
-
|
|
2924
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_radix_ui20.Tooltip.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
2925
|
+
import_radix_ui20.Tooltip.Content,
|
|
2806
2926
|
{
|
|
2807
2927
|
ref,
|
|
2808
2928
|
sideOffset,
|
|
@@ -2815,12 +2935,12 @@ var TooltipContent = React39.forwardRef(
|
|
|
2815
2935
|
),
|
|
2816
2936
|
...props,
|
|
2817
2937
|
children: [
|
|
2818
|
-
detailed ? /* @__PURE__ */ (0,
|
|
2819
|
-
title != null && /* @__PURE__ */ (0,
|
|
2820
|
-
description != null && /* @__PURE__ */ (0,
|
|
2821
|
-
action != null && /* @__PURE__ */ (0,
|
|
2938
|
+
detailed ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
|
|
2939
|
+
title != null && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-xs leading-4 font-semibold text-label", children: title }),
|
|
2940
|
+
description != null && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-xs leading-4.5 text-plum-200", children: description }),
|
|
2941
|
+
action != null && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "mt-1 text-ui-caption text-plum-300 underline *:underline", children: action })
|
|
2822
2942
|
] }) : children,
|
|
2823
|
-
arrow && /* @__PURE__ */ (0,
|
|
2943
|
+
arrow && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_radix_ui20.Tooltip.Arrow, { width: 12, height: 8, className: "fill-primary-soft-foreground" })
|
|
2824
2944
|
]
|
|
2825
2945
|
}
|
|
2826
2946
|
) });
|
|
@@ -2829,14 +2949,14 @@ var TooltipContent = React39.forwardRef(
|
|
|
2829
2949
|
TooltipContent.displayName = "TooltipContent";
|
|
2830
2950
|
|
|
2831
2951
|
// src/components/Question Types/FileUpload.tsx
|
|
2832
|
-
var
|
|
2833
|
-
var
|
|
2834
|
-
var
|
|
2952
|
+
var React43 = __toESM(require("react"), 1);
|
|
2953
|
+
var import_react22 = require("@phosphor-icons/react");
|
|
2954
|
+
var import_radix_ui21 = require("radix-ui");
|
|
2835
2955
|
|
|
2836
2956
|
// src/components/Tags & Badges/Tag.tsx
|
|
2837
|
-
var
|
|
2957
|
+
var React42 = __toESM(require("react"), 1);
|
|
2838
2958
|
var import_class_variance_authority5 = require("class-variance-authority");
|
|
2839
|
-
var
|
|
2959
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2840
2960
|
var tagVariants = (0, import_class_variance_authority5.cva)(
|
|
2841
2961
|
"inline-flex items-center gap-1.5 whitespace-nowrap rounded-sm border px-2.5 py-1 text-ui-caption",
|
|
2842
2962
|
{
|
|
@@ -2852,7 +2972,7 @@ var tagVariants = (0, import_class_variance_authority5.cva)(
|
|
|
2852
2972
|
defaultVariants: { variant: "neutral" }
|
|
2853
2973
|
}
|
|
2854
2974
|
);
|
|
2855
|
-
var Tag =
|
|
2975
|
+
var Tag = React42.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { ref, className: cn(tagVariants({ variant }), className), ...props }));
|
|
2856
2976
|
Tag.displayName = "Tag";
|
|
2857
2977
|
var statusDotVariants = (0, import_class_variance_authority5.cva)("size-1.5 shrink-0 rounded-full", {
|
|
2858
2978
|
variants: {
|
|
@@ -2865,20 +2985,20 @@ var statusDotVariants = (0, import_class_variance_authority5.cva)("size-1.5 shri
|
|
|
2865
2985
|
},
|
|
2866
2986
|
defaultVariants: { status: "active" }
|
|
2867
2987
|
});
|
|
2868
|
-
var StatusTag =
|
|
2869
|
-
({ className, status, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2870
|
-
/* @__PURE__ */ (0,
|
|
2988
|
+
var StatusTag = React42.forwardRef(
|
|
2989
|
+
({ className, status, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", { ref, className: cn(tagVariants({ variant: "default" }), className), ...props, children: [
|
|
2990
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: statusDotVariants({ status }), "aria-hidden": "true" }),
|
|
2871
2991
|
children
|
|
2872
2992
|
] })
|
|
2873
2993
|
);
|
|
2874
2994
|
StatusTag.displayName = "StatusTag";
|
|
2875
2995
|
|
|
2876
2996
|
// src/components/Question Types/FileUpload.tsx
|
|
2877
|
-
var
|
|
2878
|
-
var FileUploadZone =
|
|
2997
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
2998
|
+
var FileUploadZone = React43.forwardRef(
|
|
2879
2999
|
({ className, title = "Upload document", hint, icon, onFiles, ...props }, ref) => {
|
|
2880
|
-
const [over, setOver] =
|
|
2881
|
-
return /* @__PURE__ */ (0,
|
|
3000
|
+
const [over, setOver] = React43.useState(false);
|
|
3001
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
2882
3002
|
"label",
|
|
2883
3003
|
{
|
|
2884
3004
|
className: cn(
|
|
@@ -2898,12 +3018,12 @@ var FileUploadZone = React41.forwardRef(
|
|
|
2898
3018
|
onFiles?.(Array.from(event.dataTransfer.files));
|
|
2899
3019
|
},
|
|
2900
3020
|
children: [
|
|
2901
|
-
/* @__PURE__ */ (0,
|
|
2902
|
-
/* @__PURE__ */ (0,
|
|
2903
|
-
/* @__PURE__ */ (0,
|
|
2904
|
-
hint && /* @__PURE__ */ (0,
|
|
3021
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.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_runtime44.jsx)(import_react22.FileText, { size: 24, "aria-hidden": true }) }),
|
|
3022
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "flex flex-col gap-1", children: [
|
|
3023
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "text-body-small text-surface-foreground", children: title }),
|
|
3024
|
+
hint && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "text-ui-caption text-secondary-muted-foreground", children: hint })
|
|
2905
3025
|
] }),
|
|
2906
|
-
/* @__PURE__ */ (0,
|
|
3026
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
2907
3027
|
"input",
|
|
2908
3028
|
{
|
|
2909
3029
|
ref,
|
|
@@ -2919,47 +3039,47 @@ var FileUploadZone = React41.forwardRef(
|
|
|
2919
3039
|
}
|
|
2920
3040
|
);
|
|
2921
3041
|
FileUploadZone.displayName = "FileUploadZone";
|
|
2922
|
-
var FileUploadItem =
|
|
3042
|
+
var FileUploadItem = React43.forwardRef(
|
|
2923
3043
|
({ className, name, size, status = "uploading", progress = 0, timeLeft, icon, onRemove, removeLabel, ...props }, ref) => {
|
|
2924
3044
|
const uploading = status === "uploading";
|
|
2925
|
-
return /* @__PURE__ */ (0,
|
|
3045
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
2926
3046
|
"div",
|
|
2927
3047
|
{
|
|
2928
3048
|
ref,
|
|
2929
3049
|
className: cn("flex w-full flex-col justify-center gap-2 overflow-hidden rounded-sm border border-border p-2", className),
|
|
2930
3050
|
...props,
|
|
2931
3051
|
children: [
|
|
2932
|
-
/* @__PURE__ */ (0,
|
|
2933
|
-
/* @__PURE__ */ (0,
|
|
2934
|
-
/* @__PURE__ */ (0,
|
|
2935
|
-
/* @__PURE__ */ (0,
|
|
2936
|
-
/* @__PURE__ */ (0,
|
|
2937
|
-
onRemove && /* @__PURE__ */ (0,
|
|
3052
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3053
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.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_runtime44.jsx)(import_react22.FileText, { size: 24, "aria-hidden": true }) }),
|
|
3054
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
3055
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
3056
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "min-w-0 truncate text-ui-label text-surface-foreground", children: name }),
|
|
3057
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": removeLabel ?? `Remove ${name}`, onClick: onRemove, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react22.X, { size: 16, "aria-hidden": true }) })
|
|
2938
3058
|
] }),
|
|
2939
|
-
/* @__PURE__ */ (0,
|
|
2940
|
-
/* @__PURE__ */ (0,
|
|
3059
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex items-center justify-between text-ui-caption text-secondary-muted-foreground", children: [
|
|
3060
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "flex items-center gap-2", children: [
|
|
2941
3061
|
size,
|
|
2942
|
-
status === "complete" && /* @__PURE__ */ (0,
|
|
2943
|
-
status === "error" && /* @__PURE__ */ (0,
|
|
2944
|
-
uploading && timeLeft && /* @__PURE__ */ (0,
|
|
2945
|
-
/* @__PURE__ */ (0,
|
|
3062
|
+
status === "complete" && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Tag, { variant: "success", children: "Complete" }),
|
|
3063
|
+
status === "error" && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Tag, { variant: "destructive", children: "Error" }),
|
|
3064
|
+
uploading && timeLeft && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
|
|
3065
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { "aria-hidden": "true", className: "size-0.5 rounded-full bg-secondary-muted-foreground" }),
|
|
2946
3066
|
timeLeft
|
|
2947
3067
|
] })
|
|
2948
3068
|
] }),
|
|
2949
|
-
uploading && /* @__PURE__ */ (0,
|
|
3069
|
+
uploading && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "text-body-xxs font-normal", children: [
|
|
2950
3070
|
Math.round(progress),
|
|
2951
3071
|
"%"
|
|
2952
3072
|
] })
|
|
2953
3073
|
] })
|
|
2954
3074
|
] })
|
|
2955
3075
|
] }),
|
|
2956
|
-
uploading && /* @__PURE__ */ (0,
|
|
2957
|
-
|
|
3076
|
+
uploading && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3077
|
+
import_radix_ui21.Progress.Root,
|
|
2958
3078
|
{
|
|
2959
3079
|
value: progress,
|
|
2960
3080
|
"aria-label": `Uploading ${name}`,
|
|
2961
3081
|
className: "h-0.75 w-full overflow-hidden rounded-sm bg-background bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5",
|
|
2962
|
-
children: /* @__PURE__ */ (0,
|
|
3082
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_radix_ui21.Progress.Indicator, { className: "h-full bg-accent transition-[width]", style: { width: `${progress}%` } })
|
|
2963
3083
|
}
|
|
2964
3084
|
)
|
|
2965
3085
|
]
|
|
@@ -2970,28 +3090,28 @@ var FileUploadItem = React41.forwardRef(
|
|
|
2970
3090
|
FileUploadItem.displayName = "FileUploadItem";
|
|
2971
3091
|
|
|
2972
3092
|
// src/components/Question Types/Media.tsx
|
|
2973
|
-
var
|
|
2974
|
-
var
|
|
2975
|
-
var
|
|
2976
|
-
var
|
|
3093
|
+
var React44 = __toESM(require("react"), 1);
|
|
3094
|
+
var import_react23 = require("@phosphor-icons/react");
|
|
3095
|
+
var import_radix_ui22 = require("radix-ui");
|
|
3096
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
2977
3097
|
function MediaInfo({ name, details, onRemove, removeLabel, large, actions, compact = false, className, ...props }) {
|
|
2978
|
-
return /* @__PURE__ */ (0,
|
|
2979
|
-
/* @__PURE__ */ (0,
|
|
2980
|
-
/* @__PURE__ */ (0,
|
|
2981
|
-
/* @__PURE__ */ (0,
|
|
3098
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: cn("flex items-center justify-between border-t border-border bg-surface", compact ? "p-4" : "px-6 py-4", className), ...props, children: [
|
|
3099
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
3100
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
3101
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: cn("min-w-0 flex-1 truncate text-surface-foreground", large ? "text-body-section" : "text-ui-label"), children: name }),
|
|
2982
3102
|
actions
|
|
2983
3103
|
] }),
|
|
2984
|
-
details && /* @__PURE__ */ (0,
|
|
2985
|
-
index > 0 && /* @__PURE__ */ (0,
|
|
3104
|
+
details && /* @__PURE__ */ (0, import_jsx_runtime45.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_runtime45.jsxs)(React44.Fragment, { children: [
|
|
3105
|
+
index > 0 && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { "aria-hidden": "true", className: "size-0.5 rounded-full bg-secondary-muted-foreground" }),
|
|
2986
3106
|
part
|
|
2987
3107
|
] }, part)) })
|
|
2988
3108
|
] }),
|
|
2989
|
-
onRemove && /* @__PURE__ */ (0,
|
|
3109
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Button, { type: "button", variant: "destructive", size: "icon", "aria-label": removeLabel ?? `Remove ${name}`, onClick: onRemove, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.Trash, { size: 16, "aria-hidden": true }) })
|
|
2990
3110
|
] });
|
|
2991
3111
|
}
|
|
2992
|
-
var ImagePreview =
|
|
2993
|
-
({ className, children, name, details, onRemove, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2994
|
-
/* @__PURE__ */ (0,
|
|
3112
|
+
var ImagePreview = React44.forwardRef(
|
|
3113
|
+
({ className, children, name, details, onRemove, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { ref, className: cn("flex w-full flex-col overflow-hidden rounded-lg border border-border", className), ...props, children: [
|
|
3114
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
2995
3115
|
"div",
|
|
2996
3116
|
{
|
|
2997
3117
|
className: cn(
|
|
@@ -3002,13 +3122,13 @@ var ImagePreview = React42.forwardRef(
|
|
|
3002
3122
|
children
|
|
3003
3123
|
}
|
|
3004
3124
|
),
|
|
3005
|
-
/* @__PURE__ */ (0,
|
|
3125
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(MediaInfo, { name, details, onRemove, large: true })
|
|
3006
3126
|
] })
|
|
3007
3127
|
);
|
|
3008
3128
|
ImagePreview.displayName = "ImagePreview";
|
|
3009
|
-
var ImageThumbnails =
|
|
3010
|
-
({ className, max, images, value, onValueChange, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3011
|
-
|
|
3129
|
+
var ImageThumbnails = React44.forwardRef(
|
|
3130
|
+
({ className, max, images, value, onValueChange, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3131
|
+
import_radix_ui22.ToggleGroup.Root,
|
|
3012
3132
|
{
|
|
3013
3133
|
ref,
|
|
3014
3134
|
type: "single",
|
|
@@ -3019,18 +3139,18 @@ var ImageThumbnails = React42.forwardRef(
|
|
|
3019
3139
|
children: Array.from({ length: max }, (_, index) => {
|
|
3020
3140
|
const image = images[index];
|
|
3021
3141
|
if (!image) {
|
|
3022
|
-
return /* @__PURE__ */ (0,
|
|
3142
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3023
3143
|
"span",
|
|
3024
3144
|
{
|
|
3025
3145
|
"aria-hidden": "true",
|
|
3026
3146
|
className: "flex h-20 min-w-0 flex-1 items-center justify-center rounded-sm border border-dashed border-border text-accent-foreground",
|
|
3027
|
-
children: /* @__PURE__ */ (0,
|
|
3147
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.Image, { size: 24 })
|
|
3028
3148
|
},
|
|
3029
3149
|
`empty-${index}`
|
|
3030
3150
|
);
|
|
3031
3151
|
}
|
|
3032
|
-
return /* @__PURE__ */ (0,
|
|
3033
|
-
|
|
3152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3153
|
+
import_radix_ui22.ToggleGroup.Item,
|
|
3034
3154
|
{
|
|
3035
3155
|
value: image.id,
|
|
3036
3156
|
"aria-label": image.alt,
|
|
@@ -3039,7 +3159,7 @@ var ImageThumbnails = React42.forwardRef(
|
|
|
3039
3159
|
"hover:bg-accent-soft hover:bg-none",
|
|
3040
3160
|
"data-[state=on]:border-accent-foreground data-[state=on]:bg-accent-soft data-[state=on]:bg-none data-[state=on]:text-accent-foreground"
|
|
3041
3161
|
),
|
|
3042
|
-
children: image.src ? /* @__PURE__ */ (0,
|
|
3162
|
+
children: image.src ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("img", { src: image.src, alt: "", className: "size-full object-cover" }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.Image, { size: 24, "aria-hidden": true })
|
|
3043
3163
|
},
|
|
3044
3164
|
image.id
|
|
3045
3165
|
);
|
|
@@ -3052,13 +3172,13 @@ var formatTime = (seconds) => {
|
|
|
3052
3172
|
const total = Math.max(0, Math.floor(Number.isFinite(seconds) ? seconds : 0));
|
|
3053
3173
|
return `${Math.floor(total / 60)}:${String(total % 60).padStart(2, "0")}`;
|
|
3054
3174
|
};
|
|
3055
|
-
var VideoPlayer =
|
|
3175
|
+
var VideoPlayer = React44.forwardRef(
|
|
3056
3176
|
({ className, src, name, details, onRemove, onMore, initialTime = 0, initialDuration = 0, controls = "always", moreIn = "controls", badge, aspect = "fixed", compactInfo = false, ...props }, ref) => {
|
|
3057
|
-
const video =
|
|
3058
|
-
const [playing, setPlaying] =
|
|
3059
|
-
const [time, setTime] =
|
|
3060
|
-
const [duration, setDuration] =
|
|
3061
|
-
const [volume, setVolume] =
|
|
3177
|
+
const video = React44.useRef(null);
|
|
3178
|
+
const [playing, setPlaying] = React44.useState(false);
|
|
3179
|
+
const [time, setTime] = React44.useState(initialTime);
|
|
3180
|
+
const [duration, setDuration] = React44.useState(initialDuration);
|
|
3181
|
+
const [volume, setVolume] = React44.useState(1);
|
|
3062
3182
|
const muted = volume === 0;
|
|
3063
3183
|
const toggle2 = () => {
|
|
3064
3184
|
const el = video.current;
|
|
@@ -3066,9 +3186,9 @@ var VideoPlayer = React42.forwardRef(
|
|
|
3066
3186
|
if (el.paused) void el.play();
|
|
3067
3187
|
else el.pause();
|
|
3068
3188
|
};
|
|
3069
|
-
return /* @__PURE__ */ (0,
|
|
3070
|
-
/* @__PURE__ */ (0,
|
|
3071
|
-
src && /* @__PURE__ */ (0,
|
|
3189
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { ref, className: cn("flex w-full flex-col overflow-hidden rounded-lg border border-border bg-surface", className), ...props, children: [
|
|
3190
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: cn("group/player relative flex w-full items-end bg-accent-soft", aspect === "video" ? "aspect-video" : "h-60.5"), children: [
|
|
3191
|
+
src && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3072
3192
|
"video",
|
|
3073
3193
|
{
|
|
3074
3194
|
ref: video,
|
|
@@ -3081,8 +3201,8 @@ var VideoPlayer = React42.forwardRef(
|
|
|
3081
3201
|
onVolumeChange: (event) => setVolume(event.currentTarget.muted ? 0 : event.currentTarget.volume)
|
|
3082
3202
|
}
|
|
3083
3203
|
),
|
|
3084
|
-
badge && /* @__PURE__ */ (0,
|
|
3085
|
-
/* @__PURE__ */ (0,
|
|
3204
|
+
badge && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "absolute top-3 left-3", children: badge }),
|
|
3205
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
3086
3206
|
"div",
|
|
3087
3207
|
{
|
|
3088
3208
|
className: cn(
|
|
@@ -3090,8 +3210,8 @@ var VideoPlayer = React42.forwardRef(
|
|
|
3090
3210
|
controls === "hover" && "opacity-0 transition-opacity group-focus-within/player:opacity-100 group-hover/player:opacity-100"
|
|
3091
3211
|
),
|
|
3092
3212
|
children: [
|
|
3093
|
-
/* @__PURE__ */ (0,
|
|
3094
|
-
|
|
3213
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
3214
|
+
import_radix_ui22.Slider.Root,
|
|
3095
3215
|
{
|
|
3096
3216
|
min: 0,
|
|
3097
3217
|
max: duration || 1,
|
|
@@ -3104,31 +3224,31 @@ var VideoPlayer = React42.forwardRef(
|
|
|
3104
3224
|
},
|
|
3105
3225
|
className: "relative flex h-4 w-full touch-none items-center select-none",
|
|
3106
3226
|
children: [
|
|
3107
|
-
/* @__PURE__ */ (0,
|
|
3108
|
-
/* @__PURE__ */ (0,
|
|
3227
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_radix_ui22.Slider.Track, { className: "relative h-1 w-full grow overflow-hidden rounded-xxs bg-surface/20", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_radix_ui22.Slider.Range, { className: "absolute h-full bg-accent-foreground" }) }),
|
|
3228
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_radix_ui22.Slider.Thumb, { "aria-label": "Seek", className: "block size-3 rounded-full border-2 border-surface bg-surface shadow-sm" })
|
|
3109
3229
|
]
|
|
3110
3230
|
}
|
|
3111
3231
|
),
|
|
3112
|
-
/* @__PURE__ */ (0,
|
|
3113
|
-
/* @__PURE__ */ (0,
|
|
3114
|
-
/* @__PURE__ */ (0,
|
|
3232
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
3233
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-center gap-4", children: [
|
|
3234
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3115
3235
|
"button",
|
|
3116
3236
|
{
|
|
3117
3237
|
type: "button",
|
|
3118
3238
|
"aria-label": playing ? "Pause" : "Play",
|
|
3119
3239
|
onClick: toggle2,
|
|
3120
3240
|
className: "inline-flex size-10 items-center justify-center rounded-full bg-surface/12 text-surface transition-colors hover:bg-surface/20",
|
|
3121
|
-
children: playing ? /* @__PURE__ */ (0,
|
|
3241
|
+
children: playing ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.Pause, { size: 16, weight: "fill", "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.Play, { size: 16, weight: "fill", "aria-hidden": true })
|
|
3122
3242
|
}
|
|
3123
3243
|
),
|
|
3124
|
-
/* @__PURE__ */ (0,
|
|
3244
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("span", { className: "text-ui-label whitespace-nowrap text-surface/80", children: [
|
|
3125
3245
|
formatTime(time),
|
|
3126
3246
|
" / ",
|
|
3127
3247
|
formatTime(duration)
|
|
3128
3248
|
] })
|
|
3129
3249
|
] }),
|
|
3130
|
-
/* @__PURE__ */ (0,
|
|
3131
|
-
/* @__PURE__ */ (0,
|
|
3250
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3251
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3132
3252
|
VolumeControl,
|
|
3133
3253
|
{
|
|
3134
3254
|
volume,
|
|
@@ -3141,24 +3261,24 @@ var VideoPlayer = React42.forwardRef(
|
|
|
3141
3261
|
}
|
|
3142
3262
|
}
|
|
3143
3263
|
),
|
|
3144
|
-
/* @__PURE__ */ (0,
|
|
3264
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3145
3265
|
"button",
|
|
3146
3266
|
{
|
|
3147
3267
|
type: "button",
|
|
3148
3268
|
"aria-label": "Full screen",
|
|
3149
3269
|
onClick: () => void video.current?.requestFullscreen?.(),
|
|
3150
3270
|
className: "inline-flex size-10 items-center justify-center rounded-md text-surface transition-colors hover:bg-surface/12",
|
|
3151
|
-
children: /* @__PURE__ */ (0,
|
|
3271
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.CornersOut, { size: 16, "aria-hidden": true })
|
|
3152
3272
|
}
|
|
3153
3273
|
),
|
|
3154
|
-
moreIn === "controls" && /* @__PURE__ */ (0,
|
|
3274
|
+
moreIn === "controls" && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3155
3275
|
"button",
|
|
3156
3276
|
{
|
|
3157
3277
|
type: "button",
|
|
3158
3278
|
"aria-label": "More",
|
|
3159
3279
|
onClick: onMore,
|
|
3160
3280
|
className: "inline-flex size-10 items-center justify-center rounded-md text-surface transition-colors hover:bg-surface/12",
|
|
3161
|
-
children: /* @__PURE__ */ (0,
|
|
3281
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.DotsThree, { size: 16, "aria-hidden": true })
|
|
3162
3282
|
}
|
|
3163
3283
|
)
|
|
3164
3284
|
] })
|
|
@@ -3167,27 +3287,27 @@ var VideoPlayer = React42.forwardRef(
|
|
|
3167
3287
|
}
|
|
3168
3288
|
)
|
|
3169
3289
|
] }),
|
|
3170
|
-
name && /* @__PURE__ */ (0,
|
|
3290
|
+
name && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3171
3291
|
MediaInfo,
|
|
3172
3292
|
{
|
|
3173
3293
|
name,
|
|
3174
3294
|
details,
|
|
3175
3295
|
onRemove,
|
|
3176
3296
|
compact: compactInfo,
|
|
3177
|
-
actions: moreIn === "info" && /* @__PURE__ */ (0,
|
|
3297
|
+
actions: moreIn === "info" && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": "More", onClick: onMore, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.DotsThreeVertical, { size: 16, "aria-hidden": true }) })
|
|
3178
3298
|
}
|
|
3179
3299
|
),
|
|
3180
|
-
/* @__PURE__ */ (0,
|
|
3300
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "sr-only", "aria-live": "polite", children: muted ? "Muted" : "" })
|
|
3181
3301
|
] });
|
|
3182
3302
|
}
|
|
3183
3303
|
);
|
|
3184
3304
|
VideoPlayer.displayName = "VideoPlayer";
|
|
3185
3305
|
function VolumeControl({ volume, onVolumeChange, className }) {
|
|
3186
|
-
const last =
|
|
3306
|
+
const last = React44.useRef(volume || 1);
|
|
3187
3307
|
if (volume > 0) last.current = volume;
|
|
3188
|
-
return /* @__PURE__ */ (0,
|
|
3189
|
-
/* @__PURE__ */ (0,
|
|
3190
|
-
|
|
3308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: cn("group/volume flex items-center", className), children: [
|
|
3309
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.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_runtime45.jsxs)(
|
|
3310
|
+
import_radix_ui22.Slider.Root,
|
|
3191
3311
|
{
|
|
3192
3312
|
min: 0,
|
|
3193
3313
|
max: 1,
|
|
@@ -3196,32 +3316,32 @@ function VolumeControl({ volume, onVolumeChange, className }) {
|
|
|
3196
3316
|
onValueChange: ([next]) => next !== void 0 && onVolumeChange(next),
|
|
3197
3317
|
className: "relative flex h-4 w-14 touch-none items-center select-none",
|
|
3198
3318
|
children: [
|
|
3199
|
-
/* @__PURE__ */ (0,
|
|
3200
|
-
/* @__PURE__ */ (0,
|
|
3319
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_radix_ui22.Slider.Track, { className: "relative h-1 w-full grow overflow-hidden rounded-xxs bg-surface/20", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_radix_ui22.Slider.Range, { className: "absolute h-full bg-surface" }) }),
|
|
3320
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_radix_ui22.Slider.Thumb, { "aria-label": "Volume", className: "block size-3 rounded-full bg-surface shadow-sm" })
|
|
3201
3321
|
]
|
|
3202
3322
|
}
|
|
3203
3323
|
) }),
|
|
3204
|
-
/* @__PURE__ */ (0,
|
|
3324
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3205
3325
|
"button",
|
|
3206
3326
|
{
|
|
3207
3327
|
type: "button",
|
|
3208
3328
|
"aria-label": volume === 0 ? "Unmute" : "Mute",
|
|
3209
3329
|
onClick: () => onVolumeChange(volume === 0 ? last.current : 0),
|
|
3210
3330
|
className: "inline-flex size-10 items-center justify-center rounded-md text-surface transition-colors hover:bg-surface/12",
|
|
3211
|
-
children: volume === 0 ? /* @__PURE__ */ (0,
|
|
3331
|
+
children: volume === 0 ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.SpeakerSimpleX, { size: 16, "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.SpeakerSimpleHigh, { size: 16, "aria-hidden": true })
|
|
3212
3332
|
}
|
|
3213
3333
|
)
|
|
3214
3334
|
] });
|
|
3215
3335
|
}
|
|
3216
3336
|
|
|
3217
3337
|
// src/components/Question Types/OpenEndAnswer.tsx
|
|
3218
|
-
var
|
|
3219
|
-
var
|
|
3220
|
-
var OpenEndAnswer =
|
|
3338
|
+
var React45 = __toESM(require("react"), 1);
|
|
3339
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3340
|
+
var OpenEndAnswer = React45.forwardRef(
|
|
3221
3341
|
({ value, defaultValue, onChange, maxLength = 1e3, placeholder = "Write your answer", ...props }, ref) => {
|
|
3222
|
-
const [internal, setInternal] =
|
|
3342
|
+
const [internal, setInternal] = React45.useState(String(defaultValue ?? ""));
|
|
3223
3343
|
const text = value !== void 0 ? String(value) : internal;
|
|
3224
|
-
return /* @__PURE__ */ (0,
|
|
3344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3225
3345
|
Textarea,
|
|
3226
3346
|
{
|
|
3227
3347
|
ref,
|
|
@@ -3241,10 +3361,10 @@ var OpenEndAnswer = React43.forwardRef(
|
|
|
3241
3361
|
OpenEndAnswer.displayName = "OpenEndAnswer";
|
|
3242
3362
|
|
|
3243
3363
|
// src/components/Question Types/QuestionCard.tsx
|
|
3244
|
-
var
|
|
3245
|
-
var
|
|
3246
|
-
var QuestionCard =
|
|
3247
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3364
|
+
var React46 = __toESM(require("react"), 1);
|
|
3365
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
3366
|
+
var QuestionCard = React46.forwardRef(
|
|
3367
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3248
3368
|
"div",
|
|
3249
3369
|
{
|
|
3250
3370
|
ref,
|
|
@@ -3256,8 +3376,8 @@ var QuestionCard = React44.forwardRef(
|
|
|
3256
3376
|
QuestionCard.displayName = "QuestionCard";
|
|
3257
3377
|
|
|
3258
3378
|
// src/components/Question Types/QuestionEditorCard.tsx
|
|
3259
|
-
var
|
|
3260
|
-
var
|
|
3379
|
+
var React50 = __toESM(require("react"), 1);
|
|
3380
|
+
var import_react26 = require("@phosphor-icons/react");
|
|
3261
3381
|
|
|
3262
3382
|
// src/lib/keepEditingFocus.ts
|
|
3263
3383
|
function keepEditingFocus(event) {
|
|
@@ -3268,37 +3388,37 @@ function keepEditingFocus(event) {
|
|
|
3268
3388
|
}
|
|
3269
3389
|
|
|
3270
3390
|
// src/components/Question Types/QuestionHeader.tsx
|
|
3271
|
-
var
|
|
3391
|
+
var React49 = __toESM(require("react"), 1);
|
|
3272
3392
|
|
|
3273
3393
|
// src/components/Question Types/QuestionNumberTag.tsx
|
|
3274
|
-
var
|
|
3275
|
-
var
|
|
3394
|
+
var React48 = __toESM(require("react"), 1);
|
|
3395
|
+
var import_react25 = require("@phosphor-icons/react");
|
|
3276
3396
|
|
|
3277
3397
|
// src/components/Question Types/QuestionTypeIcon.tsx
|
|
3278
|
-
var
|
|
3279
|
-
var
|
|
3280
|
-
var
|
|
3398
|
+
var React47 = require("react");
|
|
3399
|
+
var import_react24 = require("@phosphor-icons/react");
|
|
3400
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3281
3401
|
var icons = {
|
|
3282
|
-
"select-one":
|
|
3283
|
-
"select-multiple":
|
|
3284
|
-
ranking:
|
|
3285
|
-
upload:
|
|
3286
|
-
"upload-video":
|
|
3287
|
-
"upload-photo":
|
|
3288
|
-
"upload-document":
|
|
3289
|
-
rating:
|
|
3290
|
-
"open-end":
|
|
3291
|
-
"screen-recording":
|
|
3402
|
+
"select-one": import_react24.RadioButton,
|
|
3403
|
+
"select-multiple": import_react24.CheckSquare,
|
|
3404
|
+
ranking: import_react24.ListNumbers,
|
|
3405
|
+
upload: import_react24.FileArrowUp,
|
|
3406
|
+
"upload-video": import_react24.VideoCamera,
|
|
3407
|
+
"upload-photo": import_react24.Image,
|
|
3408
|
+
"upload-document": import_react24.FileText,
|
|
3409
|
+
rating: import_react24.StarHalf,
|
|
3410
|
+
"open-end": import_react24.ChatsCircle,
|
|
3411
|
+
"screen-recording": import_react24.VideoCamera
|
|
3292
3412
|
};
|
|
3293
3413
|
function QuestionTypeIcon({ type, size = 22.5, className, ...props }) {
|
|
3294
3414
|
const Icon = icons[type];
|
|
3295
|
-
return /* @__PURE__ */ (0,
|
|
3415
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Icon, { size, weight: "duotone", "aria-hidden": true, className: className ?? "text-accent-foreground", ...props });
|
|
3296
3416
|
}
|
|
3297
3417
|
|
|
3298
3418
|
// src/components/Question Types/QuestionNumberTag.tsx
|
|
3299
|
-
var
|
|
3300
|
-
var QuestionNumberTag =
|
|
3301
|
-
({ number, active, questionType, showDragHandle = true, dragHandleProps, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3419
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3420
|
+
var QuestionNumberTag = React48.forwardRef(
|
|
3421
|
+
({ number, active, questionType, showDragHandle = true, dragHandleProps, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
3302
3422
|
"span",
|
|
3303
3423
|
{
|
|
3304
3424
|
ref,
|
|
@@ -3317,7 +3437,7 @@ var QuestionNumberTag = React46.forwardRef(
|
|
|
3317
3437
|
dragHandleProps?.className
|
|
3318
3438
|
),
|
|
3319
3439
|
children: [
|
|
3320
|
-
questionType && /* @__PURE__ */ (0,
|
|
3440
|
+
questionType && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3321
3441
|
QuestionTypeIcon,
|
|
3322
3442
|
{
|
|
3323
3443
|
type: questionType,
|
|
@@ -3325,8 +3445,8 @@ var QuestionNumberTag = React46.forwardRef(
|
|
|
3325
3445
|
className: cn("shrink-0", showDragHandle && "group-hover/editor:hidden group-data-[hovered]/editor:hidden group-hover/handle:hidden group-focus-visible/handle:hidden")
|
|
3326
3446
|
}
|
|
3327
3447
|
),
|
|
3328
|
-
showDragHandle && /* @__PURE__ */ (0,
|
|
3329
|
-
|
|
3448
|
+
showDragHandle && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3449
|
+
import_react25.DotsSixVertical,
|
|
3330
3450
|
{
|
|
3331
3451
|
size: 16,
|
|
3332
3452
|
"aria-hidden": true,
|
|
@@ -3342,30 +3462,30 @@ var QuestionNumberTag = React46.forwardRef(
|
|
|
3342
3462
|
QuestionNumberTag.displayName = "QuestionNumberTag";
|
|
3343
3463
|
|
|
3344
3464
|
// src/components/Question Types/QuestionHeader.tsx
|
|
3345
|
-
var
|
|
3465
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3346
3466
|
var eyebrow = "text-ui-caption uppercase text-secondary-muted-foreground";
|
|
3347
|
-
var QuestionHeader =
|
|
3467
|
+
var QuestionHeader = React49.forwardRef(
|
|
3348
3468
|
({ className, number, title, required, error, onDismissError, editor, onTitleChange, titlePlaceholder = "Click to write the question text", titlePlaceholderTone, titleMinLength, titleRecommendedMax, titleRecommendedNote, actions, meta, maxLength = 2e3, active, showCounter = true, dragHandleProps, showDragHandle = true, questionType, titleMarks, onTitleMarkApply, onTitleMarkDismiss, titleEditing, ...props }, ref) => {
|
|
3349
|
-
const [draft, setDraft] =
|
|
3469
|
+
const [draft, setDraft] = React49.useState(null);
|
|
3350
3470
|
const label = String(number).padStart(2, "0");
|
|
3351
3471
|
const showError = error !== void 0 && error !== false;
|
|
3352
3472
|
if (editor) {
|
|
3353
3473
|
const text = typeof title === "string" ? title : "";
|
|
3354
3474
|
const count = (draft ?? text).length;
|
|
3355
3475
|
const long = titleRecommendedMax !== void 0 && count > titleRecommendedMax;
|
|
3356
|
-
return /* @__PURE__ */ (0,
|
|
3357
|
-
/* @__PURE__ */ (0,
|
|
3358
|
-
/* @__PURE__ */ (0,
|
|
3359
|
-
/* @__PURE__ */ (0,
|
|
3476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { ref, className: cn("group/header flex w-full flex-col gap-2", className), ...props, children: [
|
|
3477
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
3478
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3479
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(QuestionNumberTag, { number, active, questionType, showDragHandle, dragHandleProps }),
|
|
3360
3480
|
meta
|
|
3361
3481
|
] }),
|
|
3362
|
-
actions && /* @__PURE__ */ (0,
|
|
3482
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: cn(
|
|
3363
3483
|
"flex items-center gap-2 opacity-0 transition-opacity group-focus-within/header:opacity-100 group-hover/header:opacity-100",
|
|
3364
3484
|
// Inside a QuestionEditorCard, hovering or focusing anywhere on the card reveals them too.
|
|
3365
3485
|
"group-focus-within/editor:opacity-100 group-hover/editor:opacity-100 group-data-[hovered]/editor:opacity-100"
|
|
3366
3486
|
), children: actions })
|
|
3367
3487
|
] }),
|
|
3368
|
-
/* @__PURE__ */ (0,
|
|
3488
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
3369
3489
|
InlineEdit,
|
|
3370
3490
|
{
|
|
3371
3491
|
variant: "question",
|
|
@@ -3391,8 +3511,8 @@ var QuestionHeader = React47.forwardRef(
|
|
|
3391
3511
|
textClassName: long ? "text-body-base" : "text-heading-h4"
|
|
3392
3512
|
}
|
|
3393
3513
|
),
|
|
3394
|
-
long && titleRecommendedNote != null && /* @__PURE__ */ (0,
|
|
3395
|
-
showCounter && titleMinLength === void 0 && maxLength !== void 0 && count > maxLength && /* @__PURE__ */ (0,
|
|
3514
|
+
long && titleRecommendedNote != null && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { className: "text-ui-caption text-secondary-muted-foreground", children: titleRecommendedNote }),
|
|
3515
|
+
showCounter && titleMinLength === void 0 && maxLength !== void 0 && count > maxLength && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("p", { className: "text-ui-caption text-secondary-muted-foreground", children: [
|
|
3396
3516
|
count,
|
|
3397
3517
|
"/",
|
|
3398
3518
|
maxLength,
|
|
@@ -3400,16 +3520,16 @@ var QuestionHeader = React47.forwardRef(
|
|
|
3400
3520
|
] })
|
|
3401
3521
|
] });
|
|
3402
3522
|
}
|
|
3403
|
-
return /* @__PURE__ */ (0,
|
|
3404
|
-
showError && /* @__PURE__ */ (0,
|
|
3405
|
-
/* @__PURE__ */ (0,
|
|
3523
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { ref, className: cn("flex w-full flex-col gap-2", className), ...props, children: [
|
|
3524
|
+
showError && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ToastInline, { variant: "destructive", onClose: onDismissError, className: "min-h-10", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "text-ui-label text-destructive", children: error === true ? "This question is mandatory." : error }) }),
|
|
3525
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("p", { className: eyebrow, children: [
|
|
3406
3526
|
"Question ",
|
|
3407
3527
|
label
|
|
3408
3528
|
] }),
|
|
3409
|
-
/* @__PURE__ */ (0,
|
|
3529
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("h3", { className: "text-heading-h4 text-surface-foreground", children: [
|
|
3410
3530
|
title,
|
|
3411
|
-
required && /* @__PURE__ */ (0,
|
|
3412
|
-
required && /* @__PURE__ */ (0,
|
|
3531
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { "aria-hidden": "true", className: "text-destructive", children: "*" }),
|
|
3532
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "sr-only", children: " (required)" })
|
|
3413
3533
|
] })
|
|
3414
3534
|
] });
|
|
3415
3535
|
}
|
|
@@ -3417,8 +3537,8 @@ var QuestionHeader = React47.forwardRef(
|
|
|
3417
3537
|
QuestionHeader.displayName = "QuestionHeader";
|
|
3418
3538
|
|
|
3419
3539
|
// src/components/Question Types/QuestionEditorCard.tsx
|
|
3420
|
-
var
|
|
3421
|
-
var QuestionEditorCard =
|
|
3540
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
3541
|
+
var QuestionEditorCard = React50.forwardRef(
|
|
3422
3542
|
({
|
|
3423
3543
|
className,
|
|
3424
3544
|
number,
|
|
@@ -3454,7 +3574,7 @@ var QuestionEditorCard = React48.forwardRef(
|
|
|
3454
3574
|
...props
|
|
3455
3575
|
}, ref) => {
|
|
3456
3576
|
const footer = active && (countLabel != null || onAdd || onPaste);
|
|
3457
|
-
return /* @__PURE__ */ (0,
|
|
3577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
3458
3578
|
"div",
|
|
3459
3579
|
{
|
|
3460
3580
|
ref,
|
|
@@ -3466,7 +3586,7 @@ var QuestionEditorCard = React48.forwardRef(
|
|
|
3466
3586
|
props.onMouseDown?.(event);
|
|
3467
3587
|
},
|
|
3468
3588
|
children: [
|
|
3469
|
-
/* @__PURE__ */ (0,
|
|
3589
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
3470
3590
|
"div",
|
|
3471
3591
|
{
|
|
3472
3592
|
className: cn(
|
|
@@ -3474,9 +3594,9 @@ var QuestionEditorCard = React48.forwardRef(
|
|
|
3474
3594
|
active ? "border-accent" : "border-border"
|
|
3475
3595
|
),
|
|
3476
3596
|
children: [
|
|
3477
|
-
/* @__PURE__ */ (0,
|
|
3478
|
-
/* @__PURE__ */ (0,
|
|
3479
|
-
/* @__PURE__ */ (0,
|
|
3597
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: cn("flex flex-col p-6", footer ? "gap-5" : "gap-4"), children: [
|
|
3598
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
3599
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3480
3600
|
QuestionHeader,
|
|
3481
3601
|
{
|
|
3482
3602
|
editor: true,
|
|
@@ -3499,8 +3619,8 @@ var QuestionEditorCard = React48.forwardRef(
|
|
|
3499
3619
|
titleEditing,
|
|
3500
3620
|
meta,
|
|
3501
3621
|
maxLength,
|
|
3502
|
-
actions: actions ?? /* @__PURE__ */ (0,
|
|
3503
|
-
/* @__PURE__ */ (0,
|
|
3622
|
+
actions: actions ?? /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
3623
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3504
3624
|
Button,
|
|
3505
3625
|
{
|
|
3506
3626
|
type: "button",
|
|
@@ -3508,10 +3628,10 @@ var QuestionEditorCard = React48.forwardRef(
|
|
|
3508
3628
|
size: "icon-sm",
|
|
3509
3629
|
"aria-label": "Duplicate question",
|
|
3510
3630
|
onClick: onDuplicate,
|
|
3511
|
-
children: /* @__PURE__ */ (0,
|
|
3631
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react26.Copy, { size: 16, "aria-hidden": true })
|
|
3512
3632
|
}
|
|
3513
3633
|
),
|
|
3514
|
-
/* @__PURE__ */ (0,
|
|
3634
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3515
3635
|
Button,
|
|
3516
3636
|
{
|
|
3517
3637
|
type: "button",
|
|
@@ -3519,10 +3639,10 @@ var QuestionEditorCard = React48.forwardRef(
|
|
|
3519
3639
|
size: "icon-sm",
|
|
3520
3640
|
"aria-label": "Delete question",
|
|
3521
3641
|
onClick: onDelete,
|
|
3522
|
-
children: /* @__PURE__ */ (0,
|
|
3642
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react26.Trash, { size: 16, "aria-hidden": true })
|
|
3523
3643
|
}
|
|
3524
3644
|
),
|
|
3525
|
-
/* @__PURE__ */ (0,
|
|
3645
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3526
3646
|
Button,
|
|
3527
3647
|
{
|
|
3528
3648
|
type: "button",
|
|
@@ -3530,7 +3650,7 @@ var QuestionEditorCard = React48.forwardRef(
|
|
|
3530
3650
|
size: "icon-sm",
|
|
3531
3651
|
"aria-label": "Preview question",
|
|
3532
3652
|
onClick: onPreview,
|
|
3533
|
-
children: /* @__PURE__ */ (0,
|
|
3653
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react26.Eye, { size: 16, "aria-hidden": true })
|
|
3534
3654
|
}
|
|
3535
3655
|
)
|
|
3536
3656
|
] })
|
|
@@ -3538,18 +3658,18 @@ var QuestionEditorCard = React48.forwardRef(
|
|
|
3538
3658
|
),
|
|
3539
3659
|
children
|
|
3540
3660
|
] }),
|
|
3541
|
-
error && /* @__PURE__ */ (0,
|
|
3542
|
-
/* @__PURE__ */ (0,
|
|
3661
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("p", { className: "flex items-center gap-1 text-ui-caption text-destructive-foreground", children: [
|
|
3662
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react26.Warning, { size: 16, "aria-hidden": true, className: "shrink-0" }),
|
|
3543
3663
|
error
|
|
3544
3664
|
] }),
|
|
3545
|
-
footer && /* @__PURE__ */ (0,
|
|
3546
|
-
/* @__PURE__ */ (0,
|
|
3547
|
-
/* @__PURE__ */ (0,
|
|
3548
|
-
onAdd && /* @__PURE__ */ (0,
|
|
3549
|
-
/* @__PURE__ */ (0,
|
|
3665
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
3666
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { className: "text-ui-caption text-secondary-muted-foreground", children: countLabel }),
|
|
3667
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3668
|
+
onAdd && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Button, { type: "button", variant: "outline", onClick: onAdd, children: [
|
|
3669
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react26.Plus, { size: 16, "aria-hidden": true }),
|
|
3550
3670
|
"Add choice"
|
|
3551
3671
|
] }),
|
|
3552
|
-
onPaste && /* @__PURE__ */ (0,
|
|
3672
|
+
onPaste && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3553
3673
|
Button,
|
|
3554
3674
|
{
|
|
3555
3675
|
type: "button",
|
|
@@ -3557,17 +3677,17 @@ var QuestionEditorCard = React48.forwardRef(
|
|
|
3557
3677
|
size: "icon",
|
|
3558
3678
|
"aria-label": "Paste choices",
|
|
3559
3679
|
onClick: onPaste,
|
|
3560
|
-
children: /* @__PURE__ */ (0,
|
|
3680
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react26.Clipboard, { size: 16, "aria-hidden": true })
|
|
3561
3681
|
}
|
|
3562
3682
|
)
|
|
3563
3683
|
] })
|
|
3564
3684
|
] })
|
|
3565
3685
|
] }),
|
|
3566
|
-
note && /* @__PURE__ */ (0,
|
|
3686
|
+
note && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "border-t border-border px-2 py-2 text-body-small text-surface-foreground", children: note })
|
|
3567
3687
|
]
|
|
3568
3688
|
}
|
|
3569
3689
|
),
|
|
3570
|
-
onAskAi && /* @__PURE__ */ (0,
|
|
3690
|
+
onAskAi && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3571
3691
|
Button,
|
|
3572
3692
|
{
|
|
3573
3693
|
type: "button",
|
|
@@ -3576,7 +3696,7 @@ var QuestionEditorCard = React48.forwardRef(
|
|
|
3576
3696
|
"aria-label": "Ask AI",
|
|
3577
3697
|
onClick: onAskAi,
|
|
3578
3698
|
className: "shrink-0 opacity-0 transition-opacity group-hover/editor:opacity-100 group-focus-within/editor:opacity-100 group-data-[hovered]/editor:opacity-100 focus-visible:opacity-100",
|
|
3579
|
-
children: /* @__PURE__ */ (0,
|
|
3699
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react26.Sparkle, { size: 16, "aria-hidden": true })
|
|
3580
3700
|
}
|
|
3581
3701
|
)
|
|
3582
3702
|
]
|
|
@@ -3587,15 +3707,15 @@ var QuestionEditorCard = React48.forwardRef(
|
|
|
3587
3707
|
QuestionEditorCard.displayName = "QuestionEditorCard";
|
|
3588
3708
|
|
|
3589
3709
|
// src/components/Question Types/QuestionNavItem.tsx
|
|
3590
|
-
var
|
|
3591
|
-
var
|
|
3592
|
-
var
|
|
3593
|
-
var
|
|
3594
|
-
var QuestionNavItem =
|
|
3710
|
+
var React51 = __toESM(require("react"), 1);
|
|
3711
|
+
var import_react27 = require("@phosphor-icons/react");
|
|
3712
|
+
var import_radix_ui23 = require("radix-ui");
|
|
3713
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3714
|
+
var QuestionNavItem = React51.forwardRef(
|
|
3595
3715
|
({ className, questionType = "select-one", selected, error, warning, asChild, showDragHandle = true, hovered, children, ...props }, ref) => {
|
|
3596
|
-
const Comp = asChild ?
|
|
3716
|
+
const Comp = asChild ? import_radix_ui23.Slot.Root : "button";
|
|
3597
3717
|
const warn = !error && !!warning;
|
|
3598
|
-
return /* @__PURE__ */ (0,
|
|
3718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
3599
3719
|
Comp,
|
|
3600
3720
|
{
|
|
3601
3721
|
ref,
|
|
@@ -3614,9 +3734,9 @@ var QuestionNavItem = React49.forwardRef(
|
|
|
3614
3734
|
),
|
|
3615
3735
|
...props,
|
|
3616
3736
|
children: [
|
|
3617
|
-
/* @__PURE__ */ (0,
|
|
3618
|
-
showDragHandle && /* @__PURE__ */ (0,
|
|
3619
|
-
/* @__PURE__ */ (0,
|
|
3737
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { "aria-hidden": "true", className: "relative flex size-4 shrink-0 items-center justify-center", children: [
|
|
3738
|
+
showDragHandle && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react27.DotsSixVertical, { size: 16, className: "hidden group-hover/nav:block group-data-[hovered]/nav:block" }),
|
|
3739
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: showDragHandle ? "group-hover/nav:hidden group-data-[hovered]/nav:hidden" : void 0, children: error ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react27.WarningCircle, { size: 16, className: "text-destructive-foreground" }) : warn ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react27.Warning, { size: 16, className: "text-warning-foreground" }) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
3620
3740
|
QuestionTypeIcon,
|
|
3621
3741
|
{
|
|
3622
3742
|
type: questionType,
|
|
@@ -3625,9 +3745,9 @@ var QuestionNavItem = React49.forwardRef(
|
|
|
3625
3745
|
}
|
|
3626
3746
|
) })
|
|
3627
3747
|
] }),
|
|
3628
|
-
/* @__PURE__ */ (0,
|
|
3629
|
-
error && /* @__PURE__ */ (0,
|
|
3630
|
-
warn && /* @__PURE__ */ (0,
|
|
3748
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "min-w-0 flex-1 truncate", children }),
|
|
3749
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "sr-only", children: ", has errors" }),
|
|
3750
|
+
warn && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "sr-only", children: ", has warnings" })
|
|
3631
3751
|
]
|
|
3632
3752
|
}
|
|
3633
3753
|
);
|
|
@@ -3636,14 +3756,14 @@ var QuestionNavItem = React49.forwardRef(
|
|
|
3636
3756
|
QuestionNavItem.displayName = "QuestionNavItem";
|
|
3637
3757
|
|
|
3638
3758
|
// src/components/Question Types/QuestionOption.tsx
|
|
3639
|
-
var
|
|
3640
|
-
var
|
|
3641
|
-
var
|
|
3759
|
+
var React52 = __toESM(require("react"), 1);
|
|
3760
|
+
var import_react28 = require("@phosphor-icons/react");
|
|
3761
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3642
3762
|
var optionClasses = "flex w-full max-w-150 cursor-pointer items-center gap-2 rounded-md border border-border bg-surface px-4 py-2 text-body-base text-surface-foreground transition-colors hover:bg-accent-soft hover:shadow-md has-[[data-state=checked]]:border-accent-foreground has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-50";
|
|
3643
3763
|
function QuestionOption(props) {
|
|
3644
|
-
const id =
|
|
3645
|
-
return /* @__PURE__ */ (0,
|
|
3646
|
-
props.kind === "checkbox" ? /* @__PURE__ */ (0,
|
|
3764
|
+
const id = React52.useId();
|
|
3765
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("label", { htmlFor: id, className: cn(optionClasses, props.className), children: [
|
|
3766
|
+
props.kind === "checkbox" ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3647
3767
|
Checkbox,
|
|
3648
3768
|
{
|
|
3649
3769
|
id,
|
|
@@ -3652,16 +3772,16 @@ function QuestionOption(props) {
|
|
|
3652
3772
|
onCheckedChange: (next) => props.onCheckedChange?.(next === true),
|
|
3653
3773
|
disabled: props.disabled
|
|
3654
3774
|
}
|
|
3655
|
-
) : /* @__PURE__ */ (0,
|
|
3656
|
-
/* @__PURE__ */ (0,
|
|
3775
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(RadioGroupItem, { id, value: props.value, disabled: props.disabled }),
|
|
3776
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "min-w-0 flex-1", children: props.label })
|
|
3657
3777
|
] });
|
|
3658
3778
|
}
|
|
3659
|
-
var QuestionOtherOption =
|
|
3779
|
+
var QuestionOtherOption = React52.forwardRef(
|
|
3660
3780
|
({ className, onSubmit, confirmLabel = "Confirm answer", placeholder = "Type your answer", ...props }, ref) => {
|
|
3661
|
-
const inner =
|
|
3662
|
-
|
|
3781
|
+
const inner = React52.useRef(null);
|
|
3782
|
+
React52.useImperativeHandle(ref, () => inner.current);
|
|
3663
3783
|
const submit = () => onSubmit?.(inner.current?.value ?? "");
|
|
3664
|
-
return /* @__PURE__ */ (0,
|
|
3784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
3665
3785
|
"div",
|
|
3666
3786
|
{
|
|
3667
3787
|
className: cn(
|
|
@@ -3669,7 +3789,7 @@ var QuestionOtherOption = React50.forwardRef(
|
|
|
3669
3789
|
className
|
|
3670
3790
|
),
|
|
3671
3791
|
children: [
|
|
3672
|
-
/* @__PURE__ */ (0,
|
|
3792
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3673
3793
|
"input",
|
|
3674
3794
|
{
|
|
3675
3795
|
ref: inner,
|
|
@@ -3685,7 +3805,7 @@ var QuestionOtherOption = React50.forwardRef(
|
|
|
3685
3805
|
...props
|
|
3686
3806
|
}
|
|
3687
3807
|
),
|
|
3688
|
-
/* @__PURE__ */ (0,
|
|
3808
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Button, { type: "button", variant: "subtle", size: "icon-sm", "aria-label": confirmLabel, onClick: submit, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react28.Check, { size: 16, "aria-hidden": true }) })
|
|
3689
3809
|
]
|
|
3690
3810
|
}
|
|
3691
3811
|
);
|
|
@@ -3700,16 +3820,16 @@ function limitsText2(min, max) {
|
|
|
3700
3820
|
function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTone = "muted", minLength, maxLength, onRemove, onAdd, removeDisabled, addDisabled, className, kind, rank, dragHandleProps, lifted, locked, marks, onMarkApply, onMarkDismiss }) {
|
|
3701
3821
|
const reveal = kind !== void 0;
|
|
3702
3822
|
const guarded = minLength !== void 0 || maxLength !== void 0;
|
|
3703
|
-
const [draft, setDraft] =
|
|
3704
|
-
const [error, setError] =
|
|
3705
|
-
const helperId =
|
|
3706
|
-
const [focused, setFocused] =
|
|
3823
|
+
const [draft, setDraft] = React52.useState(null);
|
|
3824
|
+
const [error, setError] = React52.useState(null);
|
|
3825
|
+
const helperId = React52.useId();
|
|
3826
|
+
const [focused, setFocused] = React52.useState(false);
|
|
3707
3827
|
const showMarks = !!marks?.length && !focused && draft === null;
|
|
3708
|
-
const fieldRef =
|
|
3709
|
-
const [editMarks, setEditMarks] =
|
|
3710
|
-
const [scroll, setScroll] =
|
|
3828
|
+
const fieldRef = React52.useRef(null);
|
|
3829
|
+
const [editMarks, setEditMarks] = React52.useState([]);
|
|
3830
|
+
const [scroll, setScroll] = React52.useState(0);
|
|
3711
3831
|
const typed = guarded ? draft ?? label : label;
|
|
3712
|
-
const skipBlur =
|
|
3832
|
+
const skipBlur = React52.useRef(false);
|
|
3713
3833
|
const problemWith = (text) => minLength !== void 0 && text.trim().length < minLength ? `Enter at least ${minLength} ${minLength === 1 ? "character" : "characters"}.` : null;
|
|
3714
3834
|
const save = () => {
|
|
3715
3835
|
if (draft === null) return true;
|
|
@@ -3730,9 +3850,9 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
|
|
|
3730
3850
|
...dragHandleProps,
|
|
3731
3851
|
className: cn("cursor-grab touch-none select-none", dragHandleProps.className)
|
|
3732
3852
|
} : { "aria-hidden": true };
|
|
3733
|
-
const grip = dragHandleProps ? /* @__PURE__ */ (0,
|
|
3734
|
-
return /* @__PURE__ */ (0,
|
|
3735
|
-
/* @__PURE__ */ (0,
|
|
3853
|
+
const grip = dragHandleProps ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { ...gripProps, className: cn("shrink-0", gripProps.className), children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react28.DotsSixVertical, { size: 20, "aria-hidden": true, className: "text-surface-foreground" }) }) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react28.DotsSixVertical, { size: 20, "aria-hidden": true, className: "shrink-0 text-surface-foreground" });
|
|
3854
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: cn("group/option flex w-full items-center gap-2", className), children: [
|
|
3855
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3736
3856
|
"div",
|
|
3737
3857
|
{
|
|
3738
3858
|
className: cn(
|
|
@@ -3742,10 +3862,10 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
|
|
|
3742
3862
|
cn("border-border group-hover/option:shadow-md group-focus-within/option:shadow-md", lifted && "shadow-md")
|
|
3743
3863
|
) : "border-border hover:border-input-muted hover:shadow-md"
|
|
3744
3864
|
),
|
|
3745
|
-
children: /* @__PURE__ */ (0,
|
|
3746
|
-
(kind !== void 0 || !locked) && /* @__PURE__ */ (0,
|
|
3865
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex min-w-0 items-start gap-2", children: [
|
|
3866
|
+
(kind !== void 0 || !locked) && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "flex h-7 shrink-0 items-center gap-2", children: kind === "rank" ? /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
|
|
3747
3867
|
!locked && grip,
|
|
3748
|
-
/* @__PURE__ */ (0,
|
|
3868
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3749
3869
|
"span",
|
|
3750
3870
|
{
|
|
3751
3871
|
"aria-hidden": "true",
|
|
@@ -3753,8 +3873,8 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
|
|
|
3753
3873
|
children: rank
|
|
3754
3874
|
}
|
|
3755
3875
|
)
|
|
3756
|
-
] }) : reveal && locked ? /* @__PURE__ */ (0,
|
|
3757
|
-
/* @__PURE__ */ (0,
|
|
3876
|
+
] }) : reveal && locked ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { "aria-hidden": "true", className: "relative flex size-5 shrink-0 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: cn("inline-flex size-4 border-2 border-input bg-surface", kind === "radio" ? "rounded-full" : "rounded-xxs") }) }) : reveal ? /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("span", { ...gripProps, className: cn("relative flex size-5 shrink-0 items-center justify-center", gripProps.className), children: [
|
|
3877
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3758
3878
|
"span",
|
|
3759
3879
|
{
|
|
3760
3880
|
"aria-hidden": "true",
|
|
@@ -3765,8 +3885,8 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
|
|
|
3765
3885
|
)
|
|
3766
3886
|
}
|
|
3767
3887
|
),
|
|
3768
|
-
/* @__PURE__ */ (0,
|
|
3769
|
-
|
|
3888
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3889
|
+
import_react28.DotsSixVertical,
|
|
3770
3890
|
{
|
|
3771
3891
|
size: 20,
|
|
3772
3892
|
"aria-hidden": true,
|
|
@@ -3777,10 +3897,10 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
|
|
|
3777
3897
|
}
|
|
3778
3898
|
)
|
|
3779
3899
|
] }) : locked ? null : grip }),
|
|
3780
|
-
/* @__PURE__ */ (0,
|
|
3781
|
-
/* @__PURE__ */ (0,
|
|
3782
|
-
focused && editMarks.length > 0 && /* @__PURE__ */ (0,
|
|
3783
|
-
/* @__PURE__ */ (0,
|
|
3900
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
3901
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "relative min-w-0", children: [
|
|
3902
|
+
focused && editMarks.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(DraftMarks, { layer: "behind", singleLine: true, text: typed, marks: editMarks, scrollLeft: scroll, className: "flex items-center whitespace-pre text-body-base" }),
|
|
3903
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3784
3904
|
"input",
|
|
3785
3905
|
{
|
|
3786
3906
|
ref: fieldRef,
|
|
@@ -3835,24 +3955,24 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
|
|
|
3835
3955
|
)
|
|
3836
3956
|
}
|
|
3837
3957
|
),
|
|
3838
|
-
focused && editMarks.length > 0 && /* @__PURE__ */ (0,
|
|
3839
|
-
showMarks && /* @__PURE__ */ (0,
|
|
3840
|
-
(piece, i) => piece.mark ? /* @__PURE__ */ (0,
|
|
3958
|
+
focused && editMarks.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(DraftMarks, { layer: "over", singleLine: true, text: typed, marks: editMarks, scrollLeft: scroll, className: "flex items-center whitespace-pre text-body-base" }),
|
|
3959
|
+
showMarks && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { "aria-hidden": true, className: "pointer-events-none absolute inset-0 flex items-center overflow-hidden whitespace-pre text-body-base text-surface-foreground [&_[data-mark]]:pointer-events-auto", children: splitMarks(label, marks).map(
|
|
3960
|
+
(piece, i) => piece.mark ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(MarkedText, { mark: piece.mark, text: piece.text, onApply: onMarkApply, onDismiss: onMarkDismiss }, `${piece.mark.start}:${piece.text}`) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { children: piece.text }, i)
|
|
3841
3961
|
) })
|
|
3842
3962
|
] }),
|
|
3843
|
-
guarded && draft !== null && (error || lengthOutOfRange(draft, minLength, maxLength)) && /* @__PURE__ */ (0,
|
|
3963
|
+
guarded && draft !== null && (error || lengthOutOfRange(draft, minLength, maxLength)) && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
3844
3964
|
"p",
|
|
3845
3965
|
{
|
|
3846
3966
|
id: helperId,
|
|
3847
3967
|
role: error ? "alert" : void 0,
|
|
3848
3968
|
className: cn("flex items-start justify-between gap-2 text-ui-caption", error ? "text-destructive" : "text-secondary-muted-foreground"),
|
|
3849
3969
|
children: [
|
|
3850
|
-
/* @__PURE__ */ (0,
|
|
3851
|
-
error && /* @__PURE__ */ (0,
|
|
3970
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("span", { className: "flex items-start gap-2", children: [
|
|
3971
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react28.WarningCircle, { size: 16, "aria-hidden": true, className: "shrink-0" }),
|
|
3852
3972
|
limitsText2(minLength, maxLength),
|
|
3853
|
-
error && /* @__PURE__ */ (0,
|
|
3973
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "sr-only", children: error })
|
|
3854
3974
|
] }),
|
|
3855
|
-
/* @__PURE__ */ (0,
|
|
3975
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("span", { "aria-hidden": true, className: "shrink-0 tabular-nums", children: [
|
|
3856
3976
|
draft.length,
|
|
3857
3977
|
maxLength !== void 0 && `/${maxLength}`
|
|
3858
3978
|
] })
|
|
@@ -3863,7 +3983,7 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
|
|
|
3863
3983
|
] })
|
|
3864
3984
|
}
|
|
3865
3985
|
),
|
|
3866
|
-
!locked && /* @__PURE__ */ (0,
|
|
3986
|
+
!locked && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
3867
3987
|
"div",
|
|
3868
3988
|
{
|
|
3869
3989
|
className: cn(
|
|
@@ -3871,8 +3991,8 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
|
|
|
3871
3991
|
reveal && "opacity-0 transition-opacity group-hover/option:opacity-100 group-focus-within/option:opacity-100"
|
|
3872
3992
|
),
|
|
3873
3993
|
children: [
|
|
3874
|
-
/* @__PURE__ */ (0,
|
|
3875
|
-
/* @__PURE__ */ (0,
|
|
3994
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Button, { type: "button", variant: "destructive", size: "icon-sm", "aria-label": "Remove option", disabled: removeDisabled, onClick: onRemove, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react28.Trash, { size: 16, "aria-hidden": true }) }),
|
|
3995
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": "Add option", disabled: addDisabled, onClick: onAdd, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react28.Plus, { size: 16, "aria-hidden": true }) })
|
|
3876
3996
|
]
|
|
3877
3997
|
}
|
|
3878
3998
|
)
|
|
@@ -3880,9 +4000,9 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
|
|
|
3880
4000
|
}
|
|
3881
4001
|
|
|
3882
4002
|
// src/components/Question Types/RankList.tsx
|
|
3883
|
-
var
|
|
3884
|
-
var
|
|
3885
|
-
var
|
|
4003
|
+
var React53 = __toESM(require("react"), 1);
|
|
4004
|
+
var import_react29 = require("@phosphor-icons/react");
|
|
4005
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
3886
4006
|
function move(list, from, to) {
|
|
3887
4007
|
if (from === to || to < 0 || to >= list.length) return list;
|
|
3888
4008
|
const next = list.slice();
|
|
@@ -3890,13 +4010,13 @@ function move(list, from, to) {
|
|
|
3890
4010
|
next.splice(to, 0, item);
|
|
3891
4011
|
return next;
|
|
3892
4012
|
}
|
|
3893
|
-
var RankList =
|
|
4013
|
+
var RankList = React53.forwardRef(
|
|
3894
4014
|
({ className, items, onItemsChange, ...props }, ref) => {
|
|
3895
|
-
const [dragIndex, setDragIndex] =
|
|
3896
|
-
const [announcement, setAnnouncement] =
|
|
3897
|
-
const handles =
|
|
3898
|
-
const refocus =
|
|
3899
|
-
|
|
4015
|
+
const [dragIndex, setDragIndex] = React53.useState(null);
|
|
4016
|
+
const [announcement, setAnnouncement] = React53.useState("");
|
|
4017
|
+
const handles = React53.useRef(/* @__PURE__ */ new Map());
|
|
4018
|
+
const refocus = React53.useRef(null);
|
|
4019
|
+
React53.useEffect(() => {
|
|
3900
4020
|
if (refocus.current) {
|
|
3901
4021
|
handles.current.get(refocus.current)?.focus();
|
|
3902
4022
|
refocus.current = null;
|
|
@@ -3909,8 +4029,8 @@ var RankList = React51.forwardRef(
|
|
|
3909
4029
|
setAnnouncement(`Moved to position ${to + 1} of ${items.length}`);
|
|
3910
4030
|
onItemsChange(next);
|
|
3911
4031
|
};
|
|
3912
|
-
return /* @__PURE__ */ (0,
|
|
3913
|
-
/* @__PURE__ */ (0,
|
|
4032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_jsx_runtime54.Fragment, { children: [
|
|
4033
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.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_runtime54.jsxs)(
|
|
3914
4034
|
"li",
|
|
3915
4035
|
{
|
|
3916
4036
|
draggable: true,
|
|
@@ -3927,7 +4047,7 @@ var RankList = React51.forwardRef(
|
|
|
3927
4047
|
dragIndex === index && "opacity-50"
|
|
3928
4048
|
),
|
|
3929
4049
|
children: [
|
|
3930
|
-
/* @__PURE__ */ (0,
|
|
4050
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3931
4051
|
"button",
|
|
3932
4052
|
{
|
|
3933
4053
|
type: "button",
|
|
@@ -3946,10 +4066,10 @@ var RankList = React51.forwardRef(
|
|
|
3946
4066
|
}
|
|
3947
4067
|
},
|
|
3948
4068
|
className: "inline-flex shrink-0 cursor-grab rounded-xs text-surface-foreground",
|
|
3949
|
-
children: /* @__PURE__ */ (0,
|
|
4069
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_react29.DotsSixVertical, { size: 16, "aria-hidden": true })
|
|
3950
4070
|
}
|
|
3951
4071
|
),
|
|
3952
|
-
/* @__PURE__ */ (0,
|
|
4072
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3953
4073
|
"span",
|
|
3954
4074
|
{
|
|
3955
4075
|
"aria-hidden": "true",
|
|
@@ -3957,28 +4077,28 @@ var RankList = React51.forwardRef(
|
|
|
3957
4077
|
children: index + 1
|
|
3958
4078
|
}
|
|
3959
4079
|
),
|
|
3960
|
-
/* @__PURE__ */ (0,
|
|
4080
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "min-w-0 flex-1", children: item.label })
|
|
3961
4081
|
]
|
|
3962
4082
|
},
|
|
3963
4083
|
item.id
|
|
3964
4084
|
)) }),
|
|
3965
|
-
/* @__PURE__ */ (0,
|
|
4085
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { role: "status", "aria-live": "polite", className: "sr-only", children: announcement })
|
|
3966
4086
|
] });
|
|
3967
4087
|
}
|
|
3968
4088
|
);
|
|
3969
4089
|
RankList.displayName = "RankList";
|
|
3970
4090
|
|
|
3971
4091
|
// src/components/Question Types/RatingScale.tsx
|
|
3972
|
-
var
|
|
3973
|
-
var
|
|
3974
|
-
var
|
|
3975
|
-
var RatingScale =
|
|
4092
|
+
var React54 = __toESM(require("react"), 1);
|
|
4093
|
+
var import_radix_ui24 = require("radix-ui");
|
|
4094
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4095
|
+
var RatingScale = React54.forwardRef(
|
|
3976
4096
|
({ className, max = 5, value, defaultValue, onValueChange, lowLabel, highLabel, ...props }, ref) => {
|
|
3977
|
-
const [internal, setInternal] =
|
|
4097
|
+
const [internal, setInternal] = React54.useState(defaultValue);
|
|
3978
4098
|
const current = value !== void 0 ? value : internal;
|
|
3979
|
-
return /* @__PURE__ */ (0,
|
|
3980
|
-
/* @__PURE__ */ (0,
|
|
3981
|
-
|
|
4099
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: cn("flex w-full max-w-150 flex-col gap-2", className), children: [
|
|
4100
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
4101
|
+
import_radix_ui24.ToggleGroup.Root,
|
|
3982
4102
|
{
|
|
3983
4103
|
ref,
|
|
3984
4104
|
type: "single",
|
|
@@ -3990,8 +4110,8 @@ var RatingScale = React52.forwardRef(
|
|
|
3990
4110
|
},
|
|
3991
4111
|
className: "flex gap-2",
|
|
3992
4112
|
...props,
|
|
3993
|
-
children: Array.from({ length: max }, (_, i) => i + 1).map((n) => /* @__PURE__ */ (0,
|
|
3994
|
-
|
|
4113
|
+
children: Array.from({ length: max }, (_, i) => i + 1).map((n) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
4114
|
+
import_radix_ui24.ToggleGroup.Item,
|
|
3995
4115
|
{
|
|
3996
4116
|
value: String(n),
|
|
3997
4117
|
"aria-label": `${n}`,
|
|
@@ -4006,9 +4126,9 @@ var RatingScale = React52.forwardRef(
|
|
|
4006
4126
|
))
|
|
4007
4127
|
}
|
|
4008
4128
|
),
|
|
4009
|
-
(lowLabel != null || highLabel != null) && /* @__PURE__ */ (0,
|
|
4010
|
-
/* @__PURE__ */ (0,
|
|
4011
|
-
/* @__PURE__ */ (0,
|
|
4129
|
+
(lowLabel != null || highLabel != null) && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex justify-between text-ui-caption text-secondary-muted-foreground", "aria-hidden": "true", children: [
|
|
4130
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { children: lowLabel }),
|
|
4131
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { children: highLabel })
|
|
4012
4132
|
] })
|
|
4013
4133
|
] });
|
|
4014
4134
|
}
|
|
@@ -4016,15 +4136,15 @@ var RatingScale = React52.forwardRef(
|
|
|
4016
4136
|
RatingScale.displayName = "RatingScale";
|
|
4017
4137
|
|
|
4018
4138
|
// src/components/Question Types/StimulusCard.tsx
|
|
4019
|
-
var
|
|
4020
|
-
var
|
|
4021
|
-
var
|
|
4139
|
+
var React55 = __toESM(require("react"), 1);
|
|
4140
|
+
var import_react30 = require("@phosphor-icons/react");
|
|
4141
|
+
var import_jsx_runtime56 = (
|
|
4022
4142
|
// Out of flow, so the image's own size never sets the thumbnail's size.
|
|
4023
4143
|
require("react/jsx-runtime")
|
|
4024
4144
|
);
|
|
4025
4145
|
var MIN_THUMBNAIL = 92;
|
|
4026
4146
|
var MAX_THUMBNAIL = 240;
|
|
4027
|
-
var StimulusCard =
|
|
4147
|
+
var StimulusCard = React55.forwardRef(
|
|
4028
4148
|
({
|
|
4029
4149
|
className,
|
|
4030
4150
|
thumbnail,
|
|
@@ -4041,14 +4161,14 @@ var StimulusCard = React53.forwardRef(
|
|
|
4041
4161
|
removeLabel = "Remove stimulus",
|
|
4042
4162
|
...props
|
|
4043
4163
|
}, ref) => {
|
|
4044
|
-
const [failedSrc, setFailedSrc] =
|
|
4164
|
+
const [failedSrc, setFailedSrc] = React55.useState();
|
|
4045
4165
|
const error = status === "error" || thumbnail !== void 0 && failedSrc === thumbnail;
|
|
4046
4166
|
const showImage = thumbnail !== void 0 && !error;
|
|
4047
|
-
const [draft, setDraft] =
|
|
4167
|
+
const [draft, setDraft] = React55.useState(null);
|
|
4048
4168
|
const count = (draft ?? caption ?? "").length;
|
|
4049
|
-
const textRef =
|
|
4050
|
-
const [thumbnailSize, setThumbnailSize] =
|
|
4051
|
-
|
|
4169
|
+
const textRef = React55.useRef(null);
|
|
4170
|
+
const [thumbnailSize, setThumbnailSize] = React55.useState(MIN_THUMBNAIL);
|
|
4171
|
+
React55.useEffect(() => {
|
|
4052
4172
|
const el = textRef.current;
|
|
4053
4173
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
4054
4174
|
const observer = new ResizeObserver(() => {
|
|
@@ -4057,7 +4177,7 @@ var StimulusCard = React53.forwardRef(
|
|
|
4057
4177
|
observer.observe(el);
|
|
4058
4178
|
return () => observer.disconnect();
|
|
4059
4179
|
}, []);
|
|
4060
|
-
return /* @__PURE__ */ (0,
|
|
4180
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
4061
4181
|
"div",
|
|
4062
4182
|
{
|
|
4063
4183
|
ref,
|
|
@@ -4065,8 +4185,8 @@ var StimulusCard = React53.forwardRef(
|
|
|
4065
4185
|
className: cn("flex min-h-24.5 w-full items-center gap-4 rounded-md border border-border p-0.5 pr-4", className),
|
|
4066
4186
|
...props,
|
|
4067
4187
|
children: [
|
|
4068
|
-
/* @__PURE__ */ (0,
|
|
4069
|
-
/* @__PURE__ */ (0,
|
|
4188
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-4", children: [
|
|
4189
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
4070
4190
|
"span",
|
|
4071
4191
|
{
|
|
4072
4192
|
style: { width: thumbnailSize, height: thumbnailSize },
|
|
@@ -4075,12 +4195,12 @@ var StimulusCard = React53.forwardRef(
|
|
|
4075
4195
|
error ? "border-destructive-soft-border bg-destructive-soft bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-destructive" : "border-border bg-background bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-surface-foreground",
|
|
4076
4196
|
showImage && "bg-none"
|
|
4077
4197
|
),
|
|
4078
|
-
children: showImage ? /* @__PURE__ */ (0,
|
|
4198
|
+
children: showImage ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("img", { src: thumbnail, alt: thumbnailAlt, className: "absolute inset-0 size-full object-cover", onError: () => setFailedSrc(thumbnail) }) : error ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react30.ImageBroken, { size: 24, "aria-hidden": true }) : icon ?? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react30.Image, { size: 24, "aria-hidden": true })
|
|
4079
4199
|
}
|
|
4080
4200
|
),
|
|
4081
|
-
/* @__PURE__ */ (0,
|
|
4082
|
-
/* @__PURE__ */ (0,
|
|
4083
|
-
onCaptionChange ? /* @__PURE__ */ (0,
|
|
4201
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { ref: textRef, className: "flex min-w-0 flex-1 flex-col justify-center gap-2 py-2 text-surface-foreground", children: [
|
|
4202
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "w-full text-ui-label", children: label }),
|
|
4203
|
+
onCaptionChange ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
4084
4204
|
InlineEdit,
|
|
4085
4205
|
{
|
|
4086
4206
|
variant: "question",
|
|
@@ -4097,8 +4217,8 @@ var StimulusCard = React53.forwardRef(
|
|
|
4097
4217
|
},
|
|
4098
4218
|
textClassName: "text-body-base"
|
|
4099
4219
|
}
|
|
4100
|
-
) : /* @__PURE__ */ (0,
|
|
4101
|
-
onCaptionChange && showCounter && maxLength !== void 0 && count > maxLength && /* @__PURE__ */ (0,
|
|
4220
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "w-full text-body-base [word-break:break-word]", children: caption }),
|
|
4221
|
+
onCaptionChange && showCounter && maxLength !== void 0 && count > maxLength && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("p", { className: "text-ui-caption text-secondary-muted-foreground", children: [
|
|
4102
4222
|
count,
|
|
4103
4223
|
"/",
|
|
4104
4224
|
maxLength,
|
|
@@ -4106,7 +4226,7 @@ var StimulusCard = React53.forwardRef(
|
|
|
4106
4226
|
] })
|
|
4107
4227
|
] })
|
|
4108
4228
|
] }),
|
|
4109
|
-
onRemove && /* @__PURE__ */ (0,
|
|
4229
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Button, { type: "button", variant: "destructive", size: "icon-sm", "aria-label": removeLabel, onClick: onRemove, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react30.Trash, { size: 16, "aria-hidden": true }) })
|
|
4110
4230
|
]
|
|
4111
4231
|
}
|
|
4112
4232
|
);
|
|
@@ -4115,28 +4235,28 @@ var StimulusCard = React53.forwardRef(
|
|
|
4115
4235
|
StimulusCard.displayName = "StimulusCard";
|
|
4116
4236
|
|
|
4117
4237
|
// src/components/Data Display/Progress.tsx
|
|
4118
|
-
var
|
|
4119
|
-
var
|
|
4120
|
-
var
|
|
4121
|
-
var Progress =
|
|
4238
|
+
var React56 = __toESM(require("react"), 1);
|
|
4239
|
+
var import_radix_ui25 = require("radix-ui");
|
|
4240
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4241
|
+
var Progress = React56.forwardRef(
|
|
4122
4242
|
({ className, value = 0, label, valueLabel, detailsStart, detailsEnd, ...props }, ref) => {
|
|
4123
4243
|
const hasHeader = label != null || valueLabel != null;
|
|
4124
4244
|
const hasDetails = detailsStart != null || detailsEnd != null;
|
|
4125
4245
|
const clamped = Math.min(100, Math.max(0, value ?? 0));
|
|
4126
|
-
return /* @__PURE__ */ (0,
|
|
4127
|
-
hasHeader && /* @__PURE__ */ (0,
|
|
4128
|
-
/* @__PURE__ */ (0,
|
|
4129
|
-
/* @__PURE__ */ (0,
|
|
4246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: cn("flex w-full flex-col gap-2", className), children: [
|
|
4247
|
+
hasHeader && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex items-center justify-between text-ui-label text-surface-foreground", children: [
|
|
4248
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { children: label }),
|
|
4249
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { children: valueLabel === true ? `${Math.round(clamped)}%` : valueLabel })
|
|
4130
4250
|
] }),
|
|
4131
|
-
/* @__PURE__ */ (0,
|
|
4132
|
-
|
|
4251
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4252
|
+
import_radix_ui25.Progress.Root,
|
|
4133
4253
|
{
|
|
4134
4254
|
ref,
|
|
4135
4255
|
value: clamped,
|
|
4136
4256
|
className: "relative h-2 w-full overflow-hidden rounded-full bg-secondary",
|
|
4137
4257
|
...props,
|
|
4138
|
-
children: /* @__PURE__ */ (0,
|
|
4139
|
-
|
|
4258
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4259
|
+
import_radix_ui25.Progress.Indicator,
|
|
4140
4260
|
{
|
|
4141
4261
|
className: "h-full rounded-full bg-accent transition-[width]",
|
|
4142
4262
|
style: { width: `${clamped}%` }
|
|
@@ -4144,9 +4264,9 @@ var Progress = React54.forwardRef(
|
|
|
4144
4264
|
)
|
|
4145
4265
|
}
|
|
4146
4266
|
),
|
|
4147
|
-
hasDetails && /* @__PURE__ */ (0,
|
|
4148
|
-
/* @__PURE__ */ (0,
|
|
4149
|
-
/* @__PURE__ */ (0,
|
|
4267
|
+
hasDetails && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex items-start justify-between text-ui-label leading-5 text-secondary-muted-foreground", children: [
|
|
4268
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { children: detailsStart }),
|
|
4269
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { children: detailsEnd })
|
|
4150
4270
|
] })
|
|
4151
4271
|
] });
|
|
4152
4272
|
}
|
|
@@ -4154,11 +4274,11 @@ var Progress = React54.forwardRef(
|
|
|
4154
4274
|
Progress.displayName = "Progress";
|
|
4155
4275
|
|
|
4156
4276
|
// src/components/Data Display/Table.tsx
|
|
4157
|
-
var
|
|
4158
|
-
var
|
|
4159
|
-
var
|
|
4160
|
-
var Table =
|
|
4161
|
-
({ className, containerClassName, containerRef, striped, ...props }, ref) => /* @__PURE__ */ (0,
|
|
4277
|
+
var React57 = __toESM(require("react"), 1);
|
|
4278
|
+
var import_react31 = require("@phosphor-icons/react");
|
|
4279
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4280
|
+
var Table = React57.forwardRef(
|
|
4281
|
+
({ className, containerClassName, containerRef, striped, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { ref: containerRef, className: cn("relative w-full overflow-auto rounded-lg border border-border bg-surface", containerClassName), children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4162
4282
|
"table",
|
|
4163
4283
|
{
|
|
4164
4284
|
ref,
|
|
@@ -4169,20 +4289,20 @@ var Table = React55.forwardRef(
|
|
|
4169
4289
|
) })
|
|
4170
4290
|
);
|
|
4171
4291
|
Table.displayName = "Table";
|
|
4172
|
-
var TableHeader =
|
|
4173
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
4292
|
+
var TableHeader = React57.forwardRef(
|
|
4293
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("thead", { ref, className, ...props })
|
|
4174
4294
|
);
|
|
4175
4295
|
TableHeader.displayName = "TableHeader";
|
|
4176
|
-
var TableFooter =
|
|
4177
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
4296
|
+
var TableFooter = React57.forwardRef(
|
|
4297
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("tfoot", { ref, className: cn("border-t border-border bg-background text-ui-label", className), ...props })
|
|
4178
4298
|
);
|
|
4179
4299
|
TableFooter.displayName = "TableFooter";
|
|
4180
|
-
var TableBody =
|
|
4181
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
4300
|
+
var TableBody = React57.forwardRef(
|
|
4301
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("tbody", { ref, className, ...props })
|
|
4182
4302
|
);
|
|
4183
4303
|
TableBody.displayName = "TableBody";
|
|
4184
|
-
var TableRow =
|
|
4185
|
-
({ className, selected, ...props }, ref) => /* @__PURE__ */ (0,
|
|
4304
|
+
var TableRow = React57.forwardRef(
|
|
4305
|
+
({ className, selected, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4186
4306
|
"tr",
|
|
4187
4307
|
{
|
|
4188
4308
|
ref,
|
|
@@ -4199,10 +4319,10 @@ var TableRow = React55.forwardRef(
|
|
|
4199
4319
|
);
|
|
4200
4320
|
TableRow.displayName = "TableRow";
|
|
4201
4321
|
var ariaSort = { none: "none", asc: "ascending", desc: "descending" };
|
|
4202
|
-
var TableHead =
|
|
4322
|
+
var TableHead = React57.forwardRef(
|
|
4203
4323
|
({ className, align = "left", sortable, sort = "none", onSort, checkbox, resizer, children, ...props }, ref) => {
|
|
4204
|
-
const caret = sort === "asc" ? /* @__PURE__ */ (0,
|
|
4205
|
-
return /* @__PURE__ */ (0,
|
|
4324
|
+
const caret = sort === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_react31.CaretUp, { size: 16, "aria-hidden": true, className: "shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_react31.CaretDown, { size: 16, "aria-hidden": true, className: "shrink-0" });
|
|
4325
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
4206
4326
|
"th",
|
|
4207
4327
|
{
|
|
4208
4328
|
ref,
|
|
@@ -4217,7 +4337,7 @@ var TableHead = React55.forwardRef(
|
|
|
4217
4337
|
),
|
|
4218
4338
|
...props,
|
|
4219
4339
|
children: [
|
|
4220
|
-
sortable ? /* @__PURE__ */ (0,
|
|
4340
|
+
sortable ? /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
4221
4341
|
"button",
|
|
4222
4342
|
{
|
|
4223
4343
|
type: "button",
|
|
@@ -4228,7 +4348,7 @@ var TableHead = React55.forwardRef(
|
|
|
4228
4348
|
caret
|
|
4229
4349
|
]
|
|
4230
4350
|
}
|
|
4231
|
-
) : checkbox ? /* @__PURE__ */ (0,
|
|
4351
|
+
) : checkbox ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "flex items-center justify-center", children }) : children,
|
|
4232
4352
|
resizer
|
|
4233
4353
|
]
|
|
4234
4354
|
}
|
|
@@ -4236,8 +4356,8 @@ var TableHead = React55.forwardRef(
|
|
|
4236
4356
|
}
|
|
4237
4357
|
);
|
|
4238
4358
|
TableHead.displayName = "TableHead";
|
|
4239
|
-
var TableCell =
|
|
4240
|
-
({ className, align = "left", muted, checkbox, actions, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
4359
|
+
var TableCell = React57.forwardRef(
|
|
4360
|
+
({ className, align = "left", muted, checkbox, actions, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4241
4361
|
"td",
|
|
4242
4362
|
{
|
|
4243
4363
|
ref,
|
|
@@ -4250,31 +4370,31 @@ var TableCell = React55.forwardRef(
|
|
|
4250
4370
|
className
|
|
4251
4371
|
),
|
|
4252
4372
|
...props,
|
|
4253
|
-
children: checkbox ? /* @__PURE__ */ (0,
|
|
4373
|
+
children: checkbox ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "flex items-center justify-center", children }) : actions ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "flex items-start justify-end gap-1", children }) : children
|
|
4254
4374
|
}
|
|
4255
4375
|
)
|
|
4256
4376
|
);
|
|
4257
4377
|
TableCell.displayName = "TableCell";
|
|
4258
4378
|
function TableCellTwoLines({ primary, secondary, avatar, className, ...props }) {
|
|
4259
|
-
return /* @__PURE__ */ (0,
|
|
4379
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: cn("flex items-center gap-2", className), ...props, children: [
|
|
4260
4380
|
avatar,
|
|
4261
|
-
/* @__PURE__ */ (0,
|
|
4262
|
-
/* @__PURE__ */ (0,
|
|
4263
|
-
secondary && /* @__PURE__ */ (0,
|
|
4381
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "flex flex-col gap-0.5 whitespace-nowrap", children: [
|
|
4382
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "text-ui-label text-surface-foreground", children: primary }),
|
|
4383
|
+
secondary && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "text-ui-caption text-secondary-muted-foreground", children: secondary })
|
|
4264
4384
|
] })
|
|
4265
4385
|
] });
|
|
4266
4386
|
}
|
|
4267
4387
|
|
|
4268
4388
|
// src/components/Data Display/DataTable.tsx
|
|
4269
|
-
var
|
|
4270
|
-
var
|
|
4389
|
+
var React59 = __toESM(require("react"), 1);
|
|
4390
|
+
var import_react33 = require("@phosphor-icons/react");
|
|
4271
4391
|
var import_react_table = require("@tanstack/react-table");
|
|
4272
4392
|
var import_react_virtual = require("@tanstack/react-virtual");
|
|
4273
4393
|
|
|
4274
4394
|
// src/components/Utility/Pagination.tsx
|
|
4275
|
-
var
|
|
4276
|
-
var
|
|
4277
|
-
var
|
|
4395
|
+
var React58 = __toESM(require("react"), 1);
|
|
4396
|
+
var import_react32 = require("@phosphor-icons/react");
|
|
4397
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4278
4398
|
function getPaginationItems(page, pageCount, siblings = 1) {
|
|
4279
4399
|
const keep = /* @__PURE__ */ new Set([1, pageCount]);
|
|
4280
4400
|
for (let p = page - siblings; p <= page + siblings; p++) if (p >= 1 && p <= pageCount) keep.add(p);
|
|
@@ -4288,10 +4408,10 @@ function getPaginationItems(page, pageCount, siblings = 1) {
|
|
|
4288
4408
|
});
|
|
4289
4409
|
return items;
|
|
4290
4410
|
}
|
|
4291
|
-
var Pagination =
|
|
4411
|
+
var Pagination = React58.forwardRef(
|
|
4292
4412
|
({ className, page, pageCount, onPageChange, variant = "full", siblings = 1, ...props }, ref) => {
|
|
4293
4413
|
const go = (next2) => onPageChange(Math.min(pageCount, Math.max(1, next2)));
|
|
4294
|
-
const previous = /* @__PURE__ */ (0,
|
|
4414
|
+
const previous = /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4295
4415
|
Button,
|
|
4296
4416
|
{
|
|
4297
4417
|
type: "button",
|
|
@@ -4300,10 +4420,10 @@ var Pagination = React56.forwardRef(
|
|
|
4300
4420
|
"aria-label": "Previous page",
|
|
4301
4421
|
disabled: page <= 1,
|
|
4302
4422
|
onClick: () => go(page - 1),
|
|
4303
|
-
children: /* @__PURE__ */ (0,
|
|
4423
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react32.ArrowLeft, { size: 16, "aria-hidden": true })
|
|
4304
4424
|
}
|
|
4305
4425
|
);
|
|
4306
|
-
const next = /* @__PURE__ */ (0,
|
|
4426
|
+
const next = /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4307
4427
|
Button,
|
|
4308
4428
|
{
|
|
4309
4429
|
type: "button",
|
|
@@ -4312,10 +4432,10 @@ var Pagination = React56.forwardRef(
|
|
|
4312
4432
|
"aria-label": "Next page",
|
|
4313
4433
|
disabled: page >= pageCount,
|
|
4314
4434
|
onClick: () => go(page + 1),
|
|
4315
|
-
children: /* @__PURE__ */ (0,
|
|
4435
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react32.ArrowRight, { size: 16, "aria-hidden": true })
|
|
4316
4436
|
}
|
|
4317
4437
|
);
|
|
4318
|
-
return /* @__PURE__ */ (0,
|
|
4438
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
4319
4439
|
"nav",
|
|
4320
4440
|
{
|
|
4321
4441
|
ref,
|
|
@@ -4324,14 +4444,14 @@ var Pagination = React56.forwardRef(
|
|
|
4324
4444
|
...props,
|
|
4325
4445
|
children: [
|
|
4326
4446
|
previous,
|
|
4327
|
-
variant === "compact" ? /* @__PURE__ */ (0,
|
|
4447
|
+
variant === "compact" ? /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("span", { className: "text-body-small text-surface-foreground", "aria-live": "polite", children: [
|
|
4328
4448
|
page,
|
|
4329
4449
|
"/",
|
|
4330
4450
|
pageCount
|
|
4331
|
-
] }) : /* @__PURE__ */ (0,
|
|
4332
|
-
/* @__PURE__ */ (0,
|
|
4333
|
-
/* @__PURE__ */ (0,
|
|
4334
|
-
] }) : /* @__PURE__ */ (0,
|
|
4451
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("ul", { className: "flex items-center gap-2", children: getPaginationItems(page, pageCount, siblings).map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("li", { children: item === "ellipsis" ? /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("span", { className: "inline-flex size-8 items-center justify-center rounded-sm border border-border bg-surface text-surface-foreground", children: [
|
|
4452
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react32.DotsThree, { size: 16, "aria-hidden": true }),
|
|
4453
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "sr-only", children: "More pages" })
|
|
4454
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4335
4455
|
Button,
|
|
4336
4456
|
{
|
|
4337
4457
|
type: "button",
|
|
@@ -4352,7 +4472,7 @@ var Pagination = React56.forwardRef(
|
|
|
4352
4472
|
Pagination.displayName = "Pagination";
|
|
4353
4473
|
|
|
4354
4474
|
// src/components/Data Display/DataTable.tsx
|
|
4355
|
-
var
|
|
4475
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
4356
4476
|
var features = (0, import_react_table.tableFeatures)({
|
|
4357
4477
|
rowSortingFeature: import_react_table.rowSortingFeature,
|
|
4358
4478
|
rowPaginationFeature: import_react_table.rowPaginationFeature,
|
|
@@ -4407,9 +4527,9 @@ var features = (0, import_react_table.tableFeatures)({
|
|
|
4407
4527
|
});
|
|
4408
4528
|
var getMeta = (meta) => meta ?? {};
|
|
4409
4529
|
function useControllable(value, initial, onChange) {
|
|
4410
|
-
const [internal, setInternal] =
|
|
4530
|
+
const [internal, setInternal] = React59.useState(initial);
|
|
4411
4531
|
const current = value ?? internal;
|
|
4412
|
-
const update =
|
|
4532
|
+
const update = React59.useCallback(
|
|
4413
4533
|
(updater) => {
|
|
4414
4534
|
const next = typeof updater === "function" ? updater(current) : updater;
|
|
4415
4535
|
if (value === void 0) setInternal(next);
|
|
@@ -4448,16 +4568,16 @@ function ColumnFilter({ column }) {
|
|
|
4448
4568
|
const value = column.getFilterValue();
|
|
4449
4569
|
if (variant === "select") {
|
|
4450
4570
|
const options = [...column.getFacetedUniqueValues().entries()].sort((a, b) => String(a[0]).localeCompare(String(b[0])));
|
|
4451
|
-
return /* @__PURE__ */ (0,
|
|
4571
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
4452
4572
|
Select,
|
|
4453
4573
|
{
|
|
4454
4574
|
value: typeof value === "string" ? value : ALL,
|
|
4455
4575
|
onValueChange: (next) => column.setFilterValue(next === ALL ? void 0 : next),
|
|
4456
4576
|
children: [
|
|
4457
|
-
/* @__PURE__ */ (0,
|
|
4458
|
-
/* @__PURE__ */ (0,
|
|
4459
|
-
/* @__PURE__ */ (0,
|
|
4460
|
-
options.map(([option, count]) => /* @__PURE__ */ (0,
|
|
4577
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(SelectTrigger, { "aria-label": `Filter ${label}`, className: "h-8 text-body-small", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(SelectValue, {}) }),
|
|
4578
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(SelectContent, { children: [
|
|
4579
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(SelectItem, { value: ALL, children: "All" }),
|
|
4580
|
+
options.map(([option, count]) => /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(SelectItem, { value: String(option), children: [
|
|
4461
4581
|
String(option),
|
|
4462
4582
|
" (",
|
|
4463
4583
|
count,
|
|
@@ -4476,8 +4596,8 @@ function ColumnFilter({ column }) {
|
|
|
4476
4596
|
next[index] = raw === "" ? void 0 : Number(raw);
|
|
4477
4597
|
column.setFilterValue(next[0] === void 0 && next[1] === void 0 ? void 0 : next);
|
|
4478
4598
|
};
|
|
4479
|
-
return /* @__PURE__ */ (0,
|
|
4480
|
-
/* @__PURE__ */ (0,
|
|
4599
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex gap-1", children: [
|
|
4600
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4481
4601
|
Input,
|
|
4482
4602
|
{
|
|
4483
4603
|
type: "number",
|
|
@@ -4488,7 +4608,7 @@ function ColumnFilter({ column }) {
|
|
|
4488
4608
|
className: "h-8 text-body-small"
|
|
4489
4609
|
}
|
|
4490
4610
|
),
|
|
4491
|
-
/* @__PURE__ */ (0,
|
|
4611
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4492
4612
|
Input,
|
|
4493
4613
|
{
|
|
4494
4614
|
type: "number",
|
|
@@ -4501,7 +4621,7 @@ function ColumnFilter({ column }) {
|
|
|
4501
4621
|
)
|
|
4502
4622
|
] });
|
|
4503
4623
|
}
|
|
4504
|
-
return /* @__PURE__ */ (0,
|
|
4624
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4505
4625
|
Input,
|
|
4506
4626
|
{
|
|
4507
4627
|
"aria-label": `Filter ${label}`,
|
|
@@ -4514,9 +4634,9 @@ function ColumnFilter({ column }) {
|
|
|
4514
4634
|
}
|
|
4515
4635
|
function EditableCell({ value, label, type, onCommit }) {
|
|
4516
4636
|
const initial = value == null ? "" : String(value);
|
|
4517
|
-
const [draft, setDraft] =
|
|
4518
|
-
const cancelled =
|
|
4519
|
-
return /* @__PURE__ */ (0,
|
|
4637
|
+
const [draft, setDraft] = React59.useState(null);
|
|
4638
|
+
const cancelled = React59.useRef(false);
|
|
4639
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4520
4640
|
Input,
|
|
4521
4641
|
{
|
|
4522
4642
|
type,
|
|
@@ -4654,7 +4774,7 @@ function DataTableInner({
|
|
|
4654
4774
|
onPaginationChange
|
|
4655
4775
|
);
|
|
4656
4776
|
const [density, setDensity] = useControllable(densityProp, "default", onDensityChange);
|
|
4657
|
-
const [cellSelection, setCellSelection] =
|
|
4777
|
+
const [cellSelection, setCellSelection] = React59.useState([]);
|
|
4658
4778
|
const infinite = Boolean(onLoadMore);
|
|
4659
4779
|
const paginate = !virtualized && !infinite;
|
|
4660
4780
|
const compact = density === "compact";
|
|
@@ -4727,12 +4847,12 @@ function DataTableInner({
|
|
|
4727
4847
|
const cellDensity = compact ? "h-8 py-1.5" : void 0;
|
|
4728
4848
|
const allSelected = table.getIsAllPageRowsSelected();
|
|
4729
4849
|
const someSelected = table.getIsSomePageRowsSelected();
|
|
4730
|
-
const dragged =
|
|
4850
|
+
const dragged = React59.useRef(null);
|
|
4731
4851
|
const topRows = enableRowPinning ? table.getTopRows() : [];
|
|
4732
4852
|
const bottomRows = enableRowPinning ? table.getBottomRows() : [];
|
|
4733
4853
|
const bodyRows = enableRowPinning ? table.getCenterRows() : table.getRowModel().rows;
|
|
4734
|
-
const scrollRef =
|
|
4735
|
-
const setScrollRef =
|
|
4854
|
+
const scrollRef = React59.useRef(null);
|
|
4855
|
+
const setScrollRef = React59.useCallback(
|
|
4736
4856
|
(node) => {
|
|
4737
4857
|
scrollRef.current = node;
|
|
4738
4858
|
if (typeof containerRef === "function") containerRef(node);
|
|
@@ -4751,8 +4871,8 @@ function DataTableInner({
|
|
|
4751
4871
|
const virtualItems = virtualized ? virtualizer.getVirtualItems() : [];
|
|
4752
4872
|
const paddingTop = virtualItems.length > 0 ? virtualItems[0]?.start ?? 0 : 0;
|
|
4753
4873
|
const paddingBottom = virtualItems.length > 0 ? virtualizer.getTotalSize() - (virtualItems.at(-1)?.end ?? 0) : 0;
|
|
4754
|
-
const sentinelRef =
|
|
4755
|
-
|
|
4874
|
+
const sentinelRef = React59.useRef(null);
|
|
4875
|
+
React59.useEffect(() => {
|
|
4756
4876
|
const node = sentinelRef.current;
|
|
4757
4877
|
if (!node || !onLoadMore || !hasMore || loadingMore || typeof IntersectionObserver === "undefined") return;
|
|
4758
4878
|
const container = scrollRef.current;
|
|
@@ -4793,15 +4913,15 @@ function DataTableInner({
|
|
|
4793
4913
|
table.resetCellSelection(true);
|
|
4794
4914
|
}
|
|
4795
4915
|
};
|
|
4796
|
-
const skeletonRow = (rowKey) => /* @__PURE__ */ (0,
|
|
4916
|
+
const skeletonRow = (rowKey) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TableRow, { className: "hover:bg-transparent", children: Array.from({ length: columnSpan }, (_, cell) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TableCell, { checkbox: enableRowSelection && cell === 0, className: cellDensity, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { "aria-hidden": true, className: "block h-4 w-3/4 animate-pulse rounded-xs bg-border" }) }, cell)) }, rowKey);
|
|
4797
4917
|
const renderRow = (row, options = {}) => {
|
|
4798
4918
|
const { pinned, pinnedIndex = 0, pinnedCount = 1, virtualIndex } = options;
|
|
4799
4919
|
const grouped = row.getIsGrouped();
|
|
4800
4920
|
const rowUnits = compact ? 8 : 10;
|
|
4801
4921
|
const pinStyle = pinned ? pinned === "top" ? { position: "sticky", top: `calc(var(--spacing) * ${rowUnits * (pinnedIndex + 1)})` } : { position: "sticky", bottom: `calc(var(--spacing) * ${rowUnits * (pinnedCount - 1 - pinnedIndex)})` } : void 0;
|
|
4802
4922
|
const cells = row.getVisibleCells();
|
|
4803
|
-
return /* @__PURE__ */ (0,
|
|
4804
|
-
/* @__PURE__ */ (0,
|
|
4923
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(React59.Fragment, { children: [
|
|
4924
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
4805
4925
|
TableRow,
|
|
4806
4926
|
{
|
|
4807
4927
|
ref: virtualized && virtualIndex !== void 0 ? virtualizer.measureElement : void 0,
|
|
@@ -4811,7 +4931,7 @@ function DataTableInner({
|
|
|
4811
4931
|
onClick: onRowClick && !grouped ? () => onRowClick(row.original) : void 0,
|
|
4812
4932
|
className: cn(pinned && "z-20 bg-surface", grouped && "bg-background", onRowClick && !grouped && "cursor-pointer"),
|
|
4813
4933
|
children: [
|
|
4814
|
-
enableRowSelection && /* @__PURE__ */ (0,
|
|
4934
|
+
enableRowSelection && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TableCell, { checkbox: true, className: cellDensity, onClick: (event) => event.stopPropagation(), children: !grouped && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4815
4935
|
Checkbox,
|
|
4816
4936
|
{
|
|
4817
4937
|
"aria-label": "Select row",
|
|
@@ -4820,7 +4940,7 @@ function DataTableInner({
|
|
|
4820
4940
|
onCheckedChange: (checked) => row.toggleSelected(Boolean(checked))
|
|
4821
4941
|
}
|
|
4822
4942
|
) }),
|
|
4823
|
-
hasExpander && /* @__PURE__ */ (0,
|
|
4943
|
+
hasExpander && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TableCell, { checkbox: true, className: cellDensity, onClick: (event) => event.stopPropagation(), children: !grouped && row.getCanExpand() && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4824
4944
|
Button,
|
|
4825
4945
|
{
|
|
4826
4946
|
type: "button",
|
|
@@ -4829,10 +4949,10 @@ function DataTableInner({
|
|
|
4829
4949
|
"aria-label": row.getIsExpanded() ? "Collapse row" : "Expand row",
|
|
4830
4950
|
"aria-expanded": row.getIsExpanded(),
|
|
4831
4951
|
onClick: () => row.toggleExpanded(),
|
|
4832
|
-
children: row.getIsExpanded() ? /* @__PURE__ */ (0,
|
|
4952
|
+
children: row.getIsExpanded() ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_react33.CaretDown, { size: 16, "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_react33.CaretRight, { size: 16, "aria-hidden": true })
|
|
4833
4953
|
}
|
|
4834
4954
|
) }),
|
|
4835
|
-
enableRowPinning && /* @__PURE__ */ (0,
|
|
4955
|
+
enableRowPinning && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TableCell, { checkbox: true, className: cellDensity, onClick: (event) => event.stopPropagation(), children: !grouped && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4836
4956
|
Button,
|
|
4837
4957
|
{
|
|
4838
4958
|
type: "button",
|
|
@@ -4841,7 +4961,7 @@ function DataTableInner({
|
|
|
4841
4961
|
"aria-label": row.getIsPinned() ? "Unpin row" : "Pin row to top",
|
|
4842
4962
|
"aria-pressed": Boolean(row.getIsPinned()),
|
|
4843
4963
|
onClick: () => row.pin(row.getIsPinned() ? false : "top"),
|
|
4844
|
-
children: row.getIsPinned() ? /* @__PURE__ */ (0,
|
|
4964
|
+
children: row.getIsPinned() ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_react33.PushPinSlash, { size: 16, "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_react33.PushPin, { size: 16, "aria-hidden": true })
|
|
4845
4965
|
}
|
|
4846
4966
|
) }),
|
|
4847
4967
|
cells.map((cell, index) => {
|
|
@@ -4854,7 +4974,7 @@ function DataTableInner({
|
|
|
4854
4974
|
const indent = index === 0 && hasExpander && row.depth > 0 ? row.depth * 4 : 0;
|
|
4855
4975
|
let content;
|
|
4856
4976
|
if (cell.getIsGrouped()) {
|
|
4857
|
-
content = /* @__PURE__ */ (0,
|
|
4977
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
4858
4978
|
"button",
|
|
4859
4979
|
{
|
|
4860
4980
|
type: "button",
|
|
@@ -4862,9 +4982,9 @@ function DataTableInner({
|
|
|
4862
4982
|
"aria-expanded": row.getIsExpanded(),
|
|
4863
4983
|
onClick: row.getToggleExpandedHandler(),
|
|
4864
4984
|
children: [
|
|
4865
|
-
row.getIsExpanded() ? /* @__PURE__ */ (0,
|
|
4985
|
+
row.getIsExpanded() ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_react33.CaretDown, { size: 16, "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_react33.CaretRight, { size: 16, "aria-hidden": true }),
|
|
4866
4986
|
(0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext()),
|
|
4867
|
-
/* @__PURE__ */ (0,
|
|
4987
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("span", { className: "text-secondary-muted-foreground", children: [
|
|
4868
4988
|
"(",
|
|
4869
4989
|
row.subRows.length,
|
|
4870
4990
|
")"
|
|
@@ -4877,7 +4997,7 @@ function DataTableInner({
|
|
|
4877
4997
|
} else if (cell.getIsPlaceholder()) {
|
|
4878
4998
|
content = null;
|
|
4879
4999
|
} else if (meta.editable) {
|
|
4880
|
-
content = /* @__PURE__ */ (0,
|
|
5000
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4881
5001
|
EditableCell,
|
|
4882
5002
|
{
|
|
4883
5003
|
value: cell.getValue(),
|
|
@@ -4889,7 +5009,7 @@ function DataTableInner({
|
|
|
4889
5009
|
} else {
|
|
4890
5010
|
content = (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext());
|
|
4891
5011
|
}
|
|
4892
|
-
return /* @__PURE__ */ (0,
|
|
5012
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4893
5013
|
TableCell,
|
|
4894
5014
|
{
|
|
4895
5015
|
align: meta.align,
|
|
@@ -4922,7 +5042,7 @@ function DataTableInner({
|
|
|
4922
5042
|
]
|
|
4923
5043
|
}
|
|
4924
5044
|
),
|
|
4925
|
-
renderSubComponent && !grouped && row.getIsExpanded() && /* @__PURE__ */ (0,
|
|
5045
|
+
renderSubComponent && !grouped && row.getIsExpanded() && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TableRow, { className: "bg-background hover:bg-background", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TableCell, { colSpan: columnSpan, children: renderSubComponent(row.original) }) })
|
|
4926
5046
|
] }, row.id);
|
|
4927
5047
|
};
|
|
4928
5048
|
const renderHeaderCell = (header) => {
|
|
@@ -4933,7 +5053,7 @@ function DataTableInner({
|
|
|
4933
5053
|
const pin = pinning(column, sized, true);
|
|
4934
5054
|
const reorderable = enableColumnOrdering && leaf && !column.getIsPinned();
|
|
4935
5055
|
const label = labelOf(column);
|
|
4936
|
-
return /* @__PURE__ */ (0,
|
|
5056
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4937
5057
|
TableHead,
|
|
4938
5058
|
{
|
|
4939
5059
|
colSpan: header.colSpan > 1 ? header.colSpan : void 0,
|
|
@@ -4969,7 +5089,7 @@ function DataTableInner({
|
|
|
4969
5089
|
reorderable && "cursor-grab",
|
|
4970
5090
|
!leaf && "text-center"
|
|
4971
5091
|
),
|
|
4972
|
-
resizer: enableColumnResizing && column.getCanResize() ? /* @__PURE__ */ (0,
|
|
5092
|
+
resizer: enableColumnResizing && column.getCanResize() ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4973
5093
|
"div",
|
|
4974
5094
|
{
|
|
4975
5095
|
role: "separator",
|
|
@@ -4984,14 +5104,14 @@ function DataTableInner({
|
|
|
4984
5104
|
)
|
|
4985
5105
|
}
|
|
4986
5106
|
) : void 0,
|
|
4987
|
-
children: header.isPlaceholder ? null : /* @__PURE__ */ (0,
|
|
5107
|
+
children: header.isPlaceholder ? null : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(table.FlexRender, { header })
|
|
4988
5108
|
},
|
|
4989
5109
|
header.id
|
|
4990
5110
|
);
|
|
4991
5111
|
};
|
|
4992
5112
|
const stickyLeading = cn(cellDensity, sticky && "sticky top-0 z-20 bg-surface");
|
|
4993
|
-
const leadingHeaderCells = (rowSpan) => /* @__PURE__ */ (0,
|
|
4994
|
-
enableRowSelection && /* @__PURE__ */ (0,
|
|
5113
|
+
const leadingHeaderCells = (rowSpan) => /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
|
|
5114
|
+
enableRowSelection && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TableHead, { checkbox: true, rowSpan, className: stickyLeading, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4995
5115
|
Checkbox,
|
|
4996
5116
|
{
|
|
4997
5117
|
"aria-label": "Select all rows",
|
|
@@ -5000,15 +5120,15 @@ function DataTableInner({
|
|
|
5000
5120
|
onCheckedChange: (checked) => table.toggleAllPageRowsSelected(Boolean(checked))
|
|
5001
5121
|
}
|
|
5002
5122
|
) }),
|
|
5003
|
-
hasExpander && /* @__PURE__ */ (0,
|
|
5004
|
-
enableRowPinning && /* @__PURE__ */ (0,
|
|
5123
|
+
hasExpander && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TableHead, { checkbox: true, rowSpan, className: stickyLeading, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "sr-only", children: "Expand" }) }),
|
|
5124
|
+
enableRowPinning && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TableHead, { checkbox: true, rowSpan, className: stickyLeading, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "sr-only", children: "Pin" }) })
|
|
5005
5125
|
] });
|
|
5006
5126
|
const rowsToRender = virtualized ? virtualItems.map((item) => ({ row: bodyRows[item.index], index: item.index })) : null;
|
|
5007
5127
|
const totalRows = topRows.length + bodyRows.length + bottomRows.length;
|
|
5008
|
-
return /* @__PURE__ */ (0,
|
|
5009
|
-
showToolbar && /* @__PURE__ */ (0,
|
|
5010
|
-
/* @__PURE__ */ (0,
|
|
5011
|
-
enableGlobalFilter && /* @__PURE__ */ (0,
|
|
5128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: cn("flex w-full flex-col gap-2", wrapperClassName), children: [
|
|
5129
|
+
showToolbar && /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
5130
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
5131
|
+
enableGlobalFilter && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5012
5132
|
SearchBar,
|
|
5013
5133
|
{
|
|
5014
5134
|
"aria-label": "Search table",
|
|
@@ -5021,8 +5141,8 @@ function DataTableInner({
|
|
|
5021
5141
|
),
|
|
5022
5142
|
toolbar
|
|
5023
5143
|
] }),
|
|
5024
|
-
/* @__PURE__ */ (0,
|
|
5025
|
-
enableDensityToggle && /* @__PURE__ */ (0,
|
|
5144
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
5145
|
+
enableDensityToggle && /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
5026
5146
|
Button,
|
|
5027
5147
|
{
|
|
5028
5148
|
type: "button",
|
|
@@ -5031,20 +5151,20 @@ function DataTableInner({
|
|
|
5031
5151
|
"aria-pressed": compact,
|
|
5032
5152
|
onClick: () => setDensity(compact ? "default" : "compact"),
|
|
5033
5153
|
children: [
|
|
5034
|
-
/* @__PURE__ */ (0,
|
|
5154
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_react33.Rows, { size: 16, "aria-hidden": true }),
|
|
5035
5155
|
"Compact"
|
|
5036
5156
|
]
|
|
5037
5157
|
}
|
|
5038
5158
|
),
|
|
5039
|
-
enableGrouping && /* @__PURE__ */ (0,
|
|
5040
|
-
/* @__PURE__ */ (0,
|
|
5041
|
-
/* @__PURE__ */ (0,
|
|
5159
|
+
enableGrouping && /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(DropdownMenu, { children: [
|
|
5160
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Button, { type: "button", variant: "outline", size: "sm", children: [
|
|
5161
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_react33.Stack, { size: 16, "aria-hidden": true }),
|
|
5042
5162
|
"Group by"
|
|
5043
5163
|
] }) }),
|
|
5044
|
-
/* @__PURE__ */ (0,
|
|
5045
|
-
/* @__PURE__ */ (0,
|
|
5046
|
-
/* @__PURE__ */ (0,
|
|
5047
|
-
groupableColumns.map((column) => /* @__PURE__ */ (0,
|
|
5164
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(DropdownMenuContent, { align: "end", children: [
|
|
5165
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(DropdownMenuLabel, { children: "Group rows by" }),
|
|
5166
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(DropdownMenuSeparator, {}),
|
|
5167
|
+
groupableColumns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5048
5168
|
DropdownMenuCheckboxItem,
|
|
5049
5169
|
{
|
|
5050
5170
|
checked: column.getIsGrouped(),
|
|
@@ -5055,15 +5175,15 @@ function DataTableInner({
|
|
|
5055
5175
|
))
|
|
5056
5176
|
] })
|
|
5057
5177
|
] }),
|
|
5058
|
-
enableColumnVisibility && /* @__PURE__ */ (0,
|
|
5059
|
-
/* @__PURE__ */ (0,
|
|
5060
|
-
/* @__PURE__ */ (0,
|
|
5178
|
+
enableColumnVisibility && /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(DropdownMenu, { children: [
|
|
5179
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Button, { type: "button", variant: "outline", size: "sm", children: [
|
|
5180
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_react33.Sliders, { size: 16, "aria-hidden": true }),
|
|
5061
5181
|
"Columns"
|
|
5062
5182
|
] }) }),
|
|
5063
|
-
/* @__PURE__ */ (0,
|
|
5064
|
-
/* @__PURE__ */ (0,
|
|
5065
|
-
/* @__PURE__ */ (0,
|
|
5066
|
-
hideableColumns.map((column) => /* @__PURE__ */ (0,
|
|
5183
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(DropdownMenuContent, { align: "end", children: [
|
|
5184
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(DropdownMenuLabel, { children: "Toggle columns" }),
|
|
5185
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(DropdownMenuSeparator, {}),
|
|
5186
|
+
hideableColumns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5067
5187
|
DropdownMenuCheckboxItem,
|
|
5068
5188
|
{
|
|
5069
5189
|
checked: column.getIsVisible(),
|
|
@@ -5076,7 +5196,7 @@ function DataTableInner({
|
|
|
5076
5196
|
] })
|
|
5077
5197
|
] })
|
|
5078
5198
|
] }),
|
|
5079
|
-
/* @__PURE__ */ (0,
|
|
5199
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
5080
5200
|
Table,
|
|
5081
5201
|
{
|
|
5082
5202
|
ref,
|
|
@@ -5089,52 +5209,52 @@ function DataTableInner({
|
|
|
5089
5209
|
tabIndex: enableCellSelection ? 0 : void 0,
|
|
5090
5210
|
...tableProps,
|
|
5091
5211
|
children: [
|
|
5092
|
-
/* @__PURE__ */ (0,
|
|
5093
|
-
headerGroups.map((group, groupIndex) => /* @__PURE__ */ (0,
|
|
5212
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(TableHeader, { children: [
|
|
5213
|
+
headerGroups.map((group, groupIndex) => /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(TableRow, { className: "hover:bg-transparent", children: [
|
|
5094
5214
|
groupIndex === 0 && leadingHeaderCells(headerGroups.length + (enableColumnFilters ? 1 : 0)),
|
|
5095
5215
|
group.headers.map(renderHeaderCell)
|
|
5096
5216
|
] }, group.id)),
|
|
5097
|
-
enableColumnFilters && /* @__PURE__ */ (0,
|
|
5217
|
+
enableColumnFilters && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TableRow, { className: "hover:bg-transparent", children: leafColumns.map((column) => {
|
|
5098
5218
|
const pin = pinning(column, sized, true);
|
|
5099
|
-
return /* @__PURE__ */ (0,
|
|
5219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5100
5220
|
TableHead,
|
|
5101
5221
|
{
|
|
5102
5222
|
style: pin.style,
|
|
5103
5223
|
className: cn("h-auto py-2 font-normal", pin.className, sticky && !column.getIsPinned() && "bg-surface"),
|
|
5104
|
-
children: column.getCanFilter() ? /* @__PURE__ */ (0,
|
|
5224
|
+
children: column.getCanFilter() ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ColumnFilter, { column }) : null
|
|
5105
5225
|
},
|
|
5106
5226
|
column.id
|
|
5107
5227
|
);
|
|
5108
5228
|
}) })
|
|
5109
5229
|
] }),
|
|
5110
|
-
/* @__PURE__ */ (0,
|
|
5111
|
-
loading ? Array.from({ length: pageSize }, (_, index) => skeletonRow(`loading-${index}`)) : totalRows === 0 ? /* @__PURE__ */ (0,
|
|
5230
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(TableBody, { children: [
|
|
5231
|
+
loading ? Array.from({ length: pageSize }, (_, index) => skeletonRow(`loading-${index}`)) : totalRows === 0 ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TableRow, { className: "hover:bg-transparent", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TableCell, { colSpan: columnSpan, muted: true, className: "h-24 text-center", children: emptyState ?? "No results." }) }) : /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
|
|
5112
5232
|
topRows.map((row, index) => renderRow(row, { pinned: "top", pinnedIndex: index, pinnedCount: topRows.length })),
|
|
5113
|
-
virtualized && paddingTop > 0 && /* @__PURE__ */ (0,
|
|
5233
|
+
virtualized && paddingTop > 0 && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("tr", { "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("td", { colSpan: columnSpan, style: { height: paddingTop } }) }),
|
|
5114
5234
|
rowsToRender ? rowsToRender.map(({ row, index }) => renderRow(row, { virtualIndex: index })) : bodyRows.map((row) => renderRow(row)),
|
|
5115
|
-
virtualized && paddingBottom > 0 && /* @__PURE__ */ (0,
|
|
5235
|
+
virtualized && paddingBottom > 0 && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("tr", { "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("td", { colSpan: columnSpan, style: { height: paddingBottom } }) }),
|
|
5116
5236
|
bottomRows.map(
|
|
5117
5237
|
(row, index) => renderRow(row, { pinned: "bottom", pinnedIndex: index, pinnedCount: bottomRows.length })
|
|
5118
5238
|
)
|
|
5119
5239
|
] }),
|
|
5120
|
-
infinite && /* @__PURE__ */ (0,
|
|
5240
|
+
infinite && /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
|
|
5121
5241
|
loadingMore && Array.from({ length: 3 }, (_, index) => skeletonRow(`more-${index}`)),
|
|
5122
|
-
/* @__PURE__ */ (0,
|
|
5242
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("tr", { ref: sentinelRef, "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("td", { colSpan: columnSpan, className: "h-px p-0" }) })
|
|
5123
5243
|
] })
|
|
5124
5244
|
] }),
|
|
5125
|
-
showFooter && /* @__PURE__ */ (0,
|
|
5126
|
-
leadingCount > 0 && /* @__PURE__ */ (0,
|
|
5245
|
+
showFooter && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TableFooter, { children: table.getFooterGroups().map((group) => /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(TableRow, { className: "hover:bg-transparent", children: [
|
|
5246
|
+
leadingCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TableCell, { colSpan: leadingCount, className: cellDensity }),
|
|
5127
5247
|
group.headers.map((header) => {
|
|
5128
5248
|
const { align } = getMeta(header.column.columnDef.meta);
|
|
5129
5249
|
const pin = pinning(header.column, sized);
|
|
5130
|
-
return /* @__PURE__ */ (0,
|
|
5250
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5131
5251
|
TableCell,
|
|
5132
5252
|
{
|
|
5133
5253
|
align,
|
|
5134
5254
|
colSpan: header.colSpan > 1 ? header.colSpan : void 0,
|
|
5135
5255
|
style: pin.style,
|
|
5136
5256
|
className: cn("text-ui-label", pin.className, cellDensity),
|
|
5137
|
-
children: header.isPlaceholder ? null : /* @__PURE__ */ (0,
|
|
5257
|
+
children: header.isPlaceholder ? null : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(table.FlexRender, { footer: header })
|
|
5138
5258
|
},
|
|
5139
5259
|
header.id
|
|
5140
5260
|
);
|
|
@@ -5143,9 +5263,9 @@ function DataTableInner({
|
|
|
5143
5263
|
]
|
|
5144
5264
|
}
|
|
5145
5265
|
),
|
|
5146
|
-
(enableRowSelection || paginate && pageCount > 1) && /* @__PURE__ */ (0,
|
|
5147
|
-
/* @__PURE__ */ (0,
|
|
5148
|
-
paginate && pageCount > 1 && /* @__PURE__ */ (0,
|
|
5266
|
+
(enableRowSelection || paginate && pageCount > 1) && /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
5267
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "text-body-small text-secondary-muted-foreground", "aria-live": "polite", children: enableRowSelection ? `${selectedCount} of ${table.getCoreRowModel().rows.length} row(s) selected` : null }),
|
|
5268
|
+
paginate && pageCount > 1 && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5149
5269
|
Pagination,
|
|
5150
5270
|
{
|
|
5151
5271
|
page: pagination.pageIndex + 1,
|
|
@@ -5156,13 +5276,13 @@ function DataTableInner({
|
|
|
5156
5276
|
] })
|
|
5157
5277
|
] });
|
|
5158
5278
|
}
|
|
5159
|
-
var DataTable =
|
|
5279
|
+
var DataTable = React59.forwardRef(DataTableInner);
|
|
5160
5280
|
DataTable.displayName = "DataTable";
|
|
5161
5281
|
|
|
5162
5282
|
// src/components/Data Display/StatCard.tsx
|
|
5163
|
-
var
|
|
5283
|
+
var React60 = __toESM(require("react"), 1);
|
|
5164
5284
|
var import_class_variance_authority6 = require("class-variance-authority");
|
|
5165
|
-
var
|
|
5285
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
5166
5286
|
var statCardVariants = (0, import_class_variance_authority6.cva)("flex min-w-0 flex-col gap-2 rounded-md border p-3", {
|
|
5167
5287
|
variants: {
|
|
5168
5288
|
variant: {
|
|
@@ -5176,26 +5296,26 @@ var statCardVariants = (0, import_class_variance_authority6.cva)("flex min-w-0 f
|
|
|
5176
5296
|
},
|
|
5177
5297
|
defaultVariants: { variant: "default" }
|
|
5178
5298
|
});
|
|
5179
|
-
var StatCard =
|
|
5180
|
-
({ className, variant, label, value, icon, caption, ...props }, ref) => /* @__PURE__ */ (0,
|
|
5181
|
-
/* @__PURE__ */ (0,
|
|
5182
|
-
/* @__PURE__ */ (0,
|
|
5183
|
-
icon && /* @__PURE__ */ (0,
|
|
5299
|
+
var StatCard = React60.forwardRef(
|
|
5300
|
+
({ className, variant, label, value, icon, caption, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { ref, className: cn(statCardVariants({ variant }), className), ...props, children: [
|
|
5301
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "truncate text-ui-caption text-secondary-muted-foreground", children: label }),
|
|
5302
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("p", { className: "flex items-center gap-2 text-body-base text-surface-foreground", children: [
|
|
5303
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { "aria-hidden": "true", className: "inline-flex size-6 shrink-0 items-center justify-center", children: icon }),
|
|
5184
5304
|
value
|
|
5185
5305
|
] }),
|
|
5186
|
-
caption && /* @__PURE__ */ (0,
|
|
5306
|
+
caption && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "text-ui-caption text-secondary-muted-foreground", children: caption })
|
|
5187
5307
|
] })
|
|
5188
5308
|
);
|
|
5189
5309
|
StatCard.displayName = "StatCard";
|
|
5190
5310
|
|
|
5191
5311
|
// src/components/Research-Specific/ActivityStructure.tsx
|
|
5192
|
-
var
|
|
5312
|
+
var React62 = __toESM(require("react"), 1);
|
|
5193
5313
|
|
|
5194
5314
|
// src/components/Tags & Badges/EditableTag.tsx
|
|
5195
|
-
var
|
|
5196
|
-
var
|
|
5315
|
+
var React61 = __toESM(require("react"), 1);
|
|
5316
|
+
var import_react34 = require("@phosphor-icons/react");
|
|
5197
5317
|
var import_class_variance_authority7 = require("class-variance-authority");
|
|
5198
|
-
var
|
|
5318
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
5199
5319
|
var editableTagVariants = (0, import_class_variance_authority7.cva)(
|
|
5200
5320
|
"inline-flex h-6.5 items-center whitespace-nowrap rounded-sm py-1 text-ui-caption transition-colors",
|
|
5201
5321
|
{
|
|
@@ -5210,27 +5330,27 @@ var editableTagVariants = (0, import_class_variance_authority7.cva)(
|
|
|
5210
5330
|
defaultVariants: { type: "default" }
|
|
5211
5331
|
}
|
|
5212
5332
|
);
|
|
5213
|
-
var EditableTag =
|
|
5333
|
+
var EditableTag = React61.forwardRef(
|
|
5214
5334
|
({ className, type = "default", icon, onRemove, onClick, children, ...props }, ref) => {
|
|
5215
5335
|
const classes = cn(editableTagVariants({ type }), className);
|
|
5216
|
-
const leading = type === "add" ? /* @__PURE__ */ (0,
|
|
5336
|
+
const leading = type === "add" ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react34.Plus, { size: 12, "aria-hidden": true }) : icon !== void 0 ? icon : type === "default" ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react34.Crown, { size: 12, weight: "fill", "aria-hidden": true }) : null;
|
|
5217
5337
|
if (type === "add" || type === "multiple" && onClick) {
|
|
5218
|
-
return /* @__PURE__ */ (0,
|
|
5338
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("button", { ref, type: "button", className: classes, onClick, ...props, children: [
|
|
5219
5339
|
leading,
|
|
5220
5340
|
children
|
|
5221
5341
|
] });
|
|
5222
5342
|
}
|
|
5223
|
-
return /* @__PURE__ */ (0,
|
|
5343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("span", { ref, className: classes, ...props, children: [
|
|
5224
5344
|
leading,
|
|
5225
5345
|
children,
|
|
5226
|
-
onRemove && /* @__PURE__ */ (0,
|
|
5346
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5227
5347
|
"button",
|
|
5228
5348
|
{
|
|
5229
5349
|
type: "button",
|
|
5230
5350
|
"aria-label": typeof children === "string" ? `Remove ${children}` : "Remove",
|
|
5231
5351
|
onClick: onRemove,
|
|
5232
5352
|
className: "inline-flex size-3 items-center justify-center rounded-xs",
|
|
5233
|
-
children: /* @__PURE__ */ (0,
|
|
5353
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react34.X, { size: 12, "aria-hidden": true })
|
|
5234
5354
|
}
|
|
5235
5355
|
)
|
|
5236
5356
|
] });
|
|
@@ -5239,26 +5359,26 @@ var EditableTag = React59.forwardRef(
|
|
|
5239
5359
|
EditableTag.displayName = "EditableTag";
|
|
5240
5360
|
|
|
5241
5361
|
// src/components/Research-Specific/ActivityStructure.tsx
|
|
5242
|
-
var
|
|
5243
|
-
var ActivityStructure =
|
|
5244
|
-
({ className, title = "Activity Structure", stats, sections, onRemoveTag, onAddTag, addTagLabel = "Add tag", action, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
5362
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
5363
|
+
var ActivityStructure = React62.forwardRef(
|
|
5364
|
+
({ className, title = "Activity Structure", stats, sections, onRemoveTag, onAddTag, addTagLabel = "Add tag", action, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
5245
5365
|
"section",
|
|
5246
5366
|
{
|
|
5247
5367
|
ref,
|
|
5248
5368
|
className: cn("flex w-full max-w-96.5 flex-col gap-4 rounded-xl bg-surface p-4", className),
|
|
5249
5369
|
...props,
|
|
5250
5370
|
children: [
|
|
5251
|
-
/* @__PURE__ */ (0,
|
|
5252
|
-
/* @__PURE__ */ (0,
|
|
5371
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
5372
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("h3", { className: "text-body-section text-surface-foreground", children: title }),
|
|
5253
5373
|
action
|
|
5254
5374
|
] }),
|
|
5255
|
-
stats.length > 0 && /* @__PURE__ */ (0,
|
|
5256
|
-
sections?.map(({ id, heading, body, tags }) => /* @__PURE__ */ (0,
|
|
5257
|
-
/* @__PURE__ */ (0,
|
|
5258
|
-
/* @__PURE__ */ (0,
|
|
5259
|
-
(tags?.length || onAddTag) && /* @__PURE__ */ (0,
|
|
5260
|
-
tags?.map((tag) => /* @__PURE__ */ (0,
|
|
5261
|
-
onAddTag && /* @__PURE__ */ (0,
|
|
5375
|
+
stats.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "grid grid-cols-2 gap-3", children: stats.map(({ id, ...stat }) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(StatCard, { ...stat }, id)) }),
|
|
5376
|
+
sections?.map(({ id, heading, body, tags }) => /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
5377
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("h4", { className: "text-heading-h4 text-surface-foreground", children: heading }),
|
|
5378
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "text-body-base text-surface-foreground", children: body }),
|
|
5379
|
+
(tags?.length || onAddTag) && /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
5380
|
+
tags?.map((tag) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(EditableTag, { type: "editable", onRemove: onRemoveTag && (() => onRemoveTag(id, tag)), children: tag }, tag)),
|
|
5381
|
+
onAddTag && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(EditableTag, { type: "add", onClick: () => onAddTag(id), children: addTagLabel })
|
|
5262
5382
|
] })
|
|
5263
5383
|
] }, id)),
|
|
5264
5384
|
children
|
|
@@ -5269,10 +5389,10 @@ var ActivityStructure = React60.forwardRef(
|
|
|
5269
5389
|
ActivityStructure.displayName = "ActivityStructure";
|
|
5270
5390
|
|
|
5271
5391
|
// src/components/Tags & Badges/Badge.tsx
|
|
5272
|
-
var
|
|
5273
|
-
var
|
|
5392
|
+
var React63 = __toESM(require("react"), 1);
|
|
5393
|
+
var import_react35 = require("@phosphor-icons/react");
|
|
5274
5394
|
var import_class_variance_authority8 = require("class-variance-authority");
|
|
5275
|
-
var
|
|
5395
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
5276
5396
|
var roleTagVariants = (0, import_class_variance_authority8.cva)(
|
|
5277
5397
|
"group inline-flex h-6 items-center whitespace-nowrap rounded-sm py-1 text-ui-caption transition-colors",
|
|
5278
5398
|
{
|
|
@@ -5298,11 +5418,11 @@ var roleTagVariants = (0, import_class_variance_authority8.cva)(
|
|
|
5298
5418
|
defaultVariants: { type: "primary", selected: false }
|
|
5299
5419
|
}
|
|
5300
5420
|
);
|
|
5301
|
-
var Badge =
|
|
5421
|
+
var Badge = React63.forwardRef(
|
|
5302
5422
|
({ className, type = "primary", selected = false, onClick, children, ...props }, ref) => {
|
|
5303
5423
|
const classes = cn(roleTagVariants({ type, selected: type === "interactable" ? selected : false }), className);
|
|
5304
5424
|
if (type === "interactable") {
|
|
5305
|
-
return /* @__PURE__ */ (0,
|
|
5425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
5306
5426
|
"button",
|
|
5307
5427
|
{
|
|
5308
5428
|
ref,
|
|
@@ -5312,15 +5432,15 @@ var Badge = React61.forwardRef(
|
|
|
5312
5432
|
onClick,
|
|
5313
5433
|
...props,
|
|
5314
5434
|
children: [
|
|
5315
|
-
/* @__PURE__ */ (0,
|
|
5435
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react35.DotsSixVertical, { size: 16, "aria-hidden": true, className: "hidden shrink-0 group-hover:block" }),
|
|
5316
5436
|
children
|
|
5317
5437
|
]
|
|
5318
5438
|
}
|
|
5319
5439
|
);
|
|
5320
5440
|
}
|
|
5321
|
-
return /* @__PURE__ */ (0,
|
|
5322
|
-
type === "question" && /* @__PURE__ */ (0,
|
|
5323
|
-
type === "id" && /* @__PURE__ */ (0,
|
|
5441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("span", { ref, className: classes, ...props, children: [
|
|
5442
|
+
type === "question" && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react35.RadioButton, { size: 16, weight: "fill", "aria-hidden": true }),
|
|
5443
|
+
type === "id" && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "text-secondary-muted-foreground", children: "ID" }),
|
|
5324
5444
|
children
|
|
5325
5445
|
] });
|
|
5326
5446
|
}
|
|
@@ -5328,14 +5448,14 @@ var Badge = React61.forwardRef(
|
|
|
5328
5448
|
Badge.displayName = "Badge";
|
|
5329
5449
|
|
|
5330
5450
|
// src/components/Identity & People/Avatar.tsx
|
|
5331
|
-
var
|
|
5332
|
-
var
|
|
5451
|
+
var React64 = __toESM(require("react"), 1);
|
|
5452
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
5333
5453
|
var initials = (name) => name.split(/\s+/).filter(Boolean).slice(0, 2).map((w) => w[0].toUpperCase()).join("");
|
|
5334
|
-
var Avatar =
|
|
5335
|
-
const [failed, setFailed] =
|
|
5336
|
-
|
|
5454
|
+
var Avatar = React64.forwardRef(({ className, src, name, fallback, ...props }, ref) => {
|
|
5455
|
+
const [failed, setFailed] = React64.useState(false);
|
|
5456
|
+
React64.useEffect(() => setFailed(false), [src]);
|
|
5337
5457
|
const showImage = Boolean(src) && !failed;
|
|
5338
|
-
return /* @__PURE__ */ (0,
|
|
5458
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
5339
5459
|
"span",
|
|
5340
5460
|
{
|
|
5341
5461
|
ref,
|
|
@@ -5343,16 +5463,16 @@ var Avatar = React62.forwardRef(({ className, src, name, fallback, ...props }, r
|
|
|
5343
5463
|
"aria-label": showImage ? void 0 : name,
|
|
5344
5464
|
className: cn("flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-md bg-orchid-200 text-ui-label text-surface-foreground", className),
|
|
5345
5465
|
...props,
|
|
5346
|
-
children: showImage ? /* @__PURE__ */ (0,
|
|
5466
|
+
children: showImage ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("img", { src, alt: name, className: "size-full object-cover", onError: () => setFailed(true) }) : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { "aria-hidden": "true", children: fallback ?? initials(name) })
|
|
5347
5467
|
}
|
|
5348
5468
|
);
|
|
5349
5469
|
});
|
|
5350
5470
|
Avatar.displayName = "Avatar";
|
|
5351
5471
|
|
|
5352
5472
|
// src/components/Identity & People/OrgMonogram.tsx
|
|
5353
|
-
var
|
|
5354
|
-
var
|
|
5355
|
-
var OrgMonogram =
|
|
5473
|
+
var React65 = __toESM(require("react"), 1);
|
|
5474
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
5475
|
+
var OrgMonogram = React65.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { ref, className: cn("flex size-10 shrink-0 items-center justify-center rounded-md bg-coral-500 text-ui-label font-semibold text-surface", className), ...props }));
|
|
5356
5476
|
OrgMonogram.displayName = "OrgMonogram";
|
|
5357
5477
|
// Annotate the CommonJS export names for ESM import in node:
|
|
5358
5478
|
0 && (module.exports = {
|
|
@@ -5432,6 +5552,7 @@ OrgMonogram.displayName = "OrgMonogram";
|
|
|
5432
5552
|
QuestionOptionEditor,
|
|
5433
5553
|
QuestionOtherOption,
|
|
5434
5554
|
QuestionTypeIcon,
|
|
5555
|
+
QuoteChip,
|
|
5435
5556
|
RadioGroup,
|
|
5436
5557
|
RadioGroupFieldItem,
|
|
5437
5558
|
RadioGroupItem,
|
|
@@ -5444,6 +5565,7 @@ OrgMonogram.displayName = "OrgMonogram";
|
|
|
5444
5565
|
SelectItem,
|
|
5445
5566
|
SelectTrigger,
|
|
5446
5567
|
SelectValue,
|
|
5568
|
+
SelectionComment,
|
|
5447
5569
|
SidebarNavItem,
|
|
5448
5570
|
Slider,
|
|
5449
5571
|
StatCard,
|