@caffeinebounce/ui 0.62.3 → 0.63.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/blog.js +7 -6
- package/dist/blog.mjs +2 -1
- package/dist/charts.d.cts +1 -1
- package/dist/charts.d.ts +1 -1
- package/dist/{chunk-6DVWMJ3H.mjs → chunk-2EFVMX6V.mjs} +3 -3
- package/dist/{chunk-6ZJCK6KH.js → chunk-375DECW4.js} +31 -31
- package/dist/{chunk-PZRI43EZ.js → chunk-46JYKBRX.js} +0 -43
- package/dist/chunk-5D55OVD5.js +75 -0
- package/dist/{chunk-JORVSG52.js → chunk-663CFAHS.js} +211 -269
- package/dist/chunk-6HKJDV43.mjs +48 -0
- package/dist/chunk-6NCRGHV3.mjs +64 -0
- package/dist/{chunk-OLAAXLXY.mjs → chunk-6QAKQG57.mjs} +4 -4
- package/dist/{chunk-N6AFNFZR.mjs → chunk-7ERVZXIN.mjs} +214 -270
- package/dist/chunk-APFEP5B7.mjs +100 -0
- package/dist/chunk-C3OADNSG.js +348 -0
- package/dist/{chunk-GIJQE3JR.js → chunk-DH5Z3ETN.js} +66 -45
- package/dist/chunk-DYWZ23QT.mjs +90 -0
- package/dist/{chunk-DTVWRRFN.mjs → chunk-E67IR6HU.mjs} +30 -9
- package/dist/{chunk-OVNLC5RD.mjs → chunk-EXQSWHLD.mjs} +6 -6
- package/dist/{chunk-ZOA7B32D.js → chunk-F35KL6TX.js} +9 -9
- package/dist/{chunk-YSLD2HLP.mjs → chunk-FFJC66KO.mjs} +1 -1
- package/dist/{chunk-MPZFPU4X.js → chunk-GMBLPQ3I.js} +3 -3
- package/dist/chunk-IJFPPLQW.js +50 -0
- package/dist/{chunk-BMFQG6RA.mjs → chunk-KJIX6V32.mjs} +107 -1885
- package/dist/chunk-LABHD4PU.js +109 -0
- package/dist/{chunk-GAIQJCAZ.js → chunk-LT5VD4KR.js} +149 -1953
- package/dist/{chunk-7DHKQODW.mjs → chunk-LTLCIRZY.mjs} +256 -474
- package/dist/chunk-N5BHXWR3.mjs +34 -0
- package/dist/chunk-OCO3Z5YA.js +37 -0
- package/dist/chunk-OIJ7XMDV.mjs +71 -0
- package/dist/chunk-ORBH4IBC.mjs +316 -0
- package/dist/chunk-OWWOAYIY.js +2652 -0
- package/dist/chunk-PFHOXDSW.mjs +10 -0
- package/dist/chunk-QRS7DJGS.js +103 -0
- package/dist/{chunk-NXPEJ2UR.mjs → chunk-R3X4B4JJ.mjs} +53 -6
- package/dist/chunk-RM7ACPTM.mjs +2601 -0
- package/dist/chunk-RODSGPBB.mjs +75 -0
- package/dist/{chunk-T6ZBA6VJ.js → chunk-UHAV34YX.js} +8 -8
- package/dist/{chunk-GUSTCU2W.mjs → chunk-ULANYJ7Y.mjs} +1 -59
- package/dist/chunk-ULDE7QSN.js +70 -0
- package/dist/chunk-UT36VNVZ.mjs +47 -0
- package/dist/chunk-UY3H4PKB.js +71 -0
- package/dist/{chunk-KB7UXIQZ.mjs → chunk-VIVWFQG5.mjs} +2 -1
- package/dist/{chunk-ESZ7CBA2.js → chunk-VKBJ3SGT.js} +6 -5
- package/dist/{chunk-UM7WMXIU.js → chunk-W3YOQ5ZD.js} +264 -505
- package/dist/{chunk-GHOFYK2E.js → chunk-XGJL6DLV.js} +55 -5
- package/dist/chunk-YRIBFIQ5.js +116 -0
- package/dist/chunk-ZWWJ3RRA.js +15 -0
- package/dist/data-grid.d.cts +241 -0
- package/dist/data-grid.d.ts +241 -0
- package/dist/data-grid.js +6486 -0
- package/dist/data-grid.mjs +6459 -0
- package/dist/data-table-CDQBo-Ve.d.ts +818 -0
- package/dist/data-table-jLzt6plY.d.cts +818 -0
- package/dist/data-table.d.cts +8 -42
- package/dist/data-table.d.ts +8 -42
- package/dist/data-table.js +61 -187
- package/dist/data-table.mjs +11 -5
- package/dist/finance.d.cts +534 -0
- package/dist/finance.d.ts +534 -0
- package/dist/finance.js +188 -0
- package/dist/finance.mjs +15 -0
- package/dist/forms.js +9 -6
- package/dist/forms.mjs +7 -4
- package/dist/{hooks-B2jU1GVT.d.ts → hooks-A55E0fgf.d.ts} +3 -2
- package/dist/{hooks-8ORd7T1A.d.cts → hooks-Bys_AZPI.d.cts} +3 -2
- package/dist/hooks.d.cts +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/hooks.js +26 -23
- package/dist/hooks.mjs +6 -3
- package/dist/index.d.cts +536 -665
- package/dist/index.d.ts +536 -665
- package/dist/index.js +3829 -3408
- package/dist/index.mjs +2067 -1767
- package/dist/layouts.js +25 -25
- package/dist/layouts.mjs +4 -4
- package/dist/marketing.js +74 -74
- package/dist/marketing.mjs +4 -4
- package/dist/navigation.js +28 -28
- package/dist/navigation.mjs +6 -6
- package/dist/primitives.d.cts +72 -109
- package/dist/primitives.d.ts +72 -109
- package/dist/primitives.js +78 -72
- package/dist/primitives.mjs +8 -6
- package/dist/settings.js +9 -9
- package/dist/settings.mjs +4 -4
- package/package.json +17 -1
- package/dist/UnifiedTableControls-CG299y9h.d.ts +0 -1233
- package/dist/UnifiedTableControls-CIjRpNhy.d.cts +0 -1233
- package/dist/chunk-GMBGWOCR.mjs +0 -49
- package/dist/chunk-HBLKVQIQ.mjs +0 -23
- package/dist/chunk-HMAMMC72.js +0 -26
- package/dist/chunk-MVYRNJA6.js +0 -75
- /package/dist/{chunk-RVEFPVZF.mjs → chunk-C57MX3BG.mjs} +0 -0
- /package/dist/{chunk-C4UT5V3P.js → chunk-OWHI5VGJ.js} +0 -0
|
@@ -2,26 +2,13 @@
|
|
|
2
2
|
import { Label } from './chunk-KHCC5UKW.mjs';
|
|
3
3
|
import { Separator } from './chunk-ZKUIUE7W.mjs';
|
|
4
4
|
import { cn } from './chunk-IMKLN273.mjs';
|
|
5
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
5
|
import { OTPInput, OTPInputContext } from 'input-otp';
|
|
7
|
-
import { EyeOffIcon, EyeIcon, MinusIcon,
|
|
6
|
+
import { EyeOffIcon, EyeIcon, MinusIcon, CheckCircle2Icon, InfoIcon } from 'lucide-react';
|
|
8
7
|
import * as React2 from 'react';
|
|
9
|
-
import {
|
|
8
|
+
import { useState, useRef, useEffect, useMemo } from 'react';
|
|
9
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
10
10
|
import { cva } from 'class-variance-authority';
|
|
11
11
|
|
|
12
|
-
function Textarea({ className, ...props }) {
|
|
13
|
-
return /* @__PURE__ */ jsx(
|
|
14
|
-
"textarea",
|
|
15
|
-
{
|
|
16
|
-
"data-slot": "textarea",
|
|
17
|
-
className: cn(
|
|
18
|
-
"border-input placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex min-h-16 w-full min-w-0 max-w-full rounded-box border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm break-words [overflow-wrap:anywhere]",
|
|
19
|
-
className
|
|
20
|
-
),
|
|
21
|
-
...props
|
|
22
|
-
}
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
12
|
function InputOTP({
|
|
26
13
|
className,
|
|
27
14
|
containerClassName,
|
|
@@ -79,259 +66,6 @@ function InputOTPSlot({
|
|
|
79
66
|
function InputOTPSeparator({ ...props }) {
|
|
80
67
|
return /* @__PURE__ */ jsx("div", { "data-slot": "input-otp-separator", "aria-hidden": "true", ...props, children: /* @__PURE__ */ jsx(MinusIcon, { className: "h-4 w-4 text-muted-foreground" }) });
|
|
81
68
|
}
|
|
82
|
-
function Checkbox({
|
|
83
|
-
className,
|
|
84
|
-
checked,
|
|
85
|
-
onCheckedChange,
|
|
86
|
-
disabled,
|
|
87
|
-
...props
|
|
88
|
-
}) {
|
|
89
|
-
return /* @__PURE__ */ jsx(
|
|
90
|
-
"label",
|
|
91
|
-
{
|
|
92
|
-
className: cn(
|
|
93
|
-
"inline-flex items-center",
|
|
94
|
-
disabled && "opacity-50 cursor-not-allowed"
|
|
95
|
-
),
|
|
96
|
-
children: /* @__PURE__ */ jsxs("span", { className: "relative", children: [
|
|
97
|
-
/* @__PURE__ */ jsx(
|
|
98
|
-
"input",
|
|
99
|
-
{
|
|
100
|
-
type: "checkbox",
|
|
101
|
-
checked,
|
|
102
|
-
disabled,
|
|
103
|
-
onChange: (e) => onCheckedChange?.(e.target.checked),
|
|
104
|
-
className: "peer sr-only",
|
|
105
|
-
...props
|
|
106
|
-
}
|
|
107
|
-
),
|
|
108
|
-
/* @__PURE__ */ jsx(
|
|
109
|
-
"span",
|
|
110
|
-
{
|
|
111
|
-
"data-slot": "checkbox",
|
|
112
|
-
className: cn(
|
|
113
|
-
"border-input bg-background peer-focus-visible:ring-ring/50 peer-focus-visible:ring-[3px] flex size-4 shrink-0 items-center justify-center rounded-sm border shadow-xs transition-colors",
|
|
114
|
-
"peer-checked:bg-primary peer-checked:border-primary peer-checked:text-primary-foreground",
|
|
115
|
-
"peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
116
|
-
className
|
|
117
|
-
),
|
|
118
|
-
children: checked && /* @__PURE__ */ jsx(CheckIcon, { className: "size-3.5 stroke-3" })
|
|
119
|
-
}
|
|
120
|
-
)
|
|
121
|
-
] })
|
|
122
|
-
}
|
|
123
|
-
);
|
|
124
|
-
}
|
|
125
|
-
function FieldSet({ className, ...props }) {
|
|
126
|
-
return /* @__PURE__ */ jsx(
|
|
127
|
-
"fieldset",
|
|
128
|
-
{
|
|
129
|
-
"data-slot": "field-set",
|
|
130
|
-
className: cn(
|
|
131
|
-
"flex flex-col gap-6",
|
|
132
|
-
"has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",
|
|
133
|
-
className
|
|
134
|
-
),
|
|
135
|
-
...props
|
|
136
|
-
}
|
|
137
|
-
);
|
|
138
|
-
}
|
|
139
|
-
function FieldLegend({
|
|
140
|
-
className,
|
|
141
|
-
variant = "legend",
|
|
142
|
-
...props
|
|
143
|
-
}) {
|
|
144
|
-
return /* @__PURE__ */ jsx(
|
|
145
|
-
"legend",
|
|
146
|
-
{
|
|
147
|
-
"data-slot": "field-legend",
|
|
148
|
-
"data-variant": variant,
|
|
149
|
-
className: cn(
|
|
150
|
-
"mb-3 font-medium",
|
|
151
|
-
"data-[variant=legend]:text-base",
|
|
152
|
-
"data-[variant=label]:text-sm",
|
|
153
|
-
className
|
|
154
|
-
),
|
|
155
|
-
...props
|
|
156
|
-
}
|
|
157
|
-
);
|
|
158
|
-
}
|
|
159
|
-
function FieldGroup({ className, ...props }) {
|
|
160
|
-
return /* @__PURE__ */ jsx(
|
|
161
|
-
"div",
|
|
162
|
-
{
|
|
163
|
-
"data-slot": "field-group",
|
|
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
|
-
...props
|
|
169
|
-
}
|
|
170
|
-
);
|
|
171
|
-
}
|
|
172
|
-
var fieldVariants = 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 [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]: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({
|
|
196
|
-
className,
|
|
197
|
-
orientation = "vertical",
|
|
198
|
-
...props
|
|
199
|
-
}) {
|
|
200
|
-
return /* @__PURE__ */ jsx(
|
|
201
|
-
"fieldset",
|
|
202
|
-
{
|
|
203
|
-
"data-slot": "field",
|
|
204
|
-
"data-orientation": orientation,
|
|
205
|
-
className: cn(fieldVariants({ orientation }), className),
|
|
206
|
-
...props
|
|
207
|
-
}
|
|
208
|
-
);
|
|
209
|
-
}
|
|
210
|
-
function FieldContent({ className, ...props }) {
|
|
211
|
-
return /* @__PURE__ */ jsx(
|
|
212
|
-
"div",
|
|
213
|
-
{
|
|
214
|
-
"data-slot": "field-content",
|
|
215
|
-
className: cn(
|
|
216
|
-
"group/field-content flex flex-1 flex-col gap-1.5 leading-snug",
|
|
217
|
-
className
|
|
218
|
-
),
|
|
219
|
-
...props
|
|
220
|
-
}
|
|
221
|
-
);
|
|
222
|
-
}
|
|
223
|
-
function FieldLabel({
|
|
224
|
-
className,
|
|
225
|
-
...props
|
|
226
|
-
}) {
|
|
227
|
-
return /* @__PURE__ */ jsx(
|
|
228
|
-
Label,
|
|
229
|
-
{
|
|
230
|
-
"data-slot": "field-label",
|
|
231
|
-
className: cn(
|
|
232
|
-
"group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50",
|
|
233
|
-
"has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-box has-[>[data-slot=field]]:border *:data-[slot=field]:p-4",
|
|
234
|
-
"has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10",
|
|
235
|
-
className
|
|
236
|
-
),
|
|
237
|
-
...props
|
|
238
|
-
}
|
|
239
|
-
);
|
|
240
|
-
}
|
|
241
|
-
function FieldTitle({ className, ...props }) {
|
|
242
|
-
return /* @__PURE__ */ jsx(
|
|
243
|
-
"div",
|
|
244
|
-
{
|
|
245
|
-
"data-slot": "field-label",
|
|
246
|
-
className: cn(
|
|
247
|
-
"flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50",
|
|
248
|
-
className
|
|
249
|
-
),
|
|
250
|
-
...props
|
|
251
|
-
}
|
|
252
|
-
);
|
|
253
|
-
}
|
|
254
|
-
function FieldDescription({ className, ...props }) {
|
|
255
|
-
return /* @__PURE__ */ jsx(
|
|
256
|
-
"p",
|
|
257
|
-
{
|
|
258
|
-
"data-slot": "field-description",
|
|
259
|
-
className: cn(
|
|
260
|
-
"text-muted-foreground text-sm leading-normal font-normal group-has-data-[orientation=horizontal]/field:text-balance",
|
|
261
|
-
"last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5",
|
|
262
|
-
"[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
|
|
263
|
-
className
|
|
264
|
-
),
|
|
265
|
-
...props
|
|
266
|
-
}
|
|
267
|
-
);
|
|
268
|
-
}
|
|
269
|
-
function FieldSeparator({
|
|
270
|
-
children,
|
|
271
|
-
className,
|
|
272
|
-
...props
|
|
273
|
-
}) {
|
|
274
|
-
return /* @__PURE__ */ jsxs(
|
|
275
|
-
"div",
|
|
276
|
-
{
|
|
277
|
-
"data-slot": "field-separator",
|
|
278
|
-
"data-content": !!children,
|
|
279
|
-
className: cn(
|
|
280
|
-
"relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",
|
|
281
|
-
className
|
|
282
|
-
),
|
|
283
|
-
...props,
|
|
284
|
-
children: [
|
|
285
|
-
/* @__PURE__ */ jsx(Separator, { className: "absolute inset-0 top-1/2" }),
|
|
286
|
-
children && /* @__PURE__ */ jsx(
|
|
287
|
-
"span",
|
|
288
|
-
{
|
|
289
|
-
className: "bg-background text-muted-foreground relative mx-auto block w-fit px-2",
|
|
290
|
-
"data-slot": "field-separator-content",
|
|
291
|
-
children
|
|
292
|
-
}
|
|
293
|
-
)
|
|
294
|
-
]
|
|
295
|
-
}
|
|
296
|
-
);
|
|
297
|
-
}
|
|
298
|
-
function FieldError({
|
|
299
|
-
className,
|
|
300
|
-
children,
|
|
301
|
-
errors,
|
|
302
|
-
...props
|
|
303
|
-
}) {
|
|
304
|
-
const content = useMemo(() => {
|
|
305
|
-
if (children) {
|
|
306
|
-
return children;
|
|
307
|
-
}
|
|
308
|
-
if (!errors?.length) {
|
|
309
|
-
return null;
|
|
310
|
-
}
|
|
311
|
-
const uniqueErrors = [
|
|
312
|
-
...new Map(errors.map((error) => [error?.message, error])).values()
|
|
313
|
-
];
|
|
314
|
-
if (uniqueErrors?.length === 1) {
|
|
315
|
-
return uniqueErrors[0]?.message;
|
|
316
|
-
}
|
|
317
|
-
return /* @__PURE__ */ jsx("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: uniqueErrors.map(
|
|
318
|
-
(error) => error?.message && /* @__PURE__ */ jsx("li", { children: error.message }, error.message)
|
|
319
|
-
) });
|
|
320
|
-
}, [children, errors]);
|
|
321
|
-
if (!content) {
|
|
322
|
-
return null;
|
|
323
|
-
}
|
|
324
|
-
return /* @__PURE__ */ jsx(
|
|
325
|
-
"div",
|
|
326
|
-
{
|
|
327
|
-
role: "alert",
|
|
328
|
-
"data-slot": "field-error",
|
|
329
|
-
className: cn("text-destructive text-xs font-normal -mt-2.5", className),
|
|
330
|
-
...props,
|
|
331
|
-
children: content
|
|
332
|
-
}
|
|
333
|
-
);
|
|
334
|
-
}
|
|
335
69
|
var PasswordInput = React2.forwardRef(({ className, ...props }, ref) => {
|
|
336
70
|
const [showPassword, setShowPassword] = React2.useState(false);
|
|
337
71
|
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
@@ -562,5 +296,215 @@ function VerificationCodeInput({
|
|
|
562
296
|
)) })
|
|
563
297
|
] });
|
|
564
298
|
}
|
|
299
|
+
function FieldSet({ className, ...props }) {
|
|
300
|
+
return /* @__PURE__ */ jsx(
|
|
301
|
+
"fieldset",
|
|
302
|
+
{
|
|
303
|
+
"data-slot": "field-set",
|
|
304
|
+
className: cn(
|
|
305
|
+
"flex flex-col gap-6",
|
|
306
|
+
"has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",
|
|
307
|
+
className
|
|
308
|
+
),
|
|
309
|
+
...props
|
|
310
|
+
}
|
|
311
|
+
);
|
|
312
|
+
}
|
|
313
|
+
function FieldLegend({
|
|
314
|
+
className,
|
|
315
|
+
variant = "legend",
|
|
316
|
+
...props
|
|
317
|
+
}) {
|
|
318
|
+
return /* @__PURE__ */ jsx(
|
|
319
|
+
"legend",
|
|
320
|
+
{
|
|
321
|
+
"data-slot": "field-legend",
|
|
322
|
+
"data-variant": variant,
|
|
323
|
+
className: cn(
|
|
324
|
+
"mb-3 font-medium",
|
|
325
|
+
"data-[variant=legend]:text-base",
|
|
326
|
+
"data-[variant=label]:text-sm",
|
|
327
|
+
className
|
|
328
|
+
),
|
|
329
|
+
...props
|
|
330
|
+
}
|
|
331
|
+
);
|
|
332
|
+
}
|
|
333
|
+
function FieldGroup({ className, ...props }) {
|
|
334
|
+
return /* @__PURE__ */ jsx(
|
|
335
|
+
"div",
|
|
336
|
+
{
|
|
337
|
+
"data-slot": "field-group",
|
|
338
|
+
className: cn(
|
|
339
|
+
"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",
|
|
340
|
+
className
|
|
341
|
+
),
|
|
342
|
+
...props
|
|
343
|
+
}
|
|
344
|
+
);
|
|
345
|
+
}
|
|
346
|
+
var fieldVariants = cva(
|
|
347
|
+
"group/field flex w-full gap-3 data-[invalid=true]:text-destructive",
|
|
348
|
+
{
|
|
349
|
+
variants: {
|
|
350
|
+
orientation: {
|
|
351
|
+
vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
|
|
352
|
+
horizontal: [
|
|
353
|
+
"flex-row items-center",
|
|
354
|
+
"[&>[data-slot=field-label]]:flex-auto",
|
|
355
|
+
"has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
356
|
+
],
|
|
357
|
+
responsive: [
|
|
358
|
+
"flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto",
|
|
359
|
+
"@md/field-group:[&>[data-slot=field-label]]:flex-auto",
|
|
360
|
+
"@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
361
|
+
]
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
defaultVariants: {
|
|
365
|
+
orientation: "vertical"
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
);
|
|
369
|
+
function Field({
|
|
370
|
+
className,
|
|
371
|
+
orientation = "vertical",
|
|
372
|
+
...props
|
|
373
|
+
}) {
|
|
374
|
+
return /* @__PURE__ */ jsx(
|
|
375
|
+
"fieldset",
|
|
376
|
+
{
|
|
377
|
+
"data-slot": "field",
|
|
378
|
+
"data-orientation": orientation,
|
|
379
|
+
className: cn(fieldVariants({ orientation }), className),
|
|
380
|
+
...props
|
|
381
|
+
}
|
|
382
|
+
);
|
|
383
|
+
}
|
|
384
|
+
function FieldContent({ className, ...props }) {
|
|
385
|
+
return /* @__PURE__ */ jsx(
|
|
386
|
+
"div",
|
|
387
|
+
{
|
|
388
|
+
"data-slot": "field-content",
|
|
389
|
+
className: cn(
|
|
390
|
+
"group/field-content flex flex-1 flex-col gap-1.5 leading-snug",
|
|
391
|
+
className
|
|
392
|
+
),
|
|
393
|
+
...props
|
|
394
|
+
}
|
|
395
|
+
);
|
|
396
|
+
}
|
|
397
|
+
function FieldLabel({
|
|
398
|
+
className,
|
|
399
|
+
...props
|
|
400
|
+
}) {
|
|
401
|
+
return /* @__PURE__ */ jsx(
|
|
402
|
+
Label,
|
|
403
|
+
{
|
|
404
|
+
"data-slot": "field-label",
|
|
405
|
+
className: cn(
|
|
406
|
+
"group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50",
|
|
407
|
+
"has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-box has-[>[data-slot=field]]:border *:data-[slot=field]:p-4",
|
|
408
|
+
"has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10",
|
|
409
|
+
className
|
|
410
|
+
),
|
|
411
|
+
...props
|
|
412
|
+
}
|
|
413
|
+
);
|
|
414
|
+
}
|
|
415
|
+
function FieldTitle({ className, ...props }) {
|
|
416
|
+
return /* @__PURE__ */ jsx(
|
|
417
|
+
"div",
|
|
418
|
+
{
|
|
419
|
+
"data-slot": "field-label",
|
|
420
|
+
className: cn(
|
|
421
|
+
"flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50",
|
|
422
|
+
className
|
|
423
|
+
),
|
|
424
|
+
...props
|
|
425
|
+
}
|
|
426
|
+
);
|
|
427
|
+
}
|
|
428
|
+
function FieldDescription({ className, ...props }) {
|
|
429
|
+
return /* @__PURE__ */ jsx(
|
|
430
|
+
"p",
|
|
431
|
+
{
|
|
432
|
+
"data-slot": "field-description",
|
|
433
|
+
className: cn(
|
|
434
|
+
"text-muted-foreground text-sm leading-normal font-normal group-has-data-[orientation=horizontal]/field:text-balance",
|
|
435
|
+
"last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5",
|
|
436
|
+
"[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
|
|
437
|
+
className
|
|
438
|
+
),
|
|
439
|
+
...props
|
|
440
|
+
}
|
|
441
|
+
);
|
|
442
|
+
}
|
|
443
|
+
function FieldSeparator({
|
|
444
|
+
children,
|
|
445
|
+
className,
|
|
446
|
+
...props
|
|
447
|
+
}) {
|
|
448
|
+
return /* @__PURE__ */ jsxs(
|
|
449
|
+
"div",
|
|
450
|
+
{
|
|
451
|
+
"data-slot": "field-separator",
|
|
452
|
+
"data-content": !!children,
|
|
453
|
+
className: cn(
|
|
454
|
+
"relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",
|
|
455
|
+
className
|
|
456
|
+
),
|
|
457
|
+
...props,
|
|
458
|
+
children: [
|
|
459
|
+
/* @__PURE__ */ jsx(Separator, { className: "absolute inset-0 top-1/2" }),
|
|
460
|
+
children && /* @__PURE__ */ jsx(
|
|
461
|
+
"span",
|
|
462
|
+
{
|
|
463
|
+
className: "bg-background text-muted-foreground relative mx-auto block w-fit px-2",
|
|
464
|
+
"data-slot": "field-separator-content",
|
|
465
|
+
children
|
|
466
|
+
}
|
|
467
|
+
)
|
|
468
|
+
]
|
|
469
|
+
}
|
|
470
|
+
);
|
|
471
|
+
}
|
|
472
|
+
function FieldError({
|
|
473
|
+
className,
|
|
474
|
+
children,
|
|
475
|
+
errors,
|
|
476
|
+
...props
|
|
477
|
+
}) {
|
|
478
|
+
const content = useMemo(() => {
|
|
479
|
+
if (children) {
|
|
480
|
+
return children;
|
|
481
|
+
}
|
|
482
|
+
if (!errors?.length) {
|
|
483
|
+
return null;
|
|
484
|
+
}
|
|
485
|
+
const uniqueErrors = [
|
|
486
|
+
...new Map(errors.map((error) => [error?.message, error])).values()
|
|
487
|
+
];
|
|
488
|
+
if (uniqueErrors?.length === 1) {
|
|
489
|
+
return uniqueErrors[0]?.message;
|
|
490
|
+
}
|
|
491
|
+
return /* @__PURE__ */ jsx("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: uniqueErrors.map(
|
|
492
|
+
(error) => error?.message && /* @__PURE__ */ jsx("li", { children: error.message }, error.message)
|
|
493
|
+
) });
|
|
494
|
+
}, [children, errors]);
|
|
495
|
+
if (!content) {
|
|
496
|
+
return null;
|
|
497
|
+
}
|
|
498
|
+
return /* @__PURE__ */ jsx(
|
|
499
|
+
"div",
|
|
500
|
+
{
|
|
501
|
+
role: "alert",
|
|
502
|
+
"data-slot": "field-error",
|
|
503
|
+
className: cn("text-destructive text-xs font-normal -mt-2.5", className),
|
|
504
|
+
...props,
|
|
505
|
+
children: content
|
|
506
|
+
}
|
|
507
|
+
);
|
|
508
|
+
}
|
|
565
509
|
|
|
566
|
-
export {
|
|
510
|
+
export { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, PasswordInput, PasswordRequirements, VerificationCodeInput, defaultPasswordRules, extendedPasswordRules };
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { cn } from './chunk-IMKLN273.mjs';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
function Table({ className, ...props }) {
|
|
5
|
+
return /* @__PURE__ */ jsx("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsx(
|
|
6
|
+
"table",
|
|
7
|
+
{
|
|
8
|
+
"data-slot": "table",
|
|
9
|
+
className: cn("w-full caption-bottom text-sm", className),
|
|
10
|
+
...props
|
|
11
|
+
}
|
|
12
|
+
) });
|
|
13
|
+
}
|
|
14
|
+
function TableHeader({ className, ...props }) {
|
|
15
|
+
return /* @__PURE__ */ jsx(
|
|
16
|
+
"thead",
|
|
17
|
+
{
|
|
18
|
+
"data-slot": "table-header",
|
|
19
|
+
className: cn("[&_tr]:border-b", className),
|
|
20
|
+
...props
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
function TableBody({ className, ...props }) {
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
"tbody",
|
|
27
|
+
{
|
|
28
|
+
"data-slot": "table-body",
|
|
29
|
+
className: cn("[&_tr:last-child]:border-0", className),
|
|
30
|
+
...props
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
function TableFooter({ className, ...props }) {
|
|
35
|
+
return /* @__PURE__ */ jsx(
|
|
36
|
+
"tfoot",
|
|
37
|
+
{
|
|
38
|
+
"data-slot": "table-footer",
|
|
39
|
+
className: cn(
|
|
40
|
+
"bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",
|
|
41
|
+
className
|
|
42
|
+
),
|
|
43
|
+
...props
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
function TableRow({ className, ...props }) {
|
|
48
|
+
return /* @__PURE__ */ jsx(
|
|
49
|
+
"tr",
|
|
50
|
+
{
|
|
51
|
+
"data-slot": "table-row",
|
|
52
|
+
className: cn(
|
|
53
|
+
"hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",
|
|
54
|
+
className
|
|
55
|
+
),
|
|
56
|
+
...props
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
function TableHead({ className, ...props }) {
|
|
61
|
+
return /* @__PURE__ */ jsx(
|
|
62
|
+
"th",
|
|
63
|
+
{
|
|
64
|
+
"data-slot": "table-head",
|
|
65
|
+
className: cn(
|
|
66
|
+
"text-muted-foreground h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
67
|
+
className
|
|
68
|
+
),
|
|
69
|
+
...props
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
function TableCell({ className, ...props }) {
|
|
74
|
+
return /* @__PURE__ */ jsx(
|
|
75
|
+
"td",
|
|
76
|
+
{
|
|
77
|
+
"data-slot": "table-cell",
|
|
78
|
+
className: cn(
|
|
79
|
+
"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
80
|
+
className
|
|
81
|
+
),
|
|
82
|
+
...props
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
function TableCaption({
|
|
87
|
+
className,
|
|
88
|
+
...props
|
|
89
|
+
}) {
|
|
90
|
+
return /* @__PURE__ */ jsx(
|
|
91
|
+
"caption",
|
|
92
|
+
{
|
|
93
|
+
"data-slot": "table-caption",
|
|
94
|
+
className: cn("text-muted-foreground mt-4 text-sm", className),
|
|
95
|
+
...props
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|