@cupcodev/ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +99 -0
- package/dist/charts-KwYmX5He.d.cts +97 -0
- package/dist/charts-KwYmX5He.d.ts +97 -0
- package/dist/charts.cjs +500 -0
- package/dist/charts.cjs.map +1 -0
- package/dist/charts.d.cts +11 -0
- package/dist/charts.d.ts +11 -0
- package/dist/charts.js +454 -0
- package/dist/charts.js.map +1 -0
- package/dist/index.cjs +6568 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1019 -0
- package/dist/index.d.ts +1019 -0
- package/dist/index.js +6207 -0
- package/dist/index.js.map +1 -0
- package/package.json +162 -0
- package/styles/dock.css +801 -0
- package/styles/global.css +1193 -0
- package/styles/tokens.css +305 -0
- package/tailwind-preset.cjs +192 -0
package/dist/charts.cjs
ADDED
|
@@ -0,0 +1,500 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/charts.ts
|
|
30
|
+
var charts_exports = {};
|
|
31
|
+
__export(charts_exports, {
|
|
32
|
+
Carousel: () => Carousel,
|
|
33
|
+
CarouselContent: () => CarouselContent,
|
|
34
|
+
CarouselItem: () => CarouselItem,
|
|
35
|
+
CarouselNext: () => CarouselNext,
|
|
36
|
+
CarouselPrevious: () => CarouselPrevious,
|
|
37
|
+
ChartContainer: () => ChartContainer,
|
|
38
|
+
ChartLegend: () => ChartLegend,
|
|
39
|
+
ChartLegendContent: () => ChartLegendContent,
|
|
40
|
+
ChartStyle: () => ChartStyle,
|
|
41
|
+
ChartTooltip: () => ChartTooltip,
|
|
42
|
+
ChartTooltipContent: () => ChartTooltipContent
|
|
43
|
+
});
|
|
44
|
+
module.exports = __toCommonJS(charts_exports);
|
|
45
|
+
|
|
46
|
+
// src/components/ui/chart.tsx
|
|
47
|
+
var React = __toESM(require("react"), 1);
|
|
48
|
+
var RechartsPrimitive = __toESM(require("recharts"), 1);
|
|
49
|
+
|
|
50
|
+
// src/lib/utils.ts
|
|
51
|
+
var import_clsx = require("clsx");
|
|
52
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
53
|
+
function cn(...inputs) {
|
|
54
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// src/components/ui/chart.tsx
|
|
58
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
59
|
+
var THEMES = { light: "", dark: ".dark" };
|
|
60
|
+
var ChartContext = React.createContext(null);
|
|
61
|
+
function useChart() {
|
|
62
|
+
const context = React.useContext(ChartContext);
|
|
63
|
+
if (!context) {
|
|
64
|
+
throw new Error("useChart must be used within a <ChartContainer />");
|
|
65
|
+
}
|
|
66
|
+
return context;
|
|
67
|
+
}
|
|
68
|
+
var ChartContainer = React.forwardRef(({ id, className, children, config, ...props }, ref) => {
|
|
69
|
+
const uniqueId = React.useId();
|
|
70
|
+
const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
|
|
71
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChartContext.Provider, { value: { config }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
72
|
+
"div",
|
|
73
|
+
{
|
|
74
|
+
"data-chart": chartId,
|
|
75
|
+
ref,
|
|
76
|
+
className: cn(
|
|
77
|
+
"flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",
|
|
78
|
+
className
|
|
79
|
+
),
|
|
80
|
+
...props,
|
|
81
|
+
children: [
|
|
82
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChartStyle, { id: chartId, config }),
|
|
83
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(RechartsPrimitive.ResponsiveContainer, { children })
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
) });
|
|
87
|
+
});
|
|
88
|
+
ChartContainer.displayName = "Chart";
|
|
89
|
+
var ChartStyle = ({ id, config }) => {
|
|
90
|
+
const colorConfig = Object.entries(config).filter(([_, config2]) => config2.theme || config2.color);
|
|
91
|
+
if (!colorConfig.length) {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
95
|
+
"style",
|
|
96
|
+
{
|
|
97
|
+
dangerouslySetInnerHTML: {
|
|
98
|
+
__html: Object.entries(THEMES).map(
|
|
99
|
+
([theme, prefix]) => `
|
|
100
|
+
${prefix} [data-chart=${id}] {
|
|
101
|
+
${colorConfig.map(([key, itemConfig]) => {
|
|
102
|
+
var _a;
|
|
103
|
+
const color = ((_a = itemConfig.theme) == null ? void 0 : _a[theme]) || itemConfig.color;
|
|
104
|
+
return color ? ` --color-${key}: ${color};` : null;
|
|
105
|
+
}).join("\n")}
|
|
106
|
+
}
|
|
107
|
+
`
|
|
108
|
+
).join("\n")
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
};
|
|
113
|
+
var ChartTooltip = RechartsPrimitive.Tooltip;
|
|
114
|
+
var ChartTooltipContent = React.forwardRef(
|
|
115
|
+
({
|
|
116
|
+
active,
|
|
117
|
+
payload,
|
|
118
|
+
className,
|
|
119
|
+
indicator = "dot",
|
|
120
|
+
hideLabel = false,
|
|
121
|
+
hideIndicator = false,
|
|
122
|
+
label,
|
|
123
|
+
labelFormatter,
|
|
124
|
+
labelClassName,
|
|
125
|
+
formatter,
|
|
126
|
+
color,
|
|
127
|
+
nameKey,
|
|
128
|
+
labelKey
|
|
129
|
+
}, ref) => {
|
|
130
|
+
const { config } = useChart();
|
|
131
|
+
const tooltipLabel = React.useMemo(() => {
|
|
132
|
+
var _a;
|
|
133
|
+
if (hideLabel || !(payload == null ? void 0 : payload.length)) {
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
const [item] = payload;
|
|
137
|
+
const key = `${labelKey || item.dataKey || item.name || "value"}`;
|
|
138
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
139
|
+
const value = !labelKey && typeof label === "string" ? ((_a = config[label]) == null ? void 0 : _a.label) || label : itemConfig == null ? void 0 : itemConfig.label;
|
|
140
|
+
if (labelFormatter) {
|
|
141
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: cn("font-medium", labelClassName), children: labelFormatter(value, payload) });
|
|
142
|
+
}
|
|
143
|
+
if (!value) {
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: cn("font-medium", labelClassName), children: value });
|
|
147
|
+
}, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);
|
|
148
|
+
if (!active || !(payload == null ? void 0 : payload.length)) {
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
const nestLabel = payload.length === 1 && indicator !== "dot";
|
|
152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
153
|
+
"div",
|
|
154
|
+
{
|
|
155
|
+
ref,
|
|
156
|
+
className: cn(
|
|
157
|
+
"grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",
|
|
158
|
+
className
|
|
159
|
+
),
|
|
160
|
+
children: [
|
|
161
|
+
!nestLabel ? tooltipLabel : null,
|
|
162
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid gap-1.5", children: payload.map((item, index) => {
|
|
163
|
+
const key = `${nameKey || item.name || item.dataKey || "value"}`;
|
|
164
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
165
|
+
const indicatorColor = color || item.payload.fill || item.color;
|
|
166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
167
|
+
"div",
|
|
168
|
+
{
|
|
169
|
+
className: cn(
|
|
170
|
+
"flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",
|
|
171
|
+
indicator === "dot" && "items-center"
|
|
172
|
+
),
|
|
173
|
+
children: formatter && (item == null ? void 0 : item.value) !== void 0 && item.name ? formatter(item.value, item.name, item, index, item.payload) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
174
|
+
(itemConfig == null ? void 0 : itemConfig.icon) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(itemConfig.icon, {}) : !hideIndicator && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
175
|
+
"div",
|
|
176
|
+
{
|
|
177
|
+
className: cn("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]", {
|
|
178
|
+
"h-2.5 w-2.5": indicator === "dot",
|
|
179
|
+
"w-1": indicator === "line",
|
|
180
|
+
"w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
|
|
181
|
+
"my-0.5": nestLabel && indicator === "dashed"
|
|
182
|
+
}),
|
|
183
|
+
style: {
|
|
184
|
+
"--color-bg": indicatorColor,
|
|
185
|
+
"--color-border": indicatorColor
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
),
|
|
189
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
190
|
+
"div",
|
|
191
|
+
{
|
|
192
|
+
className: cn(
|
|
193
|
+
"flex flex-1 justify-between leading-none",
|
|
194
|
+
nestLabel ? "items-end" : "items-center"
|
|
195
|
+
),
|
|
196
|
+
children: [
|
|
197
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid gap-1.5", children: [
|
|
198
|
+
nestLabel ? tooltipLabel : null,
|
|
199
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-muted-foreground", children: (itemConfig == null ? void 0 : itemConfig.label) || item.name })
|
|
200
|
+
] }),
|
|
201
|
+
item.value && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "font-mono font-medium tabular-nums text-foreground", children: item.value.toLocaleString() })
|
|
202
|
+
]
|
|
203
|
+
}
|
|
204
|
+
)
|
|
205
|
+
] })
|
|
206
|
+
},
|
|
207
|
+
item.dataKey
|
|
208
|
+
);
|
|
209
|
+
}) })
|
|
210
|
+
]
|
|
211
|
+
}
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
);
|
|
215
|
+
ChartTooltipContent.displayName = "ChartTooltip";
|
|
216
|
+
var ChartLegend = RechartsPrimitive.Legend;
|
|
217
|
+
var ChartLegendContent = React.forwardRef(({ className, hideIcon = false, payload, verticalAlign = "bottom", nameKey }, ref) => {
|
|
218
|
+
const { config } = useChart();
|
|
219
|
+
if (!(payload == null ? void 0 : payload.length)) {
|
|
220
|
+
return null;
|
|
221
|
+
}
|
|
222
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
223
|
+
"div",
|
|
224
|
+
{
|
|
225
|
+
ref,
|
|
226
|
+
className: cn("flex items-center justify-center gap-4", verticalAlign === "top" ? "pb-3" : "pt-3", className),
|
|
227
|
+
children: payload.map((item) => {
|
|
228
|
+
const key = `${nameKey || item.dataKey || "value"}`;
|
|
229
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
231
|
+
"div",
|
|
232
|
+
{
|
|
233
|
+
className: cn("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),
|
|
234
|
+
children: [
|
|
235
|
+
(itemConfig == null ? void 0 : itemConfig.icon) && !hideIcon ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(itemConfig.icon, {}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
236
|
+
"div",
|
|
237
|
+
{
|
|
238
|
+
className: "h-2 w-2 shrink-0 rounded-[2px]",
|
|
239
|
+
style: {
|
|
240
|
+
backgroundColor: item.color
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
),
|
|
244
|
+
itemConfig == null ? void 0 : itemConfig.label
|
|
245
|
+
]
|
|
246
|
+
},
|
|
247
|
+
item.value
|
|
248
|
+
);
|
|
249
|
+
})
|
|
250
|
+
}
|
|
251
|
+
);
|
|
252
|
+
});
|
|
253
|
+
ChartLegendContent.displayName = "ChartLegend";
|
|
254
|
+
function getPayloadConfigFromPayload(config, payload, key) {
|
|
255
|
+
if (typeof payload !== "object" || payload === null) {
|
|
256
|
+
return void 0;
|
|
257
|
+
}
|
|
258
|
+
const payloadPayload = "payload" in payload && typeof payload.payload === "object" && payload.payload !== null ? payload.payload : void 0;
|
|
259
|
+
let configLabelKey = key;
|
|
260
|
+
if (key in payload && typeof payload[key] === "string") {
|
|
261
|
+
configLabelKey = payload[key];
|
|
262
|
+
} else if (payloadPayload && key in payloadPayload && typeof payloadPayload[key] === "string") {
|
|
263
|
+
configLabelKey = payloadPayload[key];
|
|
264
|
+
}
|
|
265
|
+
return configLabelKey in config ? config[configLabelKey] : config[key];
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// src/components/ui/carousel.tsx
|
|
269
|
+
var React3 = __toESM(require("react"), 1);
|
|
270
|
+
var import_embla_carousel_react = __toESM(require("embla-carousel-react"), 1);
|
|
271
|
+
var import_lucide_react = require("lucide-react");
|
|
272
|
+
|
|
273
|
+
// src/components/ui/button.tsx
|
|
274
|
+
var React2 = __toESM(require("react"), 1);
|
|
275
|
+
var import_react_slot = require("@radix-ui/react-slot");
|
|
276
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
277
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
278
|
+
var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
279
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
280
|
+
{
|
|
281
|
+
variants: {
|
|
282
|
+
variant: {
|
|
283
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
284
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
285
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
286
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
287
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
288
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
289
|
+
},
|
|
290
|
+
size: {
|
|
291
|
+
default: "h-10 px-4 py-2",
|
|
292
|
+
sm: "h-9 rounded-md px-3",
|
|
293
|
+
lg: "h-11 rounded-md px-8",
|
|
294
|
+
icon: "h-10 w-10"
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
defaultVariants: {
|
|
298
|
+
variant: "default",
|
|
299
|
+
size: "default"
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
);
|
|
303
|
+
var Button = React2.forwardRef(
|
|
304
|
+
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
305
|
+
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Comp, { className: cn(buttonVariants({ variant, size, className })), ref, ...props });
|
|
307
|
+
}
|
|
308
|
+
);
|
|
309
|
+
Button.displayName = "Button";
|
|
310
|
+
|
|
311
|
+
// src/components/ui/carousel.tsx
|
|
312
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
313
|
+
var CarouselContext = React3.createContext(null);
|
|
314
|
+
function useCarousel() {
|
|
315
|
+
const context = React3.useContext(CarouselContext);
|
|
316
|
+
if (!context) {
|
|
317
|
+
throw new Error("useCarousel must be used within a <Carousel />");
|
|
318
|
+
}
|
|
319
|
+
return context;
|
|
320
|
+
}
|
|
321
|
+
var Carousel = React3.forwardRef(
|
|
322
|
+
({ orientation = "horizontal", opts, setApi, plugins, className, children, ...props }, ref) => {
|
|
323
|
+
const [carouselRef, api] = (0, import_embla_carousel_react.default)(
|
|
324
|
+
{
|
|
325
|
+
...opts,
|
|
326
|
+
axis: orientation === "horizontal" ? "x" : "y"
|
|
327
|
+
},
|
|
328
|
+
plugins
|
|
329
|
+
);
|
|
330
|
+
const [canScrollPrev, setCanScrollPrev] = React3.useState(false);
|
|
331
|
+
const [canScrollNext, setCanScrollNext] = React3.useState(false);
|
|
332
|
+
const onSelect = React3.useCallback((api2) => {
|
|
333
|
+
if (!api2) {
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
setCanScrollPrev(api2.canScrollPrev());
|
|
337
|
+
setCanScrollNext(api2.canScrollNext());
|
|
338
|
+
}, []);
|
|
339
|
+
const scrollPrev = React3.useCallback(() => {
|
|
340
|
+
api == null ? void 0 : api.scrollPrev();
|
|
341
|
+
}, [api]);
|
|
342
|
+
const scrollNext = React3.useCallback(() => {
|
|
343
|
+
api == null ? void 0 : api.scrollNext();
|
|
344
|
+
}, [api]);
|
|
345
|
+
const handleKeyDown = React3.useCallback(
|
|
346
|
+
(event) => {
|
|
347
|
+
if (event.key === "ArrowLeft") {
|
|
348
|
+
event.preventDefault();
|
|
349
|
+
scrollPrev();
|
|
350
|
+
} else if (event.key === "ArrowRight") {
|
|
351
|
+
event.preventDefault();
|
|
352
|
+
scrollNext();
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
[scrollPrev, scrollNext]
|
|
356
|
+
);
|
|
357
|
+
React3.useEffect(() => {
|
|
358
|
+
if (!api || !setApi) {
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
setApi(api);
|
|
362
|
+
}, [api, setApi]);
|
|
363
|
+
React3.useEffect(() => {
|
|
364
|
+
if (!api) {
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
onSelect(api);
|
|
368
|
+
api.on("reInit", onSelect);
|
|
369
|
+
api.on("select", onSelect);
|
|
370
|
+
return () => {
|
|
371
|
+
api == null ? void 0 : api.off("select", onSelect);
|
|
372
|
+
};
|
|
373
|
+
}, [api, onSelect]);
|
|
374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
375
|
+
CarouselContext.Provider,
|
|
376
|
+
{
|
|
377
|
+
value: {
|
|
378
|
+
carouselRef,
|
|
379
|
+
api,
|
|
380
|
+
opts,
|
|
381
|
+
orientation: orientation || ((opts == null ? void 0 : opts.axis) === "y" ? "vertical" : "horizontal"),
|
|
382
|
+
scrollPrev,
|
|
383
|
+
scrollNext,
|
|
384
|
+
canScrollPrev,
|
|
385
|
+
canScrollNext
|
|
386
|
+
},
|
|
387
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
388
|
+
"div",
|
|
389
|
+
{
|
|
390
|
+
ref,
|
|
391
|
+
onKeyDownCapture: handleKeyDown,
|
|
392
|
+
className: cn("relative", className),
|
|
393
|
+
role: "region",
|
|
394
|
+
"aria-roledescription": "carousel",
|
|
395
|
+
...props,
|
|
396
|
+
children
|
|
397
|
+
}
|
|
398
|
+
)
|
|
399
|
+
}
|
|
400
|
+
);
|
|
401
|
+
}
|
|
402
|
+
);
|
|
403
|
+
Carousel.displayName = "Carousel";
|
|
404
|
+
var CarouselContent = React3.forwardRef(
|
|
405
|
+
({ className, ...props }, ref) => {
|
|
406
|
+
const { carouselRef, orientation } = useCarousel();
|
|
407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { ref: carouselRef, className: "overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
408
|
+
"div",
|
|
409
|
+
{
|
|
410
|
+
ref,
|
|
411
|
+
className: cn("flex", orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col", className),
|
|
412
|
+
...props
|
|
413
|
+
}
|
|
414
|
+
) });
|
|
415
|
+
}
|
|
416
|
+
);
|
|
417
|
+
CarouselContent.displayName = "CarouselContent";
|
|
418
|
+
var CarouselItem = React3.forwardRef(
|
|
419
|
+
({ className, ...props }, ref) => {
|
|
420
|
+
const { orientation } = useCarousel();
|
|
421
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
422
|
+
"div",
|
|
423
|
+
{
|
|
424
|
+
ref,
|
|
425
|
+
role: "group",
|
|
426
|
+
"aria-roledescription": "slide",
|
|
427
|
+
className: cn("min-w-0 shrink-0 grow-0 basis-full", orientation === "horizontal" ? "pl-4" : "pt-4", className),
|
|
428
|
+
...props
|
|
429
|
+
}
|
|
430
|
+
);
|
|
431
|
+
}
|
|
432
|
+
);
|
|
433
|
+
CarouselItem.displayName = "CarouselItem";
|
|
434
|
+
var CarouselPrevious = React3.forwardRef(
|
|
435
|
+
({ className, variant = "outline", size = "icon", ...props }, ref) => {
|
|
436
|
+
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
437
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
438
|
+
Button,
|
|
439
|
+
{
|
|
440
|
+
ref,
|
|
441
|
+
variant,
|
|
442
|
+
size,
|
|
443
|
+
className: cn(
|
|
444
|
+
"absolute h-8 w-8 rounded-full",
|
|
445
|
+
orientation === "horizontal" ? "-left-12 top-1/2 -translate-y-1/2" : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
446
|
+
className
|
|
447
|
+
),
|
|
448
|
+
disabled: !canScrollPrev,
|
|
449
|
+
onClick: scrollPrev,
|
|
450
|
+
...props,
|
|
451
|
+
children: [
|
|
452
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.ArrowLeft, { className: "h-4 w-4" }),
|
|
453
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "sr-only", children: "Previous slide" })
|
|
454
|
+
]
|
|
455
|
+
}
|
|
456
|
+
);
|
|
457
|
+
}
|
|
458
|
+
);
|
|
459
|
+
CarouselPrevious.displayName = "CarouselPrevious";
|
|
460
|
+
var CarouselNext = React3.forwardRef(
|
|
461
|
+
({ className, variant = "outline", size = "icon", ...props }, ref) => {
|
|
462
|
+
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
463
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
464
|
+
Button,
|
|
465
|
+
{
|
|
466
|
+
ref,
|
|
467
|
+
variant,
|
|
468
|
+
size,
|
|
469
|
+
className: cn(
|
|
470
|
+
"absolute h-8 w-8 rounded-full",
|
|
471
|
+
orientation === "horizontal" ? "-right-12 top-1/2 -translate-y-1/2" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
472
|
+
className
|
|
473
|
+
),
|
|
474
|
+
disabled: !canScrollNext,
|
|
475
|
+
onClick: scrollNext,
|
|
476
|
+
...props,
|
|
477
|
+
children: [
|
|
478
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.ArrowRight, { className: "h-4 w-4" }),
|
|
479
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "sr-only", children: "Next slide" })
|
|
480
|
+
]
|
|
481
|
+
}
|
|
482
|
+
);
|
|
483
|
+
}
|
|
484
|
+
);
|
|
485
|
+
CarouselNext.displayName = "CarouselNext";
|
|
486
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
487
|
+
0 && (module.exports = {
|
|
488
|
+
Carousel,
|
|
489
|
+
CarouselContent,
|
|
490
|
+
CarouselItem,
|
|
491
|
+
CarouselNext,
|
|
492
|
+
CarouselPrevious,
|
|
493
|
+
ChartContainer,
|
|
494
|
+
ChartLegend,
|
|
495
|
+
ChartLegendContent,
|
|
496
|
+
ChartStyle,
|
|
497
|
+
ChartTooltip,
|
|
498
|
+
ChartTooltipContent
|
|
499
|
+
});
|
|
500
|
+
//# sourceMappingURL=charts.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/charts.ts","../src/components/ui/chart.tsx","../src/lib/utils.ts","../src/components/ui/carousel.tsx","../src/components/ui/button.tsx"],"sourcesContent":["export * from \"./components/ui/chart\";\nexport * from \"./components/ui/carousel\";\n","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 } & ({ color?: string; theme?: never } | { color?: never; theme: Record<keyof typeof THEMES, string> });\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\nconst ChartContainer = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\"> & {\n config: ChartConfig;\n children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>[\"children\"];\n }\n>(({ id, className, children, config, ...props }, ref) => {\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-chart={chartId}\n ref={ref}\n className={cn(\n \"flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none\",\n className,\n )}\n {...props}\n >\n <ChartStyle id={chartId} config={config} />\n <RechartsPrimitive.ResponsiveContainer>{children}</RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n );\n});\nChartContainer.displayName = \"Chart\";\n\nconst ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {\n const colorConfig = Object.entries(config).filter(([_, config]) => config.theme || config.color);\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 = itemConfig.theme?.[theme as keyof typeof itemConfig.theme] || 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\nconst ChartTooltipContent = React.forwardRef<\n HTMLDivElement,\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>(\n (\n {\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 },\n ref,\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 <div className={cn(\"font-medium\", labelClassName)}>{labelFormatter(value, payload)}</div>;\n }\n\n if (!value) {\n return null;\n }\n\n return <div className={cn(\"font-medium\", labelClassName)}>{value}</div>;\n }, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);\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 ref={ref}\n className={cn(\n \"grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl\",\n className,\n )}\n >\n {!nestLabel ? tooltipLabel : null}\n <div className=\"grid gap-1.5\">\n {payload.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 \"flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground\",\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(\"shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]\", {\n \"h-2.5 w-2.5\": indicator === \"dot\",\n \"w-1\": indicator === \"line\",\n \"w-0 border-[1.5px] border-dashed bg-transparent\": indicator === \"dashed\",\n \"my-0.5\": nestLabel && indicator === \"dashed\",\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\">{itemConfig?.label || item.name}</span>\n </div>\n {item.value && (\n <span className=\"font-mono font-medium tabular-nums text-foreground\">\n {item.value.toLocaleString()}\n </span>\n )}\n </div>\n </>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n },\n);\nChartTooltipContent.displayName = \"ChartTooltip\";\n\nconst ChartLegend = RechartsPrimitive.Legend;\n\nconst ChartLegendContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\"> &\n Pick<RechartsPrimitive.LegendProps, \"payload\" | \"verticalAlign\"> & {\n hideIcon?: boolean;\n nameKey?: string;\n }\n>(({ className, hideIcon = false, payload, verticalAlign = \"bottom\", nameKey }, ref) => {\n const { config } = useChart();\n\n if (!payload?.length) {\n return null;\n }\n\n return (\n <div\n ref={ref}\n className={cn(\"flex items-center justify-center gap-4\", verticalAlign === \"top\" ? \"pb-3\" : \"pt-3\", className)}\n >\n {payload.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(\"flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground\")}\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});\nChartLegendContent.displayName = \"ChartLegend\";\n\n// Helper to extract item config from a payload.\nfunction getPayloadConfigFromPayload(config: ChartConfig, payload: unknown, key: string) {\n if (typeof payload !== \"object\" || payload === null) {\n return undefined;\n }\n\n const payloadPayload =\n \"payload\" in payload && typeof payload.payload === \"object\" && payload.payload !== null\n ? payload.payload\n : undefined;\n\n let configLabelKey: string = key;\n\n if (key in payload && typeof payload[key as keyof typeof payload] === \"string\") {\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[key as keyof typeof payloadPayload] as string;\n }\n\n return configLabelKey in config ? config[configLabelKey] : config[key as keyof typeof config];\n}\n\nexport { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle };\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import * as React from \"react\";\nimport useEmblaCarousel, { type UseEmblaCarouselType } from \"embla-carousel-react\";\nimport { ArrowLeft, ArrowRight } from \"lucide-react\";\n\nimport { cn } from '../../lib/utils';\nimport { Button } from \"./button\";\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\nconst Carousel = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement> & CarouselProps>(\n ({ orientation = \"horizontal\", opts, setApi, plugins, className, children, ...props }, ref) => {\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) {\n return;\n }\n\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) {\n return;\n }\n\n setApi(api);\n }, [api, setApi]);\n\n React.useEffect(() => {\n if (!api) {\n return;\n }\n\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: orientation || (opts?.axis === \"y\" ? \"vertical\" : \"horizontal\"),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <div\n ref={ref}\n onKeyDownCapture={handleKeyDown}\n className={cn(\"relative\", className)}\n role=\"region\"\n aria-roledescription=\"carousel\"\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n },\n);\nCarousel.displayName = \"Carousel\";\n\nconst CarouselContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const { carouselRef, orientation } = useCarousel();\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\">\n <div\n ref={ref}\n className={cn(\"flex\", orientation === \"horizontal\" ? \"-ml-4\" : \"-mt-4 flex-col\", className)}\n {...props}\n />\n </div>\n );\n },\n);\nCarouselContent.displayName = \"CarouselContent\";\n\nconst CarouselItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const { orientation } = useCarousel();\n\n return (\n <div\n ref={ref}\n role=\"group\"\n aria-roledescription=\"slide\"\n className={cn(\"min-w-0 shrink-0 grow-0 basis-full\", orientation === \"horizontal\" ? \"pl-4\" : \"pt-4\", className)}\n {...props}\n />\n );\n },\n);\nCarouselItem.displayName = \"CarouselItem\";\n\nconst CarouselPrevious = React.forwardRef<HTMLButtonElement, React.ComponentProps<typeof Button>>(\n ({ className, variant = \"outline\", size = \"icon\", ...props }, ref) => {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n\n return (\n <Button\n ref={ref}\n variant={variant}\n size={size}\n className={cn(\n \"absolute h-8 w-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"-left-12 top-1/2 -translate-y-1/2\"\n : \"-top-12 left-1/2 -translate-x-1/2 rotate-90\",\n className,\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <ArrowLeft className=\"h-4 w-4\" />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n );\n },\n);\nCarouselPrevious.displayName = \"CarouselPrevious\";\n\nconst CarouselNext = React.forwardRef<HTMLButtonElement, React.ComponentProps<typeof Button>>(\n ({ className, variant = \"outline\", size = \"icon\", ...props }, ref) => {\n const { orientation, scrollNext, canScrollNext } = useCarousel();\n\n return (\n <Button\n ref={ref}\n variant={variant}\n size={size}\n className={cn(\n \"absolute h-8 w-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"-right-12 top-1/2 -translate-y-1/2\"\n : \"-bottom-12 left-1/2 -translate-x-1/2 rotate-90\",\n className,\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <ArrowRight className=\"h-4 w-4\" />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n );\n },\n);\nCarouselNext.displayName = \"CarouselNext\";\n\nexport { type CarouselApi, Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext };\n","import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from '../../lib/utils';\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive: \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline: \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-10 px-4 py-2\",\n sm: \"h-9 rounded-md px-3\",\n lg: \"h-11 rounded-md px-8\",\n icon: \"h-10 w-10\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n return <Comp className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />;\n },\n);\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,wBAAmC;;;ACDnC,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ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,CAAC,EAAE,WAAW,UAAU,WAAW,OAAO,QAAQ,GAAG,MAAM,GAAG,QAAQ;AACpE,UAAM,EAAE,aAAa,YAAY,cAAc,IAAI,YAAY;AAE/D,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA,gBAAgB,eACZ,sCACA;AAAA,UACJ;AAAA,QACF;AAAA,QACA,UAAU,CAAC;AAAA,QACX,SAAS;AAAA,QACR,GAAG;AAAA,QAEJ;AAAA,uDAAC,iCAAU,WAAU,WAAU;AAAA,UAC/B,6CAAC,UAAK,WAAU,WAAU,4BAAc;AAAA;AAAA;AAAA,IAC1C;AAAA,EAEJ;AACF;AACA,iBAAiB,cAAc;AAE/B,IAAM,eAAqB;AAAA,EACzB,CAAC,EAAE,WAAW,UAAU,WAAW,OAAO,QAAQ,GAAG,MAAM,GAAG,QAAQ;AACpE,UAAM,EAAE,aAAa,YAAY,cAAc,IAAI,YAAY;AAE/D,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA,gBAAgB,eACZ,uCACA;AAAA,UACJ;AAAA,QACF;AAAA,QACA,UAAU,CAAC;AAAA,QACX,SAAS;AAAA,QACR,GAAG;AAAA,QAEJ;AAAA,uDAAC,kCAAW,WAAU,WAAU;AAAA,UAChC,6CAAC,UAAK,WAAU,WAAU,wBAAU;AAAA;AAAA;AAAA,IACtC;AAAA,EAEJ;AACF;AACA,aAAa,cAAc;","names":["config","React","React","import_jsx_runtime","import_jsx_runtime","useEmblaCarousel","api"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { c as Carousel, C as CarouselApi, d as CarouselContent, e as CarouselItem, g as CarouselNext, f as CarouselPrevious, n as ChartConfig, h as ChartContainer, k as ChartLegend, l as ChartLegendContent, m as ChartStyle, i as ChartTooltip, j as ChartTooltipContent } from './charts-KwYmX5He.cjs';
|
|
2
|
+
import 'recharts/types/util/payload/getUniqPayload';
|
|
3
|
+
import 'recharts/types/component/Tooltip';
|
|
4
|
+
import 'recharts/types/util/types';
|
|
5
|
+
import 'recharts/types/component/DefaultTooltipContent';
|
|
6
|
+
import 'react/jsx-runtime';
|
|
7
|
+
import 'react';
|
|
8
|
+
import 'recharts';
|
|
9
|
+
import 'class-variance-authority/types';
|
|
10
|
+
import 'class-variance-authority';
|
|
11
|
+
import 'embla-carousel-react';
|
package/dist/charts.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { c as Carousel, C as CarouselApi, d as CarouselContent, e as CarouselItem, g as CarouselNext, f as CarouselPrevious, n as ChartConfig, h as ChartContainer, k as ChartLegend, l as ChartLegendContent, m as ChartStyle, i as ChartTooltip, j as ChartTooltipContent } from './charts-KwYmX5He.js';
|
|
2
|
+
import 'recharts/types/util/payload/getUniqPayload';
|
|
3
|
+
import 'recharts/types/component/Tooltip';
|
|
4
|
+
import 'recharts/types/util/types';
|
|
5
|
+
import 'recharts/types/component/DefaultTooltipContent';
|
|
6
|
+
import 'react/jsx-runtime';
|
|
7
|
+
import 'react';
|
|
8
|
+
import 'recharts';
|
|
9
|
+
import 'class-variance-authority/types';
|
|
10
|
+
import 'class-variance-authority';
|
|
11
|
+
import 'embla-carousel-react';
|