@timbal-ai/timbal-react 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/README.md +55 -8
- package/dist/app.cjs +2369 -1189
- package/dist/app.d.cts +8 -4
- package/dist/app.d.ts +8 -4
- package/dist/app.esm.js +32 -7
- package/dist/{chart-artifact-DOkwSTjQ.d.cts → chart-artifact-E58ve76I.d.cts} +279 -12
- package/dist/{chart-artifact-CBo9x8Ch.d.ts → chart-artifact-_PEJgCpQ.d.ts} +279 -12
- package/dist/{chat-Bed4FQSl.d.cts → chat-ClmzWzCX.d.cts} +33 -4
- package/dist/{chat-Bed4FQSl.d.ts → chat-ClmzWzCX.d.ts} +33 -4
- package/dist/chat.cjs +1446 -776
- package/dist/chat.d.cts +1 -1
- package/dist/chat.d.ts +1 -1
- package/dist/chat.esm.js +3 -3
- package/dist/{chunk-YEFBANNF.esm.js → chunk-4VULP3CJ.esm.js} +242 -288
- package/dist/{chunk-RZ6QC6RG.esm.js → chunk-AGJKK6R7.esm.js} +2 -2
- package/dist/{chunk-FOD67Z6G.esm.js → chunk-BMXFXLVV.esm.js} +341 -12
- package/dist/chunk-FEYZUVBM.esm.js +52 -0
- package/dist/{chunk-C6IXFM4T.esm.js → chunk-MTYXREHK.esm.js} +4 -4
- package/dist/{chunk-AYHOVAMI.esm.js → chunk-NAMKO2MU.esm.js} +1 -1
- package/dist/{chunk-SNLXVG7H.esm.js → chunk-UY7AKWJL.esm.js} +1108 -656
- package/dist/{chunk-GLPOVYEA.esm.js → chunk-XDIY2WSL.esm.js} +669 -279
- package/dist/index.cjs +2967 -1824
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.esm.js +41 -11
- package/dist/pill-segmented-tabs-BsIOW1Lo.d.cts +528 -0
- package/dist/pill-segmented-tabs-BsIOW1Lo.d.ts +528 -0
- package/dist/studio.cjs +1685 -1015
- package/dist/studio.d.cts +2 -2
- package/dist/studio.d.ts +2 -2
- package/dist/studio.esm.js +5 -5
- package/dist/styles.css +24 -0
- package/dist/ui.cjs +387 -49
- package/dist/ui.d.cts +71 -491
- package/dist/ui.d.ts +71 -491
- package/dist/ui.esm.js +26 -6
- package/dist/{welcome-COOb05a5.d.cts → welcome-BFGRoNfK.d.cts} +1 -1
- package/dist/{welcome-DE08m9ca.d.ts → welcome-DXqsGTwH.d.ts} +1 -1
- package/package.json +7 -3
- package/vite/local-dev.d.ts +5 -1
- package/vite/local-dev.mjs +17 -13
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
studioTopbarPillHeightClass
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UY7AKWJL.esm.js";
|
|
4
4
|
import {
|
|
5
5
|
cn,
|
|
6
6
|
controlSurfaceClass
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-BMXFXLVV.esm.js";
|
|
8
8
|
|
|
9
9
|
// src/chat/workforce-selector.tsx
|
|
10
10
|
import { ChevronDownIcon } from "lucide-react";
|
|
@@ -95,6 +95,33 @@ var TIMBAL_V2_SHADOW = {
|
|
|
95
95
|
ghost: "",
|
|
96
96
|
link: ""
|
|
97
97
|
};
|
|
98
|
+
var TIMBAL_V2_PRIMARY_SURFACE = cn(
|
|
99
|
+
TIMBAL_V2_PRIMARY_GRADIENT,
|
|
100
|
+
TIMBAL_V2_SHADOW.primary,
|
|
101
|
+
TIMBAL_V2_BORDER.primary
|
|
102
|
+
);
|
|
103
|
+
var TIMBAL_V2_PRIMARY_PILL_ROOT = cn(
|
|
104
|
+
"relative box-border inline-flex items-center justify-center overflow-hidden rounded-full border-0 bg-transparent p-0 font-normal shadow-none transition duration-200 ease-in-out",
|
|
105
|
+
TIMBAL_V2_SHADOW.primary,
|
|
106
|
+
TIMBAL_V2_BORDER.primary
|
|
107
|
+
);
|
|
108
|
+
var TIMBAL_V2_PRIMARY_PILL_FILL_LAYER = cn(
|
|
109
|
+
"pointer-events-none absolute inset-0 transition duration-200 ease-in-out",
|
|
110
|
+
"bg-gradient-to-b from-primary-fill-from to-primary-fill-to",
|
|
111
|
+
"group-hover/avatar:from-primary-fill-hover-from group-hover/avatar:to-primary-fill-hover-to",
|
|
112
|
+
"group-active/avatar:from-primary-fill-active-from group-active/avatar:to-primary-fill-active-to"
|
|
113
|
+
);
|
|
114
|
+
var TIMBAL_V2_SECONDARY_PILL_ROOT = cn(
|
|
115
|
+
"relative box-border inline-flex items-center justify-center overflow-hidden rounded-full bg-transparent p-0 font-normal shadow-none transition duration-200 ease-in-out",
|
|
116
|
+
TIMBAL_V2_SHADOW.secondary,
|
|
117
|
+
TIMBAL_V2_BORDER.secondary
|
|
118
|
+
);
|
|
119
|
+
var TIMBAL_V2_SECONDARY_PILL_FILL_LAYER = cn(
|
|
120
|
+
"pointer-events-none absolute inset-0 transition duration-200 ease-in-out",
|
|
121
|
+
TIMBAL_V2_ELEVATED_GRADIENT,
|
|
122
|
+
"group-hover/avatar:from-secondary-fill-hover-from group-hover/avatar:to-secondary-fill-hover-to",
|
|
123
|
+
"group-active/avatar:from-secondary-fill-active-from group-active/avatar:to-secondary-fill-active-to"
|
|
124
|
+
);
|
|
98
125
|
var TIMBAL_V2_SWITCH_TRACK_OFF = cn(
|
|
99
126
|
TIMBAL_V2_ELEVATED_GRADIENT,
|
|
100
127
|
"border border-border shadow-card"
|
|
@@ -521,25 +548,74 @@ function DialogFooter({ className, ...props }) {
|
|
|
521
548
|
}
|
|
522
549
|
|
|
523
550
|
// src/ui/avatar.tsx
|
|
551
|
+
import * as React2 from "react";
|
|
524
552
|
import { Avatar as AvatarPrimitive } from "radix-ui";
|
|
525
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
553
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
554
|
+
var AVATAR_PRIMARY_FALLBACK_CLASS = cn(
|
|
555
|
+
TIMBAL_V2_SECONDARY_PILL_ROOT,
|
|
556
|
+
TIMBAL_V2_LABEL.secondary,
|
|
557
|
+
"font-medium"
|
|
558
|
+
);
|
|
559
|
+
var AVATAR_SECONDARY_FILL_STYLE = {
|
|
560
|
+
backgroundImage: "linear-gradient(to bottom, var(--elevated-from), var(--elevated-to))"
|
|
561
|
+
};
|
|
562
|
+
var AvatarChromeContext = React2.createContext(
|
|
563
|
+
null
|
|
564
|
+
);
|
|
565
|
+
function useAvatarChrome() {
|
|
566
|
+
return React2.useContext(AvatarChromeContext);
|
|
567
|
+
}
|
|
568
|
+
function isBrandedVariant(variant) {
|
|
569
|
+
return variant === "secondary" || variant === "primary" || variant === "chart";
|
|
570
|
+
}
|
|
571
|
+
function avatarChartVariantClass(_seed) {
|
|
572
|
+
return AVATAR_PRIMARY_FALLBACK_CLASS;
|
|
573
|
+
}
|
|
574
|
+
var AVATAR_SIZE_CLASS = {
|
|
575
|
+
default: "size-8",
|
|
576
|
+
sm: "size-6",
|
|
577
|
+
lg: "size-10"
|
|
578
|
+
};
|
|
526
579
|
function Avatar({
|
|
527
580
|
className,
|
|
528
581
|
size = "default",
|
|
582
|
+
variant: rootVariant,
|
|
583
|
+
children,
|
|
529
584
|
...props
|
|
530
585
|
}) {
|
|
531
|
-
|
|
586
|
+
const [chrome, setChrome] = React2.useState(rootVariant ?? "muted");
|
|
587
|
+
React2.useLayoutEffect(() => {
|
|
588
|
+
if (rootVariant !== void 0) {
|
|
589
|
+
setChrome(rootVariant);
|
|
590
|
+
}
|
|
591
|
+
}, [rootVariant]);
|
|
592
|
+
const branded = isBrandedVariant(chrome);
|
|
593
|
+
return /* @__PURE__ */ jsx5(AvatarChromeContext.Provider, { value: { chrome, setChrome }, children: /* @__PURE__ */ jsxs4(
|
|
532
594
|
AvatarPrimitive.Root,
|
|
533
595
|
{
|
|
534
596
|
"data-slot": "avatar",
|
|
535
597
|
"data-size": size,
|
|
598
|
+
"data-variant": branded ? "secondary" : chrome,
|
|
536
599
|
className: cn(
|
|
537
|
-
"group/avatar relative
|
|
600
|
+
"group/avatar relative shrink-0 select-none",
|
|
601
|
+
AVATAR_SIZE_CLASS[size],
|
|
602
|
+
branded ? TIMBAL_V2_SECONDARY_PILL_ROOT : "flex overflow-hidden rounded-full",
|
|
538
603
|
className
|
|
539
604
|
),
|
|
540
|
-
...props
|
|
605
|
+
...props,
|
|
606
|
+
children: [
|
|
607
|
+
branded ? /* @__PURE__ */ jsx5(
|
|
608
|
+
"span",
|
|
609
|
+
{
|
|
610
|
+
"aria-hidden": true,
|
|
611
|
+
className: TIMBAL_V2_SECONDARY_PILL_FILL_LAYER,
|
|
612
|
+
style: AVATAR_SECONDARY_FILL_STYLE
|
|
613
|
+
}
|
|
614
|
+
) : null,
|
|
615
|
+
children
|
|
616
|
+
]
|
|
541
617
|
}
|
|
542
|
-
);
|
|
618
|
+
) });
|
|
543
619
|
}
|
|
544
620
|
function AvatarImage({
|
|
545
621
|
className,
|
|
@@ -549,35 +625,279 @@ function AvatarImage({
|
|
|
549
625
|
AvatarPrimitive.Image,
|
|
550
626
|
{
|
|
551
627
|
"data-slot": "avatar-image",
|
|
552
|
-
className: cn(
|
|
628
|
+
className: cn(
|
|
629
|
+
"relative z-10 aspect-square size-full rounded-full object-cover",
|
|
630
|
+
className
|
|
631
|
+
),
|
|
553
632
|
...props
|
|
554
633
|
}
|
|
555
634
|
);
|
|
556
635
|
}
|
|
557
636
|
function AvatarFallback({
|
|
558
637
|
className,
|
|
638
|
+
variant = "muted",
|
|
639
|
+
seed: _seed,
|
|
640
|
+
children,
|
|
641
|
+
style,
|
|
559
642
|
...props
|
|
560
643
|
}) {
|
|
644
|
+
const chromeCtx = useAvatarChrome();
|
|
645
|
+
React2.useLayoutEffect(() => {
|
|
646
|
+
chromeCtx?.setChrome(variant);
|
|
647
|
+
}, [chromeCtx, variant]);
|
|
648
|
+
const branded = isBrandedVariant(variant);
|
|
561
649
|
return /* @__PURE__ */ jsx5(
|
|
562
650
|
AvatarPrimitive.Fallback,
|
|
563
651
|
{
|
|
564
652
|
"data-slot": "avatar-fallback",
|
|
653
|
+
"data-variant": branded ? "secondary" : variant,
|
|
565
654
|
className: cn(
|
|
566
|
-
"
|
|
655
|
+
"relative z-10 flex size-full items-center justify-center rounded-full",
|
|
656
|
+
branded ? cn(
|
|
657
|
+
"bg-transparent font-medium",
|
|
658
|
+
TIMBAL_V2_LABEL.secondary,
|
|
659
|
+
"text-sm group-data-[size=sm]/avatar:text-xs"
|
|
660
|
+
) : "bg-muted font-normal text-muted-foreground text-sm group-data-[size=sm]/avatar:text-xs",
|
|
567
661
|
className
|
|
568
662
|
),
|
|
569
|
-
|
|
663
|
+
style,
|
|
664
|
+
...props,
|
|
665
|
+
children
|
|
666
|
+
}
|
|
667
|
+
);
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
// src/ui/chart.tsx
|
|
671
|
+
import * as React3 from "react";
|
|
672
|
+
import * as RechartsPrimitive from "recharts";
|
|
673
|
+
import { Fragment, jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
674
|
+
var THEMES = { light: "", dark: ".dark" };
|
|
675
|
+
var ChartContext = React3.createContext(null);
|
|
676
|
+
function useChart() {
|
|
677
|
+
const context = React3.useContext(ChartContext);
|
|
678
|
+
if (!context) {
|
|
679
|
+
throw new Error("useChart must be used within a <ChartContainer />");
|
|
680
|
+
}
|
|
681
|
+
return context;
|
|
682
|
+
}
|
|
683
|
+
function ChartContainer({
|
|
684
|
+
id,
|
|
685
|
+
className,
|
|
686
|
+
children,
|
|
687
|
+
config,
|
|
688
|
+
...props
|
|
689
|
+
}) {
|
|
690
|
+
const uniqueId = React3.useId();
|
|
691
|
+
const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
|
|
692
|
+
return /* @__PURE__ */ jsx6(ChartContext.Provider, { value: { config }, children: /* @__PURE__ */ jsxs5(
|
|
693
|
+
"div",
|
|
694
|
+
{
|
|
695
|
+
"data-slot": "chart",
|
|
696
|
+
"data-chart": chartId,
|
|
697
|
+
className: cn(
|
|
698
|
+
"[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",
|
|
699
|
+
className
|
|
700
|
+
),
|
|
701
|
+
...props,
|
|
702
|
+
children: [
|
|
703
|
+
/* @__PURE__ */ jsx6(ChartStyle, { id: chartId, config }),
|
|
704
|
+
/* @__PURE__ */ jsx6(RechartsPrimitive.ResponsiveContainer, { children })
|
|
705
|
+
]
|
|
570
706
|
}
|
|
707
|
+
) });
|
|
708
|
+
}
|
|
709
|
+
var ChartStyle = ({ id, config }) => {
|
|
710
|
+
const colorConfig = Object.entries(config).filter(
|
|
711
|
+
([, c]) => c.theme || c.color
|
|
571
712
|
);
|
|
713
|
+
if (!colorConfig.length) {
|
|
714
|
+
return null;
|
|
715
|
+
}
|
|
716
|
+
return /* @__PURE__ */ jsx6(
|
|
717
|
+
"style",
|
|
718
|
+
{
|
|
719
|
+
dangerouslySetInnerHTML: {
|
|
720
|
+
__html: Object.entries(THEMES).map(
|
|
721
|
+
([theme, prefix]) => `
|
|
722
|
+
${prefix} [data-chart=${id}] {
|
|
723
|
+
${colorConfig.map(([key, itemConfig]) => {
|
|
724
|
+
const color = itemConfig.theme?.[theme] || itemConfig.color;
|
|
725
|
+
return color ? ` --color-${key}: ${color};` : null;
|
|
726
|
+
}).join("\n")}
|
|
727
|
+
}
|
|
728
|
+
`
|
|
729
|
+
).join("\n")
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
);
|
|
733
|
+
};
|
|
734
|
+
var ChartTooltip = RechartsPrimitive.Tooltip;
|
|
735
|
+
function ChartTooltipContent({
|
|
736
|
+
active,
|
|
737
|
+
payload,
|
|
738
|
+
className,
|
|
739
|
+
indicator = "dot",
|
|
740
|
+
hideLabel = false,
|
|
741
|
+
hideIndicator = false,
|
|
742
|
+
label,
|
|
743
|
+
labelFormatter,
|
|
744
|
+
labelClassName,
|
|
745
|
+
formatter,
|
|
746
|
+
color,
|
|
747
|
+
nameKey,
|
|
748
|
+
labelKey
|
|
749
|
+
}) {
|
|
750
|
+
const { config } = useChart();
|
|
751
|
+
const tooltipLabel = React3.useMemo(() => {
|
|
752
|
+
if (hideLabel || !payload?.length) {
|
|
753
|
+
return null;
|
|
754
|
+
}
|
|
755
|
+
const [item] = payload;
|
|
756
|
+
const key = `${labelKey || item?.dataKey || item?.name || "value"}`;
|
|
757
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
758
|
+
const value = !labelKey && typeof label === "string" ? config[label]?.label || label : itemConfig?.label;
|
|
759
|
+
if (labelFormatter) {
|
|
760
|
+
return /* @__PURE__ */ jsx6("div", { className: cn("font-medium", labelClassName), children: labelFormatter(value, payload) });
|
|
761
|
+
}
|
|
762
|
+
if (!value) {
|
|
763
|
+
return null;
|
|
764
|
+
}
|
|
765
|
+
return /* @__PURE__ */ jsx6("div", { className: cn("font-medium", labelClassName), children: value });
|
|
766
|
+
}, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);
|
|
767
|
+
if (!active || !payload?.length) {
|
|
768
|
+
return null;
|
|
769
|
+
}
|
|
770
|
+
const nestLabel = payload.length === 1 && indicator !== "dot";
|
|
771
|
+
return /* @__PURE__ */ jsxs5(
|
|
772
|
+
"div",
|
|
773
|
+
{
|
|
774
|
+
className: cn(
|
|
775
|
+
"border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl",
|
|
776
|
+
"animate-in fade-in-0 zoom-in-95 duration-150",
|
|
777
|
+
className
|
|
778
|
+
),
|
|
779
|
+
children: [
|
|
780
|
+
!nestLabel ? tooltipLabel : null,
|
|
781
|
+
/* @__PURE__ */ jsx6("div", { className: "grid gap-1.5", children: payload.filter((item) => item.type !== "none").map((item, index) => {
|
|
782
|
+
const key = `${nameKey || item.name || item.dataKey || "value"}`;
|
|
783
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
784
|
+
const indicatorColor = color || item.payload?.fill || item.color;
|
|
785
|
+
return /* @__PURE__ */ jsx6(
|
|
786
|
+
"div",
|
|
787
|
+
{
|
|
788
|
+
className: cn(
|
|
789
|
+
"[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",
|
|
790
|
+
indicator === "dot" && "items-center"
|
|
791
|
+
),
|
|
792
|
+
children: formatter && item?.value !== void 0 && item.name ? formatter(item.value, item.name, item, index, item.payload) : /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
793
|
+
itemConfig?.icon ? /* @__PURE__ */ jsx6(itemConfig.icon, {}) : !hideIndicator && /* @__PURE__ */ jsx6(
|
|
794
|
+
"div",
|
|
795
|
+
{
|
|
796
|
+
className: cn(
|
|
797
|
+
"shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",
|
|
798
|
+
{
|
|
799
|
+
"h-2.5 w-2.5": indicator === "dot",
|
|
800
|
+
"w-1": indicator === "line",
|
|
801
|
+
"w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
|
|
802
|
+
"my-0.5": nestLabel && indicator === "dashed"
|
|
803
|
+
}
|
|
804
|
+
),
|
|
805
|
+
style: {
|
|
806
|
+
"--color-bg": indicatorColor,
|
|
807
|
+
"--color-border": indicatorColor
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
),
|
|
811
|
+
/* @__PURE__ */ jsxs5(
|
|
812
|
+
"div",
|
|
813
|
+
{
|
|
814
|
+
className: cn(
|
|
815
|
+
"flex flex-1 justify-between leading-none",
|
|
816
|
+
nestLabel ? "items-end" : "items-center"
|
|
817
|
+
),
|
|
818
|
+
children: [
|
|
819
|
+
/* @__PURE__ */ jsxs5("div", { className: "grid gap-1.5", children: [
|
|
820
|
+
nestLabel ? tooltipLabel : null,
|
|
821
|
+
/* @__PURE__ */ jsx6("span", { className: "text-muted-foreground", children: itemConfig?.label || item.name })
|
|
822
|
+
] }),
|
|
823
|
+
item.value != null && /* @__PURE__ */ jsx6("span", { className: "text-foreground font-mono font-medium tabular-nums", children: typeof item.value === "number" ? item.value.toLocaleString() : String(item.value) })
|
|
824
|
+
]
|
|
825
|
+
}
|
|
826
|
+
)
|
|
827
|
+
] })
|
|
828
|
+
},
|
|
829
|
+
`${item.dataKey ?? index}`
|
|
830
|
+
);
|
|
831
|
+
}) })
|
|
832
|
+
]
|
|
833
|
+
}
|
|
834
|
+
);
|
|
835
|
+
}
|
|
836
|
+
var ChartLegend = RechartsPrimitive.Legend;
|
|
837
|
+
function ChartLegendContent({
|
|
838
|
+
className,
|
|
839
|
+
hideIcon = false,
|
|
840
|
+
payload,
|
|
841
|
+
verticalAlign = "bottom",
|
|
842
|
+
nameKey
|
|
843
|
+
}) {
|
|
844
|
+
const { config } = useChart();
|
|
845
|
+
if (!payload?.length) {
|
|
846
|
+
return null;
|
|
847
|
+
}
|
|
848
|
+
return /* @__PURE__ */ jsx6(
|
|
849
|
+
"div",
|
|
850
|
+
{
|
|
851
|
+
className: cn(
|
|
852
|
+
"flex items-center justify-center gap-4",
|
|
853
|
+
verticalAlign === "top" ? "pb-3" : "pt-3",
|
|
854
|
+
className
|
|
855
|
+
),
|
|
856
|
+
children: payload.filter((item) => item.type !== "none").map((item, index) => {
|
|
857
|
+
const key = `${nameKey || item.dataKey || "value"}`;
|
|
858
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
859
|
+
return /* @__PURE__ */ jsxs5(
|
|
860
|
+
"div",
|
|
861
|
+
{
|
|
862
|
+
className: "[&>svg]:text-muted-foreground flex min-w-0 max-w-[8rem] items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3",
|
|
863
|
+
children: [
|
|
864
|
+
itemConfig?.icon && !hideIcon ? /* @__PURE__ */ jsx6(itemConfig.icon, {}) : /* @__PURE__ */ jsx6(
|
|
865
|
+
"div",
|
|
866
|
+
{
|
|
867
|
+
className: "h-2 w-2 shrink-0 rounded-[2px]",
|
|
868
|
+
style: { backgroundColor: item.color }
|
|
869
|
+
}
|
|
870
|
+
),
|
|
871
|
+
/* @__PURE__ */ jsx6("span", { className: "min-w-0 truncate", children: itemConfig?.label ?? (item.value != null ? String(item.value) : null) })
|
|
872
|
+
]
|
|
873
|
+
},
|
|
874
|
+
`${item.value ?? index}`
|
|
875
|
+
);
|
|
876
|
+
})
|
|
877
|
+
}
|
|
878
|
+
);
|
|
879
|
+
}
|
|
880
|
+
function getPayloadConfigFromPayload(config, payload, key) {
|
|
881
|
+
if (typeof payload !== "object" || payload === null) {
|
|
882
|
+
return void 0;
|
|
883
|
+
}
|
|
884
|
+
const payloadPayload = "payload" in payload && typeof payload.payload === "object" && payload.payload !== null ? payload.payload : void 0;
|
|
885
|
+
let configLabelKey = key;
|
|
886
|
+
if (key in payload && typeof payload[key] === "string") {
|
|
887
|
+
configLabelKey = payload[key];
|
|
888
|
+
} else if (payloadPayload && key in payloadPayload && typeof payloadPayload[key] === "string") {
|
|
889
|
+
configLabelKey = payloadPayload[key];
|
|
890
|
+
}
|
|
891
|
+
return configLabelKey in config ? config[configLabelKey] : config[key];
|
|
572
892
|
}
|
|
573
893
|
|
|
574
894
|
// src/ui/shimmer.tsx
|
|
575
895
|
import { motion } from "motion/react";
|
|
576
896
|
import {
|
|
577
897
|
memo,
|
|
578
|
-
useMemo
|
|
898
|
+
useMemo as useMemo2
|
|
579
899
|
} from "react";
|
|
580
|
-
import { jsx as
|
|
900
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
581
901
|
var ShimmerComponent = ({
|
|
582
902
|
children,
|
|
583
903
|
as: Component = "p",
|
|
@@ -588,11 +908,11 @@ var ShimmerComponent = ({
|
|
|
588
908
|
const MotionComponent = motion.create(
|
|
589
909
|
Component
|
|
590
910
|
);
|
|
591
|
-
const dynamicSpread =
|
|
911
|
+
const dynamicSpread = useMemo2(
|
|
592
912
|
() => (children?.length ?? 0) * spread,
|
|
593
913
|
[children, spread]
|
|
594
914
|
);
|
|
595
|
-
return /* @__PURE__ */
|
|
915
|
+
return /* @__PURE__ */ jsx7(
|
|
596
916
|
MotionComponent,
|
|
597
917
|
{
|
|
598
918
|
animate: { backgroundPosition: "0% center" },
|
|
@@ -650,8 +970,17 @@ export {
|
|
|
650
970
|
DialogDescription,
|
|
651
971
|
DialogHeader,
|
|
652
972
|
DialogFooter,
|
|
973
|
+
AVATAR_PRIMARY_FALLBACK_CLASS,
|
|
974
|
+
avatarChartVariantClass,
|
|
653
975
|
Avatar,
|
|
654
976
|
AvatarImage,
|
|
655
977
|
AvatarFallback,
|
|
978
|
+
useChart,
|
|
979
|
+
ChartContainer,
|
|
980
|
+
ChartStyle,
|
|
981
|
+
ChartTooltip,
|
|
982
|
+
ChartTooltipContent,
|
|
983
|
+
ChartLegend,
|
|
984
|
+
ChartLegendContent,
|
|
656
985
|
Shimmer
|
|
657
986
|
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-BMXFXLVV.esm.js";
|
|
4
|
+
|
|
5
|
+
// src/ui/checkbox.tsx
|
|
6
|
+
import { Checkbox as CheckboxPrimitive } from "radix-ui";
|
|
7
|
+
import { CheckIcon } from "lucide-react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
function Checkbox({
|
|
10
|
+
className,
|
|
11
|
+
...props
|
|
12
|
+
}) {
|
|
13
|
+
return /* @__PURE__ */ jsx(
|
|
14
|
+
CheckboxPrimitive.Root,
|
|
15
|
+
{
|
|
16
|
+
"data-slot": "checkbox",
|
|
17
|
+
className: cn(
|
|
18
|
+
"peer size-4 shrink-0 rounded-[4px] border border-border bg-gradient-to-b from-elevated-from to-elevated-to shadow-card outline-none transition-[box-shadow,background-color,border-color]",
|
|
19
|
+
"focus-visible:ring-2 focus-visible:ring-foreground/10 disabled:cursor-not-allowed disabled:opacity-50",
|
|
20
|
+
"data-[state=checked]:border-foreground/15 data-[state=checked]:from-primary-fill-from data-[state=checked]:to-primary-fill-to data-[state=checked]:text-primary-foreground",
|
|
21
|
+
className
|
|
22
|
+
),
|
|
23
|
+
...props,
|
|
24
|
+
children: /* @__PURE__ */ jsx(
|
|
25
|
+
CheckboxPrimitive.Indicator,
|
|
26
|
+
{
|
|
27
|
+
"data-slot": "checkbox-indicator",
|
|
28
|
+
className: "flex items-center justify-center text-current transition-none",
|
|
29
|
+
children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-3.5" })
|
|
30
|
+
}
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// src/ui/skeleton.tsx
|
|
37
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
38
|
+
function Skeleton({ className, ...props }) {
|
|
39
|
+
return /* @__PURE__ */ jsx2(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
"data-slot": "skeleton",
|
|
43
|
+
className: cn("animate-pulse rounded-lg bg-muted", className),
|
|
44
|
+
...props
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export {
|
|
50
|
+
Checkbox,
|
|
51
|
+
Skeleton
|
|
52
|
+
};
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
} from "./chunk-QIABF4KB.esm.js";
|
|
21
21
|
import {
|
|
22
22
|
WorkforceSelector
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-AGJKK6R7.esm.js";
|
|
24
24
|
import {
|
|
25
25
|
Composer,
|
|
26
26
|
TimbalChat,
|
|
@@ -43,10 +43,10 @@ import {
|
|
|
43
43
|
studioTopbarIconPillClass,
|
|
44
44
|
studioTopbarPillHeightClass,
|
|
45
45
|
useTimbalRuntime
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-UY7AKWJL.esm.js";
|
|
47
47
|
import {
|
|
48
48
|
PillSegmentedTabs
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-NAMKO2MU.esm.js";
|
|
50
50
|
import {
|
|
51
51
|
Avatar,
|
|
52
52
|
AvatarFallback,
|
|
@@ -56,7 +56,7 @@ import {
|
|
|
56
56
|
TooltipContent,
|
|
57
57
|
TooltipTrigger,
|
|
58
58
|
cn
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-BMXFXLVV.esm.js";
|
|
60
60
|
|
|
61
61
|
// src/hooks/use-workforces.ts
|
|
62
62
|
import { useEffect, useMemo, useRef, useState } from "react";
|