@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.
Files changed (42) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +55 -8
  3. package/dist/app.cjs +2369 -1189
  4. package/dist/app.d.cts +8 -4
  5. package/dist/app.d.ts +8 -4
  6. package/dist/app.esm.js +32 -7
  7. package/dist/{chart-artifact-DOkwSTjQ.d.cts → chart-artifact-E58ve76I.d.cts} +279 -12
  8. package/dist/{chart-artifact-CBo9x8Ch.d.ts → chart-artifact-_PEJgCpQ.d.ts} +279 -12
  9. package/dist/{chat-Bed4FQSl.d.cts → chat-ClmzWzCX.d.cts} +33 -4
  10. package/dist/{chat-Bed4FQSl.d.ts → chat-ClmzWzCX.d.ts} +33 -4
  11. package/dist/chat.cjs +1446 -776
  12. package/dist/chat.d.cts +1 -1
  13. package/dist/chat.d.ts +1 -1
  14. package/dist/chat.esm.js +3 -3
  15. package/dist/{chunk-YEFBANNF.esm.js → chunk-4VULP3CJ.esm.js} +242 -288
  16. package/dist/{chunk-RZ6QC6RG.esm.js → chunk-AGJKK6R7.esm.js} +2 -2
  17. package/dist/{chunk-FOD67Z6G.esm.js → chunk-BMXFXLVV.esm.js} +341 -12
  18. package/dist/chunk-FEYZUVBM.esm.js +52 -0
  19. package/dist/{chunk-C6IXFM4T.esm.js → chunk-MTYXREHK.esm.js} +4 -4
  20. package/dist/{chunk-AYHOVAMI.esm.js → chunk-NAMKO2MU.esm.js} +1 -1
  21. package/dist/{chunk-SNLXVG7H.esm.js → chunk-UY7AKWJL.esm.js} +1108 -656
  22. package/dist/{chunk-GLPOVYEA.esm.js → chunk-XDIY2WSL.esm.js} +669 -279
  23. package/dist/index.cjs +2967 -1824
  24. package/dist/index.d.cts +5 -5
  25. package/dist/index.d.ts +5 -5
  26. package/dist/index.esm.js +41 -11
  27. package/dist/pill-segmented-tabs-BsIOW1Lo.d.cts +528 -0
  28. package/dist/pill-segmented-tabs-BsIOW1Lo.d.ts +528 -0
  29. package/dist/studio.cjs +1685 -1015
  30. package/dist/studio.d.cts +2 -2
  31. package/dist/studio.d.ts +2 -2
  32. package/dist/studio.esm.js +5 -5
  33. package/dist/styles.css +24 -0
  34. package/dist/ui.cjs +387 -49
  35. package/dist/ui.d.cts +71 -491
  36. package/dist/ui.d.ts +71 -491
  37. package/dist/ui.esm.js +26 -6
  38. package/dist/{welcome-COOb05a5.d.cts → welcome-BFGRoNfK.d.cts} +1 -1
  39. package/dist/{welcome-DE08m9ca.d.ts → welcome-DXqsGTwH.d.ts} +1 -1
  40. package/package.json +7 -3
  41. package/vite/local-dev.d.ts +5 -1
  42. package/vite/local-dev.mjs +17 -13
package/dist/ui.cjs CHANGED
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/ui.ts
31
31
  var ui_exports = {};
