@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
package/dist/components/chart.js
CHANGED
|
@@ -5,10 +5,10 @@ import { createContextScope } from "@radix-ui/react-context";
|
|
|
5
5
|
import { useId, useMemo } from "react";
|
|
6
6
|
import { Legend, ResponsiveContainer, Tooltip } from "recharts";
|
|
7
7
|
const THEMES = {
|
|
8
|
-
dark:
|
|
9
|
-
light:
|
|
8
|
+
dark: ".dark",
|
|
9
|
+
light: ""
|
|
10
10
|
};
|
|
11
|
-
const CHART_PROVIDER_NAME =
|
|
11
|
+
const CHART_PROVIDER_NAME = "ChartProvider";
|
|
12
12
|
const [createChartContext, createChartScope] = createContextScope(CHART_PROVIDER_NAME);
|
|
13
13
|
const [ChartContextProvider, useChartContext] = createChartContext(CHART_PROVIDER_NAME);
|
|
14
14
|
function ChartContainer({ __scopeChart, children, className, config, id, ...props }) {
|
|
@@ -18,7 +18,7 @@ function ChartContainer({ __scopeChart, children, className, config, id, ...prop
|
|
|
18
18
|
config: config,
|
|
19
19
|
scope: __scopeChart,
|
|
20
20
|
children: /*#__PURE__*/ jsxs("div", {
|
|
21
|
-
className: cn("[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-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
|
|
21
|
+
className: cn("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-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden", className),
|
|
22
22
|
"data-chart": chartId,
|
|
23
23
|
"data-slot": "chart",
|
|
24
24
|
...props,
|
|
@@ -44,22 +44,22 @@ function ChartStyle({ config, id }) {
|
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
const ChartTooltip = Tooltip;
|
|
47
|
-
const CHART_TOOLTIP_CONTENT_NAME =
|
|
48
|
-
function ChartTooltipContent({ __scopeChart, active, className, color, formatter, hideIndicator = false, hideLabel = false, indicator =
|
|
47
|
+
const CHART_TOOLTIP_CONTENT_NAME = "ChartTooltipContent";
|
|
48
|
+
function ChartTooltipContent({ __scopeChart, active, className, color, formatter, hideIndicator = false, hideLabel = false, indicator = "dot", label, labelClassName, labelFormatter, labelKey, nameKey, payload = [] }) {
|
|
49
49
|
const { config } = useChartContext(CHART_TOOLTIP_CONTENT_NAME, __scopeChart);
|
|
50
50
|
const tooltipLabel = useMemo(()=>{
|
|
51
51
|
if (hideLabel || 0 === payload.length) return null;
|
|
52
52
|
const [item] = payload;
|
|
53
|
-
const key = safeToString(labelKey ?? item.dataKey ?? item.name ??
|
|
53
|
+
const key = safeToString(labelKey ?? item.dataKey ?? item.name ?? "value");
|
|
54
54
|
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
55
|
-
const value = labelKey ||
|
|
55
|
+
const value = labelKey || "string" != typeof label ? itemConfig?.label : label in config ? config[label].label ?? label : label;
|
|
56
56
|
if (labelFormatter) return /*#__PURE__*/ jsx("div", {
|
|
57
|
-
className: cn(
|
|
57
|
+
className: cn("font-medium", labelClassName),
|
|
58
58
|
children: labelFormatter(value, payload)
|
|
59
59
|
});
|
|
60
60
|
if (!value) return null;
|
|
61
61
|
return /*#__PURE__*/ jsx("div", {
|
|
62
|
-
className: cn(
|
|
62
|
+
className: cn("font-medium", labelClassName),
|
|
63
63
|
children: value
|
|
64
64
|
});
|
|
65
65
|
}, [
|
|
@@ -72,37 +72,37 @@ function ChartTooltipContent({ __scopeChart, active, className, color, formatter
|
|
|
72
72
|
labelKey
|
|
73
73
|
]);
|
|
74
74
|
if (!active || 0 === payload.length) return null;
|
|
75
|
-
const nestLabel = 1 === payload.length &&
|
|
75
|
+
const nestLabel = 1 === payload.length && "dot" !== indicator;
|
|
76
76
|
return /*#__PURE__*/ jsxs("div", {
|
|
77
|
-
className: cn(
|
|
77
|
+
className: cn("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", className),
|
|
78
78
|
children: [
|
|
79
79
|
nestLabel ? null : tooltipLabel,
|
|
80
80
|
/*#__PURE__*/ jsx("div", {
|
|
81
81
|
className: "grid gap-1.5",
|
|
82
82
|
children: payload.map((item, index)=>{
|
|
83
|
-
const key = safeToString(nameKey ?? item.name ?? item.dataKey ??
|
|
83
|
+
const key = safeToString(nameKey ?? item.name ?? item.dataKey ?? "value");
|
|
84
84
|
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
85
|
-
const indicatorColor = color ?? (isRecord(item.payload) &&
|
|
85
|
+
const indicatorColor = color ?? (isRecord(item.payload) && "fill" in item.payload && "string" == typeof item.payload.fill ? item.payload.fill : void 0) ?? item.color;
|
|
86
86
|
return /*#__PURE__*/ jsx("div", {
|
|
87
|
-
className: cn(
|
|
87
|
+
className: cn("flex w-full flex-wrap items-stretch gap-2 [&>svg]:size-2.5 [&>svg]:text-muted-foreground", "dot" === indicator && "items-center"),
|
|
88
88
|
children: formatter && void 0 !== item.value && item.name ? formatter(item.value, item.name, item, index, [
|
|
89
89
|
item
|
|
90
90
|
]) : /*#__PURE__*/ jsxs(Fragment, {
|
|
91
91
|
children: [
|
|
92
92
|
itemConfig?.icon ? /*#__PURE__*/ jsx(itemConfig.icon, {}) : !hideIndicator && /*#__PURE__*/ jsx("div", {
|
|
93
|
-
className: cn(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
93
|
+
className: cn("shrink-0 rounded-xs border-(--color-border) bg-(--color-bg)", {
|
|
94
|
+
"h-2.5 w-2.5": "dot" === indicator,
|
|
95
|
+
"my-0.5": nestLabel && "dashed" === indicator,
|
|
96
|
+
"border-1.5 w-0 border-dashed bg-transparent": "dashed" === indicator,
|
|
97
|
+
"w-1": "line" === indicator
|
|
98
98
|
}),
|
|
99
99
|
style: {
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
"--color-bg": indicatorColor,
|
|
101
|
+
"--color-border": indicatorColor
|
|
102
102
|
}
|
|
103
103
|
}),
|
|
104
104
|
/*#__PURE__*/ jsxs("div", {
|
|
105
|
-
className: cn(
|
|
105
|
+
className: cn("flex flex-1 justify-between leading-none", nestLabel ? "items-end" : "items-center"),
|
|
106
106
|
children: [
|
|
107
107
|
/*#__PURE__*/ jsxs("div", {
|
|
108
108
|
className: "grid gap-1.5",
|
|
@@ -115,8 +115,8 @@ function ChartTooltipContent({ __scopeChart, active, className, color, formatter
|
|
|
115
115
|
]
|
|
116
116
|
}),
|
|
117
117
|
null != item.value && /*#__PURE__*/ jsx("span", {
|
|
118
|
-
className: "
|
|
119
|
-
children:
|
|
118
|
+
className: "font-mono font-medium text-foreground tabular-nums",
|
|
119
|
+
children: "number" == typeof item.value ? item.value.toLocaleString() : safeToString(item.value)
|
|
120
120
|
})
|
|
121
121
|
]
|
|
122
122
|
})
|
|
@@ -129,19 +129,19 @@ function ChartTooltipContent({ __scopeChart, active, className, color, formatter
|
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
131
|
const ChartLegend = Legend;
|
|
132
|
-
const CHART_LEGEND_CONTENT_NAME =
|
|
133
|
-
function ChartLegendContent({ __scopeChart, className, hideIcon = false, nameKey, payload, verticalAlign =
|
|
132
|
+
const CHART_LEGEND_CONTENT_NAME = "ChartLegendContent";
|
|
133
|
+
function ChartLegendContent({ __scopeChart, className, hideIcon = false, nameKey, payload, verticalAlign = "bottom" }) {
|
|
134
134
|
const { config } = useChartContext(CHART_LEGEND_CONTENT_NAME, __scopeChart);
|
|
135
135
|
if (!payload?.length) return null;
|
|
136
136
|
return /*#__PURE__*/ jsx("div", {
|
|
137
|
-
className: cn(
|
|
137
|
+
className: cn("flex items-center justify-center gap-4", "top" === verticalAlign ? "pb-3" : "pt-3", className),
|
|
138
138
|
children: payload.map((item)=>{
|
|
139
|
-
let key =
|
|
139
|
+
let key = "value";
|
|
140
140
|
if (nameKey) key = nameKey;
|
|
141
141
|
else if (null != item.dataKey) key = safeToString(item.dataKey);
|
|
142
142
|
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
143
143
|
return /*#__PURE__*/ jsxs("div", {
|
|
144
|
-
className: cn(
|
|
144
|
+
className: cn("flex items-center gap-1.5 [&>svg]:size-3 [&>svg]:text-muted-foreground"),
|
|
145
145
|
children: [
|
|
146
146
|
itemConfig?.icon && !hideIcon ? /*#__PURE__*/ jsx(itemConfig.icon, {}) : /*#__PURE__*/ jsx("div", {
|
|
147
147
|
className: "size-2 shrink-0 rounded-md",
|
|
@@ -151,27 +151,27 @@ function ChartLegendContent({ __scopeChart, className, hideIcon = false, nameKey
|
|
|
151
151
|
}),
|
|
152
152
|
itemConfig?.label
|
|
153
153
|
]
|
|
154
|
-
}, nameKey ? safeToString(itemConfig?.color ??
|
|
154
|
+
}, nameKey ? safeToString(itemConfig?.color ?? "") : safeToString(item.value ?? ""));
|
|
155
155
|
})
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
158
|
function isRecord(value) {
|
|
159
|
-
return
|
|
159
|
+
return "object" == typeof value && null !== value;
|
|
160
160
|
}
|
|
161
161
|
function getStringValue(record, key) {
|
|
162
162
|
if (key in record) {
|
|
163
163
|
const value = record[key];
|
|
164
|
-
return
|
|
164
|
+
return "string" == typeof value ? value : void 0;
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
function safeToString(value) {
|
|
168
|
-
if (
|
|
169
|
-
if (
|
|
170
|
-
if (null == value) return
|
|
171
|
-
if (
|
|
172
|
-
if (
|
|
173
|
-
if (
|
|
174
|
-
return
|
|
168
|
+
if ("string" == typeof value) return value;
|
|
169
|
+
if ("number" == typeof value) return value.toString();
|
|
170
|
+
if (null == value) return "";
|
|
171
|
+
if ("boolean" == typeof value) return value.toString();
|
|
172
|
+
if ("bigint" == typeof value) return value.toString();
|
|
173
|
+
if ("symbol" == typeof value) return value.toString();
|
|
174
|
+
return "";
|
|
175
175
|
}
|
|
176
176
|
function getPayloadConfigFromPayload(config, payload, key) {
|
|
177
177
|
if (!isRecord(payload)) return;
|
|
@@ -190,10 +190,10 @@ function generateCssVariable(key, itemConfig, theme) {
|
|
|
190
190
|
return color ? ` --color-${key}: ${color};` : null;
|
|
191
191
|
}
|
|
192
192
|
function generateThemeStyles(theme, prefix, id, colorConfig) {
|
|
193
|
-
const cssVariables = colorConfig.map(([key, itemConfig])=>generateCssVariable(key, itemConfig, theme)).filter(Boolean).join(
|
|
193
|
+
const cssVariables = colorConfig.map(([key, itemConfig])=>generateCssVariable(key, itemConfig, theme)).filter(Boolean).join("\n");
|
|
194
194
|
return `${prefix} [data-chart=${id}] {\n${cssVariables}\n}`;
|
|
195
195
|
}
|
|
196
196
|
function generateChartStyles(id, colorConfig) {
|
|
197
|
-
return Object.entries(THEMES).map(([theme, prefix])=>generateThemeStyles(theme, prefix, id, colorConfig)).join(
|
|
197
|
+
return Object.entries(THEMES).map(([theme, prefix])=>generateThemeStyles(theme, prefix, id, colorConfig)).join("\n\n");
|
|
198
198
|
}
|
|
199
199
|
export { ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, createChartScope };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
import * as CheckboxGroupPrimitive from
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
import * as CheckboxGroupPrimitive from "../primitives/checkbox-group";
|
|
3
3
|
type CheckboxCardsProps = ComponentProps<typeof CheckboxGroupPrimitive.Root>;
|
|
4
4
|
declare function CheckboxCards(props: CheckboxCardsProps): JSX.Element;
|
|
5
5
|
interface CheckboxCardsItemProps extends ComponentProps<typeof CheckboxGroupPrimitive.Item> {
|
|
@@ -12,11 +12,11 @@ function CheckboxCards(props) {
|
|
|
12
12
|
}
|
|
13
13
|
function CheckboxCardsItem({ checkboxClassName, children, className, ...props }) {
|
|
14
14
|
return /*#__PURE__*/ jsxs(Label, {
|
|
15
|
-
className: cn(
|
|
15
|
+
className: cn("flex items-start gap-3 rounded-lg border border-input p-3 transition hover:not-has-disabled:not-has-aria-checked:bg-secondary has-focus-visible:border-ring has-disabled:opacity-50 has-aria-checked:border-primary has-aria-checked:bg-primary/10", className),
|
|
16
16
|
"data-slot": "checkbox-card",
|
|
17
17
|
children: [
|
|
18
18
|
/*#__PURE__*/ jsx(Item, {
|
|
19
|
-
className: cn(
|
|
19
|
+
className: cn("peer flex size-4 shrink-0 rounded-sm border border-input text-primary-foreground shadow-xs outline-hidden transition focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-checked:border-primary aria-checked:bg-primary focus-visible:aria-checked:ring-primary/20 dark:bg-input/30 dark:focus-visible:aria-checked:ring-primary/40", checkboxClassName),
|
|
20
20
|
"data-slot": "checkbox-card-item",
|
|
21
21
|
...props,
|
|
22
22
|
children: /*#__PURE__*/ jsx(CheckboxGroupIndicator, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
import * as CheckboxGroupPrimitive from
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
import * as CheckboxGroupPrimitive from "../primitives/checkbox-group";
|
|
3
3
|
type CheckboxGroupProps = ComponentProps<typeof CheckboxGroupPrimitive.Root>;
|
|
4
4
|
declare function CheckboxGroup({ className, ...props }: CheckboxGroupProps): JSX.Element;
|
|
5
5
|
type CheckboxGroupItemProps = ComponentProps<typeof CheckboxGroupPrimitive.Item>;
|
|
@@ -5,14 +5,14 @@ import { CheckIcon } from "lucide-react";
|
|
|
5
5
|
import { CheckboxGroupIndicator, Item, Root } from "../primitives/checkbox-group.js";
|
|
6
6
|
function CheckboxGroup({ className, ...props }) {
|
|
7
7
|
return /*#__PURE__*/ jsx(Root, {
|
|
8
|
-
className: cn(
|
|
8
|
+
className: cn("grid gap-2", className),
|
|
9
9
|
"data-slot": "checkbox-group",
|
|
10
10
|
...props
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
13
|
function CheckboxGroupItem({ className, ...props }) {
|
|
14
14
|
return /*#__PURE__*/ jsx(Item, {
|
|
15
|
-
className: cn(
|
|
15
|
+
className: cn("peer flex size-4 shrink-0 items-center justify-center rounded-sm border border-input text-primary-foreground shadow-xs outline-hidden transition hover:not-disabled:not-aria-checked:border-ring/60 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50 aria-checked:border-primary aria-checked:bg-primary focus-visible:aria-checked:ring-primary/20 aria-invalid:border-destructive aria-invalid:ring-destructive/20 hover:not-disabled:not-aria-checked:aria-invalid:border-destructive/60 aria-checked:aria-invalid:bg-destructive dark:bg-input/30 dark:focus-visible:aria-checked:ring-primary/40 dark:aria-invalid:ring-destructive/40", className),
|
|
16
16
|
"data-slot": "checkbox-group-item",
|
|
17
17
|
...props,
|
|
18
18
|
children: /*#__PURE__*/ jsx(CheckboxGroupIndicator, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
import * as CheckboxPrimitive from
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
3
3
|
type CheckboxProps = ComponentProps<typeof CheckboxPrimitive.Root>;
|
|
4
4
|
declare function Checkbox({ className, ...props }: CheckboxProps): JSX.Element;
|
|
5
5
|
export { Checkbox };
|
|
@@ -5,7 +5,7 @@ import { Indicator, Root } from "@radix-ui/react-checkbox";
|
|
|
5
5
|
import { CheckIcon } from "lucide-react";
|
|
6
6
|
function Checkbox({ className, ...props }) {
|
|
7
7
|
return /*#__PURE__*/ jsx(Root, {
|
|
8
|
-
className: cn(
|
|
8
|
+
className: cn("peer flex size-4 shrink-0 items-center justify-center rounded-sm border border-input text-primary-foreground shadow-xs outline-hidden transition hover:not-disabled:not-aria-checked:border-ring/60 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50 aria-checked:border-primary aria-checked:bg-primary aria-checked:focus-visible:ring-primary/20 aria-invalid:border-destructive aria-invalid:ring-destructive/20 hover:not-disabled:not-aria-checked:aria-invalid:border-destructive/60 aria-checked:aria-invalid:bg-destructive dark:bg-input/30 dark:aria-checked:focus-visible:ring-primary/40 dark:aria-invalid:ring-destructive/40", className),
|
|
9
9
|
"data-slot": "checkbox",
|
|
10
10
|
...props,
|
|
11
11
|
children: /*#__PURE__*/ jsx(Indicator, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
import * as CollapsiblePrimitive from
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
3
3
|
type CollapsibleProps = ComponentProps<typeof CollapsiblePrimitive.Root>;
|
|
4
4
|
declare function Collapsible({ ...props }: CollapsibleProps): JSX.Element;
|
|
5
5
|
type CollapsibleTriggerProps = ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
import { Command as CommandPrimitive } from
|
|
3
|
-
import { Dialog } from
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
import { Command as CommandPrimitive } from "cmdk";
|
|
3
|
+
import { Dialog } from "./dialog";
|
|
4
4
|
type CommandProps = ComponentProps<typeof CommandPrimitive>;
|
|
5
5
|
declare function Command({ className, ...props }: CommandProps): JSX.Element;
|
|
6
6
|
type CommandDialogProps = ComponentProps<typeof Dialog>;
|
|
@@ -19,7 +19,7 @@ type CommandItemProps = ComponentProps<typeof CommandPrimitive.Item>;
|
|
|
19
19
|
declare function CommandItem({ className, ...props }: CommandItemProps): JSX.Element;
|
|
20
20
|
type CommandLoadingProps = ComponentProps<typeof CommandPrimitive.Loading>;
|
|
21
21
|
declare function CommandLoading({ className, ...props }: CommandLoadingProps): JSX.Element;
|
|
22
|
-
type CommandShortcutProps = ComponentProps<
|
|
22
|
+
type CommandShortcutProps = ComponentProps<"span">;
|
|
23
23
|
declare function CommandShortcut({ className, ...props }: CommandShortcutProps): JSX.Element;
|
|
24
24
|
export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandLoading, CommandSeparator, CommandShortcut, };
|
|
25
25
|
export type { CommandDialogProps, CommandEmptyProps, CommandGroupProps, CommandInputProps, CommandItemProps, CommandListProps, CommandLoadingProps, CommandProps, CommandSeparatorProps, CommandShortcutProps, };
|
|
@@ -7,7 +7,7 @@ import { SearchIcon } from "lucide-react";
|
|
|
7
7
|
import { Dialog, DialogContent, DialogDescription, DialogTitle } from "./dialog.js";
|
|
8
8
|
function command_Command({ className, ...props }) {
|
|
9
9
|
return /*#__PURE__*/ jsx(Command, {
|
|
10
|
-
className: cn(
|
|
10
|
+
className: cn("flex flex-col overflow-hidden rounded-[inherit] bg-popover text-popover-foreground outline-hidden", className),
|
|
11
11
|
"data-slot": "command",
|
|
12
12
|
...props
|
|
13
13
|
});
|
|
@@ -31,7 +31,7 @@ function CommandDialog({ children, ...props }) {
|
|
|
31
31
|
]
|
|
32
32
|
}),
|
|
33
33
|
/*#__PURE__*/ jsx(command_Command, {
|
|
34
|
-
className: "[&_[cmdk-group-heading]]:
|
|
34
|
+
className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input]]:h-12",
|
|
35
35
|
children: children
|
|
36
36
|
})
|
|
37
37
|
]
|
|
@@ -48,7 +48,7 @@ function CommandInput({ className, ...props }) {
|
|
|
48
48
|
className: "size-4 shrink-0 opacity-50"
|
|
49
49
|
}),
|
|
50
50
|
/*#__PURE__*/ jsx(Command.Input, {
|
|
51
|
-
className: cn(
|
|
51
|
+
className: cn("flex h-10 w-full text-base outline-hidden placeholder:text-muted-foreground disabled:opacity-50 md:text-sm", className),
|
|
52
52
|
"data-slot": "command-input",
|
|
53
53
|
...props
|
|
54
54
|
})
|
|
@@ -57,49 +57,49 @@ function CommandInput({ className, ...props }) {
|
|
|
57
57
|
}
|
|
58
58
|
function CommandList({ className, ...props }) {
|
|
59
59
|
return /*#__PURE__*/ jsx(Command.List, {
|
|
60
|
-
className: cn(
|
|
60
|
+
className: cn("max-h-75 overflow-x-hidden overflow-y-auto", className),
|
|
61
61
|
"data-slot": "command-list",
|
|
62
62
|
...props
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
function CommandEmpty({ className, ...props }) {
|
|
66
66
|
return /*#__PURE__*/ jsx(Command.Empty, {
|
|
67
|
-
className: cn(
|
|
67
|
+
className: cn("py-6 text-center text-sm", className),
|
|
68
68
|
"data-slot": "command-empty",
|
|
69
69
|
...props
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
function CommandGroup({ className, ...props }) {
|
|
73
73
|
return /*#__PURE__*/ jsx(Command.Group, {
|
|
74
|
-
className: cn(
|
|
74
|
+
className: cn("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground", className),
|
|
75
75
|
"data-slot": "command-group",
|
|
76
76
|
...props
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
function CommandSeparator({ className, ...props }) {
|
|
80
80
|
return /*#__PURE__*/ jsx(Command.Separator, {
|
|
81
|
-
className: cn(
|
|
81
|
+
className: cn("-mx-1 h-px bg-border", className),
|
|
82
82
|
"data-slot": "command-separator",
|
|
83
83
|
...props
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
86
|
function CommandItem({ className, ...props }) {
|
|
87
87
|
return /*#__PURE__*/ jsx(Command.Item, {
|
|
88
|
-
className: cn("
|
|
88
|
+
className: cn("group/command-item relative flex cursor-default items-center gap-x-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none aria-disabled:opacity-50 aria-selected:bg-accent aria-selected:text-accent-foreground [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground", className),
|
|
89
89
|
"data-slot": "command-item",
|
|
90
90
|
...props
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
93
|
function CommandLoading({ className, ...props }) {
|
|
94
94
|
return /*#__PURE__*/ jsx(Command.Loading, {
|
|
95
|
-
className: cn(
|
|
95
|
+
className: cn("flex justify-center p-2", className),
|
|
96
96
|
"data-slot": "command-loading",
|
|
97
97
|
...props
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
100
|
function CommandShortcut({ className, ...props }) {
|
|
101
101
|
return /*#__PURE__*/ jsx("span", {
|
|
102
|
-
className: cn(
|
|
102
|
+
className: cn("ml-auto text-xs tracking-widest text-muted-foreground", className),
|
|
103
103
|
"data-slot": "command-shortcut",
|
|
104
104
|
...props
|
|
105
105
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
import * as ContextMenuPrimitive from
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
3
3
|
type ContextMenuProps = ComponentProps<typeof ContextMenuPrimitive.Root>;
|
|
4
4
|
declare function ContextMenu({ ...props }: ContextMenuProps): JSX.Element;
|
|
5
5
|
type ContextMenuTriggerProps = ComponentProps<typeof ContextMenuPrimitive.Trigger>;
|
|
@@ -20,7 +20,7 @@ type ContextMenuContentProps = ComponentProps<typeof ContextMenuPrimitive.Conten
|
|
|
20
20
|
declare function ContextMenuContent({ className, ...props }: ContextMenuContentProps): JSX.Element;
|
|
21
21
|
interface ContextMenuItemProps extends ComponentProps<typeof ContextMenuPrimitive.Item> {
|
|
22
22
|
inset?: boolean;
|
|
23
|
-
variant?:
|
|
23
|
+
variant?: "default" | "destructive";
|
|
24
24
|
}
|
|
25
25
|
declare function ContextMenuItem({ className, inset, variant, ...props }: ContextMenuItemProps): JSX.Element;
|
|
26
26
|
type ContextMenuCheckboxItemProps = ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>;
|
|
@@ -33,7 +33,7 @@ interface ContextMenuLabelProps extends ComponentProps<typeof ContextMenuPrimiti
|
|
|
33
33
|
declare function ContextMenuLabel({ className, inset, ...props }: ContextMenuLabelProps): JSX.Element;
|
|
34
34
|
type ContextMenuSeparatorProps = ComponentProps<typeof ContextMenuPrimitive.Separator>;
|
|
35
35
|
declare function ContextMenuSeparator({ className, ...props }: ContextMenuSeparatorProps): JSX.Element;
|
|
36
|
-
type ContextMenuShortcutProps = ComponentProps<
|
|
36
|
+
type ContextMenuShortcutProps = ComponentProps<"span">;
|
|
37
37
|
declare function ContextMenuShortcut({ className, ...props }: ContextMenuShortcutProps): JSX.Element;
|
|
38
38
|
type ContextMenuArrowProps = ComponentProps<typeof ContextMenuPrimitive.Arrow>;
|
|
39
39
|
declare function ContextMenuArrow({ className, ...props }: ContextMenuArrowProps): JSX.Element;
|
|
@@ -35,7 +35,7 @@ function ContextMenuRadioGroup({ ...props }) {
|
|
|
35
35
|
}
|
|
36
36
|
function ContextMenuSubTrigger({ children, className, inset, ...props }) {
|
|
37
37
|
return /*#__PURE__*/ jsxs(SubTrigger, {
|
|
38
|
-
className: cn("
|
|
38
|
+
className: cn("flex cursor-default items-center gap-x-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
39
39
|
"data-inset": inset,
|
|
40
40
|
"data-slot": "context-menu-sub-trigger",
|
|
41
41
|
...props,
|
|
@@ -50,7 +50,7 @@ function ContextMenuSubTrigger({ children, className, inset, ...props }) {
|
|
|
50
50
|
function ContextMenuSubContent({ className, ...props }) {
|
|
51
51
|
return /*#__PURE__*/ jsx(Portal, {
|
|
52
52
|
children: /*#__PURE__*/ jsx(SubContent, {
|
|
53
|
-
className: cn(
|
|
53
|
+
className: cn("z-50 min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-lg border bg-popover p-1 text-popover-foreground shadow-lg ease-ui data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=top]:slide-in-from-bottom-2", className),
|
|
54
54
|
"data-slot": "context-menu-sub-content",
|
|
55
55
|
...props
|
|
56
56
|
})
|
|
@@ -59,7 +59,7 @@ function ContextMenuSubContent({ className, ...props }) {
|
|
|
59
59
|
function ContextMenuContent({ className, ...props }) {
|
|
60
60
|
return /*#__PURE__*/ jsx(Portal, {
|
|
61
61
|
children: /*#__PURE__*/ jsx(Content, {
|
|
62
|
-
className: cn(
|
|
62
|
+
className: cn("z-50 max-h-(--radix-context-menu-content-available-height) min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border bg-popover p-1 text-popover-foreground shadow-lg ease-ui data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=top]:slide-in-from-bottom-2", className),
|
|
63
63
|
"data-slot": "context-menu-content",
|
|
64
64
|
...props
|
|
65
65
|
})
|
|
@@ -67,7 +67,7 @@ function ContextMenuContent({ className, ...props }) {
|
|
|
67
67
|
}
|
|
68
68
|
function ContextMenuItem({ className, inset, variant, ...props }) {
|
|
69
69
|
return /*#__PURE__*/ jsx(Item, {
|
|
70
|
-
className: cn("focus:bg-accent focus:text-accent-foreground
|
|
70
|
+
className: cn("group/context-menu-item relative flex cursor-default items-center gap-x-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground aria-disabled:opacity-50 data-inset:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:[&_svg:not([class*='text-'])]:text-destructive/80", className),
|
|
71
71
|
"data-inset": inset,
|
|
72
72
|
"data-slot": "context-menu-item",
|
|
73
73
|
"data-variant": variant,
|
|
@@ -77,7 +77,7 @@ function ContextMenuItem({ className, inset, variant, ...props }) {
|
|
|
77
77
|
function ContextMenuCheckboxItem({ checked, children, className, ...props }) {
|
|
78
78
|
return /*#__PURE__*/ jsxs(CheckboxItem, {
|
|
79
79
|
checked: checked,
|
|
80
|
-
className: cn("
|
|
80
|
+
className: cn("group/context-menu-item relative flex cursor-default items-center gap-x-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground aria-disabled:opacity-50 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
81
81
|
"data-slot": "context-menu-checkbox-item",
|
|
82
82
|
...props,
|
|
83
83
|
children: [
|
|
@@ -95,7 +95,7 @@ function ContextMenuCheckboxItem({ checked, children, className, ...props }) {
|
|
|
95
95
|
}
|
|
96
96
|
function ContextMenuRadioItem({ children, className, ...props }) {
|
|
97
97
|
return /*#__PURE__*/ jsxs(RadioItem, {
|
|
98
|
-
className: cn("
|
|
98
|
+
className: cn("group/context-menu-item relative flex cursor-default items-center gap-x-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground aria-disabled:opacity-50 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
99
99
|
"data-slot": "context-menu-radio-item",
|
|
100
100
|
...props,
|
|
101
101
|
children: [
|
|
@@ -113,7 +113,7 @@ function ContextMenuRadioItem({ children, className, ...props }) {
|
|
|
113
113
|
}
|
|
114
114
|
function ContextMenuLabel({ className, inset, ...props }) {
|
|
115
115
|
return /*#__PURE__*/ jsx(Label, {
|
|
116
|
-
className: cn(
|
|
116
|
+
className: cn("flex items-center gap-x-2 px-2 py-1.5 text-sm font-semibold data-inset:pl-8", className),
|
|
117
117
|
"data-inset": inset,
|
|
118
118
|
"data-slot": "context-menu-label",
|
|
119
119
|
...props
|
|
@@ -121,21 +121,21 @@ function ContextMenuLabel({ className, inset, ...props }) {
|
|
|
121
121
|
}
|
|
122
122
|
function ContextMenuSeparator({ className, ...props }) {
|
|
123
123
|
return /*#__PURE__*/ jsx(Separator, {
|
|
124
|
-
className: cn(
|
|
124
|
+
className: cn("mx-2 my-1 h-px bg-border", className),
|
|
125
125
|
"data-slot": "context-menu-separator",
|
|
126
126
|
...props
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
129
|
function ContextMenuShortcut({ className, ...props }) {
|
|
130
130
|
return /*#__PURE__*/ jsx("span", {
|
|
131
|
-
className: cn(
|
|
131
|
+
className: cn("ml-auto text-xs tracking-widest text-muted-foreground group-data-[variant=destructive]/context-menu-item:text-destructive/80", className),
|
|
132
132
|
"data-slot": "context-menu-shortcut",
|
|
133
133
|
...props
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
136
|
function ContextMenuArrow({ className, ...props }) {
|
|
137
137
|
return /*#__PURE__*/ jsx(Arrow, {
|
|
138
|
-
className: cn(
|
|
138
|
+
className: cn("fill-popover", className),
|
|
139
139
|
"data-slot": "context-menu-arrow",
|
|
140
140
|
...props
|
|
141
141
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { VariantProps } from
|
|
2
|
-
import type { ComponentProps, JSX } from
|
|
3
|
-
import * as DialogPrimitive from
|
|
4
|
-
import { buttonVariants } from
|
|
1
|
+
import type { VariantProps } from "@codefast/tailwind-variants";
|
|
2
|
+
import type { ComponentProps, JSX } from "react";
|
|
3
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
4
|
+
import { buttonVariants } from "./button";
|
|
5
5
|
type DialogProps = ComponentProps<typeof DialogPrimitive.Root>;
|
|
6
6
|
declare function Dialog({ ...props }: DialogProps): JSX.Element;
|
|
7
7
|
type DialogTriggerProps = ComponentProps<typeof DialogPrimitive.Trigger>;
|
|
@@ -15,19 +15,19 @@ interface DialogContentProps extends ComponentProps<typeof DialogPrimitive.Conte
|
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
declare function DialogContent({ children, className, classNames, ...props }: DialogContentProps): JSX.Element;
|
|
18
|
-
type DialogHeaderProps = ComponentProps<
|
|
18
|
+
type DialogHeaderProps = ComponentProps<"div">;
|
|
19
19
|
declare function DialogHeader({ className, ...props }: DialogHeaderProps): JSX.Element;
|
|
20
|
-
type DialogBodyProps = ComponentProps<
|
|
20
|
+
type DialogBodyProps = ComponentProps<"div">;
|
|
21
21
|
declare function DialogBody({ className, ...props }: DialogBodyProps): JSX.Element;
|
|
22
|
-
type DialogFooterProps = ComponentProps<
|
|
22
|
+
type DialogFooterProps = ComponentProps<"div">;
|
|
23
23
|
declare function DialogFooter({ className, ...props }: DialogFooterProps): JSX.Element;
|
|
24
24
|
type DialogTitleProps = ComponentProps<typeof DialogPrimitive.Title>;
|
|
25
25
|
declare function DialogTitle({ className, ...props }: DialogTitleProps): JSX.Element;
|
|
26
26
|
type DialogDescriptionProps = ComponentProps<typeof DialogPrimitive.Description>;
|
|
27
27
|
declare function DialogDescription({ className, ...props }: DialogDescriptionProps): JSX.Element;
|
|
28
|
-
interface DialogCloseProps extends Omit<ComponentProps<typeof DialogPrimitive.Close>,
|
|
29
|
-
size?: VariantProps<typeof buttonVariants>[
|
|
30
|
-
variant?: VariantProps<typeof buttonVariants>[
|
|
28
|
+
interface DialogCloseProps extends Omit<ComponentProps<typeof DialogPrimitive.Close>, "ref"> {
|
|
29
|
+
size?: VariantProps<typeof buttonVariants>["size"];
|
|
30
|
+
variant?: VariantProps<typeof buttonVariants>["variant"];
|
|
31
31
|
}
|
|
32
32
|
declare function DialogClose({ className, size, variant, ...props }: DialogCloseProps): JSX.Element;
|
|
33
33
|
export { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, };
|