@cryptlex/web-components 1.0.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 (64) hide show
  1. package/README.md +39 -0
  2. package/dist/components/ui/badge.es.js +27 -0
  3. package/dist/components/ui/badge.es.js.map +1 -0
  4. package/dist/components/ui/breadcrumb.es.js +91 -0
  5. package/dist/components/ui/breadcrumb.es.js.map +1 -0
  6. package/dist/components/ui/button.es.js +64 -0
  7. package/dist/components/ui/button.es.js.map +1 -0
  8. package/dist/components/ui/calendar.es.js +63 -0
  9. package/dist/components/ui/calendar.es.js.map +1 -0
  10. package/dist/components/ui/card.es.js +68 -0
  11. package/dist/components/ui/card.es.js.map +1 -0
  12. package/dist/components/ui/chart.es.js +211 -0
  13. package/dist/components/ui/chart.es.js.map +1 -0
  14. package/dist/components/ui/checkbox.es.js +28 -0
  15. package/dist/components/ui/checkbox.es.js.map +1 -0
  16. package/dist/components/ui/collapsible.es.js +8 -0
  17. package/dist/components/ui/collapsible.es.js.map +1 -0
  18. package/dist/components/ui/command.es.js +110 -0
  19. package/dist/components/ui/command.es.js.map +1 -0
  20. package/dist/components/ui/dialog.es.js +101 -0
  21. package/dist/components/ui/dialog.es.js.map +1 -0
  22. package/dist/components/ui/dropdown-menu.es.js +145 -0
  23. package/dist/components/ui/dropdown-menu.es.js.map +1 -0
  24. package/dist/components/ui/form.es.js +95 -0
  25. package/dist/components/ui/form.es.js.map +1 -0
  26. package/dist/components/ui/input.es.js +23 -0
  27. package/dist/components/ui/input.es.js.map +1 -0
  28. package/dist/components/ui/label.es.js +20 -0
  29. package/dist/components/ui/label.es.js.map +1 -0
  30. package/dist/components/ui/loader.es.js +10 -0
  31. package/dist/components/ui/loader.es.js.map +1 -0
  32. package/dist/components/ui/pagination.es.js +106 -0
  33. package/dist/components/ui/pagination.es.js.map +1 -0
  34. package/dist/components/ui/password-input.es.js +27 -0
  35. package/dist/components/ui/password-input.es.js.map +1 -0
  36. package/dist/components/ui/popover.es.js +25 -0
  37. package/dist/components/ui/popover.es.js.map +1 -0
  38. package/dist/components/ui/radio-group.es.js +32 -0
  39. package/dist/components/ui/radio-group.es.js.map +1 -0
  40. package/dist/components/ui/select.es.js +122 -0
  41. package/dist/components/ui/select.es.js.map +1 -0
  42. package/dist/components/ui/separator.es.js +25 -0
  43. package/dist/components/ui/separator.es.js.map +1 -0
  44. package/dist/components/ui/sheet.es.js +111 -0
  45. package/dist/components/ui/sheet.es.js.map +1 -0
  46. package/dist/components/ui/sidebar.es.js +534 -0
  47. package/dist/components/ui/sidebar.es.js.map +1 -0
  48. package/dist/components/ui/skeleton.es.js +18 -0
  49. package/dist/components/ui/skeleton.es.js.map +1 -0
  50. package/dist/components/ui/table.es.js +91 -0
  51. package/dist/components/ui/table.es.js.map +1 -0
  52. package/dist/components/ui/tooltip.es.js +24 -0
  53. package/dist/components/ui/tooltip.es.js.map +1 -0
  54. package/dist/hooks/use-mobile.es.js +15 -0
  55. package/dist/hooks/use-mobile.es.js.map +1 -0
  56. package/dist/index.es.d.ts +600 -0
  57. package/dist/index.es.js +178 -0
  58. package/dist/index.es.js.map +1 -0
  59. package/dist/utils/index.es.js +9 -0
  60. package/dist/utils/index.es.js.map +1 -0
  61. package/lib/index.css +24 -0
  62. package/lib/tokens.css +143 -0
  63. package/package.json +107 -0
  64. package/tailwind.preset.ts +77 -0
