@turingpaper/ui 0.0.1-test.2 → 0.0.1-test.3

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 (74) hide show
  1. package/dist/accordion.mjs +44 -83
  2. package/dist/alert-dialog.mjs +108 -175
  3. package/dist/avatar.mjs +40 -104
  4. package/dist/badge.mjs +10 -27
  5. package/dist/breadcrumb.mjs +82 -109
  6. package/dist/button.mjs +26 -38
  7. package/dist/card.mjs +62 -96
  8. package/dist/chart.mjs +208 -0
  9. package/dist/checkbox.mjs +25 -32
  10. package/dist/collapsible.mjs +5 -32
  11. package/dist/command.mjs +101 -165
  12. package/dist/components/accordion.d.ts +4 -5
  13. package/dist/components/alert-dialog.d.ts +19 -17
  14. package/dist/components/avatar.d.ts +4 -10
  15. package/dist/components/badge.d.ts +4 -4
  16. package/dist/components/breadcrumb.d.ts +16 -8
  17. package/dist/components/button.d.ts +5 -4
  18. package/dist/components/card.d.ts +7 -10
  19. package/dist/components/chart.d.ts +62 -0
  20. package/dist/components/checkbox.d.ts +1 -2
  21. package/dist/components/collapsible.d.ts +3 -4
  22. package/dist/components/command.d.ts +78 -16
  23. package/dist/components/dialog.d.ts +18 -16
  24. package/dist/components/drawer.d.ts +19 -10
  25. package/dist/components/dropdown-menu.d.ts +21 -27
  26. package/dist/components/hover-card.d.ts +3 -4
  27. package/dist/components/input-group.d.ts +1 -1
  28. package/dist/components/input-otp.d.ts +34 -0
  29. package/dist/components/input.d.ts +1 -1
  30. package/dist/components/label.d.ts +1 -2
  31. package/dist/components/pagination.d.ts +24 -13
  32. package/dist/components/popover.d.ts +4 -9
  33. package/dist/components/progress.d.ts +1 -2
  34. package/dist/components/radio-group.d.ts +2 -3
  35. package/dist/components/scroll-area.d.ts +2 -3
  36. package/dist/components/select.d.ts +11 -14
  37. package/dist/components/separator.d.ts +1 -2
  38. package/dist/components/sheet.d.ts +24 -13
  39. package/dist/components/skeleton.d.ts +1 -1
  40. package/dist/components/slider.d.ts +1 -2
  41. package/dist/components/switch.d.ts +1 -4
  42. package/dist/components/table.d.ts +8 -8
  43. package/dist/components/tabs.d.ts +5 -10
  44. package/dist/components/textarea.d.ts +1 -1
  45. package/dist/components/toggle-group.d.ts +2 -8
  46. package/dist/components/toggle.d.ts +1 -3
  47. package/dist/components/tooltip.d.ts +5 -6
  48. package/dist/dialog.mjs +91 -147
  49. package/dist/drawer.mjs +89 -118
  50. package/dist/dropdown-menu.mjs +141 -249
  51. package/dist/hover-card.mjs +20 -35
  52. package/dist/input-otp.mjs +48 -0
  53. package/dist/input.mjs +15 -13
  54. package/dist/label.mjs +17 -20
  55. package/dist/pagination.mjs +103 -126
  56. package/dist/popover.mjs +19 -76
  57. package/dist/progress.mjs +23 -28
  58. package/dist/provider.mjs +1 -1
  59. package/dist/radio-group.mjs +29 -42
  60. package/dist/scroll-area.mjs +36 -57
  61. package/dist/select.mjs +117 -182
  62. package/dist/separator.mjs +16 -18
  63. package/dist/sheet.mjs +99 -128
  64. package/dist/skeleton.mjs +8 -6
  65. package/dist/slider.mjs +21 -57
  66. package/dist/styles.css +1 -1
  67. package/dist/switch.mjs +25 -29
  68. package/dist/table.mjs +83 -110
  69. package/dist/tabs.mjs +42 -86
  70. package/dist/textarea.mjs +16 -16
  71. package/dist/toggle-group.mjs +32 -67
  72. package/dist/toggle.mjs +22 -28
  73. package/dist/tooltip.mjs +20 -52
  74. package/package.json +11 -1
