@e-infra/design-system 0.0.2
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/LICENSE.md +21 -0
- package/README.md +200 -0
- package/dist/index.cjs.js +298 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.cjs10.js +105 -0
- package/dist/index.cjs10.js.map +1 -0
- package/dist/index.cjs11.js +56 -0
- package/dist/index.cjs11.js.map +1 -0
- package/dist/index.cjs12.js +206 -0
- package/dist/index.cjs12.js.map +1 -0
- package/dist/index.cjs13.js +92 -0
- package/dist/index.cjs13.js.map +1 -0
- package/dist/index.cjs14.js +216 -0
- package/dist/index.cjs14.js.map +1 -0
- package/dist/index.cjs15.js +261 -0
- package/dist/index.cjs15.js.map +1 -0
- package/dist/index.cjs16.js +50 -0
- package/dist/index.cjs16.js.map +1 -0
- package/dist/index.cjs17.js +53 -0
- package/dist/index.cjs17.js.map +1 -0
- package/dist/index.cjs18.js +173 -0
- package/dist/index.cjs18.js.map +1 -0
- package/dist/index.cjs19.js +242 -0
- package/dist/index.cjs19.js.map +1 -0
- package/dist/index.cjs2.js +298 -0
- package/dist/index.cjs2.js.map +1 -0
- package/dist/index.cjs20.js +156 -0
- package/dist/index.cjs20.js.map +1 -0
- package/dist/index.cjs21.js +130 -0
- package/dist/index.cjs21.js.map +1 -0
- package/dist/index.cjs22.js +251 -0
- package/dist/index.cjs22.js.map +1 -0
- package/dist/index.cjs23.js +134 -0
- package/dist/index.cjs23.js.map +1 -0
- package/dist/index.cjs24.js +57 -0
- package/dist/index.cjs24.js.map +1 -0
- package/dist/index.cjs25.js +23 -0
- package/dist/index.cjs25.js.map +1 -0
- package/dist/index.cjs26.js +85 -0
- package/dist/index.cjs26.js.map +1 -0
- package/dist/index.cjs27.js +41 -0
- package/dist/index.cjs27.js.map +1 -0
- package/dist/index.cjs28.js +271 -0
- package/dist/index.cjs28.js.map +1 -0
- package/dist/index.cjs29.js +189 -0
- package/dist/index.cjs29.js.map +1 -0
- package/dist/index.cjs3.js +298 -0
- package/dist/index.cjs3.js.map +1 -0
- package/dist/index.cjs30.js +120 -0
- package/dist/index.cjs30.js.map +1 -0
- package/dist/index.cjs31.js +63 -0
- package/dist/index.cjs31.js.map +1 -0
- package/dist/index.cjs32.js +51 -0
- package/dist/index.cjs32.js.map +1 -0
- package/dist/index.cjs33.js +64 -0
- package/dist/index.cjs33.js.map +1 -0
- package/dist/index.cjs34.js +49 -0
- package/dist/index.cjs34.js.map +1 -0
- package/dist/index.cjs35.js +79 -0
- package/dist/index.cjs35.js.map +1 -0
- package/dist/index.cjs36.js +198 -0
- package/dist/index.cjs36.js.map +1 -0
- package/dist/index.cjs37.js +45 -0
- package/dist/index.cjs37.js.map +1 -0
- package/dist/index.cjs38.js +146 -0
- package/dist/index.cjs38.js.map +1 -0
- package/dist/index.cjs39.js +657 -0
- package/dist/index.cjs39.js.map +1 -0
- package/dist/index.cjs4.js +83 -0
- package/dist/index.cjs4.js.map +1 -0
- package/dist/index.cjs40.js +16 -0
- package/dist/index.cjs40.js.map +1 -0
- package/dist/index.cjs41.js +82 -0
- package/dist/index.cjs41.js.map +1 -0
- package/dist/index.cjs42.js +33 -0
- package/dist/index.cjs42.js.map +1 -0
- package/dist/index.cjs43.js +50 -0
- package/dist/index.cjs43.js.map +1 -0
- package/dist/index.cjs44.js +117 -0
- package/dist/index.cjs44.js.map +1 -0
- package/dist/index.cjs45.js +86 -0
- package/dist/index.cjs45.js.map +1 -0
- package/dist/index.cjs46.js +20 -0
- package/dist/index.cjs46.js.map +1 -0
- package/dist/index.cjs47.js +63 -0
- package/dist/index.cjs47.js.map +1 -0
- package/dist/index.cjs48.js +88 -0
- package/dist/index.cjs48.js.map +1 -0
- package/dist/index.cjs49.js +74 -0
- package/dist/index.cjs49.js.map +1 -0
- package/dist/index.cjs5.js +68 -0
- package/dist/index.cjs5.js.map +1 -0
- package/dist/index.cjs50.js +9 -0
- package/dist/index.cjs50.js.map +1 -0
- package/dist/index.cjs51.js +38 -0
- package/dist/index.cjs51.js.map +1 -0
- package/dist/index.cjs6.js +166 -0
- package/dist/index.cjs6.js.map +1 -0
- package/dist/index.cjs7.js +29 -0
- package/dist/index.cjs7.js.map +1 -0
- package/dist/index.cjs8.js +72 -0
- package/dist/index.cjs8.js.map +1 -0
- package/dist/index.cjs9.js +42 -0
- package/dist/index.cjs9.js.map +1 -0
- package/dist/index.es.js +298 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.es10.js +105 -0
- package/dist/index.es10.js.map +1 -0
- package/dist/index.es11.js +56 -0
- package/dist/index.es11.js.map +1 -0
- package/dist/index.es12.js +189 -0
- package/dist/index.es12.js.map +1 -0
- package/dist/index.es13.js +92 -0
- package/dist/index.es13.js.map +1 -0
- package/dist/index.es14.js +199 -0
- package/dist/index.es14.js.map +1 -0
- package/dist/index.es15.js +243 -0
- package/dist/index.es15.js.map +1 -0
- package/dist/index.es16.js +33 -0
- package/dist/index.es16.js.map +1 -0
- package/dist/index.es17.js +36 -0
- package/dist/index.es17.js.map +1 -0
- package/dist/index.es18.js +173 -0
- package/dist/index.es18.js.map +1 -0
- package/dist/index.es19.js +225 -0
- package/dist/index.es19.js.map +1 -0
- package/dist/index.es2.js +298 -0
- package/dist/index.es2.js.map +1 -0
- package/dist/index.es20.js +139 -0
- package/dist/index.es20.js.map +1 -0
- package/dist/index.es21.js +130 -0
- package/dist/index.es21.js.map +1 -0
- package/dist/index.es22.js +234 -0
- package/dist/index.es22.js.map +1 -0
- package/dist/index.es23.js +117 -0
- package/dist/index.es23.js.map +1 -0
- package/dist/index.es24.js +40 -0
- package/dist/index.es24.js.map +1 -0
- package/dist/index.es25.js +23 -0
- package/dist/index.es25.js.map +1 -0
- package/dist/index.es26.js +68 -0
- package/dist/index.es26.js.map +1 -0
- package/dist/index.es27.js +24 -0
- package/dist/index.es27.js.map +1 -0
- package/dist/index.es28.js +254 -0
- package/dist/index.es28.js.map +1 -0
- package/dist/index.es29.js +172 -0
- package/dist/index.es29.js.map +1 -0
- package/dist/index.es3.js +298 -0
- package/dist/index.es3.js.map +1 -0
- package/dist/index.es30.js +120 -0
- package/dist/index.es30.js.map +1 -0
- package/dist/index.es31.js +46 -0
- package/dist/index.es31.js.map +1 -0
- package/dist/index.es32.js +34 -0
- package/dist/index.es32.js.map +1 -0
- package/dist/index.es33.js +47 -0
- package/dist/index.es33.js.map +1 -0
- package/dist/index.es34.js +49 -0
- package/dist/index.es34.js.map +1 -0
- package/dist/index.es35.js +62 -0
- package/dist/index.es35.js.map +1 -0
- package/dist/index.es36.js +181 -0
- package/dist/index.es36.js.map +1 -0
- package/dist/index.es37.js +28 -0
- package/dist/index.es37.js.map +1 -0
- package/dist/index.es38.js +129 -0
- package/dist/index.es38.js.map +1 -0
- package/dist/index.es39.js +640 -0
- package/dist/index.es39.js.map +1 -0
- package/dist/index.es4.js +66 -0
- package/dist/index.es4.js.map +1 -0
- package/dist/index.es40.js +16 -0
- package/dist/index.es40.js.map +1 -0
- package/dist/index.es41.js +64 -0
- package/dist/index.es41.js.map +1 -0
- package/dist/index.es42.js +33 -0
- package/dist/index.es42.js.map +1 -0
- package/dist/index.es43.js +33 -0
- package/dist/index.es43.js.map +1 -0
- package/dist/index.es44.js +117 -0
- package/dist/index.es44.js.map +1 -0
- package/dist/index.es45.js +69 -0
- package/dist/index.es45.js.map +1 -0
- package/dist/index.es46.js +20 -0
- package/dist/index.es46.js.map +1 -0
- package/dist/index.es47.js +46 -0
- package/dist/index.es47.js.map +1 -0
- package/dist/index.es48.js +70 -0
- package/dist/index.es48.js.map +1 -0
- package/dist/index.es49.js +57 -0
- package/dist/index.es49.js.map +1 -0
- package/dist/index.es5.js +68 -0
- package/dist/index.es5.js.map +1 -0
- package/dist/index.es50.js +9 -0
- package/dist/index.es50.js.map +1 -0
- package/dist/index.es51.js +21 -0
- package/dist/index.es51.js.map +1 -0
- package/dist/index.es6.js +149 -0
- package/dist/index.es6.js.map +1 -0
- package/dist/index.es7.js +12 -0
- package/dist/index.es7.js.map +1 -0
- package/dist/index.es8.js +55 -0
- package/dist/index.es8.js.map +1 -0
- package/dist/index.es9.js +42 -0
- package/dist/index.es9.js.map +1 -0
- package/dist/types/components/index.d.ts +47 -0
- package/dist/types/components/index.d.ts.map +1 -0
- package/dist/types/components/ui/accordion.d.ts +8 -0
- package/dist/types/components/ui/accordion.d.ts.map +1 -0
- package/dist/types/components/ui/alert-dialog.d.ts +15 -0
- package/dist/types/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/types/components/ui/alert.d.ts +10 -0
- package/dist/types/components/ui/alert.d.ts.map +1 -0
- package/dist/types/components/ui/aspect-ratio.d.ts +4 -0
- package/dist/types/components/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/types/components/ui/avatar.d.ts +7 -0
- package/dist/types/components/ui/avatar.d.ts.map +1 -0
- package/dist/types/components/ui/badge.d.ts +10 -0
- package/dist/types/components/ui/badge.d.ts.map +1 -0
- package/dist/types/components/ui/breadcrumb.d.ts +12 -0
- package/dist/types/components/ui/breadcrumb.d.ts.map +1 -0
- package/dist/types/components/ui/button.d.ts +11 -0
- package/dist/types/components/ui/button.d.ts.map +1 -0
- package/dist/types/components/ui/calendar.d.ts +9 -0
- package/dist/types/components/ui/calendar.d.ts.map +1 -0
- package/dist/types/components/ui/card.d.ts +10 -0
- package/dist/types/components/ui/card.d.ts.map +1 -0
- package/dist/types/components/ui/carousel.d.ts +20 -0
- package/dist/types/components/ui/carousel.d.ts.map +1 -0
- package/dist/types/components/ui/chart.d.ts +41 -0
- package/dist/types/components/ui/chart.d.ts.map +1 -0
- package/dist/types/components/ui/checkbox.d.ts +5 -0
- package/dist/types/components/ui/checkbox.d.ts.map +1 -0
- package/dist/types/components/ui/collapsible.d.ts +6 -0
- package/dist/types/components/ui/collapsible.d.ts.map +1 -0
- package/dist/types/components/ui/command.d.ts +19 -0
- package/dist/types/components/ui/command.d.ts.map +1 -0
- package/dist/types/components/ui/context-menu.d.ts +26 -0
- package/dist/types/components/ui/context-menu.d.ts.map +1 -0
- package/dist/types/components/ui/dialog.d.ts +16 -0
- package/dist/types/components/ui/dialog.d.ts.map +1 -0
- package/dist/types/components/ui/drawer.d.ts +14 -0
- package/dist/types/components/ui/drawer.d.ts.map +1 -0
- package/dist/types/components/ui/dropdown-menu.d.ts +26 -0
- package/dist/types/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/types/components/ui/form.d.ts +25 -0
- package/dist/types/components/ui/form.d.ts.map +1 -0
- package/dist/types/components/ui/hover-card.d.ts +7 -0
- package/dist/types/components/ui/hover-card.d.ts.map +1 -0
- package/dist/types/components/ui/input-otp.d.ts +12 -0
- package/dist/types/components/ui/input-otp.d.ts.map +1 -0
- package/dist/types/components/ui/input.d.ts +4 -0
- package/dist/types/components/ui/input.d.ts.map +1 -0
- package/dist/types/components/ui/label.d.ts +5 -0
- package/dist/types/components/ui/label.d.ts.map +1 -0
- package/dist/types/components/ui/menubar.d.ts +27 -0
- package/dist/types/components/ui/menubar.d.ts.map +1 -0
- package/dist/types/components/ui/navigation-menu.d.ts +15 -0
- package/dist/types/components/ui/navigation-menu.d.ts.map +1 -0
- package/dist/types/components/ui/pagination.d.ts +14 -0
- package/dist/types/components/ui/pagination.d.ts.map +1 -0
- package/dist/types/components/ui/popover.d.ts +8 -0
- package/dist/types/components/ui/popover.d.ts.map +1 -0
- package/dist/types/components/ui/progress.d.ts +5 -0
- package/dist/types/components/ui/progress.d.ts.map +1 -0
- package/dist/types/components/ui/radio-group.d.ts +6 -0
- package/dist/types/components/ui/radio-group.d.ts.map +1 -0
- package/dist/types/components/ui/resizable.d.ts +9 -0
- package/dist/types/components/ui/resizable.d.ts.map +1 -0
- package/dist/types/components/ui/scroll-area.d.ts +6 -0
- package/dist/types/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/types/components/ui/select.d.ts +16 -0
- package/dist/types/components/ui/select.d.ts.map +1 -0
- package/dist/types/components/ui/separator.d.ts +5 -0
- package/dist/types/components/ui/separator.d.ts.map +1 -0
- package/dist/types/components/ui/sheet.d.ts +14 -0
- package/dist/types/components/ui/sheet.d.ts.map +1 -0
- package/dist/types/components/ui/sidebar.d.ts +70 -0
- package/dist/types/components/ui/sidebar.d.ts.map +1 -0
- package/dist/types/components/ui/skeleton.d.ts +3 -0
- package/dist/types/components/ui/skeleton.d.ts.map +1 -0
- package/dist/types/components/ui/slider.d.ts +5 -0
- package/dist/types/components/ui/slider.d.ts.map +1 -0
- package/dist/types/components/ui/sonner.d.ts +4 -0
- package/dist/types/components/ui/sonner.d.ts.map +1 -0
- package/dist/types/components/ui/switch.d.ts +5 -0
- package/dist/types/components/ui/switch.d.ts.map +1 -0
- package/dist/types/components/ui/table.d.ts +11 -0
- package/dist/types/components/ui/table.d.ts.map +1 -0
- package/dist/types/components/ui/tabs.d.ts +8 -0
- package/dist/types/components/ui/tabs.d.ts.map +1 -0
- package/dist/types/components/ui/textarea.d.ts +4 -0
- package/dist/types/components/ui/textarea.d.ts.map +1 -0
- package/dist/types/components/ui/toggle-group.d.ts +10 -0
- package/dist/types/components/ui/toggle-group.d.ts.map +1 -0
- package/dist/types/components/ui/toggle.d.ts +10 -0
- package/dist/types/components/ui/toggle.d.ts.map +1 -0
- package/dist/types/components/ui/tooltip.d.ts +8 -0
- package/dist/types/components/ui/tooltip.d.ts.map +1 -0
- package/dist/types/components.d.ts +2 -0
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/hooks/index.d.ts.map +1 -0
- package/dist/types/hooks/use-mobile.d.ts +2 -0
- package/dist/types/hooks/use-mobile.d.ts.map +1 -0
- package/dist/types/hooks.d.ts +2 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/lib/utils.d.ts +3 -0
- package/dist/types/lib/utils.d.ts.map +1 -0
- package/package.json +138 -0
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const RechartsPrimitive = require("recharts");
|
|
6
|
+
const utils = require("./index.cjs50.js");
|
|
7
|
+
function _interopNamespaceDefault(e) {
|
|
8
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
9
|
+
if (e) {
|
|
10
|
+
for (const k in e) {
|
|
11
|
+
if (k !== "default") {
|
|
12
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
13
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: () => e[k]
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
n.default = e;
|
|
21
|
+
return Object.freeze(n);
|
|
22
|
+
}
|
|
23
|
+
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
24
|
+
const RechartsPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(RechartsPrimitive);
|
|
25
|
+
const THEMES = { light: "", dark: ".dark" };
|
|
26
|
+
const ChartContext = React__namespace.createContext(null);
|
|
27
|
+
function useChart() {
|
|
28
|
+
const context = React__namespace.useContext(ChartContext);
|
|
29
|
+
if (!context) {
|
|
30
|
+
throw new Error("useChart must be used within a <ChartContainer />");
|
|
31
|
+
}
|
|
32
|
+
return context;
|
|
33
|
+
}
|
|
34
|
+
function ChartContainer({
|
|
35
|
+
id,
|
|
36
|
+
className,
|
|
37
|
+
children,
|
|
38
|
+
config,
|
|
39
|
+
...props
|
|
40
|
+
}) {
|
|
41
|
+
const uniqueId = React__namespace.useId();
|
|
42
|
+
const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
|
|
43
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ChartContext.Provider, { value: { config }, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
"data-slot": "chart",
|
|
47
|
+
"data-chart": chartId,
|
|
48
|
+
className: utils.cn(
|
|
49
|
+
"[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",
|
|
50
|
+
className
|
|
51
|
+
),
|
|
52
|
+
...props,
|
|
53
|
+
children: [
|
|
54
|
+
/* @__PURE__ */ jsxRuntime.jsx(ChartStyle, { id: chartId, config }),
|
|
55
|
+
/* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive__namespace.ResponsiveContainer, { children })
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
) });
|
|
59
|
+
}
|
|
60
|
+
const ChartStyle = ({ id, config }) => {
|
|
61
|
+
const colorConfig = Object.entries(config).filter(
|
|
62
|
+
([, config2]) => config2.theme || config2.color
|
|
63
|
+
);
|
|
64
|
+
if (!colorConfig.length) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
68
|
+
"style",
|
|
69
|
+
{
|
|
70
|
+
dangerouslySetInnerHTML: {
|
|
71
|
+
__html: Object.entries(THEMES).map(
|
|
72
|
+
([theme, prefix]) => `
|
|
73
|
+
${prefix} [data-chart=${id}] {
|
|
74
|
+
${colorConfig.map(([key, itemConfig]) => {
|
|
75
|
+
const color = itemConfig.theme?.[theme] || itemConfig.color;
|
|
76
|
+
return color ? ` --color-${key}: ${color};` : null;
|
|
77
|
+
}).join("\n")}
|
|
78
|
+
}
|
|
79
|
+
`
|
|
80
|
+
).join("\n")
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
};
|
|
85
|
+
const ChartTooltip = RechartsPrimitive__namespace.Tooltip;
|
|
86
|
+
function ChartTooltipContent({
|
|
87
|
+
active,
|
|
88
|
+
payload,
|
|
89
|
+
className,
|
|
90
|
+
indicator = "dot",
|
|
91
|
+
hideLabel = false,
|
|
92
|
+
hideIndicator = false,
|
|
93
|
+
label,
|
|
94
|
+
labelFormatter,
|
|
95
|
+
labelClassName,
|
|
96
|
+
formatter,
|
|
97
|
+
color,
|
|
98
|
+
nameKey,
|
|
99
|
+
labelKey
|
|
100
|
+
}) {
|
|
101
|
+
const { config } = useChart();
|
|
102
|
+
const tooltipLabel = React__namespace.useMemo(() => {
|
|
103
|
+
if (hideLabel || !payload?.length) {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
const [item] = payload;
|
|
107
|
+
const key = `${labelKey || item?.dataKey || item?.name || "value"}`;
|
|
108
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
109
|
+
const value = !labelKey && typeof label === "string" ? config[label]?.label || label : itemConfig?.label;
|
|
110
|
+
if (labelFormatter) {
|
|
111
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: utils.cn("font-medium", labelClassName), children: labelFormatter(value, payload) });
|
|
112
|
+
}
|
|
113
|
+
if (!value) {
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: utils.cn("font-medium", labelClassName), children: value });
|
|
117
|
+
}, [
|
|
118
|
+
label,
|
|
119
|
+
labelFormatter,
|
|
120
|
+
payload,
|
|
121
|
+
hideLabel,
|
|
122
|
+
labelClassName,
|
|
123
|
+
config,
|
|
124
|
+
labelKey
|
|
125
|
+
]);
|
|
126
|
+
if (!active || !payload?.length) {
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
const nestLabel = payload.length === 1 && indicator !== "dot";
|
|
130
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
131
|
+
"div",
|
|
132
|
+
{
|
|
133
|
+
className: utils.cn(
|
|
134
|
+
"border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl",
|
|
135
|
+
className
|
|
136
|
+
),
|
|
137
|
+
children: [
|
|
138
|
+
!nestLabel ? tooltipLabel : null,
|
|
139
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-1.5", children: payload.filter((item) => item.type !== "none").map((item, index) => {
|
|
140
|
+
const key = `${nameKey || item.name || item.dataKey || "value"}`;
|
|
141
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
142
|
+
const indicatorColor = color || item.payload.fill || item.color;
|
|
143
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
144
|
+
"div",
|
|
145
|
+
{
|
|
146
|
+
className: utils.cn(
|
|
147
|
+
"[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",
|
|
148
|
+
indicator === "dot" && "items-center"
|
|
149
|
+
),
|
|
150
|
+
children: formatter && item?.value !== void 0 && item.name ? formatter(item.value, item.name, item, index, item.payload) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
151
|
+
itemConfig?.icon ? /* @__PURE__ */ jsxRuntime.jsx(itemConfig.icon, {}) : !hideIndicator && /* @__PURE__ */ jsxRuntime.jsx(
|
|
152
|
+
"div",
|
|
153
|
+
{
|
|
154
|
+
className: utils.cn(
|
|
155
|
+
"shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",
|
|
156
|
+
{
|
|
157
|
+
"h-2.5 w-2.5": indicator === "dot",
|
|
158
|
+
"w-1": indicator === "line",
|
|
159
|
+
"w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
|
|
160
|
+
"my-0.5": nestLabel && indicator === "dashed"
|
|
161
|
+
}
|
|
162
|
+
),
|
|
163
|
+
style: {
|
|
164
|
+
"--color-bg": indicatorColor,
|
|
165
|
+
"--color-border": indicatorColor
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
),
|
|
169
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
170
|
+
"div",
|
|
171
|
+
{
|
|
172
|
+
className: utils.cn(
|
|
173
|
+
"flex flex-1 justify-between leading-none",
|
|
174
|
+
nestLabel ? "items-end" : "items-center"
|
|
175
|
+
),
|
|
176
|
+
children: [
|
|
177
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-1.5", children: [
|
|
178
|
+
nestLabel ? tooltipLabel : null,
|
|
179
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: itemConfig?.label || item.name })
|
|
180
|
+
] }),
|
|
181
|
+
item.value && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground font-mono font-medium tabular-nums", children: item.value.toLocaleString() })
|
|
182
|
+
]
|
|
183
|
+
}
|
|
184
|
+
)
|
|
185
|
+
] })
|
|
186
|
+
},
|
|
187
|
+
item.dataKey
|
|
188
|
+
);
|
|
189
|
+
}) })
|
|
190
|
+
]
|
|
191
|
+
}
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
const ChartLegend = RechartsPrimitive__namespace.Legend;
|
|
195
|
+
function ChartLegendContent({
|
|
196
|
+
className,
|
|
197
|
+
hideIcon = false,
|
|
198
|
+
payload,
|
|
199
|
+
verticalAlign = "bottom",
|
|
200
|
+
nameKey
|
|
201
|
+
}) {
|
|
202
|
+
const { config } = useChart();
|
|
203
|
+
if (!payload?.length) {
|
|
204
|
+
return null;
|
|
205
|
+
}
|
|
206
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
207
|
+
"div",
|
|
208
|
+
{
|
|
209
|
+
className: utils.cn(
|
|
210
|
+
"flex items-center justify-center gap-4",
|
|
211
|
+
verticalAlign === "top" ? "pb-3" : "pt-3",
|
|
212
|
+
className
|
|
213
|
+
),
|
|
214
|
+
children: payload.filter((item) => item.type !== "none").map((item) => {
|
|
215
|
+
const key = `${nameKey || item.dataKey || "value"}`;
|
|
216
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
217
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
218
|
+
"div",
|
|
219
|
+
{
|
|
220
|
+
className: utils.cn(
|
|
221
|
+
"[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"
|
|
222
|
+
),
|
|
223
|
+
children: [
|
|
224
|
+
itemConfig?.icon && !hideIcon ? /* @__PURE__ */ jsxRuntime.jsx(itemConfig.icon, {}) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
225
|
+
"div",
|
|
226
|
+
{
|
|
227
|
+
className: "h-2 w-2 shrink-0 rounded-[2px]",
|
|
228
|
+
style: {
|
|
229
|
+
backgroundColor: item.color
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
),
|
|
233
|
+
itemConfig?.label
|
|
234
|
+
]
|
|
235
|
+
},
|
|
236
|
+
item.value
|
|
237
|
+
);
|
|
238
|
+
})
|
|
239
|
+
}
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
function getPayloadConfigFromPayload(config, payload, key) {
|
|
243
|
+
if (typeof payload !== "object" || payload === null) {
|
|
244
|
+
return void 0;
|
|
245
|
+
}
|
|
246
|
+
const payloadPayload = "payload" in payload && typeof payload.payload === "object" && payload.payload !== null ? payload.payload : void 0;
|
|
247
|
+
let configLabelKey = key;
|
|
248
|
+
if (key in payload && typeof payload[key] === "string") {
|
|
249
|
+
configLabelKey = payload[key];
|
|
250
|
+
} else if (payloadPayload && key in payloadPayload && typeof payloadPayload[key] === "string") {
|
|
251
|
+
configLabelKey = payloadPayload[key];
|
|
252
|
+
}
|
|
253
|
+
return configLabelKey in config ? config[configLabelKey] : config[key];
|
|
254
|
+
}
|
|
255
|
+
exports.ChartContainer = ChartContainer;
|
|
256
|
+
exports.ChartLegend = ChartLegend;
|
|
257
|
+
exports.ChartLegendContent = ChartLegendContent;
|
|
258
|
+
exports.ChartStyle = ChartStyle;
|
|
259
|
+
exports.ChartTooltip = ChartTooltip;
|
|
260
|
+
exports.ChartTooltipContent = ChartTooltipContent;
|
|
261
|
+
//# sourceMappingURL=index.cjs15.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs15.js","sources":["../lib/components/ui/chart.tsx"],"sourcesContent":["import * as React from \"react\";\nimport * as RechartsPrimitive from \"recharts\";\n\nimport { cn } from \"@/lib/utils\";\n\n// Format: { THEME_NAME: CSS_SELECTOR }\nconst THEMES = { light: \"\", dark: \".dark\" } as const;\n\nexport type ChartConfig = {\n [k in string]: {\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 ...props\n}: React.ComponentProps<\"div\"> & {\n config: ChartConfig;\n children: React.ComponentProps<\n typeof RechartsPrimitive.ResponsiveContainer\n >[\"children\"];\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-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden\",\n className\n )}\n {...props}\n >\n <ChartStyle id={chartId} config={config} />\n <RechartsPrimitive.ResponsiveContainer>\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 }) {\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 as keyof typeof config]?.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-[8rem] 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={item.dataKey}\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 \"shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)\",\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 && (\n <span className=\"text-foreground font-mono font-medium tabular-nums\">\n {item.value.toLocaleString()}\n </span>\n )}\n </div>\n </>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n\nconst ChartLegend = RechartsPrimitive.Legend;\n\nfunction ChartLegendContent({\n className,\n hideIcon = false,\n payload,\n verticalAlign = \"bottom\",\n nameKey,\n}: React.ComponentProps<\"div\"> &\n Pick<RechartsPrimitive.LegendProps, \"payload\" | \"verticalAlign\"> & {\n hideIcon?: boolean;\n nameKey?: string;\n }) {\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) => {\n const key = `${nameKey || item.dataKey || \"value\"}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n\n return (\n <div\n key={item.value}\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\n// Helper to extract item config from a payload.\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\n ? config[configLabelKey]\n : config[key as keyof typeof config];\n}\n\nexport {\n ChartContainer,\n ChartTooltip,\n ChartTooltipContent,\n ChartLegend,\n ChartLegendContent,\n ChartStyle,\n};\n"],"names":["React","jsxs","cn","jsx","RechartsPrimitive","config","Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM,SAAS,EAAE,OAAO,IAAI,MAAM,QAAA;AAgBlC,MAAM,eAAeA,iBAAM,cAAwC,IAAI;AAEvE,SAAS,WAAW;AAClB,QAAM,UAAUA,iBAAM,WAAW,YAAY;AAE7C,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,mDAAmD;AAAA,EACrE;AAEA,SAAO;AACT;AAEA,SAAS,eAAe;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAKG;AACD,QAAM,WAAWA,iBAAM,MAAA;AACvB,QAAM,UAAU,SAAS,MAAM,SAAS,QAAQ,MAAM,EAAE,CAAC;AAEzD,wCACG,aAAa,UAAb,EAAsB,OAAO,EAAE,UAC9B,UAAAC,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,cAAY;AAAA,MACZ,WAAWC,MAAAA;AAAAA,QACT;AAAA,QACA;AAAA,MAAA;AAAA,MAED,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAAC,2BAAAA,IAAC,YAAA,EAAW,IAAI,SAAS,OAAA,CAAgB;AAAA,QACzCA,2BAAAA,IAACC,6BAAkB,qBAAlB,EACE,SAAA,CACH;AAAA,M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ACrB,OAAO,GAA0B;AACvC;;;;;;;"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
require("react");
|
|
5
|
+
const CheckboxPrimitive = require("@radix-ui/react-checkbox");
|
|
6
|
+
const lucideReact = require("lucide-react");
|
|
7
|
+
const utils = require("./index.cjs50.js");
|
|
8
|
+
function _interopNamespaceDefault(e) {
|
|
9
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
10
|
+
if (e) {
|
|
11
|
+
for (const k in e) {
|
|
12
|
+
if (k !== "default") {
|
|
13
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: () => e[k]
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
n.default = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
const CheckboxPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(CheckboxPrimitive);
|
|
25
|
+
function Checkbox({
|
|
26
|
+
className,
|
|
27
|
+
...props
|
|
28
|
+
}) {
|
|
29
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
30
|
+
CheckboxPrimitive__namespace.Root,
|
|
31
|
+
{
|
|
32
|
+
"data-slot": "checkbox",
|
|
33
|
+
className: utils.cn(
|
|
34
|
+
"peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
35
|
+
className
|
|
36
|
+
),
|
|
37
|
+
...props,
|
|
38
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
39
|
+
CheckboxPrimitive__namespace.Indicator,
|
|
40
|
+
{
|
|
41
|
+
"data-slot": "checkbox-indicator",
|
|
42
|
+
className: "grid place-content-center text-current transition-none",
|
|
43
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckIcon, { className: "size-3.5" })
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
exports.Checkbox = Checkbox;
|
|
50
|
+
//# sourceMappingURL=index.cjs16.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs16.js","sources":["../lib/components/ui/checkbox.tsx"],"sourcesContent":["import * as React from \"react\";\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport { CheckIcon } from \"lucide-react\";\n\nimport { cn } from \"@/lib/utils\";\n\nfunction Checkbox({\n className,\n ...props\n}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n \"peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none\"\n >\n <CheckIcon className=\"size-3.5\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n\nexport { Checkbox };\n"],"names":["jsx","CheckboxPrimitive","cn","CheckIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAMA,SAAS,SAAS;AAAA,EAChB;AAAA,EACA,GAAG;AACL,GAAwD;AACtD,SACEA,2BAAAA;AAAAA,IAACC,6BAAkB;AAAA,IAAlB;AAAA,MACC,aAAU;AAAA,MACV,WAAWC,MAAAA;AAAAA,QACT;AAAA,QACA;AAAA,MAAA;AAAA,MAED,GAAG;AAAA,MAEJ,UAAAF,2BAAAA;AAAAA,QAACC,6BAAkB;AAAA,QAAlB;AAAA,UACC,aAAU;AAAA,UACV,WAAU;AAAA,UAEV,UAAAD,2BAAAA,IAACG,YAAAA,WAAA,EAAU,WAAU,WAAA,CAAW;AAAA,QAAA;AAAA,MAAA;AAAA,IAClC;AAAA,EAAA;AAGN;;"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
+
const CollapsiblePrimitive = require("@radix-ui/react-collapsible");
|
|
6
|
+
function _interopNamespaceDefault(e) {
|
|
7
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
8
|
+
if (e) {
|
|
9
|
+
for (const k in e) {
|
|
10
|
+
if (k !== "default") {
|
|
11
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: () => e[k]
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
n.default = e;
|
|
20
|
+
return Object.freeze(n);
|
|
21
|
+
}
|
|
22
|
+
const CollapsiblePrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(CollapsiblePrimitive);
|
|
23
|
+
function Collapsible({
|
|
24
|
+
...props
|
|
25
|
+
}) {
|
|
26
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CollapsiblePrimitive__namespace.Root, { "data-slot": "collapsible", ...props });
|
|
27
|
+
}
|
|
28
|
+
function CollapsibleTrigger({
|
|
29
|
+
...props
|
|
30
|
+
}) {
|
|
31
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
32
|
+
CollapsiblePrimitive__namespace.CollapsibleTrigger,
|
|
33
|
+
{
|
|
34
|
+
"data-slot": "collapsible-trigger",
|
|
35
|
+
...props
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
function CollapsibleContent({
|
|
40
|
+
...props
|
|
41
|
+
}) {
|
|
42
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
43
|
+
CollapsiblePrimitive__namespace.CollapsibleContent,
|
|
44
|
+
{
|
|
45
|
+
"data-slot": "collapsible-content",
|
|
46
|
+
...props
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
exports.Collapsible = Collapsible;
|
|
51
|
+
exports.CollapsibleContent = CollapsibleContent;
|
|
52
|
+
exports.CollapsibleTrigger = CollapsibleTrigger;
|
|
53
|
+
//# sourceMappingURL=index.cjs17.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs17.js","sources":["../lib/components/ui/collapsible.tsx"],"sourcesContent":["\"use client\";\n\nimport * as CollapsiblePrimitive from \"@radix-ui/react-collapsible\";\n\nfunction Collapsible({\n ...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {\n return <CollapsiblePrimitive.Root data-slot=\"collapsible\" {...props} />;\n}\n\nfunction CollapsibleTrigger({\n ...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {\n return (\n <CollapsiblePrimitive.CollapsibleTrigger\n data-slot=\"collapsible-trigger\"\n {...props}\n />\n );\n}\n\nfunction CollapsibleContent({\n ...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {\n return (\n <CollapsiblePrimitive.CollapsibleContent\n data-slot=\"collapsible-content\"\n {...props}\n />\n );\n}\n\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent };\n"],"names":["CollapsiblePrimitive","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAIA,SAAS,YAAY;AAAA,EACnB,GAAG;AACL,GAA2D;AACzD,wCAAQA,gCAAqB,MAArB,EAA0B,aAAU,eAAe,GAAG,OAAO;AACvE;AAEA,SAAS,mBAAmB;AAAA,EAC1B,GAAG;AACL,GAAyE;AACvE,SACEC,2BAAAA;AAAAA,IAACD,gCAAqB;AAAA,IAArB;AAAA,MACC,aAAU;AAAA,MACT,GAAG;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAAS,mBAAmB;AAAA,EAC1B,GAAG;AACL,GAAyE;AACvE,SACEC,2BAAAA;AAAAA,IAACD,gCAAqB;AAAA,IAArB;AAAA,MACC,aAAU;AAAA,MACT,GAAG;AAAA,IAAA;AAAA,EAAA;AAGV;;;;"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
+
require("react");
|
|
6
|
+
const cmdk = require("cmdk");
|
|
7
|
+
const lucideReact = require("lucide-react");
|
|
8
|
+
const utils = require("./index.cjs50.js");
|
|
9
|
+
const dialog = require("./index.cjs20.js");
|
|
10
|
+
function Command({
|
|
11
|
+
className,
|
|
12
|
+
...props
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15
|
+
cmdk.Command,
|
|
16
|
+
{
|
|
17
|
+
"data-slot": "command",
|
|
18
|
+
className: utils.cn(
|
|
19
|
+
"bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",
|
|
20
|
+
className
|
|
21
|
+
),
|
|
22
|
+
...props
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
function CommandDialog({
|
|
27
|
+
title = "Command Palette",
|
|
28
|
+
description = "Search for a command to run...",
|
|
29
|
+
children,
|
|
30
|
+
className,
|
|
31
|
+
showCloseButton = true,
|
|
32
|
+
...props
|
|
33
|
+
}) {
|
|
34
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(dialog.Dialog, { ...props, children: [
|
|
35
|
+
/* @__PURE__ */ jsxRuntime.jsxs(dialog.DialogHeader, { className: "sr-only", children: [
|
|
36
|
+
/* @__PURE__ */ jsxRuntime.jsx(dialog.DialogTitle, { children: title }),
|
|
37
|
+
/* @__PURE__ */ jsxRuntime.jsx(dialog.DialogDescription, { children: description })
|
|
38
|
+
] }),
|
|
39
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
40
|
+
dialog.DialogContent,
|
|
41
|
+
{
|
|
42
|
+
className: utils.cn("overflow-hidden p-0", className),
|
|
43
|
+
showCloseButton,
|
|
44
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Command, { className: "[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children })
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
] });
|
|
48
|
+
}
|
|
49
|
+
function CommandInput({
|
|
50
|
+
className,
|
|
51
|
+
...props
|
|
52
|
+
}) {
|
|
53
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
"data-slot": "command-input-wrapper",
|
|
57
|
+
className: "flex h-9 items-center gap-2 border-b px-3",
|
|
58
|
+
children: [
|
|
59
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.SearchIcon, { className: "size-4 shrink-0 opacity-50" }),
|
|
60
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
61
|
+
cmdk.Command.Input,
|
|
62
|
+
{
|
|
63
|
+
"data-slot": "command-input",
|
|
64
|
+
className: utils.cn(
|
|
65
|
+
"placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
|
|
66
|
+
className
|
|
67
|
+
),
|
|
68
|
+
...props
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
function CommandList({
|
|
76
|
+
className,
|
|
77
|
+
...props
|
|
78
|
+
}) {
|
|
79
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
80
|
+
cmdk.Command.List,
|
|
81
|
+
{
|
|
82
|
+
"data-slot": "command-list",
|
|
83
|
+
className: utils.cn(
|
|
84
|
+
"max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",
|
|
85
|
+
className
|
|
86
|
+
),
|
|
87
|
+
...props
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
function CommandEmpty({
|
|
92
|
+
...props
|
|
93
|
+
}) {
|
|
94
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
95
|
+
cmdk.Command.Empty,
|
|
96
|
+
{
|
|
97
|
+
"data-slot": "command-empty",
|
|
98
|
+
className: "py-6 text-center text-sm",
|
|
99
|
+
...props
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
function CommandGroup({
|
|
104
|
+
className,
|
|
105
|
+
...props
|
|
106
|
+
}) {
|
|
107
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
108
|
+
cmdk.Command.Group,
|
|
109
|
+
{
|
|
110
|
+
"data-slot": "command-group",
|
|
111
|
+
className: utils.cn(
|
|
112
|
+
"text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",
|
|
113
|
+
className
|
|
114
|
+
),
|
|
115
|
+
...props
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
function CommandSeparator({
|
|
120
|
+
className,
|
|
121
|
+
...props
|
|
122
|
+
}) {
|
|
123
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
124
|
+
cmdk.Command.Separator,
|
|
125
|
+
{
|
|
126
|
+
"data-slot": "command-separator",
|
|
127
|
+
className: utils.cn("bg-border -mx-1 h-px", className),
|
|
128
|
+
...props
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
function CommandItem({
|
|
133
|
+
className,
|
|
134
|
+
...props
|
|
135
|
+
}) {
|
|
136
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
137
|
+
cmdk.Command.Item,
|
|
138
|
+
{
|
|
139
|
+
"data-slot": "command-item",
|
|
140
|
+
className: utils.cn(
|
|
141
|
+
"data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
142
|
+
className
|
|
143
|
+
),
|
|
144
|
+
...props
|
|
145
|
+
}
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
function CommandShortcut({
|
|
149
|
+
className,
|
|
150
|
+
...props
|
|
151
|
+
}) {
|
|
152
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
153
|
+
"span",
|
|
154
|
+
{
|
|
155
|
+
"data-slot": "command-shortcut",
|
|
156
|
+
className: utils.cn(
|
|
157
|
+
"text-muted-foreground ml-auto text-xs tracking-widest",
|
|
158
|
+
className
|
|
159
|
+
),
|
|
160
|
+
...props
|
|
161
|
+
}
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
exports.Command = Command;
|
|
165
|
+
exports.CommandDialog = CommandDialog;
|
|
166
|
+
exports.CommandEmpty = CommandEmpty;
|
|
167
|
+
exports.CommandGroup = CommandGroup;
|
|
168
|
+
exports.CommandInput = CommandInput;
|
|
169
|
+
exports.CommandItem = CommandItem;
|
|
170
|
+
exports.CommandList = CommandList;
|
|
171
|
+
exports.CommandSeparator = CommandSeparator;
|
|
172
|
+
exports.CommandShortcut = CommandShortcut;
|
|
173
|
+
//# sourceMappingURL=index.cjs18.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs18.js","sources":["../lib/components/ui/command.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport { SearchIcon } from \"lucide-react\";\n\nimport { cn } from \"@/lib/utils\";\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from \"./dialog\";\n\nfunction Command({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive>) {\n return (\n <CommandPrimitive\n data-slot=\"command\"\n className={cn(\n \"bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction CommandDialog({\n title = \"Command Palette\",\n description = \"Search for a command to run...\",\n children,\n className,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof Dialog> & {\n title?: string;\n description?: string;\n className?: string;\n showCloseButton?: boolean;\n}) {\n return (\n <Dialog {...props}>\n <DialogHeader className=\"sr-only\">\n <DialogTitle>{title}</DialogTitle>\n <DialogDescription>{description}</DialogDescription>\n </DialogHeader>\n <DialogContent\n className={cn(\"overflow-hidden p-0\", className)}\n showCloseButton={showCloseButton}\n >\n <Command className=\"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n}\n\nfunction CommandInput({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Input>) {\n return (\n <div\n data-slot=\"command-input-wrapper\"\n className=\"flex h-9 items-center gap-2 border-b px-3\"\n >\n <SearchIcon className=\"size-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n data-slot=\"command-input\"\n className={cn(\n \"placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n />\n </div>\n );\n}\n\nfunction CommandList({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.List>) {\n return (\n <CommandPrimitive.List\n data-slot=\"command-list\"\n className={cn(\n \"max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction CommandEmpty({\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Empty>) {\n return (\n <CommandPrimitive.Empty\n data-slot=\"command-empty\"\n className=\"py-6 text-center text-sm\"\n {...props}\n />\n );\n}\n\nfunction CommandGroup({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Group>) {\n return (\n <CommandPrimitive.Group\n data-slot=\"command-group\"\n className={cn(\n \"text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction CommandSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Separator>) {\n return (\n <CommandPrimitive.Separator\n data-slot=\"command-separator\"\n className={cn(\"bg-border -mx-1 h-px\", className)}\n {...props}\n />\n );\n}\n\nfunction CommandItem({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Item>) {\n return (\n <CommandPrimitive.Item\n data-slot=\"command-item\"\n className={cn(\n \"data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction CommandShortcut({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"command-shortcut\"\n className={cn(\n \"text-muted-foreground ml-auto text-xs tracking-widest\",\n className\n )}\n {...props}\n />\n );\n}\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n};\n"],"names":["jsx","CommandPrimitive","cn","jsxs","Dialog","DialogHeader","DialogTitle","DialogDescription","DialogContent","SearchIcon"],"mappings":";;;;;;;;;AAeA,SAAS,QAAQ;AAAA,EACf;AAAA,EACA,GAAG;AACL,GAAkD;AAChD,SACEA,2BAAAA;AAAAA,IAACC,KAAAA;AAAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWC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