32
32
  __export(ui_exports, {
33
+ AVATAR_PRIMARY_FALLBACK_CLASS: () => AVATAR_PRIMARY_FALLBACK_CLASS,
33
34
  Accordion: () => Accordion,
34
35
  AccordionContent: () => AccordionContent,
35
36
  AccordionItem: () => AccordionItem,
@@ -70,6 +71,12 @@ __export(ui_exports, {
70
71
  CardFooter: () => CardFooter,
71
72
  CardHeader: () => CardHeader,
72
73
  CardTitle: () => CardTitle,
74
+ ChartContainer: () => ChartContainer,
75
+ ChartLegend: () => ChartLegend,
76
+ ChartLegendContent: () => ChartLegendContent,
77
+ ChartStyle: () => ChartStyle,
78
+ ChartTooltip: () => ChartTooltip,
79
+ ChartTooltipContent: () => ChartTooltipContent,
73
80
  Checkbox: () => Checkbox,
74
81
  Collapsible: () => Collapsible,
75
82
  CollapsibleContent: () => CollapsibleContent,
@@ -257,6 +264,7 @@ __export(ui_exports, {
257
264
  TooltipProvider: () => TooltipProvider,
258
265
  TooltipTrigger: () => TooltipTrigger,
259
266
  alertVariants: () => alertVariants,
267
+ avatarChartVariantClass: () => avatarChartVariantClass,
260
268
  badgeVariants: () => badgeVariants,
261
269
  controlClass: () => controlClass,
262
270
  controlSurfaceClass: () => controlSurfaceClass,
@@ -268,6 +276,7 @@ __export(ui_exports, {
268
276
  overlaySurfaceClass: () => overlaySurfaceClass,
269
277
  toast: () => toast,
270
278
  toggleVariants: () => toggleVariants,
279
+ useChart: () => useChart,
271
280
  useToast: () => useToast
272
281
  });
273
282
  module.exports = __toCommonJS(ui_exports);
@@ -368,6 +377,33 @@ var TIMBAL_V2_SHADOW = {
368
377
  ghost: "",
369
378
  link: ""
370
379
  };
380
+ var TIMBAL_V2_PRIMARY_SURFACE = cn(
381
+ TIMBAL_V2_PRIMARY_GRADIENT,
382
+ TIMBAL_V2_SHADOW.primary,
383
+ TIMBAL_V2_BORDER.primary
384
+ );
385
+ var TIMBAL_V2_PRIMARY_PILL_ROOT = cn(
386
+ "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",
387
+ TIMBAL_V2_SHADOW.primary,
388
+ TIMBAL_V2_BORDER.primary
389
+ );
390
+ var TIMBAL_V2_PRIMARY_PILL_FILL_LAYER = cn(
391
+ "pointer-events-none absolute inset-0 transition duration-200 ease-in-out",
392
+ "bg-gradient-to-b from-primary-fill-from to-primary-fill-to",
393
+ "group-hover/avatar:from-primary-fill-hover-from group-hover/avatar:to-primary-fill-hover-to",
394
+ "group-active/avatar:from-primary-fill-active-from group-active/avatar:to-primary-fill-active-to"
395
+ );
396
+ var TIMBAL_V2_SECONDARY_PILL_ROOT = cn(
397
+ "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",
398
+ TIMBAL_V2_SHADOW.secondary,
399
+ TIMBAL_V2_BORDER.secondary
400
+ );
401
+ var TIMBAL_V2_SECONDARY_PILL_FILL_LAYER = cn(
402
+ "pointer-events-none absolute inset-0 transition duration-200 ease-in-out",
403
+ TIMBAL_V2_ELEVATED_GRADIENT,
404
+ "group-hover/avatar:from-secondary-fill-hover-from group-hover/avatar:to-secondary-fill-hover-to",
405
+ "group-active/avatar:from-secondary-fill-active-from group-active/avatar:to-secondary-fill-active-to"
406
+ );
371
407
  var TIMBAL_V2_SWITCH_TRACK_OFF = cn(
372
408
  TIMBAL_V2_ELEVATED_GRADIENT,
373
409
  "border border-border shadow-card"
@@ -636,25 +672,74 @@ function TooltipContent({
636
672
  }
637
673
 
638
674
  // src/ui/avatar.tsx
675
+ var React2 = __toESM(require("react"), 1);
639
676
  var import_radix_ui3 = require("radix-ui");
640
677
  var import_jsx_runtime4 = require("react/jsx-runtime");
678
+ var AVATAR_PRIMARY_FALLBACK_CLASS = cn(
679
+ TIMBAL_V2_SECONDARY_PILL_ROOT,
680
+ TIMBAL_V2_LABEL.secondary,
681
+ "font-medium"
682
+ );
683
+ var AVATAR_SECONDARY_FILL_STYLE = {
684
+ backgroundImage: "linear-gradient(to bottom, var(--elevated-from), var(--elevated-to))"
685
+ };
686
+ var AvatarChromeContext = React2.createContext(
687
+ null
688
+ );
689
+ function useAvatarChrome() {
690
+ return React2.useContext(AvatarChromeContext);
691
+ }
692
+ function isBrandedVariant(variant) {
693
+ return variant === "secondary" || variant === "primary" || variant === "chart";
694
+ }
695
+ function avatarChartVariantClass(_seed) {
696
+ return AVATAR_PRIMARY_FALLBACK_CLASS;
697
+ }
698
+ var AVATAR_SIZE_CLASS = {
699
+ default: "size-8",
700
+ sm: "size-6",
701
+ lg: "size-10"
702
+ };
641
703
  function Avatar({
642
704
  className,
643
705
  size = "default",
706
+ variant: rootVariant,
707
+ children,
644
708
  ...props
645
709
  }) {
646
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
710
+ const [chrome, setChrome] = React2.useState(rootVariant ?? "muted");
711
+ React2.useLayoutEffect(() => {
712
+ if (rootVariant !== void 0) {
713
+ setChrome(rootVariant);
714
+ }
715
+ }, [rootVariant]);
716
+ const branded = isBrandedVariant(chrome);
717
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(AvatarChromeContext.Provider, { value: { chrome, setChrome }, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
647
718
  import_radix_ui3.Avatar.Root,
648
719
  {
649
720
  "data-slot": "avatar",
650
721
  "data-size": size,
722
+ "data-variant": branded ? "secondary" : chrome,
651
723
  className: cn(
652
- "group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6",
724
+ "group/avatar relative shrink-0 select-none",
725
+ AVATAR_SIZE_CLASS[size],
726
+ branded ? TIMBAL_V2_SECONDARY_PILL_ROOT : "flex overflow-hidden rounded-full",
653
727
  className
654
728
  ),
655
- ...props
729
+ ...props,
730
+ children: [
731
+ branded ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
732
+ "span",
733
+ {
734
+ "aria-hidden": true,
735
+ className: TIMBAL_V2_SECONDARY_PILL_FILL_LAYER,
736
+ style: AVATAR_SECONDARY_FILL_STYLE
737
+ }
738
+ ) : null,
739
+ children
740
+ ]
656
741
  }
657
- );
742
+ ) });
658
743
  }
659
744
  function AvatarImage({
660
745
  className,
@@ -664,24 +749,44 @@ function AvatarImage({
664
749
  import_radix_ui3.Avatar.Image,
665
750
  {
666
751
  "data-slot": "avatar-image",
667
- className: cn("aspect-square size-full", className),
752
+ className: cn(
753
+ "relative z-10 aspect-square size-full rounded-full object-cover",
754
+ className
755
+ ),
668
756
  ...props
669
757
  }
670
758
  );
671
759
  }
672
760
  function AvatarFallback({
673
761
  className,
762
+ variant = "muted",
763
+ seed: _seed,
764
+ children,
765
+ style,
674
766
  ...props
675
767
  }) {
768
+ const chromeCtx = useAvatarChrome();
769
+ React2.useLayoutEffect(() => {
770
+ chromeCtx?.setChrome(variant);
771
+ }, [chromeCtx, variant]);
772
+ const branded = isBrandedVariant(variant);
676
773
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
677
774
  import_radix_ui3.Avatar.Fallback,
678
775
  {
679
776
  "data-slot": "avatar-fallback",
777
+ "data-variant": branded ? "secondary" : variant,
680
778
  className: cn(
681
- "bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-sm group-data-[size=sm]/avatar:text-xs",
779
+ "relative z-10 flex size-full items-center justify-center rounded-full",
780
+ branded ? cn(
781
+ "bg-transparent font-medium",
782
+ TIMBAL_V2_LABEL.secondary,
783
+ "text-sm group-data-[size=sm]/avatar:text-xs"
784
+ ) : "bg-muted font-normal text-muted-foreground text-sm group-data-[size=sm]/avatar:text-xs",
682
785
  className
683
786
  ),
684
- ...props
787
+ style,
788
+ ...props,
789
+ children
685
790
  }
686
791
  );
687
792
  }
@@ -2310,7 +2415,7 @@ function CommandShortcut({
2310
2415
  }
2311
2416
 
2312
2417
  // src/ui/calendar.tsx
2313
- var React2 = __toESM(require("react"), 1);
2418
+ var React3 = __toESM(require("react"), 1);
2314
2419
  var import_lucide_react11 = require("lucide-react");
2315
2420
  var import_react_day_picker = require("react-day-picker");
2316
2421
  var import_jsx_runtime23 = require("react/jsx-runtime");
@@ -2383,8 +2488,8 @@ function CalendarDayButton({
2383
2488
  modifiers,
2384
2489
  ...props
2385
2490
  }) {
2386
- const ref = React2.useRef(null);
2387
- React2.useEffect(() => {
2491
+ const ref = React3.useRef(null);
2492
+ React3.useEffect(() => {
2388
2493
  if (modifiers.focused) ref.current?.focus();
2389
2494
  }, [modifiers.focused]);
2390
2495
  return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
@@ -2894,7 +2999,7 @@ function Separator({
2894
2999
  }
2895
3000
 
2896
3001
  // src/ui/slider.tsx
2897
- var React3 = __toESM(require("react"), 1);
3002
+ var React4 = __toESM(require("react"), 1);
2898
3003
  var import_radix_ui21 = require("radix-ui");
2899
3004
  var import_jsx_runtime32 = require("react/jsx-runtime");
2900
3005
  function Slider({
@@ -2905,7 +3010,7 @@ function Slider({
2905
3010
  max = 100,
2906
3011
  ...props
2907
3012
  }) {
2908
- const thumbs = React3.useMemo(() => {
3013
+ const thumbs = React4.useMemo(() => {
2909
3014
  if (Array.isArray(value)) return value;
2910
3015
  if (Array.isArray(defaultValue)) return defaultValue;
2911
3016
  return [min];
@@ -3807,10 +3912,234 @@ function Skeleton({ className, ...props }) {
3807
3912
  );
3808
3913
  }
3809
3914
 
3810
- // src/ui/table.tsx
3915
+ // src/ui/chart.tsx
3916
+ var React5 = __toESM(require("react"), 1);
3917
+ var RechartsPrimitive = __toESM(require("recharts"), 1);
3811
3918
  var import_jsx_runtime46 = require("react/jsx-runtime");
3919
+ var THEMES = { light: "", dark: ".dark" };
3920
+ var ChartContext = React5.createContext(null);
3921
+ function useChart() {
3922
+ const context = React5.useContext(ChartContext);
3923
+ if (!context) {
3924
+ throw new Error("useChart must be used within a <ChartContainer />");
3925
+ }
3926
+ return context;
3927
+ }
3928
+ function ChartContainer({
3929
+ id,
3930
+ className,
3931
+ children,
3932
+ config,
3933
+ ...props
3934
+ }) {
3935
+ const uniqueId = React5.useId();
3936
+ const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
3937
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ChartContext.Provider, { value: { config }, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
3938
+ "div",
3939
+ {
3940
+ "data-slot": "chart",
3941
+ "data-chart": chartId,
3942
+ className: cn(
3943
+ "[&_.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",
3944
+ className
3945
+ ),
3946
+ ...props,
3947
+ children: [
3948
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ChartStyle, { id: chartId, config }),
3949
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(RechartsPrimitive.ResponsiveContainer, { children })
3950
+ ]
3951
+ }
3952
+ ) });
3953
+ }
3954
+ var ChartStyle = ({ id, config }) => {
3955
+ const colorConfig = Object.entries(config).filter(
3956
+ ([, c]) => c.theme || c.color
3957
+ );
3958
+ if (!colorConfig.length) {
3959
+ return null;
3960
+ }
3961
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3962
+ "style",
3963
+ {
3964
+ dangerouslySetInnerHTML: {
3965
+ __html: Object.entries(THEMES).map(
3966
+ ([theme, prefix]) => `
3967
+ ${prefix} [data-chart=${id}] {
3968
+ ${colorConfig.map(([key, itemConfig]) => {
3969
+ const color = itemConfig.theme?.[theme] || itemConfig.color;
3970
+ return color ? ` --color-${key}: ${color};` : null;
3971
+ }).join("\n")}
3972
+ }
3973
+ `
3974
+ ).join("\n")
3975
+ }
3976
+ }
3977
+ );
3978
+ };
3979
+ var ChartTooltip = RechartsPrimitive.Tooltip;
3980
+ function ChartTooltipContent({
3981
+ active,
3982
+ payload,
3983
+ className,
3984
+ indicator = "dot",
3985
+ hideLabel = false,
3986
+ hideIndicator = false,
3987
+ label,
3988
+ labelFormatter,
3989
+ labelClassName,
3990
+ formatter,
3991
+ color,
3992
+ nameKey,
3993
+ labelKey
3994
+ }) {
3995
+ const { config } = useChart();
3996
+ const tooltipLabel = React5.useMemo(() => {
3997
+ if (hideLabel || !payload?.length) {
3998
+ return null;
3999
+ }
4000
+ const [item] = payload;
4001
+ const key = `${labelKey || item?.dataKey || item?.name || "value"}`;
4002
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
4003
+ const value = !labelKey && typeof label === "string" ? config[label]?.label || label : itemConfig?.label;
4004
+ if (labelFormatter) {
4005
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: cn("font-medium", labelClassName), children: labelFormatter(value, payload) });
4006
+ }
4007
+ if (!value) {
4008
+ return null;
4009
+ }
4010
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: cn("font-medium", labelClassName), children: value });
4011
+ }, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);
4012
+ if (!active || !payload?.length) {
4013
+ return null;
4014
+ }
4015
+ const nestLabel = payload.length === 1 && indicator !== "dot";
4016
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
4017
+ "div",
4018
+ {
4019
+ className: cn(
4020
+ "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",
4021
+ "animate-in fade-in-0 zoom-in-95 duration-150",
4022
+ className
4023
+ ),
4024
+ children: [
4025
+ !nestLabel ? tooltipLabel : null,
4026
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "grid gap-1.5", children: payload.filter((item) => item.type !== "none").map((item, index) => {
4027
+ const key = `${nameKey || item.name || item.dataKey || "value"}`;
4028
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
4029
+ const indicatorColor = color || item.payload?.fill || item.color;
4030
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4031
+ "div",
4032
+ {
4033
+ className: cn(
4034
+ "[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",
4035
+ indicator === "dot" && "items-center"
4036
+ ),
4037
+ children: formatter && item?.value !== void 0 && item.name ? formatter(item.value, item.name, item, index, item.payload) : /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
4038
+ itemConfig?.icon ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(itemConfig.icon, {}) : !hideIndicator && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4039
+ "div",
4040
+ {
4041
+ className: cn(
4042
+ "shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",
4043
+ {
4044
+ "h-2.5 w-2.5": indicator === "dot",
4045
+ "w-1": indicator === "line",
4046
+ "w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
4047
+ "my-0.5": nestLabel && indicator === "dashed"
4048
+ }
4049
+ ),
4050
+ style: {
4051
+ "--color-bg": indicatorColor,
4052
+ "--color-border": indicatorColor
4053
+ }
4054
+ }
4055
+ ),
4056
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
4057
+ "div",
4058
+ {
4059
+ className: cn(
4060
+ "flex flex-1 justify-between leading-none",
4061
+ nestLabel ? "items-end" : "items-center"
4062
+ ),
4063
+ children: [
4064
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "grid gap-1.5", children: [
4065
+ nestLabel ? tooltipLabel : null,
4066
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-muted-foreground", children: itemConfig?.label || item.name })
4067
+ ] }),
4068
+ item.value != null && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-foreground font-mono font-medium tabular-nums", children: typeof item.value === "number" ? item.value.toLocaleString() : String(item.value) })
4069
+ ]
4070
+ }
4071
+ )
4072
+ ] })
4073
+ },
4074
+ `${item.dataKey ?? index}`
4075
+ );
4076
+ }) })
4077
+ ]
4078
+ }
4079
+ );
4080
+ }
4081
+ var ChartLegend = RechartsPrimitive.Legend;
4082
+ function ChartLegendContent({
4083
+ className,
4084
+ hideIcon = false,
4085
+ payload,
4086
+ verticalAlign = "bottom",
4087
+ nameKey
4088
+ }) {
4089
+ const { config } = useChart();
4090
+ if (!payload?.length) {
4091
+ return null;
4092
+ }
4093
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4094
+ "div",
4095
+ {
4096
+ className: cn(
4097
+ "flex items-center justify-center gap-4",
4098
+ verticalAlign === "top" ? "pb-3" : "pt-3",
4099
+ className
4100
+ ),
4101
+ children: payload.filter((item) => item.type !== "none").map((item, index) => {
4102
+ const key = `${nameKey || item.dataKey || "value"}`;
4103
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
4104
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
4105
+ "div",
4106
+ {
4107
+ className: "[&>svg]:text-muted-foreground flex min-w-0 max-w-[8rem] items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3",
4108
+ children: [
4109
+ itemConfig?.icon && !hideIcon ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(itemConfig.icon, {}) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4110
+ "div",
4111
+ {
4112
+ className: "h-2 w-2 shrink-0 rounded-[2px]",
4113
+ style: { backgroundColor: item.color }
4114
+ }
4115
+ ),
4116
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "min-w-0 truncate", children: itemConfig?.label ?? (item.value != null ? String(item.value) : null) })
4117
+ ]
4118
+ },
4119
+ `${item.value ?? index}`
4120
+ );
4121
+ })
4122
+ }
4123
+ );
4124
+ }
4125
+ function getPayloadConfigFromPayload(config, payload, key) {
4126
+ if (typeof payload !== "object" || payload === null) {
4127
+ return void 0;
4128
+ }
4129
+ const payloadPayload = "payload" in payload && typeof payload.payload === "object" && payload.payload !== null ? payload.payload : void 0;
4130
+ let configLabelKey = key;
4131
+ if (key in payload && typeof payload[key] === "string") {
4132
+ configLabelKey = payload[key];
4133
+ } else if (payloadPayload && key in payloadPayload && typeof payloadPayload[key] === "string") {
4134
+ configLabelKey = payloadPayload[key];
4135
+ }
4136
+ return configLabelKey in config ? config[configLabelKey] : config[key];
4137
+ }
4138
+
4139
+ // src/ui/table.tsx
4140
+ var import_jsx_runtime47 = require("react/jsx-runtime");
3812
4141
  function Table({ className, ...props }) {
3813
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { "data-slot": "table-container", className: "relative w-full overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4142
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { "data-slot": "table-container", className: "relative w-full overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
3814
4143
  "table",
3815
4144
  {
3816
4145
  "data-slot": "table",
@@ -3820,7 +4149,7 @@ function Table({ className, ...props }) {
3820
4149
  ) });
3821
4150
  }
3822
4151
  function TableHeader({ className, ...props }) {
3823
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4152
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
3824
4153
  "thead",
3825
4154
  {
3826
4155
  "data-slot": "table-header",
@@ -3830,7 +4159,7 @@ function TableHeader({ className, ...props }) {
3830
4159
  );
3831
4160
  }
3832
4161
  function TableBody({ className, ...props }) {
3833
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4162
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
3834
4163
  "tbody",
3835
4164
  {
3836
4165
  "data-slot": "table-body",
@@ -3840,7 +4169,7 @@ function TableBody({ className, ...props }) {
3840
4169
  );
3841
4170
  }
3842
4171
  function TableFooter({ className, ...props }) {
3843
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4172
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
3844
4173
  "tfoot",
3845
4174
  {
3846
4175
  "data-slot": "table-footer",
@@ -3853,7 +4182,7 @@ function TableFooter({ className, ...props }) {
3853
4182
  );
3854
4183
  }
3855
4184
  function TableRow({ className, ...props }) {
3856
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4185
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
3857
4186
  "tr",
3858
4187
  {
3859
4188
  "data-slot": "table-row",
@@ -3866,7 +4195,7 @@ function TableRow({ className, ...props }) {
3866
4195
  );
3867
4196
  }
3868
4197
  function TableHead({ className, ...props }) {
3869
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4198
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
3870
4199
  "th",
3871
4200
  {
3872
4201
  "data-slot": "table-head",
@@ -3879,7 +4208,7 @@ function TableHead({ className, ...props }) {
3879
4208
  );
3880
4209
  }
3881
4210
  function TableCell({ className, ...props }) {
3882
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4211
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
3883
4212
  "td",
3884
4213
  {
3885
4214
  "data-slot": "table-cell",
@@ -3892,7 +4221,7 @@ function TableCell({ className, ...props }) {
3892
4221
  );
3893
4222
  }
3894
4223
  function TableCaption({ className, ...props }) {
3895
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4224
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
3896
4225
  "caption",
3897
4226
  {
3898
4227
  "data-slot": "table-caption",
@@ -3905,17 +4234,17 @@ function TableCaption({ className, ...props }) {
3905
4234
  // src/ui/toast.tsx
3906
4235
  var import_radix_ui32 = require("radix-ui");
3907
4236
  var import_lucide_react18 = require("lucide-react");
3908
- var import_jsx_runtime47 = require("react/jsx-runtime");
4237
+ var import_jsx_runtime48 = require("react/jsx-runtime");
3909
4238
  function ToastProvider({
3910
4239
  ...props
3911
4240
  }) {
3912
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_radix_ui32.Toast.Provider, { "data-slot": "toast-provider", ...props });
4241
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_radix_ui32.Toast.Provider, { "data-slot": "toast-provider", ...props });
3913
4242
  }
3914
4243
  function ToastViewport({
3915
4244
  className,
3916
4245
  ...props
3917
4246
  }) {
3918
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
4247
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
3919
4248
  import_radix_ui32.Toast.Viewport,
3920
4249
  {
3921
4250
  "data-slot": "toast-viewport",
@@ -3932,7 +4261,7 @@ function Toast({
3932
4261
  variant = "default",
3933
4262
  ...props
3934
4263
  }) {
3935
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
4264
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
3936
4265
  import_radix_ui32.Toast.Root,
3937
4266
  {
3938
4267
  "data-slot": "toast",
@@ -3951,7 +4280,7 @@ function ToastAction({
3951
4280
  className,
3952
4281
  ...props
3953
4282
  }) {
3954
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
4283
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
3955
4284
  import_radix_ui32.Toast.Action,
3956
4285
  {
3957
4286
  "data-slot": "toast-action",
@@ -3967,7 +4296,7 @@ function ToastClose({
3967
4296
  className,
3968
4297
  ...props
3969
4298
  }) {
3970
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
4299
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
3971
4300
  import_radix_ui32.Toast.Close,
3972
4301
  {
3973
4302
  "data-slot": "toast-close",
@@ -3977,7 +4306,7 @@ function ToastClose({
3977
4306
  ),
3978
4307
  "toast-close": "",
3979
4308
  ...props,
3980
- children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react18.XIcon, { className: "size-4" })
4309
+ children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react18.XIcon, { className: "size-4" })
3981
4310
  }
3982
4311
  );
3983
4312
  }
@@ -3985,7 +4314,7 @@ function ToastTitle({
3985
4314
  className,
3986
4315
  ...props
3987
4316
  }) {
3988
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
4317
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
3989
4318
  import_radix_ui32.Toast.Title,
3990
4319
  {
3991
4320
  "data-slot": "toast-title",
@@ -3998,7 +4327,7 @@ function ToastDescription({
3998
4327
  className,
3999
4328
  ...props
4000
4329
  }) {
4001
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
4330
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
4002
4331
  import_radix_ui32.Toast.Description,
4003
4332
  {
4004
4333
  "data-slot": "toast-description",
@@ -4009,7 +4338,7 @@ function ToastDescription({
4009
4338
  }
4010
4339
 
4011
4340
  // src/ui/use-toast.ts
4012
- var React4 = __toESM(require("react"), 1);
4341
+ var React6 = __toESM(require("react"), 1);
4013
4342
  var TOAST_LIMIT = 3;
4014
4343
  var TOAST_REMOVE_DELAY = 5e3;
4015
4344
  var listeners = /* @__PURE__ */ new Set();
@@ -4062,8 +4391,8 @@ function toast(input) {
4062
4391
  return memoryState.add(input);
4063
4392
  }
4064
4393
  function useToast() {
4065
- const [state, setState] = React4.useState(memoryState);
4066
- React4.useEffect(() => {
4394
+ const [state, setState] = React6.useState(memoryState);
4395
+ React6.useEffect(() => {
4067
4396
  listeners.add(setState);
4068
4397
  return () => {
4069
4398
  listeners.delete(setState);
@@ -4077,33 +4406,33 @@ function useToast() {
4077
4406
  }
4078
4407
 
4079
4408
  // src/ui/toaster.tsx
4080
- var import_jsx_runtime48 = require("react/jsx-runtime");
4409
+ var import_jsx_runtime49 = require("react/jsx-runtime");
4081
4410
  function Toaster() {
4082
4411
  const { toasts, dismiss } = useToast();
4083
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(ToastProvider, { children: [
4084
- toasts.map(({ id, title, description, variant }) => /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
4412
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(ToastProvider, { children: [
4413
+ toasts.map(({ id, title, description, variant }) => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
4085
4414
  Toast,
4086
4415
  {
4087
4416
  variant,
4088
4417
  onOpenChange: (open) => !open && dismiss(id),
4089
4418
  children: [
4090
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "grid gap-1", children: [
4091
- title ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ToastTitle, { children: title }) : null,
4092
- description ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ToastDescription, { children: description }) : null
4419
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "grid gap-1", children: [
4420
+ title ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ToastTitle, { children: title }) : null,
4421
+ description ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ToastDescription, { children: description }) : null
4093
4422
  ] }),
4094
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ToastClose, {})
4423
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ToastClose, {})
4095
4424
  ]
4096
4425
  },
4097
4426
  id
4098
4427
  )),
4099
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ToastViewport, {})
4428
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ToastViewport, {})
4100
4429
  ] });
4101
4430
  }
4102
4431
 
4103
4432
  // src/ui/shimmer.tsx
4104
4433
  var import_react = require("motion/react");
4105
4434
  var import_react2 = require("react");
4106
- var import_jsx_runtime49 = require("react/jsx-runtime");
4435
+ var import_jsx_runtime50 = require("react/jsx-runtime");
4107
4436
  var ShimmerComponent = ({
4108
4437
  children,
4109
4438
  as: Component = "p",
@@ -4118,7 +4447,7 @@ var ShimmerComponent = ({
4118
4447
  () => (children?.length ?? 0) * spread,
4119
4448
  [children, spread]
4120
4449
  );
4121
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
4450
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
4122
4451
  MotionComponent,
4123
4452
  {
4124
4453
  animate: { backgroundPosition: "0% center" },
@@ -4178,7 +4507,7 @@ var pillSegmentedActiveIndicatorClass = cn(
4178
4507
  );
4179
4508
 
4180
4509
  // src/ui/pill-segmented-tabs.tsx
4181
- var import_jsx_runtime50 = require("react/jsx-runtime");
4510
+ var import_jsx_runtime51 = require("react/jsx-runtime");
4182
4511
  var PillTab = ({
4183
4512
  tabKey,
4184
4513
  label,
@@ -4192,7 +4521,7 @@ var PillTab = ({
4192
4521
  const handlePress = (0, import_react3.useCallback)(() => {
4193
4522
  if (!disabled) onSelect(tabKey);
4194
4523
  }, [disabled, onSelect, tabKey]);
4195
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
4524
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
4196
4525
  "button",
4197
4526
  {
4198
4527
  type: "button",
@@ -4205,15 +4534,15 @@ var PillTab = ({
4205
4534
  !disabled && (isActive ? "text-foreground" : "text-muted-foreground hover:text-foreground")
4206
4535
  ),
4207
4536
  children: [
4208
- isActive && animateIndicator ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
4537
+ isActive && animateIndicator ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
4209
4538
  import_react4.motion.div,
4210
4539
  {
4211
4540
  layoutId,
4212
4541
  className: pillSegmentedActiveIndicatorClass,
4213
4542
  transition: { type: "spring", duration: 0.3, bounce: 0.15 }
4214
4543
  }
4215
- ) : isActive ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: pillSegmentedActiveIndicatorClass, "aria-hidden": true }) : null,
4216
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "relative z-10 whitespace-nowrap", children: label })
4544
+ ) : isActive ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: pillSegmentedActiveIndicatorClass, "aria-hidden": true }) : null,
4545
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "relative z-10 whitespace-nowrap", children: label })
4217
4546
  ]
4218
4547
  }
4219
4548
  );
@@ -4233,7 +4562,7 @@ var PillSegmentedTabs = ({
4233
4562
  const isFlush = trackVariant === "flush";
4234
4563
  const trackClass = isFlush ? pillSegmentedTrackFlushClass : pillSegmentedTrackClass;
4235
4564
  const segmentClassName = isFlush ? pillSegmentedFlushSegmentClass : pillSegmentedSegmentClass;
4236
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { role: "group", "aria-label": ariaLabel, className: cn(trackClass, className), children: tabs.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
4565
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { role: "group", "aria-label": ariaLabel, className: cn(trackClass, className), children: tabs.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
4237
4566
  PillTab,
4238
4567
  {
4239
4568
  tabKey: tab.key,
@@ -4251,6 +4580,7 @@ var PillSegmentedTabs = ({
4251
4580
  var MemoPillSegmentedTabs = (0, import_react3.memo)(PillSegmentedTabs);
4252
4581
  // Annotate the CommonJS export names for ESM import in node:
4253
4582
  0 && (module.exports = {
4583
+ AVATAR_PRIMARY_FALLBACK_CLASS,
4254
4584
  Accordion,
4255
4585
  AccordionContent,
4256
4586
  AccordionItem,
@@ -4291,6 +4621,12 @@ var MemoPillSegmentedTabs = (0, import_react3.memo)(PillSegmentedTabs);
4291
4621
  CardFooter,
4292
4622
  CardHeader,
4293
4623
  CardTitle,
4624
+ ChartContainer,
4625
+ ChartLegend,
4626
+ ChartLegendContent,
4627
+ ChartStyle,
4628
+ ChartTooltip,
4629
+ ChartTooltipContent,
4294
4630
  Checkbox,
4295
4631
  Collapsible,
4296
4632
  CollapsibleContent,
@@ -4478,6 +4814,7 @@ var MemoPillSegmentedTabs = (0, import_react3.memo)(PillSegmentedTabs);
4478
4814
  TooltipProvider,
4479
4815
  TooltipTrigger,
4480
4816
  alertVariants,
4817
+ avatarChartVariantClass,
4481
4818
  badgeVariants,
4482
4819
  controlClass,
4483
4820
  controlSurfaceClass,
@@ -4489,5 +4826,6 @@ var MemoPillSegmentedTabs = (0, import_react3.memo)(PillSegmentedTabs);
4489
4826
  overlaySurfaceClass,
4490
4827
  toast,
4491
4828
  toggleVariants,
4829
+ useChart,
4492
4830
  useToast
4493
4831
  });