@wealthx/shadcn 0.0.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/.turbo/turbo-build.log +160 -0
  2. package/CHANGELOG.md +13 -0
  3. package/CHANGES.md +345 -0
  4. package/dist/chunk-2WZVSBAY.mjs +232 -0
  5. package/dist/chunk-2Y7YJKPE.mjs +47 -0
  6. package/dist/chunk-3U7SD3MS.mjs +55 -0
  7. package/dist/chunk-3VQNJ235.mjs +114 -0
  8. package/dist/chunk-55CEW76V.mjs +35 -0
  9. package/dist/chunk-6AFMNC42.mjs +146 -0
  10. package/dist/chunk-6OJF6XRN.mjs +117 -0
  11. package/dist/chunk-7LDIMXGM.mjs +181 -0
  12. package/dist/chunk-AMJ23O53.mjs +122 -0
  13. package/dist/chunk-BBJBJSXQ.mjs +44 -0
  14. package/dist/chunk-BGP2N52Z.mjs +126 -0
  15. package/dist/chunk-BMFN37JH.mjs +41 -0
  16. package/dist/chunk-CGOKTPXU.mjs +79 -0
  17. package/dist/chunk-CZ3BW5GL.mjs +81 -0
  18. package/dist/chunk-DBHJ5KC3.mjs +55 -0
  19. package/dist/chunk-DDPA2XXS.mjs +97 -0
  20. package/dist/chunk-DS2AMHN2.mjs +30 -0
  21. package/dist/chunk-E3K6O4FZ.mjs +57 -0
  22. package/dist/chunk-FWCSY2DS.mjs +37 -0
  23. package/dist/chunk-GPRJQ24C.mjs +28 -0
  24. package/dist/chunk-HS7TFG7V.mjs +24 -0
  25. package/dist/chunk-HUVTPUV2.mjs +256 -0
  26. package/dist/chunk-IAOOZCUY.mjs +90 -0
  27. package/dist/chunk-JF4PHPD5.mjs +111 -0
  28. package/dist/chunk-JU2RUWHF.mjs +123 -0
  29. package/dist/chunk-KKHTJNMM.mjs +86 -0
  30. package/dist/chunk-MJIEMGRD.mjs +266 -0
  31. package/dist/chunk-MKFL5MNH.mjs +372 -0
  32. package/dist/chunk-MQ72DIBH.mjs +105 -0
  33. package/dist/chunk-NGYG2EA6.mjs +148 -0
  34. package/dist/chunk-NWZ46DJL.mjs +213 -0
  35. package/dist/chunk-OXQQNQZI.mjs +75 -0
  36. package/dist/chunk-PMKODV6M.mjs +161 -0
  37. package/dist/chunk-QOJ2DQD6.mjs +57 -0
  38. package/dist/chunk-RL772EH7.mjs +126 -0
  39. package/dist/chunk-SLWCCURD.mjs +99 -0
  40. package/dist/chunk-V7CNWJT3.mjs +10 -0
  41. package/dist/chunk-VG6UF6UT.mjs +68 -0
  42. package/dist/chunk-VYMHBV6D.mjs +123 -0
  43. package/dist/chunk-VZ2NR7L3.mjs +195 -0
  44. package/dist/chunk-YN5SYTOO.mjs +117 -0
  45. package/dist/chunk-Z3MK2KKZ.mjs +83 -0
  46. package/dist/chunk-ZN2QKLF6.mjs +187 -0
  47. package/dist/chunk-ZZV5JVNW.mjs +34 -0
  48. package/dist/components/ui/accordion.js +142 -0
  49. package/dist/components/ui/accordion.mjs +14 -0
  50. package/dist/components/ui/alert-dialog.js +413 -0
  51. package/dist/components/ui/alert-dialog.mjs +34 -0
  52. package/dist/components/ui/alert.js +134 -0
  53. package/dist/components/ui/alert.mjs +12 -0
  54. package/dist/components/ui/avatar.js +173 -0
  55. package/dist/components/ui/avatar.mjs +18 -0
  56. package/dist/components/ui/badge.js +163 -0
  57. package/dist/components/ui/badge.mjs +11 -0
  58. package/dist/components/ui/button.js +198 -0
  59. package/dist/components/ui/button.mjs +11 -0
  60. package/dist/components/ui/calendar.js +408 -0
  61. package/dist/components/ui/calendar.mjs +12 -0
  62. package/dist/components/ui/card.js +156 -0
  63. package/dist/components/ui/card.mjs +20 -0
  64. package/dist/components/ui/checkbox.js +166 -0
  65. package/dist/components/ui/checkbox.mjs +11 -0
  66. package/dist/components/ui/chip.js +199 -0
  67. package/dist/components/ui/chip.mjs +10 -0
  68. package/dist/components/ui/data-table.js +925 -0
  69. package/dist/components/ui/data-table.mjs +29 -0
  70. package/dist/components/ui/date-picker.js +561 -0
  71. package/dist/components/ui/date-picker.mjs +15 -0
  72. package/dist/components/ui/dialog.js +378 -0
  73. package/dist/components/ui/dialog.mjs +30 -0
  74. package/dist/components/ui/drawer.js +213 -0
  75. package/dist/components/ui/drawer.mjs +28 -0
  76. package/dist/components/ui/dropdown-menu.js +338 -0
  77. package/dist/components/ui/dropdown-menu.mjs +38 -0
  78. package/dist/components/ui/empty.js +173 -0
  79. package/dist/components/ui/empty.mjs +18 -0
  80. package/dist/components/ui/field.js +359 -0
  81. package/dist/components/ui/field.mjs +28 -0
  82. package/dist/components/ui/input-group.js +406 -0
  83. package/dist/components/ui/input-group.mjs +22 -0
  84. package/dist/components/ui/input-otp.js +149 -0
  85. package/dist/components/ui/input-otp.mjs +14 -0
  86. package/dist/components/ui/input.js +81 -0
  87. package/dist/components/ui/input.mjs +8 -0
  88. package/dist/components/ui/label.js +85 -0
  89. package/dist/components/ui/label.mjs +8 -0
  90. package/dist/components/ui/pagination.js +333 -0
  91. package/dist/components/ui/pagination.mjs +22 -0
  92. package/dist/components/ui/popover.js +167 -0
  93. package/dist/components/ui/popover.mjs +22 -0
  94. package/dist/components/ui/progress.js +97 -0
  95. package/dist/components/ui/progress.mjs +8 -0
  96. package/dist/components/ui/radio-group.js +178 -0
  97. package/dist/components/ui/radio-group.mjs +12 -0
  98. package/dist/components/ui/select.js +262 -0
  99. package/dist/components/ui/select.mjs +28 -0
  100. package/dist/components/ui/separator.js +86 -0
  101. package/dist/components/ui/separator.mjs +8 -0
  102. package/dist/components/ui/sheet.js +227 -0
  103. package/dist/components/ui/sheet.mjs +26 -0
  104. package/dist/components/ui/skeleton.js +75 -0
  105. package/dist/components/ui/skeleton.mjs +8 -0
  106. package/dist/components/ui/sonner.js +86 -0
  107. package/dist/components/ui/sonner.mjs +7 -0
  108. package/dist/components/ui/spinner.js +93 -0
  109. package/dist/components/ui/spinner.mjs +10 -0
  110. package/dist/components/ui/switch.js +178 -0
  111. package/dist/components/ui/switch.mjs +11 -0
  112. package/dist/components/ui/table.js +184 -0
  113. package/dist/components/ui/table.mjs +22 -0
  114. package/dist/components/ui/tabs.js +181 -0
  115. package/dist/components/ui/tabs.mjs +16 -0
  116. package/dist/components/ui/textarea.js +79 -0
  117. package/dist/components/ui/textarea.mjs +8 -0
  118. package/dist/components/ui/toggle-group.js +184 -0
  119. package/dist/components/ui/toggle-group.mjs +12 -0
  120. package/dist/components/ui/toggle.js +108 -0
  121. package/dist/components/ui/toggle.mjs +11 -0
  122. package/dist/components/ui/tooltip.js +140 -0
  123. package/dist/components/ui/tooltip.mjs +16 -0
  124. package/dist/index.js +4409 -0
  125. package/dist/index.mjs +462 -0
  126. package/dist/lib/colors.js +84 -0
  127. package/dist/lib/colors.mjs +13 -0
  128. package/dist/lib/theme-provider.js +150 -0
  129. package/dist/lib/theme-provider.mjs +13 -0
  130. package/dist/lib/typography.js +157 -0
  131. package/dist/lib/typography.mjs +25 -0
  132. package/dist/lib/utils.js +34 -0
  133. package/dist/lib/utils.mjs +7 -0
  134. package/dist/styles.css +2 -0
  135. package/package.json +228 -11
  136. package/scripts/build-css.ts +15 -9
  137. package/src/components/index.tsx +443 -0
  138. package/src/components/ui/accordion.tsx +99 -0
  139. package/src/components/ui/alert-dialog.tsx +239 -0
  140. package/src/components/ui/alert.tsx +81 -0
  141. package/src/components/ui/avatar.tsx +130 -0
  142. package/src/components/ui/badge.tsx +57 -0
  143. package/src/components/ui/button.tsx +69 -37
  144. package/src/components/ui/calendar.tsx +252 -0
  145. package/src/components/ui/card.tsx +106 -0
  146. package/src/components/ui/checkbox.tsx +111 -0
  147. package/src/components/ui/chip.tsx +65 -0
  148. package/src/components/ui/data-table.tsx +490 -0
  149. package/src/components/ui/date-picker.tsx +133 -0
  150. package/src/components/ui/dialog.tsx +195 -0
  151. package/src/components/ui/drawer.tsx +169 -0
  152. package/src/components/ui/dropdown-menu.tsx +315 -0
  153. package/src/components/ui/empty.tsx +128 -0
  154. package/src/components/ui/field.tsx +273 -0
  155. package/src/components/ui/input-group.tsx +190 -0
  156. package/src/components/ui/input-otp.tsx +90 -0
  157. package/src/components/ui/input.tsx +28 -0
  158. package/src/components/ui/label.tsx +24 -0
  159. package/src/components/ui/pagination.tsx +148 -0
  160. package/src/components/ui/popover.tsx +112 -0
  161. package/src/components/ui/progress.tsx +40 -0
  162. package/src/components/ui/radio-group.tsx +129 -0
  163. package/src/components/ui/select.tsx +201 -0
  164. package/src/components/ui/separator.tsx +26 -0
  165. package/src/components/ui/sheet.tsx +182 -0
  166. package/src/components/ui/skeleton.tsx +22 -0
  167. package/src/components/ui/sonner.tsx +48 -0
  168. package/src/components/ui/spinner.tsx +41 -0
  169. package/src/components/ui/switch.tsx +126 -0
  170. package/src/components/ui/table.tsx +143 -0
  171. package/src/components/ui/tabs.tsx +119 -0
  172. package/src/components/ui/textarea.tsx +28 -0
  173. package/src/components/ui/toggle-group.tsx +94 -0
  174. package/src/components/ui/toggle.tsx +59 -0
  175. package/src/components/ui/tooltip.tsx +80 -0
  176. package/src/index.ts +15 -3
  177. package/src/lib/colors.ts +74 -0
  178. package/src/lib/slot.tsx +68 -0
  179. package/src/lib/theme-provider.tsx +134 -0
  180. package/src/lib/typography.ts +153 -0
  181. package/src/lib/utils.ts +1 -1
  182. package/src/styles/globals.css +377 -107
  183. package/src/styles/styles-css.ts +1 -1
  184. package/tsup.config.ts +48 -2
  185. package/src/provider/ShadcnProvider.tsx +0 -89
  186. package/src/provider/index.ts +0 -2
