@wealthx/shadcn 0.0.2 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +135 -11
- package/CHANGELOG.md +12 -0
- package/CHANGES.md +345 -0
- package/README.md +128 -0
- package/dist/chunk-2WZVSBAY.mjs +232 -0
- package/dist/chunk-2Y7YJKPE.mjs +47 -0
- package/dist/chunk-3U7SD3MS.mjs +55 -0
- package/dist/chunk-3VQNJ235.mjs +114 -0
- package/dist/chunk-55CEW76V.mjs +35 -0
- package/dist/chunk-6AFMNC42.mjs +146 -0
- package/dist/chunk-6OJF6XRN.mjs +117 -0
- package/dist/chunk-7LDIMXGM.mjs +181 -0
- package/dist/chunk-AMJ23O53.mjs +122 -0
- package/dist/chunk-BBJBJSXQ.mjs +44 -0
- package/dist/chunk-BGP2N52Z.mjs +126 -0
- package/dist/chunk-BMFN37JH.mjs +41 -0
- package/dist/chunk-CGOKTPXU.mjs +79 -0
- package/dist/chunk-CZ3BW5GL.mjs +81 -0
- package/dist/chunk-DBHJ5KC3.mjs +55 -0
- package/dist/chunk-DDPA2XXS.mjs +97 -0
- package/dist/chunk-DS2AMHN2.mjs +30 -0
- package/dist/chunk-E3K6O4FZ.mjs +57 -0
- package/dist/chunk-FWCSY2DS.mjs +37 -0
- package/dist/chunk-GPRJQ24C.mjs +28 -0
- package/dist/chunk-HS7TFG7V.mjs +24 -0
- package/dist/chunk-HUVTPUV2.mjs +256 -0
- package/dist/chunk-IAOOZCUY.mjs +90 -0
- package/dist/chunk-JF4PHPD5.mjs +111 -0
- package/dist/chunk-JU2RUWHF.mjs +123 -0
- package/dist/chunk-KKHTJNMM.mjs +86 -0
- package/dist/chunk-MJIEMGRD.mjs +266 -0
- package/dist/chunk-MKFL5MNH.mjs +372 -0
- package/dist/chunk-MQ72DIBH.mjs +105 -0
- package/dist/chunk-NGYG2EA6.mjs +148 -0
- package/dist/chunk-NWZ46DJL.mjs +213 -0
- package/dist/chunk-OXQQNQZI.mjs +75 -0
- package/dist/chunk-PMKODV6M.mjs +161 -0
- package/dist/chunk-QOJ2DQD6.mjs +57 -0
- package/dist/chunk-RL772EH7.mjs +126 -0
- package/dist/chunk-SLWCCURD.mjs +99 -0
- package/dist/chunk-V7CNWJT3.mjs +10 -0
- package/dist/chunk-VG6UF6UT.mjs +68 -0
- package/dist/chunk-VYMHBV6D.mjs +123 -0
- package/dist/chunk-VZ2NR7L3.mjs +195 -0
- package/dist/chunk-YN5SYTOO.mjs +117 -0
- package/dist/chunk-Z3MK2KKZ.mjs +83 -0
- package/dist/chunk-ZN2QKLF6.mjs +187 -0
- package/dist/chunk-ZZV5JVNW.mjs +34 -0
- package/dist/components/ui/accordion.js +142 -0
- package/dist/components/ui/accordion.mjs +14 -0
- package/dist/components/ui/alert-dialog.js +413 -0
- package/dist/components/ui/alert-dialog.mjs +34 -0
- package/dist/components/ui/alert.js +134 -0
- package/dist/components/ui/alert.mjs +12 -0
- package/dist/components/ui/avatar.js +173 -0
- package/dist/components/ui/avatar.mjs +18 -0
- package/dist/components/ui/badge.js +163 -0
- package/dist/components/ui/badge.mjs +11 -0
- package/dist/components/ui/button.js +198 -0
- package/dist/components/ui/button.mjs +11 -0
- package/dist/components/ui/calendar.js +408 -0
- package/dist/components/ui/calendar.mjs +12 -0
- package/dist/components/ui/card.js +156 -0
- package/dist/components/ui/card.mjs +20 -0
- package/dist/components/ui/checkbox.js +166 -0
- package/dist/components/ui/checkbox.mjs +11 -0
- package/dist/components/ui/chip.js +199 -0
- package/dist/components/ui/chip.mjs +10 -0
- package/dist/components/ui/data-table.js +925 -0
- package/dist/components/ui/data-table.mjs +29 -0
- package/dist/components/ui/date-picker.js +561 -0
- package/dist/components/ui/date-picker.mjs +15 -0
- package/dist/components/ui/dialog.js +378 -0
- package/dist/components/ui/dialog.mjs +30 -0
- package/dist/components/ui/drawer.js +213 -0
- package/dist/components/ui/drawer.mjs +28 -0
- package/dist/components/ui/dropdown-menu.js +338 -0
- package/dist/components/ui/dropdown-menu.mjs +38 -0
- package/dist/components/ui/empty.js +173 -0
- package/dist/components/ui/empty.mjs +18 -0
- package/dist/components/ui/field.js +359 -0
- package/dist/components/ui/field.mjs +28 -0
- package/dist/components/ui/input-group.js +406 -0
- package/dist/components/ui/input-group.mjs +22 -0
- package/dist/components/ui/input-otp.js +149 -0
- package/dist/components/ui/input-otp.mjs +14 -0
- package/dist/components/ui/input.js +81 -0
- package/dist/components/ui/input.mjs +8 -0
- package/dist/components/ui/label.js +85 -0
- package/dist/components/ui/label.mjs +8 -0
- package/dist/components/ui/pagination.js +333 -0
- package/dist/components/ui/pagination.mjs +22 -0
- package/dist/components/ui/popover.js +167 -0
- package/dist/components/ui/popover.mjs +22 -0
- package/dist/components/ui/progress.js +97 -0
- package/dist/components/ui/progress.mjs +8 -0
- package/dist/components/ui/radio-group.js +178 -0
- package/dist/components/ui/radio-group.mjs +12 -0
- package/dist/components/ui/select.js +262 -0
- package/dist/components/ui/select.mjs +28 -0
- package/dist/components/ui/separator.js +86 -0
- package/dist/components/ui/separator.mjs +8 -0
- package/dist/components/ui/sheet.js +227 -0
- package/dist/components/ui/sheet.mjs +26 -0
- package/dist/components/ui/skeleton.js +75 -0
- package/dist/components/ui/skeleton.mjs +8 -0
- package/dist/components/ui/sonner.js +86 -0
- package/dist/components/ui/sonner.mjs +7 -0
- package/dist/components/ui/spinner.js +93 -0
- package/dist/components/ui/spinner.mjs +10 -0
- package/dist/components/ui/switch.js +178 -0
- package/dist/components/ui/switch.mjs +11 -0
- package/dist/components/ui/table.js +184 -0
- package/dist/components/ui/table.mjs +22 -0
- package/dist/components/ui/tabs.js +181 -0
- package/dist/components/ui/tabs.mjs +16 -0
- package/dist/components/ui/textarea.js +79 -0
- package/dist/components/ui/textarea.mjs +8 -0
- package/dist/components/ui/toggle-group.js +184 -0
- package/dist/components/ui/toggle-group.mjs +12 -0
- package/dist/components/ui/toggle.js +108 -0
- package/dist/components/ui/toggle.mjs +11 -0
- package/dist/components/ui/tooltip.js +140 -0
- package/dist/components/ui/tooltip.mjs +16 -0
- package/dist/index.js +4312 -90
- package/dist/index.mjs +459 -158
- package/dist/lib/colors.js +84 -0
- package/dist/lib/colors.mjs +13 -0
- package/dist/lib/theme-provider.js +150 -0
- package/dist/lib/theme-provider.mjs +13 -0
- package/dist/lib/typography.js +157 -0
- package/dist/lib/typography.mjs +25 -0
- package/dist/lib/utils.js +34 -0
- package/dist/lib/utils.mjs +7 -0
- package/dist/styles.css +1 -1
- package/package.json +228 -11
- package/scripts/build-css.ts +15 -9
- package/src/components/index.tsx +443 -0
- package/src/components/ui/accordion.tsx +99 -0
- package/src/components/ui/alert-dialog.tsx +239 -0
- package/src/components/ui/alert.tsx +81 -0
- package/src/components/ui/avatar.tsx +130 -0
- package/src/components/ui/badge.tsx +57 -0
- package/src/components/ui/button.tsx +69 -37
- package/src/components/ui/calendar.tsx +252 -0
- package/src/components/ui/card.tsx +106 -0
- package/src/components/ui/checkbox.tsx +111 -0
- package/src/components/ui/chip.tsx +65 -0
- package/src/components/ui/data-table.tsx +490 -0
- package/src/components/ui/date-picker.tsx +133 -0
- package/src/components/ui/dialog.tsx +195 -0
- package/src/components/ui/drawer.tsx +169 -0
- package/src/components/ui/dropdown-menu.tsx +315 -0
- package/src/components/ui/empty.tsx +128 -0
- package/src/components/ui/field.tsx +273 -0
- package/src/components/ui/input-group.tsx +190 -0
- package/src/components/ui/input-otp.tsx +90 -0
- package/src/components/ui/input.tsx +28 -0
- package/src/components/ui/label.tsx +24 -0
- package/src/components/ui/pagination.tsx +148 -0
- package/src/components/ui/popover.tsx +112 -0
- package/src/components/ui/progress.tsx +40 -0
- package/src/components/ui/radio-group.tsx +129 -0
- package/src/components/ui/select.tsx +201 -0
- package/src/components/ui/separator.tsx +26 -0
- package/src/components/ui/sheet.tsx +182 -0
- package/src/components/ui/skeleton.tsx +22 -0
- package/src/components/ui/sonner.tsx +48 -0
- package/src/components/ui/spinner.tsx +41 -0
- package/src/components/ui/switch.tsx +126 -0
- package/src/components/ui/table.tsx +143 -0
- package/src/components/ui/tabs.tsx +119 -0
- package/src/components/ui/textarea.tsx +28 -0
- package/src/components/ui/toggle-group.tsx +94 -0
- package/src/components/ui/toggle.tsx +59 -0
- package/src/components/ui/tooltip.tsx +80 -0
- package/src/index.ts +15 -3
- package/src/lib/colors.ts +74 -0
- package/src/lib/slot.tsx +68 -0
- package/src/lib/theme-provider.tsx +134 -0
- package/src/lib/typography.ts +153 -0
- package/src/lib/utils.ts +1 -1
- package/src/styles/globals.css +377 -107
- package/src/styles/styles-css.ts +1 -1
- package/tsup.config.ts +48 -2
- package/dist/index.d.mts +0 -27
- package/dist/index.d.ts +0 -27
- package/src/provider/ShadcnProvider.tsx +0 -89
- package/src/provider/index.ts +0 -2
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Label
|
|
3
|
+
} from "./chunk-ZZV5JVNW.mjs";
|
|
4
|
+
import {
|
|
5
|
+
Separator
|
|
6
|
+
} from "./chunk-55CEW76V.mjs";
|
|
7
|
+
import {
|
|
8
|
+
cn
|
|
9
|
+
} from "./chunk-V7CNWJT3.mjs";
|
|
10
|
+
import {
|
|
11
|
+
__objRest,
|
|
12
|
+
__spreadProps,
|
|
13
|
+
__spreadValues
|
|
14
|
+
} from "./chunk-FWCSY2DS.mjs";
|
|
15
|
+
|
|
16
|
+
// src/components/ui/field.tsx
|
|
17
|
+
import { useMemo } from "react";
|
|
18
|
+
import { cva } from "class-variance-authority";
|
|
19
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
20
|
+
function FieldSet(_a) {
|
|
21
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
22
|
+
return /* @__PURE__ */ jsx(
|
|
23
|
+
"fieldset",
|
|
24
|
+
__spreadValues({
|
|
25
|
+
className: cn(
|
|
26
|
+
"flex flex-col gap-6",
|
|
27
|
+
"has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",
|
|
28
|
+
className
|
|
29
|
+
),
|
|
30
|
+
"data-slot": "field-set"
|
|
31
|
+
}, props)
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
function FieldLegend(_a) {
|
|
35
|
+
var _b = _a, {
|
|
36
|
+
className,
|
|
37
|
+
variant = "legend"
|
|
38
|
+
} = _b, props = __objRest(_b, [
|
|
39
|
+
"className",
|
|
40
|
+
"variant"
|
|
41
|
+
]);
|
|
42
|
+
return /* @__PURE__ */ jsx(
|
|
43
|
+
"legend",
|
|
44
|
+
__spreadValues({
|
|
45
|
+
className: cn(
|
|
46
|
+
"mb-3 font-medium",
|
|
47
|
+
"data-[variant=legend]:text-base",
|
|
48
|
+
"data-[variant=label]:text-sm",
|
|
49
|
+
className
|
|
50
|
+
),
|
|
51
|
+
"data-slot": "field-legend",
|
|
52
|
+
"data-variant": variant
|
|
53
|
+
}, props)
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
function FieldGroup(_a) {
|
|
57
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
58
|
+
return /* @__PURE__ */ jsx(
|
|
59
|
+
"div",
|
|
60
|
+
__spreadValues({
|
|
61
|
+
className: cn(
|
|
62
|
+
"group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4",
|
|
63
|
+
className
|
|
64
|
+
),
|
|
65
|
+
"data-slot": "field-group"
|
|
66
|
+
}, props)
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
var fieldVariants = cva(
|
|
70
|
+
"group/field flex w-full gap-3 data-[invalid=true]:text-destructive",
|
|
71
|
+
{
|
|
72
|
+
variants: {
|
|
73
|
+
orientation: {
|
|
74
|
+
vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
|
|
75
|
+
horizontal: [
|
|
76
|
+
"flex-row items-center",
|
|
77
|
+
"[&>[data-slot=field-label]]:flex-auto",
|
|
78
|
+
"has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
79
|
+
],
|
|
80
|
+
responsive: [
|
|
81
|
+
"flex-col @md/field-group:flex-row @md/field-group:items-center [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto",
|
|
82
|
+
"@md/field-group:[&>[data-slot=field-label]]:flex-auto",
|
|
83
|
+
"@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
defaultVariants: {
|
|
88
|
+
orientation: "vertical"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
function Field(_a) {
|
|
93
|
+
var _b = _a, {
|
|
94
|
+
className,
|
|
95
|
+
orientation = "vertical"
|
|
96
|
+
} = _b, props = __objRest(_b, [
|
|
97
|
+
"className",
|
|
98
|
+
"orientation"
|
|
99
|
+
]);
|
|
100
|
+
return /* @__PURE__ */ jsx(
|
|
101
|
+
"div",
|
|
102
|
+
__spreadValues({
|
|
103
|
+
className: cn(fieldVariants({ orientation }), className),
|
|
104
|
+
"data-orientation": orientation,
|
|
105
|
+
"data-slot": "field",
|
|
106
|
+
role: "group"
|
|
107
|
+
}, props)
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
function FieldContent(_a) {
|
|
111
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
112
|
+
return /* @__PURE__ */ jsx(
|
|
113
|
+
"div",
|
|
114
|
+
__spreadValues({
|
|
115
|
+
className: cn(
|
|
116
|
+
"group/field-content flex flex-1 flex-col gap-1.5 leading-snug",
|
|
117
|
+
className
|
|
118
|
+
),
|
|
119
|
+
"data-slot": "field-content"
|
|
120
|
+
}, props)
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
function FieldLabel(_a) {
|
|
124
|
+
var _b = _a, {
|
|
125
|
+
className
|
|
126
|
+
} = _b, props = __objRest(_b, [
|
|
127
|
+
"className"
|
|
128
|
+
]);
|
|
129
|
+
return /* @__PURE__ */ jsx(
|
|
130
|
+
Label,
|
|
131
|
+
__spreadValues({
|
|
132
|
+
className: cn(
|
|
133
|
+
"group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50",
|
|
134
|
+
"has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4",
|
|
135
|
+
"has-data-checked:border-primary has-data-checked:bg-primary/5 dark:has-data-checked:bg-primary/10",
|
|
136
|
+
className
|
|
137
|
+
),
|
|
138
|
+
"data-slot": "field-label"
|
|
139
|
+
}, props)
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
function FieldTitle(_a) {
|
|
143
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
144
|
+
return /* @__PURE__ */ jsx(
|
|
145
|
+
"div",
|
|
146
|
+
__spreadValues({
|
|
147
|
+
className: cn(
|
|
148
|
+
"flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50",
|
|
149
|
+
className
|
|
150
|
+
),
|
|
151
|
+
"data-slot": "field-label"
|
|
152
|
+
}, props)
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
function FieldDescription(_a) {
|
|
156
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
157
|
+
return /* @__PURE__ */ jsx(
|
|
158
|
+
"p",
|
|
159
|
+
__spreadValues({
|
|
160
|
+
className: cn(
|
|
161
|
+
"text-xs leading-normal font-normal text-muted-foreground group-has-[[data-orientation=horizontal]]/field:text-balance",
|
|
162
|
+
"last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5",
|
|
163
|
+
"[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",
|
|
164
|
+
className
|
|
165
|
+
),
|
|
166
|
+
"data-slot": "field-description"
|
|
167
|
+
}, props)
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
function FieldSeparator(_a) {
|
|
171
|
+
var _b = _a, {
|
|
172
|
+
children,
|
|
173
|
+
className
|
|
174
|
+
} = _b, props = __objRest(_b, [
|
|
175
|
+
"children",
|
|
176
|
+
"className"
|
|
177
|
+
]);
|
|
178
|
+
return /* @__PURE__ */ jsxs(
|
|
179
|
+
"div",
|
|
180
|
+
__spreadProps(__spreadValues({
|
|
181
|
+
className: cn(
|
|
182
|
+
"relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",
|
|
183
|
+
className
|
|
184
|
+
),
|
|
185
|
+
"data-content": Boolean(children),
|
|
186
|
+
"data-slot": "field-separator"
|
|
187
|
+
}, props), {
|
|
188
|
+
children: [
|
|
189
|
+
/* @__PURE__ */ jsx(Separator, { className: "absolute inset-0 top-1/2" }),
|
|
190
|
+
children ? /* @__PURE__ */ jsx(
|
|
191
|
+
"span",
|
|
192
|
+
{
|
|
193
|
+
className: "relative mx-auto block w-fit bg-background px-2 text-muted-foreground",
|
|
194
|
+
"data-slot": "field-separator-content",
|
|
195
|
+
children
|
|
196
|
+
}
|
|
197
|
+
) : null
|
|
198
|
+
]
|
|
199
|
+
})
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
function FieldError(_a) {
|
|
203
|
+
var _b = _a, {
|
|
204
|
+
className,
|
|
205
|
+
children,
|
|
206
|
+
errors
|
|
207
|
+
} = _b, props = __objRest(_b, [
|
|
208
|
+
"className",
|
|
209
|
+
"children",
|
|
210
|
+
"errors"
|
|
211
|
+
]);
|
|
212
|
+
const content = useMemo(() => {
|
|
213
|
+
var _a2;
|
|
214
|
+
if (children) {
|
|
215
|
+
return children;
|
|
216
|
+
}
|
|
217
|
+
if (!(errors == null ? void 0 : errors.length)) {
|
|
218
|
+
return null;
|
|
219
|
+
}
|
|
220
|
+
const uniqueErrors = Array.from(
|
|
221
|
+
new Map(errors.map((error) => [error == null ? void 0 : error.message, error])).values()
|
|
222
|
+
);
|
|
223
|
+
if (uniqueErrors.length === 1) {
|
|
224
|
+
return (_a2 = uniqueErrors[0]) == null ? void 0 : _a2.message;
|
|
225
|
+
}
|
|
226
|
+
return /* @__PURE__ */ jsx("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: uniqueErrors.map(
|
|
227
|
+
(error) => (error == null ? void 0 : error.message) && /* @__PURE__ */ jsx("li", { children: error.message }, error.message)
|
|
228
|
+
) });
|
|
229
|
+
}, [children, errors]);
|
|
230
|
+
if (!content) {
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
return /* @__PURE__ */ jsx(
|
|
234
|
+
"div",
|
|
235
|
+
__spreadProps(__spreadValues({
|
|
236
|
+
className: cn("text-xs font-normal text-destructive", className),
|
|
237
|
+
"data-slot": "field-error",
|
|
238
|
+
role: "alert"
|
|
239
|
+
}, props), {
|
|
240
|
+
children: content
|
|
241
|
+
})
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export {
|
|
246
|
+
FieldSet,
|
|
247
|
+
FieldLegend,
|
|
248
|
+
FieldGroup,
|
|
249
|
+
Field,
|
|
250
|
+
FieldContent,
|
|
251
|
+
FieldLabel,
|
|
252
|
+
FieldTitle,
|
|
253
|
+
FieldDescription,
|
|
254
|
+
FieldSeparator,
|
|
255
|
+
FieldError
|
|
256
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Slot
|
|
3
|
+
} from "./chunk-DBHJ5KC3.mjs";
|
|
4
|
+
import {
|
|
5
|
+
cn
|
|
6
|
+
} from "./chunk-V7CNWJT3.mjs";
|
|
7
|
+
import {
|
|
8
|
+
__objRest,
|
|
9
|
+
__spreadProps,
|
|
10
|
+
__spreadValues
|
|
11
|
+
} from "./chunk-FWCSY2DS.mjs";
|
|
12
|
+
|
|
13
|
+
// src/components/ui/button.tsx
|
|
14
|
+
import { forwardRef } from "react";
|
|
15
|
+
import { cva } from "class-variance-authority";
|
|
16
|
+
import { Loader2 } from "lucide-react";
|
|
17
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
var buttonVariants = cva(
|
|
19
|
+
"inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 font-sans text-sm font-medium whitespace-nowrap transition-all active:scale-[0.98] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
20
|
+
{
|
|
21
|
+
variants: {
|
|
22
|
+
variant: {
|
|
23
|
+
default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
|
|
24
|
+
secondary: "bg-brand-secondary text-brand-secondary-foreground shadow-xs hover:bg-brand-secondary/80 focus-visible:ring-brand-secondary/30",
|
|
25
|
+
destructive: "bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",
|
|
26
|
+
outline: "border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
27
|
+
"outline-primary": "border border-primary text-foreground bg-transparent shadow-xs hover:bg-primary/5 focus-visible:ring-primary/50",
|
|
28
|
+
"outline-secondary": "border border-brand-secondary text-brand-secondary bg-transparent shadow-xs hover:bg-brand-secondary/10 focus-visible:ring-brand-secondary/30",
|
|
29
|
+
ghost: "hover:bg-accent hover:text-accent-foreground hover:shadow-xs dark:hover:bg-accent/50",
|
|
30
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
31
|
+
},
|
|
32
|
+
size: {
|
|
33
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
34
|
+
xs: "h-6 gap-1 px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
35
|
+
sm: "h-8 gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
36
|
+
lg: "h-10 px-6 has-[>svg]:px-4",
|
|
37
|
+
icon: "size-9",
|
|
38
|
+
"icon-xs": "size-6 [&_svg:not([class*='size-'])]:size-3",
|
|
39
|
+
"icon-sm": "size-8",
|
|
40
|
+
"icon-lg": "size-10"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
defaultVariants: {
|
|
44
|
+
variant: "default",
|
|
45
|
+
size: "default"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
var Button = forwardRef(function Button2(_a, ref) {
|
|
50
|
+
var _b = _a, {
|
|
51
|
+
className,
|
|
52
|
+
variant,
|
|
53
|
+
size,
|
|
54
|
+
asChild = false,
|
|
55
|
+
loading = false,
|
|
56
|
+
disabled,
|
|
57
|
+
children
|
|
58
|
+
} = _b, props = __objRest(_b, [
|
|
59
|
+
"className",
|
|
60
|
+
"variant",
|
|
61
|
+
"size",
|
|
62
|
+
"asChild",
|
|
63
|
+
"loading",
|
|
64
|
+
"disabled",
|
|
65
|
+
"children"
|
|
66
|
+
]);
|
|
67
|
+
const Comp = asChild ? Slot : "button";
|
|
68
|
+
const isIconOnly = size === "icon" || size === "icon-xs" || size === "icon-sm" || size === "icon-lg";
|
|
69
|
+
return /* @__PURE__ */ jsx(
|
|
70
|
+
Comp,
|
|
71
|
+
__spreadProps(__spreadValues({
|
|
72
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
73
|
+
"data-size": size,
|
|
74
|
+
"data-slot": "button",
|
|
75
|
+
"data-variant": variant,
|
|
76
|
+
disabled: loading || disabled,
|
|
77
|
+
ref
|
|
78
|
+
}, props), {
|
|
79
|
+
children: loading ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
80
|
+
/* @__PURE__ */ jsx(Loader2, { "aria-hidden": "true", className: "animate-spin" }),
|
|
81
|
+
!isIconOnly && children
|
|
82
|
+
] }) : children
|
|
83
|
+
})
|
|
84
|
+
);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
export {
|
|
88
|
+
buttonVariants,
|
|
89
|
+
Button
|
|
90
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-V7CNWJT3.mjs";
|
|
4
|
+
import {
|
|
5
|
+
__objRest,
|
|
6
|
+
__spreadProps,
|
|
7
|
+
__spreadValues
|
|
8
|
+
} from "./chunk-FWCSY2DS.mjs";
|
|
9
|
+
|
|
10
|
+
// src/components/ui/checkbox.tsx
|
|
11
|
+
import { useState } from "react";
|
|
12
|
+
import { CheckIcon, MinusIcon } from "lucide-react";
|
|
13
|
+
import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox";
|
|
14
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
function Checkbox(_a) {
|
|
16
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
17
|
+
return /* @__PURE__ */ jsx(
|
|
18
|
+
CheckboxPrimitive.Root,
|
|
19
|
+
__spreadProps(__spreadValues({
|
|
20
|
+
className: cn(
|
|
21
|
+
"peer group inline-flex size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-all outline-none",
|
|
22
|
+
"focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
23
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
24
|
+
"aria-invalid:border-destructive aria-invalid:ring-destructive/20",
|
|
25
|
+
"data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground",
|
|
26
|
+
"data-indeterminate:border-primary data-indeterminate:bg-primary data-indeterminate:text-primary-foreground",
|
|
27
|
+
// Dark mode (upstream shadcn)
|
|
28
|
+
"dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-checked:bg-primary",
|
|
29
|
+
// Stacked (2 attr selectors) → wins over single-attr rules above
|
|
30
|
+
"aria-invalid:data-checked:border-destructive aria-invalid:data-checked:bg-destructive aria-invalid:data-checked:text-destructive-foreground",
|
|
31
|
+
"aria-invalid:data-indeterminate:border-destructive aria-invalid:data-indeterminate:bg-destructive aria-invalid:data-indeterminate:text-destructive-foreground",
|
|
32
|
+
className
|
|
33
|
+
),
|
|
34
|
+
"data-slot": "checkbox"
|
|
35
|
+
}, props), {
|
|
36
|
+
children: /* @__PURE__ */ jsxs(
|
|
37
|
+
CheckboxPrimitive.Indicator,
|
|
38
|
+
{
|
|
39
|
+
className: "grid place-content-center text-current transition-none",
|
|
40
|
+
"data-slot": "checkbox-indicator",
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ jsx(CheckIcon, { className: "size-3.5 group-data-indeterminate:hidden" }),
|
|
43
|
+
/* @__PURE__ */ jsx(MinusIcon, { className: "size-3.5 hidden group-data-indeterminate:block" })
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
})
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
function CheckboxCard(_a) {
|
|
51
|
+
var _b = _a, {
|
|
52
|
+
className,
|
|
53
|
+
checked,
|
|
54
|
+
defaultChecked,
|
|
55
|
+
onCheckedChange,
|
|
56
|
+
disabled,
|
|
57
|
+
error,
|
|
58
|
+
label,
|
|
59
|
+
description
|
|
60
|
+
} = _b, props = __objRest(_b, [
|
|
61
|
+
"className",
|
|
62
|
+
"checked",
|
|
63
|
+
"defaultChecked",
|
|
64
|
+
"onCheckedChange",
|
|
65
|
+
"disabled",
|
|
66
|
+
"error",
|
|
67
|
+
"label",
|
|
68
|
+
"description"
|
|
69
|
+
]);
|
|
70
|
+
const [internalChecked, setInternalChecked] = useState(
|
|
71
|
+
Boolean(defaultChecked)
|
|
72
|
+
);
|
|
73
|
+
const resolvedChecked = checked != null ? checked : internalChecked;
|
|
74
|
+
const isTinted = resolvedChecked;
|
|
75
|
+
return /* @__PURE__ */ jsxs(
|
|
76
|
+
"label",
|
|
77
|
+
{
|
|
78
|
+
className: cn(
|
|
79
|
+
"flex items-start gap-3 border border-border p-4 font-sans transition-colors cursor-pointer",
|
|
80
|
+
error ? ["border-destructive", isTinted && "bg-destructive/5"] : isTinted && "border-primary bg-primary/5",
|
|
81
|
+
disabled && "cursor-not-allowed opacity-50",
|
|
82
|
+
className
|
|
83
|
+
),
|
|
84
|
+
"data-slot": "checkbox-card",
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ jsx(
|
|
87
|
+
Checkbox,
|
|
88
|
+
__spreadValues({
|
|
89
|
+
"aria-invalid": error || void 0,
|
|
90
|
+
checked: resolvedChecked,
|
|
91
|
+
className: "mt-0.5",
|
|
92
|
+
disabled,
|
|
93
|
+
onCheckedChange: (value, event) => {
|
|
94
|
+
setInternalChecked(value);
|
|
95
|
+
onCheckedChange == null ? void 0 : onCheckedChange(value, event);
|
|
96
|
+
}
|
|
97
|
+
}, props)
|
|
98
|
+
),
|
|
99
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
100
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium leading-none", children: label }),
|
|
101
|
+
description ? /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: description }) : null
|
|
102
|
+
] })
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export {
|
|
109
|
+
Checkbox,
|
|
110
|
+
CheckboxCard
|
|
111
|
+
};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-V7CNWJT3.mjs";
|
|
4
|
+
import {
|
|
5
|
+
__objRest,
|
|
6
|
+
__spreadProps,
|
|
7
|
+
__spreadValues
|
|
8
|
+
} from "./chunk-FWCSY2DS.mjs";
|
|
9
|
+
|
|
10
|
+
// src/components/ui/radio-group.tsx
|
|
11
|
+
import { CircleIcon } from "lucide-react";
|
|
12
|
+
import { RadioGroup as RadioGroupPrimitive } from "@base-ui/react/radio-group";
|
|
13
|
+
import { Radio as RadioPrimitive } from "@base-ui/react/radio";
|
|
14
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
var CIRCLE_BASE = "inline-flex items-center justify-center aspect-square size-4 shrink-0 rounded-full border border-primary bg-background";
|
|
16
|
+
var INDICATOR_DOT = "size-2 fill-background text-background";
|
|
17
|
+
function RadioGroup(_a) {
|
|
18
|
+
var _b = _a, {
|
|
19
|
+
className
|
|
20
|
+
} = _b, props = __objRest(_b, [
|
|
21
|
+
"className"
|
|
22
|
+
]);
|
|
23
|
+
return /* @__PURE__ */ jsx(
|
|
24
|
+
RadioGroupPrimitive,
|
|
25
|
+
__spreadValues({
|
|
26
|
+
className: cn("grid gap-3", className),
|
|
27
|
+
"data-slot": "radio-group"
|
|
28
|
+
}, props)
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
function RadioGroupItem(_a) {
|
|
32
|
+
var _b = _a, {
|
|
33
|
+
className
|
|
34
|
+
} = _b, props = __objRest(_b, [
|
|
35
|
+
"className"
|
|
36
|
+
]);
|
|
37
|
+
return /* @__PURE__ */ jsx(
|
|
38
|
+
RadioPrimitive.Root,
|
|
39
|
+
__spreadProps(__spreadValues({
|
|
40
|
+
className: cn(
|
|
41
|
+
CIRCLE_BASE,
|
|
42
|
+
"transition-all outline-none",
|
|
43
|
+
"focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
44
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
45
|
+
"data-checked:bg-primary",
|
|
46
|
+
"aria-invalid:border-destructive aria-invalid:ring-destructive/20",
|
|
47
|
+
"aria-invalid:data-checked:border-destructive aria-invalid:data-checked:bg-destructive",
|
|
48
|
+
"dark:bg-input/30 dark:aria-invalid:ring-destructive/40",
|
|
49
|
+
className
|
|
50
|
+
),
|
|
51
|
+
"data-slot": "radio-group-item"
|
|
52
|
+
}, props), {
|
|
53
|
+
children: /* @__PURE__ */ jsx(
|
|
54
|
+
RadioPrimitive.Indicator,
|
|
55
|
+
{
|
|
56
|
+
"data-slot": "radio-group-indicator",
|
|
57
|
+
children: /* @__PURE__ */ jsx(CircleIcon, { className: INDICATOR_DOT })
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
})
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
function RadioGroupCard(_a) {
|
|
64
|
+
var _b = _a, {
|
|
65
|
+
className,
|
|
66
|
+
value,
|
|
67
|
+
disabled,
|
|
68
|
+
error,
|
|
69
|
+
label,
|
|
70
|
+
description
|
|
71
|
+
} = _b, props = __objRest(_b, [
|
|
72
|
+
"className",
|
|
73
|
+
"value",
|
|
74
|
+
"disabled",
|
|
75
|
+
"error",
|
|
76
|
+
"label",
|
|
77
|
+
"description"
|
|
78
|
+
]);
|
|
79
|
+
return /* @__PURE__ */ jsxs(
|
|
80
|
+
RadioPrimitive.Root,
|
|
81
|
+
__spreadProps(__spreadValues({
|
|
82
|
+
"aria-invalid": error || void 0,
|
|
83
|
+
className: cn(
|
|
84
|
+
"group/card flex items-center gap-3 border border-border p-4 font-sans transition-colors text-left cursor-pointer outline-none",
|
|
85
|
+
"focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
86
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
87
|
+
"data-checked:border-primary data-checked:bg-primary/5",
|
|
88
|
+
"aria-invalid:border-destructive",
|
|
89
|
+
"aria-invalid:data-checked:border-destructive aria-invalid:data-checked:bg-destructive/5",
|
|
90
|
+
className
|
|
91
|
+
),
|
|
92
|
+
"data-slot": "radio-group-card",
|
|
93
|
+
disabled,
|
|
94
|
+
value
|
|
95
|
+
}, props), {
|
|
96
|
+
children: [
|
|
97
|
+
/* @__PURE__ */ jsx(
|
|
98
|
+
"div",
|
|
99
|
+
{
|
|
100
|
+
className: cn(
|
|
101
|
+
CIRCLE_BASE,
|
|
102
|
+
"transition-colors",
|
|
103
|
+
"group-data-[checked]/card:bg-primary",
|
|
104
|
+
"group-aria-invalid/card:border-destructive",
|
|
105
|
+
"group-aria-invalid/card:group-data-[checked]/card:border-destructive group-aria-invalid/card:group-data-[checked]/card:bg-destructive"
|
|
106
|
+
),
|
|
107
|
+
children: /* @__PURE__ */ jsx(RadioPrimitive.Indicator, { children: /* @__PURE__ */ jsx(CircleIcon, { className: INDICATOR_DOT }) })
|
|
108
|
+
}
|
|
109
|
+
),
|
|
110
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
111
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium leading-none", children: label }),
|
|
112
|
+
description ? /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: description }) : null
|
|
113
|
+
] })
|
|
114
|
+
]
|
|
115
|
+
})
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export {
|
|
120
|
+
RadioGroup,
|
|
121
|
+
RadioGroupItem,
|
|
122
|
+
RadioGroupCard
|
|
123
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-V7CNWJT3.mjs";
|
|
4
|
+
import {
|
|
5
|
+
__objRest,
|
|
6
|
+
__spreadProps,
|
|
7
|
+
__spreadValues
|
|
8
|
+
} from "./chunk-FWCSY2DS.mjs";
|
|
9
|
+
|
|
10
|
+
// src/components/ui/accordion.tsx
|
|
11
|
+
import { ChevronDownIcon } from "lucide-react";
|
|
12
|
+
import { Accordion as AccordionPrimitive } from "@base-ui/react/accordion";
|
|
13
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
function Accordion(props) {
|
|
15
|
+
return /* @__PURE__ */ jsx(AccordionPrimitive.Root, __spreadValues({ "data-slot": "accordion" }, props));
|
|
16
|
+
}
|
|
17
|
+
function AccordionItem(_a) {
|
|
18
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
19
|
+
return /* @__PURE__ */ jsx(
|
|
20
|
+
AccordionPrimitive.Item,
|
|
21
|
+
__spreadValues({
|
|
22
|
+
className: cn("border-b", className),
|
|
23
|
+
"data-slot": "accordion-item"
|
|
24
|
+
}, props)
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
function AccordionTrigger(_a) {
|
|
28
|
+
var _b = _a, {
|
|
29
|
+
className,
|
|
30
|
+
children
|
|
31
|
+
} = _b, props = __objRest(_b, [
|
|
32
|
+
"className",
|
|
33
|
+
"children"
|
|
34
|
+
]);
|
|
35
|
+
return /* @__PURE__ */ jsx(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ jsxs(
|
|
36
|
+
AccordionPrimitive.Trigger,
|
|
37
|
+
__spreadProps(__spreadValues({
|
|
38
|
+
className: cn(
|
|
39
|
+
// layout
|
|
40
|
+
"flex flex-1 items-center justify-between gap-4 py-4 text-left",
|
|
41
|
+
// typography
|
|
42
|
+
"text-sm font-medium",
|
|
43
|
+
// base
|
|
44
|
+
"rounded-none outline-none transition-[color,opacity]",
|
|
45
|
+
// interactive states
|
|
46
|
+
"hover:underline",
|
|
47
|
+
"focus-visible:ring-2 focus-visible:ring-foreground/30",
|
|
48
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
49
|
+
// chevron rotation when open
|
|
50
|
+
"[&[data-panel-open]>svg]:rotate-180",
|
|
51
|
+
className
|
|
52
|
+
),
|
|
53
|
+
"data-slot": "accordion-trigger"
|
|
54
|
+
}, props), {
|
|
55
|
+
children: [
|
|
56
|
+
children,
|
|
57
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, { className: "pointer-events-none size-4 shrink-0 text-muted-foreground transition-transform duration-200" })
|
|
58
|
+
]
|
|
59
|
+
})
|
|
60
|
+
) });
|
|
61
|
+
}
|
|
62
|
+
function AccordionContent(_a) {
|
|
63
|
+
var _b = _a, {
|
|
64
|
+
className,
|
|
65
|
+
children
|
|
66
|
+
} = _b, props = __objRest(_b, [
|
|
67
|
+
"className",
|
|
68
|
+
"children"
|
|
69
|
+
]);
|
|
70
|
+
return /* @__PURE__ */ jsx(
|
|
71
|
+
AccordionPrimitive.Panel,
|
|
72
|
+
__spreadProps(__spreadValues({
|
|
73
|
+
className: "overflow-hidden text-sm h-(--accordion-panel-height) transition-[height] duration-200 ease-out data-starting-style:h-0 data-ending-style:h-0",
|
|
74
|
+
"data-slot": "accordion-content"
|
|
75
|
+
}, props), {
|
|
76
|
+
children: /* @__PURE__ */ jsx("div", { className: cn("pb-4 text-muted-foreground", className), children })
|
|
77
|
+
})
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export {
|
|
82
|
+
Accordion,
|
|
83
|
+
AccordionItem,
|
|
84
|
+
AccordionTrigger,
|
|
85
|
+
AccordionContent
|
|
86
|
+
};
|