package/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # @cryptlex/web-components
2
+
3
+ A set of React components based on shadcn/ui for the Cryptlex brand. These are to be used across all applications. Run `pnpm build` to build the component library.
4
+
5
+ ## Storybook
6
+ This project uses Storybook to test and showcase components. Stories are located in the `stories` folder.
7
+
8
+ `pnpm storybook` for running Storybook locally
9
+ `pnpn build:storybook` to build a static version of Storybook
10
+
11
+
12
+
13
+ tailwind.config.js
14
+ ```ts
15
+ import tailwindPreset from '@cryptlex/web-components/tailwind-preset';
16
+
17
+ /** @type {import('tailwindcss').Config} */
18
+ export default {
19
+ presets:[tailwindPreset],
20
+ content: [
21
+ "./index.html",
22
+ "./src/**/*.{js,ts,jsx,tsx}",
23
+ './node_modules/@cryptlex/web-components/**/*.{js,ts,jsx,tsx}',
24
+ ],
25
+ theme: {
26
+ extend: {},
27
+ },
28
+ plugins: [],
29
+ }
30
+
31
+
32
+ ```
33
+ index.css
34
+
35
+ ```css
36
+ /* Import the index.css from the @cryptlex/web-components library */
37
+ @import url('@cryptlex/web-components/index.css');
38
+
39
+ ```
@@ -0,0 +1,27 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { cva as n } from "class-variance-authority";
3
+ import { cn as a } from "../../utils/index.es.js";
4
+ const s = n(
5
+ "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
6
+ {
7
+ variants: {
8
+ variant: {
9
+ default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
10
+ secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
11
+ destructive: "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
12
+ outline: "text-foreground"
13
+ }
14
+ },
15
+ defaultVariants: {
16
+ variant: "default"
17
+ }
18
+ }
19
+ );
20
+ function c({ className: r, variant: e, ...t }) {
21
+ return /* @__PURE__ */ o("div", { className: a(s({ variant: e }), r), ...t });
22
+ }
23
+ export {
24
+ c as Badge,
25
+ s as badgeVariants
26
+ };
27
+ //# sourceMappingURL=badge.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"badge.es.js","sources":["../../../lib/components/ui/badge.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/utils\"\n\nconst badgeVariants = cva(\n \"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2\",\n {\n variants: {\n variant: {\n default:\n \"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80\",\n secondary:\n \"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n destructive:\n \"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80\",\n outline: \"text-foreground\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nexport interface BadgeProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof badgeVariants> {}\n\nfunction Badge({ className, variant, ...props }: BadgeProps) {\n return (\n <div className={cn(badgeVariants({ variant }), className)} {...props} />\n )\n}\n\nexport { Badge, badgeVariants }\n"],"names":["badgeVariants","cva","Badge","className","variant","props","jsx","cn"],"mappings":";;;AAKA,MAAMA,IAAgBC;AAAA,EACpB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SACE;AAAA,QACF,WACE;AAAA,QACF,aACE;AAAA,QACF,SAAS;AAAA,MAAA;AAAA,IAEb;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ;AAMA,SAASC,EAAM,EAAE,WAAAC,GAAW,SAAAC,GAAS,GAAGC,KAAqB;AAC3D,SACG,gBAAAC,EAAA,OAAA,EAAI,WAAWC,EAAGP,EAAc,EAAE,SAAAI,EAAS,CAAA,GAAGD,CAAS,GAAI,GAAGE,EAAO,CAAA;AAE1E;"}
@@ -0,0 +1,91 @@
1
+ import { jsx as s, jsxs as i } from "react/jsx-runtime";
2
+ import * as t from "react";
3
+ import { ChevronRightIcon as n, DotsHorizontalIcon as c } from "@radix-ui/react-icons";
4
+ import { Slot as d } from "@radix-ui/react-slot";
5
+ import { cn as o } from "../../utils/index.es.js";
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 ? d : "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 = ({
51
+ children: r,
52
+ className: e,
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(n, {})
62
+ }
63
+ );
64
+ N.displayName = "BreadcrumbSeparator";
65
+ const B = ({
66
+ className: r,
67
+ ...e
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";
82
+ export {
83
+ l as Breadcrumb,
84
+ B as BreadcrumbEllipsis,
85
+ u as BreadcrumbItem,
86
+ f as BreadcrumbLink,
87
+ p as BreadcrumbList,
88
+ b as BreadcrumbPage,
89
+ N as BreadcrumbSeparator
90
+ };
91
+ //# sourceMappingURL=breadcrumb.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"breadcrumb.es.js","sources":["../../../lib/components/ui/breadcrumb.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { ChevronRightIcon, DotsHorizontalIcon } from \"@radix-ui/react-icons\"\nimport { Slot } from \"@radix-ui/react-slot\"\n\nimport { cn } from \"@/utils\"\n\nconst Breadcrumb = React.forwardRef<\n HTMLElement,\n React.ComponentPropsWithoutRef<\"nav\"> & {\n separator?: React.ReactNode\n }\n>(({ ...props }, ref) => <nav ref={ref} aria-label=\"breadcrumb\" {...props} />)\nBreadcrumb.displayName = \"Breadcrumb\"\n\nconst BreadcrumbList = React.forwardRef<\n HTMLOListElement,\n React.ComponentPropsWithoutRef<\"ol\">\n>(({ className, ...props }, ref) => (\n <ol\n ref={ref}\n className={cn(\n \"flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5\",\n className\n )}\n {...props}\n />\n))\nBreadcrumbList.displayName = \"BreadcrumbList\"\n\nconst BreadcrumbItem = React.forwardRef<\n HTMLLIElement,\n React.ComponentPropsWithoutRef<\"li\">\n>(({ className, ...props }, ref) => (\n <li\n ref={ref}\n className={cn(\"inline-flex items-center gap-1.5\", className)}\n {...props}\n />\n))\nBreadcrumbItem.displayName = \"BreadcrumbItem\"\n\nconst BreadcrumbLink = React.forwardRef<\n HTMLAnchorElement,\n React.ComponentPropsWithoutRef<\"a\"> & {\n asChild?: boolean\n }\n>(({ asChild, className, ...props }, ref) => {\n const Comp = asChild ? Slot : \"a\"\n\n return (\n <Comp\n ref={ref}\n className={cn(\"transition-colors hover:text-foreground\", className)}\n {...props}\n />\n )\n})\nBreadcrumbLink.displayName = \"BreadcrumbLink\"\n\nconst BreadcrumbPage = React.forwardRef<\n HTMLSpanElement,\n React.ComponentPropsWithoutRef<\"span\">\n>(({ className, ...props }, ref) => (\n <span\n ref={ref}\n role=\"link\"\n aria-disabled=\"true\"\n aria-current=\"page\"\n className={cn(\"font-normal text-foreground\", className)}\n {...props}\n />\n))\nBreadcrumbPage.displayName = \"BreadcrumbPage\"\n\nconst BreadcrumbSeparator = ({\n children,\n className,\n ...props\n}: React.ComponentProps<\"li\">) => (\n <li\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"[&>svg]:w-3.5 [&>svg]:h-3.5\", className)}\n {...props}\n >\n {children ?? <ChevronRightIcon />}\n </li>\n)\nBreadcrumbSeparator.displayName = \"BreadcrumbSeparator\"\n\nconst BreadcrumbEllipsis = ({\n className,\n ...props\n}: React.ComponentProps<\"span\">) => (\n <span\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"flex h-9 w-9 items-center justify-center\", className)}\n {...props}\n >\n <DotsHorizontalIcon className=\"h-4 w-4\" />\n <span className=\"sr-only\">More</span>\n </span>\n)\nBreadcrumbEllipsis.displayName = \"BreadcrumbElipssis\"\n\nexport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbPage,\n BreadcrumbSeparator,\n BreadcrumbEllipsis,\n}\n"],"names":["Breadcrumb","React","props","ref","jsx","BreadcrumbList","className","cn","BreadcrumbItem","BreadcrumbLink","asChild","Slot","BreadcrumbPage","BreadcrumbSeparator","children","ChevronRightIcon","BreadcrumbEllipsis","jsxs","DotsHorizontalIcon"],"mappings":";;;;;AAMA,MAAMA,IAAaC,EAAM,WAKvB,CAAC,EAAE,GAAGC,EAAM,GAAGC,MAAQ,gBAAAC,EAAC,SAAI,KAAAD,GAAU,cAAW,cAAc,GAAGD,GAAO,CAAE;AAC7EF,EAAW,cAAc;AAEnB,MAAAK,IAAiBJ,EAAM,WAG3B,CAAC,EAAE,WAAAK,GAAW,GAAGJ,EAAM,GAAGC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,WAAWI;AAAA,MACT;AAAA,MACAD;AAAA,IACF;AAAA,IACC,GAAGJ;AAAA,EAAA;AACN,CACD;AACDG,EAAe,cAAc;AAEvB,MAAAG,IAAiBP,EAAM,WAG3B,CAAC,EAAE,WAAAK,GAAW,GAAGJ,EAAM,GAAGC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,WAAWI,EAAG,oCAAoCD,CAAS;AAAA,IAC1D,GAAGJ;AAAA,EAAA;AACN,CACD;AACDM,EAAe,cAAc;AAEvB,MAAAC,IAAiBR,EAAM,WAK3B,CAAC,EAAE,SAAAS,GAAS,WAAAJ,GAAW,GAAGJ,EAAM,GAAGC,MAIjC,gBAAAC;AAAA,EAHWM,IAAUC,IAAO;AAAA,EAG3B;AAAA,IACC,KAAAR;AAAA,IACA,WAAWI,EAAG,2CAA2CD,CAAS;AAAA,IACjE,GAAGJ;AAAA,EAAA;AACN,CAEH;AACDO,EAAe,cAAc;AAEvB,MAAAG,IAAiBX,EAAM,WAG3B,CAAC,EAAE,WAAAK,GAAW,GAAGJ,EAAM,GAAGC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,MAAK;AAAA,IACL,iBAAc;AAAA,IACd,gBAAa;AAAA,IACb,WAAWI,EAAG,+BAA+BD,CAAS;AAAA,IACrD,GAAGJ;AAAA,EAAA;AACN,CACD;AACDU,EAAe,cAAc;AAE7B,MAAMC,IAAsB,CAAC;AAAA,EAC3B,UAAAC;AAAA,EACA,WAAAR;AAAA,EACA,GAAGJ;AACL,MACE,gBAAAE;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,MAAK;AAAA,IACL,eAAY;AAAA,IACZ,WAAWG,EAAG,+BAA+BD,CAAS;AAAA,IACrD,GAAGJ;AAAA,IAEH,UAAAY,uBAAaC,GAAiB,CAAA,CAAA;AAAA,EAAA;AACjC;AAEFF,EAAoB,cAAc;AAElC,MAAMG,IAAqB,CAAC;AAAA,EAC1B,WAAAV;AAAA,EACA,GAAGJ;AACL,MACE,gBAAAe;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,MAAK;AAAA,IACL,eAAY;AAAA,IACZ,WAAWV,EAAG,4CAA4CD,CAAS;AAAA,IAClE,GAAGJ;AAAA,IAEJ,UAAA;AAAA,MAAC,gBAAAE,EAAAc,GAAA,EAAmB,WAAU,UAAU,CAAA;AAAA,MACvC,gBAAAd,EAAA,QAAA,EAAK,WAAU,WAAU,UAAI,OAAA,CAAA;AAAA,IAAA;AAAA,EAAA;AAChC;AAEFY,EAAmB,cAAc;"}
@@ -0,0 +1,64 @@
1
+ import { jsxs as m, jsx as r } from "react/jsx-runtime";
2
+ import * as g from "react";
3
+ import { Slot as b } from "@radix-ui/react-slot";
4
+ import { cva as p } from "class-variance-authority";
5
+ import { cn as v } from "../../utils/index.es.js";
6
+ import { Loader as h } from "./loader.es.js";
7
+ const x = p(
8
+ "inline-flex items-center justify-center whitespace-nowrap rounded-lg 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",
9
+ {
10
+ variants: {
11
+ variant: {
12
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
13
+ destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
14
+ outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
15
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
16
+ ghost: "hover:bg-accent hover:text-accent-foreground",
17
+ link: "text-primary underline-offset-4 hover:underline"
18
+ },
19
+ size: {
20
+ default: "h-10 px-4 py-2",
21
+ sm: "h-9 rounded-md px-3",
22
+ lg: "h-11 rounded-md px-8",
23
+ icon: "h-10 w-10"
24
+ }
25
+ },
26
+ defaultVariants: {
27
+ variant: "default",
28
+ size: "default"
29
+ }
30
+ }
31
+ ), y = g.forwardRef(
32
+ ({
33
+ className: i,
34
+ variant: s,
35
+ size: a,
36
+ loading: t,
37
+ disabled: d,
38
+ asChild: c = !1,
39
+ icon: o,
40
+ children: e,
41
+ ...u
42
+ }, f) => {
43
+ const l = c ? b : "button", n = o;
44
+ return /* @__PURE__ */ m(
45
+ l,
46
+ {
47
+ className: v(x({ variant: s, size: a, className: i })),
48
+ ref: f,
49
+ disabled: t || d,
50
+ ...u,
51
+ children: [
52
+ t ? /* @__PURE__ */ r(h, {}) : n ? /* @__PURE__ */ r(n, { className: "h-4 w-4" }) : null,
53
+ e ? /* @__PURE__ */ r("div", { className: o && e ? "ml-2" : "", children: e }) : null
54
+ ]
55
+ }
56
+ );
57
+ }
58
+ );
59
+ y.displayName = "Button";
60
+ export {
61
+ y as Button,
62
+ x as buttonVariants
63
+ };
64
+ //# sourceMappingURL=button.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.es.js","sources":["../../../lib/components/ui/button.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/utils\"\nimport { Loader } from \"./loader\";\nimport { LucideIcon } from \"lucide-react\";\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center whitespace-nowrap rounded-lg 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\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline:\n \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-10 px-4 py-2\",\n sm: \"h-9 rounded-md px-3\",\n lg: \"h-11 rounded-md px-8\",\n icon: \"h-10 w-10\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n loading?: boolean;\n icon?: LucideIcon;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant,\n size,\n loading,\n disabled,\n asChild = false,\n icon,\n children,\n ...props\n },\n ref\n ) => {\n const Comp = asChild ? Slot : \"button\";\n const Icon = icon;\n\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n disabled={loading || disabled}\n {...props}\n >\n {/* Shows loading when `loading:true` irrespective of icon present or not; otherwise shows button icon if present */}\n {loading ? <Loader /> : Icon ? <Icon className=\"h-4 w-4\" /> : null}\n {/* Margin left only when both icon and children (button text) are present */}\n {children ? (\n <div className={icon && children ? \"ml-2\" : \"\"}>{children}</div>\n ) : null}\n </Comp>\n );\n }\n);\n\nButton.displayName = \"Button\"; // Set display name for better debugging\n\nexport { Button, buttonVariants };\n"],"names":["buttonVariants","cva","Button","React","className","variant","size","loading","disabled","asChild","icon","children","props","ref","Comp","Slot","Icon","jsxs","cn","jsx","Loader"],"mappings":";;;;;;AAQA,MAAMA,IAAiBC;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,aACE;AAAA,QACF,SACE;AAAA,QACF,WACE;AAAA,QACF,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,MAAM;AAAA,MAAA;AAAA,IAEV;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IAAA;AAAA,EACR;AAEJ,GAUMC,IAASC,EAAM;AAAA,EACnB,CACE;AAAA,IACE,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,MAAAC;AAAA,IACA,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,MAAAC;AAAA,IACA,UAAAC;AAAA,IACA,GAAGC;AAAA,KAELC,MACG;AACG,UAAAC,IAAOL,IAAUM,IAAO,UACxBC,IAAON;AAGX,WAAA,gBAAAO;AAAA,MAACH;AAAA,MAAA;AAAA,QACC,WAAWI,EAAGlB,EAAe,EAAE,SAAAK,GAAS,MAAAC,GAAM,WAAAF,EAAA,CAAW,CAAC;AAAA,QAC1D,KAAAS;AAAA,QACA,UAAUN,KAAWC;AAAA,QACpB,GAAGI;AAAA,QAGH,UAAA;AAAA,UAAUL,IAAA,gBAAAY,EAACC,KAAO,IAAKJ,sBAAQA,GAAK,EAAA,WAAU,WAAU,IAAK;AAAA,UAE7DL,sBACE,OAAI,EAAA,WAAWD,KAAQC,IAAW,SAAS,IAAK,UAAAA,EAAA,CAAS,IACxD;AAAA,QAAA;AAAA,MAAA;AAAA,IACN;AAAA,EAAA;AAGN;AAEAT,EAAO,cAAc;"}
@@ -0,0 +1,63 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { ChevronLeftIcon as c, ChevronRightIcon as i } from "@radix-ui/react-icons";
3
+ import { DayPicker as l } from "react-day-picker";
4
+ import { cn as e } from "../../utils/index.es.js";
5
+ import { buttonVariants as r } from "./button.es.js";
6
+ function m({
7
+ className: o,
8
+ classNames: d,
9
+ showOutsideDays: n = !0,
10
+ ...t
11
+ }) {
12
+ return /* @__PURE__ */ a(
13
+ l,
14
+ {
15
+ showOutsideDays: n,
16
+ className: e("p-3", o),
17
+ classNames: {
18
+ months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
19
+ month: "space-y-4",
20
+ caption: "flex justify-center pt-1 relative items-center",
21
+ caption_label: "text-sm font-medium",
22
+ nav: "space-x-1 flex items-center",
23
+ nav_button: e(
24
+ r({ variant: "outline" }),
25
+ "h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
26
+ ),
27
+ nav_button_previous: "absolute left-1",
28
+ nav_button_next: "absolute right-1",
29
+ table: "w-full border-collapse space-y-1",
30
+ head_row: "flex",
31
+ head_cell: "text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",
32
+ row: "flex w-full mt-2",
33
+ cell: e(
34
+ "relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",
35
+ t.mode === "range" ? "[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md" : "[&:has([aria-selected])]:rounded-md"
36
+ ),
37
+ day: e(
38
+ r({ variant: "ghost" }),
39
+ "h-8 w-8 p-0 font-normal aria-selected:opacity-100"
40
+ ),
41
+ day_range_start: "day-range-start",
42
+ day_range_end: "day-range-end",
43
+ day_selected: "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
44
+ day_today: "bg-accent text-accent-foreground",
45
+ day_outside: "day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",
46
+ day_disabled: "text-muted-foreground opacity-50",
47
+ day_range_middle: "aria-selected:bg-accent aria-selected:text-accent-foreground",
48
+ day_hidden: "invisible",
49
+ ...d
50
+ },
51
+ components: {
52
+ IconLeft: ({ ...s }) => /* @__PURE__ */ a(c, { className: "h-4 w-4" }),
53
+ IconRight: ({ ...s }) => /* @__PURE__ */ a(i, { className: "h-4 w-4" })
54
+ },
55
+ ...t
56
+ }
57
+ );
58
+ }
59
+ m.displayName = "Calendar";
60
+ export {
61
+ m as Calendar
62
+ };
63
+ //# sourceMappingURL=calendar.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar.es.js","sources":["../../../lib/components/ui/calendar.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { ChevronLeftIcon, ChevronRightIcon } from \"@radix-ui/react-icons\"\nimport { DayPicker } from \"react-day-picker\"\n\nimport { cn } from \"@/utils\"\nimport { buttonVariants } from \"@/components/ui/button\"\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker>\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n ...props\n}: CalendarProps) {\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\"p-3\", className)}\n classNames={{\n months: \"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0\",\n month: \"space-y-4\",\n caption: \"flex justify-center pt-1 relative items-center\",\n caption_label: \"text-sm font-medium\",\n nav: \"space-x-1 flex items-center\",\n nav_button: cn(\n buttonVariants({ variant: \"outline\" }),\n \"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100\"\n ),\n nav_button_previous: \"absolute left-1\",\n nav_button_next: \"absolute right-1\",\n table: \"w-full border-collapse space-y-1\",\n head_row: \"flex\",\n head_cell:\n \"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]\",\n row: \"flex w-full mt-2\",\n cell: cn(\n \"relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md\",\n props.mode === \"range\"\n ? \"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md\"\n : \"[&:has([aria-selected])]:rounded-md\"\n ),\n day: cn(\n buttonVariants({ variant: \"ghost\" }),\n \"h-8 w-8 p-0 font-normal aria-selected:opacity-100\"\n ),\n day_range_start: \"day-range-start\",\n day_range_end: \"day-range-end\",\n day_selected:\n \"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground\",\n day_today: \"bg-accent text-accent-foreground\",\n day_outside:\n \"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30\",\n day_disabled: \"text-muted-foreground opacity-50\",\n day_range_middle:\n \"aria-selected:bg-accent aria-selected:text-accent-foreground\",\n day_hidden: \"invisible\",\n ...classNames,\n }}\n components={{\n IconLeft: ({ ...props }) => <ChevronLeftIcon className=\"h-4 w-4\" />,\n IconRight: ({ ...props }) => <ChevronRightIcon className=\"h-4 w-4\" />,\n }}\n {...props}\n />\n )\n}\nCalendar.displayName = \"Calendar\"\n\nexport { Calendar }\n"],"names":["Calendar","className","classNames","showOutsideDays","props","jsx","DayPicker","cn","buttonVariants","ChevronLeftIcon","ChevronRightIcon"],"mappings":";;;;;AASA,SAASA,EAAS;AAAA,EAChB,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,iBAAAC,IAAkB;AAAA,EAClB,GAAGC;AACL,GAAkB;AAEd,SAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,iBAAAH;AAAA,MACA,WAAWI,EAAG,OAAON,CAAS;AAAA,MAC9B,YAAY;AAAA,QACV,QAAQ;AAAA,QACR,OAAO;AAAA,QACP,SAAS;AAAA,QACT,eAAe;AAAA,QACf,KAAK;AAAA,QACL,YAAYM;AAAA,UACVC,EAAe,EAAE,SAAS,WAAW;AAAA,UACrC;AAAA,QACF;AAAA,QACA,qBAAqB;AAAA,QACrB,iBAAiB;AAAA,QACjB,OAAO;AAAA,QACP,UAAU;AAAA,QACV,WACE;AAAA,QACF,KAAK;AAAA,QACL,MAAMD;AAAA,UACJ;AAAA,UACAH,EAAM,SAAS,UACX,yKACA;AAAA,QACN;AAAA,QACA,KAAKG;AAAA,UACHC,EAAe,EAAE,SAAS,SAAS;AAAA,UACnC;AAAA,QACF;AAAA,QACA,iBAAiB;AAAA,QACjB,eAAe;AAAA,QACf,cACE;AAAA,QACF,WAAW;AAAA,QACX,aACE;AAAA,QACF,cAAc;AAAA,QACd,kBACE;AAAA,QACF,YAAY;AAAA,QACZ,GAAGN;AAAA,MACL;AAAA,MACA,YAAY;AAAA,QACV,UAAU,CAAC,EAAE,GAAGE,EAAY,MAAA,gBAAAC,EAACI,GAAgB,EAAA,WAAU,WAAU;AAAA,QACjE,WAAW,CAAC,EAAE,GAAGL,EAAY,MAAA,gBAAAC,EAACK,GAAiB,EAAA,WAAU,UAAU,CAAA;AAAA,MACrE;AAAA,MACC,GAAGN;AAAA,IAAA;AAAA,EACN;AAEJ;AACAJ,EAAS,cAAc;"}
@@ -0,0 +1,68 @@
1
+ import { jsx as d } from "react/jsx-runtime";
2
+ import * as t from "react";
3
+ import { cn as o } from "../../utils/index.es.js";
4
+ const s = t.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
5
+ "div",
6
+ {
7
+ ref: r,
8
+ className: o(
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 = t.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
17
+ "div",
18
+ {
19
+ ref: r,
20
+ className: o("flex flex-col space-y-1.5 p-6", a),
21
+ ...e
22
+ }
23
+ ));
24
+ i.displayName = "CardHeader";
25
+ const l = t.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
26
+ "h3",
27
+ {
28
+ ref: r,
29
+ className: o(
30
+ "text-2xl font-semibold leading-none tracking-tight",
31
+ a
32
+ ),
33
+ ...e
34
+ }
35
+ ));
36
+ l.displayName = "CardTitle";
37
+ const f = t.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
38
+ "p",
39
+ {
40
+ ref: r,
41
+ className: o("text-sm text-muted-foreground", a),
42
+ ...e
43
+ }
44
+ ));
45
+ f.displayName = "CardDescription";
46
+ const m = t.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d("div", { ref: r, className: o("p-6 pt-0", a), ...e }));
47
+ m.displayName = "CardContent";
48
+ const n = t.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
49
+ "div",
50
+ {
51
+ ref: r,
52
+ className: o(
53
+ "flex items-center p-6 pt-0 w-full gap-4 justify-end",
54
+ a
55
+ ),
56
+ ...e
57
+ }
58
+ ));
59
+ n.displayName = "CardFooter";
60
+ export {
61
+ s as Card,
62
+ m as CardContent,
63
+ f as CardDescription,
64
+ n as CardFooter,
65
+ i as CardHeader,
66
+ l as CardTitle
67
+ };
68
+ //# sourceMappingURL=card.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card.es.js","sources":["../../../lib/components/ui/card.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { cn } from \"@/utils\";\nconst Card = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n \"rounded-lg border bg-card text-card-foreground shadow-sm\",\n className\n )}\n {...props}\n />\n));\nCard.displayName = \"Card\";\n\nconst CardHeader = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex flex-col space-y-1.5 p-6\", className)}\n {...props}\n />\n));\nCardHeader.displayName = \"CardHeader\";\n\nconst CardTitle = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h3\n ref={ref}\n className={cn(\n \"text-2xl font-semibold leading-none tracking-tight\",\n className\n )}\n {...props}\n />\n));\nCardTitle.displayName = \"CardTitle\";\n\nconst CardDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <p\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nCardDescription.displayName = \"CardDescription\";\n\nconst CardContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"p-6 pt-0\", className)} {...props} />\n));\nCardContent.displayName = \"CardContent\";\n\nconst CardFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n \"flex items-center p-6 pt-0 w-full gap-4 justify-end\",\n className\n )}\n {...props}\n />\n));\nCardFooter.displayName = \"CardFooter\";\n\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle,\n CardDescription,\n CardContent,\n};\n"],"names":["Card","React","className","props","ref","jsx","cn","CardHeader","CardTitle","CardDescription","CardContent","CardFooter"],"mappings":";;;AAGM,MAAAA,IAAOC,EAAM,WAGjB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAM,GAAGC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACAJ;AAAA,IACF;AAAA,IACC,GAAGC;AAAA,EAAA;AACN,CACD;AACDH,EAAK,cAAc;AAEb,MAAAO,IAAaN,EAAM,WAGvB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAM,GAAGC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,WAAWE,EAAG,iCAAiCJ,CAAS;AAAA,IACvD,GAAGC;AAAA,EAAA;AACN,CACD;AACDI,EAAW,cAAc;AAEnB,MAAAC,IAAYP,EAAM,WAGtB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAM,GAAGC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACAJ;AAAA,IACF;AAAA,IACC,GAAGC;AAAA,EAAA;AACN,CACD;AACDK,EAAU,cAAc;AAElB,MAAAC,IAAkBR,EAAM,WAG5B,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAM,GAAGC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,WAAWE,EAAG,iCAAiCJ,CAAS;AAAA,IACvD,GAAGC;AAAA,EAAA;AACN,CACD;AACDM,EAAgB,cAAc;AAExB,MAAAC,IAAcT,EAAM,WAGxB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAS,GAAAC,wBACzB,OAAI,EAAA,KAAAA,GAAU,WAAWE,EAAG,YAAYJ,CAAS,GAAI,GAAGC,GAAO,CACjE;AACDO,EAAY,cAAc;AAEpB,MAAAC,IAAaV,EAAM,WAGvB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAM,GAAGC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACAJ;AAAA,IACF;AAAA,IACC,GAAGC;AAAA,EAAA;AACN,CACD;AACDQ,EAAW,cAAc;"}
@@ -0,0 +1,211 @@
1
+ import { jsx as s, jsxs as v, Fragment as P } from "react/jsx-runtime";
2
+ import * as g from "react";
3
+ import * as C from "recharts";
4
+ import { cn as i } from "../../utils/index.es.js";
5
+ const I = { light: "", dark: ".dark" }, j = g.createContext(null);
6
+ function $() {
7
+ const c = g.useContext(j);
8
+ if (!c)
9
+ throw new Error("useChart must be used within a <ChartContainer />");
10
+ return c;
11
+ }
12
+ const S = g.forwardRef(({ id: c, className: e, children: t, config: n, ...o }, f) => {
13
+ const l = g.useId(), a = `chart-${c || l.replace(/:/g, "")}`;
14
+ return /* @__PURE__ */ s(j.Provider, { value: { config: n }, children: /* @__PURE__ */ v(
15
+ "div",
16
+ {
17
+ "data-chart": a,
18
+ ref: f,
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
+ ...o,
24
+ children: [
25
+ /* @__PURE__ */ s(E, { id: a, config: n }),
26
+ /* @__PURE__ */ s(C.ResponsiveContainer, { children: t })
27
+ ]
28
+ }
29
+ ) });
30
+ });
31
+ S.displayName = "Chart";
32
+ const E = ({ id: c, config: e }) => {
33
+ const t = Object.entries(e).filter(
34
+ ([n, o]) => o.theme || o.color
35
+ );
36
+ return t.length ? /* @__PURE__ */ s(
37
+ "style",
38
+ {
39
+ dangerouslySetInnerHTML: {
40
+ __html: Object.entries(I).map(
41
+ ([n, o]) => `
42
+ ${o} [data-chart=${c}] {
43
+ ${t.map(([f, l]) => {
44
+ var h;
45
+ const a = ((h = l.theme) == null ? void 0 : h[n]) || l.color;
46
+ return a ? ` --color-${f}: ${a};` : null;
47
+ }).join(`
48
+ `)}
49
+ }
50
+ `
51
+ ).join(`
52
+ `)
53
+ }
54
+ }
55
+ ) : null;
56
+ }, q = C.Tooltip, K = g.forwardRef(
57
+ ({
58
+ active: c,
59
+ payload: e,
60
+ className: t,
61
+ indicator: n = "dot",
62
+ hideLabel: o = !1,
63
+ hideIndicator: f = !1,
64
+ label: l,
65
+ labelFormatter: a,
66
+ labelClassName: h,
67
+ formatter: u,
68
+ color: L,
69
+ nameKey: R,
70
+ labelKey: _
71
+ }, T) => {
72
+ const { config: p } = $(), N = g.useMemo(() => {
73
+ var x;
74
+ if (o || !(e != null && e.length))
75
+ return null;
76
+ const [r] = e, w = `${_ || r.dataKey || r.name || "value"}`, m = k(p, r, w), d = !_ && typeof l == "string" ? ((x = p[l]) == null ? void 0 : x.label) || l : m == null ? void 0 : m.label;
77
+ return a ? /* @__PURE__ */ s("div", { className: i("font-medium", h), children: a(d, e) }) : d ? /* @__PURE__ */ s("div", { className: i("font-medium", h), children: d }) : null;
78
+ }, [
79
+ l,
80
+ a,
81
+ e,
82
+ o,
83
+ h,
84
+ p,
85
+ _
86
+ ]);
87
+ if (!c || !(e != null && e.length))
88
+ return null;
89
+ const b = e.length === 1 && n !== "dot";
90
+ return /* @__PURE__ */ v(
91
+ "div",
92
+ {
93
+ ref: T,
94
+ className: i(
95
+ "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",
96
+ t
97
+ ),
98
+ children: [
99
+ b ? null : N,
100
+ /* @__PURE__ */ s("div", { className: "grid gap-1.5", children: e.map((r, w) => {
101
+ const m = `${R || r.name || r.dataKey || "value"}`, d = k(p, r, m), x = L || r.payload.fill || r.color;
102
+ return /* @__PURE__ */ s(
103
+ "div",
104
+ {
105
+ className: i(
106
+ "flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",
107
+ n === "dot" && "items-center"
108
+ ),
109
+ children: u && (r == null ? void 0 : r.value) !== void 0 && r.name ? u(r.value, r.name, r, w, r.payload) : /* @__PURE__ */ v(P, { children: [
110
+ d != null && d.icon ? /* @__PURE__ */ s(d.icon, {}) : !f && /* @__PURE__ */ s(
111
+ "div",
112
+ {
113
+ className: i(
114
+ "shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",
115
+ {
116
+ "h-2.5 w-2.5": n === "dot",
117
+ "w-1": n === "line",
118
+ "w-0 border-[1.5px] border-dashed bg-transparent": n === "dashed",
119
+ "my-0.5": b && n === "dashed"
120
+ }
121
+ ),
122
+ style: {
123
+ "--color-bg": x,
124
+ "--color-border": x
125
+ }
126
+ }
127
+ ),
128
+ /* @__PURE__ */ v(
129
+ "div",
130
+ {
131
+ className: i(
132
+ "flex flex-1 justify-between leading-none",
133
+ b ? "items-end" : "items-center"
134
+ ),
135
+ children: [
136
+ /* @__PURE__ */ v("div", { className: "grid gap-1.5", children: [
137
+ b ? N : null,
138
+ /* @__PURE__ */ s("span", { className: "text-muted-foreground", children: (d == null ? void 0 : d.label) || r.name })
139
+ ] }),
140
+ r.value && /* @__PURE__ */ s("span", { className: "font-mono font-medium tabular-nums text-foreground", children: r.value.toLocaleString() })
141
+ ]
142
+ }
143
+ )
144
+ ] })
145
+ },
146
+ r.dataKey
147
+ );
148
+ }) })
149
+ ]
150
+ }
151
+ );
152
+ }
153
+ );
154
+ K.displayName = "ChartTooltip";
155
+ const y = C.Legend, M = g.forwardRef(
156
+ ({ className: c, hideIcon: e = !1, payload: t, verticalAlign: n = "bottom", nameKey: o }, f) => {
157
+ const { config: l } = $();
158
+ return t != null && t.length ? /* @__PURE__ */ s(
159
+ "div",
160
+ {
161
+ ref: f,
162
+ className: i(
163
+ "flex items-center justify-center gap-4",
164
+ n === "top" ? "pb-3" : "pt-3",
165
+ c
166
+ ),
167
+ children: t.map((a) => {
168
+ const h = `${o || a.dataKey || "value"}`, u = k(l, a, h);
169
+ return /* @__PURE__ */ v(
170
+ "div",
171
+ {
172
+ className: i(
173
+ "flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"
174
+ ),
175
+ children: [
176
+ u != null && u.icon && !e ? /* @__PURE__ */ s(u.icon, {}) : /* @__PURE__ */ s(
177
+ "div",
178
+ {
179
+ className: "h-2 w-2 shrink-0 rounded-[2px]",
180
+ style: {
181
+ backgroundColor: a.color
182
+ }
183
+ }
184
+ ),
185
+ u == null ? void 0 : u.label
186
+ ]
187
+ },
188
+ a.value
189
+ );
190
+ })
191
+ }
192
+ ) : null;
193
+ }
194
+ );
195
+ M.displayName = "ChartLegend";
196
+ function k(c, e, t) {
197
+ if (typeof e != "object" || e === null)
198
+ return;
199
+ const n = "payload" in e && typeof e.payload == "object" && e.payload !== null ? e.payload : void 0;
200
+ let o = t;
201
+ return t in e && typeof e[t] == "string" ? o = e[t] : n && t in n && typeof n[t] == "string" && (o = n[t]), o in c ? c[o] : c[t];
202
+ }
203
+ export {
204
+ S as ChartContainer,
205
+ y as ChartLegend,
206
+ M as ChartLegendContent,
207
+ E as ChartStyle,
208
+ q as ChartTooltip,
209
+ K as ChartTooltipContent
210
+ };
211
+ //# sourceMappingURL=chart.es.js.map