@codefast/ui 0.3.10 → 0.3.11-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/README.md +277 -167
- package/dist/components/accordion.d.ts +4 -4
- package/dist/components/accordion.js +5 -5
- package/dist/components/alert-dialog.d.ts +11 -11
- package/dist/components/alert-dialog.js +9 -9
- package/dist/components/alert.d.ts +5 -5
- package/dist/components/alert.js +5 -5
- package/dist/components/aspect-ratio.d.ts +2 -2
- package/dist/components/avatar.d.ts +2 -2
- package/dist/components/avatar.js +3 -3
- package/dist/components/badge.d.ts +3 -3
- package/dist/components/badge.js +7 -7
- package/dist/components/breadcrumb.d.ts +8 -8
- package/dist/components/breadcrumb.js +6 -8
- package/dist/components/button-group.d.ts +5 -5
- package/dist/components/button-group.js +8 -8
- package/dist/components/button.d.ts +6 -6
- package/dist/components/button.js +17 -17
- package/dist/components/calendar.d.ts +5 -5
- package/dist/components/calendar.js +35 -35
- package/dist/components/card.d.ts +8 -8
- package/dist/components/card.js +7 -7
- package/dist/components/carousel.d.ts +10 -10
- package/dist/components/carousel.js +20 -20
- package/dist/components/chart.d.ts +12 -11
- package/dist/components/chart.js +42 -42
- package/dist/components/checkbox-cards.d.ts +2 -2
- package/dist/components/checkbox-cards.js +2 -2
- package/dist/components/checkbox-group.d.ts +2 -2
- package/dist/components/checkbox-group.js +2 -2
- package/dist/components/checkbox.d.ts +2 -2
- package/dist/components/checkbox.js +1 -1
- package/dist/components/collapsible.d.ts +2 -2
- package/dist/components/command.d.ts +4 -4
- package/dist/components/command.js +10 -10
- package/dist/components/context-menu.d.ts +4 -4
- package/dist/components/context-menu.js +10 -10
- package/dist/components/dialog.d.ts +10 -10
- package/dist/components/dialog.js +12 -12
- package/dist/components/drawer.d.ts +9 -9
- package/dist/components/drawer.js +9 -9
- package/dist/components/dropdown-menu.d.ts +4 -4
- package/dist/components/dropdown-menu.js +10 -10
- package/dist/components/empty.d.ts +9 -9
- package/dist/components/empty.js +10 -10
- package/dist/components/field.d.ts +14 -14
- package/dist/components/field.js +17 -17
- package/dist/components/form.d.ts +10 -10
- package/dist/components/form.js +8 -8
- package/dist/components/hover-card.d.ts +2 -2
- package/dist/components/hover-card.js +3 -3
- package/dist/components/input-group.d.ts +15 -15
- package/dist/components/input-group.js +20 -20
- package/dist/components/input-number.d.ts +2 -2
- package/dist/components/input-number.js +7 -7
- package/dist/components/input-otp.d.ts +6 -6
- package/dist/components/input-otp.js +4 -4
- package/dist/components/input-password.d.ts +3 -3
- package/dist/components/input-password.js +6 -6
- package/dist/components/input-search.d.ts +3 -3
- package/dist/components/input-search.js +4 -4
- package/dist/components/input.d.ts +2 -2
- package/dist/components/input.js +1 -1
- package/dist/components/item.d.ts +12 -12
- package/dist/components/item.js +23 -23
- package/dist/components/kbd.d.ts +3 -3
- package/dist/components/kbd.js +2 -2
- package/dist/components/label.d.ts +2 -2
- package/dist/components/label.js +1 -1
- package/dist/components/menubar.d.ts +4 -4
- package/dist/components/menubar.js +13 -13
- package/dist/components/native-select.d.ts +4 -4
- package/dist/components/native-select.js +2 -2
- package/dist/components/navigation-menu.d.ts +2 -2
- package/dist/components/navigation-menu.js +10 -10
- package/dist/components/pagination.d.ts +10 -10
- package/dist/components/pagination.js +6 -6
- package/dist/components/popover.d.ts +3 -3
- package/dist/components/popover.js +3 -3
- package/dist/components/progress-circle.d.ts +5 -5
- package/dist/components/progress-circle.js +22 -22
- package/dist/components/progress.d.ts +2 -2
- package/dist/components/progress.js +2 -2
- package/dist/components/radio-cards.d.ts +2 -2
- package/dist/components/radio-cards.js +3 -3
- package/dist/components/radio-group.d.ts +2 -2
- package/dist/components/radio-group.js +3 -3
- package/dist/components/radio.d.ts +2 -2
- package/dist/components/radio.js +1 -1
- package/dist/components/resizable.d.ts +2 -2
- package/dist/components/resizable.js +3 -3
- package/dist/components/scroll-area.d.ts +5 -5
- package/dist/components/scroll-area.js +31 -31
- package/dist/components/select.d.ts +5 -5
- package/dist/components/select.js +9 -9
- package/dist/components/separator.d.ts +5 -5
- package/dist/components/separator.js +9 -9
- package/dist/components/sheet.d.ts +9 -9
- package/dist/components/sheet.js +17 -17
- package/dist/components/sidebar.d.ts +31 -31
- package/dist/components/sidebar.js +65 -65
- package/dist/components/skeleton.d.ts +2 -2
- package/dist/components/skeleton.js +1 -1
- package/dist/components/slider.d.ts +2 -2
- package/dist/components/slider.js +4 -4
- package/dist/components/sonner.d.ts +3 -3
- package/dist/components/sonner.js +4 -4
- package/dist/components/spinner.d.ts +2 -2
- package/dist/components/spinner.js +5 -5
- package/dist/components/switch.d.ts +2 -2
- package/dist/components/switch.js +2 -2
- package/dist/components/table.d.ts +9 -9
- package/dist/components/table.js +8 -8
- package/dist/components/tabs.d.ts +2 -2
- package/dist/components/tabs.js +4 -4
- package/dist/components/textarea.d.ts +2 -2
- package/dist/components/textarea.js +1 -1
- package/dist/components/toggle-group.d.ts +4 -4
- package/dist/components/toggle-group.js +5 -5
- package/dist/components/toggle.d.ts +3 -3
- package/dist/components/toggle.js +8 -8
- package/dist/components/tooltip.d.ts +3 -3
- package/dist/components/tooltip.js +2 -2
- package/dist/css/preset.css +4 -4
- package/dist/css/style.css +3 -3
- package/dist/hooks/use-copy-to-clipboard.d.ts +1 -1
- package/dist/hooks/use-copy-to-clipboard.js +1 -1
- package/dist/hooks/use-media-query.js +3 -3
- package/dist/hooks/use-mutation-observer.d.ts +1 -1
- package/dist/hooks/use-pagination.js +1 -1
- package/dist/index.d.ts +130 -130
- package/dist/primitives/checkbox-group.d.ts +11 -11
- package/dist/primitives/checkbox-group.js +3 -3
- package/dist/primitives/input-number.d.ts +8 -8
- package/dist/primitives/input-number.js +46 -46
- package/dist/primitives/input.d.ts +4 -4
- package/dist/primitives/input.js +7 -7
- package/dist/primitives/progress-circle.d.ts +7 -7
- package/dist/primitives/progress-circle.js +8 -8
- package/package.json +111 -189
- package/dist/components/accordion.cjs +0 -98
- package/dist/components/alert-dialog.cjs +0 -156
- package/dist/components/alert.cjs +0 -84
- package/dist/components/aspect-ratio.cjs +0 -44
- package/dist/components/avatar.cjs +0 -66
- package/dist/components/badge.cjs +0 -67
- package/dist/components/breadcrumb.cjs +0 -127
- package/dist/components/button-group.cjs +0 -87
- package/dist/components/button.cjs +0 -92
- package/dist/components/calendar.cjs +0 -151
- package/dist/components/card.cjs +0 -105
- package/dist/components/carousel.cjs +0 -211
- package/dist/components/chart.cjs +0 -251
- package/dist/components/checkbox-cards.cjs +0 -70
- package/dist/components/checkbox-group.cjs +0 -64
- package/dist/components/checkbox.cjs +0 -54
- package/dist/components/collapsible.cjs +0 -62
- package/dist/components/command.cjs +0 -168
- package/dist/components/context-menu.cjs +0 -219
- package/dist/components/dialog.cjs +0 -165
- package/dist/components/drawer.cjs +0 -144
- package/dist/components/dropdown-menu.cjs +0 -222
- package/dist/components/empty.cjs +0 -113
- package/dist/components/field.cjs +0 -194
- package/dist/components/form.cjs +0 -152
- package/dist/components/hover-card.cjs +0 -78
- package/dist/components/input-group.cjs +0 -156
- package/dist/components/input-number.cjs +0 -99
- package/dist/components/input-otp.cjs +0 -102
- package/dist/components/input-password.cjs +0 -72
- package/dist/components/input-search.cjs +0 -81
- package/dist/components/input.cjs +0 -46
- package/dist/components/item.cjs +0 -186
- package/dist/components/kbd.cjs +0 -54
- package/dist/components/label.cjs +0 -46
- package/dist/components/menubar.cjs +0 -233
- package/dist/components/native-select.cjs +0 -75
- package/dist/components/navigation-menu.cjs +0 -146
- package/dist/components/pagination.cjs +0 -138
- package/dist/components/popover.cjs +0 -87
- package/dist/components/progress-circle.cjs +0 -185
- package/dist/components/progress.cjs +0 -53
- package/dist/components/radio-cards.cjs +0 -67
- package/dist/components/radio-group.cjs +0 -60
- package/dist/components/radio.cjs +0 -48
- package/dist/components/resizable.cjs +0 -72
- package/dist/components/scroll-area.cjs +0 -141
- package/dist/components/select.cjs +0 -181
- package/dist/components/separator.cjs +0 -83
- package/dist/components/sheet.cjs +0 -185
- package/dist/components/sidebar.cjs +0 -507
- package/dist/components/skeleton.cjs +0 -44
- package/dist/components/slider.cjs +0 -80
- package/dist/components/sonner.cjs +0 -58
- package/dist/components/spinner.cjs +0 -76
- package/dist/components/switch.cjs +0 -50
- package/dist/components/table.cjs +0 -118
- package/dist/components/tabs.cjs +0 -76
- package/dist/components/textarea.cjs +0 -44
- package/dist/components/toggle-group.cjs +0 -91
- package/dist/components/toggle.cjs +0 -72
- package/dist/components/tooltip.cjs +0 -91
- package/dist/hooks/use-animated-value.cjs +0 -75
- package/dist/hooks/use-copy-to-clipboard.cjs +0 -58
- package/dist/hooks/use-is-mobile.cjs +0 -40
- package/dist/hooks/use-media-query.cjs +0 -57
- package/dist/hooks/use-mutation-observer.cjs +0 -57
- package/dist/hooks/use-pagination.cjs +0 -93
- package/dist/index.cjs +0 -1081
- package/dist/primitives/checkbox-group.cjs +0 -151
- package/dist/primitives/input-number.cjs +0 -439
- package/dist/primitives/input.cjs +0 -99
- package/dist/primitives/progress-circle.cjs +0 -199
|
@@ -1,251 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
"use client";
|
|
3
|
-
var __webpack_require__ = {};
|
|
4
|
-
(()=>{
|
|
5
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
6
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: definition[key]
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
})();
|
|
12
|
-
(()=>{
|
|
13
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
-
})();
|
|
15
|
-
(()=>{
|
|
16
|
-
__webpack_require__.r = (exports1)=>{
|
|
17
|
-
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
18
|
-
value: 'Module'
|
|
19
|
-
});
|
|
20
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
21
|
-
value: true
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
})();
|
|
25
|
-
var __webpack_exports__ = {};
|
|
26
|
-
__webpack_require__.r(__webpack_exports__);
|
|
27
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
28
|
-
ChartContainer: ()=>ChartContainer,
|
|
29
|
-
ChartLegend: ()=>ChartLegend,
|
|
30
|
-
ChartTooltipContent: ()=>ChartTooltipContent,
|
|
31
|
-
ChartLegendContent: ()=>ChartLegendContent,
|
|
32
|
-
createChartScope: ()=>createChartScope,
|
|
33
|
-
ChartTooltip: ()=>ChartTooltip,
|
|
34
|
-
ChartStyle: ()=>ChartStyle
|
|
35
|
-
});
|
|
36
|
-
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
37
|
-
const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
|
|
38
|
-
const react_context_namespaceObject = require("@radix-ui/react-context");
|
|
39
|
-
const external_react_namespaceObject = require("react");
|
|
40
|
-
const external_recharts_namespaceObject = require("recharts");
|
|
41
|
-
const THEMES = {
|
|
42
|
-
dark: '.dark',
|
|
43
|
-
light: ''
|
|
44
|
-
};
|
|
45
|
-
const CHART_PROVIDER_NAME = 'ChartProvider';
|
|
46
|
-
const [createChartContext, createChartScope] = (0, react_context_namespaceObject.createContextScope)(CHART_PROVIDER_NAME);
|
|
47
|
-
const [ChartContextProvider, useChartContext] = createChartContext(CHART_PROVIDER_NAME);
|
|
48
|
-
function ChartContainer({ __scopeChart, children, className, config, id, ...props }) {
|
|
49
|
-
const uniqueId = (0, external_react_namespaceObject.useId)();
|
|
50
|
-
const chartId = `chart-${id ?? uniqueId}`;
|
|
51
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ChartContextProvider, {
|
|
52
|
-
config: config,
|
|
53
|
-
scope: __scopeChart,
|
|
54
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
55
|
-
className: (0, tailwind_variants_namespaceObject.cn)("[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-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", className),
|
|
56
|
-
"data-chart": chartId,
|
|
57
|
-
"data-slot": "chart",
|
|
58
|
-
...props,
|
|
59
|
-
children: [
|
|
60
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ChartStyle, {
|
|
61
|
-
config: config,
|
|
62
|
-
id: chartId
|
|
63
|
-
}),
|
|
64
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_recharts_namespaceObject.ResponsiveContainer, {
|
|
65
|
-
children: children
|
|
66
|
-
})
|
|
67
|
-
]
|
|
68
|
-
})
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
function ChartStyle({ config, id }) {
|
|
72
|
-
const colorConfig = Object.entries(config).filter(([, itemConfig])=>itemConfig.theme ?? itemConfig.color);
|
|
73
|
-
if (0 === colorConfig.length) return null;
|
|
74
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("style", {
|
|
75
|
-
dangerouslySetInnerHTML: {
|
|
76
|
-
__html: generateChartStyles(id, colorConfig)
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
const ChartTooltip = external_recharts_namespaceObject.Tooltip;
|
|
81
|
-
const CHART_TOOLTIP_CONTENT_NAME = 'ChartTooltipContent';
|
|
82
|
-
function ChartTooltipContent({ __scopeChart, active, className, color, formatter, hideIndicator = false, hideLabel = false, indicator = 'dot', label, labelClassName, labelFormatter, labelKey, nameKey, payload = [] }) {
|
|
83
|
-
const { config } = useChartContext(CHART_TOOLTIP_CONTENT_NAME, __scopeChart);
|
|
84
|
-
const tooltipLabel = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
85
|
-
if (hideLabel || 0 === payload.length) return null;
|
|
86
|
-
const [item] = payload;
|
|
87
|
-
const key = safeToString(labelKey ?? item.dataKey ?? item.name ?? 'value');
|
|
88
|
-
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
89
|
-
const value = labelKey || 'string' != typeof label ? itemConfig?.label : label in config ? config[label].label ?? label : label;
|
|
90
|
-
if (labelFormatter) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
91
|
-
className: (0, tailwind_variants_namespaceObject.cn)('font-medium', labelClassName),
|
|
92
|
-
children: labelFormatter(value, payload)
|
|
93
|
-
});
|
|
94
|
-
if (!value) return null;
|
|
95
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
96
|
-
className: (0, tailwind_variants_namespaceObject.cn)('font-medium', labelClassName),
|
|
97
|
-
children: value
|
|
98
|
-
});
|
|
99
|
-
}, [
|
|
100
|
-
label,
|
|
101
|
-
labelFormatter,
|
|
102
|
-
payload,
|
|
103
|
-
hideLabel,
|
|
104
|
-
labelClassName,
|
|
105
|
-
config,
|
|
106
|
-
labelKey
|
|
107
|
-
]);
|
|
108
|
-
if (!active || 0 === payload.length) return null;
|
|
109
|
-
const nestLabel = 1 === payload.length && 'dot' !== indicator;
|
|
110
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
111
|
-
className: (0, tailwind_variants_namespaceObject.cn)('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', className),
|
|
112
|
-
children: [
|
|
113
|
-
nestLabel ? null : tooltipLabel,
|
|
114
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
115
|
-
className: "grid gap-1.5",
|
|
116
|
-
children: payload.map((item, index)=>{
|
|
117
|
-
const key = safeToString(nameKey ?? item.name ?? item.dataKey ?? 'value');
|
|
118
|
-
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
119
|
-
const indicatorColor = color ?? (isRecord(item.payload) && 'fill' in item.payload && 'string' == typeof item.payload.fill ? item.payload.fill : void 0) ?? item.color;
|
|
120
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
121
|
-
className: (0, tailwind_variants_namespaceObject.cn)('[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:size-2.5', 'dot' === indicator && 'items-center'),
|
|
122
|
-
children: formatter && void 0 !== item.value && item.name ? formatter(item.value, item.name, item, index, [
|
|
123
|
-
item
|
|
124
|
-
]) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
125
|
-
children: [
|
|
126
|
-
itemConfig?.icon ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(itemConfig.icon, {}) : !hideIndicator && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
127
|
-
className: (0, tailwind_variants_namespaceObject.cn)('shrink-0 rounded-xs border-(--color-border) bg-(--color-bg)', {
|
|
128
|
-
'h-2.5 w-2.5': 'dot' === indicator,
|
|
129
|
-
'my-0.5': nestLabel && 'dashed' === indicator,
|
|
130
|
-
'border-1.5 w-0 border-dashed bg-transparent': 'dashed' === indicator,
|
|
131
|
-
'w-1': 'line' === indicator
|
|
132
|
-
}),
|
|
133
|
-
style: {
|
|
134
|
-
'--color-bg': indicatorColor,
|
|
135
|
-
'--color-border': indicatorColor
|
|
136
|
-
}
|
|
137
|
-
}),
|
|
138
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
139
|
-
className: (0, tailwind_variants_namespaceObject.cn)('flex flex-1 justify-between leading-none', nestLabel ? 'items-end' : 'items-center'),
|
|
140
|
-
children: [
|
|
141
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
142
|
-
className: "grid gap-1.5",
|
|
143
|
-
children: [
|
|
144
|
-
nestLabel ? tooltipLabel : null,
|
|
145
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
146
|
-
className: "text-muted-foreground",
|
|
147
|
-
children: itemConfig?.label ?? item.name
|
|
148
|
-
})
|
|
149
|
-
]
|
|
150
|
-
}),
|
|
151
|
-
null != item.value && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
152
|
-
className: "text-foreground font-mono font-medium tabular-nums",
|
|
153
|
-
children: 'number' == typeof item.value ? item.value.toLocaleString() : safeToString(item.value)
|
|
154
|
-
})
|
|
155
|
-
]
|
|
156
|
-
})
|
|
157
|
-
]
|
|
158
|
-
})
|
|
159
|
-
}, key);
|
|
160
|
-
})
|
|
161
|
-
})
|
|
162
|
-
]
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
const ChartLegend = external_recharts_namespaceObject.Legend;
|
|
166
|
-
const CHART_LEGEND_CONTENT_NAME = 'ChartLegendContent';
|
|
167
|
-
function ChartLegendContent({ __scopeChart, className, hideIcon = false, nameKey, payload, verticalAlign = 'bottom' }) {
|
|
168
|
-
const { config } = useChartContext(CHART_LEGEND_CONTENT_NAME, __scopeChart);
|
|
169
|
-
if (!payload?.length) return null;
|
|
170
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
171
|
-
className: (0, tailwind_variants_namespaceObject.cn)('flex items-center justify-center gap-4', 'top' === verticalAlign ? 'pb-3' : 'pt-3', className),
|
|
172
|
-
children: payload.map((item)=>{
|
|
173
|
-
let key = 'value';
|
|
174
|
-
if (nameKey) key = nameKey;
|
|
175
|
-
else if (null != item.dataKey) key = safeToString(item.dataKey);
|
|
176
|
-
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
177
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
178
|
-
className: (0, tailwind_variants_namespaceObject.cn)('[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:size-3'),
|
|
179
|
-
children: [
|
|
180
|
-
itemConfig?.icon && !hideIcon ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(itemConfig.icon, {}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
181
|
-
className: "size-2 shrink-0 rounded-md",
|
|
182
|
-
style: {
|
|
183
|
-
backgroundColor: item.color
|
|
184
|
-
}
|
|
185
|
-
}),
|
|
186
|
-
itemConfig?.label
|
|
187
|
-
]
|
|
188
|
-
}, nameKey ? safeToString(itemConfig?.color ?? '') : safeToString(item.value ?? ''));
|
|
189
|
-
})
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
function isRecord(value) {
|
|
193
|
-
return 'object' == typeof value && null !== value;
|
|
194
|
-
}
|
|
195
|
-
function getStringValue(record, key) {
|
|
196
|
-
if (key in record) {
|
|
197
|
-
const value = record[key];
|
|
198
|
-
return 'string' == typeof value ? value : void 0;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
function safeToString(value) {
|
|
202
|
-
if ('string' == typeof value) return value;
|
|
203
|
-
if ('number' == typeof value) return value.toString();
|
|
204
|
-
if (null == value) return '';
|
|
205
|
-
if ('boolean' == typeof value) return value.toString();
|
|
206
|
-
if ('bigint' == typeof value) return value.toString();
|
|
207
|
-
if ('symbol' == typeof value) return value.toString();
|
|
208
|
-
return '';
|
|
209
|
-
}
|
|
210
|
-
function getPayloadConfigFromPayload(config, payload, key) {
|
|
211
|
-
if (!isRecord(payload)) return;
|
|
212
|
-
const payloadPayload = isRecord(payload.payload) ? payload.payload : void 0;
|
|
213
|
-
let configLabelKey = key;
|
|
214
|
-
const payloadValue = getStringValue(payload, key);
|
|
215
|
-
if (payloadValue) configLabelKey = payloadValue;
|
|
216
|
-
else if (payloadPayload) {
|
|
217
|
-
const nestedValue = getStringValue(payloadPayload, key);
|
|
218
|
-
if (nestedValue) configLabelKey = nestedValue;
|
|
219
|
-
}
|
|
220
|
-
return configLabelKey in config ? config[configLabelKey] : config[key];
|
|
221
|
-
}
|
|
222
|
-
function generateCssVariable(key, itemConfig, theme) {
|
|
223
|
-
const color = itemConfig.theme?.[theme] ?? itemConfig.color;
|
|
224
|
-
return color ? ` --color-${key}: ${color};` : null;
|
|
225
|
-
}
|
|
226
|
-
function generateThemeStyles(theme, prefix, id, colorConfig) {
|
|
227
|
-
const cssVariables = colorConfig.map(([key, itemConfig])=>generateCssVariable(key, itemConfig, theme)).filter(Boolean).join('\n');
|
|
228
|
-
return `${prefix} [data-chart=${id}] {\n${cssVariables}\n}`;
|
|
229
|
-
}
|
|
230
|
-
function generateChartStyles(id, colorConfig) {
|
|
231
|
-
return Object.entries(THEMES).map(([theme, prefix])=>generateThemeStyles(theme, prefix, id, colorConfig)).join('\n\n');
|
|
232
|
-
}
|
|
233
|
-
exports.ChartContainer = __webpack_exports__.ChartContainer;
|
|
234
|
-
exports.ChartLegend = __webpack_exports__.ChartLegend;
|
|
235
|
-
exports.ChartLegendContent = __webpack_exports__.ChartLegendContent;
|
|
236
|
-
exports.ChartStyle = __webpack_exports__.ChartStyle;
|
|
237
|
-
exports.ChartTooltip = __webpack_exports__.ChartTooltip;
|
|
238
|
-
exports.ChartTooltipContent = __webpack_exports__.ChartTooltipContent;
|
|
239
|
-
exports.createChartScope = __webpack_exports__.createChartScope;
|
|
240
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
241
|
-
"ChartContainer",
|
|
242
|
-
"ChartLegend",
|
|
243
|
-
"ChartLegendContent",
|
|
244
|
-
"ChartStyle",
|
|
245
|
-
"ChartTooltip",
|
|
246
|
-
"ChartTooltipContent",
|
|
247
|
-
"createChartScope"
|
|
248
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
249
|
-
Object.defineProperty(exports, '__esModule', {
|
|
250
|
-
value: true
|
|
251
|
-
});
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
"use client";
|
|
3
|
-
var __webpack_require__ = {};
|
|
4
|
-
(()=>{
|
|
5
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
6
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: definition[key]
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
})();
|
|
12
|
-
(()=>{
|
|
13
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
-
})();
|
|
15
|
-
(()=>{
|
|
16
|
-
__webpack_require__.r = (exports1)=>{
|
|
17
|
-
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
18
|
-
value: 'Module'
|
|
19
|
-
});
|
|
20
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
21
|
-
value: true
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
})();
|
|
25
|
-
var __webpack_exports__ = {};
|
|
26
|
-
__webpack_require__.r(__webpack_exports__);
|
|
27
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
28
|
-
CheckboxCards: ()=>CheckboxCards,
|
|
29
|
-
CheckboxCardsItem: ()=>CheckboxCardsItem
|
|
30
|
-
});
|
|
31
|
-
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
32
|
-
const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
|
|
33
|
-
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
34
|
-
const external_label_cjs_namespaceObject = require("./label.cjs");
|
|
35
|
-
const checkbox_group_cjs_namespaceObject = require("../primitives/checkbox-group.cjs");
|
|
36
|
-
function CheckboxCards(props) {
|
|
37
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(checkbox_group_cjs_namespaceObject.Root, {
|
|
38
|
-
"data-slot": "checkbox-cards",
|
|
39
|
-
...props
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
function CheckboxCardsItem({ checkboxClassName, children, className, ...props }) {
|
|
43
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_label_cjs_namespaceObject.Label, {
|
|
44
|
-
className: (0, tailwind_variants_namespaceObject.cn)('border-input hover:not-has-disabled:not-has-aria-checked:bg-secondary has-aria-checked:bg-primary/10 has-aria-checked:border-primary has-focus-visible:border-ring flex items-start gap-3 rounded-lg border p-3 transition has-disabled:opacity-50', className),
|
|
45
|
-
"data-slot": "checkbox-card",
|
|
46
|
-
children: [
|
|
47
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(checkbox_group_cjs_namespaceObject.Item, {
|
|
48
|
-
className: (0, tailwind_variants_namespaceObject.cn)('border-input text-primary-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:aria-checked:ring-primary/20 dark:focus-visible:aria-checked:ring-primary/40 aria-checked:border-primary aria-checked:bg-primary dark:bg-input/30 peer flex size-4 shrink-0 rounded-sm border shadow-xs outline-hidden transition focus-visible:ring-3', checkboxClassName),
|
|
49
|
-
"data-slot": "checkbox-card-item",
|
|
50
|
-
...props,
|
|
51
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(checkbox_group_cjs_namespaceObject.CheckboxGroupIndicator, {
|
|
52
|
-
"data-slot": "checkbox-card-indicator",
|
|
53
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.CheckIcon, {
|
|
54
|
-
className: "size-3.5"
|
|
55
|
-
})
|
|
56
|
-
})
|
|
57
|
-
}),
|
|
58
|
-
children
|
|
59
|
-
]
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
exports.CheckboxCards = __webpack_exports__.CheckboxCards;
|
|
63
|
-
exports.CheckboxCardsItem = __webpack_exports__.CheckboxCardsItem;
|
|
64
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
65
|
-
"CheckboxCards",
|
|
66
|
-
"CheckboxCardsItem"
|
|
67
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
68
|
-
Object.defineProperty(exports, '__esModule', {
|
|
69
|
-
value: true
|
|
70
|
-
});
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
"use client";
|
|
3
|
-
var __webpack_require__ = {};
|
|
4
|
-
(()=>{
|
|
5
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
6
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: definition[key]
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
})();
|
|
12
|
-
(()=>{
|
|
13
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
-
})();
|
|
15
|
-
(()=>{
|
|
16
|
-
__webpack_require__.r = (exports1)=>{
|
|
17
|
-
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
18
|
-
value: 'Module'
|
|
19
|
-
});
|
|
20
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
21
|
-
value: true
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
})();
|
|
25
|
-
var __webpack_exports__ = {};
|
|
26
|
-
__webpack_require__.r(__webpack_exports__);
|
|
27
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
28
|
-
CheckboxGroup: ()=>CheckboxGroup,
|
|
29
|
-
CheckboxGroupItem: ()=>CheckboxGroupItem
|
|
30
|
-
});
|
|
31
|
-
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
32
|
-
const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
|
|
33
|
-
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
34
|
-
const checkbox_group_cjs_namespaceObject = require("../primitives/checkbox-group.cjs");
|
|
35
|
-
function CheckboxGroup({ className, ...props }) {
|
|
36
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(checkbox_group_cjs_namespaceObject.Root, {
|
|
37
|
-
className: (0, tailwind_variants_namespaceObject.cn)('grid gap-2', className),
|
|
38
|
-
"data-slot": "checkbox-group",
|
|
39
|
-
...props
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
function CheckboxGroupItem({ className, ...props }) {
|
|
43
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(checkbox_group_cjs_namespaceObject.Item, {
|
|
44
|
-
className: (0, tailwind_variants_namespaceObject.cn)('border-input text-primary-foreground hover:not-disabled:not-aria-checked:border-ring/60 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:aria-checked:ring-primary/20 dark:focus-visible:aria-checked:ring-primary/40 aria-checked:border-primary aria-checked:bg-primary aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-checked:aria-invalid:bg-destructive hover:not-disabled:not-aria-checked:aria-invalid:border-destructive/60 dark:bg-input/30 peer flex size-4 shrink-0 items-center justify-center rounded-sm border shadow-xs outline-hidden transition focus-visible:ring-3 disabled:opacity-50', className),
|
|
45
|
-
"data-slot": "checkbox-group-item",
|
|
46
|
-
...props,
|
|
47
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(checkbox_group_cjs_namespaceObject.CheckboxGroupIndicator, {
|
|
48
|
-
className: "flex items-center justify-center text-current transition-none",
|
|
49
|
-
"data-slot": "checkbox-group-indicator",
|
|
50
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.CheckIcon, {
|
|
51
|
-
className: "size-3.5"
|
|
52
|
-
})
|
|
53
|
-
})
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
exports.CheckboxGroup = __webpack_exports__.CheckboxGroup;
|
|
57
|
-
exports.CheckboxGroupItem = __webpack_exports__.CheckboxGroupItem;
|
|
58
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
59
|
-
"CheckboxGroup",
|
|
60
|
-
"CheckboxGroupItem"
|
|
61
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
62
|
-
Object.defineProperty(exports, '__esModule', {
|
|
63
|
-
value: true
|
|
64
|
-
});
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
"use client";
|
|
3
|
-
var __webpack_require__ = {};
|
|
4
|
-
(()=>{
|
|
5
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
6
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: definition[key]
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
})();
|
|
12
|
-
(()=>{
|
|
13
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
-
})();
|
|
15
|
-
(()=>{
|
|
16
|
-
__webpack_require__.r = (exports1)=>{
|
|
17
|
-
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
18
|
-
value: 'Module'
|
|
19
|
-
});
|
|
20
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
21
|
-
value: true
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
})();
|
|
25
|
-
var __webpack_exports__ = {};
|
|
26
|
-
__webpack_require__.r(__webpack_exports__);
|
|
27
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
28
|
-
Checkbox: ()=>Checkbox
|
|
29
|
-
});
|
|
30
|
-
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
|
-
const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
|
|
32
|
-
const react_checkbox_namespaceObject = require("@radix-ui/react-checkbox");
|
|
33
|
-
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
34
|
-
function Checkbox({ className, ...props }) {
|
|
35
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_checkbox_namespaceObject.Root, {
|
|
36
|
-
className: (0, tailwind_variants_namespaceObject.cn)('border-input text-primary-foreground hover:not-disabled:not-aria-checked:border-ring/60 focus-visible:border-ring focus-visible:ring-ring/50 aria-checked:focus-visible:ring-primary/20 dark:aria-checked:focus-visible:ring-primary/40 aria-checked:border-primary aria-checked:aria-invalid:bg-destructive aria-checked:bg-primary aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 hover:not-disabled:not-aria-checked:aria-invalid:border-destructive/60 dark:bg-input/30 peer flex size-4 shrink-0 items-center justify-center rounded-sm border shadow-xs outline-hidden transition focus-visible:ring-3 disabled:opacity-50', className),
|
|
37
|
-
"data-slot": "checkbox",
|
|
38
|
-
...props,
|
|
39
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_checkbox_namespaceObject.Indicator, {
|
|
40
|
-
className: "flex items-center justify-center text-current transition-none",
|
|
41
|
-
"data-slot": "checkbox-indicator",
|
|
42
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.CheckIcon, {
|
|
43
|
-
className: "size-3.5"
|
|
44
|
-
})
|
|
45
|
-
})
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
exports.Checkbox = __webpack_exports__.Checkbox;
|
|
49
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
50
|
-
"Checkbox"
|
|
51
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
52
|
-
Object.defineProperty(exports, '__esModule', {
|
|
53
|
-
value: true
|
|
54
|
-
});
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
"use client";
|
|
3
|
-
var __webpack_require__ = {};
|
|
4
|
-
(()=>{
|
|
5
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
6
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: definition[key]
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
})();
|
|
12
|
-
(()=>{
|
|
13
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
-
})();
|
|
15
|
-
(()=>{
|
|
16
|
-
__webpack_require__.r = (exports1)=>{
|
|
17
|
-
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
18
|
-
value: 'Module'
|
|
19
|
-
});
|
|
20
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
21
|
-
value: true
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
})();
|
|
25
|
-
var __webpack_exports__ = {};
|
|
26
|
-
__webpack_require__.r(__webpack_exports__);
|
|
27
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
28
|
-
Collapsible: ()=>Collapsible,
|
|
29
|
-
CollapsibleContent: ()=>CollapsibleContent,
|
|
30
|
-
CollapsibleTrigger: ()=>CollapsibleTrigger
|
|
31
|
-
});
|
|
32
|
-
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
33
|
-
const react_collapsible_namespaceObject = require("@radix-ui/react-collapsible");
|
|
34
|
-
function Collapsible({ ...props }) {
|
|
35
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_collapsible_namespaceObject.Root, {
|
|
36
|
-
"data-slot": "collapsible",
|
|
37
|
-
...props
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
function CollapsibleTrigger({ ...props }) {
|
|
41
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_collapsible_namespaceObject.CollapsibleTrigger, {
|
|
42
|
-
"data-slot": "collapsible-trigger",
|
|
43
|
-
...props
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
function CollapsibleContent({ ...props }) {
|
|
47
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_collapsible_namespaceObject.CollapsibleContent, {
|
|
48
|
-
"data-slot": "collapsible-content",
|
|
49
|
-
...props
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
exports.Collapsible = __webpack_exports__.Collapsible;
|
|
53
|
-
exports.CollapsibleContent = __webpack_exports__.CollapsibleContent;
|
|
54
|
-
exports.CollapsibleTrigger = __webpack_exports__.CollapsibleTrigger;
|
|
55
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
56
|
-
"Collapsible",
|
|
57
|
-
"CollapsibleContent",
|
|
58
|
-
"CollapsibleTrigger"
|
|
59
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
60
|
-
Object.defineProperty(exports, '__esModule', {
|
|
61
|
-
value: true
|
|
62
|
-
});
|