@@ -1,117 +1,90 @@
1
- import { jsx as a, jsxs as s } from "react/jsx-runtime";
2
- import { Slot as i } from "radix-ui";
3
- import { cn as t } from "./utils.mjs";
4
- import { MoreHorizontalIcon as l, ChevronRightIcon as c } from "lucide-react";
5
- function p({ className: r, ...e }) {
6
- return /* @__PURE__ */ a(
7
- "nav",
8
- {
9
- "aria-label": "breadcrumb",
10
- "data-slot": "breadcrumb",
11
- className: t(r),
12
- ...e
13
- }
14
- );
15
- }
16
- function f({ className: r, ...e }) {
17
- return /* @__PURE__ */ a(
18
- "ol",
19
- {
20
- "data-slot": "breadcrumb-list",
21
- className: t(
22
- "flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground sm:gap-2.5",
23
- r
24
- ),
25
- ...e
26
- }
27
- );
28
- }
29
- function g({ className: r, ...e }) {
30
- return /* @__PURE__ */ a(
31
- "li",
32
- {
33
- "data-slot": "breadcrumb-item",
34
- className: t("inline-flex items-center gap-1.5", r),
35
- ...e
36
- }
37
- );
38
- }
39
- function x({
40
- asChild: r,
41
- className: e,
42
- ...n
43
- }) {
44
- const o = r ? i.Root : "a";
45
- return /* @__PURE__ */ a(
46
- o,
47
- {
48
- "data-slot": "breadcrumb-link",
49
- className: t("transition-colors hover:text-foreground", e),
50
- ...n
51
- }
52
- );
53
- }
54
- function h({ className: r, ...e }) {
55
- return /* @__PURE__ */ a(
56
- "span",
57
- {
58
- "data-slot": "breadcrumb-page",
59
- role: "link",
60
- "aria-disabled": "true",
61
- "aria-current": "page",
62
- className: t("font-normal text-foreground", r),
63
- ...e
64
- }
65
- );
66
- }
67
- function N({
1
+ import { jsx as s, jsxs as i } from "react/jsx-runtime";
2
+ import * as t from "react";
3
+ import { Slot as n } from "radix-ui";
4
+ import { MoreHorizontal as c, ChevronRight as d } from "lucide-react";
5
+ import { cn as o } from "./utils.mjs";
6
+ const l = t.forwardRef(({ ...r }, e) => /* @__PURE__ */ s("nav", { ref: e, "aria-label": "breadcrumb", ...r }));
7
+ l.displayName = "Breadcrumb";
8
+ const p = t.forwardRef(({ className: r, ...e }, a) => /* @__PURE__ */ s(
9
+ "ol",
10
+ {
11
+ ref: a,
12
+ className: o(
13
+ "flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",
14
+ r
15
+ ),
16
+ ...e
17
+ }
18
+ ));
19
+ p.displayName = "BreadcrumbList";
20
+ const u = t.forwardRef(({ className: r, ...e }, a) => /* @__PURE__ */ s(
21
+ "li",
22
+ {
23
+ ref: a,
24
+ className: o("inline-flex items-center gap-1.5", r),
25
+ ...e
26
+ }
27
+ ));
28
+ u.displayName = "BreadcrumbItem";
29
+ const f = t.forwardRef(({ asChild: r, className: e, ...a }, m) => /* @__PURE__ */ s(
30
+ r ? n : "a",
31
+ {
32
+ ref: m,
33
+ className: o("transition-colors hover:text-foreground", e),
34
+ ...a
35
+ }
36
+ ));
37
+ f.displayName = "BreadcrumbLink";
38
+ const b = t.forwardRef(({ className: r, ...e }, a) => /* @__PURE__ */ s(
39
+ "span",
40
+ {
41
+ ref: a,
42
+ role: "link",
43
+ "aria-disabled": "true",
44
+ "aria-current": "page",
45
+ className: o("font-normal text-foreground", r),
46
+ ...e
47
+ }
48
+ ));
49
+ b.displayName = "BreadcrumbPage";
50
+ const N = ({
68
51
  children: r,
69
52
  className: e,
70
- ...n
71
- }) {
72
- return /* @__PURE__ */ a(
73
- "li",
74
- {
75
- "data-slot": "breadcrumb-separator",
76
- role: "presentation",
77
- "aria-hidden": "true",
78
- className: t("[&>svg]:size-3.5", e),
79
- ...n,
80
- children: r ?? /* @__PURE__ */ a(c, {})
81
- }
82
- );
83
- }
84
- function B({
53
+ ...a
54
+ }) => /* @__PURE__ */ s(
55
+ "li",
56
+ {
57
+ role: "presentation",
58
+ "aria-hidden": "true",
59
+ className: o("[&>svg]:w-3.5 [&>svg]:h-3.5", e),
60
+ ...a,
61
+ children: r ?? /* @__PURE__ */ s(d, {})
62
+ }
63
+ );
64
+ N.displayName = "BreadcrumbSeparator";
65
+ const B = ({
85
66
  className: r,
86
67
  ...e
87
- }) {
88
- return /* @__PURE__ */ s(
89
- "span",
90
- {
91
- "data-slot": "breadcrumb-ellipsis",
92
- role: "presentation",
93
- "aria-hidden": "true",
94
- className: t(
95
- "flex size-5 items-center justify-center [&>svg]:size-4",
96
- r
97
- ),
98
- ...e,
99
- children: [
100
- /* @__PURE__ */ a(
101
- l,
102
- {}
103
- ),
104
- /* @__PURE__ */ a("span", { className: "sr-only", children: "More" })
105
- ]
106
- }
107
- );
108
- }
68
+ }) => /* @__PURE__ */ i(
69
+ "span",
70
+ {
71
+ role: "presentation",
72
+ "aria-hidden": "true",
73
+ className: o("flex h-9 w-9 items-center justify-center", r),
74
+ ...e,
75
+ children: [
76
+ /* @__PURE__ */ s(c, { className: "h-4 w-4" }),
77
+ /* @__PURE__ */ s("span", { className: "sr-only", children: "More" })
78
+ ]
79
+ }
80
+ );
81
+ B.displayName = "BreadcrumbElipssis";
109
82
  export {
110
- p as Breadcrumb,
83
+ l as Breadcrumb,
111
84
  B as BreadcrumbEllipsis,
112
- g as BreadcrumbItem,
113
- x as BreadcrumbLink,
114
- f as BreadcrumbList,
115
- h as BreadcrumbPage,
85
+ u as BreadcrumbItem,
86
+ f as BreadcrumbLink,
87
+ p as BreadcrumbList,
88
+ b as BreadcrumbPage,
116
89
  N as BreadcrumbSeparator
117
90
  };
