@dilipod/ui 0.4.2 → 0.4.4
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/components/button.d.ts +4 -0
- package/dist/components/button.d.ts.map +1 -1
- package/dist/components/impact-metrics-form.d.ts +26 -0
- package/dist/components/impact-metrics-form.d.ts.map +1 -0
- package/dist/components/scenarios-manager.d.ts +4 -1
- package/dist/components/scenarios-manager.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +485 -196
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +480 -192
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -2
- package/src/__tests__/button.test.tsx +171 -0
- package/src/__tests__/scenarios-manager.test.tsx +260 -0
- package/src/__tests__/setup.ts +31 -0
- package/src/components/button.tsx +50 -25
- package/src/components/impact-metrics-form.tsx +314 -0
- package/src/components/scenarios-manager.tsx +83 -26
- package/src/index.ts +4 -0
package/dist/index.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import * as
|
|
2
|
+
import * as React50 from 'react';
|
|
3
3
|
import { useState, useRef } from 'react';
|
|
4
|
-
import { Slot, createSlot } from '@radix-ui/react-slot';
|
|
4
|
+
import { Slot, Slottable, createSlot } from '@radix-ui/react-slot';
|
|
5
5
|
import { cva } from 'class-variance-authority';
|
|
6
6
|
import { clsx } from 'clsx';
|
|
7
7
|
import { twMerge } from 'tailwind-merge';
|
|
8
8
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
9
9
|
import * as SheetPrimitive from '@radix-ui/react-dialog';
|
|
10
10
|
import * as react_star from '@phosphor-icons/react';
|
|
11
|
-
import { X, CaretDown, Circle, CaretLeft, DotsThree, CaretRight, Check, House, Info, WarningCircle, Play, Download, Folder, ArrowSquareOut, CircleNotch, File, FileVideo, Lightning, Plus, FileImage, FilePdf, FileDoc, Question,
|
|
11
|
+
import { X, CaretDown, Circle, CaretLeft, DotsThree, CaretRight, Check, House, Info, WarningCircle, Play, Download, Folder, ArrowSquareOut, CircleNotch, File, FileVideo, Lightning, Plus, CheckCircle, FileImage, FilePdf, FileDoc, Question, Warning, PencilSimple, Trash } from '@phosphor-icons/react';
|
|
12
12
|
import 'react-dom';
|
|
13
13
|
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
14
14
|
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
@@ -108,6 +108,7 @@ __export(index_exports, {
|
|
|
108
108
|
FilePreview: () => FilePreview,
|
|
109
109
|
FormField: () => FormField,
|
|
110
110
|
IconBox: () => IconBox,
|
|
111
|
+
ImpactMetricsForm: () => ImpactMetricsForm,
|
|
111
112
|
Input: () => Input,
|
|
112
113
|
Label: () => Label2,
|
|
113
114
|
LabeledSwitch: () => LabeledSwitch,
|
|
@@ -219,7 +220,7 @@ var buttonVariants = cva(
|
|
|
219
220
|
variants: {
|
|
220
221
|
variant: {
|
|
221
222
|
default: "bg-[var(--black)] text-white border-2 border-[var(--black)] hover:bg-gray-800 hover:border-gray-800 active:scale-95",
|
|
222
|
-
primary: "bg-[var(--cyan)] text-
|
|
223
|
+
primary: "bg-[var(--cyan)] text-white border-2 border-[var(--cyan)] hover:bg-[var(--cyan-dark)] hover:border-[var(--cyan-dark)] active:scale-95",
|
|
223
224
|
destructive: "bg-red-600 text-white border-2 border-red-600 hover:bg-red-700 hover:border-red-700 active:scale-95",
|
|
224
225
|
outline: "border-2 border-gray-300 bg-transparent hover:bg-gray-100 active:scale-95",
|
|
225
226
|
secondary: "bg-gray-100 text-[var(--black)] border-2 border-gray-100 hover:bg-gray-200 hover:border-gray-200 active:scale-95",
|
|
@@ -239,10 +240,56 @@ var buttonVariants = cva(
|
|
|
239
240
|
}
|
|
240
241
|
}
|
|
241
242
|
);
|
|
242
|
-
var Button =
|
|
243
|
-
({ className, variant, size, asChild = false, loading, loadingText, children, disabled, ...props }, ref) => {
|
|
243
|
+
var Button = React50.forwardRef(
|
|
244
|
+
({ className, variant, size, asChild = false, loading, loadingText, icon, iconAfter, children, disabled, ...props }, ref) => {
|
|
244
245
|
const Comp = asChild ? Slot : "button";
|
|
245
246
|
const isDisabled = disabled || loading;
|
|
247
|
+
const LoadingSpinner = /* @__PURE__ */ jsxs(
|
|
248
|
+
"svg",
|
|
249
|
+
{
|
|
250
|
+
className: "animate-spin h-4 w-4",
|
|
251
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
252
|
+
fill: "none",
|
|
253
|
+
viewBox: "0 0 24 24",
|
|
254
|
+
children: [
|
|
255
|
+
/* @__PURE__ */ jsx(
|
|
256
|
+
"circle",
|
|
257
|
+
{
|
|
258
|
+
className: "opacity-25",
|
|
259
|
+
cx: "12",
|
|
260
|
+
cy: "12",
|
|
261
|
+
r: "10",
|
|
262
|
+
stroke: "currentColor",
|
|
263
|
+
strokeWidth: "4"
|
|
264
|
+
}
|
|
265
|
+
),
|
|
266
|
+
/* @__PURE__ */ jsx(
|
|
267
|
+
"path",
|
|
268
|
+
{
|
|
269
|
+
className: "opacity-75",
|
|
270
|
+
fill: "currentColor",
|
|
271
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
272
|
+
}
|
|
273
|
+
)
|
|
274
|
+
]
|
|
275
|
+
}
|
|
276
|
+
);
|
|
277
|
+
if (asChild && (icon || iconAfter || loading)) {
|
|
278
|
+
return /* @__PURE__ */ jsxs(
|
|
279
|
+
Slot,
|
|
280
|
+
{
|
|
281
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
282
|
+
ref,
|
|
283
|
+
...props,
|
|
284
|
+
children: [
|
|
285
|
+
loading && LoadingSpinner,
|
|
286
|
+
!loading && icon,
|
|
287
|
+
/* @__PURE__ */ jsx(Slottable, { children }),
|
|
288
|
+
!loading && iconAfter
|
|
289
|
+
]
|
|
290
|
+
}
|
|
291
|
+
);
|
|
292
|
+
}
|
|
246
293
|
return /* @__PURE__ */ jsxs(
|
|
247
294
|
Comp,
|
|
248
295
|
{
|
|
@@ -251,37 +298,10 @@ var Button = React28.forwardRef(
|
|
|
251
298
|
disabled: isDisabled,
|
|
252
299
|
...props,
|
|
253
300
|
children: [
|
|
254
|
-
loading &&
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
259
|
-
fill: "none",
|
|
260
|
-
viewBox: "0 0 24 24",
|
|
261
|
-
children: [
|
|
262
|
-
/* @__PURE__ */ jsx(
|
|
263
|
-
"circle",
|
|
264
|
-
{
|
|
265
|
-
className: "opacity-25",
|
|
266
|
-
cx: "12",
|
|
267
|
-
cy: "12",
|
|
268
|
-
r: "10",
|
|
269
|
-
stroke: "currentColor",
|
|
270
|
-
strokeWidth: "4"
|
|
271
|
-
}
|
|
272
|
-
),
|
|
273
|
-
/* @__PURE__ */ jsx(
|
|
274
|
-
"path",
|
|
275
|
-
{
|
|
276
|
-
className: "opacity-75",
|
|
277
|
-
fill: "currentColor",
|
|
278
|
-
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
279
|
-
}
|
|
280
|
-
)
|
|
281
|
-
]
|
|
282
|
-
}
|
|
283
|
-
),
|
|
284
|
-
loading ? loadingText || children : children
|
|
301
|
+
loading && LoadingSpinner,
|
|
302
|
+
!loading && icon,
|
|
303
|
+
loading ? loadingText || children : children,
|
|
304
|
+
!loading && iconAfter
|
|
285
305
|
]
|
|
286
306
|
}
|
|
287
307
|
);
|
|
@@ -292,7 +312,7 @@ var Sheet = SheetPrimitive.Root;
|
|
|
292
312
|
var SheetTrigger = SheetPrimitive.Trigger;
|
|
293
313
|
var SheetClose = SheetPrimitive.Close;
|
|
294
314
|
var SheetPortal = SheetPrimitive.Portal;
|
|
295
|
-
var SheetOverlay =
|
|
315
|
+
var SheetOverlay = React50.forwardRef(({ className, ...props }, ref) => (
|
|
296
316
|
// @ts-ignore - Radix Dialog Overlay accepts className at runtime
|
|
297
317
|
/* @__PURE__ */ jsx(
|
|
298
318
|
SheetPrimitive.Overlay,
|
|
@@ -323,7 +343,7 @@ var sheetVariants = cva(
|
|
|
323
343
|
}
|
|
324
344
|
}
|
|
325
345
|
);
|
|
326
|
-
var SheetContent =
|
|
346
|
+
var SheetContent = React50.forwardRef(({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */ jsxs(SheetPortal, { children: [
|
|
327
347
|
/* @__PURE__ */ jsx(SheetOverlay, {}),
|
|
328
348
|
/* @__PURE__ */ jsxs(
|
|
329
349
|
SheetPrimitive.Content,
|
|
@@ -370,7 +390,7 @@ var SheetFooter = ({
|
|
|
370
390
|
}
|
|
371
391
|
);
|
|
372
392
|
SheetFooter.displayName = "SheetFooter";
|
|
373
|
-
var SheetTitle =
|
|
393
|
+
var SheetTitle = React50.forwardRef(({ className, ...props }, ref) => (
|
|
374
394
|
// @ts-ignore - Radix Dialog Title accepts className at runtime
|
|
375
395
|
/* @__PURE__ */ jsx(
|
|
376
396
|
SheetPrimitive.Title,
|
|
@@ -382,7 +402,7 @@ var SheetTitle = React28.forwardRef(({ className, ...props }, ref) => (
|
|
|
382
402
|
)
|
|
383
403
|
));
|
|
384
404
|
SheetTitle.displayName = SheetPrimitive.Title.displayName;
|
|
385
|
-
var SheetDescription =
|
|
405
|
+
var SheetDescription = React50.forwardRef(({ className, ...props }, ref) => (
|
|
386
406
|
// @ts-ignore - Radix Dialog Description accepts className at runtime
|
|
387
407
|
/* @__PURE__ */ jsx(
|
|
388
408
|
SheetPrimitive.Description,
|
|
@@ -482,7 +502,7 @@ var badgeVariants = cva(
|
|
|
482
502
|
}
|
|
483
503
|
}
|
|
484
504
|
);
|
|
485
|
-
var Badge =
|
|
505
|
+
var Badge = React50.forwardRef(
|
|
486
506
|
({ className, variant, size, pulse, pulseColor: pulseColorProp, children, ...props }, ref) => {
|
|
487
507
|
const getPulseColorClass = () => {
|
|
488
508
|
const color = pulseColorProp || variant || "default";
|
|
@@ -536,7 +556,7 @@ var Badge = React28.forwardRef(
|
|
|
536
556
|
}
|
|
537
557
|
);
|
|
538
558
|
Badge.displayName = "Badge";
|
|
539
|
-
var Card =
|
|
559
|
+
var Card = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
540
560
|
"div",
|
|
541
561
|
{
|
|
542
562
|
ref,
|
|
@@ -548,7 +568,7 @@ var Card = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
548
568
|
}
|
|
549
569
|
));
|
|
550
570
|
Card.displayName = "Card";
|
|
551
|
-
var CardHeader =
|
|
571
|
+
var CardHeader = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
552
572
|
"div",
|
|
553
573
|
{
|
|
554
574
|
ref,
|
|
@@ -557,7 +577,7 @@ var CardHeader = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
557
577
|
}
|
|
558
578
|
));
|
|
559
579
|
CardHeader.displayName = "CardHeader";
|
|
560
|
-
var CardTitle =
|
|
580
|
+
var CardTitle = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
561
581
|
"h3",
|
|
562
582
|
{
|
|
563
583
|
ref,
|
|
@@ -569,7 +589,7 @@ var CardTitle = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
569
589
|
}
|
|
570
590
|
));
|
|
571
591
|
CardTitle.displayName = "CardTitle";
|
|
572
|
-
var CardDescription =
|
|
592
|
+
var CardDescription = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
573
593
|
"p",
|
|
574
594
|
{
|
|
575
595
|
ref,
|
|
@@ -578,9 +598,9 @@ var CardDescription = React28.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
578
598
|
}
|
|
579
599
|
));
|
|
580
600
|
CardDescription.displayName = "CardDescription";
|
|
581
|
-
var CardContent =
|
|
601
|
+
var CardContent = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("p-6 pt-0", className), ...props }));
|
|
582
602
|
CardContent.displayName = "CardContent";
|
|
583
|
-
var CardFooter =
|
|
603
|
+
var CardFooter = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
584
604
|
"div",
|
|
585
605
|
{
|
|
586
606
|
ref,
|
|
@@ -603,7 +623,7 @@ var progressVariants = cva("h-full rounded-full transition-all duration-300", {
|
|
|
603
623
|
variant: "default"
|
|
604
624
|
}
|
|
605
625
|
});
|
|
606
|
-
var Progress =
|
|
626
|
+
var Progress = React50.forwardRef(
|
|
607
627
|
({ className, value, variant, showLabel, label = "Progress", size = "default", ...props }, ref) => {
|
|
608
628
|
const clampedValue = Math.min(100, Math.max(0, value));
|
|
609
629
|
const heightClass = {
|
|
@@ -670,7 +690,7 @@ var iconBoxVariants = cva(
|
|
|
670
690
|
}
|
|
671
691
|
}
|
|
672
692
|
);
|
|
673
|
-
var IconBox =
|
|
693
|
+
var IconBox = React50.forwardRef(
|
|
674
694
|
({ className, variant, size, rounded, children, ...props }, ref) => {
|
|
675
695
|
return /* @__PURE__ */ jsx(
|
|
676
696
|
"div",
|
|
@@ -706,7 +726,7 @@ var tagVariants = cva(
|
|
|
706
726
|
}
|
|
707
727
|
}
|
|
708
728
|
);
|
|
709
|
-
var Tag =
|
|
729
|
+
var Tag = React50.forwardRef(
|
|
710
730
|
({ className, variant, size, icon, children, ...props }, ref) => {
|
|
711
731
|
return /* @__PURE__ */ jsxs(
|
|
712
732
|
"span",
|
|
@@ -760,7 +780,7 @@ var valueVariants = cva("font-bold", {
|
|
|
760
780
|
color: "default"
|
|
761
781
|
}
|
|
762
782
|
});
|
|
763
|
-
var Stat =
|
|
783
|
+
var Stat = React50.forwardRef(
|
|
764
784
|
({
|
|
765
785
|
className,
|
|
766
786
|
variant,
|
|
@@ -842,7 +862,7 @@ var iconVariants = cva("h-5 w-5", {
|
|
|
842
862
|
color: "cyan"
|
|
843
863
|
}
|
|
844
864
|
});
|
|
845
|
-
var MetricCard =
|
|
865
|
+
var MetricCard = React50.forwardRef(
|
|
846
866
|
({
|
|
847
867
|
className,
|
|
848
868
|
variant,
|
|
@@ -875,7 +895,7 @@ var MetricCard = React28.forwardRef(
|
|
|
875
895
|
}
|
|
876
896
|
);
|
|
877
897
|
MetricCard.displayName = "MetricCard";
|
|
878
|
-
var MetricLabel =
|
|
898
|
+
var MetricLabel = React50.forwardRef(
|
|
879
899
|
({ className, children, ...props }, ref) => {
|
|
880
900
|
return /* @__PURE__ */ jsx(
|
|
881
901
|
"p",
|
|
@@ -892,7 +912,7 @@ var MetricLabel = React28.forwardRef(
|
|
|
892
912
|
}
|
|
893
913
|
);
|
|
894
914
|
MetricLabel.displayName = "MetricLabel";
|
|
895
|
-
var MetricValue =
|
|
915
|
+
var MetricValue = React50.forwardRef(
|
|
896
916
|
({ className, children, size = "default", highlight = false, ...props }, ref) => {
|
|
897
917
|
return /* @__PURE__ */ jsx(
|
|
898
918
|
"p",
|
|
@@ -913,7 +933,7 @@ var MetricValue = React28.forwardRef(
|
|
|
913
933
|
}
|
|
914
934
|
);
|
|
915
935
|
MetricValue.displayName = "MetricValue";
|
|
916
|
-
var MetricSubtext =
|
|
936
|
+
var MetricSubtext = React50.forwardRef(
|
|
917
937
|
({ className, children, ...props }, ref) => {
|
|
918
938
|
return /* @__PURE__ */ jsx(
|
|
919
939
|
"p",
|
|
@@ -930,7 +950,7 @@ var MetricSubtext = React28.forwardRef(
|
|
|
930
950
|
}
|
|
931
951
|
);
|
|
932
952
|
MetricSubtext.displayName = "MetricSubtext";
|
|
933
|
-
var Metric =
|
|
953
|
+
var Metric = React50.forwardRef(
|
|
934
954
|
({ className, children, ...props }, ref) => {
|
|
935
955
|
return /* @__PURE__ */ jsx(
|
|
936
956
|
"div",
|
|
@@ -970,7 +990,7 @@ var progressColorVariants = cva("", {
|
|
|
970
990
|
color: "cyan"
|
|
971
991
|
}
|
|
972
992
|
});
|
|
973
|
-
var UsageBar =
|
|
993
|
+
var UsageBar = React50.forwardRef(
|
|
974
994
|
({
|
|
975
995
|
className,
|
|
976
996
|
size,
|
|
@@ -1042,7 +1062,7 @@ var UsageBar = React28.forwardRef(
|
|
|
1042
1062
|
}
|
|
1043
1063
|
);
|
|
1044
1064
|
UsageBar.displayName = "UsageBar";
|
|
1045
|
-
var UsageChart =
|
|
1065
|
+
var UsageChart = React50.forwardRef(
|
|
1046
1066
|
({
|
|
1047
1067
|
className,
|
|
1048
1068
|
data,
|
|
@@ -1053,8 +1073,8 @@ var UsageChart = React28.forwardRef(
|
|
|
1053
1073
|
formatValue = (v) => v.toLocaleString(),
|
|
1054
1074
|
...props
|
|
1055
1075
|
}, ref) => {
|
|
1056
|
-
const [hoveredIndex, setHoveredIndex] =
|
|
1057
|
-
const maxValue =
|
|
1076
|
+
const [hoveredIndex, setHoveredIndex] = React50.useState(null);
|
|
1077
|
+
const maxValue = React50.useMemo(() => {
|
|
1058
1078
|
return Math.max(
|
|
1059
1079
|
...data.map((d) => d.value + (d.secondaryValue || 0)),
|
|
1060
1080
|
1
|
|
@@ -1181,7 +1201,7 @@ var UsageChart = React28.forwardRef(
|
|
|
1181
1201
|
}
|
|
1182
1202
|
);
|
|
1183
1203
|
UsageChart.displayName = "UsageChart";
|
|
1184
|
-
var Input =
|
|
1204
|
+
var Input = React50.forwardRef(
|
|
1185
1205
|
({ className, type, error, ...props }, ref) => {
|
|
1186
1206
|
return /* @__PURE__ */ jsx(
|
|
1187
1207
|
"input",
|
|
@@ -1221,7 +1241,7 @@ var NODES = [
|
|
|
1221
1241
|
];
|
|
1222
1242
|
var Primitive = NODES.reduce((primitive, node) => {
|
|
1223
1243
|
const Slot2 = createSlot(`Primitive.${node}`);
|
|
1224
|
-
const Node =
|
|
1244
|
+
const Node = React50.forwardRef((props, forwardedRef) => {
|
|
1225
1245
|
const { asChild, ...primitiveProps } = props;
|
|
1226
1246
|
const Comp = asChild ? Slot2 : node;
|
|
1227
1247
|
if (typeof window !== "undefined") {
|
|
@@ -1233,7 +1253,7 @@ var Primitive = NODES.reduce((primitive, node) => {
|
|
|
1233
1253
|
return { ...primitive, [node]: Node };
|
|
1234
1254
|
}, {});
|
|
1235
1255
|
var NAME = "Label";
|
|
1236
|
-
var Label =
|
|
1256
|
+
var Label = React50.forwardRef((props, forwardedRef) => {
|
|
1237
1257
|
return /* @__PURE__ */ jsx(
|
|
1238
1258
|
Primitive.label,
|
|
1239
1259
|
{
|
|
@@ -1253,7 +1273,7 @@ var Root2 = Label;
|
|
|
1253
1273
|
var labelVariants = cva(
|
|
1254
1274
|
"text-sm font-medium leading-none text-[var(--black)] peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
1255
1275
|
);
|
|
1256
|
-
var Label2 =
|
|
1276
|
+
var Label2 = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1257
1277
|
Root2,
|
|
1258
1278
|
{
|
|
1259
1279
|
ref,
|
|
@@ -1262,7 +1282,7 @@ var Label2 = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
1262
1282
|
}
|
|
1263
1283
|
));
|
|
1264
1284
|
Label2.displayName = Root2.displayName;
|
|
1265
|
-
var Textarea =
|
|
1285
|
+
var Textarea = React50.forwardRef(
|
|
1266
1286
|
({ className, error, ...props }, ref) => {
|
|
1267
1287
|
return /* @__PURE__ */ jsx(
|
|
1268
1288
|
"textarea",
|
|
@@ -1280,7 +1300,7 @@ var Textarea = React28.forwardRef(
|
|
|
1280
1300
|
}
|
|
1281
1301
|
);
|
|
1282
1302
|
Textarea.displayName = "Textarea";
|
|
1283
|
-
var Select =
|
|
1303
|
+
var Select = React50.forwardRef(
|
|
1284
1304
|
({ className, error, children, ...props }, ref) => {
|
|
1285
1305
|
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
1286
1306
|
/* @__PURE__ */ jsx(
|
|
@@ -1316,7 +1336,7 @@ Select.displayName = "Select";
|
|
|
1316
1336
|
// src/icons.ts
|
|
1317
1337
|
var icons_exports = {};
|
|
1318
1338
|
__reExport(icons_exports, react_star);
|
|
1319
|
-
var Checkbox =
|
|
1339
|
+
var Checkbox = React50.forwardRef(
|
|
1320
1340
|
({ className, checked, onCheckedChange, ...props }, ref) => {
|
|
1321
1341
|
return /* @__PURE__ */ jsxs("label", { className: "relative inline-flex items-center cursor-pointer", children: [
|
|
1322
1342
|
/* @__PURE__ */ jsx(
|
|
@@ -1347,7 +1367,7 @@ var Checkbox = React28.forwardRef(
|
|
|
1347
1367
|
}
|
|
1348
1368
|
);
|
|
1349
1369
|
Checkbox.displayName = "Checkbox";
|
|
1350
|
-
var Switch =
|
|
1370
|
+
var Switch = React50.forwardRef(({ className, size = "default", ...props }, ref) => {
|
|
1351
1371
|
const sizeStyles = {
|
|
1352
1372
|
sm: {
|
|
1353
1373
|
root: "h-4 w-7",
|
|
@@ -1385,8 +1405,8 @@ var Switch = React28.forwardRef(({ className, size = "default", ...props }, ref)
|
|
|
1385
1405
|
);
|
|
1386
1406
|
});
|
|
1387
1407
|
Switch.displayName = SwitchPrimitive.Root.displayName;
|
|
1388
|
-
var LabeledSwitch =
|
|
1389
|
-
const switchId = id ||
|
|
1408
|
+
var LabeledSwitch = React50.forwardRef(({ label, description, labelPosition = "right", className, id, ...props }, ref) => {
|
|
1409
|
+
const switchId = id || React50.useId();
|
|
1390
1410
|
const labelContent = /* @__PURE__ */ jsxs("div", { className: "space-y-0.5", children: [
|
|
1391
1411
|
/* @__PURE__ */ jsx(
|
|
1392
1412
|
"label",
|
|
@@ -1414,7 +1434,7 @@ var LabeledSwitch = React28.forwardRef(({ label, description, labelPosition = "r
|
|
|
1414
1434
|
);
|
|
1415
1435
|
});
|
|
1416
1436
|
LabeledSwitch.displayName = "LabeledSwitch";
|
|
1417
|
-
var RadioGroup =
|
|
1437
|
+
var RadioGroup = React50.forwardRef(({ className, ...props }, ref) => {
|
|
1418
1438
|
return /* @__PURE__ */ jsx(
|
|
1419
1439
|
RadioGroupPrimitive.Root,
|
|
1420
1440
|
{
|
|
@@ -1425,7 +1445,7 @@ var RadioGroup = React28.forwardRef(({ className, ...props }, ref) => {
|
|
|
1425
1445
|
);
|
|
1426
1446
|
});
|
|
1427
1447
|
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
|
|
1428
|
-
var RadioGroupItem =
|
|
1448
|
+
var RadioGroupItem = React50.forwardRef(({ className, ...props }, ref) => {
|
|
1429
1449
|
return /* @__PURE__ */ jsx(
|
|
1430
1450
|
RadioGroupPrimitive.Item,
|
|
1431
1451
|
{
|
|
@@ -1440,8 +1460,8 @@ var RadioGroupItem = React28.forwardRef(({ className, ...props }, ref) => {
|
|
|
1440
1460
|
);
|
|
1441
1461
|
});
|
|
1442
1462
|
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
1443
|
-
var RadioGroupOption =
|
|
1444
|
-
const optionId = id ||
|
|
1463
|
+
var RadioGroupOption = React50.forwardRef(({ label, description, className, id, ...props }, ref) => {
|
|
1464
|
+
const optionId = id || React50.useId();
|
|
1445
1465
|
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-start gap-3", className), children: [
|
|
1446
1466
|
/* @__PURE__ */ jsx(RadioGroupItem, { ref, id: optionId, ...props }),
|
|
1447
1467
|
/* @__PURE__ */ jsxs("div", { className: "space-y-0.5", children: [
|
|
@@ -1458,8 +1478,8 @@ var RadioGroupOption = React28.forwardRef(({ label, description, className, id,
|
|
|
1458
1478
|
] });
|
|
1459
1479
|
});
|
|
1460
1480
|
RadioGroupOption.displayName = "RadioGroupOption";
|
|
1461
|
-
var RadioGroupCard =
|
|
1462
|
-
const cardId = id ||
|
|
1481
|
+
var RadioGroupCard = React50.forwardRef(({ label, description, children, className, id, ...props }, ref) => {
|
|
1482
|
+
const cardId = id || React50.useId();
|
|
1463
1483
|
return /* @__PURE__ */ jsx(
|
|
1464
1484
|
RadioGroupPrimitive.Item,
|
|
1465
1485
|
{
|
|
@@ -1490,7 +1510,7 @@ var RadioGroupCard = React28.forwardRef(({ label, description, children, classNa
|
|
|
1490
1510
|
});
|
|
1491
1511
|
RadioGroupCard.displayName = "RadioGroupCard";
|
|
1492
1512
|
var Accordion = AccordionPrimitive.Root;
|
|
1493
|
-
var AccordionItem =
|
|
1513
|
+
var AccordionItem = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1494
1514
|
AccordionPrimitive.Item,
|
|
1495
1515
|
{
|
|
1496
1516
|
ref,
|
|
@@ -1499,7 +1519,7 @@ var AccordionItem = React28.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
1499
1519
|
}
|
|
1500
1520
|
));
|
|
1501
1521
|
AccordionItem.displayName = "AccordionItem";
|
|
1502
|
-
var AccordionTrigger =
|
|
1522
|
+
var AccordionTrigger = React50.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ jsxs(
|
|
1503
1523
|
AccordionPrimitive.Trigger,
|
|
1504
1524
|
{
|
|
1505
1525
|
ref,
|
|
@@ -1515,7 +1535,7 @@ var AccordionTrigger = React28.forwardRef(({ className, children, ...props }, re
|
|
|
1515
1535
|
}
|
|
1516
1536
|
) }));
|
|
1517
1537
|
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
|
1518
|
-
var AccordionContent =
|
|
1538
|
+
var AccordionContent = React50.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1519
1539
|
AccordionPrimitive.Content,
|
|
1520
1540
|
{
|
|
1521
1541
|
ref,
|
|
@@ -1546,7 +1566,7 @@ var NODES2 = [
|
|
|
1546
1566
|
];
|
|
1547
1567
|
var Primitive2 = NODES2.reduce((primitive, node) => {
|
|
1548
1568
|
const Slot2 = createSlot(`Primitive.${node}`);
|
|
1549
|
-
const Node =
|
|
1569
|
+
const Node = React50.forwardRef((props, forwardedRef) => {
|
|
1550
1570
|
const { asChild, ...primitiveProps } = props;
|
|
1551
1571
|
const Comp = asChild ? Slot2 : node;
|
|
1552
1572
|
if (typeof window !== "undefined") {
|
|
@@ -1560,7 +1580,7 @@ var Primitive2 = NODES2.reduce((primitive, node) => {
|
|
|
1560
1580
|
var NAME2 = "Separator";
|
|
1561
1581
|
var DEFAULT_ORIENTATION = "horizontal";
|
|
1562
1582
|
var ORIENTATIONS = ["horizontal", "vertical"];
|
|
1563
|
-
var Separator =
|
|
1583
|
+
var Separator = React50.forwardRef((props, forwardedRef) => {
|
|
1564
1584
|
const { decorative, orientation: orientationProp = DEFAULT_ORIENTATION, ...domProps } = props;
|
|
1565
1585
|
const orientation = isValidOrientation(orientationProp) ? orientationProp : DEFAULT_ORIENTATION;
|
|
1566
1586
|
const ariaOrientation = orientation === "vertical" ? orientation : void 0;
|
|
@@ -1580,7 +1600,7 @@ function isValidOrientation(orientation) {
|
|
|
1580
1600
|
return ORIENTATIONS.includes(orientation);
|
|
1581
1601
|
}
|
|
1582
1602
|
var Root6 = Separator;
|
|
1583
|
-
var Separator2 =
|
|
1603
|
+
var Separator2 = React50.forwardRef(
|
|
1584
1604
|
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1585
1605
|
Root6,
|
|
1586
1606
|
{
|
|
@@ -1597,7 +1617,7 @@ var Separator2 = React28.forwardRef(
|
|
|
1597
1617
|
)
|
|
1598
1618
|
);
|
|
1599
1619
|
Separator2.displayName = Root6.displayName;
|
|
1600
|
-
var NavigationMenu =
|
|
1620
|
+
var NavigationMenu = React50.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
1601
1621
|
NavigationMenuPrimitive.Root,
|
|
1602
1622
|
{
|
|
1603
1623
|
ref,
|
|
@@ -1613,7 +1633,7 @@ var NavigationMenu = React28.forwardRef(({ className, children, ...props }, ref)
|
|
|
1613
1633
|
}
|
|
1614
1634
|
));
|
|
1615
1635
|
NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;
|
|
1616
|
-
var NavigationMenuList =
|
|
1636
|
+
var NavigationMenuList = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1617
1637
|
NavigationMenuPrimitive.List,
|
|
1618
1638
|
{
|
|
1619
1639
|
ref,
|
|
@@ -1629,7 +1649,7 @@ var NavigationMenuItem = NavigationMenuPrimitive.Item;
|
|
|
1629
1649
|
var navigationMenuTriggerStyle = cva(
|
|
1630
1650
|
"group inline-flex h-10 w-max items-center justify-center rounded-md bg-white px-4 py-2 text-sm font-medium text-[var(--black)] transition-colors hover:bg-gray-100 hover:text-[var(--black)] focus:bg-gray-100 focus:text-[var(--black)] focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:text-[var(--black)] data-[state=open]:bg-gray-100/50 data-[state=open]:hover:bg-gray-100 data-[state=open]:focus:bg-gray-100"
|
|
1631
1651
|
);
|
|
1632
|
-
var NavigationMenuTrigger =
|
|
1652
|
+
var NavigationMenuTrigger = React50.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
1633
1653
|
NavigationMenuPrimitive.Trigger,
|
|
1634
1654
|
{
|
|
1635
1655
|
ref,
|
|
@@ -1649,7 +1669,7 @@ var NavigationMenuTrigger = React28.forwardRef(({ className, children, ...props
|
|
|
1649
1669
|
}
|
|
1650
1670
|
));
|
|
1651
1671
|
NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;
|
|
1652
|
-
var NavigationMenuContent =
|
|
1672
|
+
var NavigationMenuContent = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1653
1673
|
NavigationMenuPrimitive.Content,
|
|
1654
1674
|
{
|
|
1655
1675
|
ref,
|
|
@@ -1662,7 +1682,7 @@ var NavigationMenuContent = React28.forwardRef(({ className, ...props }, ref) =>
|
|
|
1662
1682
|
));
|
|
1663
1683
|
NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;
|
|
1664
1684
|
var NavigationMenuLink = NavigationMenuPrimitive.Link;
|
|
1665
|
-
var NavigationMenuViewport =
|
|
1685
|
+
var NavigationMenuViewport = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: cn("absolute left-0 top-full flex justify-center"), children: /* @__PURE__ */ jsx(
|
|
1666
1686
|
NavigationMenuPrimitive.Viewport,
|
|
1667
1687
|
{
|
|
1668
1688
|
className: cn(
|
|
@@ -1674,7 +1694,7 @@ var NavigationMenuViewport = React28.forwardRef(({ className, ...props }, ref) =
|
|
|
1674
1694
|
}
|
|
1675
1695
|
) }));
|
|
1676
1696
|
NavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;
|
|
1677
|
-
var NavigationMenuIndicator =
|
|
1697
|
+
var NavigationMenuIndicator = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1678
1698
|
NavigationMenuPrimitive.Indicator,
|
|
1679
1699
|
{
|
|
1680
1700
|
ref,
|
|
@@ -1687,7 +1707,7 @@ var NavigationMenuIndicator = React28.forwardRef(({ className, ...props }, ref)
|
|
|
1687
1707
|
}
|
|
1688
1708
|
));
|
|
1689
1709
|
NavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;
|
|
1690
|
-
var Avatar =
|
|
1710
|
+
var Avatar = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1691
1711
|
AvatarPrimitive.Root,
|
|
1692
1712
|
{
|
|
1693
1713
|
ref,
|
|
@@ -1699,7 +1719,7 @@ var Avatar = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
1699
1719
|
}
|
|
1700
1720
|
));
|
|
1701
1721
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
1702
|
-
var AvatarImage =
|
|
1722
|
+
var AvatarImage = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1703
1723
|
AvatarPrimitive.Image,
|
|
1704
1724
|
{
|
|
1705
1725
|
ref,
|
|
@@ -1708,7 +1728,7 @@ var AvatarImage = React28.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
1708
1728
|
}
|
|
1709
1729
|
));
|
|
1710
1730
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
1711
|
-
var AvatarFallback =
|
|
1731
|
+
var AvatarFallback = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1712
1732
|
AvatarPrimitive.Fallback,
|
|
1713
1733
|
{
|
|
1714
1734
|
ref,
|
|
@@ -1726,7 +1746,7 @@ var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
|
1726
1746
|
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
1727
1747
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
1728
1748
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
1729
|
-
var DropdownMenuSubTrigger =
|
|
1749
|
+
var DropdownMenuSubTrigger = React50.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
1730
1750
|
DropdownMenuPrimitive.SubTrigger,
|
|
1731
1751
|
{
|
|
1732
1752
|
ref,
|
|
@@ -1743,7 +1763,7 @@ var DropdownMenuSubTrigger = React28.forwardRef(({ className, inset, children, .
|
|
|
1743
1763
|
}
|
|
1744
1764
|
));
|
|
1745
1765
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
1746
|
-
var DropdownMenuSubContent =
|
|
1766
|
+
var DropdownMenuSubContent = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1747
1767
|
DropdownMenuPrimitive.SubContent,
|
|
1748
1768
|
{
|
|
1749
1769
|
ref,
|
|
@@ -1755,7 +1775,7 @@ var DropdownMenuSubContent = React28.forwardRef(({ className, ...props }, ref) =
|
|
|
1755
1775
|
}
|
|
1756
1776
|
));
|
|
1757
1777
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
1758
|
-
var DropdownMenuContent =
|
|
1778
|
+
var DropdownMenuContent = React50.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
1759
1779
|
DropdownMenuPrimitive.Content,
|
|
1760
1780
|
{
|
|
1761
1781
|
ref,
|
|
@@ -1768,7 +1788,7 @@ var DropdownMenuContent = React28.forwardRef(({ className, sideOffset = 4, ...pr
|
|
|
1768
1788
|
}
|
|
1769
1789
|
) }));
|
|
1770
1790
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
1771
|
-
var DropdownMenuItem =
|
|
1791
|
+
var DropdownMenuItem = React50.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1772
1792
|
DropdownMenuPrimitive.Item,
|
|
1773
1793
|
{
|
|
1774
1794
|
ref,
|
|
@@ -1781,7 +1801,7 @@ var DropdownMenuItem = React28.forwardRef(({ className, inset, ...props }, ref)
|
|
|
1781
1801
|
}
|
|
1782
1802
|
));
|
|
1783
1803
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
1784
|
-
var DropdownMenuCheckboxItem =
|
|
1804
|
+
var DropdownMenuCheckboxItem = React50.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
1785
1805
|
DropdownMenuPrimitive.CheckboxItem,
|
|
1786
1806
|
{
|
|
1787
1807
|
ref,
|
|
@@ -1798,7 +1818,7 @@ var DropdownMenuCheckboxItem = React28.forwardRef(({ className, children, checke
|
|
|
1798
1818
|
}
|
|
1799
1819
|
));
|
|
1800
1820
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
1801
|
-
var DropdownMenuRadioItem =
|
|
1821
|
+
var DropdownMenuRadioItem = React50.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
1802
1822
|
DropdownMenuPrimitive.RadioItem,
|
|
1803
1823
|
{
|
|
1804
1824
|
ref,
|
|
@@ -1814,7 +1834,7 @@ var DropdownMenuRadioItem = React28.forwardRef(({ className, children, ...props
|
|
|
1814
1834
|
}
|
|
1815
1835
|
));
|
|
1816
1836
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
1817
|
-
var DropdownMenuLabel =
|
|
1837
|
+
var DropdownMenuLabel = React50.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1818
1838
|
DropdownMenuPrimitive.Label,
|
|
1819
1839
|
{
|
|
1820
1840
|
ref,
|
|
@@ -1827,7 +1847,7 @@ var DropdownMenuLabel = React28.forwardRef(({ className, inset, ...props }, ref)
|
|
|
1827
1847
|
}
|
|
1828
1848
|
));
|
|
1829
1849
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
1830
|
-
var DropdownMenuSeparator =
|
|
1850
|
+
var DropdownMenuSeparator = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1831
1851
|
DropdownMenuPrimitive.Separator,
|
|
1832
1852
|
{
|
|
1833
1853
|
ref,
|
|
@@ -1849,7 +1869,7 @@ var DropdownMenuShortcut = ({
|
|
|
1849
1869
|
);
|
|
1850
1870
|
};
|
|
1851
1871
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
1852
|
-
var SidebarNavItem =
|
|
1872
|
+
var SidebarNavItem = React50.forwardRef(
|
|
1853
1873
|
({ item, isActive, className, LinkComponent, ...props }, ref) => {
|
|
1854
1874
|
const Icon = item.icon;
|
|
1855
1875
|
const baseClassName = cn(
|
|
@@ -1889,7 +1909,7 @@ var SidebarNavItem = React28.forwardRef(
|
|
|
1889
1909
|
}
|
|
1890
1910
|
);
|
|
1891
1911
|
SidebarNavItem.displayName = "SidebarNavItem";
|
|
1892
|
-
var Sidebar =
|
|
1912
|
+
var Sidebar = React50.forwardRef(
|
|
1893
1913
|
({
|
|
1894
1914
|
mainNav = [],
|
|
1895
1915
|
bottomNav = [],
|
|
@@ -1999,7 +2019,7 @@ var alertVariants = cva(
|
|
|
1999
2019
|
}
|
|
2000
2020
|
}
|
|
2001
2021
|
);
|
|
2002
|
-
var Alert =
|
|
2022
|
+
var Alert = React50.forwardRef(
|
|
2003
2023
|
({ className, variant, icon, title, action, children, ...props }, ref) => {
|
|
2004
2024
|
return /* @__PURE__ */ jsx(
|
|
2005
2025
|
"div",
|
|
@@ -2022,7 +2042,7 @@ var Alert = React28.forwardRef(
|
|
|
2022
2042
|
}
|
|
2023
2043
|
);
|
|
2024
2044
|
Alert.displayName = "Alert";
|
|
2025
|
-
var EmptyState =
|
|
2045
|
+
var EmptyState = React50.forwardRef(
|
|
2026
2046
|
({ className, icon, title, description, action, size = "default", ...props }, ref) => {
|
|
2027
2047
|
const paddingClass = {
|
|
2028
2048
|
sm: "p-8",
|
|
@@ -2050,7 +2070,7 @@ var EmptyState = React28.forwardRef(
|
|
|
2050
2070
|
}
|
|
2051
2071
|
);
|
|
2052
2072
|
EmptyState.displayName = "EmptyState";
|
|
2053
|
-
var ErrorState =
|
|
2073
|
+
var ErrorState = React50.forwardRef(
|
|
2054
2074
|
({
|
|
2055
2075
|
title = "Something went wrong",
|
|
2056
2076
|
description = "We encountered an error loading this page. Please try again.",
|
|
@@ -2113,7 +2133,7 @@ var ErrorState = React28.forwardRef(
|
|
|
2113
2133
|
}
|
|
2114
2134
|
);
|
|
2115
2135
|
ErrorState.displayName = "ErrorState";
|
|
2116
|
-
var CodeBlock =
|
|
2136
|
+
var CodeBlock = React50.forwardRef(
|
|
2117
2137
|
({ className, children, language, ...props }, ref) => {
|
|
2118
2138
|
return /* @__PURE__ */ jsx(
|
|
2119
2139
|
"pre",
|
|
@@ -2131,15 +2151,15 @@ var CodeBlock = React28.forwardRef(
|
|
|
2131
2151
|
}
|
|
2132
2152
|
);
|
|
2133
2153
|
CodeBlock.displayName = "CodeBlock";
|
|
2134
|
-
var FormField =
|
|
2154
|
+
var FormField = React50.forwardRef(
|
|
2135
2155
|
({ label, error, helperText, hint, required, id, className, children, ...props }, ref) => {
|
|
2136
|
-
const fieldId = id ||
|
|
2156
|
+
const fieldId = id || React50.useId();
|
|
2137
2157
|
const errorId = `${fieldId}-error`;
|
|
2138
2158
|
const helperId = `${fieldId}-helper`;
|
|
2139
|
-
const enhancedChildren =
|
|
2140
|
-
if (
|
|
2159
|
+
const enhancedChildren = React50.Children.map(children, (child) => {
|
|
2160
|
+
if (React50.isValidElement(child)) {
|
|
2141
2161
|
const childProps = child.props;
|
|
2142
|
-
return
|
|
2162
|
+
return React50.cloneElement(child, {
|
|
2143
2163
|
id: fieldId,
|
|
2144
2164
|
"aria-invalid": error ? "true" : void 0,
|
|
2145
2165
|
"aria-describedby": error ? errorId : helperText ? helperId : void 0,
|
|
@@ -2163,7 +2183,7 @@ var FormField = React28.forwardRef(
|
|
|
2163
2183
|
}
|
|
2164
2184
|
);
|
|
2165
2185
|
FormField.displayName = "FormField";
|
|
2166
|
-
var Table =
|
|
2186
|
+
var Table = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsx(
|
|
2167
2187
|
"table",
|
|
2168
2188
|
{
|
|
2169
2189
|
ref,
|
|
@@ -2172,11 +2192,11 @@ var Table = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
2172
2192
|
}
|
|
2173
2193
|
) }));
|
|
2174
2194
|
Table.displayName = "Table";
|
|
2175
|
-
var TableHeader =
|
|
2195
|
+
var TableHeader = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("thead", { ref, className: cn("", className), ...props }));
|
|
2176
2196
|
TableHeader.displayName = "TableHeader";
|
|
2177
|
-
var TableBody =
|
|
2197
|
+
var TableBody = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tbody", { ref, className: cn("", className), ...props }));
|
|
2178
2198
|
TableBody.displayName = "TableBody";
|
|
2179
|
-
var TableFooter =
|
|
2199
|
+
var TableFooter = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2180
2200
|
"tfoot",
|
|
2181
2201
|
{
|
|
2182
2202
|
ref,
|
|
@@ -2185,7 +2205,7 @@ var TableFooter = React28.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
2185
2205
|
}
|
|
2186
2206
|
));
|
|
2187
2207
|
TableFooter.displayName = "TableFooter";
|
|
2188
|
-
var TableRow =
|
|
2208
|
+
var TableRow = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2189
2209
|
"tr",
|
|
2190
2210
|
{
|
|
2191
2211
|
ref,
|
|
@@ -2194,7 +2214,7 @@ var TableRow = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
2194
2214
|
}
|
|
2195
2215
|
));
|
|
2196
2216
|
TableRow.displayName = "TableRow";
|
|
2197
|
-
var TableHead =
|
|
2217
|
+
var TableHead = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2198
2218
|
"th",
|
|
2199
2219
|
{
|
|
2200
2220
|
ref,
|
|
@@ -2206,7 +2226,7 @@ var TableHead = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
2206
2226
|
}
|
|
2207
2227
|
));
|
|
2208
2228
|
TableHead.displayName = "TableHead";
|
|
2209
|
-
var TableCell =
|
|
2229
|
+
var TableCell = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2210
2230
|
"td",
|
|
2211
2231
|
{
|
|
2212
2232
|
ref,
|
|
@@ -2215,7 +2235,7 @@ var TableCell = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
2215
2235
|
}
|
|
2216
2236
|
));
|
|
2217
2237
|
TableCell.displayName = "TableCell";
|
|
2218
|
-
var TableCaption =
|
|
2238
|
+
var TableCaption = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2219
2239
|
"caption",
|
|
2220
2240
|
{
|
|
2221
2241
|
ref,
|
|
@@ -2224,7 +2244,7 @@ var TableCaption = React28.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
2224
2244
|
}
|
|
2225
2245
|
));
|
|
2226
2246
|
TableCaption.displayName = "TableCaption";
|
|
2227
|
-
var Divider =
|
|
2247
|
+
var Divider = React50.forwardRef(
|
|
2228
2248
|
({ className, text, orientation = "horizontal", ...props }, ref) => {
|
|
2229
2249
|
if (orientation === "vertical") {
|
|
2230
2250
|
return /* @__PURE__ */ jsx(
|
|
@@ -2263,7 +2283,7 @@ var Divider = React28.forwardRef(
|
|
|
2263
2283
|
);
|
|
2264
2284
|
Divider.displayName = "Divider";
|
|
2265
2285
|
var Tabs = TabsPrimitive.Root;
|
|
2266
|
-
var TabsList =
|
|
2286
|
+
var TabsList = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2267
2287
|
TabsPrimitive.List,
|
|
2268
2288
|
{
|
|
2269
2289
|
ref,
|
|
@@ -2275,7 +2295,7 @@ var TabsList = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
2275
2295
|
}
|
|
2276
2296
|
));
|
|
2277
2297
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
2278
|
-
var TabsTrigger =
|
|
2298
|
+
var TabsTrigger = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2279
2299
|
TabsPrimitive.Trigger,
|
|
2280
2300
|
{
|
|
2281
2301
|
ref,
|
|
@@ -2287,7 +2307,7 @@ var TabsTrigger = React28.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
2287
2307
|
}
|
|
2288
2308
|
));
|
|
2289
2309
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
2290
|
-
var TabsContent =
|
|
2310
|
+
var TabsContent = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2291
2311
|
TabsPrimitive.Content,
|
|
2292
2312
|
{
|
|
2293
2313
|
ref,
|
|
@@ -2299,7 +2319,7 @@ var TabsContent = React28.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
2299
2319
|
}
|
|
2300
2320
|
));
|
|
2301
2321
|
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
2302
|
-
var TabsListUnderline =
|
|
2322
|
+
var TabsListUnderline = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2303
2323
|
TabsPrimitive.List,
|
|
2304
2324
|
{
|
|
2305
2325
|
ref,
|
|
@@ -2311,7 +2331,7 @@ var TabsListUnderline = React28.forwardRef(({ className, ...props }, ref) => /*
|
|
|
2311
2331
|
}
|
|
2312
2332
|
));
|
|
2313
2333
|
TabsListUnderline.displayName = "TabsListUnderline";
|
|
2314
|
-
var TabsTriggerUnderline =
|
|
2334
|
+
var TabsTriggerUnderline = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2315
2335
|
TabsPrimitive.Trigger,
|
|
2316
2336
|
{
|
|
2317
2337
|
ref,
|
|
@@ -2329,7 +2349,7 @@ var Dialog = SheetPrimitive.Root;
|
|
|
2329
2349
|
var DialogTrigger = SheetPrimitive.Trigger;
|
|
2330
2350
|
var DialogPortal = SheetPrimitive.Portal;
|
|
2331
2351
|
var DialogClose = SheetPrimitive.Close;
|
|
2332
|
-
var DialogOverlay =
|
|
2352
|
+
var DialogOverlay = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2333
2353
|
SheetPrimitive.Overlay,
|
|
2334
2354
|
{
|
|
2335
2355
|
ref,
|
|
@@ -2341,7 +2361,7 @@ var DialogOverlay = React28.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
2341
2361
|
}
|
|
2342
2362
|
));
|
|
2343
2363
|
DialogOverlay.displayName = SheetPrimitive.Overlay.displayName;
|
|
2344
|
-
var DialogContent =
|
|
2364
|
+
var DialogContent = React50.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
2345
2365
|
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
2346
2366
|
/* @__PURE__ */ jsxs(
|
|
2347
2367
|
SheetPrimitive.Content,
|
|
@@ -2391,7 +2411,7 @@ var DialogFooter = ({
|
|
|
2391
2411
|
}
|
|
2392
2412
|
);
|
|
2393
2413
|
DialogFooter.displayName = "DialogFooter";
|
|
2394
|
-
var DialogTitle =
|
|
2414
|
+
var DialogTitle = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2395
2415
|
SheetPrimitive.Title,
|
|
2396
2416
|
{
|
|
2397
2417
|
ref,
|
|
@@ -2403,7 +2423,7 @@ var DialogTitle = React28.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
2403
2423
|
}
|
|
2404
2424
|
));
|
|
2405
2425
|
DialogTitle.displayName = SheetPrimitive.Title.displayName;
|
|
2406
|
-
var DialogDescription =
|
|
2426
|
+
var DialogDescription = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2407
2427
|
SheetPrimitive.Description,
|
|
2408
2428
|
{
|
|
2409
2429
|
ref,
|
|
@@ -2415,7 +2435,7 @@ DialogDescription.displayName = SheetPrimitive.Description.displayName;
|
|
|
2415
2435
|
var AlertDialog = AlertDialogPrimitive.Root;
|
|
2416
2436
|
var AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
2417
2437
|
var AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
2418
|
-
var AlertDialogOverlay =
|
|
2438
|
+
var AlertDialogOverlay = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2419
2439
|
AlertDialogPrimitive.Overlay,
|
|
2420
2440
|
{
|
|
2421
2441
|
className: cn(
|
|
@@ -2427,7 +2447,7 @@ var AlertDialogOverlay = React28.forwardRef(({ className, ...props }, ref) => /*
|
|
|
2427
2447
|
}
|
|
2428
2448
|
));
|
|
2429
2449
|
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
2430
|
-
var AlertDialogContent =
|
|
2450
|
+
var AlertDialogContent = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [
|
|
2431
2451
|
/* @__PURE__ */ jsx(AlertDialogOverlay, {}),
|
|
2432
2452
|
/* @__PURE__ */ jsx(
|
|
2433
2453
|
AlertDialogPrimitive.Content,
|
|
@@ -2470,7 +2490,7 @@ var AlertDialogFooter = ({
|
|
|
2470
2490
|
}
|
|
2471
2491
|
);
|
|
2472
2492
|
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
2473
|
-
var AlertDialogTitle =
|
|
2493
|
+
var AlertDialogTitle = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2474
2494
|
AlertDialogPrimitive.Title,
|
|
2475
2495
|
{
|
|
2476
2496
|
ref,
|
|
@@ -2479,7 +2499,7 @@ var AlertDialogTitle = React28.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
2479
2499
|
}
|
|
2480
2500
|
));
|
|
2481
2501
|
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
2482
|
-
var AlertDialogDescription =
|
|
2502
|
+
var AlertDialogDescription = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2483
2503
|
AlertDialogPrimitive.Description,
|
|
2484
2504
|
{
|
|
2485
2505
|
ref,
|
|
@@ -2488,7 +2508,7 @@ var AlertDialogDescription = React28.forwardRef(({ className, ...props }, ref) =
|
|
|
2488
2508
|
}
|
|
2489
2509
|
));
|
|
2490
2510
|
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
|
|
2491
|
-
var AlertDialogAction =
|
|
2511
|
+
var AlertDialogAction = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2492
2512
|
AlertDialogPrimitive.Action,
|
|
2493
2513
|
{
|
|
2494
2514
|
ref,
|
|
@@ -2497,7 +2517,7 @@ var AlertDialogAction = React28.forwardRef(({ className, ...props }, ref) => /*
|
|
|
2497
2517
|
}
|
|
2498
2518
|
));
|
|
2499
2519
|
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
2500
|
-
var AlertDialogCancel =
|
|
2520
|
+
var AlertDialogCancel = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2501
2521
|
AlertDialogPrimitive.Cancel,
|
|
2502
2522
|
{
|
|
2503
2523
|
ref,
|
|
@@ -2558,7 +2578,7 @@ var Popover = PopoverPrimitive.Root;
|
|
|
2558
2578
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
2559
2579
|
var PopoverAnchor = PopoverPrimitive.Anchor;
|
|
2560
2580
|
var PopoverClose = PopoverPrimitive.Close;
|
|
2561
|
-
var PopoverContent =
|
|
2581
|
+
var PopoverContent = React50.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
2562
2582
|
PopoverPrimitive.Content,
|
|
2563
2583
|
{
|
|
2564
2584
|
ref,
|
|
@@ -2572,7 +2592,7 @@ var PopoverContent = React28.forwardRef(({ className, align = "center", sideOffs
|
|
|
2572
2592
|
}
|
|
2573
2593
|
) }));
|
|
2574
2594
|
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
2575
|
-
var PopoverArrow =
|
|
2595
|
+
var PopoverArrow = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2576
2596
|
PopoverPrimitive.Arrow,
|
|
2577
2597
|
{
|
|
2578
2598
|
ref,
|
|
@@ -2584,7 +2604,7 @@ PopoverArrow.displayName = PopoverPrimitive.Arrow.displayName;
|
|
|
2584
2604
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
2585
2605
|
var Tooltip = TooltipPrimitive.Root;
|
|
2586
2606
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
2587
|
-
var TooltipContent =
|
|
2607
|
+
var TooltipContent = React50.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
2588
2608
|
TooltipPrimitive.Content,
|
|
2589
2609
|
{
|
|
2590
2610
|
ref,
|
|
@@ -2597,7 +2617,7 @@ var TooltipContent = React28.forwardRef(({ className, sideOffset = 4, ...props }
|
|
|
2597
2617
|
}
|
|
2598
2618
|
) }));
|
|
2599
2619
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
2600
|
-
var TooltipArrow =
|
|
2620
|
+
var TooltipArrow = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2601
2621
|
TooltipPrimitive.Arrow,
|
|
2602
2622
|
{
|
|
2603
2623
|
ref,
|
|
@@ -2619,7 +2639,7 @@ function SimpleTooltip({
|
|
|
2619
2639
|
] }) });
|
|
2620
2640
|
}
|
|
2621
2641
|
var ToastProvider = ToastPrimitives.Provider;
|
|
2622
|
-
var ToastViewport =
|
|
2642
|
+
var ToastViewport = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2623
2643
|
ToastPrimitives.Viewport,
|
|
2624
2644
|
{
|
|
2625
2645
|
ref,
|
|
@@ -2648,7 +2668,7 @@ var toastVariants = cva(
|
|
|
2648
2668
|
}
|
|
2649
2669
|
}
|
|
2650
2670
|
);
|
|
2651
|
-
var Toast =
|
|
2671
|
+
var Toast = React50.forwardRef(({ className, variant, ...props }, ref) => {
|
|
2652
2672
|
return /* @__PURE__ */ jsx(
|
|
2653
2673
|
ToastPrimitives.Root,
|
|
2654
2674
|
{
|
|
@@ -2659,7 +2679,7 @@ var Toast = React28.forwardRef(({ className, variant, ...props }, ref) => {
|
|
|
2659
2679
|
);
|
|
2660
2680
|
});
|
|
2661
2681
|
Toast.displayName = ToastPrimitives.Root.displayName;
|
|
2662
|
-
var ToastAction =
|
|
2682
|
+
var ToastAction = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2663
2683
|
ToastPrimitives.Action,
|
|
2664
2684
|
{
|
|
2665
2685
|
ref,
|
|
@@ -2671,7 +2691,7 @@ var ToastAction = React28.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
2671
2691
|
}
|
|
2672
2692
|
));
|
|
2673
2693
|
ToastAction.displayName = ToastPrimitives.Action.displayName;
|
|
2674
|
-
var ToastClose =
|
|
2694
|
+
var ToastClose = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2675
2695
|
ToastPrimitives.Close,
|
|
2676
2696
|
{
|
|
2677
2697
|
ref,
|
|
@@ -2685,7 +2705,7 @@ var ToastClose = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
2685
2705
|
}
|
|
2686
2706
|
));
|
|
2687
2707
|
ToastClose.displayName = ToastPrimitives.Close.displayName;
|
|
2688
|
-
var ToastTitle =
|
|
2708
|
+
var ToastTitle = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2689
2709
|
ToastPrimitives.Title,
|
|
2690
2710
|
{
|
|
2691
2711
|
ref,
|
|
@@ -2694,7 +2714,7 @@ var ToastTitle = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
2694
2714
|
}
|
|
2695
2715
|
));
|
|
2696
2716
|
ToastTitle.displayName = ToastPrimitives.Title.displayName;
|
|
2697
|
-
var ToastDescription =
|
|
2717
|
+
var ToastDescription = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2698
2718
|
ToastPrimitives.Description,
|
|
2699
2719
|
{
|
|
2700
2720
|
ref,
|
|
@@ -2833,8 +2853,8 @@ function toast({ ...props }) {
|
|
|
2833
2853
|
};
|
|
2834
2854
|
}
|
|
2835
2855
|
function useToast() {
|
|
2836
|
-
const [state, setState] =
|
|
2837
|
-
|
|
2856
|
+
const [state, setState] = React50.useState(memoryState);
|
|
2857
|
+
React50.useEffect(() => {
|
|
2838
2858
|
listeners.push(setState);
|
|
2839
2859
|
return () => {
|
|
2840
2860
|
const index = listeners.indexOf(setState);
|
|
@@ -2869,7 +2889,7 @@ function Toaster() {
|
|
|
2869
2889
|
/* @__PURE__ */ jsx(ToastViewport, {})
|
|
2870
2890
|
] });
|
|
2871
2891
|
}
|
|
2872
|
-
var Skeleton =
|
|
2892
|
+
var Skeleton = React50.forwardRef(
|
|
2873
2893
|
({ className, variant = "default", width, height, animate = true, style, ...props }, ref) => {
|
|
2874
2894
|
const variantStyles = {
|
|
2875
2895
|
default: "rounded-sm",
|
|
@@ -2897,7 +2917,7 @@ var Skeleton = React28.forwardRef(
|
|
|
2897
2917
|
}
|
|
2898
2918
|
);
|
|
2899
2919
|
Skeleton.displayName = "Skeleton";
|
|
2900
|
-
var SkeletonText =
|
|
2920
|
+
var SkeletonText = React50.forwardRef(
|
|
2901
2921
|
({ lines = 3, gap = 8, className, ...props }, ref) => {
|
|
2902
2922
|
return /* @__PURE__ */ jsx("div", { ref, className: cn("space-y-2", className), style: { gap }, children: Array.from({ length: lines }).map((_, i) => /* @__PURE__ */ jsx(
|
|
2903
2923
|
Skeleton,
|
|
@@ -2911,7 +2931,7 @@ var SkeletonText = React28.forwardRef(
|
|
|
2911
2931
|
}
|
|
2912
2932
|
);
|
|
2913
2933
|
SkeletonText.displayName = "SkeletonText";
|
|
2914
|
-
var SkeletonCard =
|
|
2934
|
+
var SkeletonCard = React50.forwardRef(
|
|
2915
2935
|
({ hasHeader = true, hasAvatar = false, className, ...props }, ref) => {
|
|
2916
2936
|
return /* @__PURE__ */ jsxs(
|
|
2917
2937
|
"div",
|
|
@@ -2963,7 +2983,7 @@ function generatePagination(currentPage, totalPages, siblingCount) {
|
|
|
2963
2983
|
);
|
|
2964
2984
|
return [1, "ellipsis", ...middleRange, "ellipsis", totalPages];
|
|
2965
2985
|
}
|
|
2966
|
-
var Pagination =
|
|
2986
|
+
var Pagination = React50.forwardRef(
|
|
2967
2987
|
({
|
|
2968
2988
|
currentPage,
|
|
2969
2989
|
totalPages,
|
|
@@ -3040,7 +3060,7 @@ var Pagination = React28.forwardRef(
|
|
|
3040
3060
|
}
|
|
3041
3061
|
);
|
|
3042
3062
|
Pagination.displayName = "Pagination";
|
|
3043
|
-
var SimplePagination =
|
|
3063
|
+
var SimplePagination = React50.forwardRef(
|
|
3044
3064
|
({
|
|
3045
3065
|
currentPage,
|
|
3046
3066
|
totalPages,
|
|
@@ -3102,7 +3122,7 @@ var SimplePagination = React28.forwardRef(
|
|
|
3102
3122
|
}
|
|
3103
3123
|
);
|
|
3104
3124
|
SimplePagination.displayName = "SimplePagination";
|
|
3105
|
-
var StepProgress =
|
|
3125
|
+
var StepProgress = React50.forwardRef(
|
|
3106
3126
|
({
|
|
3107
3127
|
steps,
|
|
3108
3128
|
currentStep,
|
|
@@ -3222,7 +3242,7 @@ var StepProgress = React28.forwardRef(
|
|
|
3222
3242
|
}
|
|
3223
3243
|
);
|
|
3224
3244
|
StepProgress.displayName = "StepProgress";
|
|
3225
|
-
var StepDots =
|
|
3245
|
+
var StepDots = React50.forwardRef(
|
|
3226
3246
|
({ totalSteps, currentStep, onStepClick, className }, ref) => {
|
|
3227
3247
|
return /* @__PURE__ */ jsx("div", { ref, className: cn("flex items-center gap-2", className), children: Array.from({ length: totalSteps }, (_, i) => i + 1).map((step) => {
|
|
3228
3248
|
const isCompleted = step < currentStep;
|
|
@@ -3248,7 +3268,7 @@ var StepDots = React28.forwardRef(
|
|
|
3248
3268
|
}
|
|
3249
3269
|
);
|
|
3250
3270
|
StepDots.displayName = "StepDots";
|
|
3251
|
-
var Breadcrumbs =
|
|
3271
|
+
var Breadcrumbs = React50.forwardRef(
|
|
3252
3272
|
({
|
|
3253
3273
|
items,
|
|
3254
3274
|
LinkComponent,
|
|
@@ -3330,7 +3350,7 @@ var Breadcrumbs = React28.forwardRef(
|
|
|
3330
3350
|
}
|
|
3331
3351
|
);
|
|
3332
3352
|
Breadcrumbs.displayName = "Breadcrumbs";
|
|
3333
|
-
var BreadcrumbLink =
|
|
3353
|
+
var BreadcrumbLink = React50.forwardRef(
|
|
3334
3354
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3335
3355
|
"a",
|
|
3336
3356
|
{
|
|
@@ -3355,7 +3375,7 @@ var presetLabels = {
|
|
|
3355
3375
|
"this-year": "This year",
|
|
3356
3376
|
"custom": "Custom"
|
|
3357
3377
|
};
|
|
3358
|
-
var DateRangePicker =
|
|
3378
|
+
var DateRangePicker = React50.forwardRef(
|
|
3359
3379
|
({
|
|
3360
3380
|
value,
|
|
3361
3381
|
onChange,
|
|
@@ -3414,7 +3434,7 @@ var DateRangePicker = React28.forwardRef(
|
|
|
3414
3434
|
}
|
|
3415
3435
|
);
|
|
3416
3436
|
DateRangePicker.displayName = "DateRangePicker";
|
|
3417
|
-
var DateRangeSelect =
|
|
3437
|
+
var DateRangeSelect = React50.forwardRef(
|
|
3418
3438
|
({ value, onChange, presets = ["7d", "30d", "90d"], className }, ref) => {
|
|
3419
3439
|
return /* @__PURE__ */ jsx(
|
|
3420
3440
|
"select",
|
|
@@ -3753,7 +3773,7 @@ function FilePreview({
|
|
|
3753
3773
|
/* @__PURE__ */ jsx(CardContent, { children: content })
|
|
3754
3774
|
] });
|
|
3755
3775
|
}
|
|
3756
|
-
var SettingsNav =
|
|
3776
|
+
var SettingsNav = React50.forwardRef(
|
|
3757
3777
|
({ groups, LinkComponent, className, ...props }, ref) => {
|
|
3758
3778
|
const Link2 = LinkComponent || "a";
|
|
3759
3779
|
return /* @__PURE__ */ jsx("div", { ref, className: cn("space-y-8", className), ...props, children: groups.map((group) => /* @__PURE__ */ jsxs("div", { children: [
|
|
@@ -3784,7 +3804,7 @@ var SettingsNav = React28.forwardRef(
|
|
|
3784
3804
|
}
|
|
3785
3805
|
);
|
|
3786
3806
|
SettingsNav.displayName = "SettingsNav";
|
|
3787
|
-
var SettingsNavLink =
|
|
3807
|
+
var SettingsNavLink = React50.forwardRef(
|
|
3788
3808
|
({ title, description, icon, href, LinkComponent, className, ...props }, ref) => {
|
|
3789
3809
|
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3790
3810
|
icon && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center w-10 h-10 rounded-sm bg-gray-100 group-hover:bg-[var(--cyan)]/10 transition-colors", children: /* @__PURE__ */ jsx("span", { className: "text-gray-600 group-hover:text-[var(--cyan)] transition-colors [&>svg]:w-5 [&>svg]:h-5", children: icon }) }),
|
|
@@ -3822,8 +3842,8 @@ var typeConfig = {
|
|
|
3822
3842
|
default_behavior: {
|
|
3823
3843
|
label: "Handle it",
|
|
3824
3844
|
icon: CheckCircle,
|
|
3825
|
-
color: "text-
|
|
3826
|
-
bgColor: "bg-
|
|
3845
|
+
color: "text-[var(--cyan)]",
|
|
3846
|
+
bgColor: "bg-[var(--cyan)]/10",
|
|
3827
3847
|
description: "Proceed automatically using this rule"
|
|
3828
3848
|
},
|
|
3829
3849
|
quality_check: {
|
|
@@ -3836,8 +3856,8 @@ var typeConfig = {
|
|
|
3836
3856
|
edge_case: {
|
|
3837
3857
|
label: "Watch out",
|
|
3838
3858
|
icon: Question,
|
|
3839
|
-
color: "text-
|
|
3840
|
-
bgColor: "bg-
|
|
3859
|
+
color: "text-muted-foreground",
|
|
3860
|
+
bgColor: "bg-muted",
|
|
3841
3861
|
description: "Common mistakes or tricky situations"
|
|
3842
3862
|
}
|
|
3843
3863
|
};
|
|
@@ -3848,18 +3868,20 @@ function ScenarioCard({
|
|
|
3848
3868
|
}) {
|
|
3849
3869
|
const config = typeConfig[scenario.type];
|
|
3850
3870
|
const Icon = config.icon;
|
|
3851
|
-
return /* @__PURE__ */ jsx("div", { className: "group relative border border-
|
|
3871
|
+
return /* @__PURE__ */ jsx("div", { className: "group relative border border-border rounded-sm p-4 hover:border-[var(--cyan)]/30 hover:bg-[var(--cyan)]/[0.02] transition-all", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-3", children: [
|
|
3852
3872
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3 flex-1 min-w-0", children: [
|
|
3853
|
-
/* @__PURE__ */ jsx("div", { className: cn("w-
|
|
3873
|
+
/* @__PURE__ */ jsx("div", { className: cn("w-9 h-9 rounded-sm flex items-center justify-center shrink-0", config.bgColor), children: /* @__PURE__ */ jsx(Icon, { size: 18, weight: "fill", className: config.color }) }),
|
|
3854
3874
|
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
3855
|
-
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 mb-1", children: /* @__PURE__ */ jsx(Badge, { variant: "outline", size: "sm", children: config.label }) }),
|
|
3856
|
-
/* @__PURE__ */ jsxs("p", { className: "text-sm text-[var(--black)]
|
|
3857
|
-
"
|
|
3858
|
-
|
|
3875
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 mb-1.5", children: /* @__PURE__ */ jsx(Badge, { variant: "outline", size: "sm", className: "font-medium", children: config.label }) }),
|
|
3876
|
+
/* @__PURE__ */ jsxs("p", { className: "text-sm text-[var(--black)]", children: [
|
|
3877
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium", children: "When:" }),
|
|
3878
|
+
" ",
|
|
3879
|
+
scenario.situation
|
|
3859
3880
|
] }),
|
|
3860
3881
|
/* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground mt-1", children: [
|
|
3861
|
-
"
|
|
3862
|
-
|
|
3882
|
+
/* @__PURE__ */ jsx("span", { className: "text-[var(--black)] font-medium", children: "Action:" }),
|
|
3883
|
+
" ",
|
|
3884
|
+
scenario.action
|
|
3863
3885
|
] })
|
|
3864
3886
|
] })
|
|
3865
3887
|
] }),
|
|
@@ -3869,7 +3891,7 @@ function ScenarioCard({
|
|
|
3869
3891
|
{
|
|
3870
3892
|
variant: "ghost",
|
|
3871
3893
|
size: "icon",
|
|
3872
|
-
className: "h-8 w-8",
|
|
3894
|
+
className: "h-8 w-8 text-muted-foreground hover:text-[var(--black)]",
|
|
3873
3895
|
onClick: onEdit,
|
|
3874
3896
|
children: /* @__PURE__ */ jsx(PencilSimple, { size: 16 })
|
|
3875
3897
|
}
|
|
@@ -3879,7 +3901,7 @@ function ScenarioCard({
|
|
|
3879
3901
|
{
|
|
3880
3902
|
variant: "ghost",
|
|
3881
3903
|
size: "icon",
|
|
3882
|
-
className: "h-8 w-8 text-
|
|
3904
|
+
className: "h-8 w-8 text-muted-foreground hover:text-red-600 hover:bg-red-50",
|
|
3883
3905
|
onClick: onDelete,
|
|
3884
3906
|
children: /* @__PURE__ */ jsx(Trash, { size: 16 })
|
|
3885
3907
|
}
|
|
@@ -3892,8 +3914,6 @@ function SuggestionChip({
|
|
|
3892
3914
|
onAdd,
|
|
3893
3915
|
disabled
|
|
3894
3916
|
}) {
|
|
3895
|
-
const config = typeConfig[suggestion.type];
|
|
3896
|
-
config.icon;
|
|
3897
3917
|
return /* @__PURE__ */ jsxs(
|
|
3898
3918
|
"button",
|
|
3899
3919
|
{
|
|
@@ -3901,12 +3921,12 @@ function SuggestionChip({
|
|
|
3901
3921
|
onClick: onAdd,
|
|
3902
3922
|
disabled,
|
|
3903
3923
|
className: cn(
|
|
3904
|
-
"inline-flex items-center gap-
|
|
3924
|
+
"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-sm border border-dashed border-border",
|
|
3905
3925
|
"text-sm text-muted-foreground hover:border-[var(--cyan)] hover:text-[var(--cyan)] hover:bg-[var(--cyan)]/5",
|
|
3906
|
-
"transition-
|
|
3926
|
+
"transition-all disabled:opacity-50 disabled:cursor-not-allowed"
|
|
3907
3927
|
),
|
|
3908
3928
|
children: [
|
|
3909
|
-
/* @__PURE__ */ jsx(Plus, { size: 14 }),
|
|
3929
|
+
/* @__PURE__ */ jsx(Plus, { size: 14, weight: "bold" }),
|
|
3910
3930
|
suggestion.situation
|
|
3911
3931
|
]
|
|
3912
3932
|
}
|
|
@@ -3919,11 +3939,11 @@ function ScenarioDialog({
|
|
|
3919
3939
|
onSave,
|
|
3920
3940
|
isLoading
|
|
3921
3941
|
}) {
|
|
3922
|
-
const [type, setType] =
|
|
3923
|
-
const [situation, setSituation] =
|
|
3924
|
-
const [action, setAction] =
|
|
3925
|
-
const [isSaving, setIsSaving] =
|
|
3926
|
-
|
|
3942
|
+
const [type, setType] = React50.useState(scenario?.type || "escalation");
|
|
3943
|
+
const [situation, setSituation] = React50.useState(scenario?.situation || "");
|
|
3944
|
+
const [action, setAction] = React50.useState(scenario?.action || "");
|
|
3945
|
+
const [isSaving, setIsSaving] = React50.useState(false);
|
|
3946
|
+
React50.useEffect(() => {
|
|
3927
3947
|
if (open) {
|
|
3928
3948
|
setType(scenario?.type || "escalation");
|
|
3929
3949
|
setSituation(scenario?.situation || "");
|
|
@@ -4006,13 +4026,18 @@ function ScenariosManager({
|
|
|
4006
4026
|
onAdd,
|
|
4007
4027
|
onUpdate,
|
|
4008
4028
|
onDelete,
|
|
4029
|
+
onComplete,
|
|
4009
4030
|
suggestions = [],
|
|
4010
4031
|
isLoading,
|
|
4032
|
+
isComplete = false,
|
|
4033
|
+
minScenariosToComplete = 1,
|
|
4011
4034
|
className
|
|
4012
4035
|
}) {
|
|
4013
|
-
const [dialogOpen, setDialogOpen] =
|
|
4014
|
-
const [editingScenario, setEditingScenario] =
|
|
4015
|
-
const [deletingId, setDeletingId] =
|
|
4036
|
+
const [dialogOpen, setDialogOpen] = React50.useState(false);
|
|
4037
|
+
const [editingScenario, setEditingScenario] = React50.useState(null);
|
|
4038
|
+
const [deletingId, setDeletingId] = React50.useState(null);
|
|
4039
|
+
const [isCompleting, setIsCompleting] = React50.useState(false);
|
|
4040
|
+
const canComplete = scenarios.length >= minScenariosToComplete && !isComplete && onComplete;
|
|
4016
4041
|
const handleAddClick = () => {
|
|
4017
4042
|
setEditingScenario(null);
|
|
4018
4043
|
setDialogOpen(true);
|
|
@@ -4039,6 +4064,15 @@ function ScenariosManager({
|
|
|
4039
4064
|
const handleSuggestionAdd = async (suggestion) => {
|
|
4040
4065
|
await onAdd(suggestion);
|
|
4041
4066
|
};
|
|
4067
|
+
const handleComplete = async () => {
|
|
4068
|
+
if (!onComplete) return;
|
|
4069
|
+
setIsCompleting(true);
|
|
4070
|
+
try {
|
|
4071
|
+
await onComplete();
|
|
4072
|
+
} finally {
|
|
4073
|
+
setIsCompleting(false);
|
|
4074
|
+
}
|
|
4075
|
+
};
|
|
4042
4076
|
const filteredSuggestions = suggestions.filter(
|
|
4043
4077
|
(s) => !scenarios.some(
|
|
4044
4078
|
(existing) => existing.situation.toLowerCase() === s.situation.toLowerCase()
|
|
@@ -4067,15 +4101,15 @@ function ScenariosManager({
|
|
|
4067
4101
|
},
|
|
4068
4102
|
scenario.id
|
|
4069
4103
|
)) }),
|
|
4070
|
-
scenarios.length === 0 && /* @__PURE__ */ jsxs("div", { className: "border border-dashed border-
|
|
4071
|
-
/* @__PURE__ */ jsx(
|
|
4104
|
+
scenarios.length === 0 && /* @__PURE__ */ jsxs("div", { className: "border border-dashed border-border rounded-sm p-8 text-center", children: [
|
|
4105
|
+
/* @__PURE__ */ jsx("div", { className: "w-12 h-12 rounded-sm bg-muted flex items-center justify-center mx-auto mb-3", children: /* @__PURE__ */ jsx(Lightning, { size: 24, className: "text-muted-foreground" }) }),
|
|
4072
4106
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mb-4", children: "No scenarios yet. Add rules for how the worker should handle edge cases." }),
|
|
4073
4107
|
/* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", onClick: handleAddClick, children: [
|
|
4074
|
-
/* @__PURE__ */ jsx(Plus, { size: 16, className: "mr-1" }),
|
|
4108
|
+
/* @__PURE__ */ jsx(Plus, { size: 16, className: "mr-1.5" }),
|
|
4075
4109
|
"Add your first scenario"
|
|
4076
4110
|
] })
|
|
4077
4111
|
] }),
|
|
4078
|
-
filteredSuggestions.length > 0 && /* @__PURE__ */ jsxs("div", { className: "pt-2", children: [
|
|
4112
|
+
filteredSuggestions.length > 0 && !isComplete && /* @__PURE__ */ jsxs("div", { className: "pt-2", children: [
|
|
4079
4113
|
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mb-2", children: "Suggested scenarios:" }),
|
|
4080
4114
|
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: filteredSuggestions.map((suggestion, index) => /* @__PURE__ */ jsx(
|
|
4081
4115
|
SuggestionChip,
|
|
@@ -4087,6 +4121,33 @@ function ScenariosManager({
|
|
|
4087
4121
|
index
|
|
4088
4122
|
)) })
|
|
4089
4123
|
] }),
|
|
4124
|
+
canComplete && /* @__PURE__ */ jsx("div", { className: "pt-4 border-t border-border", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4 bg-[var(--cyan)]/5 rounded-sm p-4 -mx-1", children: [
|
|
4125
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
4126
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-[var(--black)]", children: "Ready to proceed?" }),
|
|
4127
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-0.5", children: "Mark your scenarios as complete to continue with the onboarding." })
|
|
4128
|
+
] }),
|
|
4129
|
+
/* @__PURE__ */ jsxs(
|
|
4130
|
+
Button,
|
|
4131
|
+
{
|
|
4132
|
+
onClick: handleComplete,
|
|
4133
|
+
disabled: isCompleting,
|
|
4134
|
+
loading: isCompleting,
|
|
4135
|
+
size: "sm",
|
|
4136
|
+
className: "shrink-0",
|
|
4137
|
+
children: [
|
|
4138
|
+
/* @__PURE__ */ jsx(Check, { size: 16, className: "mr-1.5" }),
|
|
4139
|
+
"Mark complete"
|
|
4140
|
+
]
|
|
4141
|
+
}
|
|
4142
|
+
)
|
|
4143
|
+
] }) }),
|
|
4144
|
+
isComplete && /* @__PURE__ */ jsxs("div", { className: "pt-4 border-t border-border", children: [
|
|
4145
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-[var(--cyan)]", children: [
|
|
4146
|
+
/* @__PURE__ */ jsx(CheckCircle, { size: 16, weight: "fill" }),
|
|
4147
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: "Scenarios completed" })
|
|
4148
|
+
] }),
|
|
4149
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-1", children: "You can still add or edit scenarios while we build your worker." })
|
|
4150
|
+
] }),
|
|
4090
4151
|
/* @__PURE__ */ jsx(
|
|
4091
4152
|
ScenarioDialog,
|
|
4092
4153
|
{
|
|
@@ -4099,10 +4160,237 @@ function ScenariosManager({
|
|
|
4099
4160
|
)
|
|
4100
4161
|
] });
|
|
4101
4162
|
}
|
|
4163
|
+
var HOURS_PER_FTE_YEAR = 1880;
|
|
4164
|
+
var TIER_PRICING = {
|
|
4165
|
+
starter: 29,
|
|
4166
|
+
growth: 25,
|
|
4167
|
+
scale: 21,
|
|
4168
|
+
enterprise: 21
|
|
4169
|
+
};
|
|
4170
|
+
function ImpactMetricsForm({
|
|
4171
|
+
workerId,
|
|
4172
|
+
initialMetrics,
|
|
4173
|
+
totalExecutions = 0,
|
|
4174
|
+
customerPlan = "starter",
|
|
4175
|
+
apiBasePath = "/api/workers",
|
|
4176
|
+
onSave,
|
|
4177
|
+
showToasts = true,
|
|
4178
|
+
className
|
|
4179
|
+
}) {
|
|
4180
|
+
const [metrics, setMetrics] = useState(initialMetrics);
|
|
4181
|
+
const [savedMetrics, setSavedMetrics] = useState(initialMetrics);
|
|
4182
|
+
const [isSaving, setIsSaving] = useState(false);
|
|
4183
|
+
const isInitiallySaved = initialMetrics.time_saved_minutes_per_run !== 30 || initialMetrics.hourly_rate_euros !== 20 || initialMetrics.fte_equivalent !== 0.1;
|
|
4184
|
+
const [isEditing, setIsEditing] = useState(!isInitiallySaved);
|
|
4185
|
+
const workerCostPerMonth = TIER_PRICING[customerPlan] || TIER_PRICING.starter;
|
|
4186
|
+
const workerCostPerYear = workerCostPerMonth * 12;
|
|
4187
|
+
const calculateAnnualSavings = (fteEquivalent, hourlyRate) => {
|
|
4188
|
+
const laborSavings = fteEquivalent * HOURS_PER_FTE_YEAR * hourlyRate;
|
|
4189
|
+
return laborSavings - workerCostPerYear;
|
|
4190
|
+
};
|
|
4191
|
+
const handleSave = async () => {
|
|
4192
|
+
setIsSaving(true);
|
|
4193
|
+
try {
|
|
4194
|
+
const annualSavings = calculateAnnualSavings(
|
|
4195
|
+
metrics.fte_equivalent,
|
|
4196
|
+
metrics.hourly_rate_euros
|
|
4197
|
+
);
|
|
4198
|
+
const updatedMetrics = { ...metrics, estimated_annual_savings_euros: annualSavings };
|
|
4199
|
+
let success = false;
|
|
4200
|
+
if (onSave) {
|
|
4201
|
+
success = await onSave(workerId, updatedMetrics);
|
|
4202
|
+
} else {
|
|
4203
|
+
const response = await fetch(`${apiBasePath}/${workerId}/impact-metrics`, {
|
|
4204
|
+
method: "PATCH",
|
|
4205
|
+
headers: { "Content-Type": "application/json" },
|
|
4206
|
+
body: JSON.stringify(updatedMetrics)
|
|
4207
|
+
});
|
|
4208
|
+
success = response.ok;
|
|
4209
|
+
}
|
|
4210
|
+
if (success) {
|
|
4211
|
+
setMetrics(updatedMetrics);
|
|
4212
|
+
setSavedMetrics(updatedMetrics);
|
|
4213
|
+
setIsEditing(false);
|
|
4214
|
+
if (showToasts) {
|
|
4215
|
+
toast({
|
|
4216
|
+
title: "Metrics saved",
|
|
4217
|
+
description: "Impact metrics have been updated.",
|
|
4218
|
+
variant: "success"
|
|
4219
|
+
});
|
|
4220
|
+
}
|
|
4221
|
+
} else {
|
|
4222
|
+
throw new Error("Failed to save");
|
|
4223
|
+
}
|
|
4224
|
+
} catch (error) {
|
|
4225
|
+
console.error("Failed to save metrics:", error);
|
|
4226
|
+
if (showToasts) {
|
|
4227
|
+
toast({
|
|
4228
|
+
title: "Failed to save",
|
|
4229
|
+
description: "Could not save metrics. Please try again.",
|
|
4230
|
+
variant: "error"
|
|
4231
|
+
});
|
|
4232
|
+
}
|
|
4233
|
+
} finally {
|
|
4234
|
+
setIsSaving(false);
|
|
4235
|
+
}
|
|
4236
|
+
};
|
|
4237
|
+
const handleCancel = () => {
|
|
4238
|
+
setMetrics(savedMetrics);
|
|
4239
|
+
setIsEditing(false);
|
|
4240
|
+
};
|
|
4241
|
+
const hoursSavedPerYear = Math.round(metrics.fte_equivalent * HOURS_PER_FTE_YEAR);
|
|
4242
|
+
const laborSavingsPerYear = metrics.fte_equivalent * HOURS_PER_FTE_YEAR * metrics.hourly_rate_euros;
|
|
4243
|
+
const netAnnualSavings = laborSavingsPerYear - workerCostPerYear;
|
|
4244
|
+
return /* @__PURE__ */ jsxs(Card, { className: cn("border-[var(--cyan)]/20 bg-gradient-to-br from-white to-[var(--cyan)]/5", className), children: [
|
|
4245
|
+
/* @__PURE__ */ jsx(CardHeader, { className: "pb-3", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
4246
|
+
/* @__PURE__ */ jsxs(CardTitle, { className: "flex items-center gap-2", children: [
|
|
4247
|
+
/* @__PURE__ */ jsx(IconBox, { size: "sm", children: /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", fill: "currentColor", viewBox: "0 0 256 256", children: /* @__PURE__ */ jsx("path", { d: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-88a16,16,0,1,1-16-16A16,16,0,0,1,144,128Zm-56,0a16,16,0,1,1-16-16A16,16,0,0,1,88,128Zm112,0a16,16,0,1,1-16-16A16,16,0,0,1,200,128Z" }) }) }),
|
|
4248
|
+
"Impact Metrics (ROI)"
|
|
4249
|
+
] }),
|
|
4250
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: isEditing ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4251
|
+
isInitiallySaved && /* @__PURE__ */ jsx(
|
|
4252
|
+
Button,
|
|
4253
|
+
{
|
|
4254
|
+
onClick: handleCancel,
|
|
4255
|
+
size: "sm",
|
|
4256
|
+
variant: "ghost",
|
|
4257
|
+
children: "Cancel"
|
|
4258
|
+
}
|
|
4259
|
+
),
|
|
4260
|
+
/* @__PURE__ */ jsx(
|
|
4261
|
+
Button,
|
|
4262
|
+
{
|
|
4263
|
+
onClick: handleSave,
|
|
4264
|
+
disabled: isSaving,
|
|
4265
|
+
size: "sm",
|
|
4266
|
+
children: isSaving ? "Saving..." : "Save"
|
|
4267
|
+
}
|
|
4268
|
+
)
|
|
4269
|
+
] }) : /* @__PURE__ */ jsx(
|
|
4270
|
+
Button,
|
|
4271
|
+
{
|
|
4272
|
+
onClick: () => setIsEditing(true),
|
|
4273
|
+
size: "sm",
|
|
4274
|
+
variant: "outline",
|
|
4275
|
+
children: "Edit"
|
|
4276
|
+
}
|
|
4277
|
+
) })
|
|
4278
|
+
] }) }),
|
|
4279
|
+
/* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsxs("div", { className: "grid gap-6 md:grid-cols-2 lg:grid-cols-4", children: [
|
|
4280
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
4281
|
+
/* @__PURE__ */ jsx("div", { className: "p-2 rounded-sm bg-[var(--cyan)]/10 shrink-0", children: /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", fill: "currentColor", viewBox: "0 0 256 256", className: "text-[var(--cyan)]", children: /* @__PURE__ */ jsx("path", { d: "M128,40a96,96,0,1,0,96,96A96.11,96.11,0,0,0,128,40Zm0,176a80,80,0,1,1,80-80A80.09,80.09,0,0,1,128,216ZM173.66,90.34a8,8,0,0,1,0,11.32l-40,40a8,8,0,0,1-11.32-11.32l40-40A8,8,0,0,1,173.66,90.34ZM96,16a8,8,0,0,1,8-8h48a8,8,0,0,1,0,16H104A8,8,0,0,1,96,16Z" }) }) }),
|
|
4282
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
4283
|
+
/* @__PURE__ */ jsx("label", { className: "text-sm text-muted-foreground block mb-1", children: "Time per Task" }),
|
|
4284
|
+
isEditing ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
4285
|
+
/* @__PURE__ */ jsx(
|
|
4286
|
+
"input",
|
|
4287
|
+
{
|
|
4288
|
+
type: "number",
|
|
4289
|
+
value: metrics.time_saved_minutes_per_run,
|
|
4290
|
+
onChange: (e) => setMetrics((prev) => ({
|
|
4291
|
+
...prev,
|
|
4292
|
+
time_saved_minutes_per_run: parseInt(e.target.value) || 0
|
|
4293
|
+
})),
|
|
4294
|
+
className: "w-16 px-2 py-1 text-lg font-bold border border-border rounded-sm focus:outline-none focus:ring-2 focus:ring-[var(--cyan)] bg-background",
|
|
4295
|
+
min: "0"
|
|
4296
|
+
}
|
|
4297
|
+
),
|
|
4298
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "min" })
|
|
4299
|
+
] }) : /* @__PURE__ */ jsxs("p", { className: "text-2xl font-bold", children: [
|
|
4300
|
+
metrics.time_saved_minutes_per_run,
|
|
4301
|
+
" ",
|
|
4302
|
+
/* @__PURE__ */ jsx("span", { className: "text-base font-normal text-muted-foreground", children: "min" })
|
|
4303
|
+
] }),
|
|
4304
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-1", children: "How long manually" })
|
|
4305
|
+
] })
|
|
4306
|
+
] }),
|
|
4307
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
4308
|
+
/* @__PURE__ */ jsx("div", { className: "p-2 rounded-sm bg-[var(--cyan)]/10 shrink-0", children: /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", fill: "currentColor", viewBox: "0 0 256 256", className: "text-[var(--cyan)]", children: /* @__PURE__ */ jsx("path", { d: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm0-144a8,8,0,0,1,8,8v4.4c14.25,3.14,24,14.43,24,30.6,0,4.42-3.58,8-8,8s-8-3.58-8-8c0-8.64-7.18-13-16-13s-16,4.36-16,13,7.18,13,16,13c17.64,0,32,11.35,32,29,0,16.17-9.75,27.46-24,30.6V192a8,8,0,0,1-16,0v-4.4c-14.25-3.14-24-14.43-24-30.6a8,8,0,0,1,16,0c0,8.64,7.18,13,16,13s16-4.36,16-13-7.18-13-16-13c-17.64,0-32-11.35-32-29,0-16.17,9.75-27.46,24-30.6V80A8,8,0,0,1,128,72Z" }) }) }),
|
|
4309
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
4310
|
+
/* @__PURE__ */ jsx("label", { className: "text-sm text-muted-foreground block mb-1", children: "Manual Cost" }),
|
|
4311
|
+
isEditing ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
4312
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "\u20AC" }),
|
|
4313
|
+
/* @__PURE__ */ jsx(
|
|
4314
|
+
"input",
|
|
4315
|
+
{
|
|
4316
|
+
type: "number",
|
|
4317
|
+
value: metrics.hourly_rate_euros,
|
|
4318
|
+
onChange: (e) => setMetrics((prev) => ({
|
|
4319
|
+
...prev,
|
|
4320
|
+
hourly_rate_euros: parseFloat(e.target.value) || 0
|
|
4321
|
+
})),
|
|
4322
|
+
className: "w-16 px-2 py-1 text-lg font-bold border border-border rounded-sm focus:outline-none focus:ring-2 focus:ring-[var(--cyan)] bg-background",
|
|
4323
|
+
min: "0",
|
|
4324
|
+
step: "0.5"
|
|
4325
|
+
}
|
|
4326
|
+
),
|
|
4327
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "/hr" })
|
|
4328
|
+
] }) : /* @__PURE__ */ jsxs("p", { className: "text-2xl font-bold", children: [
|
|
4329
|
+
"\u20AC",
|
|
4330
|
+
metrics.hourly_rate_euros,
|
|
4331
|
+
" ",
|
|
4332
|
+
/* @__PURE__ */ jsx("span", { className: "text-base font-normal text-muted-foreground", children: "/hr" })
|
|
4333
|
+
] }),
|
|
4334
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-1", children: "Employee hourly cost" })
|
|
4335
|
+
] })
|
|
4336
|
+
] }),
|
|
4337
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
4338
|
+
/* @__PURE__ */ jsx("div", { className: "p-2 rounded-sm bg-[var(--cyan)]/10 shrink-0", children: /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", fill: "currentColor", viewBox: "0 0 256 256", className: "text-[var(--cyan)]", children: /* @__PURE__ */ jsx("path", { d: "M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8c18.84-32.56,52.14-52,89.07-52s70.23,19.44,89.07,52a8,8,0,1,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z" }) }) }),
|
|
4339
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
4340
|
+
/* @__PURE__ */ jsx("label", { className: "text-sm text-muted-foreground block mb-1", children: "Job Portion" }),
|
|
4341
|
+
isEditing ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
4342
|
+
/* @__PURE__ */ jsx(
|
|
4343
|
+
"input",
|
|
4344
|
+
{
|
|
4345
|
+
type: "number",
|
|
4346
|
+
value: Math.round(metrics.fte_equivalent * 100),
|
|
4347
|
+
onChange: (e) => setMetrics((prev) => ({
|
|
4348
|
+
...prev,
|
|
4349
|
+
fte_equivalent: (parseFloat(e.target.value) || 0) / 100
|
|
4350
|
+
})),
|
|
4351
|
+
className: "w-16 px-2 py-1 text-lg font-bold border border-border rounded-sm focus:outline-none focus:ring-2 focus:ring-[var(--cyan)] bg-background",
|
|
4352
|
+
min: "0",
|
|
4353
|
+
max: "1000",
|
|
4354
|
+
step: "5"
|
|
4355
|
+
}
|
|
4356
|
+
),
|
|
4357
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "%" })
|
|
4358
|
+
] }) : /* @__PURE__ */ jsxs("p", { className: "text-2xl font-bold", children: [
|
|
4359
|
+
Math.round(metrics.fte_equivalent * 100),
|
|
4360
|
+
" ",
|
|
4361
|
+
/* @__PURE__ */ jsx("span", { className: "text-base font-normal text-muted-foreground", children: "%" })
|
|
4362
|
+
] }),
|
|
4363
|
+
/* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground mt-1", children: [
|
|
4364
|
+
"% of FTE (",
|
|
4365
|
+
hoursSavedPerYear,
|
|
4366
|
+
"h/year)"
|
|
4367
|
+
] })
|
|
4368
|
+
] })
|
|
4369
|
+
] }),
|
|
4370
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
4371
|
+
/* @__PURE__ */ jsx("div", { className: "p-2 rounded-sm bg-[var(--cyan)]/10 shrink-0", children: /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", fill: "currentColor", viewBox: "0 0 256 256", className: "text-[var(--cyan)]", children: /* @__PURE__ */ jsx("path", { d: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm0-144a8,8,0,0,1,8,8v4.4c14.25,3.14,24,14.43,24,30.6,0,4.42-3.58,8-8,8s-8-3.58-8-8c0-8.64-7.18-13-16-13s-16,4.36-16,13,7.18,13,16,13c17.64,0,32,11.35,32,29,0,16.17-9.75,27.46-24,30.6V192a8,8,0,0,1-16,0v-4.4c-14.25-3.14-24-14.43-24-30.6a8,8,0,0,1,16,0c0,8.64,7.18,13,16,13s16-4.36,16-13-7.18-13-16-13c-17.64,0-32-11.35-32-29,0-16.17,9.75-27.46,24-30.6V80A8,8,0,0,1,128,72Z" }) }) }),
|
|
4372
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
4373
|
+
/* @__PURE__ */ jsx("label", { className: "text-sm text-muted-foreground block mb-1", children: "Net Annual Savings" }),
|
|
4374
|
+
/* @__PURE__ */ jsxs("p", { className: cn("text-2xl font-bold", netAnnualSavings >= 0 ? "text-[var(--cyan)]" : "text-red-500"), children: [
|
|
4375
|
+
"\u20AC",
|
|
4376
|
+
netAnnualSavings.toLocaleString(void 0, { maximumFractionDigits: 0 })
|
|
4377
|
+
] }),
|
|
4378
|
+
/* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground mt-1", children: [
|
|
4379
|
+
"\u20AC",
|
|
4380
|
+
laborSavingsPerYear.toLocaleString(void 0, { maximumFractionDigits: 0 }),
|
|
4381
|
+
" labor \u2212 \u20AC",
|
|
4382
|
+
workerCostPerYear,
|
|
4383
|
+
" worker"
|
|
4384
|
+
] })
|
|
4385
|
+
] })
|
|
4386
|
+
] })
|
|
4387
|
+
] }) })
|
|
4388
|
+
] });
|
|
4389
|
+
}
|
|
4102
4390
|
|
|
4103
4391
|
// src/index.ts
|
|
4104
4392
|
__reExport(index_exports, icons_exports);
|
|
4105
4393
|
|
|
4106
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, BreadcrumbLink, Breadcrumbs, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CodeBlock, ConfirmDialog, DateRangePicker, DateRangeSelect, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Divider, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, ErrorState, FilePreview, FormField, IconBox, Input, Label2 as Label, LabeledSwitch, Logo, Metric, MetricCard, MetricLabel, MetricSubtext, MetricValue, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupCard, RadioGroupItem, RadioGroupOption, ScenariosManager, Select, Separator2 as Separator, SettingsNav, SettingsNavLink, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SimplePagination, SimpleTooltip, Skeleton, SkeletonCard, SkeletonText, Stat, StepDots, StepProgress, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsListUnderline, TabsTrigger, TabsTriggerUnderline, Tag, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastIcon, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipArrow, TooltipContent, TooltipProvider, TooltipTrigger, UsageBar, UsageChart, alertVariants, badgeVariants, buttonVariants, cn, getDateRangeFromPreset, iconBoxVariants, metricCardVariants, navigationMenuTriggerStyle, progressVariants, statVariants, tagVariants, toast, usageBarVariants, useToast, valueVariants };
|
|
4394
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, BreadcrumbLink, Breadcrumbs, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CodeBlock, ConfirmDialog, DateRangePicker, DateRangeSelect, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Divider, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, ErrorState, FilePreview, FormField, IconBox, ImpactMetricsForm, Input, Label2 as Label, LabeledSwitch, Logo, Metric, MetricCard, MetricLabel, MetricSubtext, MetricValue, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupCard, RadioGroupItem, RadioGroupOption, ScenariosManager, Select, Separator2 as Separator, SettingsNav, SettingsNavLink, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SimplePagination, SimpleTooltip, Skeleton, SkeletonCard, SkeletonText, Stat, StepDots, StepProgress, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsListUnderline, TabsTrigger, TabsTriggerUnderline, Tag, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastIcon, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipArrow, TooltipContent, TooltipProvider, TooltipTrigger, UsageBar, UsageChart, alertVariants, badgeVariants, buttonVariants, cn, getDateRangeFromPreset, iconBoxVariants, metricCardVariants, navigationMenuTriggerStyle, progressVariants, statVariants, tagVariants, toast, usageBarVariants, useToast, valueVariants };
|
|
4107
4395
|
//# sourceMappingURL=index.mjs.map
|
|
4108
4396
|
//# sourceMappingURL=index.mjs.map
|