cuenti-dna 0.1.1-beta.1 → 0.1.1-beta.2
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/dist/index.cjs +814 -127
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +104 -1
- package/dist/index.d.ts +104 -1
- package/dist/index.js +802 -123
- package/dist/index.js.map +1 -1
- package/dist/styles.css +371 -0
- package/package.json +9 -5
- package/scripts/cli/args.cjs +71 -71
- package/scripts/cli/constants.cjs +49 -49
- package/scripts/cli/core.cjs +66 -66
- package/scripts/cli/css.cjs +224 -224
- package/scripts/cli/workflows.cjs +226 -226
- package/scripts/cli.cjs +33 -33
- package/src/styles/globals.css +4 -0
package/dist/index.cjs
CHANGED
|
@@ -31,7 +31,11 @@ __export(index_exports, {
|
|
|
31
31
|
Check: () => Check,
|
|
32
32
|
Checkbox: () => Checkbox,
|
|
33
33
|
CloseX: () => CloseX,
|
|
34
|
+
Form: () => Form,
|
|
35
|
+
HelperMessage: () => HelperText,
|
|
36
|
+
HelperText: () => HelperText,
|
|
34
37
|
Input: () => Input,
|
|
38
|
+
Label: () => Label,
|
|
35
39
|
Minus: () => Minus,
|
|
36
40
|
MoneyInput: () => MoneyInput,
|
|
37
41
|
NumberInput: () => NumberInput,
|
|
@@ -40,6 +44,10 @@ __export(index_exports, {
|
|
|
40
44
|
RadioGroup: () => RadioGroup,
|
|
41
45
|
RadioItem: () => RadioItem,
|
|
42
46
|
Switch: () => Switch,
|
|
47
|
+
Tooltip: () => Tooltip,
|
|
48
|
+
TooltipContent: () => TooltipContent,
|
|
49
|
+
TooltipProvider: () => TooltipProvider,
|
|
50
|
+
TooltipTrigger: () => TooltipTrigger,
|
|
43
51
|
cn: () => cn,
|
|
44
52
|
inputTypes: () => inputTypes,
|
|
45
53
|
useFormattedNumericInput: () => useFormattedNumericInput,
|
|
@@ -48,7 +56,13 @@ __export(index_exports, {
|
|
|
48
56
|
});
|
|
49
57
|
module.exports = __toCommonJS(index_exports);
|
|
50
58
|
|
|
51
|
-
// src/components/
|
|
59
|
+
// src/components/forms/form.tsx
|
|
60
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
61
|
+
function Form({ children, ...props }) {
|
|
62
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("form", { ...props, children });
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// src/components/forms/inputs/button.tsx
|
|
52
66
|
var import_class_variance_authority = require("class-variance-authority");
|
|
53
67
|
|
|
54
68
|
// src/utils/cn.ts
|
|
@@ -58,9 +72,9 @@ function cn(...inputs) {
|
|
|
58
72
|
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
59
73
|
}
|
|
60
74
|
|
|
61
|
-
// src/components/inputs/button.tsx
|
|
62
|
-
var
|
|
63
|
-
var baseStyles = "inline-flex items-center justify-center gap-2 whitespace-nowrap text-base transition-all duration-300 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] cursor-pointer disabled:bg-neutral-600 disabled:text-neutral-700 font-bold disabled:cursor-not-allowed";
|
|
75
|
+
// src/components/forms/inputs/button.tsx
|
|
76
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
77
|
+
var baseStyles = "inline-flex items-center justify-center gap-2 whitespace-nowrap text-base transition-all duration-300 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] cursor-pointer disabled:bg-neutral-600 disabled:text-neutral-700 font-bold disabled:cursor-not-allowed peer";
|
|
64
78
|
var variants = {
|
|
65
79
|
primary: "bg-primary text-primary-foreground hover:bg-primary-600 active:bg-primary-400 aria-pressed:bg-primary-400",
|
|
66
80
|
alt: "bg-primary-400 text-primary-foreground hover:bg-primary-500 active:bg-primary-300 aria-pressed:bg-primary-300",
|
|
@@ -101,17 +115,17 @@ function Button({
|
|
|
101
115
|
...props
|
|
102
116
|
}) {
|
|
103
117
|
const classes = cn(buttonVariants({ variant, size }), className);
|
|
104
|
-
return /* @__PURE__ */ (0,
|
|
118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { className: classes, type, ...props, children });
|
|
105
119
|
}
|
|
106
120
|
|
|
107
|
-
// src/components/inputs/checkbox.tsx
|
|
121
|
+
// src/components/forms/inputs/checkbox.tsx
|
|
108
122
|
var import_class_variance_authority2 = require("class-variance-authority");
|
|
109
123
|
var import_react = require("react");
|
|
110
124
|
|
|
111
125
|
// src/components/icons/interface/check.tsx
|
|
112
|
-
var
|
|
126
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
113
127
|
function Check({ className, ...props }) {
|
|
114
|
-
return /* @__PURE__ */ (0,
|
|
128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
115
129
|
"svg",
|
|
116
130
|
{
|
|
117
131
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -119,7 +133,7 @@ function Check({ className, ...props }) {
|
|
|
119
133
|
viewBox: "0 0 20 20",
|
|
120
134
|
className,
|
|
121
135
|
...props,
|
|
122
|
-
children: /* @__PURE__ */ (0,
|
|
136
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
123
137
|
"path",
|
|
124
138
|
{
|
|
125
139
|
stroke: "currentColor",
|
|
@@ -134,16 +148,16 @@ function Check({ className, ...props }) {
|
|
|
134
148
|
}
|
|
135
149
|
|
|
136
150
|
// src/components/icons/interface/minus.tsx
|
|
137
|
-
var
|
|
151
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
138
152
|
function Minus({ ...props }) {
|
|
139
|
-
return /* @__PURE__ */ (0,
|
|
153
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
140
154
|
"svg",
|
|
141
155
|
{
|
|
142
156
|
xmlns: "http://www.w3.org/2000/svg",
|
|
143
157
|
fill: "none",
|
|
144
158
|
viewBox: "0 0 24 24",
|
|
145
159
|
...props,
|
|
146
|
-
children: /* @__PURE__ */ (0,
|
|
160
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
147
161
|
"path",
|
|
148
162
|
{
|
|
149
163
|
stroke: "currentColor",
|
|
@@ -157,9 +171,9 @@ function Minus({ ...props }) {
|
|
|
157
171
|
);
|
|
158
172
|
}
|
|
159
173
|
|
|
160
|
-
// src/components/inputs/checkbox.tsx
|
|
161
|
-
var
|
|
162
|
-
var baseStyles2 = "size-6 shrink-0 appearance-none border-2 border-neutral-600 bg-transparent transition-all duration-200 outline-none disabled:border-neutral-400 disabled:bg-transparent focus-visible:ring-2 focus-visible:bg-neutral-400 focus-visible:ring-offset-1 cursor-pointer disabled:cursor-not-allowed group-data-[readonly=true]/checkbox:cursor-default";
|
|
174
|
+
// src/components/forms/inputs/checkbox.tsx
|
|
175
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
176
|
+
var baseStyles2 = "peer size-6 shrink-0 appearance-none border-2 border-neutral-600 bg-transparent transition-all duration-200 outline-none disabled:border-neutral-400 disabled:bg-transparent focus-visible:ring-2 focus-visible:bg-neutral-400 focus-visible:ring-offset-1 cursor-pointer disabled:cursor-not-allowed group-data-[readonly=true]/checkbox:cursor-default";
|
|
163
177
|
var variants2 = {
|
|
164
178
|
default: "hover:border-info-500 hover:bg-info-50 focus-visible:border-info-500 focus-visible:ring-info-500/20 focus-visible:checked:border-info-500 focus-visible:checked:bg-info-500 checked:border-info-500 checked:bg-info-500 checked:hover:border-info-600 checked:hover:bg-info-600 indeterminate:border-info-500 indeterminate:bg-info-500 indeterminate:hover:border-info-600 indeterminate:hover:bg-info-600 disabled:hover:border-neutral-400 disabled:hover:bg-transparent",
|
|
165
179
|
success: "hover:border-success-500 hover:bg-success-50 focus-visible:border-success-500 focus-visible:ring-success-500/20 focus-visible:checked:border-success-500 focus-visible:checked:bg-success-500 checked:border-success-500 checked:bg-success-500 checked:hover:border-success-600 checked:hover:bg-success-600 indeterminate:border-success-500 indeterminate:bg-success-500 indeterminate:hover:border-success-600 indeterminate:hover:bg-success-600 disabled:hover:border-neutral-400 disabled:hover:bg-transparent"
|
|
@@ -219,7 +233,7 @@ function Checkbox({
|
|
|
219
233
|
}
|
|
220
234
|
onChange?.(event);
|
|
221
235
|
};
|
|
222
|
-
return /* @__PURE__ */ (0,
|
|
236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
223
237
|
"div",
|
|
224
238
|
{
|
|
225
239
|
"data-slot": "checkbox",
|
|
@@ -230,8 +244,8 @@ function Checkbox({
|
|
|
230
244
|
classNames?.root
|
|
231
245
|
),
|
|
232
246
|
children: [
|
|
233
|
-
/* @__PURE__ */ (0,
|
|
234
|
-
/* @__PURE__ */ (0,
|
|
247
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "group/control relative flex size-6 shrink-0 items-center justify-center text-white", children: [
|
|
248
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
235
249
|
"input",
|
|
236
250
|
{
|
|
237
251
|
ref: inputRef,
|
|
@@ -247,14 +261,14 @@ function Checkbox({
|
|
|
247
261
|
...props
|
|
248
262
|
}
|
|
249
263
|
),
|
|
250
|
-
/* @__PURE__ */ (0,
|
|
264
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
251
265
|
Check,
|
|
252
266
|
{
|
|
253
267
|
"aria-hidden": "true",
|
|
254
268
|
className: "pointer-events-none absolute z-10 size-5 opacity-0 transition-opacity group-has-checked/control:opacity-100 group-has-indeterminate/control:opacity-0"
|
|
255
269
|
}
|
|
256
270
|
),
|
|
257
|
-
/* @__PURE__ */ (0,
|
|
271
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
258
272
|
Minus,
|
|
259
273
|
{
|
|
260
274
|
"aria-hidden": "true",
|
|
@@ -262,7 +276,7 @@ function Checkbox({
|
|
|
262
276
|
}
|
|
263
277
|
)
|
|
264
278
|
] }),
|
|
265
|
-
children ? /* @__PURE__ */ (0,
|
|
279
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
266
280
|
"label",
|
|
267
281
|
{
|
|
268
282
|
"data-slot": "checkbox-label",
|
|
@@ -279,10 +293,188 @@ function Checkbox({
|
|
|
279
293
|
);
|
|
280
294
|
}
|
|
281
295
|
|
|
282
|
-
// src/components/inputs/
|
|
296
|
+
// src/components/forms/inputs/helper-text.tsx
|
|
283
297
|
var import_class_variance_authority3 = require("class-variance-authority");
|
|
298
|
+
var import_lucide_react = require("lucide-react");
|
|
299
|
+
|
|
300
|
+
// src/components/icons/menu/closeX.tsx
|
|
301
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
302
|
+
function CloseX({ className, ...props }) {
|
|
303
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
304
|
+
"svg",
|
|
305
|
+
{
|
|
306
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
307
|
+
fill: "none",
|
|
308
|
+
viewBox: "0 0 24 24",
|
|
309
|
+
className,
|
|
310
|
+
...props,
|
|
311
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
312
|
+
"path",
|
|
313
|
+
{
|
|
314
|
+
stroke: "currentColor",
|
|
315
|
+
strokeLinecap: "round",
|
|
316
|
+
strokeLinejoin: "round",
|
|
317
|
+
d: "m18 18-6-6m0 0L6 6m6 6 6-6m-6 6-6 6"
|
|
318
|
+
}
|
|
319
|
+
)
|
|
320
|
+
}
|
|
321
|
+
);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
// src/components/forms/inputs/helper-text.tsx
|
|
325
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
326
|
+
var helperTextVariants = {
|
|
327
|
+
success: {
|
|
328
|
+
text: "text-success",
|
|
329
|
+
wrapped: "bg-success-50 rounded-lg",
|
|
330
|
+
iconWrapper: "bg-success",
|
|
331
|
+
icon: "text-success-foreground"
|
|
332
|
+
},
|
|
333
|
+
default: {
|
|
334
|
+
text: "text-neutral-700",
|
|
335
|
+
wrapped: "bg-neutral-400 rounded-lg",
|
|
336
|
+
iconWrapper: "bg-transparent",
|
|
337
|
+
icon: "text-neutral-700"
|
|
338
|
+
},
|
|
339
|
+
info: {
|
|
340
|
+
text: "text-info",
|
|
341
|
+
wrapped: "bg-info-50 rounded-lg",
|
|
342
|
+
iconWrapper: "bg-info",
|
|
343
|
+
icon: "text-info-foreground"
|
|
344
|
+
},
|
|
345
|
+
warning: {
|
|
346
|
+
text: "text-warning",
|
|
347
|
+
wrapped: "bg-warning-50 rounded-lg",
|
|
348
|
+
iconWrapper: "bg-warning",
|
|
349
|
+
icon: "text-warning-foreground"
|
|
350
|
+
},
|
|
351
|
+
destructive: {
|
|
352
|
+
text: "text-destructive",
|
|
353
|
+
wrapped: "bg-destructive-50 rounded-lg",
|
|
354
|
+
iconWrapper: "bg-destructive",
|
|
355
|
+
icon: "text-destructive-foreground"
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
var helperSizeVariants = {
|
|
359
|
+
sm: "text-sm font-normal",
|
|
360
|
+
md: "text-base font-semibold",
|
|
361
|
+
lg: "text-base font-semibold"
|
|
362
|
+
};
|
|
363
|
+
var helperTextIcons = {
|
|
364
|
+
success: Check,
|
|
365
|
+
default: import_lucide_react.CircleDashed,
|
|
366
|
+
info: import_lucide_react.Info,
|
|
367
|
+
warning: import_lucide_react.AlertCircle,
|
|
368
|
+
destructive: import_lucide_react.X
|
|
369
|
+
};
|
|
370
|
+
var textStyles = (0, import_class_variance_authority3.cva)("text-left text-pretty", {
|
|
371
|
+
variants: {
|
|
372
|
+
size: helperSizeVariants,
|
|
373
|
+
withIcon: {
|
|
374
|
+
true: "",
|
|
375
|
+
false: "px-2 py-1"
|
|
376
|
+
}
|
|
377
|
+
},
|
|
378
|
+
defaultVariants: {
|
|
379
|
+
size: "md",
|
|
380
|
+
withIcon: false
|
|
381
|
+
}
|
|
382
|
+
});
|
|
383
|
+
var rootStyles = (0, import_class_variance_authority3.cva)("", {
|
|
384
|
+
variants: {
|
|
385
|
+
withIcon: {
|
|
386
|
+
true: "flex items-center justify-start gap-2 rounded-lg px-2 py-1",
|
|
387
|
+
false: ""
|
|
388
|
+
}
|
|
389
|
+
},
|
|
390
|
+
defaultVariants: {
|
|
391
|
+
withIcon: false
|
|
392
|
+
}
|
|
393
|
+
});
|
|
394
|
+
var iconWrapperStyles = (0, import_class_variance_authority3.cva)(
|
|
395
|
+
"inline-flex shrink-0 items-center justify-center rounded-full",
|
|
396
|
+
{
|
|
397
|
+
variants: {
|
|
398
|
+
size: {
|
|
399
|
+
sm: "size-4",
|
|
400
|
+
md: "size-5",
|
|
401
|
+
lg: "size-6"
|
|
402
|
+
}
|
|
403
|
+
},
|
|
404
|
+
defaultVariants: {
|
|
405
|
+
size: "md"
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
);
|
|
409
|
+
var iconStyles = (0, import_class_variance_authority3.cva)("", {
|
|
410
|
+
variants: {
|
|
411
|
+
size: {
|
|
412
|
+
sm: "size-3",
|
|
413
|
+
md: "size-4",
|
|
414
|
+
lg: "size-5"
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
defaultVariants: {
|
|
418
|
+
size: "md"
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
function HelperText({
|
|
422
|
+
children,
|
|
423
|
+
variant,
|
|
424
|
+
className,
|
|
425
|
+
classNames,
|
|
426
|
+
withIcon,
|
|
427
|
+
size,
|
|
428
|
+
wrapped,
|
|
429
|
+
...props
|
|
430
|
+
}) {
|
|
431
|
+
const currentVariant = variant ?? "default";
|
|
432
|
+
const currentVariantStyles = helperTextVariants[currentVariant];
|
|
433
|
+
const Icon = helperTextIcons[currentVariant];
|
|
434
|
+
const finalRootClassName = cn(
|
|
435
|
+
rootStyles({ withIcon }),
|
|
436
|
+
wrapped ? currentVariantStyles.wrapped : "",
|
|
437
|
+
classNames?.root
|
|
438
|
+
);
|
|
439
|
+
const finalTextClassName = cn(
|
|
440
|
+
textStyles({ size, withIcon }),
|
|
441
|
+
currentVariantStyles.text,
|
|
442
|
+
className,
|
|
443
|
+
classNames?.text
|
|
444
|
+
);
|
|
445
|
+
if (withIcon) {
|
|
446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: finalRootClassName, children: [
|
|
447
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
448
|
+
"span",
|
|
449
|
+
{
|
|
450
|
+
"aria-hidden": "true",
|
|
451
|
+
className: cn(
|
|
452
|
+
iconWrapperStyles({ size }),
|
|
453
|
+
currentVariantStyles.iconWrapper,
|
|
454
|
+
classNames?.iconWrapper
|
|
455
|
+
),
|
|
456
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
457
|
+
Icon,
|
|
458
|
+
{
|
|
459
|
+
className: cn(
|
|
460
|
+
iconStyles({ size }),
|
|
461
|
+
currentVariantStyles.icon,
|
|
462
|
+
classNames?.icon
|
|
463
|
+
)
|
|
464
|
+
}
|
|
465
|
+
)
|
|
466
|
+
}
|
|
467
|
+
),
|
|
468
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { ...props, className: finalTextClassName, children })
|
|
469
|
+
] });
|
|
470
|
+
}
|
|
471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { ...props, className: cn(finalRootClassName, finalTextClassName), children });
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
// src/components/forms/inputs/input/input.tsx
|
|
475
|
+
var import_class_variance_authority4 = require("class-variance-authority");
|
|
284
476
|
|
|
285
|
-
// src/components/inputs/input/money-input.tsx
|
|
477
|
+
// src/components/forms/inputs/input/money-input.tsx
|
|
286
478
|
var import_react3 = require("react");
|
|
287
479
|
|
|
288
480
|
// src/hooks/use-formatted-numeric-input.ts
|
|
@@ -452,8 +644,8 @@ var formatMoneyValue = (rawValue, moneySymbol) => {
|
|
|
452
644
|
return `${prefix} ${integerWithGrouping}${decimalSection}`;
|
|
453
645
|
};
|
|
454
646
|
|
|
455
|
-
// src/components/inputs/input/money-input.tsx
|
|
456
|
-
var
|
|
647
|
+
// src/components/forms/inputs/input/money-input.tsx
|
|
648
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
457
649
|
function MoneyInput({
|
|
458
650
|
size: _size,
|
|
459
651
|
classNames,
|
|
@@ -518,10 +710,10 @@ function MoneyInput({
|
|
|
518
710
|
onPaste?.(event);
|
|
519
711
|
};
|
|
520
712
|
if (reset) {
|
|
521
|
-
return /* @__PURE__ */ (0,
|
|
713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: cn("w-full", classNames?.root), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("input", { ...props, className: cn(classNames?.input, className) }) });
|
|
522
714
|
}
|
|
523
|
-
return /* @__PURE__ */ (0,
|
|
524
|
-
/* @__PURE__ */ (0,
|
|
715
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: cn("w-full", classNames?.root), children: [
|
|
716
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
525
717
|
"input",
|
|
526
718
|
{
|
|
527
719
|
...restProps,
|
|
@@ -539,7 +731,7 @@ function MoneyInput({
|
|
|
539
731
|
className: cn(classNames?.input, className)
|
|
540
732
|
}
|
|
541
733
|
),
|
|
542
|
-
name ? /* @__PURE__ */ (0,
|
|
734
|
+
name ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("input", { type: "hidden", name, value: rawValue, disabled }) : null
|
|
543
735
|
] });
|
|
544
736
|
}
|
|
545
737
|
|
|
@@ -605,8 +797,8 @@ var normalizeNumberRawValue = (value) => {
|
|
|
605
797
|
return displayNumberToRawValue(asString);
|
|
606
798
|
};
|
|
607
799
|
|
|
608
|
-
// src/components/inputs/input/number-input.tsx
|
|
609
|
-
var
|
|
800
|
+
// src/components/forms/inputs/input/number-input.tsx
|
|
801
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
610
802
|
function NumberInput({
|
|
611
803
|
size: _size,
|
|
612
804
|
classNames,
|
|
@@ -678,7 +870,7 @@ function NumberInput({
|
|
|
678
870
|
onPaste?.(event);
|
|
679
871
|
};
|
|
680
872
|
if (reset) {
|
|
681
|
-
return /* @__PURE__ */ (0,
|
|
873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: cn("w-full", classNames?.root), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
682
874
|
"input",
|
|
683
875
|
{
|
|
684
876
|
...props,
|
|
@@ -687,8 +879,8 @@ function NumberInput({
|
|
|
687
879
|
}
|
|
688
880
|
) });
|
|
689
881
|
}
|
|
690
|
-
return /* @__PURE__ */ (0,
|
|
691
|
-
/* @__PURE__ */ (0,
|
|
882
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: cn("w-full", classNames?.root), children: [
|
|
883
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
692
884
|
"input",
|
|
693
885
|
{
|
|
694
886
|
...restProps,
|
|
@@ -706,14 +898,14 @@ function NumberInput({
|
|
|
706
898
|
className: cn(classNames?.input, className)
|
|
707
899
|
}
|
|
708
900
|
),
|
|
709
|
-
name ? /* @__PURE__ */ (0,
|
|
901
|
+
name ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("input", { type: "hidden", name, value: rawValue, disabled }) : null
|
|
710
902
|
] });
|
|
711
903
|
}
|
|
712
904
|
|
|
713
|
-
// src/components/inputs/input/password-input.tsx
|
|
714
|
-
var
|
|
905
|
+
// src/components/forms/inputs/input/password-input.tsx
|
|
906
|
+
var import_lucide_react2 = require("lucide-react");
|
|
715
907
|
var import_react4 = require("react");
|
|
716
|
-
var
|
|
908
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
717
909
|
var buttonSizeClasses = {
|
|
718
910
|
sm: "size-8 rounded-sm",
|
|
719
911
|
md: "size-10 rounded-sm",
|
|
@@ -730,11 +922,11 @@ function PasswordInput({
|
|
|
730
922
|
...props
|
|
731
923
|
}) {
|
|
732
924
|
const [viewPassword, setViewPassword] = (0, import_react4.useState)(false);
|
|
733
|
-
const EyeIcon = viewPassword ?
|
|
925
|
+
const EyeIcon = viewPassword ? import_lucide_react2.Eye : import_lucide_react2.EyeOff;
|
|
734
926
|
const { className, ...restProps } = props;
|
|
735
927
|
const currentSize = size ?? "md";
|
|
736
|
-
return /* @__PURE__ */ (0,
|
|
737
|
-
/* @__PURE__ */ (0,
|
|
928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: cn("relative w-full", classNames?.root), children: [
|
|
929
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
738
930
|
"input",
|
|
739
931
|
{
|
|
740
932
|
...restProps,
|
|
@@ -746,7 +938,7 @@ function PasswordInput({
|
|
|
746
938
|
)
|
|
747
939
|
}
|
|
748
940
|
),
|
|
749
|
-
/* @__PURE__ */ (0,
|
|
941
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
750
942
|
Button,
|
|
751
943
|
{
|
|
752
944
|
variant: "ghost",
|
|
@@ -759,7 +951,7 @@ function PasswordInput({
|
|
|
759
951
|
"aria-label": viewPassword ? "Hide password" : "Show password",
|
|
760
952
|
title: viewPassword ? "Ocultar contrase\xF1a" : "Mostrar contrase\xF1a",
|
|
761
953
|
onClick: () => setViewPassword((prev) => !prev),
|
|
762
|
-
children: /* @__PURE__ */ (0,
|
|
954
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
763
955
|
EyeIcon,
|
|
764
956
|
{
|
|
765
957
|
"aria-hidden": "true",
|
|
@@ -780,10 +972,10 @@ var inputTypes = [
|
|
|
780
972
|
"money"
|
|
781
973
|
];
|
|
782
974
|
|
|
783
|
-
// src/components/inputs/input/input.tsx
|
|
784
|
-
var
|
|
975
|
+
// src/components/forms/inputs/input/input.tsx
|
|
976
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
785
977
|
var baseStyles3 = [
|
|
786
|
-
"bg-transparent transition-colors duration-200 ease-in-out disabled:bg-neutral-200 disabled:text-neutral-600 disabled:border-neutral-400 disabled:cursor-not-allowed"
|
|
978
|
+
"peer w-full bg-transparent transition-colors duration-200 ease-in-out disabled:bg-neutral-200 disabled:text-neutral-600 disabled:border-neutral-400 disabled:cursor-not-allowed"
|
|
787
979
|
];
|
|
788
980
|
var variants3 = {
|
|
789
981
|
default: [
|
|
@@ -810,7 +1002,7 @@ var sizes3 = {
|
|
|
810
1002
|
md: ["h-12 rounded-md px-3 pt-3 pb-3.5 text-base"],
|
|
811
1003
|
lg: ["h-13 rounded-lg px-3 py-[15px] text-base"]
|
|
812
1004
|
};
|
|
813
|
-
var switchVariants = (0,
|
|
1005
|
+
var switchVariants = (0, import_class_variance_authority4.cva)(baseStyles3, {
|
|
814
1006
|
variants: {
|
|
815
1007
|
variant: variants3,
|
|
816
1008
|
size: sizes3
|
|
@@ -839,17 +1031,17 @@ function Input({
|
|
|
839
1031
|
);
|
|
840
1032
|
}
|
|
841
1033
|
if (type !== "password" && type !== "number" && type !== "money") {
|
|
842
|
-
return /* @__PURE__ */ (0,
|
|
1034
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
843
1035
|
"input",
|
|
844
1036
|
{
|
|
845
1037
|
...props,
|
|
846
1038
|
type,
|
|
847
1039
|
className: cn(inputClasses, classNames?.input)
|
|
848
1040
|
}
|
|
849
|
-
)
|
|
1041
|
+
);
|
|
850
1042
|
}
|
|
851
1043
|
if (type === "password") {
|
|
852
|
-
return /* @__PURE__ */ (0,
|
|
1044
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
853
1045
|
PasswordInput,
|
|
854
1046
|
{
|
|
855
1047
|
size,
|
|
@@ -859,10 +1051,10 @@ function Input({
|
|
|
859
1051
|
);
|
|
860
1052
|
}
|
|
861
1053
|
if (type === "number") {
|
|
862
|
-
return /* @__PURE__ */ (0,
|
|
1054
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(NumberInput, { size, classNames: specializedClassNames, ...props });
|
|
863
1055
|
}
|
|
864
1056
|
if (type === "money") {
|
|
865
|
-
return /* @__PURE__ */ (0,
|
|
1057
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
866
1058
|
MoneyInput,
|
|
867
1059
|
{
|
|
868
1060
|
size,
|
|
@@ -874,17 +1066,528 @@ function Input({
|
|
|
874
1066
|
}
|
|
875
1067
|
}
|
|
876
1068
|
|
|
877
|
-
// src/components/inputs/
|
|
878
|
-
var
|
|
1069
|
+
// src/components/forms/inputs/label.tsx
|
|
1070
|
+
var import_class_variance_authority6 = require("class-variance-authority");
|
|
1071
|
+
var import_lucide_react3 = require("lucide-react");
|
|
879
1072
|
|
|
880
|
-
// src/
|
|
1073
|
+
// src/components/forms/tooltip.tsx
|
|
1074
|
+
var import_class_variance_authority5 = require("class-variance-authority");
|
|
1075
|
+
var import_react10 = require("react");
|
|
1076
|
+
|
|
1077
|
+
// src/hooks/use-tooltip.ts
|
|
1078
|
+
var import_react5 = require("react");
|
|
1079
|
+
function clearTimer(timerRef) {
|
|
1080
|
+
if (timerRef.current) {
|
|
1081
|
+
clearTimeout(timerRef.current);
|
|
1082
|
+
timerRef.current = null;
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
function useTooltip({
|
|
1086
|
+
open,
|
|
1087
|
+
defaultOpen = false,
|
|
1088
|
+
onOpenChange,
|
|
1089
|
+
delayDuration,
|
|
1090
|
+
closeDelay
|
|
1091
|
+
}) {
|
|
1092
|
+
const [internalOpen, setInternalOpen] = (0, import_react5.useState)(defaultOpen);
|
|
1093
|
+
const openTimerRef = (0, import_react5.useRef)(null);
|
|
1094
|
+
const closeTimerRef = (0, import_react5.useRef)(null);
|
|
1095
|
+
const contentId = (0, import_react5.useId)();
|
|
1096
|
+
const isControlled = open !== void 0;
|
|
1097
|
+
const isOpen = isControlled ? open : internalOpen;
|
|
1098
|
+
const latestOpenRef = (0, import_react5.useRef)(isOpen);
|
|
1099
|
+
(0, import_react5.useEffect)(() => {
|
|
1100
|
+
latestOpenRef.current = isOpen;
|
|
1101
|
+
}, [isOpen]);
|
|
1102
|
+
const clearTimers = (0, import_react5.useCallback)(() => {
|
|
1103
|
+
clearTimer(openTimerRef);
|
|
1104
|
+
clearTimer(closeTimerRef);
|
|
1105
|
+
}, []);
|
|
1106
|
+
const setOpen = (0, import_react5.useCallback)(
|
|
1107
|
+
(nextOpen) => {
|
|
1108
|
+
if (latestOpenRef.current === nextOpen) {
|
|
1109
|
+
return;
|
|
1110
|
+
}
|
|
1111
|
+
if (!isControlled) {
|
|
1112
|
+
latestOpenRef.current = nextOpen;
|
|
1113
|
+
setInternalOpen(nextOpen);
|
|
1114
|
+
}
|
|
1115
|
+
onOpenChange?.(nextOpen);
|
|
1116
|
+
},
|
|
1117
|
+
[isControlled, onOpenChange]
|
|
1118
|
+
);
|
|
1119
|
+
const openNow = (0, import_react5.useCallback)(() => {
|
|
1120
|
+
clearTimers();
|
|
1121
|
+
setOpen(true);
|
|
1122
|
+
}, [clearTimers, setOpen]);
|
|
1123
|
+
const closeNow = (0, import_react5.useCallback)(() => {
|
|
1124
|
+
clearTimers();
|
|
1125
|
+
setOpen(false);
|
|
1126
|
+
}, [clearTimers, setOpen]);
|
|
1127
|
+
const openWithDelay = (0, import_react5.useCallback)(() => {
|
|
1128
|
+
clearTimer(closeTimerRef);
|
|
1129
|
+
clearTimer(openTimerRef);
|
|
1130
|
+
if (delayDuration <= 0) {
|
|
1131
|
+
setOpen(true);
|
|
1132
|
+
return;
|
|
1133
|
+
}
|
|
1134
|
+
openTimerRef.current = setTimeout(() => {
|
|
1135
|
+
setOpen(true);
|
|
1136
|
+
openTimerRef.current = null;
|
|
1137
|
+
}, delayDuration);
|
|
1138
|
+
}, [delayDuration, setOpen]);
|
|
1139
|
+
const closeWithDelay = (0, import_react5.useCallback)(() => {
|
|
1140
|
+
clearTimer(openTimerRef);
|
|
1141
|
+
clearTimer(closeTimerRef);
|
|
1142
|
+
if (closeDelay <= 0) {
|
|
1143
|
+
setOpen(false);
|
|
1144
|
+
return;
|
|
1145
|
+
}
|
|
1146
|
+
closeTimerRef.current = setTimeout(() => {
|
|
1147
|
+
setOpen(false);
|
|
1148
|
+
closeTimerRef.current = null;
|
|
1149
|
+
}, closeDelay);
|
|
1150
|
+
}, [closeDelay, setOpen]);
|
|
1151
|
+
(0, import_react5.useEffect)(() => {
|
|
1152
|
+
return () => {
|
|
1153
|
+
clearTimers();
|
|
1154
|
+
};
|
|
1155
|
+
}, [clearTimers]);
|
|
1156
|
+
const contextValue = (0, import_react5.useMemo)(
|
|
1157
|
+
() => ({
|
|
1158
|
+
open: isOpen,
|
|
1159
|
+
contentId,
|
|
1160
|
+
openWithDelay,
|
|
1161
|
+
openNow,
|
|
1162
|
+
closeWithDelay,
|
|
1163
|
+
closeNow
|
|
1164
|
+
}),
|
|
1165
|
+
[isOpen, contentId, openWithDelay, openNow, closeWithDelay, closeNow]
|
|
1166
|
+
);
|
|
1167
|
+
return contextValue;
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
// src/hooks/use-tooltip-content.ts
|
|
1171
|
+
var import_react7 = require("react");
|
|
1172
|
+
|
|
1173
|
+
// src/hooks/context/tooltip.ts
|
|
881
1174
|
var import_react6 = require("react");
|
|
1175
|
+
var TooltipProviderContext = (0, import_react6.createContext)(null);
|
|
1176
|
+
var TooltipContext = (0, import_react6.createContext)(null);
|
|
1177
|
+
function useTooltipProviderContext() {
|
|
1178
|
+
return (0, import_react6.useContext)(TooltipProviderContext);
|
|
1179
|
+
}
|
|
1180
|
+
function useTooltipContext() {
|
|
1181
|
+
const context = (0, import_react6.useContext)(TooltipContext);
|
|
1182
|
+
if (!context) {
|
|
1183
|
+
throw new Error(
|
|
1184
|
+
"Tooltip components must be used inside <Tooltip> root component."
|
|
1185
|
+
);
|
|
1186
|
+
}
|
|
1187
|
+
return context;
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
// src/utils/tooltip.ts
|
|
1191
|
+
function composeEventHandlers(...handlers) {
|
|
1192
|
+
return (event) => {
|
|
1193
|
+
for (const handler of handlers) {
|
|
1194
|
+
handler?.(event);
|
|
1195
|
+
if (event.defaultPrevented) {
|
|
1196
|
+
return;
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
};
|
|
1200
|
+
}
|
|
1201
|
+
function getTooltipPositionStyles({
|
|
1202
|
+
side,
|
|
1203
|
+
offset
|
|
1204
|
+
}) {
|
|
1205
|
+
const styles = {};
|
|
1206
|
+
if (side === "top") {
|
|
1207
|
+
styles.bottom = `calc(100% + ${offset}px)`;
|
|
1208
|
+
}
|
|
1209
|
+
if (side === "right") {
|
|
1210
|
+
styles.left = `calc(100% + ${offset}px)`;
|
|
1211
|
+
}
|
|
1212
|
+
if (side === "bottom") {
|
|
1213
|
+
styles.top = `calc(100% + ${offset}px)`;
|
|
1214
|
+
}
|
|
1215
|
+
if (side === "left") {
|
|
1216
|
+
styles.right = `calc(100% + ${offset}px)`;
|
|
1217
|
+
}
|
|
1218
|
+
const isVerticalSide = side === "top" || side === "bottom";
|
|
1219
|
+
if (isVerticalSide) {
|
|
1220
|
+
styles.left = "50%";
|
|
1221
|
+
styles.transform = "translateX(-50%)";
|
|
1222
|
+
} else {
|
|
1223
|
+
styles.top = "50%";
|
|
1224
|
+
styles.transform = "translateY(-50%)";
|
|
1225
|
+
}
|
|
1226
|
+
return styles;
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
// src/hooks/use-tooltip-content.ts
|
|
1230
|
+
var DEFAULT_TOOLTIP_OFFSET = 8;
|
|
1231
|
+
function useTooltipContent({
|
|
1232
|
+
side = "top",
|
|
1233
|
+
offset = DEFAULT_TOOLTIP_OFFSET,
|
|
1234
|
+
onMouseEnter,
|
|
1235
|
+
onMouseLeave,
|
|
1236
|
+
onFocus,
|
|
1237
|
+
onBlur
|
|
1238
|
+
}) {
|
|
1239
|
+
const tooltipContext = useTooltipContext();
|
|
1240
|
+
const positionStyles = (0, import_react7.useMemo)(
|
|
1241
|
+
() => getTooltipPositionStyles({ side, offset }),
|
|
1242
|
+
[side, offset]
|
|
1243
|
+
);
|
|
1244
|
+
const interactionHandlers = (0, import_react7.useMemo)(
|
|
1245
|
+
() => ({
|
|
1246
|
+
onMouseEnter: composeEventHandlers(
|
|
1247
|
+
onMouseEnter,
|
|
1248
|
+
() => tooltipContext.openNow()
|
|
1249
|
+
),
|
|
1250
|
+
onMouseLeave: composeEventHandlers(
|
|
1251
|
+
onMouseLeave,
|
|
1252
|
+
() => tooltipContext.closeWithDelay()
|
|
1253
|
+
),
|
|
1254
|
+
onFocus: composeEventHandlers(onFocus, () => tooltipContext.openNow()),
|
|
1255
|
+
onBlur: composeEventHandlers(
|
|
1256
|
+
onBlur,
|
|
1257
|
+
() => tooltipContext.closeWithDelay()
|
|
1258
|
+
)
|
|
1259
|
+
}),
|
|
1260
|
+
[
|
|
1261
|
+
tooltipContext.openNow,
|
|
1262
|
+
tooltipContext.closeWithDelay,
|
|
1263
|
+
onMouseEnter,
|
|
1264
|
+
onMouseLeave,
|
|
1265
|
+
onFocus,
|
|
1266
|
+
onBlur
|
|
1267
|
+
]
|
|
1268
|
+
);
|
|
1269
|
+
return {
|
|
1270
|
+
contentId: tooltipContext.contentId,
|
|
1271
|
+
isOpen: tooltipContext.open,
|
|
1272
|
+
dataState: tooltipContext.open ? "open" : "closed",
|
|
1273
|
+
side,
|
|
1274
|
+
positionStyles,
|
|
1275
|
+
interactionHandlers
|
|
1276
|
+
};
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
// src/hooks/use-tooltip-timings.ts
|
|
1280
|
+
var import_react8 = require("react");
|
|
1281
|
+
var DEFAULT_DELAY_DURATION = 300;
|
|
1282
|
+
var DEFAULT_CLOSE_DELAY = 80;
|
|
1283
|
+
function useTooltipTimingProviderValue({
|
|
1284
|
+
delayDuration = DEFAULT_DELAY_DURATION,
|
|
1285
|
+
closeDelay = DEFAULT_CLOSE_DELAY
|
|
1286
|
+
}) {
|
|
1287
|
+
return (0, import_react8.useMemo)(
|
|
1288
|
+
() => ({
|
|
1289
|
+
delayDuration,
|
|
1290
|
+
closeDelay
|
|
1291
|
+
}),
|
|
1292
|
+
[delayDuration, closeDelay]
|
|
1293
|
+
);
|
|
1294
|
+
}
|
|
1295
|
+
function useResolvedTooltipTimings({
|
|
1296
|
+
delayDuration,
|
|
1297
|
+
closeDelay
|
|
1298
|
+
}) {
|
|
1299
|
+
const providerContext = useTooltipProviderContext();
|
|
1300
|
+
return (0, import_react8.useMemo)(
|
|
1301
|
+
() => ({
|
|
1302
|
+
delayDuration: delayDuration ?? providerContext?.delayDuration ?? DEFAULT_DELAY_DURATION,
|
|
1303
|
+
closeDelay: closeDelay ?? providerContext?.closeDelay ?? DEFAULT_CLOSE_DELAY
|
|
1304
|
+
}),
|
|
1305
|
+
[
|
|
1306
|
+
delayDuration,
|
|
1307
|
+
closeDelay,
|
|
1308
|
+
providerContext?.delayDuration,
|
|
1309
|
+
providerContext?.closeDelay
|
|
1310
|
+
]
|
|
1311
|
+
);
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
// src/hooks/use-tooltip-trigger.ts
|
|
1315
|
+
var import_react9 = require("react");
|
|
1316
|
+
function useTooltipTrigger({
|
|
1317
|
+
onMouseEnter,
|
|
1318
|
+
onMouseLeave,
|
|
1319
|
+
onFocus,
|
|
1320
|
+
onBlur
|
|
1321
|
+
}) {
|
|
1322
|
+
const tooltipContext = useTooltipContext();
|
|
1323
|
+
return (0, import_react9.useMemo)(
|
|
1324
|
+
() => ({
|
|
1325
|
+
ariaDescribedBy: tooltipContext.open ? tooltipContext.contentId : void 0,
|
|
1326
|
+
dataState: tooltipContext.open ? "open" : "closed",
|
|
1327
|
+
onMouseEnter: composeEventHandlers(
|
|
1328
|
+
onMouseEnter,
|
|
1329
|
+
() => tooltipContext.openWithDelay()
|
|
1330
|
+
),
|
|
1331
|
+
onMouseLeave: composeEventHandlers(
|
|
1332
|
+
onMouseLeave,
|
|
1333
|
+
() => tooltipContext.closeWithDelay()
|
|
1334
|
+
),
|
|
1335
|
+
onFocus: composeEventHandlers(
|
|
1336
|
+
onFocus,
|
|
1337
|
+
() => tooltipContext.openNow()
|
|
1338
|
+
),
|
|
1339
|
+
onBlur: composeEventHandlers(
|
|
1340
|
+
onBlur,
|
|
1341
|
+
() => tooltipContext.closeWithDelay()
|
|
1342
|
+
)
|
|
1343
|
+
}),
|
|
1344
|
+
[
|
|
1345
|
+
tooltipContext.open,
|
|
1346
|
+
tooltipContext.contentId,
|
|
1347
|
+
tooltipContext.openWithDelay,
|
|
1348
|
+
tooltipContext.closeWithDelay,
|
|
1349
|
+
tooltipContext.openNow,
|
|
1350
|
+
onMouseEnter,
|
|
1351
|
+
onMouseLeave,
|
|
1352
|
+
onFocus,
|
|
1353
|
+
onBlur
|
|
1354
|
+
]
|
|
1355
|
+
);
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
// src/providers/tooltip-provider.tsx
|
|
1359
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1360
|
+
function TooltipTimingProvider({
|
|
1361
|
+
value,
|
|
1362
|
+
children
|
|
1363
|
+
}) {
|
|
1364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TooltipProviderContext.Provider, { value, children });
|
|
1365
|
+
}
|
|
1366
|
+
function TooltipRootProvider({ value, children }) {
|
|
1367
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TooltipContext.Provider, { value, children });
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
// src/components/forms/tooltip.tsx
|
|
1371
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1372
|
+
var baseStyles4 = "absolute z-50 w-max max-w-sm whitespace-normal break-words rounded-[8px] bg-info px-3 py-2 text-left text-sm leading-5 text-info-foreground shadow-lg outline-none transition-all data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 text-pretty";
|
|
1373
|
+
var variants4 = {
|
|
1374
|
+
side: {
|
|
1375
|
+
top: "origin-bottom before:absolute before:top-full before:left-1/2 before:size-0 before:-translate-x-1/2 before:content-[''] before:border-x-8 before:border-t-8 before:border-x-transparent before:border-t-info",
|
|
1376
|
+
right: "origin-left before:absolute before:right-full before:top-1/2 before:size-0 before:-translate-y-1/2 before:content-[''] before:border-y-8 before:border-r-8 before:border-y-transparent before:border-r-info",
|
|
1377
|
+
bottom: "origin-top before:absolute before:bottom-full before:left-1/2 before:size-0 before:-translate-x-1/2 before:content-[''] before:border-x-8 before:border-b-8 before:border-x-transparent before:border-b-info",
|
|
1378
|
+
left: "origin-right before:absolute before:left-full before:top-1/2 before:size-0 before:-translate-y-1/2 before:content-[''] before:border-y-8 before:border-l-8 before:border-y-transparent before:border-l-info"
|
|
1379
|
+
}
|
|
1380
|
+
};
|
|
1381
|
+
var contentVariants = (0, import_class_variance_authority5.cva)(baseStyles4, {
|
|
1382
|
+
variants: {
|
|
1383
|
+
side: variants4.side
|
|
1384
|
+
},
|
|
1385
|
+
defaultVariants: {
|
|
1386
|
+
side: "top"
|
|
1387
|
+
}
|
|
1388
|
+
});
|
|
1389
|
+
function TooltipProvider({
|
|
1390
|
+
delayDuration,
|
|
1391
|
+
closeDelay,
|
|
1392
|
+
children
|
|
1393
|
+
}) {
|
|
1394
|
+
const value = useTooltipTimingProviderValue({ delayDuration, closeDelay });
|
|
1395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TooltipTimingProvider, { value, children });
|
|
1396
|
+
}
|
|
1397
|
+
function Tooltip({
|
|
1398
|
+
open,
|
|
1399
|
+
defaultOpen = false,
|
|
1400
|
+
onOpenChange,
|
|
1401
|
+
delayDuration,
|
|
1402
|
+
closeDelay,
|
|
1403
|
+
children
|
|
1404
|
+
}) {
|
|
1405
|
+
const resolvedTimings = useResolvedTooltipTimings({
|
|
1406
|
+
delayDuration,
|
|
1407
|
+
closeDelay
|
|
1408
|
+
});
|
|
1409
|
+
const contextValue = useTooltip({
|
|
1410
|
+
open,
|
|
1411
|
+
defaultOpen,
|
|
1412
|
+
onOpenChange,
|
|
1413
|
+
delayDuration: resolvedTimings.delayDuration,
|
|
1414
|
+
closeDelay: resolvedTimings.closeDelay
|
|
1415
|
+
});
|
|
1416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TooltipRootProvider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { "data-slot": "tooltip", className: "relative inline-flex w-fit", children }) });
|
|
1417
|
+
}
|
|
1418
|
+
function TooltipTrigger({
|
|
1419
|
+
asChild,
|
|
1420
|
+
children,
|
|
1421
|
+
onMouseEnter,
|
|
1422
|
+
onMouseLeave,
|
|
1423
|
+
onFocus,
|
|
1424
|
+
onBlur,
|
|
1425
|
+
...props
|
|
1426
|
+
}) {
|
|
1427
|
+
const trigger = useTooltipTrigger({
|
|
1428
|
+
onMouseEnter,
|
|
1429
|
+
onMouseLeave,
|
|
1430
|
+
onFocus,
|
|
1431
|
+
onBlur
|
|
1432
|
+
});
|
|
1433
|
+
if (asChild) {
|
|
1434
|
+
if (!(0, import_react10.isValidElement)(children)) {
|
|
1435
|
+
throw new Error(
|
|
1436
|
+
"TooltipTrigger with `asChild` expects a valid React element as child."
|
|
1437
|
+
);
|
|
1438
|
+
}
|
|
1439
|
+
const child = children;
|
|
1440
|
+
const childProps = child.props;
|
|
1441
|
+
return (0, import_react10.cloneElement)(child, {
|
|
1442
|
+
...props,
|
|
1443
|
+
...childProps,
|
|
1444
|
+
"aria-describedby": trigger.ariaDescribedBy,
|
|
1445
|
+
onMouseEnter: composeEventHandlers(
|
|
1446
|
+
childProps.onMouseEnter,
|
|
1447
|
+
trigger.onMouseEnter
|
|
1448
|
+
),
|
|
1449
|
+
onMouseLeave: composeEventHandlers(
|
|
1450
|
+
childProps.onMouseLeave,
|
|
1451
|
+
trigger.onMouseLeave
|
|
1452
|
+
),
|
|
1453
|
+
onFocus: composeEventHandlers(childProps.onFocus, trigger.onFocus),
|
|
1454
|
+
onBlur: composeEventHandlers(childProps.onBlur, trigger.onBlur)
|
|
1455
|
+
});
|
|
1456
|
+
}
|
|
1457
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1458
|
+
Button,
|
|
1459
|
+
{
|
|
1460
|
+
"aria-describedby": trigger.ariaDescribedBy,
|
|
1461
|
+
"data-state": trigger.dataState,
|
|
1462
|
+
onMouseEnter: trigger.onMouseEnter,
|
|
1463
|
+
onMouseLeave: trigger.onMouseLeave,
|
|
1464
|
+
onFocus: trigger.onFocus,
|
|
1465
|
+
onBlur: trigger.onBlur,
|
|
1466
|
+
...props,
|
|
1467
|
+
children
|
|
1468
|
+
}
|
|
1469
|
+
);
|
|
1470
|
+
}
|
|
1471
|
+
function TooltipContent({
|
|
1472
|
+
side = "top",
|
|
1473
|
+
offset,
|
|
1474
|
+
className,
|
|
1475
|
+
style,
|
|
1476
|
+
onMouseEnter,
|
|
1477
|
+
onMouseLeave,
|
|
1478
|
+
onFocus,
|
|
1479
|
+
onBlur,
|
|
1480
|
+
children,
|
|
1481
|
+
...props
|
|
1482
|
+
}) {
|
|
1483
|
+
const content = useTooltipContent({
|
|
1484
|
+
side,
|
|
1485
|
+
offset,
|
|
1486
|
+
onMouseEnter,
|
|
1487
|
+
onMouseLeave,
|
|
1488
|
+
onFocus,
|
|
1489
|
+
onBlur
|
|
1490
|
+
});
|
|
1491
|
+
if (!content.isOpen) {
|
|
1492
|
+
return null;
|
|
1493
|
+
}
|
|
1494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1495
|
+
"div",
|
|
1496
|
+
{
|
|
1497
|
+
id: content.contentId,
|
|
1498
|
+
role: "tooltip",
|
|
1499
|
+
"data-slot": "tooltip-content",
|
|
1500
|
+
"data-state": content.dataState,
|
|
1501
|
+
"data-side": content.side,
|
|
1502
|
+
className: cn(contentVariants({ side: content.side }), className),
|
|
1503
|
+
style: {
|
|
1504
|
+
...content.positionStyles,
|
|
1505
|
+
...style
|
|
1506
|
+
},
|
|
1507
|
+
onMouseEnter: content.interactionHandlers.onMouseEnter,
|
|
1508
|
+
onMouseLeave: content.interactionHandlers.onMouseLeave,
|
|
1509
|
+
onFocus: content.interactionHandlers.onFocus,
|
|
1510
|
+
onBlur: content.interactionHandlers.onBlur,
|
|
1511
|
+
...props,
|
|
1512
|
+
children
|
|
1513
|
+
}
|
|
1514
|
+
);
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
// src/components/forms/inputs/label.tsx
|
|
1518
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1519
|
+
var baseStyles5 = "block text-neutral-800 font-paragraph peer-invalid:text-destructive peer-[aria-invalid=true]:text-destructive peer-[data-error]:text-destructive peer";
|
|
1520
|
+
var sizes4 = {
|
|
1521
|
+
sm: "text-sm",
|
|
1522
|
+
md: "text-base font-semibold",
|
|
1523
|
+
lg: "text-lg font-semibold"
|
|
1524
|
+
};
|
|
1525
|
+
var labelVariants = (0, import_class_variance_authority6.cva)(baseStyles5, {
|
|
1526
|
+
variants: {
|
|
1527
|
+
size: sizes4
|
|
1528
|
+
},
|
|
1529
|
+
defaultVariants: {
|
|
1530
|
+
size: "md"
|
|
1531
|
+
}
|
|
1532
|
+
});
|
|
1533
|
+
function Label({
|
|
1534
|
+
children,
|
|
1535
|
+
htmlFor,
|
|
1536
|
+
required,
|
|
1537
|
+
size,
|
|
1538
|
+
className,
|
|
1539
|
+
withTooltip,
|
|
1540
|
+
tooltipContent,
|
|
1541
|
+
...props
|
|
1542
|
+
}) {
|
|
1543
|
+
const variantClasses = cn(labelVariants({ size }), className);
|
|
1544
|
+
if (withTooltip && !tooltipContent) {
|
|
1545
|
+
throw new Error(
|
|
1546
|
+
'Label component: "withTooltip" is true but "tooltipContent" is not provided.'
|
|
1547
|
+
);
|
|
1548
|
+
} else if (withTooltip && tooltipContent) {
|
|
1549
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
1550
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: variantClasses, htmlFor, ...props, children: [
|
|
1551
|
+
children,
|
|
1552
|
+
" ",
|
|
1553
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-destructive", children: " *" })
|
|
1554
|
+
] }),
|
|
1555
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Tooltip, { children: [
|
|
1556
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1557
|
+
Button,
|
|
1558
|
+
{
|
|
1559
|
+
type: "button",
|
|
1560
|
+
variant: "ghost",
|
|
1561
|
+
size: "icon-sm",
|
|
1562
|
+
className: "size-7 cursor-pointer rounded-full text-info hover:text-info-600",
|
|
1563
|
+
children: [
|
|
1564
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react3.CircleQuestionMark, { className: "size-5", "aria-hidden": "true" }),
|
|
1565
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "sr-only", children: "Tooltip" })
|
|
1566
|
+
]
|
|
1567
|
+
}
|
|
1568
|
+
) }),
|
|
1569
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TooltipContent, { children: tooltipContent })
|
|
1570
|
+
] })
|
|
1571
|
+
] });
|
|
1572
|
+
}
|
|
1573
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: variantClasses, htmlFor, ...props, children: [
|
|
1574
|
+
children,
|
|
1575
|
+
" ",
|
|
1576
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-destructive", children: " *" })
|
|
1577
|
+
] });
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
// src/components/forms/inputs/radio.tsx
|
|
1581
|
+
var import_class_variance_authority7 = require("class-variance-authority");
|
|
1582
|
+
|
|
1583
|
+
// src/hooks/use-radio.ts
|
|
1584
|
+
var import_react12 = require("react");
|
|
882
1585
|
|
|
883
1586
|
// src/hooks/context/radio-group.ts
|
|
884
|
-
var
|
|
885
|
-
var RadioGroupContext = (0,
|
|
1587
|
+
var import_react11 = require("react");
|
|
1588
|
+
var RadioGroupContext = (0, import_react11.createContext)(null);
|
|
886
1589
|
function useRadioGroupContext() {
|
|
887
|
-
const context = (0,
|
|
1590
|
+
const context = (0, import_react11.useContext)(RadioGroupContext);
|
|
888
1591
|
if (!context) {
|
|
889
1592
|
throw new Error("RadioItem must be used within a RadioGroup");
|
|
890
1593
|
}
|
|
@@ -902,7 +1605,7 @@ function useRadio({
|
|
|
902
1605
|
id
|
|
903
1606
|
}) {
|
|
904
1607
|
const context = useRadioGroupContext();
|
|
905
|
-
const generatedId = (0,
|
|
1608
|
+
const generatedId = (0, import_react12.useId)();
|
|
906
1609
|
const finalId = id || generatedId;
|
|
907
1610
|
const resolvedVariant = variant || context.variant;
|
|
908
1611
|
const isReadOnly = Boolean(readOnly || context.readOnly);
|
|
@@ -937,7 +1640,7 @@ function useRadio({
|
|
|
937
1640
|
}
|
|
938
1641
|
|
|
939
1642
|
// src/hooks/use-radio-group.ts
|
|
940
|
-
var
|
|
1643
|
+
var import_react13 = require("react");
|
|
941
1644
|
function useRadioGroup({
|
|
942
1645
|
value,
|
|
943
1646
|
defaultValue,
|
|
@@ -947,12 +1650,12 @@ function useRadioGroup({
|
|
|
947
1650
|
disabled = false,
|
|
948
1651
|
readOnly = false
|
|
949
1652
|
}) {
|
|
950
|
-
const generatedName = (0,
|
|
1653
|
+
const generatedName = (0, import_react13.useId)();
|
|
951
1654
|
const groupName = name || generatedName;
|
|
952
|
-
const [internalValue, setInternalValue] = (0,
|
|
1655
|
+
const [internalValue, setInternalValue] = (0, import_react13.useState)(defaultValue);
|
|
953
1656
|
const isControlled = value !== void 0;
|
|
954
1657
|
const selectedValue = isControlled ? value : internalValue;
|
|
955
|
-
const handleValueChange = (0,
|
|
1658
|
+
const handleValueChange = (0, import_react13.useCallback)(
|
|
956
1659
|
(nextValue) => {
|
|
957
1660
|
if (disabled || readOnly) {
|
|
958
1661
|
return;
|
|
@@ -964,7 +1667,7 @@ function useRadioGroup({
|
|
|
964
1667
|
},
|
|
965
1668
|
[disabled, readOnly, isControlled, onValueChange]
|
|
966
1669
|
);
|
|
967
|
-
const contextValue = (0,
|
|
1670
|
+
const contextValue = (0, import_react13.useMemo)(
|
|
968
1671
|
() => ({
|
|
969
1672
|
name: groupName,
|
|
970
1673
|
value: selectedValue,
|
|
@@ -981,19 +1684,19 @@ function useRadioGroup({
|
|
|
981
1684
|
}
|
|
982
1685
|
|
|
983
1686
|
// src/providers/radio-group-provider.tsx
|
|
984
|
-
var
|
|
1687
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
985
1688
|
function RadioGroupProvider({ value, children }) {
|
|
986
|
-
return /* @__PURE__ */ (0,
|
|
1689
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(RadioGroupContext.Provider, { value, children });
|
|
987
1690
|
}
|
|
988
1691
|
|
|
989
|
-
// src/components/inputs/radio.tsx
|
|
990
|
-
var
|
|
991
|
-
var
|
|
992
|
-
var
|
|
1692
|
+
// src/components/forms/inputs/radio.tsx
|
|
1693
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1694
|
+
var baseStyles6 = "peer size-6 shrink-0 appearance-none rounded-full border-2 border-neutral-600 bg-transparent transition-all duration-200 outline-none disabled:border-neutral-400 disabled:bg-transparent focus-visible:ring-2 focus-visible:ring-offset-1 cursor-pointer disabled:cursor-not-allowed group-data-[readonly=true]/radio:cursor-default";
|
|
1695
|
+
var variants5 = {
|
|
993
1696
|
default: "hover:border-info-500 hover:bg-info-50 focus-visible:border-info-500 focus-visible:ring-info-500/20 checked:border-info-500 checked:hover:border-info-600 disabled:hover:border-neutral-400 disabled:hover:bg-transparent",
|
|
994
1697
|
success: "hover:border-success-500 hover:bg-success-50 focus-visible:border-success-500 focus-visible:ring-success-500/20 checked:border-success-500 checked:hover:border-success-600 disabled:hover:border-neutral-400 disabled:hover:bg-transparent"
|
|
995
1698
|
};
|
|
996
|
-
var indicatorVariants = (0,
|
|
1699
|
+
var indicatorVariants = (0, import_class_variance_authority7.cva)(
|
|
997
1700
|
"pointer-events-none absolute z-10 size-3 rounded-full opacity-0 transition-opacity group-has-checked/control:opacity-100",
|
|
998
1701
|
{
|
|
999
1702
|
variants: {
|
|
@@ -1007,9 +1710,9 @@ var indicatorVariants = (0, import_class_variance_authority4.cva)(
|
|
|
1007
1710
|
}
|
|
1008
1711
|
}
|
|
1009
1712
|
);
|
|
1010
|
-
var radioVariants = (0,
|
|
1713
|
+
var radioVariants = (0, import_class_variance_authority7.cva)(baseStyles6, {
|
|
1011
1714
|
variants: {
|
|
1012
|
-
variant:
|
|
1715
|
+
variant: variants5
|
|
1013
1716
|
},
|
|
1014
1717
|
defaultVariants: {
|
|
1015
1718
|
variant: "default"
|
|
@@ -1036,7 +1739,7 @@ function RadioGroup({
|
|
|
1036
1739
|
disabled,
|
|
1037
1740
|
readOnly
|
|
1038
1741
|
});
|
|
1039
|
-
return /* @__PURE__ */ (0,
|
|
1742
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(RadioGroupProvider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1040
1743
|
"div",
|
|
1041
1744
|
{
|
|
1042
1745
|
role: "radiogroup",
|
|
@@ -1087,7 +1790,7 @@ function RadioItem({
|
|
|
1087
1790
|
className,
|
|
1088
1791
|
classNames?.input
|
|
1089
1792
|
);
|
|
1090
|
-
return /* @__PURE__ */ (0,
|
|
1793
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
1091
1794
|
"label",
|
|
1092
1795
|
{
|
|
1093
1796
|
"data-slot": "radio",
|
|
@@ -1099,13 +1802,13 @@ function RadioItem({
|
|
|
1099
1802
|
classNames?.root
|
|
1100
1803
|
),
|
|
1101
1804
|
children: [
|
|
1102
|
-
/* @__PURE__ */ (0,
|
|
1805
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
1103
1806
|
"span",
|
|
1104
1807
|
{
|
|
1105
1808
|
role: "presentation",
|
|
1106
1809
|
className: "group/control relative flex size-6 shrink-0 items-center justify-center",
|
|
1107
1810
|
children: [
|
|
1108
|
-
/* @__PURE__ */ (0,
|
|
1811
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1109
1812
|
"input",
|
|
1110
1813
|
{
|
|
1111
1814
|
id,
|
|
@@ -1121,7 +1824,7 @@ function RadioItem({
|
|
|
1121
1824
|
...props
|
|
1122
1825
|
}
|
|
1123
1826
|
),
|
|
1124
|
-
/* @__PURE__ */ (0,
|
|
1827
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1125
1828
|
"span",
|
|
1126
1829
|
{
|
|
1127
1830
|
"aria-hidden": "true",
|
|
@@ -1135,7 +1838,7 @@ function RadioItem({
|
|
|
1135
1838
|
]
|
|
1136
1839
|
}
|
|
1137
1840
|
),
|
|
1138
|
-
children ? /* @__PURE__ */ (0,
|
|
1841
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1139
1842
|
"span",
|
|
1140
1843
|
{
|
|
1141
1844
|
"data-slot": "radio-label",
|
|
@@ -1151,12 +1854,12 @@ function RadioItem({
|
|
|
1151
1854
|
);
|
|
1152
1855
|
}
|
|
1153
1856
|
|
|
1154
|
-
// src/components/inputs/switch.tsx
|
|
1155
|
-
var
|
|
1156
|
-
var
|
|
1157
|
-
var
|
|
1158
|
-
var
|
|
1159
|
-
"group relative inline-flex h-6 w-11 items-center rounded-sm p-0.5 transition-colors duration-300",
|
|
1857
|
+
// src/components/forms/inputs/switch.tsx
|
|
1858
|
+
var import_class_variance_authority8 = require("class-variance-authority");
|
|
1859
|
+
var import_react14 = require("react");
|
|
1860
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1861
|
+
var baseStyles7 = [
|
|
1862
|
+
"peer group relative inline-flex h-6 w-11 items-center rounded-sm p-0.5 transition-colors duration-300",
|
|
1160
1863
|
"[&_>span]:block [&_>span]:size-5 [&_>span]:rounded-full [&_>span]:transition-all [&_>span]:duration-300 [&_>span]:group-has-checked:translate-x-full",
|
|
1161
1864
|
"bg-neutral-300 group-hover:bg-neutral-400",
|
|
1162
1865
|
"[&_>span]:bg-neutral-500 group-hover:[&_>span]:bg-neutral-600",
|
|
@@ -1166,7 +1869,7 @@ var baseStyles5 = [
|
|
|
1166
1869
|
"group-has-disabled:group-hover:bg-neutral-200 group-has-disabled:[&_>span]:bg-neutral-400 group-has-disabled:group-hover:[&_>span]:bg-neutral-400",
|
|
1167
1870
|
"group-has-disabled:group-has-checked:[&_>span]:bg-neutral-200 group-has-disabled:group-has-checked:group-hover:[&_>span]:bg-neutral-200"
|
|
1168
1871
|
];
|
|
1169
|
-
var
|
|
1872
|
+
var variants6 = {
|
|
1170
1873
|
default: [
|
|
1171
1874
|
"group-has-checked:bg-info-500 group-has-checked:group-hover:bg-info-700",
|
|
1172
1875
|
"group-has-disabled:group-has-checked:bg-info-50 group-has-disabled:group-has-checked:group-hover:bg-info-50"
|
|
@@ -1176,9 +1879,9 @@ var variants5 = {
|
|
|
1176
1879
|
"group-has-disabled:group-has-checked:bg-alt2-50 group-has-disabled:group-has-checked:group-hover:bg-alt2-50"
|
|
1177
1880
|
]
|
|
1178
1881
|
};
|
|
1179
|
-
var switchVariants2 = (0,
|
|
1882
|
+
var switchVariants2 = (0, import_class_variance_authority8.cva)(baseStyles7, {
|
|
1180
1883
|
variants: {
|
|
1181
|
-
variant:
|
|
1884
|
+
variant: variants6
|
|
1182
1885
|
},
|
|
1183
1886
|
defaultVariants: {
|
|
1184
1887
|
variant: "default"
|
|
@@ -1192,10 +1895,10 @@ function Switch({
|
|
|
1192
1895
|
className,
|
|
1193
1896
|
...props
|
|
1194
1897
|
}) {
|
|
1195
|
-
const generatedId = (0,
|
|
1898
|
+
const generatedId = (0, import_react14.useId)();
|
|
1196
1899
|
const id = propsId || generatedId;
|
|
1197
1900
|
const classes = cn(switchVariants2({ variant }), classNames?.input);
|
|
1198
|
-
return /* @__PURE__ */ (0,
|
|
1901
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1199
1902
|
"label",
|
|
1200
1903
|
{
|
|
1201
1904
|
htmlFor: id,
|
|
@@ -1206,9 +1909,9 @@ function Switch({
|
|
|
1206
1909
|
classNames?.root
|
|
1207
1910
|
),
|
|
1208
1911
|
children: [
|
|
1209
|
-
/* @__PURE__ */ (0,
|
|
1210
|
-
/* @__PURE__ */ (0,
|
|
1211
|
-
/* @__PURE__ */ (0,
|
|
1912
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: classes, children: [
|
|
1913
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("input", { ...props, id, type: "checkbox", className: "sr-only" }),
|
|
1914
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { "aria-hidden": "true", className: cn(classNames?.indicator) })
|
|
1212
1915
|
] }),
|
|
1213
1916
|
children
|
|
1214
1917
|
]
|
|
@@ -1217,7 +1920,7 @@ function Switch({
|
|
|
1217
1920
|
}
|
|
1218
1921
|
|
|
1219
1922
|
// src/components/surfaces/card.tsx
|
|
1220
|
-
var
|
|
1923
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1221
1924
|
function Card({ as = "div", className, interactive, ...props }) {
|
|
1222
1925
|
const cardClassName = cn(
|
|
1223
1926
|
"flex flex-col gap-5 rounded-lg bg-card p-4 text-card-foreground",
|
|
@@ -1225,15 +1928,15 @@ function Card({ as = "div", className, interactive, ...props }) {
|
|
|
1225
1928
|
className
|
|
1226
1929
|
);
|
|
1227
1930
|
if (as === "article") {
|
|
1228
|
-
return /* @__PURE__ */ (0,
|
|
1931
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("article", { "data-slot": "card", className: cardClassName, ...props });
|
|
1229
1932
|
}
|
|
1230
1933
|
if (as === "section") {
|
|
1231
|
-
return /* @__PURE__ */ (0,
|
|
1934
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("section", { "data-slot": "card", className: cardClassName, ...props });
|
|
1232
1935
|
}
|
|
1233
|
-
return /* @__PURE__ */ (0,
|
|
1936
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { "data-slot": "card", className: cardClassName, ...props });
|
|
1234
1937
|
}
|
|
1235
1938
|
function CardHeader({ className, ...props }) {
|
|
1236
|
-
return /* @__PURE__ */ (0,
|
|
1939
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1237
1940
|
"header",
|
|
1238
1941
|
{
|
|
1239
1942
|
"data-slot": "card-header",
|
|
@@ -1246,7 +1949,7 @@ function CardHeader({ className, ...props }) {
|
|
|
1246
1949
|
);
|
|
1247
1950
|
}
|
|
1248
1951
|
function CardTitle({ className, ...props }) {
|
|
1249
|
-
return /* @__PURE__ */ (0,
|
|
1952
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1250
1953
|
"h3",
|
|
1251
1954
|
{
|
|
1252
1955
|
"data-slot": "card-title",
|
|
@@ -1256,7 +1959,7 @@ function CardTitle({ className, ...props }) {
|
|
|
1256
1959
|
);
|
|
1257
1960
|
}
|
|
1258
1961
|
function CardDescription({ className, ...props }) {
|
|
1259
|
-
return /* @__PURE__ */ (0,
|
|
1962
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1260
1963
|
"p",
|
|
1261
1964
|
{
|
|
1262
1965
|
"data-slot": "card-description",
|
|
@@ -1266,7 +1969,7 @@ function CardDescription({ className, ...props }) {
|
|
|
1266
1969
|
);
|
|
1267
1970
|
}
|
|
1268
1971
|
function CardAction({ className, ...props }) {
|
|
1269
|
-
return /* @__PURE__ */ (0,
|
|
1972
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1270
1973
|
"div",
|
|
1271
1974
|
{
|
|
1272
1975
|
"data-slot": "card-action",
|
|
@@ -1279,10 +1982,10 @@ function CardAction({ className, ...props }) {
|
|
|
1279
1982
|
);
|
|
1280
1983
|
}
|
|
1281
1984
|
function CardContent({ className, ...props }) {
|
|
1282
|
-
return /* @__PURE__ */ (0,
|
|
1985
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("section", { "data-slot": "card-content", className: cn(className), ...props });
|
|
1283
1986
|
}
|
|
1284
1987
|
function CardFooter({ className, ...props }) {
|
|
1285
|
-
return /* @__PURE__ */ (0,
|
|
1988
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1286
1989
|
"footer",
|
|
1287
1990
|
{
|
|
1288
1991
|
"data-slot": "card-footer",
|
|
@@ -1291,30 +1994,6 @@ function CardFooter({ className, ...props }) {
|
|
|
1291
1994
|
}
|
|
1292
1995
|
);
|
|
1293
1996
|
}
|
|
1294
|
-
|
|
1295
|
-
// src/components/icons/menu/closeX.tsx
|
|
1296
|
-
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1297
|
-
function CloseX({ className, ...props }) {
|
|
1298
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1299
|
-
"svg",
|
|
1300
|
-
{
|
|
1301
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1302
|
-
fill: "none",
|
|
1303
|
-
viewBox: "0 0 24 24",
|
|
1304
|
-
className,
|
|
1305
|
-
...props,
|
|
1306
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1307
|
-
"path",
|
|
1308
|
-
{
|
|
1309
|
-
stroke: "currentColor",
|
|
1310
|
-
strokeLinecap: "round",
|
|
1311
|
-
strokeLinejoin: "round",
|
|
1312
|
-
d: "m18 18-6-6m0 0L6 6m6 6 6-6m-6 6-6 6"
|
|
1313
|
-
}
|
|
1314
|
-
)
|
|
1315
|
-
}
|
|
1316
|
-
);
|
|
1317
|
-
}
|
|
1318
1997
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1319
1998
|
0 && (module.exports = {
|
|
1320
1999
|
Button,
|
|
@@ -1328,7 +2007,11 @@ function CloseX({ className, ...props }) {
|
|
|
1328
2007
|
Check,
|
|
1329
2008
|
Checkbox,
|
|
1330
2009
|
CloseX,
|
|
2010
|
+
Form,
|
|
2011
|
+
HelperMessage,
|
|
2012
|
+
HelperText,
|
|
1331
2013
|
Input,
|
|
2014
|
+
Label,
|
|
1332
2015
|
Minus,
|
|
1333
2016
|
MoneyInput,
|
|
1334
2017
|
NumberInput,
|
|
@@ -1337,6 +2020,10 @@ function CloseX({ className, ...props }) {
|
|
|
1337
2020
|
RadioGroup,
|
|
1338
2021
|
RadioItem,
|
|
1339
2022
|
Switch,
|
|
2023
|
+
Tooltip,
|
|
2024
|
+
TooltipContent,
|
|
2025
|
+
TooltipProvider,
|
|
2026
|
+
TooltipTrigger,
|
|
1340
2027
|
cn,
|
|
1341
2028
|
inputTypes,
|
|
1342
2029
|
useFormattedNumericInput,
|