package/dist/button.mjs CHANGED
@@ -1,28 +1,25 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { cva as s } from "class-variance-authority";
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import * as a from "react";
3
3
  import { Slot as d } from "radix-ui";
4
- import { cn as l } from "./utils.mjs";
5
- const u = s(
6
- "group/button inline-flex shrink-0 items-center justify-center rounded-4xl border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
4
+ import { cva as c } from "class-variance-authority";
5
+ import { cn as u } from "./utils.mjs";
6
+ const f = c(
7
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
7
8
  {
8
9
  variants: {
9
10
  variant: {
10
- default: "bg-primary text-primary-foreground hover:bg-primary/80",
11
- outline: "border-border bg-input/30 hover:bg-input/50 hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground",
12
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
13
- ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
14
- destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
11
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
12
+ destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
13
+ outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
14
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
15
+ ghost: "hover:bg-accent hover:text-accent-foreground",
15
16
  link: "text-primary underline-offset-4 hover:underline"
16
17
  },
17
18
  size: {
18
- default: "h-9 gap-1.5 px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5",
19
- xs: "h-6 gap-1 px-2.5 text-xs has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3",
20
- sm: "h-8 gap-1 px-3 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
21
- lg: "h-10 gap-1.5 px-4 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",
22
- icon: "size-9",
23
- "icon-xs": "size-6 [&_svg:not([class*='size-'])]:size-3",
24
- "icon-sm": "size-8",
25
- "icon-lg": "size-10"
19
+ default: "h-10 px-4 py-2",
20
+ sm: "h-9 rounded-md px-3",
21
+ lg: "h-11 rounded-md px-8",
22
+ icon: "h-10 w-10"
26
23
  }
27
24
  },
28
25
  defaultVariants: {
@@ -30,27 +27,18 @@ const u = s(
30
27
  size: "default"
31
28
  }
32
29
  }
33
- );
34
- function b({
35
- className: t,
36
- variant: e = "default",
37
- size: i = "default",
38
- asChild: r = !1,
39
- ...a
40
- }) {
41
- const n = r ? d.Root : "button";
42
- return /* @__PURE__ */ o(
43
- n,
30
+ ), g = a.forwardRef(
31
+ ({ className: e, variant: r, size: t, asChild: o = !1, ...n }, i) => /* @__PURE__ */ s(
32
+ o ? d : "button",
44
33
  {
45
- "data-slot": "button",
46
- "data-variant": e,
47
- "data-size": i,
48
- className: l(u({ variant: e, size: i, className: t })),
49
- ...a
34
+ className: u(f({ variant: r, size: t, className: e })),
35
+ ref: i,
36
+ ...n
50
37
  }
51
- );
52
- }
38
+ )
39
+ );
40
+ g.displayName = "Button";
53
41
  export {
54
- b as Button,
55
- u as buttonVariants
42
+ g as Button,
43
+ f as buttonVariants
56
44
  };
package/dist/card.mjs CHANGED
@@ -1,98 +1,64 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { cn as d } from "./utils.mjs";
3
- function i({
4
- className: a,
5
- size: r = "default",
6
- ...e
7
- }) {
8
- return /* @__PURE__ */ t(
9
- "div",
10
- {
11
- "data-slot": "card",
12
- "data-size": r,
13
- className: d(
14
- "group/card flex flex-col gap-6 overflow-hidden rounded-2xl bg-card py-6 text-sm text-card-foreground ring-1 ring-foreground/10 has-[>img:first-child]:pt-0 data-[size=sm]:gap-4 data-[size=sm]:py-4 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",
15
- a
16
- ),
17
- ...e
18
- }
19
- );
20
- }
21
- function n({ className: a, ...r }) {
22
- return /* @__PURE__ */ t(
23
- "div",
24
- {
25
- "data-slot": "card-header",
26
- className: d(
27
- "group/card-header @container/card-header grid auto-rows-min items-start gap-2 rounded-t-xl px-6 group-data-[size=sm]/card:px-4 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-6 group-data-[size=sm]/card:[.border-b]:pb-4",
28
- a
29
- ),
30
- ...r
31
- }
32
- );
33
- }
34
- function c({ className: a, ...r }) {
35
- return /* @__PURE__ */ t(
36
- "div",
37
- {
38
- "data-slot": "card-title",
39
- className: d("text-base font-medium", a),
40
- ...r
41
- }
42
- );
43
- }
44
- function l({ className: a, ...r }) {
45
- return /* @__PURE__ */ t(
46
- "div",
47
- {
48
- "data-slot": "card-description",
49
- className: d("text-sm text-muted-foreground", a),
50
- ...r
51
- }
52
- );
53
- }
54
- function u({ className: a, ...r }) {
55
- return /* @__PURE__ */ t(
56
- "div",
57
- {
58
- "data-slot": "card-action",
59
- className: d(
60
- "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
61
- a
62
- ),
63
- ...r
64
- }
65
- );
66
- }
67
- function p({ className: a, ...r }) {
68
- return /* @__PURE__ */ t(
69
- "div",
70
- {
71
- "data-slot": "card-content",
72
- className: d("px-6 group-data-[size=sm]/card:px-4", a),
73
- ...r
74
- }
75
- );
76
- }
77
- function m({ className: a, ...r }) {
78
- return /* @__PURE__ */ t(
79
- "div",
80
- {
81
- "data-slot": "card-footer",
82
- className: d(
83
- "flex items-center rounded-b-xl px-6 group-data-[size=sm]/card:px-4 [.border-t]:pt-6 group-data-[size=sm]/card:[.border-t]:pt-4",
84
- a
85
- ),
86
- ...r
87
- }
88
- );
89
- }
1
+ import { jsx as d } from "react/jsx-runtime";
2
+ import * as o from "react";
3
+ import { cn as t } from "./utils.mjs";
4
+ const s = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
5
+ "div",
6
+ {
7
+ ref: r,
8
+ className: t(
9
+ "rounded-lg border bg-card text-card-foreground shadow-sm",
10
+ a
11
+ ),
12
+ ...e
13
+ }
14
+ ));
15
+ s.displayName = "Card";
16
+ const i = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
17
+ "div",
18
+ {
19
+ ref: r,
20
+ className: t("flex flex-col space-y-1.5 p-6", a),
21
+ ...e
22
+ }
23
+ ));
24
+ i.displayName = "CardHeader";
25
+ const m = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
26
+ "div",
27
+ {
28
+ ref: r,
29
+ className: t(
30
+ "text-2xl font-semibold leading-none tracking-tight",
31
+ a
32
+ ),
33
+ ...e
34
+ }
35
+ ));
36
+ m.displayName = "CardTitle";
37
+ const c = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
38
+ "div",
39
+ {
40
+ ref: r,
41
+ className: t("text-sm text-muted-foreground", a),
42
+ ...e
43
+ }
44
+ ));
45
+ c.displayName = "CardDescription";
46
+ const l = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d("div", { ref: r, className: t("p-6 pt-0", a), ...e }));
47
+ l.displayName = "CardContent";
48
+ const n = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
49
+ "div",
50
+ {
51
+ ref: r,
52
+ className: t("flex items-center p-6 pt-0", a),
53
+ ...e
54
+ }
55
+ ));
56
+ n.displayName = "CardFooter";
90
57
  export {
91
- i as Card,
92
- u as CardAction,
93
- p as CardContent,
94
- l as CardDescription,
95
- m as CardFooter,
96
- n as CardHeader,
97
- c as CardTitle
58
+ s as Card,
59
+ l as CardContent,
60
+ c as CardDescription,
61
+ n as CardFooter,
62
+ i as CardHeader,
63
+ m as CardTitle
98
64
  };
