@px-ui/ui 0.1.4 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/avatar-C-yFMpI5.d.ts +41 -0
- package/dist/avatar-C-yFMpI5.d.ts.map +1 -0
- package/dist/avatar-DDdL9xDH.js +119 -0
- package/dist/avatar-DDdL9xDH.js.map +1 -0
- package/dist/button-KTVkwZNA.d.ts +19 -0
- package/dist/button-KTVkwZNA.d.ts.map +1 -0
- package/dist/button-hBUFMmsZ.js +47 -0
- package/dist/button-hBUFMmsZ.js.map +1 -0
- package/dist/combobox-CnpyzZ7B.js +334 -0
- package/dist/combobox-CnpyzZ7B.js.map +1 -0
- package/dist/combobox-GYXOAPSk.d.ts +109 -0
- package/dist/combobox-GYXOAPSk.d.ts.map +1 -0
- package/dist/components/accordion.d.ts +25 -0
- package/dist/components/accordion.d.ts.map +1 -0
- package/dist/components/accordion.js +56 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/alert-dialog.d.ts +59 -0
- package/dist/components/alert-dialog.d.ts.map +1 -0
- package/dist/components/alert-dialog.js +99 -0
- package/dist/components/alert-dialog.js.map +1 -0
- package/dist/components/alert.d.ts +29 -0
- package/dist/components/alert.d.ts.map +1 -0
- package/dist/components/alert.js +47 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/aspect-ratio.d.ts +13 -0
- package/dist/components/aspect-ratio.d.ts.map +1 -0
- package/dist/components/aspect-ratio.js +16 -0
- package/dist/components/aspect-ratio.js.map +1 -0
- package/dist/components/avatar-group.d.ts +30 -0
- package/dist/components/avatar-group.d.ts.map +1 -0
- package/dist/components/avatar-group.js +69 -0
- package/dist/components/avatar-group.js.map +1 -0
- package/dist/components/avatar.d.ts +2 -0
- package/dist/components/avatar.js +5 -0
- package/dist/components/badge.d.ts +18 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +31 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/breadcrumb.d.ts +38 -0
- package/dist/components/breadcrumb.d.ts.map +1 -0
- package/dist/components/breadcrumb.js +75 -0
- package/dist/components/breadcrumb.js.map +1 -0
- package/dist/components/button-group.d.ts +29 -0
- package/dist/components/button-group.d.ts.map +1 -0
- package/dist/components/button-group.js +44 -0
- package/dist/components/button-group.js.map +1 -0
- package/dist/components/button.d.ts +2 -0
- package/dist/components/button.js +4 -0
- package/dist/components/calendar.d.ts +32 -0
- package/dist/components/calendar.d.ts.map +1 -0
- package/dist/components/calendar.js +119 -0
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/card.d.ts +38 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +59 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/carousel.d.ts +57 -0
- package/dist/components/carousel.d.ts.map +1 -0
- package/dist/components/carousel.js +136 -0
- package/dist/components/carousel.js.map +1 -0
- package/dist/components/chart.d.ts +79 -0
- package/dist/components/chart.d.ts.map +1 -0
- package/dist/components/chart.js +148 -0
- package/dist/components/chart.js.map +1 -0
- package/dist/components/checkbox.d.ts +11 -0
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox.js +24 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/collapsible.d.ts +25 -0
- package/dist/components/collapsible.d.ts.map +1 -0
- package/dist/components/collapsible.js +28 -0
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/combobox.d.ts +3 -0
- package/dist/components/combobox.js +13 -0
- package/dist/components/command.d.ts +78 -0
- package/dist/components/command.d.ts.map +1 -0
- package/dist/components/command.js +125 -0
- package/dist/components/command.js.map +1 -0
- package/dist/components/context-menu.d.ts +87 -0
- package/dist/components/context-menu.d.ts.map +1 -0
- package/dist/components/context-menu.js +137 -0
- package/dist/components/context-menu.js.map +1 -0
- package/dist/components/currency-select-field.d.ts +105 -0
- package/dist/components/currency-select-field.d.ts.map +1 -0
- package/dist/components/currency-select-field.js +266 -0
- package/dist/components/currency-select-field.js.map +1 -0
- package/dist/components/dialog.d.ts +61 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +5 -0
- package/dist/components/direction.d.ts +2 -0
- package/dist/components/direction.js +3 -0
- package/dist/components/drawer.d.ts +45 -0
- package/dist/components/drawer.d.ts.map +1 -0
- package/dist/components/drawer.js +86 -0
- package/dist/components/drawer.js.map +1 -0
- package/dist/components/dropdown-menu.d.ts +2 -0
- package/dist/components/dropdown-menu.js +4 -0
- package/dist/components/empty.d.ts +36 -0
- package/dist/components/empty.d.ts.map +1 -0
- package/dist/components/empty.js +62 -0
- package/dist/components/empty.js.map +1 -0
- package/dist/components/field.d.ts +72 -0
- package/dist/components/field.d.ts.map +1 -0
- package/dist/components/field.js +122 -0
- package/dist/components/field.js.map +1 -0
- package/dist/components/file-upload-field.d.ts +58 -0
- package/dist/components/file-upload-field.d.ts.map +1 -0
- package/dist/components/file-upload-field.js +90 -0
- package/dist/components/file-upload-field.js.map +1 -0
- package/dist/components/file-upload.d.ts +4 -0
- package/dist/components/file-upload.js +6 -0
- package/dist/components/hover-card.d.ts +21 -0
- package/dist/components/hover-card.d.ts.map +1 -0
- package/dist/components/hover-card.js +40 -0
- package/dist/components/hover-card.js.map +1 -0
- package/dist/components/input-group.d.ts +46 -0
- package/dist/components/input-group.d.ts.map +1 -0
- package/dist/components/input-group.js +9 -0
- package/dist/components/input-otp.d.ts +24 -0
- package/dist/components/input-otp.d.ts.map +1 -0
- package/dist/components/input-otp.js +40 -0
- package/dist/components/input-otp.js.map +1 -0
- package/dist/components/input.d.ts +2 -0
- package/dist/components/input.js +4 -0
- package/dist/components/item.d.ts +62 -0
- package/dist/components/item.d.ts.map +1 -0
- package/dist/components/item.js +124 -0
- package/dist/components/item.js.map +1 -0
- package/dist/components/kbd.d.ts +14 -0
- package/dist/components/kbd.d.ts.map +1 -0
- package/dist/components/kbd.js +22 -0
- package/dist/components/kbd.js.map +1 -0
- package/dist/components/label.d.ts +2 -0
- package/dist/components/label.js +6 -0
- package/dist/components/menubar.d.ts +89 -0
- package/dist/components/menubar.d.ts.map +1 -0
- package/dist/components/menubar.js +140 -0
- package/dist/components/menubar.js.map +1 -0
- package/dist/components/native-select.d.ts +23 -0
- package/dist/components/native-select.d.ts.map +1 -0
- package/dist/components/native-select.js +41 -0
- package/dist/components/native-select.js.map +1 -0
- package/dist/components/navigation-menu.d.ts +48 -0
- package/dist/components/navigation-menu.d.ts.map +1 -0
- package/dist/components/navigation-menu.js +85 -0
- package/dist/components/navigation-menu.js.map +1 -0
- package/dist/components/pagination.d.ts +46 -0
- package/dist/components/pagination.d.ts.map +1 -0
- package/dist/components/pagination.js +89 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/phone-input.d.ts +28 -0
- package/dist/components/phone-input.d.ts.map +1 -0
- package/dist/components/phone-input.js +60 -0
- package/dist/components/phone-input.js.map +1 -0
- package/dist/components/popover.d.ts +34 -0
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/popover.js +4 -0
- package/dist/components/progress.d.ts +29 -0
- package/dist/components/progress.d.ts.map +1 -0
- package/dist/components/progress.js +48 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/radio-group.d.ts +16 -0
- package/dist/components/radio-group.d.ts.map +1 -0
- package/dist/components/radio-group.js +29 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/resizable.d.ts +21 -0
- package/dist/components/resizable.d.ts.map +1 -0
- package/dist/components/resizable.js +32 -0
- package/dist/components/resizable.js.map +1 -0
- package/dist/components/scroll-area.d.ts +17 -0
- package/dist/components/scroll-area.d.ts.map +1 -0
- package/dist/components/scroll-area.js +39 -0
- package/dist/components/scroll-area.js.map +1 -0
- package/dist/components/select.d.ts +56 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +102 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/separator.d.ts +2 -0
- package/dist/components/separator.js +4 -0
- package/dist/components/sheet.d.ts +43 -0
- package/dist/components/sheet.d.ts.map +1 -0
- package/dist/components/sheet.js +7 -0
- package/dist/components/sidebar.d.ts +162 -0
- package/dist/components/sidebar.d.ts.map +1 -0
- package/dist/components/sidebar.js +390 -0
- package/dist/components/sidebar.js.map +1 -0
- package/dist/components/skeleton.d.ts +10 -0
- package/dist/components/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton.js +4 -0
- package/dist/components/slider.d.ts +15 -0
- package/dist/components/slider.d.ts.map +1 -0
- package/dist/components/slider.js +36 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/spinner.d.ts +11 -0
- package/dist/components/spinner.d.ts.map +1 -0
- package/dist/components/spinner.js +4 -0
- package/dist/components/switch.d.ts +14 -0
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/switch.js +21 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/table.d.ts +39 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +71 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +31 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +55 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/textarea.d.ts +11 -0
- package/dist/components/textarea.d.ts.map +1 -0
- package/dist/components/textarea.js +4 -0
- package/dist/components/toast.d.ts +2 -0
- package/dist/components/toast.js +6 -0
- package/dist/components/toggle-group.d.ts +29 -0
- package/dist/components/toggle-group.d.ts.map +1 -0
- package/dist/components/toggle-group.js +55 -0
- package/dist/components/toggle-group.js.map +1 -0
- package/dist/components/toggle.d.ts +2 -0
- package/dist/components/toggle.js +6 -0
- package/dist/components/tooltip.d.ts +2 -0
- package/dist/components/tooltip.js +4 -0
- package/dist/dialog-CTqRrytc.js +103 -0
- package/dist/dialog-CTqRrytc.js.map +1 -0
- package/dist/direction-BKSh6e6q.js +3 -0
- package/dist/dropdown-menu-CcumvwhM.js +139 -0
- package/dist/dropdown-menu-CcumvwhM.js.map +1 -0
- package/dist/dropdown-menu-tIPvwiCD.d.ts +91 -0
- package/dist/dropdown-menu-tIPvwiCD.d.ts.map +1 -0
- package/dist/file-upload-CmWvJwwY.d.ts +145 -0
- package/dist/file-upload-CmWvJwwY.d.ts.map +1 -0
- package/dist/file-upload-DeCIv13t.js +434 -0
- package/dist/file-upload-DeCIv13t.js.map +1 -0
- package/dist/hooks/use-async-options.d.ts +2 -0
- package/dist/hooks/use-async-options.js +3 -0
- package/dist/hooks/use-debounce.d.ts +5 -0
- package/dist/hooks/use-debounce.d.ts.map +1 -0
- package/dist/hooks/use-debounce.js +3 -0
- package/dist/hooks/use-file-upload.d.ts +2 -0
- package/dist/hooks/use-file-upload.js +3 -0
- package/dist/hooks/use-infinite-scroll.d.ts +21 -0
- package/dist/hooks/use-infinite-scroll.d.ts.map +1 -0
- package/dist/hooks/use-infinite-scroll.js +4 -0
- package/dist/hooks/use-intersection-observer.d.ts +2 -0
- package/dist/hooks/use-intersection-observer.js +3 -0
- package/dist/hooks/use-mobile.d.ts +5 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +3 -0
- package/dist/input-8jqdnUZl.js +18 -0
- package/dist/input-8jqdnUZl.js.map +1 -0
- package/dist/input-CvG-4ebq.d.ts +12 -0
- package/dist/input-CvG-4ebq.d.ts.map +1 -0
- package/dist/input-group-DqEkmpXW.js +81 -0
- package/dist/input-group-DqEkmpXW.js.map +1 -0
- package/dist/label-AaH9ZYCZ.js +16 -0
- package/dist/label-AaH9ZYCZ.js.map +1 -0
- package/dist/label-CCHCFJeS.d.ts +11 -0
- package/dist/label-CCHCFJeS.d.ts.map +1 -0
- package/dist/lib/utils.d.ts +7 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +3 -0
- package/dist/popover-C9D43EuT.js +57 -0
- package/dist/popover-C9D43EuT.js.map +1 -0
- package/dist/providers/px-ui-provider.d.ts +36 -0
- package/dist/providers/px-ui-provider.d.ts.map +1 -0
- package/dist/providers/px-ui-provider.js +26 -0
- package/dist/providers/px-ui-provider.js.map +1 -0
- package/dist/separator-BS3ilczC.js +17 -0
- package/dist/separator-BS3ilczC.js.map +1 -0
- package/dist/separator-CmcC4YJr.d.ts +12 -0
- package/dist/separator-CmcC4YJr.d.ts.map +1 -0
- package/dist/sheet-CLjNDrfL.js +91 -0
- package/dist/sheet-CLjNDrfL.js.map +1 -0
- package/dist/skeleton-BcIxI5Wq.js +15 -0
- package/dist/skeleton-BcIxI5Wq.js.map +1 -0
- package/dist/spinner-Bo0sUZEg.js +17 -0
- package/dist/spinner-Bo0sUZEg.js.map +1 -0
- package/dist/styles.css +196 -0
- package/dist/textarea-Cq0o323P.js +16 -0
- package/dist/textarea-Cq0o323P.js.map +1 -0
- package/dist/toast-COWAQbIk.js +211 -0
- package/dist/toast-COWAQbIk.js.map +1 -0
- package/dist/toast-FlYtbGl-.d.ts +74 -0
- package/dist/toast-FlYtbGl-.d.ts.map +1 -0
- package/dist/toggle-Bln33AlY.d.ts +19 -0
- package/dist/toggle-Bln33AlY.d.ts.map +1 -0
- package/dist/toggle-DhJ_qwgw.js +38 -0
- package/dist/toggle-DhJ_qwgw.js.map +1 -0
- package/dist/tooltip-D7qJywrH.d.ts +26 -0
- package/dist/tooltip-D7qJywrH.d.ts.map +1 -0
- package/dist/tooltip-DkPxCJIL.js +43 -0
- package/dist/tooltip-DkPxCJIL.js.map +1 -0
- package/dist/use-async-options-DHR8q5qX.d.ts +45 -0
- package/dist/use-async-options-DHR8q5qX.d.ts.map +1 -0
- package/dist/use-async-options-wZ9LJ2BJ.js +46 -0
- package/dist/use-async-options-wZ9LJ2BJ.js.map +1 -0
- package/dist/use-debounce-_qaEZqtt.js +24 -0
- package/dist/use-debounce-_qaEZqtt.js.map +1 -0
- package/dist/{index.js → use-file-upload-Dxrej28u.js} +3 -204
- package/dist/use-file-upload-Dxrej28u.js.map +1 -0
- package/dist/use-file-upload-yy-xLBtn.d.ts +133 -0
- package/dist/use-file-upload-yy-xLBtn.d.ts.map +1 -0
- package/dist/use-infinite-scroll-CpbhGGT5.js +38 -0
- package/dist/use-infinite-scroll-CpbhGGT5.js.map +1 -0
- package/dist/use-intersection-observer-C2xDq2SW.d.ts +11 -0
- package/dist/use-intersection-observer-C2xDq2SW.d.ts.map +1 -0
- package/dist/use-intersection-observer-CZfnep4z.js +33 -0
- package/dist/use-intersection-observer-CZfnep4z.js.map +1 -0
- package/dist/use-mobile-l5ebOdQl.js +21 -0
- package/dist/use-mobile-l5ebOdQl.js.map +1 -0
- package/dist/utils-mWJR2N24.js +28 -0
- package/dist/utils-mWJR2N24.js.map +1 -0
- package/package.json +289 -26
- package/dist/index.css +0 -143
- package/dist/index.d.ts +0 -229
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { t as cn } from "../utils-mWJR2N24.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/card.tsx
|
|
6
|
+
function Card({ className, size = "default", ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx("div", {
|
|
8
|
+
"data-slot": "card",
|
|
9
|
+
"data-size": size,
|
|
10
|
+
className: cn("group/card flex flex-col gap-6 overflow-hidden rounded-xl bg-card py-6 text-sm text-card-foreground shadow-xs 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", className),
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function CardHeader({ className, ...props }) {
|
|
15
|
+
return /* @__PURE__ */ jsx("div", {
|
|
16
|
+
"data-slot": "card-header",
|
|
17
|
+
className: cn("group/card-header @container/card-header grid auto-rows-min items-start gap-1 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", className),
|
|
18
|
+
...props
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function CardTitle({ className, ...props }) {
|
|
22
|
+
return /* @__PURE__ */ jsx("div", {
|
|
23
|
+
"data-slot": "card-title",
|
|
24
|
+
className: cn("font-heading text-base leading-normal font-medium group-data-[size=sm]/card:text-sm", className),
|
|
25
|
+
...props
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function CardDescription({ className, ...props }) {
|
|
29
|
+
return /* @__PURE__ */ jsx("div", {
|
|
30
|
+
"data-slot": "card-description",
|
|
31
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function CardAction({ className, ...props }) {
|
|
36
|
+
return /* @__PURE__ */ jsx("div", {
|
|
37
|
+
"data-slot": "card-action",
|
|
38
|
+
className: cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className),
|
|
39
|
+
...props
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
function CardContent({ className, ...props }) {
|
|
43
|
+
return /* @__PURE__ */ jsx("div", {
|
|
44
|
+
"data-slot": "card-content",
|
|
45
|
+
className: cn("px-6 group-data-[size=sm]/card:px-4", className),
|
|
46
|
+
...props
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function CardFooter({ className, ...props }) {
|
|
50
|
+
return /* @__PURE__ */ jsx("div", {
|
|
51
|
+
"data-slot": "card-footer",
|
|
52
|
+
className: cn("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", className),
|
|
53
|
+
...props
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
//#endregion
|
|
58
|
+
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
|
|
59
|
+
//# sourceMappingURL=card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.js","names":[],"sources":["../../src/components/card.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { cn } from \"@px-ui/ui/lib/utils\"\n\nfunction Card({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"div\"> & { size?: \"default\" | \"sm\" }) {\n return (\n <div\n data-slot=\"card\"\n data-size={size}\n className={cn(\n \"group/card flex flex-col gap-6 overflow-hidden rounded-xl bg-card py-6 text-sm text-card-foreground shadow-xs 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\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CardHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n \"group/card-header @container/card-header grid auto-rows-min items-start gap-1 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\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CardTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-title\"\n className={cn(\n \"font-heading text-base leading-normal font-medium group-data-[size=sm]/card:text-sm\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CardDescription({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-description\"\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\nfunction CardAction({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-action\"\n className={cn(\n \"col-start-2 row-span-2 row-start-1 self-start justify-self-end\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CardContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-content\"\n className={cn(\"px-6 group-data-[size=sm]/card:px-4\", className)}\n {...props}\n />\n )\n}\n\nfunction CardFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-footer\"\n className={cn(\n \"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\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle,\n CardAction,\n CardDescription,\n CardContent,\n}\n"],"mappings":";;;;;AAIA,SAAS,KAAK,EACZ,WACA,OAAO,WACP,GAAG,SACyD;AAC5D,QACE,oBAAC;EACC,aAAU;EACV,aAAW;EACX,WAAW,GACT,iRACA,UACD;EACD,GAAI;GACJ;;AAIN,SAAS,WAAW,EAAE,WAAW,GAAG,SAAsC;AACxE,QACE,oBAAC;EACC,aAAU;EACV,WAAW,GACT,sSACA,UACD;EACD,GAAI;GACJ;;AAIN,SAAS,UAAU,EAAE,WAAW,GAAG,SAAsC;AACvE,QACE,oBAAC;EACC,aAAU;EACV,WAAW,GACT,uFACA,UACD;EACD,GAAI;GACJ;;AAIN,SAAS,gBAAgB,EAAE,WAAW,GAAG,SAAsC;AAC7E,QACE,oBAAC;EACC,aAAU;EACV,WAAW,GAAG,iCAAiC,UAAU;EACzD,GAAI;GACJ;;AAIN,SAAS,WAAW,EAAE,WAAW,GAAG,SAAsC;AACxE,QACE,oBAAC;EACC,aAAU;EACV,WAAW,GACT,kEACA,UACD;EACD,GAAI;GACJ;;AAIN,SAAS,YAAY,EAAE,WAAW,GAAG,SAAsC;AACzE,QACE,oBAAC;EACC,aAAU;EACV,WAAW,GAAG,uCAAuC,UAAU;EAC/D,GAAI;GACJ;;AAIN,SAAS,WAAW,EAAE,WAAW,GAAG,SAAsC;AACxE,QACE,oBAAC;EACC,aAAU;EACV,WAAW,GACT,kIACA,UACD;EACD,GAAI;GACJ"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { t as Button } from "../button-KTVkwZNA.js";
|
|
2
|
+
import * as react_jsx_runtime137 from "react/jsx-runtime";
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
import useEmblaCarousel, { UseEmblaCarouselType } from "embla-carousel-react";
|
|
5
|
+
|
|
6
|
+
//#region src/components/carousel.d.ts
|
|
7
|
+
type CarouselApi = UseEmblaCarouselType[1];
|
|
8
|
+
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
|
|
9
|
+
type CarouselOptions = UseCarouselParameters[0];
|
|
10
|
+
type CarouselPlugin = UseCarouselParameters[1];
|
|
11
|
+
type CarouselProps = {
|
|
12
|
+
opts?: CarouselOptions;
|
|
13
|
+
plugins?: CarouselPlugin;
|
|
14
|
+
orientation?: "horizontal" | "vertical";
|
|
15
|
+
setApi?: (api: CarouselApi) => void;
|
|
16
|
+
};
|
|
17
|
+
type CarouselContextProps = {
|
|
18
|
+
carouselRef: ReturnType<typeof useEmblaCarousel>[0];
|
|
19
|
+
api: ReturnType<typeof useEmblaCarousel>[1];
|
|
20
|
+
scrollPrev: () => void;
|
|
21
|
+
scrollNext: () => void;
|
|
22
|
+
canScrollPrev: boolean;
|
|
23
|
+
canScrollNext: boolean;
|
|
24
|
+
} & CarouselProps;
|
|
25
|
+
declare function useCarousel(): CarouselContextProps;
|
|
26
|
+
declare function Carousel({
|
|
27
|
+
orientation,
|
|
28
|
+
opts,
|
|
29
|
+
setApi,
|
|
30
|
+
plugins,
|
|
31
|
+
className,
|
|
32
|
+
children,
|
|
33
|
+
...props
|
|
34
|
+
}: React$1.ComponentProps<"div"> & CarouselProps): react_jsx_runtime137.JSX.Element;
|
|
35
|
+
declare function CarouselContent({
|
|
36
|
+
className,
|
|
37
|
+
...props
|
|
38
|
+
}: React$1.ComponentProps<"div">): react_jsx_runtime137.JSX.Element;
|
|
39
|
+
declare function CarouselItem({
|
|
40
|
+
className,
|
|
41
|
+
...props
|
|
42
|
+
}: React$1.ComponentProps<"div">): react_jsx_runtime137.JSX.Element;
|
|
43
|
+
declare function CarouselPrevious({
|
|
44
|
+
className,
|
|
45
|
+
variant,
|
|
46
|
+
size,
|
|
47
|
+
...props
|
|
48
|
+
}: React$1.ComponentProps<typeof Button>): react_jsx_runtime137.JSX.Element;
|
|
49
|
+
declare function CarouselNext({
|
|
50
|
+
className,
|
|
51
|
+
variant,
|
|
52
|
+
size,
|
|
53
|
+
...props
|
|
54
|
+
}: React$1.ComponentProps<typeof Button>): react_jsx_runtime137.JSX.Element;
|
|
55
|
+
//#endregion
|
|
56
|
+
export { Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, useCarousel };
|
|
57
|
+
//# sourceMappingURL=carousel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carousel.d.ts","names":[],"sources":["../../src/components/carousel.tsx"],"sourcesContent":[],"mappings":";;;;;;KAWK,WAAA,GAAc;KACd,qBAAA,GAAwB,kBAAkB;KAC1C,eAAA,GAAkB;AAL6B,KAM/C,cAAA,GAAiB,qBAHH,CAAA,CAAA,CAAA;AAAoB,KAKlC,aAAA,GAJA;EACA,IAAA,CAAA,EAII,eAJW;EACf,OAAA,CAAA,EAIO,cAJO;EAEd,WAAA,CAAA,EAAA,YAAa,GAAA,UAAA;EACT,MAAA,CAAA,EAAA,CAAA,GAAA,EAGQ,WAHR,EAAA,GAAA,IAAA;CACG;KAKP,oBAAA,GAHY;EAAW,WAAA,EAIb,UAJa,CAAA,OAIK,gBAJL,CAAA,CAAA,CAAA,CAAA;EAGvB,GAAA,EAEE,UAFF,CAAA,OAEoB,gBAFA,CAAA,CAAA,CAAA,CAAA;EACQ,UAAA,EAAA,GAAA,GAAA,IAAA;EAAlB,UAAA,EAAA,GAAA,GAAA,IAAA;EACU,aAAA,EAAA,OAAA;EAAlB,aAAA,EAAA,OAAA;CAKH,GAAA,aAAA;iBAIK,WAAA,CAAA,CAJQ,EAIG,oBAJH;AAAA,iBAcR,QAAA,CAVW;EAAA,WAAA;EAAA,IAAA;EAAA,MAAA;EAAA,OAAA;EAAA,SAAA;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAkBjB,OAAA,CAAM,cAlBW,CAAA,KAAA,CAAA,GAkBa,aAlBb,CAAA,EAkB0B,oBAAA,CAAA,GAAA,CAAA,OAlB1B;AAAA,iBAoGX,eAAA,CA1FQ;EAAA,SAAA;EAAA,GAAA;AAAA,CAAA,EA0FiC,OAAA,CAAM,cA1FvC,CAAA,KAAA,CAAA,CAAA,EA0F4D,oBAAA,CAAA,GAAA,CAAA,OA1F5D;iBA+GR,YAAA,CA9GP;EAAA,SAAA;EAAA,GAAA;AAAA,CAAA,EA8G6C,OAAA,CAAM,cA9GnD,CAAA,KAAA,CAAA,CAAA,EA8GwE,oBAAA,CAAA,GAAA,CAAA,OA9GxE;iBAgIO,gBAAA,CA/HP;EAAA,SAAA;EAAA,OAAA;EAAA,IAAA;EAAA,GAAA;AAAA,CAAA,EAoIC,OAAA,CAAM,cApIP,CAAA,OAoI6B,MApI7B,CAAA,CAAA,EAoIoC,oBAAA,CAAA,GAAA,CAAA,OApIpC;iBA6JO,YAAA,CA5JP;EAAA,SAAA;EAAA,OAAA;EAAA,IAAA;EAAA,GAAA;AAAA,CAAA,EAiKC,OAAA,CAAM,cAjKP,CAAA,OAiK6B,MAjK7B,CAAA,CAAA,EAiKoC,oBAAA,CAAA,GAAA,CAAA,OAjKpC"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { t as cn } from "../utils-mWJR2N24.js";
|
|
4
|
+
import { t as Button } from "../button-hBUFMmsZ.js";
|
|
5
|
+
import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import * as React$1 from "react";
|
|
8
|
+
import useEmblaCarousel from "embla-carousel-react";
|
|
9
|
+
|
|
10
|
+
//#region src/components/carousel.tsx
|
|
11
|
+
const CarouselContext = React$1.createContext(null);
|
|
12
|
+
function useCarousel() {
|
|
13
|
+
const context = React$1.useContext(CarouselContext);
|
|
14
|
+
if (!context) throw new Error("useCarousel must be used within a <Carousel />");
|
|
15
|
+
return context;
|
|
16
|
+
}
|
|
17
|
+
function Carousel({ orientation = "horizontal", opts, setApi, plugins, className, children, ...props }) {
|
|
18
|
+
const [carouselRef, api] = useEmblaCarousel({
|
|
19
|
+
...opts,
|
|
20
|
+
axis: orientation === "horizontal" ? "x" : "y"
|
|
21
|
+
}, plugins);
|
|
22
|
+
const [canScrollPrev, setCanScrollPrev] = React$1.useState(false);
|
|
23
|
+
const [canScrollNext, setCanScrollNext] = React$1.useState(false);
|
|
24
|
+
const onSelect = React$1.useCallback((api$1) => {
|
|
25
|
+
if (!api$1) return;
|
|
26
|
+
setCanScrollPrev(api$1.canScrollPrev());
|
|
27
|
+
setCanScrollNext(api$1.canScrollNext());
|
|
28
|
+
}, []);
|
|
29
|
+
const scrollPrev = React$1.useCallback(() => {
|
|
30
|
+
api?.scrollPrev();
|
|
31
|
+
}, [api]);
|
|
32
|
+
const scrollNext = React$1.useCallback(() => {
|
|
33
|
+
api?.scrollNext();
|
|
34
|
+
}, [api]);
|
|
35
|
+
const handleKeyDown = React$1.useCallback((event) => {
|
|
36
|
+
if (event.key === "ArrowLeft") {
|
|
37
|
+
event.preventDefault();
|
|
38
|
+
scrollPrev();
|
|
39
|
+
} else if (event.key === "ArrowRight") {
|
|
40
|
+
event.preventDefault();
|
|
41
|
+
scrollNext();
|
|
42
|
+
}
|
|
43
|
+
}, [scrollPrev, scrollNext]);
|
|
44
|
+
React$1.useEffect(() => {
|
|
45
|
+
if (!api || !setApi) return;
|
|
46
|
+
setApi(api);
|
|
47
|
+
}, [api, setApi]);
|
|
48
|
+
React$1.useEffect(() => {
|
|
49
|
+
if (!api) return;
|
|
50
|
+
onSelect(api);
|
|
51
|
+
api.on("reInit", onSelect);
|
|
52
|
+
api.on("select", onSelect);
|
|
53
|
+
return () => {
|
|
54
|
+
api?.off("select", onSelect);
|
|
55
|
+
};
|
|
56
|
+
}, [api, onSelect]);
|
|
57
|
+
return /* @__PURE__ */ jsx(CarouselContext.Provider, {
|
|
58
|
+
value: {
|
|
59
|
+
carouselRef,
|
|
60
|
+
api,
|
|
61
|
+
opts,
|
|
62
|
+
orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
|
|
63
|
+
scrollPrev,
|
|
64
|
+
scrollNext,
|
|
65
|
+
canScrollPrev,
|
|
66
|
+
canScrollNext
|
|
67
|
+
},
|
|
68
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
69
|
+
onKeyDownCapture: handleKeyDown,
|
|
70
|
+
className: cn("relative", className),
|
|
71
|
+
role: "region",
|
|
72
|
+
"aria-roledescription": "carousel",
|
|
73
|
+
"data-slot": "carousel",
|
|
74
|
+
...props,
|
|
75
|
+
children
|
|
76
|
+
})
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
function CarouselContent({ className, ...props }) {
|
|
80
|
+
const { carouselRef, orientation } = useCarousel();
|
|
81
|
+
return /* @__PURE__ */ jsx("div", {
|
|
82
|
+
ref: carouselRef,
|
|
83
|
+
className: "overflow-hidden",
|
|
84
|
+
"data-slot": "carousel-content",
|
|
85
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
86
|
+
className: cn("flex", orientation === "horizontal" ? "-ms-4" : "-mt-4 flex-col", className),
|
|
87
|
+
...props
|
|
88
|
+
})
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
function CarouselItem({ className, ...props }) {
|
|
92
|
+
const { orientation } = useCarousel();
|
|
93
|
+
return /* @__PURE__ */ jsx("div", {
|
|
94
|
+
role: "group",
|
|
95
|
+
"aria-roledescription": "slide",
|
|
96
|
+
"data-slot": "carousel-item",
|
|
97
|
+
className: cn("min-w-0 shrink-0 grow-0 basis-full", orientation === "horizontal" ? "ps-4" : "pt-4", className),
|
|
98
|
+
...props
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
function CarouselPrevious({ className, variant = "outline", size = "icon-sm", ...props }) {
|
|
102
|
+
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
103
|
+
return /* @__PURE__ */ jsxs(Button, {
|
|
104
|
+
"data-slot": "carousel-previous",
|
|
105
|
+
variant,
|
|
106
|
+
size,
|
|
107
|
+
className: cn("absolute touch-manipulation rounded-full", orientation === "horizontal" ? "top-1/2 -start-12 -translate-y-1/2" : "-top-12 start-1/2 -translate-x-1/2 rtl:translate-x-1/2 rotate-90", className),
|
|
108
|
+
disabled: !canScrollPrev,
|
|
109
|
+
onClick: scrollPrev,
|
|
110
|
+
...props,
|
|
111
|
+
children: [/* @__PURE__ */ jsx(ChevronLeftIcon, { className: "rtl:rotate-180" }), /* @__PURE__ */ jsx("span", {
|
|
112
|
+
className: "sr-only",
|
|
113
|
+
children: "Previous slide"
|
|
114
|
+
})]
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
function CarouselNext({ className, variant = "outline", size = "icon-sm", ...props }) {
|
|
118
|
+
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
119
|
+
return /* @__PURE__ */ jsxs(Button, {
|
|
120
|
+
"data-slot": "carousel-next",
|
|
121
|
+
variant,
|
|
122
|
+
size,
|
|
123
|
+
className: cn("absolute touch-manipulation rounded-full", orientation === "horizontal" ? "top-1/2 -end-12 -translate-y-1/2" : "-bottom-12 start-1/2 -translate-x-1/2 rtl:translate-x-1/2 rotate-90", className),
|
|
124
|
+
disabled: !canScrollNext,
|
|
125
|
+
onClick: scrollNext,
|
|
126
|
+
...props,
|
|
127
|
+
children: [/* @__PURE__ */ jsx(ChevronRightIcon, { className: "rtl:rotate-180" }), /* @__PURE__ */ jsx("span", {
|
|
128
|
+
className: "sr-only",
|
|
129
|
+
children: "Next slide"
|
|
130
|
+
})]
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
//#endregion
|
|
135
|
+
export { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, useCarousel };
|
|
136
|
+
//# sourceMappingURL=carousel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carousel.js","names":["React","api"],"sources":["../../src/components/carousel.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport useEmblaCarousel, {\n type UseEmblaCarouselType,\n} from \"embla-carousel-react\"\n\nimport { cn } from \"@px-ui/ui/lib/utils\"\nimport { Button } from \"@px-ui/ui/components/button\"\nimport { ChevronLeftIcon, ChevronRightIcon } from \"lucide-react\"\n\ntype CarouselApi = UseEmblaCarouselType[1]\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>\ntype CarouselOptions = UseCarouselParameters[0]\ntype CarouselPlugin = UseCarouselParameters[1]\n\ntype CarouselProps = {\n opts?: CarouselOptions\n plugins?: CarouselPlugin\n orientation?: \"horizontal\" | \"vertical\"\n setApi?: (api: CarouselApi) => void\n}\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0]\n api: ReturnType<typeof useEmblaCarousel>[1]\n scrollPrev: () => void\n scrollNext: () => void\n canScrollPrev: boolean\n canScrollNext: boolean\n} & CarouselProps\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null)\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext)\n\n if (!context) {\n throw new Error(\"useCarousel must be used within a <Carousel />\")\n }\n\n return context\n}\n\nfunction Carousel({\n orientation = \"horizontal\",\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & CarouselProps) {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === \"horizontal\" ? \"x\" : \"y\",\n },\n plugins\n )\n const [canScrollPrev, setCanScrollPrev] = React.useState(false)\n const [canScrollNext, setCanScrollNext] = React.useState(false)\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) return\n setCanScrollPrev(api.canScrollPrev())\n setCanScrollNext(api.canScrollNext())\n }, [])\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev()\n }, [api])\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext()\n }, [api])\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === \"ArrowLeft\") {\n event.preventDefault()\n scrollPrev()\n } else if (event.key === \"ArrowRight\") {\n event.preventDefault()\n scrollNext()\n }\n },\n [scrollPrev, scrollNext]\n )\n\n React.useEffect(() => {\n if (!api || !setApi) return\n setApi(api)\n }, [api, setApi])\n\n React.useEffect(() => {\n if (!api) return\n onSelect(api)\n api.on(\"reInit\", onSelect)\n api.on(\"select\", onSelect)\n\n return () => {\n api?.off(\"select\", onSelect)\n }\n }, [api, onSelect])\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation:\n orientation || (opts?.axis === \"y\" ? \"vertical\" : \"horizontal\"),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <div\n onKeyDownCapture={handleKeyDown}\n className={cn(\"relative\", className)}\n role=\"region\"\n aria-roledescription=\"carousel\"\n data-slot=\"carousel\"\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n )\n}\n\nfunction CarouselContent({ className, ...props }: React.ComponentProps<\"div\">) {\n const { carouselRef, orientation } = useCarousel()\n\n return (\n <div\n ref={carouselRef}\n className=\"overflow-hidden\"\n data-slot=\"carousel-content\"\n >\n <div\n className={cn(\n \"flex\",\n orientation === \"horizontal\" ? \"-ms-4\" : \"-mt-4 flex-col\",\n className\n )}\n {...props}\n />\n </div>\n )\n}\n\nfunction CarouselItem({ className, ...props }: React.ComponentProps<\"div\">) {\n const { orientation } = useCarousel()\n\n return (\n <div\n role=\"group\"\n aria-roledescription=\"slide\"\n data-slot=\"carousel-item\"\n className={cn(\n \"min-w-0 shrink-0 grow-0 basis-full\",\n orientation === \"horizontal\" ? \"ps-4\" : \"pt-4\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CarouselPrevious({\n className,\n variant = \"outline\",\n size = \"icon-sm\",\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel()\n\n return (\n <Button\n data-slot=\"carousel-previous\"\n variant={variant}\n size={size}\n className={cn(\n \"absolute touch-manipulation rounded-full\",\n orientation === \"horizontal\"\n ? \"top-1/2 -start-12 -translate-y-1/2\"\n : \"-top-12 start-1/2 -translate-x-1/2 rtl:translate-x-1/2 rotate-90\",\n className\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <ChevronLeftIcon className=\"rtl:rotate-180\" />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n )\n}\n\nfunction CarouselNext({\n className,\n variant = \"outline\",\n size = \"icon-sm\",\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollNext, canScrollNext } = useCarousel()\n\n return (\n <Button\n data-slot=\"carousel-next\"\n variant={variant}\n size={size}\n className={cn(\n \"absolute touch-manipulation rounded-full\",\n orientation === \"horizontal\"\n ? \"top-1/2 -end-12 -translate-y-1/2\"\n : \"-bottom-12 start-1/2 -translate-x-1/2 rtl:translate-x-1/2 rotate-90\",\n className\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <ChevronRightIcon className=\"rtl:rotate-180\" />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n )\n}\n\nexport {\n type CarouselApi,\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselPrevious,\n CarouselNext,\n useCarousel,\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as react_jsx_runtime133 from "react/jsx-runtime";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import * as RechartsPrimitive from "recharts";
|
|
4
|
+
import { TooltipValueType } from "recharts";
|
|
5
|
+
|
|
6
|
+
//#region src/components/chart.d.ts
|
|
7
|
+
declare const THEMES: {
|
|
8
|
+
readonly light: "";
|
|
9
|
+
readonly dark: ".dark";
|
|
10
|
+
};
|
|
11
|
+
type TooltipNameType = number | string;
|
|
12
|
+
type ChartConfig = Record<string, {
|
|
13
|
+
label?: React$1.ReactNode;
|
|
14
|
+
icon?: React$1.ComponentType;
|
|
15
|
+
} & ({
|
|
16
|
+
color?: string;
|
|
17
|
+
theme?: never;
|
|
18
|
+
} | {
|
|
19
|
+
color?: never;
|
|
20
|
+
theme: Record<keyof typeof THEMES, string>;
|
|
21
|
+
})>;
|
|
22
|
+
declare function ChartContainer({
|
|
23
|
+
id,
|
|
24
|
+
className,
|
|
25
|
+
children,
|
|
26
|
+
config,
|
|
27
|
+
initialDimension,
|
|
28
|
+
...props
|
|
29
|
+
}: React$1.ComponentProps<"div"> & {
|
|
30
|
+
config: ChartConfig;
|
|
31
|
+
children: React$1.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>["children"];
|
|
32
|
+
initialDimension?: {
|
|
33
|
+
width: number;
|
|
34
|
+
height: number;
|
|
35
|
+
};
|
|
36
|
+
}): react_jsx_runtime133.JSX.Element;
|
|
37
|
+
declare const ChartStyle: ({
|
|
38
|
+
id,
|
|
39
|
+
config
|
|
40
|
+
}: {
|
|
41
|
+
id: string;
|
|
42
|
+
config: ChartConfig;
|
|
43
|
+
}) => react_jsx_runtime133.JSX.Element | null;
|
|
44
|
+
declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
|
|
45
|
+
declare function ChartTooltipContent({
|
|
46
|
+
active,
|
|
47
|
+
payload,
|
|
48
|
+
className,
|
|
49
|
+
indicator,
|
|
50
|
+
hideLabel,
|
|
51
|
+
hideIndicator,
|
|
52
|
+
label,
|
|
53
|
+
labelFormatter,
|
|
54
|
+
labelClassName,
|
|
55
|
+
formatter,
|
|
56
|
+
color,
|
|
57
|
+
nameKey,
|
|
58
|
+
labelKey
|
|
59
|
+
}: React$1.ComponentProps<typeof RechartsPrimitive.Tooltip> & React$1.ComponentProps<"div"> & {
|
|
60
|
+
hideLabel?: boolean;
|
|
61
|
+
hideIndicator?: boolean;
|
|
62
|
+
indicator?: "line" | "dot" | "dashed";
|
|
63
|
+
nameKey?: string;
|
|
64
|
+
labelKey?: string;
|
|
65
|
+
} & Omit<RechartsPrimitive.DefaultTooltipContentProps<TooltipValueType, TooltipNameType>, "accessibilityLayer">): react_jsx_runtime133.JSX.Element | null;
|
|
66
|
+
declare const ChartLegend: typeof RechartsPrimitive.Legend;
|
|
67
|
+
declare function ChartLegendContent({
|
|
68
|
+
className,
|
|
69
|
+
hideIcon,
|
|
70
|
+
payload,
|
|
71
|
+
verticalAlign,
|
|
72
|
+
nameKey
|
|
73
|
+
}: React$1.ComponentProps<"div"> & {
|
|
74
|
+
hideIcon?: boolean;
|
|
75
|
+
nameKey?: string;
|
|
76
|
+
} & RechartsPrimitive.DefaultLegendContentProps): react_jsx_runtime133.JSX.Element | null;
|
|
77
|
+
//#endregion
|
|
78
|
+
export { ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent };
|
|
79
|
+
//# sourceMappingURL=chart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart.d.ts","names":[],"sources":["../../src/components/chart.tsx"],"sourcesContent":[],"mappings":";;;;;;cAOM;;;AAL2C,CAAA;AAKG,KAG/C,eAAA,GAAe,MAAA,GAAA,MAAA;AAER,KAAA,WAAA,GAAc,MAAH,CAAA,MAAA,EAAA;EAGX,KAAM,CAAA,EAAN,OAAA,CAAM,SAAA;EACP,IAAA,CAAM,EAAN,OAAA,CAAM,aAAA;CAGiC,GAAA,CAAA;EAApB,KAAA,CAAA,EAAA,MAAA;EAPJ,KAAA,CAAA,EAAA,KAAA;CAAM,GAAA;EA2BvB,KAAA,CAAA,EAAA,KAAA;EACP,KAAA,EArB4B,MAqB5B,CAAA,MAAA,OArBgD,MAqBhD,EAAA,MAAA,CAAA;CACA,CAAA,CAAA;iBAFO,cAAA,CAGP;EAAA,EAAA;EAAA,SAAA;EAAA,QAAA;EAAA,MAAA;EAAA,gBAAA;EAAA,GAAA;CAAA,EAIC,OAAA,CAAM,cAJP,CAAA,KAAA,CAAA,GAAA;EACA,MAAA,EAIQ,WAJR;EACA,QAAA,EAIU,OAAA,CAAM,cAJhB,CAAA,OAKS,iBAAA,CAAkB,mBAL3B,CAAA,CAAA,UAAA,CAAA;EAEC,gBAAM,CAAA,EAAA;IACC,KAAA,EAAA,MAAA;IAEC,MAAA,EAAA,MAAkB;EADjB,CAAA;CAOX,CAAA,EAAA,oBAAA,CAAA,GAAA,CAAA,OAAA;cA0BK,UA1BL,EAAA,CAAA;EAAA,EAAA;EAAA;CAAA,EAAA;EA0BK,EAAA,EAAA,MAAA;EAAc,MAAA,EAAsC,WAAtC;CAAA,EAAA,GAAmD,oBAAA,CAAA,GAAA,CAAA,OAAA,GAAnD,IAAA;cAiCd,YAjCoD,EAAA,OAiCxC,iBAAA,CAAA,OAjCwC;iBAmCjD,mBAAA,CAnC8D;EAAA,MAAA;EAAA,OAAA;EAAA,SAAA;EAAA,SAAA;EAAA,SAAA;EAAA,aAAA;EAAA,KAAA;EAAA,cAAA;EAAA,cAAA;EAAA,SAAA;EAAA,KAAA;EAAA,OAAA;EAAA;AAsCrE,CAtCqE,EAiDpE,OAAA,CAAM,cAjD8D,CAAA,OAiDxC,iBAAA,CAAkB,OAjDsB,CAAA,GAkDrE,OAAA,CAAM,cAlD+D,CAAA,KAAA,CAAA,GAAA;EAAA,SAAA,CAAA,EAAA,OAAA;EAiCjE,aAAA,CAAA,EAAwC,OAAA;EAErC,SAAA,CAAA,EAAA,MAAA,GAAA,KAAmB,GAAA,QAAA;EAC1B,OAAA,CAAA,EAAA,MAAA;EACA,QAAA,CAAA,EAAA,MAAA;CACA,GAkBI,IAlBJ,CAmBE,iBAAA,CAAkB,0BAnBpB,CAoBI,gBApBJ,EAqBI,eArBJ,CAAA,EAAA,oBAAA,CAAA,CAAA,EAwBC,oBAAA,CAAA,GAAA,CAAA,OAAA,GAxBD,IAAA;cAuJI,WAtJJ,EAAA,OAsJwB,iBAAA,CAAkB,MAtJ1C;iBAwJO,kBAAA,CAvJP;EAAA,SAAA;EAAA,QAAA;EAAA,OAAA;EAAA,aAAA;EAAA;AAGA,CAHA,EA6JC,OAAA,CAAM,cA7JP,CAAA,KAAA,CAAA,GAAA;EACA,QAAA,CAAA,EAAA,OAAA;EACA,OAAA,CAAA,EAAA,MAAA;CACA,GA6JE,iBAAA,CAAkB,yBA7JpB,CAAA,EA6J6C,oBAAA,CAAA,GAAA,CAAA,OAAA,GA7J7C,IAAA"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { t as cn } from "../utils-mWJR2N24.js";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
import * as RechartsPrimitive from "recharts";
|
|
5
|
+
|
|
6
|
+
//#region src/components/chart.tsx
|
|
7
|
+
const THEMES = {
|
|
8
|
+
light: "",
|
|
9
|
+
dark: ".dark"
|
|
10
|
+
};
|
|
11
|
+
const INITIAL_DIMENSION = {
|
|
12
|
+
width: 320,
|
|
13
|
+
height: 200
|
|
14
|
+
};
|
|
15
|
+
const ChartContext = React$1.createContext(null);
|
|
16
|
+
function useChart() {
|
|
17
|
+
const context = React$1.useContext(ChartContext);
|
|
18
|
+
if (!context) throw new Error("useChart must be used within a <ChartContainer />");
|
|
19
|
+
return context;
|
|
20
|
+
}
|
|
21
|
+
function ChartContainer({ id, className, children, config, initialDimension = INITIAL_DIMENSION, ...props }) {
|
|
22
|
+
const uniqueId = React$1.useId();
|
|
23
|
+
const chartId = `chart-${id ?? uniqueId.replace(/:/g, "")}`;
|
|
24
|
+
return /* @__PURE__ */ jsx(ChartContext.Provider, {
|
|
25
|
+
value: { config },
|
|
26
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
27
|
+
"data-slot": "chart",
|
|
28
|
+
"data-chart": chartId,
|
|
29
|
+
className: cn("[&_.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-layer]:outline-hidden [&_.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]:outline-hidden [&_.recharts-surface]:outline-hidden flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-sector[stroke='#fff']]:stroke-transparent", className),
|
|
30
|
+
...props,
|
|
31
|
+
children: [/* @__PURE__ */ jsx(ChartStyle, {
|
|
32
|
+
id: chartId,
|
|
33
|
+
config
|
|
34
|
+
}), /* @__PURE__ */ jsx(RechartsPrimitive.ResponsiveContainer, {
|
|
35
|
+
initialDimension,
|
|
36
|
+
children
|
|
37
|
+
})]
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
const ChartStyle = ({ id, config }) => {
|
|
42
|
+
const colorConfig = Object.entries(config).filter(([, config$1]) => config$1.theme ?? config$1.color);
|
|
43
|
+
if (!colorConfig.length) return null;
|
|
44
|
+
return /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: Object.entries(THEMES).map(([theme, prefix]) => `
|
|
45
|
+
${prefix} [data-chart=${id}] {
|
|
46
|
+
${colorConfig.map(([key, itemConfig]) => {
|
|
47
|
+
const color = itemConfig.theme?.[theme] ?? itemConfig.color;
|
|
48
|
+
return color ? ` --color-${key}: ${color};` : null;
|
|
49
|
+
}).join("\n")}
|
|
50
|
+
}
|
|
51
|
+
`).join("\n") } });
|
|
52
|
+
};
|
|
53
|
+
const ChartTooltip = RechartsPrimitive.Tooltip;
|
|
54
|
+
function ChartTooltipContent({ active, payload, className, indicator = "dot", hideLabel = false, hideIndicator = false, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey }) {
|
|
55
|
+
const { config } = useChart();
|
|
56
|
+
const tooltipLabel = React$1.useMemo(() => {
|
|
57
|
+
if (hideLabel || !payload?.length) return null;
|
|
58
|
+
const [item] = payload;
|
|
59
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, `${labelKey ?? item?.dataKey ?? item?.name ?? "value"}`);
|
|
60
|
+
const value = !labelKey && typeof label === "string" ? config[label]?.label ?? label : itemConfig?.label;
|
|
61
|
+
if (labelFormatter) return /* @__PURE__ */ jsx("div", {
|
|
62
|
+
className: cn("font-medium", labelClassName),
|
|
63
|
+
children: labelFormatter(value, payload)
|
|
64
|
+
});
|
|
65
|
+
if (!value) return null;
|
|
66
|
+
return /* @__PURE__ */ jsx("div", {
|
|
67
|
+
className: cn("font-medium", labelClassName),
|
|
68
|
+
children: value
|
|
69
|
+
});
|
|
70
|
+
}, [
|
|
71
|
+
label,
|
|
72
|
+
labelFormatter,
|
|
73
|
+
payload,
|
|
74
|
+
hideLabel,
|
|
75
|
+
labelClassName,
|
|
76
|
+
config,
|
|
77
|
+
labelKey
|
|
78
|
+
]);
|
|
79
|
+
if (!active || !payload?.length) return null;
|
|
80
|
+
const nestLabel = payload.length === 1 && indicator !== "dot";
|
|
81
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
82
|
+
className: cn("border-border/50 bg-background grid min-w-32 items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl", className),
|
|
83
|
+
children: [!nestLabel ? tooltipLabel : null, /* @__PURE__ */ jsx("div", {
|
|
84
|
+
className: "grid gap-1.5",
|
|
85
|
+
children: payload.filter((item) => item.type !== "none").map((item, index) => {
|
|
86
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, `${nameKey ?? item.name ?? item.dataKey ?? "value"}`);
|
|
87
|
+
const indicatorColor = color ?? item.payload?.fill ?? item.color;
|
|
88
|
+
return /* @__PURE__ */ jsx("div", {
|
|
89
|
+
className: cn("[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5", indicator === "dot" && "items-center"),
|
|
90
|
+
children: formatter && item?.value !== void 0 && item.name ? formatter(item.value, item.name, item, index, item.payload) : /* @__PURE__ */ jsxs(Fragment, { children: [itemConfig?.icon ? /* @__PURE__ */ jsx(itemConfig.icon, {}) : !hideIndicator && /* @__PURE__ */ jsx("div", {
|
|
91
|
+
className: cn("border-(--color-border) bg-(--color-bg) shrink-0 rounded-[2px]", {
|
|
92
|
+
"h-2.5 w-2.5": indicator === "dot",
|
|
93
|
+
"w-1": indicator === "line",
|
|
94
|
+
"w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
|
|
95
|
+
"my-0.5": nestLabel && indicator === "dashed"
|
|
96
|
+
}),
|
|
97
|
+
style: {
|
|
98
|
+
"--color-bg": indicatorColor,
|
|
99
|
+
"--color-border": indicatorColor
|
|
100
|
+
}
|
|
101
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
102
|
+
className: cn("flex flex-1 justify-between leading-none", nestLabel ? "items-end" : "items-center"),
|
|
103
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
104
|
+
className: "grid gap-1.5",
|
|
105
|
+
children: [nestLabel ? tooltipLabel : null, /* @__PURE__ */ jsx("span", {
|
|
106
|
+
className: "text-muted-foreground",
|
|
107
|
+
children: itemConfig?.label ?? item.name
|
|
108
|
+
})]
|
|
109
|
+
}), item.value != null && /* @__PURE__ */ jsx("span", {
|
|
110
|
+
className: "text-foreground font-mono font-medium tabular-nums",
|
|
111
|
+
children: typeof item.value === "number" ? item.value.toLocaleString() : String(item.value)
|
|
112
|
+
})]
|
|
113
|
+
})] })
|
|
114
|
+
}, index);
|
|
115
|
+
})
|
|
116
|
+
})]
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
const ChartLegend = RechartsPrimitive.Legend;
|
|
120
|
+
function ChartLegendContent({ className, hideIcon = false, payload, verticalAlign = "bottom", nameKey }) {
|
|
121
|
+
const { config } = useChart();
|
|
122
|
+
if (!payload?.length) return null;
|
|
123
|
+
return /* @__PURE__ */ jsx("div", {
|
|
124
|
+
className: cn("flex items-center justify-center gap-4", verticalAlign === "top" ? "pb-3" : "pt-3", className),
|
|
125
|
+
children: payload.filter((item) => item.type !== "none").map((item, index) => {
|
|
126
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, `${nameKey ?? item.dataKey ?? "value"}`);
|
|
127
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
128
|
+
className: cn("[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"),
|
|
129
|
+
children: [itemConfig?.icon && !hideIcon ? /* @__PURE__ */ jsx(itemConfig.icon, {}) : /* @__PURE__ */ jsx("div", {
|
|
130
|
+
className: "h-2 w-2 shrink-0 rounded-[2px]",
|
|
131
|
+
style: { backgroundColor: item.color }
|
|
132
|
+
}), itemConfig?.label]
|
|
133
|
+
}, index);
|
|
134
|
+
})
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
function getPayloadConfigFromPayload(config, payload, key) {
|
|
138
|
+
if (typeof payload !== "object" || payload === null) return;
|
|
139
|
+
const payloadPayload = "payload" in payload && typeof payload.payload === "object" && payload.payload !== null ? payload.payload : void 0;
|
|
140
|
+
let configLabelKey = key;
|
|
141
|
+
if (key in payload && typeof payload[key] === "string") configLabelKey = payload[key];
|
|
142
|
+
else if (payloadPayload && key in payloadPayload && typeof payloadPayload[key] === "string") configLabelKey = payloadPayload[key];
|
|
143
|
+
return configLabelKey in config ? config[configLabelKey] : config[key];
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
//#endregion
|
|
147
|
+
export { ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent };
|
|
148
|
+
//# sourceMappingURL=chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart.js","names":["React","config","ChartLegend: typeof RechartsPrimitive.Legend","configLabelKey: string"],"sources":["../../src/components/chart.tsx"],"sourcesContent":["import * as React from \"react\";\nimport * as RechartsPrimitive from \"recharts\";\nimport type { TooltipValueType } from \"recharts\";\n\nimport { cn } from \"@px-ui/ui/lib/utils\";\n\n// Format: { THEME_NAME: CSS_SELECTOR }\nconst THEMES = { light: \"\", dark: \".dark\" } as const;\n\nconst INITIAL_DIMENSION = { width: 320, height: 200 } as const;\ntype TooltipNameType = number | string;\n\nexport type ChartConfig = Record<\n string,\n {\n label?: React.ReactNode;\n icon?: React.ComponentType;\n } & (\n | { color?: string; theme?: never }\n | { color?: never; theme: Record<keyof typeof THEMES, string> }\n )\n>;\n\ntype ChartContextProps = {\n config: ChartConfig;\n};\n\nconst ChartContext = React.createContext<ChartContextProps | null>(null);\n\nfunction useChart() {\n const context = React.useContext(ChartContext);\n\n if (!context) {\n throw new Error(\"useChart must be used within a <ChartContainer />\");\n }\n\n return context;\n}\n\nfunction ChartContainer({\n id,\n className,\n children,\n config,\n initialDimension = INITIAL_DIMENSION,\n ...props\n}: React.ComponentProps<\"div\"> & {\n config: ChartConfig;\n children: React.ComponentProps<\n typeof RechartsPrimitive.ResponsiveContainer\n >[\"children\"];\n initialDimension?: {\n width: number;\n height: number;\n };\n}) {\n const uniqueId = React.useId();\n const chartId = `chart-${id ?? uniqueId.replace(/:/g, \"\")}`;\n\n return (\n <ChartContext.Provider value={{ config }}>\n <div\n data-slot=\"chart\"\n data-chart={chartId}\n className={cn(\n \"[&_.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-layer]:outline-hidden [&_.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]:outline-hidden [&_.recharts-surface]:outline-hidden flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-sector[stroke='#fff']]:stroke-transparent\",\n className,\n )}\n {...props}\n >\n <ChartStyle id={chartId} config={config} />\n <RechartsPrimitive.ResponsiveContainer\n initialDimension={initialDimension}\n >\n {children}\n </RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n );\n}\n\nconst ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {\n const colorConfig = Object.entries(config).filter(\n ([, config]) => config.theme ?? config.color,\n );\n\n if (!colorConfig.length) {\n return null;\n }\n\n return (\n <style\n dangerouslySetInnerHTML={{\n __html: Object.entries(THEMES)\n .map(\n ([theme, prefix]) => `\n${prefix} [data-chart=${id}] {\n${colorConfig\n .map(([key, itemConfig]) => {\n const color =\n itemConfig.theme?.[theme as keyof typeof itemConfig.theme] ??\n itemConfig.color;\n return color ? ` --color-${key}: ${color};` : null;\n })\n .join(\"\\n\")}\n}\n`,\n )\n .join(\"\\n\"),\n }}\n />\n );\n};\n\nconst ChartTooltip = RechartsPrimitive.Tooltip;\n\nfunction ChartTooltipContent({\n active,\n payload,\n className,\n indicator = \"dot\",\n hideLabel = false,\n hideIndicator = false,\n label,\n labelFormatter,\n labelClassName,\n formatter,\n color,\n nameKey,\n labelKey,\n}: React.ComponentProps<typeof RechartsPrimitive.Tooltip> &\n React.ComponentProps<\"div\"> & {\n hideLabel?: boolean;\n hideIndicator?: boolean;\n indicator?: \"line\" | \"dot\" | \"dashed\";\n nameKey?: string;\n labelKey?: string;\n } & Omit<\n RechartsPrimitive.DefaultTooltipContentProps<\n TooltipValueType,\n TooltipNameType\n >,\n \"accessibilityLayer\"\n >) {\n const { config } = useChart();\n\n const tooltipLabel = React.useMemo(() => {\n if (hideLabel || !payload?.length) {\n return null;\n }\n\n const [item] = payload;\n const key = `${labelKey ?? item?.dataKey ?? item?.name ?? \"value\"}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const value =\n !labelKey && typeof label === \"string\"\n ? (config[label]?.label ?? label)\n : itemConfig?.label;\n\n if (labelFormatter) {\n return (\n <div className={cn(\"font-medium\", labelClassName)}>\n {labelFormatter(value, payload)}\n </div>\n );\n }\n\n if (!value) {\n return null;\n }\n\n return <div className={cn(\"font-medium\", labelClassName)}>{value}</div>;\n }, [\n label,\n labelFormatter,\n payload,\n hideLabel,\n labelClassName,\n config,\n labelKey,\n ]);\n\n if (!active || !payload?.length) {\n return null;\n }\n\n const nestLabel = payload.length === 1 && indicator !== \"dot\";\n\n return (\n <div\n className={cn(\n \"border-border/50 bg-background grid min-w-32 items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl\",\n className,\n )}\n >\n {!nestLabel ? tooltipLabel : null}\n <div className=\"grid gap-1.5\">\n {payload\n .filter((item) => item.type !== \"none\")\n .map((item, index) => {\n const key = `${nameKey ?? item.name ?? item.dataKey ?? \"value\"}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const indicatorColor = color ?? item.payload?.fill ?? item.color;\n\n return (\n <div\n key={index}\n className={cn(\n \"[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5\",\n indicator === \"dot\" && \"items-center\",\n )}\n >\n {formatter && item?.value !== undefined && item.name ? (\n formatter(item.value, item.name, item, index, item.payload)\n ) : (\n <>\n {itemConfig?.icon ? (\n <itemConfig.icon />\n ) : (\n !hideIndicator && (\n <div\n className={cn(\n \"border-(--color-border) bg-(--color-bg) shrink-0 rounded-[2px]\",\n {\n \"h-2.5 w-2.5\": indicator === \"dot\",\n \"w-1\": indicator === \"line\",\n \"w-0 border-[1.5px] border-dashed bg-transparent\":\n indicator === \"dashed\",\n \"my-0.5\": nestLabel && indicator === \"dashed\",\n },\n )}\n style={\n {\n \"--color-bg\": indicatorColor,\n \"--color-border\": indicatorColor,\n } as React.CSSProperties\n }\n />\n )\n )}\n <div\n className={cn(\n \"flex flex-1 justify-between leading-none\",\n nestLabel ? \"items-end\" : \"items-center\",\n )}\n >\n <div className=\"grid gap-1.5\">\n {nestLabel ? tooltipLabel : null}\n <span className=\"text-muted-foreground\">\n {itemConfig?.label ?? item.name}\n </span>\n </div>\n {item.value != null && (\n <span className=\"text-foreground font-mono font-medium tabular-nums\">\n {typeof item.value === \"number\"\n ? item.value.toLocaleString()\n : String(item.value)}\n </span>\n )}\n </div>\n </>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n\nconst ChartLegend: typeof RechartsPrimitive.Legend = RechartsPrimitive.Legend;\n\nfunction ChartLegendContent({\n className,\n hideIcon = false,\n payload,\n verticalAlign = \"bottom\",\n nameKey,\n}: React.ComponentProps<\"div\"> & {\n hideIcon?: boolean;\n nameKey?: string;\n} & RechartsPrimitive.DefaultLegendContentProps) {\n const { config } = useChart();\n\n if (!payload?.length) {\n return null;\n }\n\n return (\n <div\n className={cn(\n \"flex items-center justify-center gap-4\",\n verticalAlign === \"top\" ? \"pb-3\" : \"pt-3\",\n className,\n )}\n >\n {payload\n .filter((item) => item.type !== \"none\")\n .map((item, index) => {\n const key = `${nameKey ?? item.dataKey ?? \"value\"}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n\n return (\n <div\n key={index}\n className={cn(\n \"[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3\",\n )}\n >\n {itemConfig?.icon && !hideIcon ? (\n <itemConfig.icon />\n ) : (\n <div\n className=\"h-2 w-2 shrink-0 rounded-[2px]\"\n style={{\n backgroundColor: item.color,\n }}\n />\n )}\n {itemConfig?.label}\n </div>\n );\n })}\n </div>\n );\n}\n\nfunction getPayloadConfigFromPayload(\n config: ChartConfig,\n payload: unknown,\n key: string,\n) {\n if (typeof payload !== \"object\" || payload === null) {\n return undefined;\n }\n\n const payloadPayload =\n \"payload\" in payload &&\n typeof payload.payload === \"object\" &&\n payload.payload !== null\n ? payload.payload\n : undefined;\n\n let configLabelKey: string = key;\n\n if (\n key in payload &&\n typeof payload[key as keyof typeof payload] === \"string\"\n ) {\n configLabelKey = payload[key as keyof typeof payload] as string;\n } else if (\n payloadPayload &&\n key in payloadPayload &&\n typeof payloadPayload[key as keyof typeof payloadPayload] === \"string\"\n ) {\n configLabelKey = payloadPayload[\n key as keyof typeof payloadPayload\n ] as string;\n }\n\n return configLabelKey in config ? config[configLabelKey] : config[key];\n}\n\nexport {\n ChartContainer,\n ChartTooltip,\n ChartTooltipContent,\n ChartLegend,\n ChartLegendContent,\n ChartStyle,\n};\n"],"mappings":"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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as react_jsx_runtime253 from "react/jsx-runtime";
|
|
2
|
+
import { Checkbox as Checkbox$1 } from "@base-ui/react/checkbox";
|
|
3
|
+
|
|
4
|
+
//#region src/components/checkbox.d.ts
|
|
5
|
+
declare function Checkbox({
|
|
6
|
+
className,
|
|
7
|
+
...props
|
|
8
|
+
}: Checkbox$1.Root.Props): react_jsx_runtime253.JSX.Element;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { Checkbox };
|
|
11
|
+
//# sourceMappingURL=checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","names":[],"sources":["../../src/components/checkbox.tsx"],"sourcesContent":[],"mappings":";;;;iBAOS,QAAA;;;GAAkC,UAAA,CAAkB,IAAA,CAAK,QAAK,oBAAA,CAAA,GAAA,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { t as cn } from "../utils-mWJR2N24.js";
|
|
4
|
+
import { CheckIcon } from "lucide-react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { Checkbox as Checkbox$1 } from "@base-ui/react/checkbox";
|
|
7
|
+
|
|
8
|
+
//#region src/components/checkbox.tsx
|
|
9
|
+
function Checkbox({ className, ...props }) {
|
|
10
|
+
return /* @__PURE__ */ jsx(Checkbox$1.Root, {
|
|
11
|
+
"data-slot": "checkbox",
|
|
12
|
+
className: cn("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input shadow-xs transition-shadow outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary", className),
|
|
13
|
+
...props,
|
|
14
|
+
children: /* @__PURE__ */ jsx(Checkbox$1.Indicator, {
|
|
15
|
+
"data-slot": "checkbox-indicator",
|
|
16
|
+
className: "grid place-content-center text-current transition-none [&>svg]:size-3.5",
|
|
17
|
+
children: /* @__PURE__ */ jsx(CheckIcon, {})
|
|
18
|
+
})
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { Checkbox };
|
|
24
|
+
//# sourceMappingURL=checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.js","names":["CheckboxPrimitive"],"sources":["../../src/components/checkbox.tsx"],"sourcesContent":["\"use client\"\n\nimport { Checkbox as CheckboxPrimitive } from \"@base-ui/react/checkbox\"\n\nimport { cn } from \"@px-ui/ui/lib/utils\"\nimport { CheckIcon } from \"lucide-react\"\n\nfunction Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n \"peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input shadow-xs transition-shadow outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary\",\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none [&>svg]:size-3.5\"\n >\n <CheckIcon\n />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n}\n\nexport { Checkbox }\n"],"mappings":";;;;;;;;AAOA,SAAS,SAAS,EAAE,WAAW,GAAG,SAAuC;AACvE,QACE,oBAACA,WAAkB;EACjB,aAAU;EACV,WAAW,GACT,+qBACA,UACD;EACD,GAAI;YAEJ,oBAACA,WAAkB;GACjB,aAAU;GACV,WAAU;aAEV,oBAAC,cACC;IAC0B;GACP"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as react_jsx_runtime159 from "react/jsx-runtime";
|
|
2
|
+
import { Collapsible as Collapsible$1 } from "@base-ui/react/collapsible";
|
|
3
|
+
|
|
4
|
+
//#region src/components/collapsible.d.ts
|
|
5
|
+
declare function Collapsible({
|
|
6
|
+
...props
|
|
7
|
+
}: Collapsible$1.Root.Props): react_jsx_runtime159.JSX.Element;
|
|
8
|
+
declare function CollapsibleTrigger({
|
|
9
|
+
...props
|
|
10
|
+
}: Collapsible$1.Trigger.Props): react_jsx_runtime159.JSX.Element;
|
|
11
|
+
type CollapsibleContentProps = Collapsible$1.Panel.Props & {
|
|
12
|
+
/**
|
|
13
|
+
* Animate the panel's open/close with a height transition.
|
|
14
|
+
* Adds `overflow-hidden`, which can conflict with grid/subgrid layouts.
|
|
15
|
+
*/
|
|
16
|
+
animate?: boolean;
|
|
17
|
+
};
|
|
18
|
+
declare function CollapsibleContent({
|
|
19
|
+
animate,
|
|
20
|
+
className,
|
|
21
|
+
...props
|
|
22
|
+
}: CollapsibleContentProps): react_jsx_runtime159.JSX.Element;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { Collapsible, CollapsibleContent, CollapsibleTrigger };
|
|
25
|
+
//# sourceMappingURL=collapsible.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collapsible.d.ts","names":[],"sources":["../../src/components/collapsible.tsx"],"sourcesContent":[],"mappings":";;;;iBAIS,WAAA;;GAA0B,aAAA,CAAqB,IAAA,CAAK,QAAK,oBAAA,CAAA,GAAA,CAAA;iBAIzD,kBAAA;;GAAiC,aAAA,CAAqB,OAAA,CAAQ,QAAK,oBAAA,CAAA,GAAA,CAAA;KAMvE,uBAAA,GAA0B,aAAA,CAAqB,KAAA,CAAM;EAVjD;AAAyD;AAIU;AAMb;EAS7D,OAAA,CAAA,EAAA,OAAA;CACA;iBAFO,kBAAA,CAIN;EAAA,OAAA;EAAA,SAAA;EAAA,GAAA;AAAA,CAAA,EAAA,uBAAA,CAAA,EAAuB,oBAAA,CAAA,GAAA,CAAA,OAAvB"}
|