@@ -0,0 +1,359 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
10
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
+ var __spreadValues = (a, b) => {
12
+ for (var prop in b || (b = {}))
13
+ if (__hasOwnProp.call(b, prop))
14
+ __defNormalProp(a, prop, b[prop]);
15
+ if (__getOwnPropSymbols)
16
+ for (var prop of __getOwnPropSymbols(b)) {
17
+ if (__propIsEnum.call(b, prop))
18
+ __defNormalProp(a, prop, b[prop]);
19
+ }
20
+ return a;
21
+ };
22
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
23
+ var __objRest = (source, exclude) => {
24
+ var target = {};
25
+ for (var prop in source)
26
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
27
+ target[prop] = source[prop];
28
+ if (source != null && __getOwnPropSymbols)
29
+ for (var prop of __getOwnPropSymbols(source)) {
30
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
31
+ target[prop] = source[prop];
32
+ }
33
+ return target;
34
+ };
35
+ var __export = (target, all) => {
36
+ for (var name in all)
37
+ __defProp(target, name, { get: all[name], enumerable: true });
38
+ };
39
+ var __copyProps = (to, from, except, desc) => {
40
+ if (from && typeof from === "object" || typeof from === "function") {
41
+ for (let key of __getOwnPropNames(from))
42
+ if (!__hasOwnProp.call(to, key) && key !== except)
43
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
44
+ }
45
+ return to;
46
+ };
47
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
48
+
49
+ // src/components/ui/field.tsx
50
+ var field_exports = {};
51
+ __export(field_exports, {
52
+ Field: () => Field,
53
+ FieldContent: () => FieldContent,
54
+ FieldDescription: () => FieldDescription,
55
+ FieldError: () => FieldError,
56
+ FieldGroup: () => FieldGroup,
57
+ FieldLabel: () => FieldLabel,
58
+ FieldLegend: () => FieldLegend,
59
+ FieldSeparator: () => FieldSeparator,
60
+ FieldSet: () => FieldSet,
61
+ FieldTitle: () => FieldTitle
62
+ });
63
+ module.exports = __toCommonJS(field_exports);
64
+ var import_react = require("react");
65
+ var import_class_variance_authority = require("class-variance-authority");
66
+
67
+ // src/lib/utils.ts
68
+ var import_clsx = require("clsx");
69
+ var import_tailwind_merge = require("tailwind-merge");
70
+ function cn(...inputs) {
71
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
72
+ }
73
+
74
+ // src/components/ui/label.tsx
75
+ var import_jsx_runtime = (
76
+ // eslint-disable-next-line jsx-a11y/label-has-associated-control -- htmlFor is passed by the consumer
77
+ require("react/jsx-runtime")
78
+ );
79
+ function Label(_a) {
80
+ var _b = _a, {
81
+ className
82
+ } = _b, props = __objRest(_b, [
83
+ "className"
84
+ ]);
85
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
86
+ "label",
87
+ __spreadValues({
88
+ className: cn(
89
+ "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
90
+ className
91
+ ),
92
+ "data-slot": "label"
93
+ }, props)
94
+ );
95
+ }
96
+
97
+ // src/components/ui/separator.tsx
98
+ var import_separator = require("@base-ui/react/separator");
99
+ var import_jsx_runtime2 = require("react/jsx-runtime");
100
+ function Separator(_a) {
101
+ var _b = _a, {
102
+ className,
103
+ orientation = "horizontal"
104
+ } = _b, props = __objRest(_b, [
105
+ "className",
106
+ "orientation"
107
+ ]);
108
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
109
+ import_separator.Separator,
110
+ __spreadValues({
111
+ className: cn(
112
+ "shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
113
+ className
114
+ ),
115
+ "data-orientation": orientation,
116
+ "data-slot": "separator"
117
+ }, props)
118
+ );
119
+ }
120
+
121
+ // src/components/ui/field.tsx
122
+ var import_jsx_runtime3 = require("react/jsx-runtime");
123
+ function FieldSet(_a) {
124
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
125
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
126
+ "fieldset",
127
+ __spreadValues({
128
+ className: cn(
129
+ "flex flex-col gap-6",
130
+ "has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",
131
+ className
132
+ ),
133
+ "data-slot": "field-set"
134
+ }, props)
135
+ );
136
+ }
137
+ function FieldLegend(_a) {
138
+ var _b = _a, {
139
+ className,
140
+ variant = "legend"
141
+ } = _b, props = __objRest(_b, [
142
+ "className",
143
+ "variant"
144
+ ]);
145
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
146
+ "legend",
147
+ __spreadValues({
148
+ className: cn(
149
+ "mb-3 font-medium",
150
+ "data-[variant=legend]:text-base",
151
+ "data-[variant=label]:text-sm",
152
+ className
153
+ ),
154
+ "data-slot": "field-legend",
155
+ "data-variant": variant
156
+ }, props)
157
+ );
158
+ }
159
+ function FieldGroup(_a) {
160
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
161
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
162
+ "div",
163
+ __spreadValues({
164
+ className: cn(
165
+ "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",
166
+ className
167
+ ),
168
+ "data-slot": "field-group"
169
+ }, props)
170
+ );
171
+ }
172
+ var fieldVariants = (0, import_class_variance_authority.cva)(
173
+ "group/field flex w-full gap-3 data-[invalid=true]:text-destructive",
174
+ {
175
+ variants: {
176
+ orientation: {
177
+ vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
178
+ horizontal: [
179
+ "flex-row items-center",
180
+ "[&>[data-slot=field-label]]:flex-auto",
181
+ "has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
182
+ ],
183
+ responsive: [
184
+ "flex-col @md/field-group:flex-row @md/field-group:items-center [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto",
185
+ "@md/field-group:[&>[data-slot=field-label]]:flex-auto",
186
+ "@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
187
+ ]
188
+ }
189
+ },
190
+ defaultVariants: {
191
+ orientation: "vertical"
192
+ }
193
+ }
194
+ );
195
+ function Field(_a) {
196
+ var _b = _a, {
197
+ className,
198
+ orientation = "vertical"
199
+ } = _b, props = __objRest(_b, [
200
+ "className",
201
+ "orientation"
202
+ ]);
203
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
204
+ "div",
205
+ __spreadValues({
206
+ className: cn(fieldVariants({ orientation }), className),
207
+ "data-orientation": orientation,
208
+ "data-slot": "field",
209
+ role: "group"
210
+ }, props)
211
+ );
212
+ }
213
+ function FieldContent(_a) {
214
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
215
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
216
+ "div",
217
+ __spreadValues({
218
+ className: cn(
219
+ "group/field-content flex flex-1 flex-col gap-1.5 leading-snug",
220
+ className
221
+ ),
222
+ "data-slot": "field-content"
223
+ }, props)
224
+ );
225
+ }
226
+ function FieldLabel(_a) {
227
+ var _b = _a, {
228
+ className
229
+ } = _b, props = __objRest(_b, [
230
+ "className"
231
+ ]);
232
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
233
+ Label,
234
+ __spreadValues({
235
+ className: cn(
236
+ "group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50",
237
+ "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4",
238
+ "has-data-checked:border-primary has-data-checked:bg-primary/5 dark:has-data-checked:bg-primary/10",
239
+ className
240
+ ),
241
+ "data-slot": "field-label"
242
+ }, props)
243
+ );
244
+ }
245
+ function FieldTitle(_a) {
246
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
247
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
248
+ "div",
249
+ __spreadValues({
250
+ className: cn(
251
+ "flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50",
252
+ className
253
+ ),
254
+ "data-slot": "field-label"
255
+ }, props)
256
+ );
257
+ }
258
+ function FieldDescription(_a) {
259
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
260
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
261
+ "p",
262
+ __spreadValues({
263
+ className: cn(
264
+ "text-xs leading-normal font-normal text-muted-foreground group-has-[[data-orientation=horizontal]]/field:text-balance",
265
+ "last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5",
266
+ "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",
267
+ className
268
+ ),
269
+ "data-slot": "field-description"
270
+ }, props)
271
+ );
272
+ }
273
+ function FieldSeparator(_a) {
274
+ var _b = _a, {
275
+ children,
276
+ className
277
+ } = _b, props = __objRest(_b, [
278
+ "children",
279
+ "className"
280
+ ]);
281
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
282
+ "div",
283
+ __spreadProps(__spreadValues({
284
+ className: cn(
285
+ "relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",
286
+ className
287
+ ),
288
+ "data-content": Boolean(children),
289
+ "data-slot": "field-separator"
290
+ }, props), {
291
+ children: [
292
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Separator, { className: "absolute inset-0 top-1/2" }),
293
+ children ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
294
+ "span",
295
+ {
296
+ className: "relative mx-auto block w-fit bg-background px-2 text-muted-foreground",
297
+ "data-slot": "field-separator-content",
298
+ children
299
+ }
300
+ ) : null
301
+ ]
302
+ })
303
+ );
304
+ }
305
+ function FieldError(_a) {
306
+ var _b = _a, {
307
+ className,
308
+ children,
309
+ errors
310
+ } = _b, props = __objRest(_b, [
311
+ "className",
312
+ "children",
313
+ "errors"
314
+ ]);
315
+ const content = (0, import_react.useMemo)(() => {
316
+ var _a2;
317
+ if (children) {
318
+ return children;
319
+ }
320
+ if (!(errors == null ? void 0 : errors.length)) {
321
+ return null;
322
+ }
323
+ const uniqueErrors = Array.from(
324
+ new Map(errors.map((error) => [error == null ? void 0 : error.message, error])).values()
325
+ );
326
+ if (uniqueErrors.length === 1) {
327
+ return (_a2 = uniqueErrors[0]) == null ? void 0 : _a2.message;
328
+ }
329
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: uniqueErrors.map(
330
+ (error) => (error == null ? void 0 : error.message) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("li", { children: error.message }, error.message)
331
+ ) });
332
+ }, [children, errors]);
333
+ if (!content) {
334
+ return null;
335
+ }
336
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
337
+ "div",
338
+ __spreadProps(__spreadValues({
339
+ className: cn("text-xs font-normal text-destructive", className),
340
+ "data-slot": "field-error",
341
+ role: "alert"
342
+ }, props), {
343
+ children: content
344
+ })
345
+ );
346
+ }
347
+ // Annotate the CommonJS export names for ESM import in node:
348
+ 0 && (module.exports = {
349
+ Field,
350
+ FieldContent,
351
+ FieldDescription,
352
+ FieldError,
353
+ FieldGroup,
354
+ FieldLabel,
355
+ FieldLegend,
356
+ FieldSeparator,
357
+ FieldSet,
358
+ FieldTitle
359
+ });
@@ -0,0 +1,28 @@
1
+ import {
2
+ Field,
3
+ FieldContent,
4
+ FieldDescription,
5
+ FieldError,
6
+ FieldGroup,
7
+ FieldLabel,
8
+ FieldLegend,
9
+ FieldSeparator,
10
+ FieldSet,
11
+ FieldTitle
12
+ } from "../../chunk-HUVTPUV2.mjs";
13
+ import "../../chunk-ZZV5JVNW.mjs";
14
+ import "../../chunk-55CEW76V.mjs";
15
+ import "../../chunk-V7CNWJT3.mjs";
16
+ import "../../chunk-FWCSY2DS.mjs";
17
+ export {
18
+ Field,
19
+ FieldContent,
20
+ FieldDescription,
21
+ FieldError,
22
+ FieldGroup,
23
+ FieldLabel,
24
+ FieldLegend,
25
+ FieldSeparator,
26
+ FieldSet,
27
+ FieldTitle
28
+ };