@sofya-ds/react 1.13.0 → 1.14.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/dist/index.cjs +1898 -301
- package/dist/index.css +1 -1
- package/dist/index.d.cts +250 -9
- package/dist/index.d.ts +250 -9
- package/dist/index.js +1893 -301
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -107,26 +107,42 @@ import * as React2 from "react";
|
|
|
107
107
|
// src/components/icon-data.ts
|
|
108
108
|
import {
|
|
109
109
|
IconAdjustmentsHorizontalFilled,
|
|
110
|
+
IconActivity,
|
|
111
|
+
IconActivityHeartbeat,
|
|
110
112
|
IconAlignCenter,
|
|
111
113
|
IconAlignJustified,
|
|
112
114
|
IconAlignLeft,
|
|
113
115
|
IconAlignRight,
|
|
116
|
+
IconAlertCircle,
|
|
114
117
|
IconArrowUp,
|
|
115
118
|
IconArchive,
|
|
116
119
|
IconBold,
|
|
120
|
+
IconBrain,
|
|
117
121
|
IconBuildingHospital,
|
|
118
122
|
IconBooks,
|
|
119
123
|
IconBulb,
|
|
120
124
|
IconChartBar,
|
|
121
125
|
IconCheck,
|
|
122
126
|
IconChecklist,
|
|
127
|
+
IconClipboardList,
|
|
128
|
+
IconClipboardText,
|
|
123
129
|
IconCode,
|
|
130
|
+
IconFileText,
|
|
131
|
+
IconFlask,
|
|
132
|
+
IconHeartbeat,
|
|
124
133
|
IconItalic,
|
|
125
134
|
IconLink,
|
|
126
135
|
IconList,
|
|
136
|
+
IconListCheck,
|
|
127
137
|
IconListNumbers,
|
|
138
|
+
IconNotes,
|
|
139
|
+
IconPill,
|
|
128
140
|
IconQuote,
|
|
141
|
+
IconReportMedical,
|
|
129
142
|
IconStrikethrough,
|
|
143
|
+
IconStethoscope,
|
|
144
|
+
IconTable,
|
|
145
|
+
IconTemperature,
|
|
130
146
|
IconUnderline,
|
|
131
147
|
IconChevronLeft,
|
|
132
148
|
IconChevronDown,
|
|
@@ -166,26 +182,42 @@ import {
|
|
|
166
182
|
} from "@tabler/icons-react";
|
|
167
183
|
var tablerIconRegistry = {
|
|
168
184
|
IconAdjustmentsHorizontalFilled,
|
|
185
|
+
IconActivity,
|
|
186
|
+
IconActivityHeartbeat,
|
|
169
187
|
IconAlignCenter,
|
|
170
188
|
IconAlignJustified,
|
|
171
189
|
IconAlignLeft,
|
|
172
190
|
IconAlignRight,
|
|
191
|
+
IconAlertCircle,
|
|
173
192
|
IconArrowUp,
|
|
174
193
|
IconArchive,
|
|
175
194
|
IconBold,
|
|
195
|
+
IconBrain,
|
|
176
196
|
IconBuildingHospital,
|
|
177
197
|
IconBooks,
|
|
178
198
|
IconBulb,
|
|
179
199
|
IconChartBar,
|
|
180
200
|
IconCheck,
|
|
181
201
|
IconChecklist,
|
|
202
|
+
IconClipboardList,
|
|
203
|
+
IconClipboardText,
|
|
182
204
|
IconCode,
|
|
205
|
+
IconFileText,
|
|
206
|
+
IconFlask,
|
|
207
|
+
IconHeartbeat,
|
|
183
208
|
IconItalic,
|
|
184
209
|
IconLink,
|
|
185
210
|
IconList,
|
|
211
|
+
IconListCheck,
|
|
186
212
|
IconListNumbers,
|
|
213
|
+
IconNotes,
|
|
214
|
+
IconPill,
|
|
187
215
|
IconQuote,
|
|
216
|
+
IconReportMedical,
|
|
188
217
|
IconStrikethrough,
|
|
218
|
+
IconStethoscope,
|
|
219
|
+
IconTable,
|
|
220
|
+
IconTemperature,
|
|
189
221
|
IconUnderline,
|
|
190
222
|
IconChevronLeft,
|
|
191
223
|
IconChevronDown,
|
|
@@ -253,6 +285,7 @@ var legacyIconToTablerNameMap = {
|
|
|
253
285
|
"lightbulb": "IconBulb",
|
|
254
286
|
"chats": "IconMessages",
|
|
255
287
|
"file": "IconFile",
|
|
288
|
+
"file-text": "IconFileText",
|
|
256
289
|
"folders": "IconFolders",
|
|
257
290
|
"sparkle": "IconSparkles",
|
|
258
291
|
"x": "IconX",
|
|
@@ -260,6 +293,21 @@ var legacyIconToTablerNameMap = {
|
|
|
260
293
|
"search": "IconSearch",
|
|
261
294
|
"arrow-up": "IconArrowUp",
|
|
262
295
|
"question": "IconHelpCircle",
|
|
296
|
+
"activity": "IconActivity",
|
|
297
|
+
"activity-heartbeat": "IconActivityHeartbeat",
|
|
298
|
+
"alert-circle": "IconAlertCircle",
|
|
299
|
+
"brain": "IconBrain",
|
|
300
|
+
"clipboard-list": "IconClipboardList",
|
|
301
|
+
"clipboard-text": "IconClipboardText",
|
|
302
|
+
"flask": "IconFlask",
|
|
303
|
+
"heartbeat": "IconHeartbeat",
|
|
304
|
+
"list-check": "IconListCheck",
|
|
305
|
+
"notes": "IconNotes",
|
|
306
|
+
"pill": "IconPill",
|
|
307
|
+
"report-medical": "IconReportMedical",
|
|
308
|
+
"stethoscope": "IconStethoscope",
|
|
309
|
+
"table": "IconTable",
|
|
310
|
+
"temperature": "IconTemperature",
|
|
263
311
|
"user-filled": "IconUserFilled",
|
|
264
312
|
"caret-up": "IconChevronUp",
|
|
265
313
|
"caret-left": "IconChevronLeft",
|
|
@@ -460,6 +508,9 @@ var defaultElements = {
|
|
|
460
508
|
"heading-xl": "h1",
|
|
461
509
|
"heading-lg": "h2",
|
|
462
510
|
"heading-md": "h3",
|
|
511
|
+
"settings-page-title": "h1",
|
|
512
|
+
"home-inline-encounter-title": "h1",
|
|
513
|
+
"home-inline-encounter-action": "span",
|
|
463
514
|
h1: "h1",
|
|
464
515
|
h2: "h2",
|
|
465
516
|
h3: "h3",
|
|
@@ -472,7 +523,10 @@ var defaultElements = {
|
|
|
472
523
|
"body-md": "p",
|
|
473
524
|
"body-sm": "p",
|
|
474
525
|
body: "p",
|
|
526
|
+
"clinical-body": "p",
|
|
475
527
|
"label-md": "span",
|
|
528
|
+
"settings-section-title": "span",
|
|
529
|
+
"clinical-section-title": "span",
|
|
476
530
|
"section-label": "span",
|
|
477
531
|
"eyebrow-md": "span",
|
|
478
532
|
"overline-md": "span",
|
|
@@ -499,7 +553,8 @@ var textSizeStyles = Object.fromEntries(
|
|
|
499
553
|
fontSize: `var(--sofya-text-${size}-font-size)`,
|
|
500
554
|
fontWeight: `var(--sofya-text-${size}-font-weight)`,
|
|
501
555
|
lineHeight: `var(--sofya-text-${size}-line-height)`,
|
|
502
|
-
letterSpacing: `var(--sofya-text-${size}-letter-spacing)
|
|
556
|
+
letterSpacing: `var(--sofya-text-${size}-letter-spacing)`,
|
|
557
|
+
...size === "settings-section-title" || size === "clinical-section-title" ? { textTransform: "uppercase" } : {}
|
|
503
558
|
}
|
|
504
559
|
])
|
|
505
560
|
);
|
|
@@ -993,6 +1048,7 @@ var buttonRippleVariantClasses = {
|
|
|
993
1048
|
icon: "bg-[hsl(var(--sofya-primary)/0.34)]",
|
|
994
1049
|
language: "bg-[hsl(var(--sofya-background)/0.76)] mix-blend-screen",
|
|
995
1050
|
secondary: "bg-[hsl(var(--sofya-primary)/0.30)]",
|
|
1051
|
+
"auth-outline": "bg-[hsl(var(--sofya-primary)/0.24)]",
|
|
996
1052
|
outline: "bg-[hsl(var(--sofya-primary)/0.32)]",
|
|
997
1053
|
ghost: "bg-[hsl(var(--sofya-primary)/0.28)]",
|
|
998
1054
|
destructive: "bg-[hsl(var(--sofya-destructive-foreground)/0.78)] mix-blend-screen"
|
|
@@ -1001,6 +1057,8 @@ var buttonRippleBaseSize = {
|
|
|
1001
1057
|
default: 20,
|
|
1002
1058
|
sm: 18,
|
|
1003
1059
|
lg: 22,
|
|
1060
|
+
toolbar: 20,
|
|
1061
|
+
auth: 22,
|
|
1004
1062
|
icon: 18
|
|
1005
1063
|
};
|
|
1006
1064
|
function useButtonRippleState({
|
|
@@ -1253,11 +1311,12 @@ var buttonVariantOptions = [
|
|
|
1253
1311
|
"icon",
|
|
1254
1312
|
"language",
|
|
1255
1313
|
"secondary",
|
|
1314
|
+
"auth-outline",
|
|
1256
1315
|
"outline",
|
|
1257
1316
|
"ghost",
|
|
1258
1317
|
"destructive"
|
|
1259
1318
|
];
|
|
1260
|
-
var buttonSizeOptions = ["default", "sm", "lg", "icon"];
|
|
1319
|
+
var buttonSizeOptions = ["default", "sm", "lg", "toolbar", "auth", "icon"];
|
|
1261
1320
|
var buttonVariants = cva2(
|
|
1262
1321
|
"relative isolate inline-flex items-center justify-center gap-2 overflow-hidden whitespace-nowrap rounded-full font-medium tracking-[0.025em] transform-gpu transition-[width,transform,filter,background-color,border-color,color,box-shadow] duration-sofya ease-sofya motion-safe:active:scale-[0.985] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none data-[disabled=true]:cursor-not-allowed",
|
|
1263
1322
|
{
|
|
@@ -1271,6 +1330,7 @@ var buttonVariants = cva2(
|
|
|
1271
1330
|
icon: "border-0 bg-transparent text-[color:var(--sofya-text-soft)] shadow-none hover:bg-[color:var(--sofya-surface-hover)] hover:text-[color:var(--sofya-text-default)] data-[disabled=true]:bg-transparent data-[disabled=true]:text-[color:var(--sofya-text-subtle)] data-[disabled=true]:shadow-none",
|
|
1272
1331
|
language: "border-0 bg-muted bg-cover bg-center bg-no-repeat text-primary-foreground shadow-none hover:brightness-[1.03]",
|
|
1273
1332
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/85 data-[disabled=true]:bg-muted data-[disabled=true]:text-[color:var(--sofya-text-subtle)]",
|
|
1333
|
+
"auth-outline": "rounded-[10px] border border-[color:var(--sofya-border-strong)] bg-card text-[color:var(--sofya-text-default)] shadow-none hover:border-[color:var(--sofya-border-strong)] hover:bg-card active:bg-card data-[disabled=true]:border-[color:var(--sofya-border-soft)] data-[disabled=true]:text-[color:var(--sofya-text-subtle)]",
|
|
1274
1334
|
outline: "border border-primary/15 bg-background text-foreground hover:border-primary/30 hover:bg-background active:bg-background data-[disabled=true]:border-[color:var(--sofya-border-soft)] data-[disabled=true]:text-[color:var(--sofya-text-subtle)]",
|
|
1275
1335
|
ghost: "bg-transparent text-foreground hover:bg-muted data-[disabled=true]:text-[color:var(--sofya-text-subtle)]",
|
|
1276
1336
|
destructive: "bg-destructive text-destructive-foreground hover:brightness-[1.04] data-[disabled=true]:bg-muted data-[disabled=true]:text-[color:var(--sofya-text-subtle)]"
|
|
@@ -1279,6 +1339,8 @@ var buttonVariants = cva2(
|
|
|
1279
1339
|
default: "h-11 px-10",
|
|
1280
1340
|
sm: "h-10 px-6",
|
|
1281
1341
|
lg: "h-12 px-12",
|
|
1342
|
+
toolbar: "h-[42px] px-7",
|
|
1343
|
+
auth: "h-[46px] px-6",
|
|
1282
1344
|
icon: "h-11 w-11"
|
|
1283
1345
|
}
|
|
1284
1346
|
},
|
|
@@ -1292,12 +1354,16 @@ var loadingSpinnerSizeClasses = {
|
|
|
1292
1354
|
default: "h-4 w-4",
|
|
1293
1355
|
sm: "h-3.5 w-3.5",
|
|
1294
1356
|
lg: "h-[18px] w-[18px]",
|
|
1357
|
+
toolbar: "h-4 w-4",
|
|
1358
|
+
auth: "h-4 w-4",
|
|
1295
1359
|
icon: "h-4 w-4"
|
|
1296
1360
|
};
|
|
1297
1361
|
var languageButtonSizeClasses = {
|
|
1298
1362
|
default: "h-11 w-11 rounded-full p-0",
|
|
1299
1363
|
sm: "h-10 w-10 rounded-full p-0",
|
|
1300
1364
|
lg: "h-12 w-12 rounded-full p-0",
|
|
1365
|
+
toolbar: "h-[42px] w-[42px] rounded-full p-0",
|
|
1366
|
+
auth: "h-[46px] w-[46px] rounded-full p-0",
|
|
1301
1367
|
icon: "h-11 w-11 rounded-full p-0"
|
|
1302
1368
|
};
|
|
1303
1369
|
function ButtonSpinner({
|
|
@@ -1341,6 +1407,7 @@ var Button = React7.forwardRef(
|
|
|
1341
1407
|
const resolvedSize = size ?? (isIconOnly ? "icon" : "default");
|
|
1342
1408
|
const resolvedVariant = variant ?? "default";
|
|
1343
1409
|
const isLanguageButton = variant === "language";
|
|
1410
|
+
const textSize = resolvedVariant === "auth-outline" ? "body-md" : "tiny";
|
|
1344
1411
|
const resolvedLanguageLocale = isLanguageButton ? languageLocale ?? "en-US" : void 0;
|
|
1345
1412
|
const resolvedLanguageFlagSrc = resolvedLanguageLocale ? buttonLanguageFlagSrc[resolvedLanguageLocale] : void 0;
|
|
1346
1413
|
const resolvedLanguageLabel = resolvedLanguageLocale ? buttonLanguageLabels[resolvedLanguageLocale] : void 0;
|
|
@@ -1399,7 +1466,7 @@ var Button = React7.forwardRef(
|
|
|
1399
1466
|
hasChildren ? renderTextContent(children, {
|
|
1400
1467
|
as: "span",
|
|
1401
1468
|
className: "inline-flex items-center text-current",
|
|
1402
|
-
size:
|
|
1469
|
+
size: textSize,
|
|
1403
1470
|
style: {
|
|
1404
1471
|
fontWeight: "inherit",
|
|
1405
1472
|
letterSpacing: "inherit"
|
|
@@ -2558,7 +2625,7 @@ function FieldShell({
|
|
|
2558
2625
|
// src/components/input-upload.tsx
|
|
2559
2626
|
import * as React14 from "react";
|
|
2560
2627
|
import {
|
|
2561
|
-
IconFileText,
|
|
2628
|
+
IconFileText as IconFileText2,
|
|
2562
2629
|
IconPhoto,
|
|
2563
2630
|
IconUpload,
|
|
2564
2631
|
IconVideo
|
|
@@ -2689,7 +2756,7 @@ function UploadFileTypeGlyph({
|
|
|
2689
2756
|
);
|
|
2690
2757
|
}
|
|
2691
2758
|
return /* @__PURE__ */ jsx15(
|
|
2692
|
-
|
|
2759
|
+
IconFileText2,
|
|
2693
2760
|
{
|
|
2694
2761
|
"aria-hidden": "true",
|
|
2695
2762
|
className: cn("inline-block shrink-0 align-middle", className)
|
|
@@ -3078,6 +3145,7 @@ InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
|
3078
3145
|
import { Fragment as Fragment2, jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3079
3146
|
var inputVariantOptions = [
|
|
3080
3147
|
"default",
|
|
3148
|
+
"auth-login",
|
|
3081
3149
|
"search",
|
|
3082
3150
|
"otp",
|
|
3083
3151
|
"upload"
|
|
@@ -3210,6 +3278,7 @@ var Input = React16.forwardRef((props, ref) => {
|
|
|
3210
3278
|
...nativeProps
|
|
3211
3279
|
} = props;
|
|
3212
3280
|
const isSearch = variant === "search";
|
|
3281
|
+
const isAuthLogin = variant === "auth-login";
|
|
3213
3282
|
const resolvedType = type ?? (isSearch ? "search" : void 0);
|
|
3214
3283
|
const ariaLabel = nativeProps["aria-label"] ?? (typeof label === "string" ? label : isSearch ? "Search" : void 0);
|
|
3215
3284
|
const nativeControl = isSearch ? /* @__PURE__ */ jsxs9("div", { className: "flex h-[88px] w-full items-center gap-6 rounded-full border border-[color:var(--sofya-border-strong)] bg-card px-8 shadow-none transition-[border-color,box-shadow,background-color] duration-sofya ease-sofya hover:border-[color:var(--sofya-border-hover)] hover:ring-2 hover:ring-[color:var(--sofya-focus-ring-soft)] focus-within:border-transparent focus-within:ring-2 focus-within:ring-[color:var(--sofya-focus-ring-soft)] has-[:active]:border-transparent has-[:active]:ring-2 has-[:active]:ring-[color:var(--sofya-focus-ring-soft)]", children: [
|
|
@@ -3245,7 +3314,8 @@ var Input = React16.forwardRef((props, ref) => {
|
|
|
3245
3314
|
ref,
|
|
3246
3315
|
type: resolvedType,
|
|
3247
3316
|
className: cn(
|
|
3248
|
-
"flex
|
|
3317
|
+
"flex w-full rounded-[10px] border border-[color:var(--sofya-border-strong)] bg-card text-[color:var(--sofya-text-default)] shadow-none transition-[border-color,box-shadow,background-color,color] duration-sofya ease-sofya placeholder:text-[color:var(--sofya-text-placeholder)] hover:border-[color:var(--sofya-border-hover)] focus:border-transparent focus:outline-none focus:ring-2 focus:ring-[color:var(--sofya-focus-ring-soft)] focus:ring-offset-0 active:border-transparent active:ring-2 active:ring-[color:var(--sofya-focus-ring-soft)] disabled:cursor-not-allowed disabled:bg-muted disabled:opacity-50",
|
|
3318
|
+
isAuthLogin ? "h-[46px] px-6 py-3 [font-family:var(--sofya-text-tiny-font-family)] text-[14px] [font-weight:500] leading-[24px] tracking-[var(--sofya-text-tiny-letter-spacing)] placeholder:font-medium" : "h-10 px-4 py-2 [font-family:var(--sofya-text-tiny-font-family)] text-[length:var(--sofya-text-tiny-font-size)] [font-weight:var(--sofya-text-tiny-font-weight)] leading-[var(--sofya-text-tiny-line-height)] tracking-[var(--sofya-text-tiny-letter-spacing)]",
|
|
3249
3319
|
className
|
|
3250
3320
|
),
|
|
3251
3321
|
...nativeProps,
|
|
@@ -3255,10 +3325,12 @@ var Input = React16.forwardRef((props, ref) => {
|
|
|
3255
3325
|
return /* @__PURE__ */ jsx17(
|
|
3256
3326
|
FieldShell,
|
|
3257
3327
|
{
|
|
3258
|
-
containerClassName,
|
|
3328
|
+
containerClassName: cn(isAuthLogin ? "gap-2.5" : void 0, containerClassName),
|
|
3259
3329
|
control: nativeControl,
|
|
3260
3330
|
label: isSearch ? void 0 : label,
|
|
3261
3331
|
labelClassName: isSearch ? void 0 : labelClassName,
|
|
3332
|
+
labelTextSize: isAuthLogin ? "body-md" : void 0,
|
|
3333
|
+
labelTextStyle: isAuthLogin ? { fontWeight: 500 } : void 0,
|
|
3262
3334
|
labelHtmlFor: isSearch ? void 0 : resolvedId
|
|
3263
3335
|
}
|
|
3264
3336
|
);
|
|
@@ -4972,156 +5044,1569 @@ var RichTextToolbarButton = React31.forwardRef(function RichTextToolbarButton2({
|
|
|
4972
5044
|
});
|
|
4973
5045
|
RichTextToolbarButton.displayName = "RichTextToolbarButton";
|
|
4974
5046
|
|
|
4975
|
-
// src/components/
|
|
5047
|
+
// src/components/reasoning-widget.tsx
|
|
4976
5048
|
import * as React32 from "react";
|
|
4977
|
-
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
4978
|
-
var
|
|
4979
|
-
|
|
4980
|
-
|
|
5049
|
+
import { jsx as jsx34, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
5050
|
+
var reasoningWidgetToneOptions = [
|
|
5051
|
+
"default",
|
|
5052
|
+
"info",
|
|
5053
|
+
"success",
|
|
5054
|
+
"warning",
|
|
5055
|
+
"critical",
|
|
5056
|
+
"muted"
|
|
5057
|
+
];
|
|
5058
|
+
var reasoningWidgetDensityOptions = ["default", "compact"];
|
|
5059
|
+
var reasoningWidgetVariantOptions = [
|
|
5060
|
+
"flat",
|
|
5061
|
+
"outline",
|
|
5062
|
+
"muted",
|
|
5063
|
+
"suggestion"
|
|
5064
|
+
];
|
|
5065
|
+
var reasoningWidgetActionScopeOptions = ["item", "widget"];
|
|
5066
|
+
var reasoningWidgetActionToneOptions = [
|
|
5067
|
+
"primary",
|
|
5068
|
+
"neutral",
|
|
5069
|
+
"danger"
|
|
5070
|
+
];
|
|
5071
|
+
var reasoningWidgetTableAlignOptions = [
|
|
5072
|
+
"left",
|
|
5073
|
+
"center",
|
|
5074
|
+
"right"
|
|
5075
|
+
];
|
|
5076
|
+
var reasoningWidgetTableColumnVariantOptions = [
|
|
5077
|
+
"default",
|
|
5078
|
+
"value"
|
|
5079
|
+
];
|
|
5080
|
+
var reasoningWidgetFrameOptions = ["bordered", "minimal"];
|
|
5081
|
+
var ReasoningWidgetDensityContext = React32.createContext("default");
|
|
5082
|
+
var actionIconNames = {
|
|
5083
|
+
accept: "check",
|
|
5084
|
+
add: "plus",
|
|
5085
|
+
edit: "edit",
|
|
5086
|
+
reject: "x",
|
|
5087
|
+
remove: "trash"
|
|
5088
|
+
};
|
|
5089
|
+
var actionToneById = {
|
|
5090
|
+
accept: "primary",
|
|
5091
|
+
add: "primary",
|
|
5092
|
+
edit: "neutral",
|
|
5093
|
+
reject: "danger",
|
|
5094
|
+
remove: "danger"
|
|
5095
|
+
};
|
|
5096
|
+
var actionVariantByTone = {
|
|
5097
|
+
danger: "destructive",
|
|
5098
|
+
neutral: "ghost",
|
|
5099
|
+
primary: "subtle"
|
|
5100
|
+
};
|
|
5101
|
+
var toneSurfaceClassName = {
|
|
5102
|
+
default: "border-[color:var(--sofya-neutral-600)] bg-card",
|
|
5103
|
+
info: "border-[color:var(--sofya-tone-info-border)] bg-[color:var(--sofya-tone-info-background)]",
|
|
5104
|
+
success: "border-[color:var(--sofya-tone-success-border)] bg-[color:var(--sofya-tone-success-background)]",
|
|
5105
|
+
warning: "border-[color:var(--sofya-tone-warning-border)] bg-[color:var(--sofya-tone-warning-background)]",
|
|
5106
|
+
critical: "border-[color:var(--sofya-tone-destructive-border)] bg-[color:var(--sofya-tone-destructive-background)]",
|
|
5107
|
+
muted: "border-[color:var(--sofya-neutral-600)] bg-card"
|
|
5108
|
+
};
|
|
5109
|
+
var clinicalToneMarkerClassName = {
|
|
5110
|
+
default: "bg-[color:var(--sofya-neutral-600)]",
|
|
5111
|
+
info: "bg-secondary",
|
|
5112
|
+
success: "bg-[color:var(--sofya-tag-green)]",
|
|
5113
|
+
warning: "bg-[color:var(--sofya-tag-red)]",
|
|
5114
|
+
critical: "bg-[color:var(--sofya-tag-red)]",
|
|
5115
|
+
muted: "bg-[color:var(--sofya-neutral-600)]"
|
|
5116
|
+
};
|
|
5117
|
+
var clinicalToneSurfaceClassName = {
|
|
5118
|
+
default: "bg-transparent",
|
|
5119
|
+
info: "bg-[color:var(--sofya-neutral-50)]",
|
|
5120
|
+
success: "bg-transparent",
|
|
5121
|
+
warning: "bg-transparent",
|
|
5122
|
+
critical: "bg-transparent",
|
|
5123
|
+
muted: "bg-transparent"
|
|
5124
|
+
};
|
|
5125
|
+
var clinicalToneStatusClassName = {
|
|
5126
|
+
default: "text-[color:var(--sofya-text-subtle)]",
|
|
5127
|
+
info: "text-secondary",
|
|
5128
|
+
success: "text-[color:var(--sofya-tag-green)]",
|
|
5129
|
+
warning: "text-[color:var(--sofya-tag-red)]",
|
|
5130
|
+
critical: "text-[color:var(--sofya-tag-red)]",
|
|
5131
|
+
muted: "text-[color:var(--sofya-text-subtle)]"
|
|
5132
|
+
};
|
|
5133
|
+
var clinicalToneValueClassName = {
|
|
5134
|
+
default: "text-[color:var(--sofya-neutral-900)]",
|
|
5135
|
+
info: "text-[color:var(--sofya-neutral-900)]",
|
|
5136
|
+
success: "text-[color:var(--sofya-neutral-900)]",
|
|
5137
|
+
warning: "text-[color:var(--sofya-tag-red)]",
|
|
5138
|
+
critical: "text-[color:var(--sofya-tag-red)]",
|
|
5139
|
+
muted: "text-[color:var(--sofya-neutral-900)]"
|
|
5140
|
+
};
|
|
5141
|
+
var clinicalToneBadgeClassName = {
|
|
5142
|
+
default: "bg-[color:var(--sofya-neutral-50)] text-[color:var(--sofya-text-subtle)]",
|
|
5143
|
+
info: "bg-[color:var(--sofya-neutral-50)] text-secondary",
|
|
5144
|
+
success: "bg-[color:var(--sofya-agent-mint)] text-[color:var(--sofya-tag-green)]",
|
|
5145
|
+
warning: "bg-[color:var(--sofya-tag-sand)] text-[color:var(--sofya-tag-red)]",
|
|
5146
|
+
critical: "bg-[color:var(--sofya-tag-sand)] text-[color:var(--sofya-tag-red)]",
|
|
5147
|
+
muted: "bg-[color:var(--sofya-neutral-50)] text-[color:var(--sofya-text-subtle)]"
|
|
5148
|
+
};
|
|
5149
|
+
var clinicalDataFrameClassName = {
|
|
5150
|
+
bordered: "w-full overflow-hidden rounded-[var(--sofya-radius-lg)] border border-[color:var(--sofya-neutral-600)] bg-card",
|
|
5151
|
+
minimal: "w-full overflow-hidden rounded-[var(--sofya-radius-md)] border-0 bg-[color:var(--sofya-neutral-50)]"
|
|
5152
|
+
};
|
|
5153
|
+
var clinicalDataHeaderClassName = {
|
|
5154
|
+
bordered: "border-b border-[color:var(--sofya-neutral-600)] bg-[color:var(--sofya-neutral-50)]",
|
|
5155
|
+
minimal: "border-b border-[color:var(--sofya-neutral-600)] bg-transparent"
|
|
5156
|
+
};
|
|
5157
|
+
var clinicalLabsFrameClassName = {
|
|
5158
|
+
bordered: "w-full overflow-x-auto overflow-y-hidden rounded-[var(--sofya-radius-lg)] border border-[color:var(--sofya-neutral-600)] bg-card",
|
|
5159
|
+
minimal: "w-fit max-w-full overflow-x-auto overflow-y-hidden rounded-[var(--sofya-radius-md)] border-0 bg-[color:var(--sofya-neutral-50)]"
|
|
5160
|
+
};
|
|
5161
|
+
var tableAlignClassName = {
|
|
5162
|
+
center: "text-center",
|
|
5163
|
+
left: "text-left",
|
|
5164
|
+
right: "text-right"
|
|
5165
|
+
};
|
|
5166
|
+
function isWidgetAction(action) {
|
|
5167
|
+
return action.scope === "widget";
|
|
5168
|
+
}
|
|
5169
|
+
function isItemAction(action) {
|
|
5170
|
+
return action.scope !== "widget";
|
|
5171
|
+
}
|
|
5172
|
+
function getActionIcon(action) {
|
|
5173
|
+
if (action.icon) {
|
|
5174
|
+
return action.icon;
|
|
5175
|
+
}
|
|
5176
|
+
return actionIconNames[action.id] ?? "square-toggle";
|
|
5177
|
+
}
|
|
5178
|
+
function getActionTone(action) {
|
|
5179
|
+
if (action.tone) {
|
|
5180
|
+
return action.tone;
|
|
5181
|
+
}
|
|
5182
|
+
return actionToneById[action.id] ?? "neutral";
|
|
5183
|
+
}
|
|
5184
|
+
function getTargetLabel(target) {
|
|
5185
|
+
if (!target) {
|
|
5186
|
+
return void 0;
|
|
5187
|
+
}
|
|
5188
|
+
if ("label" in target) {
|
|
5189
|
+
return typeof target.label === "string" || typeof target.label === "number" ? String(target.label) : target.id;
|
|
5190
|
+
}
|
|
5191
|
+
return target.id;
|
|
5192
|
+
}
|
|
5193
|
+
function getActionLabel(action, target) {
|
|
5194
|
+
if (action.ariaLabel) {
|
|
5195
|
+
return action.ariaLabel;
|
|
5196
|
+
}
|
|
5197
|
+
const targetLabel = getTargetLabel(target);
|
|
5198
|
+
return targetLabel ? `${action.label} ${targetLabel}` : action.label;
|
|
5199
|
+
}
|
|
5200
|
+
function getItemsFromDescriptor(widget) {
|
|
5201
|
+
return widget.items ?? widget.data?.items ?? [];
|
|
5202
|
+
}
|
|
5203
|
+
function getDescriptionFromDescriptor(widget) {
|
|
5204
|
+
return widget.description ?? widget.data?.description;
|
|
5205
|
+
}
|
|
5206
|
+
function getEmptyLabelFromDescriptor(widget) {
|
|
5207
|
+
return widget.emptyLabel ?? widget.data?.emptyLabel;
|
|
5208
|
+
}
|
|
5209
|
+
function getFrameFromDescriptor(widget) {
|
|
5210
|
+
return widget.frame ?? widget.data?.frame;
|
|
5211
|
+
}
|
|
5212
|
+
function getDescriptorKind(widget) {
|
|
5213
|
+
return `${widget.component ?? ""} ${widget.type ?? ""}`.toLowerCase();
|
|
5214
|
+
}
|
|
5215
|
+
function getIconFromDescriptor(widget) {
|
|
5216
|
+
if (widget.icon) {
|
|
5217
|
+
return widget.icon;
|
|
5218
|
+
}
|
|
5219
|
+
const descriptorKind = getDescriptorKind(widget);
|
|
5220
|
+
if (descriptorKind.includes("summary") || descriptorKind.includes("impression") || hasRenderableNode(widget.data?.impression)) {
|
|
5221
|
+
return "stethoscope";
|
|
5222
|
+
}
|
|
5223
|
+
if (descriptorKind.includes("vitals")) {
|
|
5224
|
+
return "activity-heartbeat";
|
|
5225
|
+
}
|
|
5226
|
+
if (descriptorKind.includes("question")) {
|
|
5227
|
+
return "question";
|
|
5228
|
+
}
|
|
5229
|
+
if (descriptorKind.includes("prescription") || descriptorKind.includes("medication")) {
|
|
5230
|
+
return "pill";
|
|
5231
|
+
}
|
|
5232
|
+
if (descriptorKind.includes("lab")) {
|
|
5233
|
+
return "flask";
|
|
5234
|
+
}
|
|
5235
|
+
if (descriptorKind.includes("alert")) {
|
|
5236
|
+
return "alert-circle";
|
|
5237
|
+
}
|
|
5238
|
+
if (widget.data?.tableColumns && widget.data.rows) {
|
|
5239
|
+
return "table";
|
|
5240
|
+
}
|
|
5241
|
+
return "clipboard-list";
|
|
5242
|
+
}
|
|
5243
|
+
function hasRenderableNode(value) {
|
|
5244
|
+
return value !== null && value !== void 0 && value !== false;
|
|
5245
|
+
}
|
|
5246
|
+
function isEditableTextValue(value) {
|
|
5247
|
+
return typeof value === "string" || typeof value === "number";
|
|
5248
|
+
}
|
|
5249
|
+
function ReasoningEditableText({
|
|
5250
|
+
as = "span",
|
|
5251
|
+
ariaLabel,
|
|
5252
|
+
className,
|
|
5253
|
+
editable = false,
|
|
5254
|
+
multiline = false,
|
|
5255
|
+
onCommit,
|
|
5256
|
+
size,
|
|
5257
|
+
value,
|
|
5258
|
+
weight
|
|
5259
|
+
}) {
|
|
5260
|
+
if (!editable || !isEditableTextValue(value)) {
|
|
5261
|
+
return renderTextContent(value, {
|
|
5262
|
+
as,
|
|
5263
|
+
className,
|
|
5264
|
+
size,
|
|
5265
|
+
weight
|
|
5266
|
+
});
|
|
5267
|
+
}
|
|
5268
|
+
const initialValue = String(value);
|
|
5269
|
+
return /* @__PURE__ */ jsx34(
|
|
5270
|
+
Text,
|
|
4981
5271
|
{
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
variant: "ghost",
|
|
4985
|
-
selected: active,
|
|
4986
|
-
"data-slot": "right-rail-action",
|
|
5272
|
+
as,
|
|
5273
|
+
"aria-label": ariaLabel,
|
|
4987
5274
|
className: cn(
|
|
4988
|
-
"
|
|
5275
|
+
"rounded-[4px] text-inherit outline-none transition-[background-color,box-shadow] duration-sofya ease-sofya",
|
|
5276
|
+
"-mx-1 px-1 hover:bg-[color:var(--sofya-surface-hover)] focus-visible:bg-card focus-visible:ring-2 focus-visible:ring-[color:var(--sofya-focus-ring-strong)]",
|
|
5277
|
+
multiline ? "whitespace-pre-wrap" : "truncate",
|
|
4989
5278
|
className
|
|
4990
5279
|
),
|
|
4991
|
-
|
|
4992
|
-
|
|
4993
|
-
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5280
|
+
contentEditable: true,
|
|
5281
|
+
"data-editable": "true",
|
|
5282
|
+
role: "textbox",
|
|
5283
|
+
size,
|
|
5284
|
+
spellCheck: true,
|
|
5285
|
+
suppressContentEditableWarning: true,
|
|
5286
|
+
tabIndex: 0,
|
|
5287
|
+
weight,
|
|
5288
|
+
onBlur: (event) => {
|
|
5289
|
+
const nextValue = event.currentTarget.textContent ?? "";
|
|
5290
|
+
if (nextValue !== initialValue) {
|
|
5291
|
+
onCommit?.(nextValue);
|
|
5292
|
+
}
|
|
5293
|
+
},
|
|
5294
|
+
onKeyDown: (event) => {
|
|
5295
|
+
if (event.key === "Enter" && !multiline) {
|
|
5296
|
+
event.preventDefault();
|
|
5297
|
+
event.currentTarget.blur();
|
|
5298
|
+
}
|
|
5299
|
+
},
|
|
5300
|
+
children: initialValue
|
|
5010
5301
|
}
|
|
5011
5302
|
);
|
|
5012
|
-
}
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
return /* @__PURE__ */
|
|
5016
|
-
|
|
5303
|
+
}
|
|
5304
|
+
var ReasoningWidgetActionButton = React32.forwardRef(function ReasoningWidgetActionButton2({ action, className, disabled, onAction, target, widgetId, ...props }, ref) {
|
|
5305
|
+
const tone = getActionTone(action);
|
|
5306
|
+
return /* @__PURE__ */ jsx34(
|
|
5307
|
+
IconButton,
|
|
5017
5308
|
{
|
|
5018
5309
|
ref,
|
|
5019
|
-
"
|
|
5310
|
+
"aria-label": getActionLabel(
|
|
5311
|
+
action,
|
|
5312
|
+
target
|
|
5313
|
+
),
|
|
5314
|
+
"data-action-id": action.id,
|
|
5315
|
+
"data-action-scope": action.scope,
|
|
5316
|
+
disabled: disabled ?? action.disabled,
|
|
5317
|
+
icon: /* @__PURE__ */ jsx34(Icon, { name: getActionIcon(action), size: "sm" }),
|
|
5318
|
+
size: "sm",
|
|
5319
|
+
variant: actionVariantByTone[tone],
|
|
5020
5320
|
className: cn(
|
|
5021
|
-
"
|
|
5321
|
+
"rounded-[var(--sofya-radius-sm)] text-[color:var(--sofya-text-soft)]",
|
|
5322
|
+
tone === "primary" && "text-primary",
|
|
5022
5323
|
className
|
|
5023
5324
|
),
|
|
5325
|
+
onClick: () => {
|
|
5326
|
+
onAction?.({
|
|
5327
|
+
action,
|
|
5328
|
+
target,
|
|
5329
|
+
widgetId
|
|
5330
|
+
});
|
|
5331
|
+
},
|
|
5024
5332
|
...props
|
|
5025
5333
|
}
|
|
5026
5334
|
);
|
|
5027
5335
|
});
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5336
|
+
var ReasoningWidgetActions = React32.forwardRef(function ReasoningWidgetActions2({
|
|
5337
|
+
actions = [],
|
|
5338
|
+
className,
|
|
5339
|
+
onAction,
|
|
5340
|
+
reveal = "widget-hover",
|
|
5341
|
+
target,
|
|
5342
|
+
widgetId,
|
|
5343
|
+
...props
|
|
5344
|
+
}, ref) {
|
|
5345
|
+
if (actions.length === 0) {
|
|
5346
|
+
return null;
|
|
5347
|
+
}
|
|
5348
|
+
return /* @__PURE__ */ jsx34(
|
|
5349
|
+
"div",
|
|
5032
5350
|
{
|
|
5033
5351
|
ref,
|
|
5034
|
-
"data-slot": "
|
|
5035
|
-
|
|
5352
|
+
"data-slot": "reasoning-widget-actions",
|
|
5353
|
+
"data-reveal": reveal,
|
|
5036
5354
|
className: cn(
|
|
5037
|
-
"flex
|
|
5355
|
+
"z-10 flex shrink-0 items-center gap-1 transition-opacity duration-sofya ease-sofya",
|
|
5356
|
+
reveal === "widget-hover" && "pointer-events-none opacity-0 group-hover/reasoning:pointer-events-auto group-hover/reasoning:opacity-100 group-focus-within/reasoning:pointer-events-auto group-focus-within/reasoning:opacity-100",
|
|
5357
|
+
reveal === "item-hover" && "pointer-events-none opacity-0 group-hover/item:pointer-events-auto group-hover/item:opacity-100 group-focus-within/item:pointer-events-auto group-focus-within/item:opacity-100",
|
|
5038
5358
|
className
|
|
5039
5359
|
),
|
|
5040
5360
|
...props,
|
|
5041
|
-
children: /* @__PURE__ */
|
|
5042
|
-
|
|
5361
|
+
children: actions.map((action) => /* @__PURE__ */ jsx34(
|
|
5362
|
+
ReasoningWidgetActionButton,
|
|
5043
5363
|
{
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
)
|
|
5364
|
+
action,
|
|
5365
|
+
onAction,
|
|
5366
|
+
target,
|
|
5367
|
+
widgetId
|
|
5368
|
+
},
|
|
5369
|
+
action.id
|
|
5370
|
+
))
|
|
5051
5371
|
}
|
|
5052
5372
|
);
|
|
5053
5373
|
});
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5374
|
+
var ReasoningWidget = React32.forwardRef(
|
|
5375
|
+
function ReasoningWidget2({
|
|
5376
|
+
actions = [],
|
|
5377
|
+
children,
|
|
5378
|
+
className,
|
|
5379
|
+
density = "default",
|
|
5380
|
+
description,
|
|
5381
|
+
empty = false,
|
|
5382
|
+
emptyLabel = "No extracted information yet.",
|
|
5383
|
+
eyebrow,
|
|
5384
|
+
icon,
|
|
5385
|
+
onAction,
|
|
5386
|
+
sectionDivider = false,
|
|
5387
|
+
title,
|
|
5388
|
+
variant = "flat",
|
|
5389
|
+
widgetId,
|
|
5390
|
+
...props
|
|
5391
|
+
}, ref) {
|
|
5392
|
+
const widgetActions = actions.filter(isWidgetAction);
|
|
5393
|
+
return /* @__PURE__ */ jsx34(ReasoningWidgetDensityContext.Provider, { value: density, children: /* @__PURE__ */ jsxs17(
|
|
5394
|
+
"article",
|
|
5395
|
+
{
|
|
5396
|
+
ref,
|
|
5397
|
+
"data-density": density,
|
|
5398
|
+
"data-slot": "reasoning-widget",
|
|
5399
|
+
"data-variant": variant,
|
|
5400
|
+
className: cn(
|
|
5401
|
+
"group/reasoning w-full shadow-none",
|
|
5402
|
+
"transition-[border-color,box-shadow] duration-sofya ease-sofya",
|
|
5403
|
+
variant === "flat" && "rounded-none border-0 bg-transparent p-0",
|
|
5404
|
+
variant === "outline" && "rounded-[var(--sofya-radius-md)] border border-[color:var(--sofya-border-strong)] bg-card",
|
|
5405
|
+
variant === "muted" && "rounded-[var(--sofya-radius-md)] border-0 bg-[color:var(--sofya-surface-muted)]",
|
|
5406
|
+
variant === "suggestion" && "rounded-[var(--sofya-radius-md)] border border-[color:var(--sofya-border-hover)] bg-card",
|
|
5407
|
+
variant !== "flat" && (density === "compact" ? "p-4" : "p-5"),
|
|
5408
|
+
className
|
|
5409
|
+
),
|
|
5410
|
+
...props,
|
|
5411
|
+
children: [
|
|
5412
|
+
/* @__PURE__ */ jsxs17(
|
|
5413
|
+
"div",
|
|
5414
|
+
{
|
|
5415
|
+
"data-slot": "reasoning-widget-header",
|
|
5416
|
+
className: "relative flex items-start gap-4",
|
|
5417
|
+
children: [
|
|
5418
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex min-w-0 flex-1 items-start gap-3", children: [
|
|
5419
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex min-w-0 items-start gap-2.5", children: [
|
|
5420
|
+
icon ? /* @__PURE__ */ jsx34(
|
|
5421
|
+
"span",
|
|
5422
|
+
{
|
|
5423
|
+
"aria-hidden": "true",
|
|
5424
|
+
"data-icon": icon,
|
|
5425
|
+
"data-slot": "reasoning-widget-icon",
|
|
5426
|
+
className: "mt-0.5 inline-flex size-4 shrink-0 items-center justify-center text-secondary",
|
|
5427
|
+
children: /* @__PURE__ */ jsx34(Icon, { name: icon, size: 14, strokeWidth: 1.8 })
|
|
5428
|
+
}
|
|
5429
|
+
) : null,
|
|
5430
|
+
/* @__PURE__ */ jsxs17("div", { className: "min-w-0", children: [
|
|
5431
|
+
eyebrow ? renderTextContent(eyebrow, {
|
|
5432
|
+
as: "span",
|
|
5433
|
+
className: "mb-1 block uppercase text-secondary [font-weight:var(--sofya-text-section-label-font-weight)]",
|
|
5434
|
+
size: "section-label"
|
|
5435
|
+
}) : null,
|
|
5436
|
+
/* @__PURE__ */ jsx34(
|
|
5437
|
+
"h3",
|
|
5438
|
+
{
|
|
5439
|
+
className: cn(
|
|
5440
|
+
"m-0",
|
|
5441
|
+
eyebrow ? "text-[color:var(--sofya-neutral-800)]" : "text-secondary"
|
|
5442
|
+
),
|
|
5443
|
+
children: renderTextContent(title, {
|
|
5444
|
+
as: "span",
|
|
5445
|
+
className: cn(
|
|
5446
|
+
"block text-inherit",
|
|
5447
|
+
!eyebrow && "uppercase"
|
|
5448
|
+
),
|
|
5449
|
+
size: eyebrow ? density === "compact" ? "label-md" : "title-sm" : density === "compact" ? "section-label" : "clinical-section-title"
|
|
5450
|
+
})
|
|
5451
|
+
}
|
|
5452
|
+
),
|
|
5453
|
+
description ? renderTextContent(description, {
|
|
5454
|
+
as: "p",
|
|
5455
|
+
className: "mt-2 text-[color:var(--sofya-text-subtle)]",
|
|
5456
|
+
size: "body-md"
|
|
5457
|
+
}) : null
|
|
5458
|
+
] })
|
|
5459
|
+
] }),
|
|
5460
|
+
sectionDivider ? /* @__PURE__ */ jsx34(
|
|
5461
|
+
"span",
|
|
5462
|
+
{
|
|
5463
|
+
"aria-hidden": "true",
|
|
5464
|
+
"data-slot": "reasoning-widget-section-divider",
|
|
5465
|
+
className: cn(
|
|
5466
|
+
"mt-2 h-px min-w-8 flex-1 bg-[color:var(--sofya-neutral-600)]",
|
|
5467
|
+
widgetActions.length > 0 && "mr-12"
|
|
5468
|
+
)
|
|
5469
|
+
}
|
|
5470
|
+
) : null
|
|
5471
|
+
] }),
|
|
5472
|
+
/* @__PURE__ */ jsx34(
|
|
5473
|
+
ReasoningWidgetActions,
|
|
5474
|
+
{
|
|
5475
|
+
actions: widgetActions,
|
|
5476
|
+
className: "absolute right-0 top-1/2 -translate-y-1/2",
|
|
5477
|
+
onAction,
|
|
5478
|
+
reveal: "widget-hover",
|
|
5479
|
+
widgetId
|
|
5480
|
+
}
|
|
5481
|
+
)
|
|
5482
|
+
]
|
|
5483
|
+
}
|
|
5484
|
+
),
|
|
5485
|
+
/* @__PURE__ */ jsx34(
|
|
5486
|
+
"div",
|
|
5487
|
+
{
|
|
5488
|
+
"data-slot": "reasoning-widget-content",
|
|
5489
|
+
className: cn(density === "compact" ? "mt-3" : "mt-4"),
|
|
5490
|
+
children: empty ? renderTextContent(emptyLabel, {
|
|
5491
|
+
as: "p",
|
|
5492
|
+
className: "m-0 text-[color:var(--sofya-text-subtle)]",
|
|
5493
|
+
size: "body-md"
|
|
5494
|
+
}) : children
|
|
5495
|
+
}
|
|
5496
|
+
)
|
|
5497
|
+
]
|
|
5498
|
+
}
|
|
5499
|
+
) });
|
|
5500
|
+
}
|
|
5501
|
+
);
|
|
5502
|
+
var ReasoningWidgetList = React32.forwardRef(function ReasoningWidgetList2({
|
|
5503
|
+
actions = [],
|
|
5504
|
+
className,
|
|
5505
|
+
editable = false,
|
|
5506
|
+
emptyLabel,
|
|
5507
|
+
items,
|
|
5508
|
+
onAction,
|
|
5509
|
+
onItemEdit,
|
|
5510
|
+
widgetId,
|
|
5511
|
+
...props
|
|
5512
|
+
}, ref) {
|
|
5513
|
+
const itemActions = actions.filter(isItemAction);
|
|
5514
|
+
const density = React32.useContext(ReasoningWidgetDensityContext);
|
|
5515
|
+
const primaryTextSize = density === "compact" ? "body-md" : "clinical-body";
|
|
5516
|
+
const supportingTextSize = density === "compact" ? "body-sm" : "clinical-body";
|
|
5517
|
+
if (items.length === 0) {
|
|
5518
|
+
return /* @__PURE__ */ jsx34("p", { className: "m-0 text-[color:var(--sofya-text-subtle)]", children: renderTextContent(emptyLabel ?? "No extracted items.", {
|
|
5519
|
+
as: "span",
|
|
5520
|
+
className: "block text-inherit",
|
|
5521
|
+
size: "body-md"
|
|
5522
|
+
}) });
|
|
5523
|
+
}
|
|
5524
|
+
return /* @__PURE__ */ jsx34(
|
|
5525
|
+
"ul",
|
|
5058
5526
|
{
|
|
5059
5527
|
ref,
|
|
5060
|
-
"data-slot": "
|
|
5061
|
-
className: cn("
|
|
5062
|
-
...props
|
|
5528
|
+
"data-slot": "reasoning-widget-list",
|
|
5529
|
+
className: cn("m-0 list-none space-y-0 p-0", className),
|
|
5530
|
+
...props,
|
|
5531
|
+
children: items.map((item, index) => /* @__PURE__ */ jsxs17(
|
|
5532
|
+
"li",
|
|
5533
|
+
{
|
|
5534
|
+
"data-slot": "reasoning-widget-list-item",
|
|
5535
|
+
"data-tone": item.tone,
|
|
5536
|
+
className: "group/item relative grid grid-cols-[auto_minmax(0,1fr)] items-start gap-3 rounded-[var(--sofya-radius-sm)] pr-2 transition-colors duration-sofya ease-sofya hover:bg-[color:var(--sofya-surface-hover)] focus-within:bg-[color:var(--sofya-surface-hover)]",
|
|
5537
|
+
children: [
|
|
5538
|
+
/* @__PURE__ */ jsx34(
|
|
5539
|
+
"span",
|
|
5540
|
+
{
|
|
5541
|
+
"aria-hidden": "true",
|
|
5542
|
+
"data-slot": "reasoning-widget-list-marker",
|
|
5543
|
+
className: "mt-2 size-2 rounded-full bg-[color:var(--sofya-text-soft)]"
|
|
5544
|
+
}
|
|
5545
|
+
),
|
|
5546
|
+
/* @__PURE__ */ jsxs17("div", { className: "min-w-0", children: [
|
|
5547
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1", children: [
|
|
5548
|
+
/* @__PURE__ */ jsx34("span", { className: "min-w-0 text-[color:var(--sofya-neutral-800)]", children: /* @__PURE__ */ jsx34(
|
|
5549
|
+
ReasoningEditableText,
|
|
5550
|
+
{
|
|
5551
|
+
ariaLabel: `Edit ${getTargetLabel(item) ?? "item"} label`,
|
|
5552
|
+
className: "block text-inherit",
|
|
5553
|
+
editable,
|
|
5554
|
+
size: primaryTextSize,
|
|
5555
|
+
value: item.label,
|
|
5556
|
+
onCommit: (value) => {
|
|
5557
|
+
onItemEdit?.({
|
|
5558
|
+
field: "label",
|
|
5559
|
+
item,
|
|
5560
|
+
value,
|
|
5561
|
+
widgetId
|
|
5562
|
+
});
|
|
5563
|
+
}
|
|
5564
|
+
}
|
|
5565
|
+
) }),
|
|
5566
|
+
hasRenderableNode(item.value) ? /* @__PURE__ */ jsx34(
|
|
5567
|
+
ReasoningEditableText,
|
|
5568
|
+
{
|
|
5569
|
+
ariaLabel: `Edit ${getTargetLabel(item) ?? "item"} value`,
|
|
5570
|
+
className: "text-[color:var(--sofya-text-soft)]",
|
|
5571
|
+
editable,
|
|
5572
|
+
size: primaryTextSize,
|
|
5573
|
+
value: item.value,
|
|
5574
|
+
onCommit: (value) => {
|
|
5575
|
+
onItemEdit?.({
|
|
5576
|
+
field: "value",
|
|
5577
|
+
item,
|
|
5578
|
+
value,
|
|
5579
|
+
widgetId
|
|
5580
|
+
});
|
|
5581
|
+
}
|
|
5582
|
+
}
|
|
5583
|
+
) : null,
|
|
5584
|
+
hasRenderableNode(item.status) ? /* @__PURE__ */ jsx34(
|
|
5585
|
+
ReasoningEditableText,
|
|
5586
|
+
{
|
|
5587
|
+
ariaLabel: `Edit ${getTargetLabel(item) ?? "item"} status`,
|
|
5588
|
+
className: "text-[color:var(--sofya-text-subtle)]",
|
|
5589
|
+
editable,
|
|
5590
|
+
size: "caption",
|
|
5591
|
+
value: item.status,
|
|
5592
|
+
onCommit: (value) => {
|
|
5593
|
+
onItemEdit?.({
|
|
5594
|
+
field: "status",
|
|
5595
|
+
item,
|
|
5596
|
+
value,
|
|
5597
|
+
widgetId
|
|
5598
|
+
});
|
|
5599
|
+
}
|
|
5600
|
+
}
|
|
5601
|
+
) : null
|
|
5602
|
+
] }),
|
|
5603
|
+
hasRenderableNode(item.evidence) ? /* @__PURE__ */ jsx34(
|
|
5604
|
+
ReasoningEditableText,
|
|
5605
|
+
{
|
|
5606
|
+
as: "p",
|
|
5607
|
+
ariaLabel: `Edit ${getTargetLabel(item) ?? "item"} evidence`,
|
|
5608
|
+
className: "mt-1 text-[color:var(--sofya-text-subtle)]",
|
|
5609
|
+
editable,
|
|
5610
|
+
multiline: true,
|
|
5611
|
+
size: supportingTextSize,
|
|
5612
|
+
value: item.evidence,
|
|
5613
|
+
onCommit: (value) => {
|
|
5614
|
+
onItemEdit?.({
|
|
5615
|
+
field: "evidence",
|
|
5616
|
+
item,
|
|
5617
|
+
value,
|
|
5618
|
+
widgetId
|
|
5619
|
+
});
|
|
5620
|
+
}
|
|
5621
|
+
}
|
|
5622
|
+
) : null
|
|
5623
|
+
] }),
|
|
5624
|
+
/* @__PURE__ */ jsx34(
|
|
5625
|
+
ReasoningWidgetActions,
|
|
5626
|
+
{
|
|
5627
|
+
actions: itemActions,
|
|
5628
|
+
className: "absolute right-1 top-1",
|
|
5629
|
+
onAction,
|
|
5630
|
+
reveal: "item-hover",
|
|
5631
|
+
target: item,
|
|
5632
|
+
widgetId
|
|
5633
|
+
}
|
|
5634
|
+
)
|
|
5635
|
+
]
|
|
5636
|
+
},
|
|
5637
|
+
item.id ?? `reasoning-widget-item-${index}`
|
|
5638
|
+
))
|
|
5063
5639
|
}
|
|
5064
5640
|
);
|
|
5065
5641
|
});
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
|
|
5081
|
-
|
|
5082
|
-
|
|
5083
|
-
|
|
5084
|
-
|
|
5642
|
+
var ReasoningWidgetTable = React32.forwardRef(function ReasoningWidgetTable2({
|
|
5643
|
+
actions = [],
|
|
5644
|
+
className,
|
|
5645
|
+
columns,
|
|
5646
|
+
editable = false,
|
|
5647
|
+
emptyLabel = "No rows available.",
|
|
5648
|
+
onAction,
|
|
5649
|
+
onCellEdit,
|
|
5650
|
+
rows,
|
|
5651
|
+
showHeader = true,
|
|
5652
|
+
widgetId,
|
|
5653
|
+
...props
|
|
5654
|
+
}, ref) {
|
|
5655
|
+
const itemActions = actions.filter(isItemAction);
|
|
5656
|
+
const hasActions = itemActions.length > 0;
|
|
5657
|
+
const density = React32.useContext(ReasoningWidgetDensityContext);
|
|
5658
|
+
const headerTextSize = density === "compact" ? "label-md" : "body-sm";
|
|
5659
|
+
const cellTextSize = density === "compact" ? "body-sm" : "body-sm";
|
|
5660
|
+
if (rows.length === 0) {
|
|
5661
|
+
return /* @__PURE__ */ jsx34("p", { className: "m-0 text-[color:var(--sofya-text-subtle)]", children: renderTextContent(emptyLabel, {
|
|
5085
5662
|
as: "span",
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
);
|
|
5093
|
-
});
|
|
5094
|
-
SelectValue.displayName = SelectPrimitive.Value.displayName;
|
|
5095
|
-
var SelectTrigger = React34.forwardRef(function SelectTrigger2({ className, children, size = "default", ...props }, ref) {
|
|
5096
|
-
return /* @__PURE__ */ jsxs17(
|
|
5097
|
-
SelectPrimitive.Trigger,
|
|
5663
|
+
className: "block text-inherit",
|
|
5664
|
+
size: "body-md"
|
|
5665
|
+
}) });
|
|
5666
|
+
}
|
|
5667
|
+
return /* @__PURE__ */ jsx34(
|
|
5668
|
+
"div",
|
|
5098
5669
|
{
|
|
5099
5670
|
ref,
|
|
5100
|
-
"data-slot": "
|
|
5101
|
-
"data-size": size,
|
|
5671
|
+
"data-slot": "reasoning-widget-table",
|
|
5102
5672
|
className: cn(
|
|
5103
|
-
|
|
5104
|
-
"data-[size=default]:h-10 data-[size=default]:py-2 data-[size=sm]:h-9 data-[size=sm]:px-2 data-[size=sm]:text-[14px] data-[size=sm]:leading-5 [&>span]:line-clamp-1 [&>span]:flex-1",
|
|
5673
|
+
"overflow-hidden rounded-[10px] border border-[color:var(--sofya-neutral-600)] bg-[color:var(--sofya-neutral-50)]",
|
|
5105
5674
|
className
|
|
5106
5675
|
),
|
|
5107
5676
|
...props,
|
|
5108
|
-
children: [
|
|
5109
|
-
children,
|
|
5110
|
-
|
|
5111
|
-
Icon,
|
|
5677
|
+
children: /* @__PURE__ */ jsxs17("table", { className: "w-full border-collapse table-fixed", children: [
|
|
5678
|
+
showHeader ? /* @__PURE__ */ jsx34("thead", { children: /* @__PURE__ */ jsx34("tr", { className: "border-b border-[color:var(--sofya-neutral-600)]", children: columns.map((column, columnIndex) => /* @__PURE__ */ jsx34(
|
|
5679
|
+
"th",
|
|
5112
5680
|
{
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5681
|
+
className: cn(
|
|
5682
|
+
"align-middle text-[color:var(--sofya-text-subtle)]",
|
|
5683
|
+
density === "compact" ? "px-3 py-2" : "px-4 py-2",
|
|
5684
|
+
columnIndex > 0 && "border-l border-[color:var(--sofya-neutral-600)]",
|
|
5685
|
+
tableAlignClassName[column.align ?? "left"]
|
|
5686
|
+
),
|
|
5687
|
+
style: column.width ? { width: column.width } : void 0,
|
|
5688
|
+
scope: "col",
|
|
5689
|
+
children: renderTextContent(column.header, {
|
|
5690
|
+
as: "span",
|
|
5691
|
+
className: "block truncate text-inherit",
|
|
5692
|
+
size: headerTextSize
|
|
5693
|
+
})
|
|
5694
|
+
},
|
|
5695
|
+
column.key
|
|
5696
|
+
)) }) }) : null,
|
|
5697
|
+
/* @__PURE__ */ jsx34("tbody", { children: rows.map((row, rowIndex) => /* @__PURE__ */ jsx34(
|
|
5698
|
+
"tr",
|
|
5699
|
+
{
|
|
5700
|
+
"data-tone": row.tone,
|
|
5701
|
+
className: cn(
|
|
5702
|
+
"group/item border-t border-[color:var(--sofya-neutral-600)] transition-colors duration-sofya ease-sofya first:border-t-0 hover:bg-[color:var(--sofya-surface-hover)] focus-within:bg-[color:var(--sofya-surface-hover)]",
|
|
5703
|
+
row.tone && toneSurfaceClassName[row.tone]
|
|
5704
|
+
),
|
|
5705
|
+
children: columns.map((column, columnIndex) => {
|
|
5706
|
+
const isLastColumn = columnIndex === columns.length - 1;
|
|
5707
|
+
return /* @__PURE__ */ jsxs17(
|
|
5708
|
+
"td",
|
|
5709
|
+
{
|
|
5710
|
+
className: cn(
|
|
5711
|
+
"relative min-w-0 align-top",
|
|
5712
|
+
density === "compact" ? "px-3 py-2" : "px-4 py-2",
|
|
5713
|
+
column.variant === "value" ? "text-[color:var(--sofya-neutral-800)]" : "text-[color:var(--sofya-neutral-800)]",
|
|
5714
|
+
columnIndex > 0 && "border-l border-[color:var(--sofya-neutral-600)]",
|
|
5715
|
+
hasActions && isLastColumn && "pr-24",
|
|
5716
|
+
tableAlignClassName[column.align ?? "left"]
|
|
5717
|
+
),
|
|
5718
|
+
children: [
|
|
5719
|
+
/* @__PURE__ */ jsx34(
|
|
5720
|
+
ReasoningEditableText,
|
|
5721
|
+
{
|
|
5722
|
+
ariaLabel: `Edit ${row.id ?? "row"} ${column.key}`,
|
|
5723
|
+
className: "block truncate text-inherit",
|
|
5724
|
+
editable,
|
|
5725
|
+
size: cellTextSize,
|
|
5726
|
+
value: row.cells[column.key] ?? null,
|
|
5727
|
+
weight: column.variant === "value" ? 600 : void 0,
|
|
5728
|
+
onCommit: (value) => {
|
|
5729
|
+
onCellEdit?.({
|
|
5730
|
+
columnKey: column.key,
|
|
5731
|
+
row,
|
|
5732
|
+
value,
|
|
5733
|
+
widgetId
|
|
5734
|
+
});
|
|
5735
|
+
}
|
|
5736
|
+
}
|
|
5737
|
+
),
|
|
5738
|
+
hasActions && isLastColumn ? /* @__PURE__ */ jsx34(
|
|
5739
|
+
ReasoningWidgetActions,
|
|
5740
|
+
{
|
|
5741
|
+
actions: itemActions,
|
|
5742
|
+
className: "absolute right-2 top-1/2 -translate-y-1/2",
|
|
5743
|
+
onAction,
|
|
5744
|
+
reveal: "item-hover",
|
|
5745
|
+
target: row,
|
|
5746
|
+
widgetId
|
|
5747
|
+
}
|
|
5748
|
+
) : null
|
|
5749
|
+
]
|
|
5750
|
+
},
|
|
5751
|
+
column.key
|
|
5752
|
+
);
|
|
5753
|
+
})
|
|
5754
|
+
},
|
|
5755
|
+
row.id ?? `reasoning-widget-row-${rowIndex}`
|
|
5756
|
+
)) })
|
|
5757
|
+
] })
|
|
5758
|
+
}
|
|
5759
|
+
);
|
|
5760
|
+
});
|
|
5761
|
+
var ReasoningVitalsWidget = React32.forwardRef(function ReasoningVitalsWidget2({
|
|
5762
|
+
actions = [],
|
|
5763
|
+
editable = false,
|
|
5764
|
+
emptyLabel = "No vitals extracted.",
|
|
5765
|
+
frame = "bordered",
|
|
5766
|
+
icon = "activity-heartbeat",
|
|
5767
|
+
items,
|
|
5768
|
+
onAction,
|
|
5769
|
+
onItemEdit,
|
|
5770
|
+
title = "Vitals",
|
|
5771
|
+
widgetId,
|
|
5772
|
+
...props
|
|
5773
|
+
}, ref) {
|
|
5774
|
+
const itemActions = actions.filter(isItemAction);
|
|
5775
|
+
const hasActions = itemActions.length > 0;
|
|
5776
|
+
return /* @__PURE__ */ jsx34(
|
|
5777
|
+
ReasoningWidget,
|
|
5778
|
+
{
|
|
5779
|
+
ref,
|
|
5780
|
+
actions,
|
|
5781
|
+
empty: items.length === 0,
|
|
5782
|
+
emptyLabel,
|
|
5783
|
+
icon,
|
|
5784
|
+
onAction,
|
|
5785
|
+
title,
|
|
5786
|
+
widgetId,
|
|
5787
|
+
...props,
|
|
5788
|
+
children: /* @__PURE__ */ jsx34(
|
|
5789
|
+
"div",
|
|
5790
|
+
{
|
|
5791
|
+
"data-slot": "reasoning-vitals-list",
|
|
5792
|
+
"data-frame": frame,
|
|
5793
|
+
className: clinicalDataFrameClassName[frame],
|
|
5794
|
+
children: items.map((item, index) => {
|
|
5795
|
+
const tone = item.tone ?? "muted";
|
|
5796
|
+
const unit = item.unit ?? (typeof item.metadata?.unit === "string" ? item.metadata.unit : void 0);
|
|
5797
|
+
const hasValue = hasRenderableNode(item.value);
|
|
5798
|
+
const value = hasValue ? item.value : item.label;
|
|
5799
|
+
const label = hasValue ? item.label : void 0;
|
|
5800
|
+
return /* @__PURE__ */ jsxs17(
|
|
5801
|
+
"div",
|
|
5802
|
+
{
|
|
5803
|
+
"data-slot": "reasoning-vital",
|
|
5804
|
+
"data-tone": tone,
|
|
5805
|
+
className: cn(
|
|
5806
|
+
"group/item relative grid min-w-0 grid-cols-[auto_minmax(0,1fr)_auto] items-stretch gap-0 border-t border-[color:var(--sofya-neutral-600)] transition-colors duration-sofya ease-sofya first:border-t-0 hover:bg-[color:var(--sofya-surface-hover)] focus-within:bg-[color:var(--sofya-surface-hover)]",
|
|
5807
|
+
clinicalToneSurfaceClassName[tone]
|
|
5808
|
+
),
|
|
5809
|
+
children: [
|
|
5810
|
+
/* @__PURE__ */ jsx34(
|
|
5811
|
+
"span",
|
|
5812
|
+
{
|
|
5813
|
+
"aria-hidden": "true",
|
|
5814
|
+
"data-slot": "reasoning-vital-marker",
|
|
5815
|
+
className: cn(
|
|
5816
|
+
"my-5 ml-0 mr-5 w-1 rounded-r-full",
|
|
5817
|
+
clinicalToneMarkerClassName[tone]
|
|
5818
|
+
)
|
|
5819
|
+
}
|
|
5820
|
+
),
|
|
5821
|
+
/* @__PURE__ */ jsxs17("div", { className: "min-w-0 py-5", children: [
|
|
5822
|
+
hasRenderableNode(label) ? /* @__PURE__ */ jsx34(
|
|
5823
|
+
ReasoningEditableText,
|
|
5824
|
+
{
|
|
5825
|
+
as: "p",
|
|
5826
|
+
ariaLabel: `Edit ${getTargetLabel(item) ?? "vital"} label`,
|
|
5827
|
+
className: "text-[color:var(--sofya-neutral-900)]",
|
|
5828
|
+
editable,
|
|
5829
|
+
size: "title-sm",
|
|
5830
|
+
weight: 500,
|
|
5831
|
+
value: label,
|
|
5832
|
+
onCommit: (nextValue) => {
|
|
5833
|
+
onItemEdit?.({
|
|
5834
|
+
field: "label",
|
|
5835
|
+
item,
|
|
5836
|
+
value: nextValue,
|
|
5837
|
+
widgetId
|
|
5838
|
+
});
|
|
5839
|
+
}
|
|
5840
|
+
}
|
|
5841
|
+
) : null,
|
|
5842
|
+
hasRenderableNode(item.referenceRange) ? /* @__PURE__ */ jsx34(
|
|
5843
|
+
ReasoningEditableText,
|
|
5844
|
+
{
|
|
5845
|
+
as: "p",
|
|
5846
|
+
ariaLabel: `Edit ${getTargetLabel(item) ?? "vital"} reference range`,
|
|
5847
|
+
className: "mt-1 text-[color:var(--sofya-text-subtle)]",
|
|
5848
|
+
editable,
|
|
5849
|
+
size: "body-sm",
|
|
5850
|
+
value: item.referenceRange,
|
|
5851
|
+
onCommit: (nextValue) => {
|
|
5852
|
+
onItemEdit?.({
|
|
5853
|
+
field: "referenceRange",
|
|
5854
|
+
item,
|
|
5855
|
+
value: nextValue,
|
|
5856
|
+
widgetId
|
|
5857
|
+
});
|
|
5858
|
+
}
|
|
5859
|
+
}
|
|
5860
|
+
) : null,
|
|
5861
|
+
hasRenderableNode(item.evidence) ? /* @__PURE__ */ jsx34(
|
|
5862
|
+
ReasoningEditableText,
|
|
5863
|
+
{
|
|
5864
|
+
as: "p",
|
|
5865
|
+
ariaLabel: `Edit ${getTargetLabel(item) ?? "vital"} evidence`,
|
|
5866
|
+
className: "mt-1 text-[color:var(--sofya-text-subtle)]",
|
|
5867
|
+
editable,
|
|
5868
|
+
multiline: true,
|
|
5869
|
+
size: "body-sm",
|
|
5870
|
+
value: item.evidence,
|
|
5871
|
+
onCommit: (nextValue) => {
|
|
5872
|
+
onItemEdit?.({
|
|
5873
|
+
field: "evidence",
|
|
5874
|
+
item,
|
|
5875
|
+
value: nextValue,
|
|
5876
|
+
widgetId
|
|
5877
|
+
});
|
|
5878
|
+
}
|
|
5879
|
+
}
|
|
5880
|
+
) : null,
|
|
5881
|
+
hasRenderableNode(item.observedAt) ? /* @__PURE__ */ jsx34(
|
|
5882
|
+
ReasoningEditableText,
|
|
5883
|
+
{
|
|
5884
|
+
as: "p",
|
|
5885
|
+
ariaLabel: `Edit ${getTargetLabel(item) ?? "vital"} observed time`,
|
|
5886
|
+
className: "mt-1 text-[color:var(--sofya-text-subtle)]",
|
|
5887
|
+
editable,
|
|
5888
|
+
size: "body-sm",
|
|
5889
|
+
value: item.observedAt,
|
|
5890
|
+
onCommit: (nextValue) => {
|
|
5891
|
+
onItemEdit?.({
|
|
5892
|
+
field: "observedAt",
|
|
5893
|
+
item,
|
|
5894
|
+
value: nextValue,
|
|
5895
|
+
widgetId
|
|
5896
|
+
});
|
|
5897
|
+
}
|
|
5898
|
+
}
|
|
5899
|
+
) : null
|
|
5900
|
+
] }),
|
|
5901
|
+
/* @__PURE__ */ jsxs17(
|
|
5902
|
+
"div",
|
|
5903
|
+
{
|
|
5904
|
+
className: cn(
|
|
5905
|
+
"min-w-[7.5rem] py-4 pr-6 text-right",
|
|
5906
|
+
hasActions && "pr-24"
|
|
5907
|
+
),
|
|
5908
|
+
children: [
|
|
5909
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex min-w-0 items-baseline justify-end gap-1", children: [
|
|
5910
|
+
/* @__PURE__ */ jsx34(
|
|
5911
|
+
"span",
|
|
5912
|
+
{
|
|
5913
|
+
className: cn("min-w-0", clinicalToneValueClassName[tone]),
|
|
5914
|
+
children: /* @__PURE__ */ jsx34(
|
|
5915
|
+
ReasoningEditableText,
|
|
5916
|
+
{
|
|
5917
|
+
ariaLabel: `Edit ${getTargetLabel(item) ?? "vital"} value`,
|
|
5918
|
+
className: "block text-inherit",
|
|
5919
|
+
editable,
|
|
5920
|
+
size: "title-md",
|
|
5921
|
+
value,
|
|
5922
|
+
weight: 600,
|
|
5923
|
+
onCommit: (nextValue) => {
|
|
5924
|
+
onItemEdit?.({
|
|
5925
|
+
field: hasValue ? "value" : "label",
|
|
5926
|
+
item,
|
|
5927
|
+
value: nextValue,
|
|
5928
|
+
widgetId
|
|
5929
|
+
});
|
|
5930
|
+
}
|
|
5931
|
+
}
|
|
5932
|
+
)
|
|
5933
|
+
}
|
|
5934
|
+
),
|
|
5935
|
+
hasRenderableNode(unit) && hasValue ? /* @__PURE__ */ jsx34(
|
|
5936
|
+
ReasoningEditableText,
|
|
5937
|
+
{
|
|
5938
|
+
ariaLabel: `Edit ${getTargetLabel(item) ?? "vital"} unit`,
|
|
5939
|
+
className: "text-[color:var(--sofya-text-subtle)]",
|
|
5940
|
+
editable,
|
|
5941
|
+
size: "body-sm",
|
|
5942
|
+
value: unit,
|
|
5943
|
+
onCommit: (nextValue) => {
|
|
5944
|
+
onItemEdit?.({
|
|
5945
|
+
field: "unit",
|
|
5946
|
+
item,
|
|
5947
|
+
value: nextValue,
|
|
5948
|
+
widgetId
|
|
5949
|
+
});
|
|
5950
|
+
}
|
|
5951
|
+
}
|
|
5952
|
+
) : null
|
|
5953
|
+
] }),
|
|
5954
|
+
hasRenderableNode(item.status) ? /* @__PURE__ */ jsx34(
|
|
5955
|
+
ReasoningEditableText,
|
|
5956
|
+
{
|
|
5957
|
+
as: "p",
|
|
5958
|
+
ariaLabel: `Edit ${getTargetLabel(item) ?? "vital"} status`,
|
|
5959
|
+
className: cn(
|
|
5960
|
+
"mt-1 text-right",
|
|
5961
|
+
clinicalToneStatusClassName[tone]
|
|
5962
|
+
),
|
|
5963
|
+
editable,
|
|
5964
|
+
size: "label-md",
|
|
5965
|
+
value: item.status,
|
|
5966
|
+
weight: 600,
|
|
5967
|
+
onCommit: (nextValue) => {
|
|
5968
|
+
onItemEdit?.({
|
|
5969
|
+
field: "status",
|
|
5970
|
+
item,
|
|
5971
|
+
value: nextValue,
|
|
5972
|
+
widgetId
|
|
5973
|
+
});
|
|
5974
|
+
}
|
|
5975
|
+
}
|
|
5976
|
+
) : null
|
|
5977
|
+
]
|
|
5978
|
+
}
|
|
5979
|
+
),
|
|
5980
|
+
/* @__PURE__ */ jsx34(
|
|
5981
|
+
ReasoningWidgetActions,
|
|
5982
|
+
{
|
|
5983
|
+
actions: itemActions,
|
|
5984
|
+
className: "absolute right-2 top-1/2 -translate-y-1/2",
|
|
5985
|
+
onAction,
|
|
5986
|
+
reveal: "item-hover",
|
|
5987
|
+
target: item,
|
|
5988
|
+
widgetId
|
|
5989
|
+
}
|
|
5990
|
+
)
|
|
5991
|
+
]
|
|
5992
|
+
},
|
|
5993
|
+
item.id ?? `reasoning-vital-${index}`
|
|
5994
|
+
);
|
|
5995
|
+
})
|
|
5996
|
+
}
|
|
5997
|
+
)
|
|
5998
|
+
}
|
|
5999
|
+
);
|
|
6000
|
+
});
|
|
6001
|
+
var ReasoningLabsWidget = React32.forwardRef(function ReasoningLabsWidget2({
|
|
6002
|
+
actions = [],
|
|
6003
|
+
columnLabels,
|
|
6004
|
+
editable = false,
|
|
6005
|
+
emptyLabel = "No labs extracted.",
|
|
6006
|
+
frame = "bordered",
|
|
6007
|
+
icon = "flask",
|
|
6008
|
+
items,
|
|
6009
|
+
onAction,
|
|
6010
|
+
onItemEdit,
|
|
6011
|
+
title = "Labs",
|
|
6012
|
+
widgetId,
|
|
6013
|
+
...props
|
|
6014
|
+
}, ref) {
|
|
6015
|
+
const itemActions = actions.filter(isItemAction);
|
|
6016
|
+
const labColumns = [
|
|
6017
|
+
{
|
|
6018
|
+
key: "test",
|
|
6019
|
+
label: columnLabels?.test ?? "Test",
|
|
6020
|
+
width: "260px"
|
|
6021
|
+
},
|
|
6022
|
+
{
|
|
6023
|
+
key: "result",
|
|
6024
|
+
label: columnLabels?.result ?? "Result",
|
|
6025
|
+
width: "150px"
|
|
6026
|
+
},
|
|
6027
|
+
{
|
|
6028
|
+
key: "reference",
|
|
6029
|
+
label: columnLabels?.reference ?? "Reference",
|
|
6030
|
+
width: "150px"
|
|
6031
|
+
},
|
|
6032
|
+
{
|
|
6033
|
+
key: "flag",
|
|
6034
|
+
label: columnLabels?.flag ?? "Flag",
|
|
6035
|
+
width: "160px"
|
|
6036
|
+
}
|
|
6037
|
+
];
|
|
6038
|
+
return /* @__PURE__ */ jsx34(
|
|
6039
|
+
ReasoningWidget,
|
|
6040
|
+
{
|
|
6041
|
+
ref,
|
|
6042
|
+
actions,
|
|
6043
|
+
empty: items.length === 0,
|
|
6044
|
+
emptyLabel,
|
|
6045
|
+
icon,
|
|
6046
|
+
onAction,
|
|
6047
|
+
title,
|
|
6048
|
+
widgetId,
|
|
6049
|
+
...props,
|
|
6050
|
+
children: /* @__PURE__ */ jsx34(
|
|
6051
|
+
"div",
|
|
6052
|
+
{
|
|
6053
|
+
"data-slot": "reasoning-labs-table",
|
|
6054
|
+
"data-frame": frame,
|
|
6055
|
+
className: clinicalLabsFrameClassName[frame],
|
|
6056
|
+
children: /* @__PURE__ */ jsxs17("table", { className: "w-auto min-w-[720px] border-collapse table-fixed", children: [
|
|
6057
|
+
/* @__PURE__ */ jsx34("thead", { children: /* @__PURE__ */ jsxs17("tr", { className: clinicalDataHeaderClassName[frame], children: [
|
|
6058
|
+
/* @__PURE__ */ jsx34("th", { className: "w-7 px-4 py-3", scope: "col", children: /* @__PURE__ */ jsx34("span", { className: "sr-only", children: columnLabels?.tone ?? "Tone" }) }),
|
|
6059
|
+
labColumns.map((column) => /* @__PURE__ */ jsx34(
|
|
6060
|
+
"th",
|
|
6061
|
+
{
|
|
6062
|
+
className: "px-4 py-3 text-left align-middle text-[color:var(--sofya-text-subtle)]",
|
|
6063
|
+
scope: "col",
|
|
6064
|
+
style: { width: column.width },
|
|
6065
|
+
children: renderTextContent(column.label, {
|
|
6066
|
+
as: "span",
|
|
6067
|
+
className: "block truncate text-inherit",
|
|
6068
|
+
size: "clinical-section-title"
|
|
6069
|
+
})
|
|
6070
|
+
},
|
|
6071
|
+
column.key
|
|
6072
|
+
))
|
|
6073
|
+
] }) }),
|
|
6074
|
+
/* @__PURE__ */ jsx34("tbody", { children: items.map((item, index) => {
|
|
6075
|
+
const tone = item.tone ?? "muted";
|
|
6076
|
+
const unit = item.unit ?? (typeof item.metadata?.unit === "string" ? item.metadata.unit : void 0);
|
|
6077
|
+
const interpretation = item.interpretation ?? item.status;
|
|
6078
|
+
return /* @__PURE__ */ jsxs17(
|
|
6079
|
+
"tr",
|
|
6080
|
+
{
|
|
6081
|
+
"data-slot": "reasoning-lab",
|
|
6082
|
+
"data-tone": tone,
|
|
6083
|
+
className: cn(
|
|
6084
|
+
"group/item border-t border-[color:var(--sofya-neutral-600)] transition-colors duration-sofya ease-sofya first:border-t-0 hover:bg-[color:var(--sofya-surface-hover)] focus-within:bg-[color:var(--sofya-surface-hover)]",
|
|
6085
|
+
clinicalToneSurfaceClassName[tone]
|
|
6086
|
+
),
|
|
6087
|
+
children: [
|
|
6088
|
+
/* @__PURE__ */ jsx34("td", { className: "px-0 py-4 align-top", children: /* @__PURE__ */ jsx34(
|
|
6089
|
+
"span",
|
|
6090
|
+
{
|
|
6091
|
+
"aria-hidden": "true",
|
|
6092
|
+
"data-slot": "reasoning-lab-marker",
|
|
6093
|
+
className: cn(
|
|
6094
|
+
"mt-1 block h-12 w-1 rounded-r-full",
|
|
6095
|
+
clinicalToneMarkerClassName[tone]
|
|
6096
|
+
)
|
|
6097
|
+
}
|
|
6098
|
+
) }),
|
|
6099
|
+
/* @__PURE__ */ jsxs17("td", { className: "min-w-0 px-4 py-4 align-top text-[color:var(--sofya-neutral-900)]", children: [
|
|
6100
|
+
/* @__PURE__ */ jsx34(
|
|
6101
|
+
ReasoningEditableText,
|
|
6102
|
+
{
|
|
6103
|
+
ariaLabel: `Edit ${getTargetLabel(item) ?? "lab"} label`,
|
|
6104
|
+
className: "block text-inherit",
|
|
6105
|
+
editable,
|
|
6106
|
+
size: "title-sm",
|
|
6107
|
+
value: item.label,
|
|
6108
|
+
weight: 500,
|
|
6109
|
+
onCommit: (nextValue) => {
|
|
6110
|
+
onItemEdit?.({
|
|
6111
|
+
field: "label",
|
|
6112
|
+
item,
|
|
6113
|
+
value: nextValue,
|
|
6114
|
+
widgetId
|
|
6115
|
+
});
|
|
6116
|
+
}
|
|
6117
|
+
}
|
|
6118
|
+
),
|
|
6119
|
+
hasRenderableNode(item.evidence) ? /* @__PURE__ */ jsx34(
|
|
6120
|
+
ReasoningEditableText,
|
|
6121
|
+
{
|
|
6122
|
+
as: "p",
|
|
6123
|
+
ariaLabel: `Edit ${getTargetLabel(item) ?? "lab"} evidence`,
|
|
6124
|
+
className: "mt-1 text-[color:var(--sofya-text-subtle)]",
|
|
6125
|
+
editable,
|
|
6126
|
+
multiline: true,
|
|
6127
|
+
size: "body-sm",
|
|
6128
|
+
value: item.evidence,
|
|
6129
|
+
onCommit: (nextValue) => {
|
|
6130
|
+
onItemEdit?.({
|
|
6131
|
+
field: "evidence",
|
|
6132
|
+
item,
|
|
6133
|
+
value: nextValue,
|
|
6134
|
+
widgetId
|
|
6135
|
+
});
|
|
6136
|
+
}
|
|
6137
|
+
}
|
|
6138
|
+
) : null
|
|
6139
|
+
] }),
|
|
6140
|
+
/* @__PURE__ */ jsx34("td", { className: "min-w-0 px-4 py-4 align-top", children: /* @__PURE__ */ jsxs17("div", { className: "flex min-w-0 flex-col items-start", children: [
|
|
6141
|
+
/* @__PURE__ */ jsx34(
|
|
6142
|
+
"span",
|
|
6143
|
+
{
|
|
6144
|
+
className: cn(
|
|
6145
|
+
"min-w-0",
|
|
6146
|
+
clinicalToneValueClassName[tone]
|
|
6147
|
+
),
|
|
6148
|
+
children: /* @__PURE__ */ jsx34(
|
|
6149
|
+
ReasoningEditableText,
|
|
6150
|
+
{
|
|
6151
|
+
ariaLabel: `Edit ${getTargetLabel(item) ?? "lab"} value`,
|
|
6152
|
+
className: "block text-inherit",
|
|
6153
|
+
editable,
|
|
6154
|
+
size: "title-sm",
|
|
6155
|
+
value: item.value ?? null,
|
|
6156
|
+
weight: 600,
|
|
6157
|
+
onCommit: (nextValue) => {
|
|
6158
|
+
onItemEdit?.({
|
|
6159
|
+
field: "value",
|
|
6160
|
+
item,
|
|
6161
|
+
value: nextValue,
|
|
6162
|
+
widgetId
|
|
6163
|
+
});
|
|
6164
|
+
}
|
|
6165
|
+
}
|
|
6166
|
+
)
|
|
6167
|
+
}
|
|
6168
|
+
),
|
|
6169
|
+
hasRenderableNode(unit) ? /* @__PURE__ */ jsx34(
|
|
6170
|
+
ReasoningEditableText,
|
|
6171
|
+
{
|
|
6172
|
+
ariaLabel: `Edit ${getTargetLabel(item) ?? "lab"} unit`,
|
|
6173
|
+
className: "text-[color:var(--sofya-text-subtle)]",
|
|
6174
|
+
editable,
|
|
6175
|
+
size: "body-sm",
|
|
6176
|
+
value: unit,
|
|
6177
|
+
onCommit: (nextValue) => {
|
|
6178
|
+
onItemEdit?.({
|
|
6179
|
+
field: "unit",
|
|
6180
|
+
item,
|
|
6181
|
+
value: nextValue,
|
|
6182
|
+
widgetId
|
|
6183
|
+
});
|
|
6184
|
+
}
|
|
6185
|
+
}
|
|
6186
|
+
) : null
|
|
6187
|
+
] }) }),
|
|
6188
|
+
/* @__PURE__ */ jsx34("td", { className: "min-w-0 px-4 py-4 align-top text-[color:var(--sofya-text-soft)]", children: hasRenderableNode(item.referenceRange) ? /* @__PURE__ */ jsx34(
|
|
6189
|
+
ReasoningEditableText,
|
|
6190
|
+
{
|
|
6191
|
+
ariaLabel: `Edit ${getTargetLabel(item) ?? "lab"} reference range`,
|
|
6192
|
+
className: "block truncate text-inherit",
|
|
6193
|
+
editable,
|
|
6194
|
+
size: "body-sm",
|
|
6195
|
+
value: item.referenceRange,
|
|
6196
|
+
onCommit: (nextValue) => {
|
|
6197
|
+
onItemEdit?.({
|
|
6198
|
+
field: "referenceRange",
|
|
6199
|
+
item,
|
|
6200
|
+
value: nextValue,
|
|
6201
|
+
widgetId
|
|
6202
|
+
});
|
|
6203
|
+
}
|
|
6204
|
+
}
|
|
6205
|
+
) : null }),
|
|
6206
|
+
/* @__PURE__ */ jsxs17("td", { className: "relative min-w-0 px-4 py-4 align-top", children: [
|
|
6207
|
+
hasRenderableNode(interpretation) ? /* @__PURE__ */ jsx34(
|
|
6208
|
+
ReasoningEditableText,
|
|
6209
|
+
{
|
|
6210
|
+
ariaLabel: `Edit ${getTargetLabel(item) ?? "lab"} interpretation`,
|
|
6211
|
+
className: cn(
|
|
6212
|
+
"inline-flex rounded-full px-3 py-1",
|
|
6213
|
+
clinicalToneBadgeClassName[tone]
|
|
6214
|
+
),
|
|
6215
|
+
editable,
|
|
6216
|
+
multiline: true,
|
|
6217
|
+
size: "label-md",
|
|
6218
|
+
value: interpretation,
|
|
6219
|
+
weight: tone === "muted" ? void 0 : 600,
|
|
6220
|
+
onCommit: (nextValue) => {
|
|
6221
|
+
onItemEdit?.({
|
|
6222
|
+
field: "status",
|
|
6223
|
+
item,
|
|
6224
|
+
value: nextValue,
|
|
6225
|
+
widgetId
|
|
6226
|
+
});
|
|
6227
|
+
}
|
|
6228
|
+
}
|
|
6229
|
+
) : null,
|
|
6230
|
+
/* @__PURE__ */ jsx34(
|
|
6231
|
+
ReasoningWidgetActions,
|
|
6232
|
+
{
|
|
6233
|
+
actions: itemActions,
|
|
6234
|
+
className: "absolute right-2 top-1/2 -translate-y-1/2",
|
|
6235
|
+
onAction,
|
|
6236
|
+
reveal: "item-hover",
|
|
6237
|
+
target: item,
|
|
6238
|
+
widgetId
|
|
6239
|
+
}
|
|
6240
|
+
)
|
|
6241
|
+
] })
|
|
6242
|
+
]
|
|
6243
|
+
},
|
|
6244
|
+
item.id ?? `reasoning-lab-${index}`
|
|
6245
|
+
);
|
|
6246
|
+
}) })
|
|
6247
|
+
] })
|
|
6248
|
+
}
|
|
6249
|
+
)
|
|
6250
|
+
}
|
|
6251
|
+
);
|
|
6252
|
+
});
|
|
6253
|
+
var ReasoningSummaryWidget = React32.forwardRef(function ReasoningSummaryWidget2({
|
|
6254
|
+
actions,
|
|
6255
|
+
clinicalImpression,
|
|
6256
|
+
description,
|
|
6257
|
+
editable = false,
|
|
6258
|
+
findings = [],
|
|
6259
|
+
eyebrow = "Summary",
|
|
6260
|
+
icon = "stethoscope",
|
|
6261
|
+
onAction,
|
|
6262
|
+
onItemEdit,
|
|
6263
|
+
onSummaryEdit,
|
|
6264
|
+
title,
|
|
6265
|
+
widgetId,
|
|
6266
|
+
...props
|
|
6267
|
+
}, ref) {
|
|
6268
|
+
return /* @__PURE__ */ jsxs17(
|
|
6269
|
+
ReasoningWidget,
|
|
6270
|
+
{
|
|
6271
|
+
ref,
|
|
6272
|
+
actions,
|
|
6273
|
+
description,
|
|
6274
|
+
eyebrow,
|
|
6275
|
+
icon,
|
|
6276
|
+
onAction,
|
|
6277
|
+
title,
|
|
6278
|
+
widgetId,
|
|
6279
|
+
...props,
|
|
6280
|
+
children: [
|
|
6281
|
+
hasRenderableNode(clinicalImpression) ? /* @__PURE__ */ jsx34(
|
|
6282
|
+
ReasoningEditableText,
|
|
6283
|
+
{
|
|
6284
|
+
as: "p",
|
|
6285
|
+
ariaLabel: "Edit clinical impression",
|
|
6286
|
+
className: "m-0 text-[color:var(--sofya-neutral-800)]",
|
|
6287
|
+
editable,
|
|
6288
|
+
multiline: true,
|
|
6289
|
+
size: "clinical-body",
|
|
6290
|
+
value: clinicalImpression,
|
|
6291
|
+
onCommit: (value) => {
|
|
6292
|
+
onSummaryEdit?.({
|
|
6293
|
+
field: "clinicalImpression",
|
|
6294
|
+
value,
|
|
6295
|
+
widgetId
|
|
6296
|
+
});
|
|
6297
|
+
}
|
|
6298
|
+
}
|
|
6299
|
+
) : null,
|
|
6300
|
+
findings.length > 0 ? /* @__PURE__ */ jsx34(
|
|
6301
|
+
ReasoningWidgetList,
|
|
6302
|
+
{
|
|
6303
|
+
actions,
|
|
6304
|
+
className: hasRenderableNode(clinicalImpression) ? "mt-3" : void 0,
|
|
6305
|
+
editable,
|
|
6306
|
+
items: findings,
|
|
6307
|
+
onAction,
|
|
6308
|
+
onItemEdit,
|
|
6309
|
+
widgetId
|
|
6310
|
+
}
|
|
6311
|
+
) : null
|
|
6312
|
+
]
|
|
6313
|
+
}
|
|
6314
|
+
);
|
|
6315
|
+
});
|
|
6316
|
+
function ReasoningWidgetRenderer({
|
|
6317
|
+
editable = false,
|
|
6318
|
+
onAction,
|
|
6319
|
+
onCellEdit,
|
|
6320
|
+
onItemEdit,
|
|
6321
|
+
onSummaryEdit,
|
|
6322
|
+
widget,
|
|
6323
|
+
...props
|
|
6324
|
+
}) {
|
|
6325
|
+
const descriptorKind = getDescriptorKind(widget);
|
|
6326
|
+
const description = getDescriptionFromDescriptor(widget);
|
|
6327
|
+
const emptyLabel = getEmptyLabelFromDescriptor(widget);
|
|
6328
|
+
const frame = getFrameFromDescriptor(widget);
|
|
6329
|
+
const items = getItemsFromDescriptor(widget);
|
|
6330
|
+
const actions = widget.actions ?? [];
|
|
6331
|
+
const icon = getIconFromDescriptor(widget);
|
|
6332
|
+
if (descriptorKind.includes("summary") || hasRenderableNode(widget.data?.impression)) {
|
|
6333
|
+
return /* @__PURE__ */ jsx34(
|
|
6334
|
+
ReasoningSummaryWidget,
|
|
6335
|
+
{
|
|
6336
|
+
actions,
|
|
6337
|
+
clinicalImpression: widget.data?.impression,
|
|
6338
|
+
description,
|
|
6339
|
+
editable,
|
|
6340
|
+
findings: items,
|
|
6341
|
+
icon,
|
|
6342
|
+
onAction,
|
|
6343
|
+
onItemEdit,
|
|
6344
|
+
onSummaryEdit,
|
|
6345
|
+
sectionDivider: widget.sectionDivider,
|
|
6346
|
+
title: widget.title,
|
|
6347
|
+
widgetId: widget.id,
|
|
6348
|
+
...props
|
|
6349
|
+
}
|
|
6350
|
+
);
|
|
6351
|
+
}
|
|
6352
|
+
if (descriptorKind.includes("vitals")) {
|
|
6353
|
+
return /* @__PURE__ */ jsx34(
|
|
6354
|
+
ReasoningVitalsWidget,
|
|
6355
|
+
{
|
|
6356
|
+
actions,
|
|
6357
|
+
description,
|
|
6358
|
+
editable,
|
|
6359
|
+
emptyLabel,
|
|
6360
|
+
frame,
|
|
6361
|
+
icon,
|
|
6362
|
+
items,
|
|
6363
|
+
onAction,
|
|
6364
|
+
onItemEdit,
|
|
6365
|
+
sectionDivider: widget.sectionDivider,
|
|
6366
|
+
title: widget.title,
|
|
6367
|
+
widgetId: widget.id,
|
|
6368
|
+
...props
|
|
6369
|
+
}
|
|
6370
|
+
);
|
|
6371
|
+
}
|
|
6372
|
+
if (descriptorKind.includes("lab") && items.length > 0) {
|
|
6373
|
+
return /* @__PURE__ */ jsx34(
|
|
6374
|
+
ReasoningLabsWidget,
|
|
6375
|
+
{
|
|
6376
|
+
actions,
|
|
6377
|
+
columnLabels: widget.data?.labColumnLabels,
|
|
6378
|
+
description,
|
|
6379
|
+
editable,
|
|
6380
|
+
emptyLabel,
|
|
6381
|
+
frame,
|
|
6382
|
+
icon,
|
|
6383
|
+
items,
|
|
6384
|
+
onAction,
|
|
6385
|
+
onItemEdit,
|
|
6386
|
+
sectionDivider: widget.sectionDivider,
|
|
6387
|
+
title: widget.title,
|
|
6388
|
+
widgetId: widget.id,
|
|
6389
|
+
...props
|
|
6390
|
+
}
|
|
6391
|
+
);
|
|
6392
|
+
}
|
|
6393
|
+
if (widget.data?.tableColumns && widget.data.rows) {
|
|
6394
|
+
return /* @__PURE__ */ jsx34(
|
|
6395
|
+
ReasoningWidget,
|
|
6396
|
+
{
|
|
6397
|
+
actions,
|
|
6398
|
+
description,
|
|
6399
|
+
empty: widget.data.rows.length === 0,
|
|
6400
|
+
emptyLabel,
|
|
6401
|
+
icon,
|
|
6402
|
+
onAction,
|
|
6403
|
+
sectionDivider: widget.sectionDivider,
|
|
6404
|
+
title: widget.title,
|
|
6405
|
+
widgetId: widget.id,
|
|
6406
|
+
...props,
|
|
6407
|
+
children: /* @__PURE__ */ jsx34(
|
|
6408
|
+
ReasoningWidgetTable,
|
|
6409
|
+
{
|
|
6410
|
+
actions,
|
|
6411
|
+
columns: widget.data.tableColumns,
|
|
6412
|
+
editable,
|
|
6413
|
+
emptyLabel,
|
|
6414
|
+
onAction,
|
|
6415
|
+
onCellEdit,
|
|
6416
|
+
rows: widget.data.rows,
|
|
6417
|
+
widgetId: widget.id
|
|
6418
|
+
}
|
|
6419
|
+
)
|
|
6420
|
+
}
|
|
6421
|
+
);
|
|
6422
|
+
}
|
|
6423
|
+
return /* @__PURE__ */ jsx34(
|
|
6424
|
+
ReasoningWidget,
|
|
6425
|
+
{
|
|
6426
|
+
actions,
|
|
6427
|
+
description,
|
|
6428
|
+
empty: items.length === 0,
|
|
6429
|
+
emptyLabel,
|
|
6430
|
+
icon,
|
|
6431
|
+
onAction,
|
|
6432
|
+
sectionDivider: widget.sectionDivider,
|
|
6433
|
+
title: widget.title,
|
|
6434
|
+
widgetId: widget.id,
|
|
6435
|
+
...props,
|
|
6436
|
+
children: /* @__PURE__ */ jsx34(
|
|
6437
|
+
ReasoningWidgetList,
|
|
6438
|
+
{
|
|
6439
|
+
actions,
|
|
6440
|
+
editable,
|
|
6441
|
+
emptyLabel,
|
|
6442
|
+
items,
|
|
6443
|
+
onAction,
|
|
6444
|
+
onItemEdit,
|
|
6445
|
+
widgetId: widget.id
|
|
6446
|
+
}
|
|
6447
|
+
)
|
|
6448
|
+
}
|
|
6449
|
+
);
|
|
6450
|
+
}
|
|
6451
|
+
ReasoningWidgetActionButton.displayName = "ReasoningWidgetActionButton";
|
|
6452
|
+
ReasoningWidgetActions.displayName = "ReasoningWidgetActions";
|
|
6453
|
+
ReasoningWidget.displayName = "ReasoningWidget";
|
|
6454
|
+
ReasoningWidgetList.displayName = "ReasoningWidgetList";
|
|
6455
|
+
ReasoningWidgetTable.displayName = "ReasoningWidgetTable";
|
|
6456
|
+
ReasoningVitalsWidget.displayName = "ReasoningVitalsWidget";
|
|
6457
|
+
ReasoningLabsWidget.displayName = "ReasoningLabsWidget";
|
|
6458
|
+
ReasoningSummaryWidget.displayName = "ReasoningSummaryWidget";
|
|
6459
|
+
|
|
6460
|
+
// src/components/right-rail-action.tsx
|
|
6461
|
+
import * as React33 from "react";
|
|
6462
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
6463
|
+
var RightRailAction = React33.forwardRef(
|
|
6464
|
+
({ active = false, className, icon, ...props }, ref) => /* @__PURE__ */ jsx35(
|
|
6465
|
+
IconButton,
|
|
6466
|
+
{
|
|
6467
|
+
ref,
|
|
6468
|
+
icon,
|
|
6469
|
+
variant: "ghost",
|
|
6470
|
+
selected: active,
|
|
6471
|
+
"data-slot": "right-rail-action",
|
|
6472
|
+
className: cn(
|
|
6473
|
+
"size-[var(--sofya-icon-button-size-md)] rounded-[var(--sofya-radius-md)] shadow-none",
|
|
6474
|
+
className
|
|
6475
|
+
),
|
|
6476
|
+
...props
|
|
6477
|
+
}
|
|
6478
|
+
)
|
|
6479
|
+
);
|
|
6480
|
+
RightRailAction.displayName = "RightRailAction";
|
|
6481
|
+
|
|
6482
|
+
// src/components/scroll-area.tsx
|
|
6483
|
+
import * as React34 from "react";
|
|
6484
|
+
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
6485
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
6486
|
+
var scrollAreaOrientationOptions = ["horizontal", "vertical"];
|
|
6487
|
+
var ScrollArea = React34.forwardRef(function ScrollArea2({ className, ...props }, ref) {
|
|
6488
|
+
return /* @__PURE__ */ jsx36(
|
|
6489
|
+
ScrollAreaPrimitive.Root,
|
|
6490
|
+
{
|
|
6491
|
+
ref,
|
|
6492
|
+
"data-slot": "scroll-area",
|
|
6493
|
+
className: cn("relative overflow-hidden", className),
|
|
6494
|
+
...props
|
|
6495
|
+
}
|
|
6496
|
+
);
|
|
6497
|
+
});
|
|
6498
|
+
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
6499
|
+
var ScrollAreaViewport = React34.forwardRef(function ScrollAreaViewport2({ className, ...props }, ref) {
|
|
6500
|
+
return /* @__PURE__ */ jsx36(
|
|
6501
|
+
ScrollAreaPrimitive.Viewport,
|
|
6502
|
+
{
|
|
6503
|
+
ref,
|
|
6504
|
+
"data-slot": "scroll-area-viewport",
|
|
6505
|
+
className: cn(
|
|
6506
|
+
"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--sofya-focus-ring-soft)] focus-visible:ring-offset-0",
|
|
6507
|
+
className
|
|
6508
|
+
),
|
|
6509
|
+
...props
|
|
6510
|
+
}
|
|
6511
|
+
);
|
|
6512
|
+
});
|
|
6513
|
+
ScrollAreaViewport.displayName = ScrollAreaPrimitive.Viewport.displayName;
|
|
6514
|
+
var ScrollAreaScrollbar = React34.forwardRef(function ScrollAreaScrollbar2({ className, orientation = "vertical", thumbClassName, ...props }, ref) {
|
|
6515
|
+
return /* @__PURE__ */ jsx36(
|
|
6516
|
+
ScrollAreaPrimitive.Scrollbar,
|
|
6517
|
+
{
|
|
6518
|
+
ref,
|
|
6519
|
+
"data-slot": "scroll-area-scrollbar",
|
|
6520
|
+
orientation,
|
|
6521
|
+
className: cn(
|
|
6522
|
+
"flex touch-none select-none p-0 transition-colors duration-sofya ease-sofya data-[orientation=horizontal]:h-2.5 data-[orientation=horizontal]:flex-col data-[orientation=horizontal]:border-t data-[orientation=horizontal]:border-t-transparent data-[orientation=vertical]:h-full data-[orientation=vertical]:w-2.5 data-[orientation=vertical]:border-l data-[orientation=vertical]:border-l-transparent",
|
|
6523
|
+
className
|
|
6524
|
+
),
|
|
6525
|
+
...props,
|
|
6526
|
+
children: /* @__PURE__ */ jsx36(
|
|
6527
|
+
ScrollAreaPrimitive.Thumb,
|
|
6528
|
+
{
|
|
6529
|
+
"data-slot": "scroll-area-thumb",
|
|
6530
|
+
className: cn(
|
|
6531
|
+
"relative flex-1 rounded-full bg-[color:var(--sofya-border-strong)]",
|
|
6532
|
+
thumbClassName
|
|
6533
|
+
)
|
|
6534
|
+
}
|
|
6535
|
+
)
|
|
6536
|
+
}
|
|
6537
|
+
);
|
|
6538
|
+
});
|
|
6539
|
+
ScrollAreaScrollbar.displayName = ScrollAreaPrimitive.Scrollbar.displayName;
|
|
6540
|
+
var ScrollAreaCorner = React34.forwardRef(function ScrollAreaCorner2({ className, ...props }, ref) {
|
|
6541
|
+
return /* @__PURE__ */ jsx36(
|
|
6542
|
+
ScrollAreaPrimitive.Corner,
|
|
6543
|
+
{
|
|
6544
|
+
ref,
|
|
6545
|
+
"data-slot": "scroll-area-corner",
|
|
6546
|
+
className: cn("bg-transparent", className),
|
|
6547
|
+
...props
|
|
6548
|
+
}
|
|
6549
|
+
);
|
|
6550
|
+
});
|
|
6551
|
+
ScrollAreaCorner.displayName = ScrollAreaPrimitive.Corner.displayName;
|
|
6552
|
+
|
|
6553
|
+
// src/components/select.tsx
|
|
6554
|
+
import * as React35 from "react";
|
|
6555
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
6556
|
+
|
|
6557
|
+
// src/lib/form-control-classes.ts
|
|
6558
|
+
var formControlBaseClasses = "flex w-full items-center justify-between gap-4 rounded-[10px] border border-[color:var(--sofya-border-strong)] bg-card px-4 text-left [font-family:var(--sofya-text-body-font-family)] text-[length:var(--sofya-text-body-font-size)] [font-weight:var(--sofya-text-body-font-weight)] leading-[var(--sofya-text-body-line-height)] tracking-[var(--sofya-text-body-letter-spacing)] text-[color:var(--sofya-text-default)] shadow-none transition-[border-color,box-shadow,background-color,color] duration-sofya ease-sofya hover:border-[color:var(--sofya-border-hover)] focus:outline-none focus:ring-2 focus:ring-[color:var(--sofya-focus-ring-soft)] focus:ring-offset-0 active:border-transparent active:ring-2 active:ring-[color:var(--sofya-focus-ring-soft)] disabled:cursor-not-allowed disabled:bg-muted disabled:opacity-50 aria-invalid:border-destructive aria-invalid:focus:ring-destructive/20 data-[placeholder]:text-[color:var(--sofya-text-placeholder)]";
|
|
6559
|
+
|
|
6560
|
+
// src/components/select.tsx
|
|
6561
|
+
import { jsx as jsx37, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
6562
|
+
var selectSizeOptions = ["default", "sm"];
|
|
6563
|
+
var Select = SelectPrimitive.Root;
|
|
6564
|
+
var SelectGroup = SelectPrimitive.Group;
|
|
6565
|
+
var SelectValue = React35.forwardRef(function SelectValue2({ className, ...props }, ref) {
|
|
6566
|
+
return /* @__PURE__ */ jsx37(
|
|
6567
|
+
Text,
|
|
6568
|
+
{
|
|
6569
|
+
ref,
|
|
6570
|
+
as: "span",
|
|
6571
|
+
"data-slot": "select-value",
|
|
6572
|
+
className: cn("block truncate text-inherit", className),
|
|
6573
|
+
size: "tiny",
|
|
6574
|
+
style: inheritedTypographyStyle,
|
|
6575
|
+
children: /* @__PURE__ */ jsx37(SelectPrimitive.Value, { className: "block truncate", ...props })
|
|
6576
|
+
}
|
|
6577
|
+
);
|
|
6578
|
+
});
|
|
6579
|
+
SelectValue.displayName = SelectPrimitive.Value.displayName;
|
|
6580
|
+
var SelectTrigger = React35.forwardRef(function SelectTrigger2({ className, children, size = "default", ...props }, ref) {
|
|
6581
|
+
return /* @__PURE__ */ jsxs18(
|
|
6582
|
+
SelectPrimitive.Trigger,
|
|
6583
|
+
{
|
|
6584
|
+
ref,
|
|
6585
|
+
"data-slot": "select-trigger",
|
|
6586
|
+
"data-size": size,
|
|
6587
|
+
className: cn(
|
|
6588
|
+
formControlBaseClasses,
|
|
6589
|
+
"data-[size=default]:h-10 data-[size=default]:py-2 data-[size=sm]:h-9 data-[size=sm]:px-2 data-[size=sm]:text-[14px] data-[size=sm]:leading-5 [&>span]:line-clamp-1 [&>span]:flex-1",
|
|
6590
|
+
className
|
|
6591
|
+
),
|
|
6592
|
+
...props,
|
|
6593
|
+
children: [
|
|
6594
|
+
children,
|
|
6595
|
+
/* @__PURE__ */ jsx37(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx37(
|
|
6596
|
+
Icon,
|
|
6597
|
+
{
|
|
6598
|
+
name: "caret-down",
|
|
6599
|
+
size: size === "sm" ? 12 : 14,
|
|
6600
|
+
className: "shrink-0 text-[color:var(--sofya-text-subtle)]"
|
|
6601
|
+
}
|
|
5117
6602
|
) })
|
|
5118
6603
|
]
|
|
5119
6604
|
}
|
|
5120
6605
|
);
|
|
5121
6606
|
});
|
|
5122
6607
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
5123
|
-
var SelectScrollUpButton =
|
|
5124
|
-
return /* @__PURE__ */
|
|
6608
|
+
var SelectScrollUpButton = React35.forwardRef(function SelectScrollUpButton2({ className, ...props }, ref) {
|
|
6609
|
+
return /* @__PURE__ */ jsx37(
|
|
5125
6610
|
SelectPrimitive.ScrollUpButton,
|
|
5126
6611
|
{
|
|
5127
6612
|
ref,
|
|
@@ -5131,13 +6616,13 @@ var SelectScrollUpButton = React34.forwardRef(function SelectScrollUpButton2({ c
|
|
|
5131
6616
|
className
|
|
5132
6617
|
),
|
|
5133
6618
|
...props,
|
|
5134
|
-
children: /* @__PURE__ */
|
|
6619
|
+
children: /* @__PURE__ */ jsx37(Icon, { name: "caret-up", size: 12 })
|
|
5135
6620
|
}
|
|
5136
6621
|
);
|
|
5137
6622
|
});
|
|
5138
6623
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
5139
|
-
var SelectScrollDownButton =
|
|
5140
|
-
return /* @__PURE__ */
|
|
6624
|
+
var SelectScrollDownButton = React35.forwardRef(function SelectScrollDownButton2({ className, ...props }, ref) {
|
|
6625
|
+
return /* @__PURE__ */ jsx37(
|
|
5141
6626
|
SelectPrimitive.ScrollDownButton,
|
|
5142
6627
|
{
|
|
5143
6628
|
ref,
|
|
@@ -5147,13 +6632,13 @@ var SelectScrollDownButton = React34.forwardRef(function SelectScrollDownButton2
|
|
|
5147
6632
|
className
|
|
5148
6633
|
),
|
|
5149
6634
|
...props,
|
|
5150
|
-
children: /* @__PURE__ */
|
|
6635
|
+
children: /* @__PURE__ */ jsx37(Icon, { name: "caret-down", size: 12 })
|
|
5151
6636
|
}
|
|
5152
6637
|
);
|
|
5153
6638
|
});
|
|
5154
6639
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
5155
|
-
var SelectContent =
|
|
5156
|
-
return /* @__PURE__ */
|
|
6640
|
+
var SelectContent = React35.forwardRef(function SelectContent2({ className, children, position = "popper", ...props }, ref) {
|
|
6641
|
+
return /* @__PURE__ */ jsx37(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs18(
|
|
5157
6642
|
SelectPrimitive.Content,
|
|
5158
6643
|
{
|
|
5159
6644
|
ref,
|
|
@@ -5166,8 +6651,8 @@ var SelectContent = React34.forwardRef(function SelectContent2({ className, chil
|
|
|
5166
6651
|
),
|
|
5167
6652
|
...props,
|
|
5168
6653
|
children: [
|
|
5169
|
-
/* @__PURE__ */
|
|
5170
|
-
/* @__PURE__ */
|
|
6654
|
+
/* @__PURE__ */ jsx37(SelectScrollUpButton, {}),
|
|
6655
|
+
/* @__PURE__ */ jsx37(
|
|
5171
6656
|
SelectPrimitive.Viewport,
|
|
5172
6657
|
{
|
|
5173
6658
|
"data-slot": "select-viewport",
|
|
@@ -5175,14 +6660,14 @@ var SelectContent = React34.forwardRef(function SelectContent2({ className, chil
|
|
|
5175
6660
|
children
|
|
5176
6661
|
}
|
|
5177
6662
|
),
|
|
5178
|
-
/* @__PURE__ */
|
|
6663
|
+
/* @__PURE__ */ jsx37(SelectScrollDownButton, {})
|
|
5179
6664
|
]
|
|
5180
6665
|
}
|
|
5181
6666
|
) });
|
|
5182
6667
|
});
|
|
5183
6668
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
5184
|
-
var SelectLabel =
|
|
5185
|
-
return /* @__PURE__ */
|
|
6669
|
+
var SelectLabel = React35.forwardRef(function SelectLabel2({ className, ...props }, ref) {
|
|
6670
|
+
return /* @__PURE__ */ jsx37(
|
|
5186
6671
|
SelectPrimitive.Label,
|
|
5187
6672
|
{
|
|
5188
6673
|
ref,
|
|
@@ -5204,8 +6689,8 @@ var SelectLabel = React34.forwardRef(function SelectLabel2({ className, ...props
|
|
|
5204
6689
|
);
|
|
5205
6690
|
});
|
|
5206
6691
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
5207
|
-
var SelectItem =
|
|
5208
|
-
return /* @__PURE__ */
|
|
6692
|
+
var SelectItem = React35.forwardRef(function SelectItem2({ className, children, ...props }, ref) {
|
|
6693
|
+
return /* @__PURE__ */ jsxs18(
|
|
5209
6694
|
SelectPrimitive.Item,
|
|
5210
6695
|
{
|
|
5211
6696
|
ref,
|
|
@@ -5216,20 +6701,20 @@ var SelectItem = React34.forwardRef(function SelectItem2({ className, children,
|
|
|
5216
6701
|
),
|
|
5217
6702
|
...props,
|
|
5218
6703
|
children: [
|
|
5219
|
-
/* @__PURE__ */
|
|
6704
|
+
/* @__PURE__ */ jsx37(SelectPrimitive.ItemText, { className: "truncate", children: renderTextContent(children, {
|
|
5220
6705
|
as: "span",
|
|
5221
6706
|
className: "block truncate text-[color:var(--sofya-text-default)]",
|
|
5222
6707
|
size: "tiny",
|
|
5223
6708
|
style: inheritedTypographyStyle
|
|
5224
6709
|
}) }),
|
|
5225
|
-
/* @__PURE__ */
|
|
6710
|
+
/* @__PURE__ */ jsx37(SelectPrimitive.ItemIndicator, { asChild: true, children: /* @__PURE__ */ jsx37("span", { className: "absolute right-4 inline-flex h-4 w-4 items-center justify-center text-primary", children: /* @__PURE__ */ jsx37(Icon, { name: "check", size: 14 }) }) })
|
|
5226
6711
|
]
|
|
5227
6712
|
}
|
|
5228
6713
|
);
|
|
5229
6714
|
});
|
|
5230
6715
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
5231
|
-
var SelectSeparator =
|
|
5232
|
-
return /* @__PURE__ */
|
|
6716
|
+
var SelectSeparator = React35.forwardRef(function SelectSeparator2({ className, ...props }, ref) {
|
|
6717
|
+
return /* @__PURE__ */ jsx37(
|
|
5233
6718
|
SelectPrimitive.Separator,
|
|
5234
6719
|
{
|
|
5235
6720
|
ref,
|
|
@@ -5242,11 +6727,11 @@ var SelectSeparator = React34.forwardRef(function SelectSeparator2({ className,
|
|
|
5242
6727
|
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
5243
6728
|
|
|
5244
6729
|
// src/components/separator.tsx
|
|
5245
|
-
import * as
|
|
6730
|
+
import * as React36 from "react";
|
|
5246
6731
|
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
5247
|
-
import { jsx as
|
|
5248
|
-
var Separator2 =
|
|
5249
|
-
return /* @__PURE__ */
|
|
6732
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
6733
|
+
var Separator2 = React36.forwardRef(function Separator3({ className, decorative = true, orientation = "horizontal", ...props }, ref) {
|
|
6734
|
+
return /* @__PURE__ */ jsx38(
|
|
5250
6735
|
SeparatorPrimitive.Root,
|
|
5251
6736
|
{
|
|
5252
6737
|
ref,
|
|
@@ -5265,13 +6750,93 @@ var Separator2 = React35.forwardRef(function Separator3({ className, decorative
|
|
|
5265
6750
|
Separator2.displayName = SeparatorPrimitive.Root.displayName;
|
|
5266
6751
|
|
|
5267
6752
|
// src/components/sidebar-nav-item.tsx
|
|
5268
|
-
import * as
|
|
5269
|
-
import { jsx as
|
|
5270
|
-
var
|
|
5271
|
-
|
|
6753
|
+
import * as React37 from "react";
|
|
6754
|
+
import { jsx as jsx39, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
6755
|
+
var sidebarNavItemAppearanceClassNames = {
|
|
6756
|
+
settings: "rounded-[var(--sofya-radius-md)] py-[var(--sofya-space-2)] pl-[var(--sofya-space-3)] pr-[var(--sofya-space-3)] text-[color:var(--sofya-text-soft)] hover:bg-[color:var(--sofya-surface-hover)] hover:text-[color:var(--sofya-text-default)] data-[active=true]:bg-[color:var(--sofya-surface-selected)] data-[active=true]:text-[color:var(--sofya-text-default)] data-[active=true]:hover:bg-[color:var(--sofya-surface-selected-strong)] data-[disabled=true]:text-[color:var(--sofya-text-subtle)] data-[disabled=true]:hover:bg-transparent",
|
|
6757
|
+
workspace: "rounded-[var(--sofya-radius-sm)] bg-transparent px-0 py-0 text-[color:var(--sofya-text-subtle)] hover:bg-transparent hover:text-[color:var(--sofya-text-default)] data-[active=true]:bg-transparent data-[active=true]:text-primary data-[active=true]:hover:bg-transparent data-[active=true]:hover:text-primary data-[disabled=true]:text-[color:var(--sofya-text-subtle)] data-[disabled=true]:hover:bg-transparent"
|
|
6758
|
+
};
|
|
6759
|
+
var sidebarNavItemIconClassNames = {
|
|
6760
|
+
settings: "flex h-5 w-5 shrink-0 items-center justify-center [&_svg]:h-[1em] [&_svg]:w-[1em] [&_svg]:shrink-0",
|
|
6761
|
+
workspace: "flex h-[var(--sofya-text-sidebar-title-font-size)] w-[var(--sofya-text-sidebar-title-font-size)] shrink-0 items-center justify-center [&_svg]:h-[1em] [&_svg]:w-[1em] [&_svg]:shrink-0"
|
|
6762
|
+
};
|
|
6763
|
+
var sidebarNavItemTextSize = {
|
|
6764
|
+
settings: "sidebar-title",
|
|
6765
|
+
workspace: "sidebar-title-regular"
|
|
6766
|
+
};
|
|
6767
|
+
var SidebarNav = React37.forwardRef(
|
|
6768
|
+
({ as, className, ...props }, ref) => {
|
|
6769
|
+
const Comp = as ?? "nav";
|
|
6770
|
+
return /* @__PURE__ */ jsx39(
|
|
6771
|
+
Comp,
|
|
6772
|
+
{
|
|
6773
|
+
ref,
|
|
6774
|
+
"data-slot": "sidebar-nav",
|
|
6775
|
+
className: cn("flex w-full min-w-0 flex-col gap-[var(--sofya-rhythm-group)]", className),
|
|
6776
|
+
...props
|
|
6777
|
+
}
|
|
6778
|
+
);
|
|
6779
|
+
}
|
|
6780
|
+
);
|
|
6781
|
+
SidebarNav.displayName = "SidebarNav";
|
|
6782
|
+
var SidebarNavSection = React37.forwardRef(
|
|
6783
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx39(
|
|
6784
|
+
"div",
|
|
6785
|
+
{
|
|
6786
|
+
ref,
|
|
6787
|
+
"data-slot": "sidebar-nav-section",
|
|
6788
|
+
className: cn("flex min-w-0 flex-col gap-[var(--sofya-rhythm-group)]", className),
|
|
6789
|
+
...props
|
|
6790
|
+
}
|
|
6791
|
+
)
|
|
6792
|
+
);
|
|
6793
|
+
SidebarNavSection.displayName = "SidebarNavSection";
|
|
6794
|
+
var SidebarNavSectionLabel = React37.forwardRef(
|
|
6795
|
+
({ as, className, children, ...props }, ref) => {
|
|
6796
|
+
const Comp = as ?? "h5";
|
|
6797
|
+
return /* @__PURE__ */ jsx39(
|
|
6798
|
+
Comp,
|
|
6799
|
+
{
|
|
6800
|
+
ref,
|
|
6801
|
+
"data-slot": "sidebar-nav-section-label",
|
|
6802
|
+
className: cn("m-0 min-w-0 text-muted-foreground uppercase", className),
|
|
6803
|
+
...props,
|
|
6804
|
+
children: renderTextContent(children, {
|
|
6805
|
+
as: "span",
|
|
6806
|
+
className: "block min-w-0 truncate text-inherit",
|
|
6807
|
+
size: "sidebar-title"
|
|
6808
|
+
})
|
|
6809
|
+
}
|
|
6810
|
+
);
|
|
6811
|
+
}
|
|
6812
|
+
);
|
|
6813
|
+
SidebarNavSectionLabel.displayName = "SidebarNavSectionLabel";
|
|
6814
|
+
var SidebarNavSectionItems = React37.forwardRef(
|
|
6815
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx39(
|
|
6816
|
+
"div",
|
|
6817
|
+
{
|
|
6818
|
+
ref,
|
|
6819
|
+
"data-slot": "sidebar-nav-section-items",
|
|
6820
|
+
className: cn("flex min-w-0 flex-col gap-[var(--sofya-gap-comfortable)]", className),
|
|
6821
|
+
...props
|
|
6822
|
+
}
|
|
6823
|
+
)
|
|
6824
|
+
);
|
|
6825
|
+
SidebarNavSectionItems.displayName = "SidebarNavSectionItems";
|
|
6826
|
+
var SidebarNavItem = React37.forwardRef(
|
|
6827
|
+
function SidebarNavItem2({
|
|
6828
|
+
as,
|
|
6829
|
+
active = false,
|
|
6830
|
+
appearance = "settings",
|
|
6831
|
+
disabled = false,
|
|
6832
|
+
icon,
|
|
6833
|
+
className,
|
|
6834
|
+
children,
|
|
6835
|
+
...props
|
|
6836
|
+
}, ref) {
|
|
5272
6837
|
const Comp = as ?? (props.href ? "a" : "button");
|
|
5273
6838
|
const isNativeButton = Comp === "button";
|
|
5274
|
-
return /* @__PURE__ */
|
|
6839
|
+
return /* @__PURE__ */ jsxs19(
|
|
5275
6840
|
Comp,
|
|
5276
6841
|
{
|
|
5277
6842
|
ref,
|
|
@@ -5282,19 +6847,17 @@ var SidebarNavItem = React36.forwardRef(
|
|
|
5282
6847
|
"aria-disabled": disabled || void 0,
|
|
5283
6848
|
...isNativeButton ? { type: "button", disabled } : {},
|
|
5284
6849
|
className: cn(
|
|
5285
|
-
"group relative flex w-full items-center gap-[var(--sofya-gap-compact)]
|
|
6850
|
+
"group relative flex w-full items-center gap-[var(--sofya-gap-compact)] text-left no-underline outline-none",
|
|
5286
6851
|
"[font-family:var(--sofya-text-sidebar-title-font-family)] text-[length:var(--sofya-text-sidebar-title-font-size)] [font-weight:var(--sofya-text-sidebar-title-font-weight)] leading-[var(--sofya-text-sidebar-title-line-height)] tracking-[var(--sofya-text-sidebar-title-letter-spacing)]",
|
|
5287
|
-
"
|
|
5288
|
-
"hover:bg-[color:var(--sofya-surface-hover)] hover:text-[color:var(--sofya-text-default)]",
|
|
6852
|
+
"transition-colors duration-sofya ease-sofya",
|
|
5289
6853
|
"focus-visible:ring-2 focus-visible:ring-[color:var(--sofya-focus-ring-soft)] focus-visible:ring-offset-0",
|
|
5290
|
-
"data-[
|
|
5291
|
-
|
|
5292
|
-
"data-[disabled=true]:pointer-events-none data-[disabled=true]:cursor-not-allowed data-[disabled=true]:text-[color:var(--sofya-text-subtle)] data-[disabled=true]:hover:bg-transparent",
|
|
6854
|
+
"data-[disabled=true]:pointer-events-none data-[disabled=true]:cursor-not-allowed",
|
|
6855
|
+
sidebarNavItemAppearanceClassNames[appearance],
|
|
5293
6856
|
className
|
|
5294
6857
|
),
|
|
5295
6858
|
...props,
|
|
5296
6859
|
children: [
|
|
5297
|
-
/* @__PURE__ */
|
|
6860
|
+
appearance === "settings" ? /* @__PURE__ */ jsx39(
|
|
5298
6861
|
"span",
|
|
5299
6862
|
{
|
|
5300
6863
|
"aria-hidden": "true",
|
|
@@ -5304,12 +6867,19 @@ var SidebarNavItem = React36.forwardRef(
|
|
|
5304
6867
|
active ? "opacity-100" : "opacity-0"
|
|
5305
6868
|
)
|
|
5306
6869
|
}
|
|
5307
|
-
),
|
|
5308
|
-
icon ? /* @__PURE__ */
|
|
5309
|
-
|
|
6870
|
+
) : null,
|
|
6871
|
+
icon ? /* @__PURE__ */ jsx39(
|
|
6872
|
+
"span",
|
|
6873
|
+
{
|
|
6874
|
+
"data-slot": "sidebar-nav-item-icon",
|
|
6875
|
+
className: sidebarNavItemIconClassNames[appearance],
|
|
6876
|
+
children: icon
|
|
6877
|
+
}
|
|
6878
|
+
) : null,
|
|
6879
|
+
/* @__PURE__ */ jsx39("span", { className: "min-w-0 flex-1 truncate", children: renderTextContent(children, {
|
|
5310
6880
|
as: "span",
|
|
5311
6881
|
className: "block min-w-0 truncate text-inherit",
|
|
5312
|
-
size:
|
|
6882
|
+
size: sidebarNavItemTextSize[appearance]
|
|
5313
6883
|
}) })
|
|
5314
6884
|
]
|
|
5315
6885
|
}
|
|
@@ -5320,8 +6890,8 @@ SidebarNavItem.displayName = "SidebarNavItem";
|
|
|
5320
6890
|
var SettingsNavItem = SidebarNavItem;
|
|
5321
6891
|
|
|
5322
6892
|
// src/components/slider.tsx
|
|
5323
|
-
import * as
|
|
5324
|
-
import { jsx as
|
|
6893
|
+
import * as React38 from "react";
|
|
6894
|
+
import { jsx as jsx40, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
5325
6895
|
function clampSliderValue(value, min, max) {
|
|
5326
6896
|
if (Number.isNaN(value)) {
|
|
5327
6897
|
return min;
|
|
@@ -5346,7 +6916,7 @@ function resolveSliderMeasurement(value, fallback) {
|
|
|
5346
6916
|
function isTextValue(value) {
|
|
5347
6917
|
return typeof value === "string" || typeof value === "number";
|
|
5348
6918
|
}
|
|
5349
|
-
var Slider =
|
|
6919
|
+
var Slider = React38.forwardRef(function Slider2({
|
|
5350
6920
|
className,
|
|
5351
6921
|
defaultValue,
|
|
5352
6922
|
formatValue,
|
|
@@ -5369,7 +6939,7 @@ var Slider = React37.forwardRef(function Slider2({
|
|
|
5369
6939
|
valueClassName,
|
|
5370
6940
|
...props
|
|
5371
6941
|
}, ref) {
|
|
5372
|
-
const resolvedId =
|
|
6942
|
+
const resolvedId = React38.useId();
|
|
5373
6943
|
const inputId = id ?? resolvedId;
|
|
5374
6944
|
const safeMin = min;
|
|
5375
6945
|
const safeMax = resolveSliderMax(safeMin, max);
|
|
@@ -5378,7 +6948,7 @@ var Slider = React37.forwardRef(function Slider2({
|
|
|
5378
6948
|
onChange: onValueChange,
|
|
5379
6949
|
value
|
|
5380
6950
|
});
|
|
5381
|
-
|
|
6951
|
+
React38.useEffect(() => {
|
|
5382
6952
|
if (value !== void 0) {
|
|
5383
6953
|
return;
|
|
5384
6954
|
}
|
|
@@ -5425,14 +6995,14 @@ var Slider = React37.forwardRef(function Slider2({
|
|
|
5425
6995
|
setControllableValue(nextValue);
|
|
5426
6996
|
onChange?.(event);
|
|
5427
6997
|
};
|
|
5428
|
-
return /* @__PURE__ */
|
|
6998
|
+
return /* @__PURE__ */ jsxs20(
|
|
5429
6999
|
"div",
|
|
5430
7000
|
{
|
|
5431
7001
|
"data-slot": "slider",
|
|
5432
7002
|
className: cn("grid w-full gap-2", className),
|
|
5433
7003
|
children: [
|
|
5434
|
-
label || showValue ? /* @__PURE__ */
|
|
5435
|
-
label ? /* @__PURE__ */
|
|
7004
|
+
label || showValue ? /* @__PURE__ */ jsxs20("div", { className: "flex items-center justify-between gap-4", children: [
|
|
7005
|
+
label ? /* @__PURE__ */ jsx40(
|
|
5436
7006
|
FieldLabel,
|
|
5437
7007
|
{
|
|
5438
7008
|
htmlFor: inputId,
|
|
@@ -5443,8 +7013,8 @@ var Slider = React37.forwardRef(function Slider2({
|
|
|
5443
7013
|
textClassName: "block min-w-0 text-[color:var(--sofya-text-default)]",
|
|
5444
7014
|
children: label
|
|
5445
7015
|
}
|
|
5446
|
-
) : /* @__PURE__ */
|
|
5447
|
-
showValue ? /* @__PURE__ */
|
|
7016
|
+
) : /* @__PURE__ */ jsx40("span", {}),
|
|
7017
|
+
showValue ? /* @__PURE__ */ jsx40(
|
|
5448
7018
|
"div",
|
|
5449
7019
|
{
|
|
5450
7020
|
className: cn(
|
|
@@ -5462,7 +7032,7 @@ var Slider = React37.forwardRef(function Slider2({
|
|
|
5462
7032
|
}
|
|
5463
7033
|
) : null
|
|
5464
7034
|
] }) : null,
|
|
5465
|
-
/* @__PURE__ */
|
|
7035
|
+
/* @__PURE__ */ jsxs20(
|
|
5466
7036
|
"div",
|
|
5467
7037
|
{
|
|
5468
7038
|
"data-slot": "slider-control",
|
|
@@ -5472,7 +7042,7 @@ var Slider = React37.forwardRef(function Slider2({
|
|
|
5472
7042
|
),
|
|
5473
7043
|
style: controlStyle,
|
|
5474
7044
|
children: [
|
|
5475
|
-
/* @__PURE__ */
|
|
7045
|
+
/* @__PURE__ */ jsx40(
|
|
5476
7046
|
"input",
|
|
5477
7047
|
{
|
|
5478
7048
|
...props,
|
|
@@ -5489,7 +7059,7 @@ var Slider = React37.forwardRef(function Slider2({
|
|
|
5489
7059
|
style: inputBoundsStyle
|
|
5490
7060
|
}
|
|
5491
7061
|
),
|
|
5492
|
-
/* @__PURE__ */
|
|
7062
|
+
/* @__PURE__ */ jsx40(
|
|
5493
7063
|
"div",
|
|
5494
7064
|
{
|
|
5495
7065
|
"data-slot": "slider-track",
|
|
@@ -5500,7 +7070,7 @@ var Slider = React37.forwardRef(function Slider2({
|
|
|
5500
7070
|
style: trackBoundsStyle
|
|
5501
7071
|
}
|
|
5502
7072
|
),
|
|
5503
|
-
/* @__PURE__ */
|
|
7073
|
+
/* @__PURE__ */ jsx40(
|
|
5504
7074
|
"div",
|
|
5505
7075
|
{
|
|
5506
7076
|
"data-slot": "slider-range",
|
|
@@ -5511,7 +7081,7 @@ var Slider = React37.forwardRef(function Slider2({
|
|
|
5511
7081
|
style: rangeStyle
|
|
5512
7082
|
}
|
|
5513
7083
|
),
|
|
5514
|
-
/* @__PURE__ */
|
|
7084
|
+
/* @__PURE__ */ jsx40(
|
|
5515
7085
|
"div",
|
|
5516
7086
|
{
|
|
5517
7087
|
"data-slot": "slider-thumb",
|
|
@@ -5532,10 +7102,10 @@ var Slider = React37.forwardRef(function Slider2({
|
|
|
5532
7102
|
Slider.displayName = "Slider";
|
|
5533
7103
|
|
|
5534
7104
|
// src/components/skeleton.tsx
|
|
5535
|
-
import * as
|
|
5536
|
-
import { jsx as
|
|
5537
|
-
var Skeleton =
|
|
5538
|
-
return /* @__PURE__ */
|
|
7105
|
+
import * as React39 from "react";
|
|
7106
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
7107
|
+
var Skeleton = React39.forwardRef(function Skeleton2({ className, ...props }, ref) {
|
|
7108
|
+
return /* @__PURE__ */ jsx41(
|
|
5539
7109
|
"div",
|
|
5540
7110
|
{
|
|
5541
7111
|
ref,
|
|
@@ -5550,18 +7120,18 @@ var Skeleton = React38.forwardRef(function Skeleton2({ className, ...props }, re
|
|
|
5550
7120
|
Skeleton.displayName = "Skeleton";
|
|
5551
7121
|
|
|
5552
7122
|
// src/components/sonner.tsx
|
|
5553
|
-
import * as
|
|
7123
|
+
import * as React40 from "react";
|
|
5554
7124
|
import {
|
|
5555
7125
|
Toaster as SonnerToaster,
|
|
5556
7126
|
toast
|
|
5557
7127
|
} from "sonner";
|
|
5558
|
-
import { jsx as
|
|
7128
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
5559
7129
|
var notificationVariantOptions = ["default", "success", "error", "warning"];
|
|
5560
7130
|
function ToastStatusIcon({
|
|
5561
7131
|
iconName,
|
|
5562
7132
|
className
|
|
5563
7133
|
}) {
|
|
5564
|
-
return /* @__PURE__ */
|
|
7134
|
+
return /* @__PURE__ */ jsx42(
|
|
5565
7135
|
"span",
|
|
5566
7136
|
{
|
|
5567
7137
|
"aria-hidden": "true",
|
|
@@ -5569,7 +7139,7 @@ function ToastStatusIcon({
|
|
|
5569
7139
|
"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full border shadow-none",
|
|
5570
7140
|
className
|
|
5571
7141
|
),
|
|
5572
|
-
children: /* @__PURE__ */
|
|
7142
|
+
children: /* @__PURE__ */ jsx42(Icon, { name: iconName, size: 16 })
|
|
5573
7143
|
}
|
|
5574
7144
|
);
|
|
5575
7145
|
}
|
|
@@ -5593,35 +7163,35 @@ var defaultToastClassNames = {
|
|
|
5593
7163
|
loading: "border-border bg-card text-foreground"
|
|
5594
7164
|
};
|
|
5595
7165
|
var defaultToastIcons = {
|
|
5596
|
-
success: /* @__PURE__ */
|
|
7166
|
+
success: /* @__PURE__ */ jsx42(
|
|
5597
7167
|
ToastStatusIcon,
|
|
5598
7168
|
{
|
|
5599
7169
|
iconName: "check",
|
|
5600
7170
|
className: "border-success/15 bg-success/12 text-success"
|
|
5601
7171
|
}
|
|
5602
7172
|
),
|
|
5603
|
-
error: /* @__PURE__ */
|
|
7173
|
+
error: /* @__PURE__ */ jsx42(
|
|
5604
7174
|
ToastStatusIcon,
|
|
5605
7175
|
{
|
|
5606
7176
|
iconName: "x",
|
|
5607
7177
|
className: "border-destructive/15 bg-destructive/12 text-destructive"
|
|
5608
7178
|
}
|
|
5609
7179
|
),
|
|
5610
|
-
warning: /* @__PURE__ */
|
|
7180
|
+
warning: /* @__PURE__ */ jsx42(
|
|
5611
7181
|
ToastStatusIcon,
|
|
5612
7182
|
{
|
|
5613
7183
|
iconName: "question",
|
|
5614
7184
|
className: "border-warning/20 bg-warning/15 text-foreground"
|
|
5615
7185
|
}
|
|
5616
7186
|
),
|
|
5617
|
-
info: /* @__PURE__ */
|
|
7187
|
+
info: /* @__PURE__ */ jsx42(
|
|
5618
7188
|
ToastStatusIcon,
|
|
5619
7189
|
{
|
|
5620
7190
|
iconName: "question",
|
|
5621
7191
|
className: "border-primary/15 bg-primary/10 text-primary"
|
|
5622
7192
|
}
|
|
5623
7193
|
),
|
|
5624
|
-
close: /* @__PURE__ */
|
|
7194
|
+
close: /* @__PURE__ */ jsx42(Icon, { name: "x", size: 12 })
|
|
5625
7195
|
};
|
|
5626
7196
|
function mergeToastClassNames(overrides) {
|
|
5627
7197
|
return {
|
|
@@ -5629,7 +7199,7 @@ function mergeToastClassNames(overrides) {
|
|
|
5629
7199
|
...overrides
|
|
5630
7200
|
};
|
|
5631
7201
|
}
|
|
5632
|
-
var Toaster =
|
|
7202
|
+
var Toaster = React40.forwardRef(
|
|
5633
7203
|
function Toaster2({
|
|
5634
7204
|
className,
|
|
5635
7205
|
closeButton = true,
|
|
@@ -5641,7 +7211,7 @@ var Toaster = React39.forwardRef(
|
|
|
5641
7211
|
visibleToasts = 5,
|
|
5642
7212
|
...props
|
|
5643
7213
|
}, ref) {
|
|
5644
|
-
return /* @__PURE__ */
|
|
7214
|
+
return /* @__PURE__ */ jsx42(
|
|
5645
7215
|
SonnerToaster,
|
|
5646
7216
|
{
|
|
5647
7217
|
ref,
|
|
@@ -5696,12 +7266,12 @@ notify.dismiss = toast.dismiss;
|
|
|
5696
7266
|
notify.promise = toast.promise;
|
|
5697
7267
|
|
|
5698
7268
|
// src/components/status-indicator.tsx
|
|
5699
|
-
import * as
|
|
7269
|
+
import * as React42 from "react";
|
|
5700
7270
|
|
|
5701
7271
|
// src/components/tooltip.tsx
|
|
5702
|
-
import * as
|
|
7272
|
+
import * as React41 from "react";
|
|
5703
7273
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
5704
|
-
import { Fragment as Fragment4, jsx as
|
|
7274
|
+
import { Fragment as Fragment4, jsx as jsx43, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
5705
7275
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
5706
7276
|
var Tooltip = TooltipPrimitive.Root;
|
|
5707
7277
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
@@ -5719,8 +7289,8 @@ var tooltipToneClassNames = {
|
|
|
5719
7289
|
warning: "border-[color:var(--sofya-tone-warning-border)] bg-[color:var(--sofya-tone-warning-background)] text-[color:var(--sofya-tone-warning-foreground)]",
|
|
5720
7290
|
destructive: "border-[color:var(--sofya-tone-destructive-border)] bg-[color:var(--sofya-tone-destructive-background)] text-[color:var(--sofya-tone-destructive-foreground)]"
|
|
5721
7291
|
};
|
|
5722
|
-
var TooltipContent =
|
|
5723
|
-
return /* @__PURE__ */
|
|
7292
|
+
var TooltipContent = React41.forwardRef(function TooltipContent2({ className, sideOffset = 8, align = "center", tone = "default", ...props }, ref) {
|
|
7293
|
+
return /* @__PURE__ */ jsx43(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx43(
|
|
5724
7294
|
TooltipPrimitive.Content,
|
|
5725
7295
|
{
|
|
5726
7296
|
ref,
|
|
@@ -5746,7 +7316,7 @@ var TooltipContent = React40.forwardRef(function TooltipContent2({ className, si
|
|
|
5746
7316
|
) });
|
|
5747
7317
|
});
|
|
5748
7318
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
5749
|
-
var StatusTooltip =
|
|
7319
|
+
var StatusTooltip = React41.forwardRef(function StatusTooltip2({
|
|
5750
7320
|
children,
|
|
5751
7321
|
label,
|
|
5752
7322
|
status = "default",
|
|
@@ -5761,11 +7331,11 @@ var StatusTooltip = React40.forwardRef(function StatusTooltip2({
|
|
|
5761
7331
|
className
|
|
5762
7332
|
}, ref) {
|
|
5763
7333
|
if (disabled) {
|
|
5764
|
-
return /* @__PURE__ */
|
|
7334
|
+
return /* @__PURE__ */ jsx43(Fragment4, { children });
|
|
5765
7335
|
}
|
|
5766
|
-
return /* @__PURE__ */
|
|
5767
|
-
/* @__PURE__ */
|
|
5768
|
-
/* @__PURE__ */
|
|
7336
|
+
return /* @__PURE__ */ jsx43(TooltipProvider, { delayDuration, children: /* @__PURE__ */ jsxs21(Tooltip, { open, defaultOpen, onOpenChange, children: [
|
|
7337
|
+
/* @__PURE__ */ jsx43(TooltipTrigger, { asChild: true, children }),
|
|
7338
|
+
/* @__PURE__ */ jsx43(
|
|
5769
7339
|
TooltipContent,
|
|
5770
7340
|
{
|
|
5771
7341
|
ref,
|
|
@@ -5783,7 +7353,7 @@ var StatusTooltip = React40.forwardRef(function StatusTooltip2({
|
|
|
5783
7353
|
StatusTooltip.displayName = "StatusTooltip";
|
|
5784
7354
|
|
|
5785
7355
|
// src/components/status-indicator.tsx
|
|
5786
|
-
import { jsx as
|
|
7356
|
+
import { jsx as jsx44, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5787
7357
|
var workflowStatusOptions = [
|
|
5788
7358
|
"draft",
|
|
5789
7359
|
"in_progress",
|
|
@@ -5864,7 +7434,7 @@ var toneTextClassName = {
|
|
|
5864
7434
|
warning: "text-[color:var(--sofya-tone-warning-foreground)]",
|
|
5865
7435
|
destructive: "text-[color:var(--sofya-tone-destructive-foreground)]"
|
|
5866
7436
|
};
|
|
5867
|
-
var StatusIndicator =
|
|
7437
|
+
var StatusIndicator = React42.forwardRef(
|
|
5868
7438
|
function StatusIndicator2({
|
|
5869
7439
|
className,
|
|
5870
7440
|
label,
|
|
@@ -5875,7 +7445,7 @@ var StatusIndicator = React41.forwardRef(
|
|
|
5875
7445
|
...props
|
|
5876
7446
|
}, ref) {
|
|
5877
7447
|
const resolved = resolveWorkflowStatus(status, { label });
|
|
5878
|
-
const indicator = /* @__PURE__ */
|
|
7448
|
+
const indicator = /* @__PURE__ */ jsxs22(
|
|
5879
7449
|
"span",
|
|
5880
7450
|
{
|
|
5881
7451
|
ref,
|
|
@@ -5890,7 +7460,7 @@ var StatusIndicator = React41.forwardRef(
|
|
|
5890
7460
|
),
|
|
5891
7461
|
...props,
|
|
5892
7462
|
children: [
|
|
5893
|
-
/* @__PURE__ */
|
|
7463
|
+
/* @__PURE__ */ jsx44(
|
|
5894
7464
|
"span",
|
|
5895
7465
|
{
|
|
5896
7466
|
"aria-hidden": "true",
|
|
@@ -5911,15 +7481,15 @@ var StatusIndicator = React41.forwardRef(
|
|
|
5911
7481
|
if (!tooltip) {
|
|
5912
7482
|
return indicator;
|
|
5913
7483
|
}
|
|
5914
|
-
return /* @__PURE__ */
|
|
7484
|
+
return /* @__PURE__ */ jsx44(StatusTooltip, { status: resolved.tone, label: resolved.label, side, children: indicator });
|
|
5915
7485
|
}
|
|
5916
7486
|
);
|
|
5917
7487
|
StatusIndicator.displayName = "StatusIndicator";
|
|
5918
7488
|
|
|
5919
7489
|
// src/components/switch.tsx
|
|
5920
|
-
import * as
|
|
7490
|
+
import * as React43 from "react";
|
|
5921
7491
|
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
5922
|
-
import { jsx as
|
|
7492
|
+
import { jsx as jsx45, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
5923
7493
|
var switchSizeOptions = ["default", "sm"];
|
|
5924
7494
|
var switchRootSizeClasses = {
|
|
5925
7495
|
default: "h-6 w-11",
|
|
@@ -5929,7 +7499,7 @@ var switchThumbSizeClasses = {
|
|
|
5929
7499
|
default: "h-5 w-5 data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0",
|
|
5930
7500
|
sm: "h-4 w-4 data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
|
|
5931
7501
|
};
|
|
5932
|
-
var Switch =
|
|
7502
|
+
var Switch = React43.forwardRef(
|
|
5933
7503
|
({
|
|
5934
7504
|
"aria-describedby": ariaDescribedBy,
|
|
5935
7505
|
"aria-labelledby": ariaLabelledBy,
|
|
@@ -5944,7 +7514,7 @@ var Switch = React42.forwardRef(
|
|
|
5944
7514
|
size,
|
|
5945
7515
|
...props
|
|
5946
7516
|
}, ref) => {
|
|
5947
|
-
const generatedId =
|
|
7517
|
+
const generatedId = React43.useId();
|
|
5948
7518
|
const resolvedId = id ?? generatedId;
|
|
5949
7519
|
const labelId = label ? `${resolvedId}-label` : void 0;
|
|
5950
7520
|
const descriptionId = description ? `${resolvedId}-description` : void 0;
|
|
@@ -5953,7 +7523,7 @@ var Switch = React42.forwardRef(
|
|
|
5953
7523
|
const alignClassName2 = description ? "items-start" : "items-center";
|
|
5954
7524
|
const resolvedAriaDescribedBy = [ariaDescribedBy, descriptionId].filter(Boolean).join(" ") || void 0;
|
|
5955
7525
|
const resolvedAriaLabelledBy = ariaLabelledBy ?? labelId;
|
|
5956
|
-
const switchControl = /* @__PURE__ */
|
|
7526
|
+
const switchControl = /* @__PURE__ */ jsx45(
|
|
5957
7527
|
SwitchPrimitives.Root,
|
|
5958
7528
|
{
|
|
5959
7529
|
id: resolvedId,
|
|
@@ -5968,7 +7538,7 @@ var Switch = React42.forwardRef(
|
|
|
5968
7538
|
"data-size": resolvedSize,
|
|
5969
7539
|
...props,
|
|
5970
7540
|
ref,
|
|
5971
|
-
children: /* @__PURE__ */
|
|
7541
|
+
children: /* @__PURE__ */ jsx45(
|
|
5972
7542
|
SwitchPrimitives.Thumb,
|
|
5973
7543
|
{
|
|
5974
7544
|
className: cn(
|
|
@@ -5982,7 +7552,7 @@ var Switch = React42.forwardRef(
|
|
|
5982
7552
|
if (!hasTextContent) {
|
|
5983
7553
|
return switchControl;
|
|
5984
7554
|
}
|
|
5985
|
-
return /* @__PURE__ */
|
|
7555
|
+
return /* @__PURE__ */ jsxs23(
|
|
5986
7556
|
"div",
|
|
5987
7557
|
{
|
|
5988
7558
|
"data-slot": "switch-container",
|
|
@@ -5993,8 +7563,8 @@ var Switch = React42.forwardRef(
|
|
|
5993
7563
|
}),
|
|
5994
7564
|
children: [
|
|
5995
7565
|
switchControl,
|
|
5996
|
-
/* @__PURE__ */
|
|
5997
|
-
label ? /* @__PURE__ */
|
|
7566
|
+
/* @__PURE__ */ jsxs23("span", { className: selectionControlContentBaseClasses, children: [
|
|
7567
|
+
label ? /* @__PURE__ */ jsx45("label", { htmlFor: resolvedId, className: selectionControlLabelTextBaseClasses, children: /* @__PURE__ */ jsx45(
|
|
5998
7568
|
"span",
|
|
5999
7569
|
{
|
|
6000
7570
|
id: labelId,
|
|
@@ -6009,7 +7579,7 @@ var Switch = React42.forwardRef(
|
|
|
6009
7579
|
})
|
|
6010
7580
|
}
|
|
6011
7581
|
) }) : null,
|
|
6012
|
-
description ? /* @__PURE__ */
|
|
7582
|
+
description ? /* @__PURE__ */ jsx45(
|
|
6013
7583
|
"span",
|
|
6014
7584
|
{
|
|
6015
7585
|
id: descriptionId,
|
|
@@ -6034,8 +7604,8 @@ Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
|
6034
7604
|
|
|
6035
7605
|
// src/components/table.tsx
|
|
6036
7606
|
import { cva as cva8 } from "class-variance-authority";
|
|
6037
|
-
import * as
|
|
6038
|
-
import { jsx as
|
|
7607
|
+
import * as React44 from "react";
|
|
7608
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
6039
7609
|
var tableDensityOptions = ["default", "compact"];
|
|
6040
7610
|
var tableCellVariantOptions = ["default", "primary", "muted"];
|
|
6041
7611
|
var tableStatusToneOptions = [
|
|
@@ -6045,10 +7615,10 @@ var tableStatusToneOptions = [
|
|
|
6045
7615
|
"warning"
|
|
6046
7616
|
];
|
|
6047
7617
|
var tableActionToneOptions = ["primary", "neutral", "danger"];
|
|
6048
|
-
var TableDensityContext =
|
|
6049
|
-
var TableHeaderDensityContext =
|
|
7618
|
+
var TableDensityContext = React44.createContext("default");
|
|
7619
|
+
var TableHeaderDensityContext = React44.createContext("default");
|
|
6050
7620
|
function useTableDensity(density) {
|
|
6051
|
-
const inheritedDensity =
|
|
7621
|
+
const inheritedDensity = React44.useContext(TableDensityContext);
|
|
6052
7622
|
return density ?? inheritedDensity;
|
|
6053
7623
|
}
|
|
6054
7624
|
var tableCellVariants = cva8(
|
|
@@ -6104,20 +7674,21 @@ var tableActionButtonVariants = cva8(
|
|
|
6104
7674
|
}
|
|
6105
7675
|
}
|
|
6106
7676
|
);
|
|
6107
|
-
var Table =
|
|
6108
|
-
return /* @__PURE__ */
|
|
7677
|
+
var Table = React44.forwardRef(function Table2({ className, density = "default", ...props }, ref) {
|
|
7678
|
+
return /* @__PURE__ */ jsx46(TableDensityContext.Provider, { value: density, children: /* @__PURE__ */ jsx46(
|
|
6109
7679
|
"div",
|
|
6110
7680
|
{
|
|
6111
7681
|
"data-slot": "table-container",
|
|
6112
7682
|
className: "relative w-full overflow-x-auto",
|
|
6113
|
-
children: /* @__PURE__ */
|
|
7683
|
+
children: /* @__PURE__ */ jsx46(
|
|
6114
7684
|
"table",
|
|
6115
7685
|
{
|
|
6116
7686
|
"data-density": density,
|
|
6117
7687
|
"data-slot": "table",
|
|
6118
7688
|
ref,
|
|
6119
7689
|
className: cn(
|
|
6120
|
-
"w-full min-w-[1040px] caption-bottom border-separate border-spacing-0 bg-card",
|
|
7690
|
+
"w-full min-w-[1040px] caption-bottom border-separate border-spacing-x-0 bg-card",
|
|
7691
|
+
density === "compact" ? "border-spacing-y-2" : "border-spacing-y-0",
|
|
6121
7692
|
className
|
|
6122
7693
|
),
|
|
6123
7694
|
...props
|
|
@@ -6126,10 +7697,10 @@ var Table = React43.forwardRef(function Table2({ className, density = "default",
|
|
|
6126
7697
|
}
|
|
6127
7698
|
) });
|
|
6128
7699
|
});
|
|
6129
|
-
var TableHeader =
|
|
7700
|
+
var TableHeader = React44.forwardRef(function TableHeader2({ className, density, ...props }, ref) {
|
|
6130
7701
|
const tableDensity = useTableDensity();
|
|
6131
7702
|
const headerDensity = density ?? tableDensity;
|
|
6132
|
-
return /* @__PURE__ */
|
|
7703
|
+
return /* @__PURE__ */ jsx46(TableHeaderDensityContext.Provider, { value: headerDensity, children: /* @__PURE__ */ jsx46(TableDensityContext.Provider, { value: "default", children: /* @__PURE__ */ jsx46(
|
|
6133
7704
|
"thead",
|
|
6134
7705
|
{
|
|
6135
7706
|
"data-slot": "table-header",
|
|
@@ -6143,8 +7714,8 @@ var TableHeader = React43.forwardRef(function TableHeader2({ className, density,
|
|
|
6143
7714
|
}
|
|
6144
7715
|
) }) });
|
|
6145
7716
|
});
|
|
6146
|
-
var TableBody =
|
|
6147
|
-
return /* @__PURE__ */
|
|
7717
|
+
var TableBody = React44.forwardRef(function TableBody2({ className, ...props }, ref) {
|
|
7718
|
+
return /* @__PURE__ */ jsx46(
|
|
6148
7719
|
"tbody",
|
|
6149
7720
|
{
|
|
6150
7721
|
"data-slot": "table-body",
|
|
@@ -6154,8 +7725,8 @@ var TableBody = React43.forwardRef(function TableBody2({ className, ...props },
|
|
|
6154
7725
|
}
|
|
6155
7726
|
);
|
|
6156
7727
|
});
|
|
6157
|
-
var TableFooter =
|
|
6158
|
-
return /* @__PURE__ */
|
|
7728
|
+
var TableFooter = React44.forwardRef(function TableFooter2({ className, ...props }, ref) {
|
|
7729
|
+
return /* @__PURE__ */ jsx46(
|
|
6159
7730
|
"tfoot",
|
|
6160
7731
|
{
|
|
6161
7732
|
"data-slot": "table-footer",
|
|
@@ -6168,10 +7739,10 @@ var TableFooter = React43.forwardRef(function TableFooter2({ className, ...props
|
|
|
6168
7739
|
}
|
|
6169
7740
|
);
|
|
6170
7741
|
});
|
|
6171
|
-
var TableRow =
|
|
7742
|
+
var TableRow = React44.forwardRef(
|
|
6172
7743
|
function TableRow2({ className, density, ...props }, ref) {
|
|
6173
7744
|
const resolvedDensity = useTableDensity(density);
|
|
6174
|
-
return /* @__PURE__ */
|
|
7745
|
+
return /* @__PURE__ */ jsx46(TableDensityContext.Provider, { value: resolvedDensity, children: /* @__PURE__ */ jsx46(
|
|
6175
7746
|
"tr",
|
|
6176
7747
|
{
|
|
6177
7748
|
"data-density": resolvedDensity,
|
|
@@ -6187,9 +7758,9 @@ var TableRow = React43.forwardRef(
|
|
|
6187
7758
|
) });
|
|
6188
7759
|
}
|
|
6189
7760
|
);
|
|
6190
|
-
var TableHead =
|
|
6191
|
-
const headerDensity =
|
|
6192
|
-
return /* @__PURE__ */
|
|
7761
|
+
var TableHead = React44.forwardRef(function TableHead2({ className, children, ...props }, ref) {
|
|
7762
|
+
const headerDensity = React44.useContext(TableHeaderDensityContext);
|
|
7763
|
+
return /* @__PURE__ */ jsx46(
|
|
6193
7764
|
"th",
|
|
6194
7765
|
{
|
|
6195
7766
|
"data-slot": "table-head",
|
|
@@ -6197,7 +7768,7 @@ var TableHead = React43.forwardRef(function TableHead2({ className, children, ..
|
|
|
6197
7768
|
ref,
|
|
6198
7769
|
className: cn(
|
|
6199
7770
|
"whitespace-nowrap px-4 text-left align-middle [font-family:var(--sofya-text-tiny-font-family)] text-[length:var(--sofya-text-tiny-font-size)] font-medium uppercase leading-4 tracking-[0.08em] text-[color:var(--sofya-text-default)] [&_svg]:h-[1em] [&_svg]:w-[1em] [&_svg]:shrink-0",
|
|
6200
|
-
headerDensity === "compact" ? "py-
|
|
7771
|
+
headerDensity === "compact" ? "h-[45px] py-0" : "py-4",
|
|
6201
7772
|
className
|
|
6202
7773
|
),
|
|
6203
7774
|
...props,
|
|
@@ -6210,10 +7781,10 @@ var TableHead = React43.forwardRef(function TableHead2({ className, children, ..
|
|
|
6210
7781
|
}
|
|
6211
7782
|
);
|
|
6212
7783
|
});
|
|
6213
|
-
var TableCell =
|
|
7784
|
+
var TableCell = React44.forwardRef(
|
|
6214
7785
|
function TableCell2({ className, density, variant, truncate, children, ...props }, ref) {
|
|
6215
7786
|
const resolvedDensity = useTableDensity(density);
|
|
6216
|
-
return /* @__PURE__ */
|
|
7787
|
+
return /* @__PURE__ */ jsx46(
|
|
6217
7788
|
"td",
|
|
6218
7789
|
{
|
|
6219
7790
|
"data-density": resolvedDensity,
|
|
@@ -6238,8 +7809,8 @@ var TableCell = React43.forwardRef(
|
|
|
6238
7809
|
);
|
|
6239
7810
|
}
|
|
6240
7811
|
);
|
|
6241
|
-
var TableCaption =
|
|
6242
|
-
return /* @__PURE__ */
|
|
7812
|
+
var TableCaption = React44.forwardRef(function TableCaption2({ className, children, ...props }, ref) {
|
|
7813
|
+
return /* @__PURE__ */ jsx46(
|
|
6243
7814
|
"caption",
|
|
6244
7815
|
{
|
|
6245
7816
|
"data-slot": "table-caption",
|
|
@@ -6258,12 +7829,12 @@ var TableCaption = React43.forwardRef(function TableCaption2({ className, childr
|
|
|
6258
7829
|
}
|
|
6259
7830
|
);
|
|
6260
7831
|
});
|
|
6261
|
-
var TableCellTitle =
|
|
7832
|
+
var TableCellTitle = React44.forwardRef(
|
|
6262
7833
|
function TableCellTitle2({ className, children, size, ...props }, ref) {
|
|
6263
7834
|
const density = useTableDensity();
|
|
6264
7835
|
const resolvedSize = size ?? (density === "compact" ? "compact" : "default");
|
|
6265
7836
|
const textSize = resolvedSize === "compact" ? "label-md" : "body";
|
|
6266
|
-
return /* @__PURE__ */
|
|
7837
|
+
return /* @__PURE__ */ jsx46(
|
|
6267
7838
|
"span",
|
|
6268
7839
|
{
|
|
6269
7840
|
"data-slot": "table-cell-title",
|
|
@@ -6283,11 +7854,11 @@ var TableCellTitle = React43.forwardRef(
|
|
|
6283
7854
|
);
|
|
6284
7855
|
}
|
|
6285
7856
|
);
|
|
6286
|
-
var TableCellDescription =
|
|
7857
|
+
var TableCellDescription = React44.forwardRef(function TableCellDescription2({ className, children, size, ...props }, ref) {
|
|
6287
7858
|
const density = useTableDensity();
|
|
6288
7859
|
const resolvedSize = size ?? (density === "compact" ? "compact" : "default");
|
|
6289
7860
|
const textSize = resolvedSize === "compact" ? "body-sm" : "tiny";
|
|
6290
|
-
return /* @__PURE__ */
|
|
7861
|
+
return /* @__PURE__ */ jsx46(
|
|
6291
7862
|
"span",
|
|
6292
7863
|
{
|
|
6293
7864
|
"data-slot": "table-cell-description",
|
|
@@ -6315,7 +7886,7 @@ function TableStatusBadge({
|
|
|
6315
7886
|
...props
|
|
6316
7887
|
}) {
|
|
6317
7888
|
const resolvedDensity = useTableDensity(density);
|
|
6318
|
-
return /* @__PURE__ */
|
|
7889
|
+
return /* @__PURE__ */ jsx46(
|
|
6319
7890
|
Badge,
|
|
6320
7891
|
{
|
|
6321
7892
|
"data-density": resolvedDensity,
|
|
@@ -6334,8 +7905,8 @@ function TableStatusBadge({
|
|
|
6334
7905
|
}
|
|
6335
7906
|
);
|
|
6336
7907
|
}
|
|
6337
|
-
var TableActionButton =
|
|
6338
|
-
return /* @__PURE__ */
|
|
7908
|
+
var TableActionButton = React44.forwardRef(function TableActionButton2({ className, tone, type = "button", children, ...props }, ref) {
|
|
7909
|
+
return /* @__PURE__ */ jsx46(
|
|
6339
7910
|
Button,
|
|
6340
7911
|
{
|
|
6341
7912
|
ref,
|
|
@@ -6353,8 +7924,8 @@ var TableActionButton = React43.forwardRef(function TableActionButton2({ classNa
|
|
|
6353
7924
|
}
|
|
6354
7925
|
);
|
|
6355
7926
|
});
|
|
6356
|
-
var TableActions =
|
|
6357
|
-
return /* @__PURE__ */
|
|
7927
|
+
var TableActions = React44.forwardRef(function TableActions2({ className, ...props }, ref) {
|
|
7928
|
+
return /* @__PURE__ */ jsx46(
|
|
6358
7929
|
"div",
|
|
6359
7930
|
{
|
|
6360
7931
|
ref,
|
|
@@ -6381,8 +7952,8 @@ TableActions.displayName = "TableActions";
|
|
|
6381
7952
|
|
|
6382
7953
|
// src/components/tag.tsx
|
|
6383
7954
|
import { cva as cva9 } from "class-variance-authority";
|
|
6384
|
-
import * as
|
|
6385
|
-
import { jsx as
|
|
7955
|
+
import * as React45 from "react";
|
|
7956
|
+
import { jsx as jsx47, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
6386
7957
|
var tagVariantOptions = [
|
|
6387
7958
|
"neutral",
|
|
6388
7959
|
"organization",
|
|
@@ -6423,9 +7994,9 @@ var tagStatusToneClasses = {
|
|
|
6423
7994
|
warning: "border-[color:var(--sofya-tone-warning-border)] bg-[color:var(--sofya-tone-warning-background)] text-[color:var(--sofya-tone-warning-foreground)]",
|
|
6424
7995
|
destructive: "border-[color:var(--sofya-tone-destructive-border)] bg-[color:var(--sofya-tone-destructive-background)] text-[color:var(--sofya-tone-destructive-foreground)]"
|
|
6425
7996
|
};
|
|
6426
|
-
var Tag =
|
|
7997
|
+
var Tag = React45.forwardRef(function Tag2({ children, className, icon, tone = "info", truncate = false, variant, ...props }, ref) {
|
|
6427
7998
|
const resolvedVariant = variant ?? "neutral";
|
|
6428
|
-
return /* @__PURE__ */
|
|
7999
|
+
return /* @__PURE__ */ jsxs24(
|
|
6429
8000
|
"span",
|
|
6430
8001
|
{
|
|
6431
8002
|
ref,
|
|
@@ -6439,7 +8010,7 @@ var Tag = React44.forwardRef(function Tag2({ children, className, icon, tone = "
|
|
|
6439
8010
|
),
|
|
6440
8011
|
...props,
|
|
6441
8012
|
children: [
|
|
6442
|
-
icon ? /* @__PURE__ */
|
|
8013
|
+
icon ? /* @__PURE__ */ jsx47("span", { className: "inline-flex shrink-0 items-center justify-center", children: icon }) : null,
|
|
6443
8014
|
renderTextContent(children, {
|
|
6444
8015
|
as: "span",
|
|
6445
8016
|
className: cn("text-inherit", truncate && "min-w-0 truncate"),
|
|
@@ -6460,11 +8031,11 @@ var privacyDefaultLabels = {
|
|
|
6460
8031
|
organization: "Minha organiza\xE7\xE3o",
|
|
6461
8032
|
public: "P\xFAblico"
|
|
6462
8033
|
};
|
|
6463
|
-
var PrivacyLabel =
|
|
8034
|
+
var PrivacyLabel = React45.forwardRef(
|
|
6464
8035
|
function PrivacyLabel2({ appearance = "text", className, icon, label, privacy, ...props }, ref) {
|
|
6465
8036
|
const content = label ?? privacyDefaultLabels[privacy];
|
|
6466
8037
|
if (appearance === "tag") {
|
|
6467
|
-
return /* @__PURE__ */
|
|
8038
|
+
return /* @__PURE__ */ jsx47(
|
|
6468
8039
|
Tag,
|
|
6469
8040
|
{
|
|
6470
8041
|
ref,
|
|
@@ -6477,7 +8048,7 @@ var PrivacyLabel = React44.forwardRef(
|
|
|
6477
8048
|
}
|
|
6478
8049
|
);
|
|
6479
8050
|
}
|
|
6480
|
-
return /* @__PURE__ */
|
|
8051
|
+
return /* @__PURE__ */ jsxs24(
|
|
6481
8052
|
"span",
|
|
6482
8053
|
{
|
|
6483
8054
|
ref,
|
|
@@ -6489,7 +8060,7 @@ var PrivacyLabel = React44.forwardRef(
|
|
|
6489
8060
|
),
|
|
6490
8061
|
...props,
|
|
6491
8062
|
children: [
|
|
6492
|
-
icon ? /* @__PURE__ */
|
|
8063
|
+
icon ? /* @__PURE__ */ jsx47("span", { className: "inline-flex shrink-0 items-center justify-center", children: icon }) : null,
|
|
6493
8064
|
renderTextContent(content, {
|
|
6494
8065
|
as: "span",
|
|
6495
8066
|
className: "text-inherit",
|
|
@@ -6503,12 +8074,12 @@ var PrivacyLabel = React44.forwardRef(
|
|
|
6503
8074
|
PrivacyLabel.displayName = "PrivacyLabel";
|
|
6504
8075
|
|
|
6505
8076
|
// src/components/template-card.tsx
|
|
6506
|
-
import * as
|
|
6507
|
-
import { Fragment as Fragment5, jsx as
|
|
8077
|
+
import * as React46 from "react";
|
|
8078
|
+
import { Fragment as Fragment5, jsx as jsx48, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
6508
8079
|
var templateCardLayoutOptions = ["card", "list"];
|
|
6509
8080
|
var templateCardFavoriteDisplayOptions = ["action", "inline"];
|
|
6510
8081
|
var templateCardMetaPlacementOptions = ["block", "inline"];
|
|
6511
|
-
var TemplateCard =
|
|
8082
|
+
var TemplateCard = React46.forwardRef(
|
|
6512
8083
|
function TemplateCard2({
|
|
6513
8084
|
className,
|
|
6514
8085
|
description,
|
|
@@ -6535,14 +8106,14 @@ var TemplateCard = React45.forwardRef(
|
|
|
6535
8106
|
const showInlineMeta = metaPlacement === "inline" && Boolean(meta);
|
|
6536
8107
|
const showBlockMeta = metaPlacement !== "inline" && Boolean(meta);
|
|
6537
8108
|
const showFavoriteAction = favoriteDisplay !== "inline" && (onToggleFavorite !== void 0 || favorited !== void 0);
|
|
6538
|
-
const actions = showFavoriteAction || overflow ? /* @__PURE__ */
|
|
6539
|
-
showFavoriteAction ? /* @__PURE__ */
|
|
8109
|
+
const actions = showFavoriteAction || overflow ? /* @__PURE__ */ jsxs25("div", { className: "flex shrink-0 items-center gap-[var(--sofya-gap-tight)]", children: [
|
|
8110
|
+
showFavoriteAction ? /* @__PURE__ */ jsx48(
|
|
6540
8111
|
IconButton,
|
|
6541
8112
|
{
|
|
6542
8113
|
"aria-label": favoriteLabel,
|
|
6543
8114
|
selected: Boolean(favorited),
|
|
6544
8115
|
onClick: onToggleFavorite,
|
|
6545
|
-
icon: /* @__PURE__ */
|
|
8116
|
+
icon: /* @__PURE__ */ jsx48(Icon, { name: "star", size: 18 })
|
|
6546
8117
|
}
|
|
6547
8118
|
) : null,
|
|
6548
8119
|
overflow
|
|
@@ -6557,10 +8128,10 @@ var TemplateCard = React45.forwardRef(
|
|
|
6557
8128
|
style: selectable ? { fontSize: "15px", lineHeight: "26px", fontWeight: 600 } : void 0
|
|
6558
8129
|
});
|
|
6559
8130
|
const hasInlineTitleExtras = showInlineStar || showInlineMeta;
|
|
6560
|
-
const titleRow = hasInlineTitleExtras ? /* @__PURE__ */
|
|
6561
|
-
showInlineStar ? /* @__PURE__ */
|
|
8131
|
+
const titleRow = hasInlineTitleExtras ? /* @__PURE__ */ jsxs25("div", { className: "flex min-w-0 items-center gap-[var(--sofya-gap-tight)]", children: [
|
|
8132
|
+
showInlineStar ? /* @__PURE__ */ jsx48(Icon, { name: "star-filled", size: 18, color: "primary" }) : null,
|
|
6562
8133
|
titleNode,
|
|
6563
|
-
showInlineMeta ? /* @__PURE__ */
|
|
8134
|
+
showInlineMeta ? /* @__PURE__ */ jsx48(
|
|
6564
8135
|
"span",
|
|
6565
8136
|
{
|
|
6566
8137
|
"data-slot": "template-card-meta-inline",
|
|
@@ -6569,7 +8140,7 @@ var TemplateCard = React45.forwardRef(
|
|
|
6569
8140
|
}
|
|
6570
8141
|
) : null
|
|
6571
8142
|
] }) : titleNode;
|
|
6572
|
-
const heading = /* @__PURE__ */
|
|
8143
|
+
const heading = /* @__PURE__ */ jsxs25("div", { className: "flex min-w-0 flex-col gap-[var(--sofya-space-1)]", children: [
|
|
6573
8144
|
titleRow,
|
|
6574
8145
|
description ? renderTextContent(description, {
|
|
6575
8146
|
as: "span",
|
|
@@ -6587,7 +8158,7 @@ var TemplateCard = React45.forwardRef(
|
|
|
6587
8158
|
style: selectable ? { fontSize: "14px", lineHeight: "18px", fontWeight: 400 } : void 0
|
|
6588
8159
|
}) : null
|
|
6589
8160
|
] });
|
|
6590
|
-
const blockMeta = showBlockMeta ? /* @__PURE__ */
|
|
8161
|
+
const blockMeta = showBlockMeta ? /* @__PURE__ */ jsx48(
|
|
6591
8162
|
"div",
|
|
6592
8163
|
{
|
|
6593
8164
|
"data-slot": "template-card-meta",
|
|
@@ -6611,7 +8182,7 @@ var TemplateCard = React45.forwardRef(
|
|
|
6611
8182
|
}
|
|
6612
8183
|
onKeyDown?.(event);
|
|
6613
8184
|
};
|
|
6614
|
-
return /* @__PURE__ */
|
|
8185
|
+
return /* @__PURE__ */ jsx48(
|
|
6615
8186
|
"div",
|
|
6616
8187
|
{
|
|
6617
8188
|
ref,
|
|
@@ -6637,13 +8208,13 @@ var TemplateCard = React45.forwardRef(
|
|
|
6637
8208
|
className
|
|
6638
8209
|
),
|
|
6639
8210
|
...props,
|
|
6640
|
-
children: selectable ? /* @__PURE__ */
|
|
6641
|
-
/* @__PURE__ */
|
|
8211
|
+
children: selectable ? /* @__PURE__ */ jsxs25(Fragment5, { children: [
|
|
8212
|
+
/* @__PURE__ */ jsx48(
|
|
6642
8213
|
"span",
|
|
6643
8214
|
{
|
|
6644
8215
|
className: "shrink-0",
|
|
6645
8216
|
onClick: (event) => event.stopPropagation(),
|
|
6646
|
-
children: /* @__PURE__ */
|
|
8217
|
+
children: /* @__PURE__ */ jsx48(
|
|
6647
8218
|
Checkbox,
|
|
6648
8219
|
{
|
|
6649
8220
|
checked: selected,
|
|
@@ -6653,15 +8224,15 @@ var TemplateCard = React45.forwardRef(
|
|
|
6653
8224
|
)
|
|
6654
8225
|
}
|
|
6655
8226
|
),
|
|
6656
|
-
/* @__PURE__ */
|
|
8227
|
+
/* @__PURE__ */ jsx48("div", { className: "min-w-0 flex-1", children: heading }),
|
|
6657
8228
|
blockMeta,
|
|
6658
8229
|
actions
|
|
6659
|
-
] }) : isList ? /* @__PURE__ */
|
|
6660
|
-
/* @__PURE__ */
|
|
8230
|
+
] }) : isList ? /* @__PURE__ */ jsxs25(Fragment5, { children: [
|
|
8231
|
+
/* @__PURE__ */ jsx48("div", { className: "min-w-0 flex-1", children: heading }),
|
|
6661
8232
|
blockMeta,
|
|
6662
8233
|
actions
|
|
6663
|
-
] }) : /* @__PURE__ */
|
|
6664
|
-
/* @__PURE__ */
|
|
8234
|
+
] }) : /* @__PURE__ */ jsxs25(Fragment5, { children: [
|
|
8235
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex items-start justify-between gap-[var(--sofya-gap-compact)]", children: [
|
|
6665
8236
|
heading,
|
|
6666
8237
|
actions
|
|
6667
8238
|
] }),
|
|
@@ -6672,16 +8243,16 @@ var TemplateCard = React45.forwardRef(
|
|
|
6672
8243
|
}
|
|
6673
8244
|
);
|
|
6674
8245
|
TemplateCard.displayName = "TemplateCard";
|
|
6675
|
-
var TemplateListItem =
|
|
6676
|
-
return /* @__PURE__ */
|
|
8246
|
+
var TemplateListItem = React46.forwardRef(function TemplateListItem2(props, ref) {
|
|
8247
|
+
return /* @__PURE__ */ jsx48(TemplateCard, { ref, layout: "list", ...props });
|
|
6677
8248
|
});
|
|
6678
8249
|
TemplateListItem.displayName = "TemplateListItem";
|
|
6679
8250
|
|
|
6680
8251
|
// src/components/tabs.tsx
|
|
6681
|
-
import * as
|
|
8252
|
+
import * as React47 from "react";
|
|
6682
8253
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
6683
8254
|
import { motion as motion3 } from "motion/react";
|
|
6684
|
-
import { jsx as
|
|
8255
|
+
import { jsx as jsx49, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
6685
8256
|
function resolveDefaultValue(items, defaultValue) {
|
|
6686
8257
|
if (defaultValue) {
|
|
6687
8258
|
return defaultValue;
|
|
@@ -6705,13 +8276,13 @@ function Tabs({
|
|
|
6705
8276
|
onChange: onValueChange,
|
|
6706
8277
|
value
|
|
6707
8278
|
});
|
|
6708
|
-
const indicatorLayoutId =
|
|
6709
|
-
|
|
8279
|
+
const indicatorLayoutId = React47.useId();
|
|
8280
|
+
React47.useEffect(() => {
|
|
6710
8281
|
if (value === void 0) {
|
|
6711
8282
|
setUncontrolledCurrentValue(resolvedDefaultValue);
|
|
6712
8283
|
}
|
|
6713
8284
|
}, [resolvedDefaultValue, setUncontrolledCurrentValue, value]);
|
|
6714
|
-
return /* @__PURE__ */
|
|
8285
|
+
return /* @__PURE__ */ jsxs26(
|
|
6715
8286
|
TabsPrimitive.Root,
|
|
6716
8287
|
{
|
|
6717
8288
|
className: cn("w-full", className),
|
|
@@ -6719,7 +8290,7 @@ function Tabs({
|
|
|
6719
8290
|
value: currentValue,
|
|
6720
8291
|
...props,
|
|
6721
8292
|
children: [
|
|
6722
|
-
/* @__PURE__ */
|
|
8293
|
+
/* @__PURE__ */ jsx49(
|
|
6723
8294
|
TabsPrimitive.List,
|
|
6724
8295
|
{
|
|
6725
8296
|
"aria-label": "Subtelas navegaveis",
|
|
@@ -6730,7 +8301,7 @@ function Tabs({
|
|
|
6730
8301
|
children: items.map((item) => {
|
|
6731
8302
|
const isUnavailable = item.disabled || item.loading;
|
|
6732
8303
|
const isActive = item.value === currentValue;
|
|
6733
|
-
return /* @__PURE__ */
|
|
8304
|
+
return /* @__PURE__ */ jsxs26(
|
|
6734
8305
|
TabsPrimitive.Trigger,
|
|
6735
8306
|
{
|
|
6736
8307
|
value: item.value,
|
|
@@ -6742,7 +8313,7 @@ function Tabs({
|
|
|
6742
8313
|
item.triggerClassName
|
|
6743
8314
|
),
|
|
6744
8315
|
children: [
|
|
6745
|
-
isActive ? /* @__PURE__ */
|
|
8316
|
+
isActive ? /* @__PURE__ */ jsx49(
|
|
6746
8317
|
motion3.span,
|
|
6747
8318
|
{
|
|
6748
8319
|
"aria-hidden": "true",
|
|
@@ -6752,15 +8323,15 @@ function Tabs({
|
|
|
6752
8323
|
transition: { duration: 0.25, ease: "easeInOut" }
|
|
6753
8324
|
}
|
|
6754
8325
|
) : null,
|
|
6755
|
-
/* @__PURE__ */
|
|
6756
|
-
item.loading ? /* @__PURE__ */
|
|
8326
|
+
/* @__PURE__ */ jsxs26("span", { className: "relative z-10 inline-flex items-center gap-2", children: [
|
|
8327
|
+
item.loading ? /* @__PURE__ */ jsx49(
|
|
6757
8328
|
"span",
|
|
6758
8329
|
{
|
|
6759
8330
|
"aria-hidden": "true",
|
|
6760
8331
|
className: "h-4 w-4 animate-spin rounded-full border-2 border-current border-r-transparent"
|
|
6761
8332
|
}
|
|
6762
8333
|
) : null,
|
|
6763
|
-
/* @__PURE__ */
|
|
8334
|
+
/* @__PURE__ */ jsx49("span", { children: renderTextContent(item.label, {
|
|
6764
8335
|
as: "span",
|
|
6765
8336
|
className: "block text-inherit",
|
|
6766
8337
|
size: "body"
|
|
@@ -6774,7 +8345,7 @@ function Tabs({
|
|
|
6774
8345
|
}
|
|
6775
8346
|
),
|
|
6776
8347
|
items.map(
|
|
6777
|
-
(item) => item.content !== void 0 ? /* @__PURE__ */
|
|
8348
|
+
(item) => item.content !== void 0 ? /* @__PURE__ */ jsx49(
|
|
6778
8349
|
TabsPrimitive.Content,
|
|
6779
8350
|
{
|
|
6780
8351
|
value: item.value,
|
|
@@ -6797,9 +8368,9 @@ function Tabs({
|
|
|
6797
8368
|
Tabs.displayName = "Tabs";
|
|
6798
8369
|
|
|
6799
8370
|
// src/components/textarea.tsx
|
|
6800
|
-
import * as
|
|
6801
|
-
import { jsx as
|
|
6802
|
-
var Textarea =
|
|
8371
|
+
import * as React48 from "react";
|
|
8372
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
8373
|
+
var Textarea = React48.forwardRef(
|
|
6803
8374
|
({
|
|
6804
8375
|
className,
|
|
6805
8376
|
containerClassName,
|
|
@@ -6809,10 +8380,10 @@ var Textarea = React47.forwardRef(
|
|
|
6809
8380
|
rows = 5,
|
|
6810
8381
|
...props
|
|
6811
8382
|
}, ref) => {
|
|
6812
|
-
const generatedId =
|
|
8383
|
+
const generatedId = React48.useId();
|
|
6813
8384
|
const resolvedId = id ?? generatedId;
|
|
6814
8385
|
const ariaLabel = props["aria-label"] ?? (typeof label === "string" ? label : void 0);
|
|
6815
|
-
const control = /* @__PURE__ */
|
|
8386
|
+
const control = /* @__PURE__ */ jsx50(
|
|
6816
8387
|
"textarea",
|
|
6817
8388
|
{
|
|
6818
8389
|
className: cn(
|
|
@@ -6826,7 +8397,7 @@ var Textarea = React47.forwardRef(
|
|
|
6826
8397
|
"aria-label": ariaLabel
|
|
6827
8398
|
}
|
|
6828
8399
|
);
|
|
6829
|
-
return /* @__PURE__ */
|
|
8400
|
+
return /* @__PURE__ */ jsx50(
|
|
6830
8401
|
FieldShell,
|
|
6831
8402
|
{
|
|
6832
8403
|
control,
|
|
@@ -6841,10 +8412,10 @@ var Textarea = React47.forwardRef(
|
|
|
6841
8412
|
Textarea.displayName = "Textarea";
|
|
6842
8413
|
|
|
6843
8414
|
// src/components/toggle.tsx
|
|
6844
|
-
import * as
|
|
8415
|
+
import * as React49 from "react";
|
|
6845
8416
|
import * as SwitchPrimitives2 from "@radix-ui/react-switch";
|
|
6846
|
-
import { jsx as
|
|
6847
|
-
var Toggle =
|
|
8417
|
+
import { jsx as jsx51, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
8418
|
+
var Toggle = React49.forwardRef(function Toggle2({
|
|
6848
8419
|
"aria-describedby": ariaDescribedBy,
|
|
6849
8420
|
"aria-labelledby": ariaLabelledBy,
|
|
6850
8421
|
className,
|
|
@@ -6857,7 +8428,7 @@ var Toggle = React48.forwardRef(function Toggle2({
|
|
|
6857
8428
|
labelClassName,
|
|
6858
8429
|
...props
|
|
6859
8430
|
}, ref) {
|
|
6860
|
-
const generatedId =
|
|
8431
|
+
const generatedId = React49.useId();
|
|
6861
8432
|
const resolvedId = id ?? generatedId;
|
|
6862
8433
|
const labelId = label ? `${resolvedId}-label` : void 0;
|
|
6863
8434
|
const descriptionId = description ? `${resolvedId}-description` : void 0;
|
|
@@ -6865,7 +8436,7 @@ var Toggle = React48.forwardRef(function Toggle2({
|
|
|
6865
8436
|
const alignClassName2 = description ? "items-start" : "items-center";
|
|
6866
8437
|
const resolvedAriaDescribedBy = [ariaDescribedBy, descriptionId].filter(Boolean).join(" ") || void 0;
|
|
6867
8438
|
const resolvedAriaLabelledBy = ariaLabelledBy ?? labelId;
|
|
6868
|
-
const toggleControl = /* @__PURE__ */
|
|
8439
|
+
const toggleControl = /* @__PURE__ */ jsx51(
|
|
6869
8440
|
SwitchPrimitives2.Root,
|
|
6870
8441
|
{
|
|
6871
8442
|
id: resolvedId,
|
|
@@ -6879,7 +8450,7 @@ var Toggle = React48.forwardRef(function Toggle2({
|
|
|
6879
8450
|
className
|
|
6880
8451
|
),
|
|
6881
8452
|
...props,
|
|
6882
|
-
children: /* @__PURE__ */
|
|
8453
|
+
children: /* @__PURE__ */ jsx51(
|
|
6883
8454
|
SwitchPrimitives2.Thumb,
|
|
6884
8455
|
{
|
|
6885
8456
|
"data-slot": "toggle-thumb",
|
|
@@ -6891,7 +8462,7 @@ var Toggle = React48.forwardRef(function Toggle2({
|
|
|
6891
8462
|
if (!hasTextContent) {
|
|
6892
8463
|
return toggleControl;
|
|
6893
8464
|
}
|
|
6894
|
-
return /* @__PURE__ */
|
|
8465
|
+
return /* @__PURE__ */ jsxs27(
|
|
6895
8466
|
"div",
|
|
6896
8467
|
{
|
|
6897
8468
|
"data-slot": "toggle-container",
|
|
@@ -6902,8 +8473,8 @@ var Toggle = React48.forwardRef(function Toggle2({
|
|
|
6902
8473
|
}),
|
|
6903
8474
|
children: [
|
|
6904
8475
|
toggleControl,
|
|
6905
|
-
/* @__PURE__ */
|
|
6906
|
-
label ? /* @__PURE__ */
|
|
8476
|
+
/* @__PURE__ */ jsxs27("span", { className: selectionControlContentBaseClasses, children: [
|
|
8477
|
+
label ? /* @__PURE__ */ jsx51("label", { htmlFor: resolvedId, className: selectionControlLabelTextBaseClasses, children: /* @__PURE__ */ jsx51(
|
|
6907
8478
|
"span",
|
|
6908
8479
|
{
|
|
6909
8480
|
id: labelId,
|
|
@@ -6915,7 +8486,7 @@ var Toggle = React48.forwardRef(function Toggle2({
|
|
|
6915
8486
|
})
|
|
6916
8487
|
}
|
|
6917
8488
|
) }) : null,
|
|
6918
|
-
description ? /* @__PURE__ */
|
|
8489
|
+
description ? /* @__PURE__ */ jsx51(
|
|
6919
8490
|
"span",
|
|
6920
8491
|
{
|
|
6921
8492
|
id: descriptionId,
|
|
@@ -6938,13 +8509,13 @@ var Toggle = React48.forwardRef(function Toggle2({
|
|
|
6938
8509
|
Toggle.displayName = "Toggle";
|
|
6939
8510
|
|
|
6940
8511
|
// src/theme/provider.tsx
|
|
6941
|
-
import * as
|
|
8512
|
+
import * as React50 from "react";
|
|
6942
8513
|
import {
|
|
6943
8514
|
createWhitelabelTheme,
|
|
6944
8515
|
defaultTheme,
|
|
6945
8516
|
themeToCssVariables
|
|
6946
8517
|
} from "@sofya-ds/tokens";
|
|
6947
|
-
import { jsx as
|
|
8518
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
6948
8519
|
var SOFYA_FONT_LINKS = [
|
|
6949
8520
|
{
|
|
6950
8521
|
id: "preconnect-googleapis",
|
|
@@ -6964,7 +8535,7 @@ var SOFYA_FONT_LINKS = [
|
|
|
6964
8535
|
}
|
|
6965
8536
|
];
|
|
6966
8537
|
function useSofyaFontLinks() {
|
|
6967
|
-
|
|
8538
|
+
React50.useEffect(() => {
|
|
6968
8539
|
if (typeof document === "undefined") {
|
|
6969
8540
|
return;
|
|
6970
8541
|
}
|
|
@@ -6997,7 +8568,7 @@ function SofyaProvider({
|
|
|
6997
8568
|
useSofyaFontLinks();
|
|
6998
8569
|
const theme = createWhitelabelTheme(overrides ?? {}, preset);
|
|
6999
8570
|
const cssVariables = themeToCssVariables(theme);
|
|
7000
|
-
return /* @__PURE__ */
|
|
8571
|
+
return /* @__PURE__ */ jsx52(
|
|
7001
8572
|
"div",
|
|
7002
8573
|
{
|
|
7003
8574
|
"data-sofya-theme": theme.name,
|
|
@@ -7117,6 +8688,15 @@ export {
|
|
|
7117
8688
|
RadioGroupOptionDescription,
|
|
7118
8689
|
RadioGroupOptionIndicator,
|
|
7119
8690
|
RadioGroupOptionLabel,
|
|
8691
|
+
ReasoningLabsWidget,
|
|
8692
|
+
ReasoningSummaryWidget,
|
|
8693
|
+
ReasoningVitalsWidget,
|
|
8694
|
+
ReasoningWidget,
|
|
8695
|
+
ReasoningWidgetActionButton,
|
|
8696
|
+
ReasoningWidgetActions,
|
|
8697
|
+
ReasoningWidgetList,
|
|
8698
|
+
ReasoningWidgetRenderer,
|
|
8699
|
+
ReasoningWidgetTable,
|
|
7120
8700
|
RichTextToolbar,
|
|
7121
8701
|
RichTextToolbarButton,
|
|
7122
8702
|
RichTextToolbarGroup,
|
|
@@ -7138,7 +8718,11 @@ export {
|
|
|
7138
8718
|
SelectValue,
|
|
7139
8719
|
Separator2 as Separator,
|
|
7140
8720
|
SettingsNavItem,
|
|
8721
|
+
SidebarNav,
|
|
7141
8722
|
SidebarNavItem,
|
|
8723
|
+
SidebarNavSection,
|
|
8724
|
+
SidebarNavSectionItems,
|
|
8725
|
+
SidebarNavSectionLabel,
|
|
7142
8726
|
Skeleton,
|
|
7143
8727
|
Slider,
|
|
7144
8728
|
SofyaProvider,
|
|
@@ -7217,6 +8801,14 @@ export {
|
|
|
7217
8801
|
progressSizeOptions,
|
|
7218
8802
|
radioGroupOrientationOptions,
|
|
7219
8803
|
radioGroupVariantOptions,
|
|
8804
|
+
reasoningWidgetActionScopeOptions,
|
|
8805
|
+
reasoningWidgetActionToneOptions,
|
|
8806
|
+
reasoningWidgetDensityOptions,
|
|
8807
|
+
reasoningWidgetFrameOptions,
|
|
8808
|
+
reasoningWidgetTableAlignOptions,
|
|
8809
|
+
reasoningWidgetTableColumnVariantOptions,
|
|
8810
|
+
reasoningWidgetToneOptions,
|
|
8811
|
+
reasoningWidgetVariantOptions,
|
|
7220
8812
|
renderTextContent,
|
|
7221
8813
|
resolveSurfaceToken,
|
|
7222
8814
|
resolveTextStyle,
|