package/dist/chart.mjs ADDED
@@ -0,0 +1,208 @@
1
+ import { jsx as s, jsxs as g, Fragment as T } from "react/jsx-runtime";
2
+ import * as f from "react";
3
+ import * as w from "recharts";
4
+ import { cn as i } from "./utils.mjs";
5
+ const P = { light: "", dark: ".dark" }, N = f.createContext(null);
6
+ function j() {
7
+ const a = f.useContext(N);
8
+ if (!a)
9
+ throw new Error("useChart must be used within a <ChartContainer />");
10
+ return a;
11
+ }
12
+ const I = f.forwardRef(({ id: a, className: e, children: n, config: r, ...c }, d) => {
13
+ const l = f.useId(), o = `chart-${a || l.replace(/:/g, "")}`;
14
+ return /* @__PURE__ */ s(N.Provider, { value: { config: r }, children: /* @__PURE__ */ g(
15
+ "div",
16
+ {
17
+ "data-chart": o,
18
+ ref: d,
19
+ className: i(
20
+ "flex aspect-video justify-center text-xs [&_.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-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.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 [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",
21
+ e
22
+ ),
23
+ ...c,
24
+ children: [
25
+ /* @__PURE__ */ s(S, { id: o, config: r }),
26
+ /* @__PURE__ */ s(w.ResponsiveContainer, { children: n })
27
+ ]
28
+ }
29
+ ) });
30
+ });
31
+ I.displayName = "Chart";
32
+ const S = ({ id: a, config: e }) => {
33
+ const n = Object.entries(e).filter(
34
+ ([, r]) => r.theme || r.color
35
+ );
36
+ return n.length ? /* @__PURE__ */ s(
37
+ "style",
38
+ {
39
+ dangerouslySetInnerHTML: {
40
+ __html: Object.entries(P).map(
41
+ ([r, c]) => `
42
+ ${c} [data-chart=${a}] {
43
+ ${n.map(([d, l]) => {
44
+ const o = l.theme?.[r] || l.color;
45
+ return o ? ` --color-${d}: ${o};` : null;
46
+ }).join(`
47
+ `)}
48
+ }
49
+ `
50
+ ).join(`
51
+ `)
52
+ }
53
+ }
54
+ ) : null;
55
+ }, O = w.Tooltip, E = f.forwardRef(
56
+ ({
57
+ active: a,
58
+ payload: e,
59
+ className: n,
60
+ indicator: r = "dot",
61
+ hideLabel: c = !1,
62
+ hideIndicator: d = !1,
63
+ label: l,
64
+ labelFormatter: o,
65
+ labelClassName: m,
66
+ formatter: h,
67
+ color: $,
68
+ nameKey: L,
69
+ labelKey: x
70
+ }, R) => {
71
+ const { config: p } = j(), k = f.useMemo(() => {
72
+ if (c || !e?.length)
73
+ return null;
74
+ const [t] = e, b = `${x || t?.dataKey || t?.name || "value"}`, C = _(p, t, b), u = !x && typeof l == "string" ? p[l]?.label || l : C?.label;
75
+ return o ? /* @__PURE__ */ s("div", { className: i("font-medium", m), children: o(u, e) }) : u ? /* @__PURE__ */ s("div", { className: i("font-medium", m), children: u }) : null;
76
+ }, [
77
+ l,
78
+ o,
79
+ e,
80
+ c,
81
+ m,
82
+ p,
83
+ x
84
+ ]);
85
+ if (!a || !e?.length)
86
+ return null;
87
+ const v = e.length === 1 && r !== "dot";
88
+ return /* @__PURE__ */ g(
89
+ "div",
90
+ {
91
+ ref: R,
92
+ className: i(
93
+ "grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",
94
+ n
95
+ ),
96
+ children: [
97
+ v ? null : k,
98
+ /* @__PURE__ */ s("div", { className: "grid gap-1.5", children: e.filter((t) => t.type !== "none").map((t, b) => {
99
+ const C = `${L || t.name || t.dataKey || "value"}`, u = _(p, t, C), y = $ || t.payload.fill || t.color;
100
+ return /* @__PURE__ */ s(
101
+ "div",
102
+ {
103
+ className: i(
104
+ "flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",
105
+ r === "dot" && "items-center"
106
+ ),
107
+ children: h && t?.value !== void 0 && t.name ? h(t.value, t.name, t, b, t.payload) : /* @__PURE__ */ g(T, { children: [
108
+ u?.icon ? /* @__PURE__ */ s(u.icon, {}) : !d && /* @__PURE__ */ s(
109
+ "div",
110
+ {
111
+ className: i(
112
+ "shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",
113
+ {
114
+ "h-2.5 w-2.5": r === "dot",
115
+ "w-1": r === "line",
116
+ "w-0 border-[1.5px] border-dashed bg-transparent": r === "dashed",
117
+ "my-0.5": v && r === "dashed"
118
+ }
119
+ ),
120
+ style: {
121
+ "--color-bg": y,
122
+ "--color-border": y
123
+ }
124
+ }
125
+ ),
126
+ /* @__PURE__ */ g(
127
+ "div",
128
+ {
129
+ className: i(
130
+ "flex flex-1 justify-between leading-none",
131
+ v ? "items-end" : "items-center"
132
+ ),
133
+ children: [
134
+ /* @__PURE__ */ g("div", { className: "grid gap-1.5", children: [
135
+ v ? k : null,
136
+ /* @__PURE__ */ s("span", { className: "text-muted-foreground", children: u?.label || t.name })
137
+ ] }),
138
+ t.value && /* @__PURE__ */ s("span", { className: "font-mono font-medium tabular-nums text-foreground", children: t.value.toLocaleString() })
139
+ ]
140
+ }
141
+ )
142
+ ] })
143
+ },
144
+ t.dataKey
145
+ );
146
+ }) })
147
+ ]
148
+ }
149
+ );
150
+ }
151
+ );
152
+ E.displayName = "ChartTooltip";
153
+ const q = w.Legend, K = f.forwardRef(
154
+ ({ className: a, hideIcon: e = !1, payload: n, verticalAlign: r = "bottom", nameKey: c }, d) => {
155
+ const { config: l } = j();
156
+ return n?.length ? /* @__PURE__ */ s(
157
+ "div",
158
+ {
159
+ ref: d,
160
+ className: i(
161
+ "flex items-center justify-center gap-4",
162
+ r === "top" ? "pb-3" : "pt-3",
163
+ a
164
+ ),
165
+ children: n.filter((o) => o.type !== "none").map((o) => {
166
+ const m = `${c || o.dataKey || "value"}`, h = _(l, o, m);
167
+ return /* @__PURE__ */ g(
168
+ "div",
169
+ {
170
+ className: i(
171
+ "flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"
172
+ ),
173
+ children: [
174
+ h?.icon && !e ? /* @__PURE__ */ s(h.icon, {}) : /* @__PURE__ */ s(
175
+ "div",
176
+ {
177
+ className: "h-2 w-2 shrink-0 rounded-[2px]",
178
+ style: {
179
+ backgroundColor: o.color
180
+ }
181
+ }
182
+ ),
183
+ h?.label
184
+ ]
185
+ },
186
+ o.value
187
+ );
188
+ })
189
+ }
190
+ ) : null;
191
+ }
192
+ );
193
+ K.displayName = "ChartLegend";
194
+ function _(a, e, n) {
195
+ if (typeof e != "object" || e === null)
196
+ return;
197
+ const r = "payload" in e && typeof e.payload == "object" && e.payload !== null ? e.payload : void 0;
198
+ let c = n;
199
+ return n in e && typeof e[n] == "string" ? c = e[n] : r && n in r && typeof r[n] == "string" && (c = r[n]), c in a ? a[c] : a[n];
200
+ }
201
+ export {
202
+ I as ChartContainer,
203
+ q as ChartLegend,
204
+ K as ChartLegendContent,
205
+ S as ChartStyle,
206
+ O as ChartTooltip,
207
+ E as ChartTooltipContent
208
+ };