@algodomain/smart-forms 0.1.6 → 0.1.8
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/{chunk-X75PSJXO.cjs → chunk-I5HYLSDJ.cjs} +93 -93
- package/dist/chunk-I5HYLSDJ.cjs.map +1 -0
- package/dist/{chunk-VDV7A7YZ.js → chunk-ONWU4O23.js} +5 -5
- package/dist/chunk-ONWU4O23.js.map +1 -0
- package/dist/{chunk-RHECLW3K.js → chunk-S4UZYPMB.js} +9 -3
- package/dist/chunk-S4UZYPMB.js.map +1 -0
- package/dist/{chunk-WIBCOQPP.cjs → chunk-VOLW7NZ4.cjs} +9 -2
- package/dist/chunk-VOLW7NZ4.cjs.map +1 -0
- package/dist/fields.cjs +101 -101
- package/dist/fields.js +4 -4
- package/dist/index.cjs +8934 -186
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +8818 -67
- package/dist/index.js.map +1 -1
- package/dist/opinionated.cjs +18 -18
- package/dist/opinionated.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-RHECLW3K.js.map +0 -1
- package/dist/chunk-VDV7A7YZ.js.map +0 -1
- package/dist/chunk-WIBCOQPP.cjs.map +0 -1
- package/dist/chunk-X75PSJXO.cjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkVOLW7NZ4_cjs = require('./chunk-VOLW7NZ4.cjs');
|
|
4
4
|
var React6 = require('react');
|
|
5
5
|
var CheckboxPrimitive = require('@radix-ui/react-checkbox');
|
|
6
6
|
var lucideReact = require('lucide-react');
|
|
@@ -50,7 +50,7 @@ function Checkbox({
|
|
|
50
50
|
CheckboxPrimitive__namespace.Root,
|
|
51
51
|
{
|
|
52
52
|
"data-slot": "checkbox",
|
|
53
|
-
className:
|
|
53
|
+
className: chunkVOLW7NZ4_cjs.cn(
|
|
54
54
|
"peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
55
55
|
className
|
|
56
56
|
),
|
|
@@ -78,9 +78,9 @@ var SmartCheckbox = ({
|
|
|
78
78
|
disabled,
|
|
79
79
|
hidden
|
|
80
80
|
}) => {
|
|
81
|
-
const { formData } =
|
|
82
|
-
const { value, error, onChange, fieldRef, registerValidation } =
|
|
83
|
-
const fieldDetection =
|
|
81
|
+
const { formData } = chunkVOLW7NZ4_cjs.useSmartForm();
|
|
82
|
+
const { value, error, onChange, fieldRef, registerValidation } = chunkVOLW7NZ4_cjs.useFormField(field);
|
|
83
|
+
const fieldDetection = chunkVOLW7NZ4_cjs.useFieldDetection();
|
|
84
84
|
const hasRegistered = React6.useRef(false);
|
|
85
85
|
const hasSetDefault = React6.useRef(false);
|
|
86
86
|
const isDisabled = typeof disabled === "function" ? disabled(formData) : disabled || false;
|
|
@@ -119,15 +119,15 @@ var SmartCheckbox = ({
|
|
|
119
119
|
disabled: isDisabled
|
|
120
120
|
}
|
|
121
121
|
),
|
|
122
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
122
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkVOLW7NZ4_cjs.Label, { htmlFor: `${field}-checkbox`, className: "text-sm font-normal cursor-pointer", children: [
|
|
123
123
|
label || field,
|
|
124
124
|
" ",
|
|
125
125
|
required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-destructive", children: "*" })
|
|
126
126
|
] })
|
|
127
127
|
] }),
|
|
128
|
-
info && /* @__PURE__ */ jsxRuntime.jsx(
|
|
129
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
130
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
128
|
+
info && /* @__PURE__ */ jsxRuntime.jsx(chunkVOLW7NZ4_cjs.TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(chunkVOLW7NZ4_cjs.Tooltip, { children: [
|
|
129
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVOLW7NZ4_cjs.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.InfoIcon, { className: "h-4 w-4 text-muted-foreground cursor-pointer mr-2" }) }),
|
|
130
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVOLW7NZ4_cjs.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "max-w-xs", children: info }) })
|
|
131
131
|
] }) })
|
|
132
132
|
] }),
|
|
133
133
|
subLabel && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground ml-6", children: subLabel })
|
|
@@ -143,7 +143,7 @@ function RadioGroup({
|
|
|
143
143
|
RadioGroupPrimitive__namespace.Root,
|
|
144
144
|
{
|
|
145
145
|
"data-slot": "radio-group",
|
|
146
|
-
className:
|
|
146
|
+
className: chunkVOLW7NZ4_cjs.cn("grid gap-3", className),
|
|
147
147
|
...props
|
|
148
148
|
}
|
|
149
149
|
);
|
|
@@ -156,7 +156,7 @@ function RadioGroupItem({
|
|
|
156
156
|
RadioGroupPrimitive__namespace.Item,
|
|
157
157
|
{
|
|
158
158
|
"data-slot": "radio-group-item",
|
|
159
|
-
className:
|
|
159
|
+
className: chunkVOLW7NZ4_cjs.cn(
|
|
160
160
|
"border-input text-primary 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 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
161
161
|
className
|
|
162
162
|
),
|
|
@@ -187,9 +187,9 @@ var SmartRadioGroup = ({
|
|
|
187
187
|
disabled,
|
|
188
188
|
hidden
|
|
189
189
|
}) => {
|
|
190
|
-
const { formData } =
|
|
191
|
-
const { value, error, onChange, fieldRef, registerValidation } =
|
|
192
|
-
const fieldDetection =
|
|
190
|
+
const { formData } = chunkVOLW7NZ4_cjs.useSmartForm();
|
|
191
|
+
const { value, error, onChange, fieldRef, registerValidation } = chunkVOLW7NZ4_cjs.useFormField(field);
|
|
192
|
+
const fieldDetection = chunkVOLW7NZ4_cjs.useFieldDetection();
|
|
193
193
|
const hasRegistered = React6.useRef(false);
|
|
194
194
|
const hasSetDefault = React6.useRef(false);
|
|
195
195
|
const isDisabled = typeof disabled === "function" ? disabled(formData) : disabled || false;
|
|
@@ -215,14 +215,14 @@ var SmartRadioGroup = ({
|
|
|
215
215
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex-1 min-w-0 ${className}`, children: [
|
|
216
216
|
label && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-2", children: [
|
|
217
217
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
218
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
218
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkVOLW7NZ4_cjs.Label, { className: "text-sm font-medium text-foreground", children: [
|
|
219
219
|
label,
|
|
220
220
|
" ",
|
|
221
221
|
required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-destructive", children: "*" })
|
|
222
222
|
] }),
|
|
223
|
-
info && /* @__PURE__ */ jsxRuntime.jsx(
|
|
224
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
225
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
223
|
+
info && /* @__PURE__ */ jsxRuntime.jsx(chunkVOLW7NZ4_cjs.TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(chunkVOLW7NZ4_cjs.Tooltip, { children: [
|
|
224
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVOLW7NZ4_cjs.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.InfoIcon, { className: "h-4 w-4 text-muted-foreground cursor-pointer mr-2" }) }),
|
|
225
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVOLW7NZ4_cjs.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "max-w-xs", children: info }) })
|
|
226
226
|
] }) })
|
|
227
227
|
] }),
|
|
228
228
|
subLabel && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-1", children: subLabel })
|
|
@@ -246,7 +246,7 @@ var SmartRadioGroup = ({
|
|
|
246
246
|
}
|
|
247
247
|
),
|
|
248
248
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
249
|
-
|
|
249
|
+
chunkVOLW7NZ4_cjs.Label,
|
|
250
250
|
{
|
|
251
251
|
htmlFor: `${field}-${option.value}`,
|
|
252
252
|
className: "text-sm font-normal cursor-pointer",
|
|
@@ -280,7 +280,7 @@ function SelectTrigger({
|
|
|
280
280
|
{
|
|
281
281
|
"data-slot": "select-trigger",
|
|
282
282
|
"data-size": size,
|
|
283
|
-
className:
|
|
283
|
+
className: chunkVOLW7NZ4_cjs.cn(
|
|
284
284
|
"border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-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 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
285
285
|
className
|
|
286
286
|
),
|
|
@@ -302,7 +302,7 @@ function SelectContent({
|
|
|
302
302
|
SelectPrimitive__namespace.Content,
|
|
303
303
|
{
|
|
304
304
|
"data-slot": "select-content",
|
|
305
|
-
className:
|
|
305
|
+
className: chunkVOLW7NZ4_cjs.cn(
|
|
306
306
|
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
|
|
307
307
|
position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
308
308
|
className
|
|
@@ -314,7 +314,7 @@ function SelectContent({
|
|
|
314
314
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
315
315
|
SelectPrimitive__namespace.Viewport,
|
|
316
316
|
{
|
|
317
|
-
className:
|
|
317
|
+
className: chunkVOLW7NZ4_cjs.cn(
|
|
318
318
|
"p-1",
|
|
319
319
|
position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
|
|
320
320
|
),
|
|
@@ -335,7 +335,7 @@ function SelectItem({
|
|
|
335
335
|
SelectPrimitive__namespace.Item,
|
|
336
336
|
{
|
|
337
337
|
"data-slot": "select-item",
|
|
338
|
-
className:
|
|
338
|
+
className: chunkVOLW7NZ4_cjs.cn(
|
|
339
339
|
"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
340
340
|
className
|
|
341
341
|
),
|
|
@@ -355,7 +355,7 @@ function SelectScrollUpButton({
|
|
|
355
355
|
SelectPrimitive__namespace.ScrollUpButton,
|
|
356
356
|
{
|
|
357
357
|
"data-slot": "select-scroll-up-button",
|
|
358
|
-
className:
|
|
358
|
+
className: chunkVOLW7NZ4_cjs.cn(
|
|
359
359
|
"flex cursor-default items-center justify-center py-1",
|
|
360
360
|
className
|
|
361
361
|
),
|
|
@@ -372,7 +372,7 @@ function SelectScrollDownButton({
|
|
|
372
372
|
SelectPrimitive__namespace.ScrollDownButton,
|
|
373
373
|
{
|
|
374
374
|
"data-slot": "select-scroll-down-button",
|
|
375
|
-
className:
|
|
375
|
+
className: chunkVOLW7NZ4_cjs.cn(
|
|
376
376
|
"flex cursor-default items-center justify-center py-1",
|
|
377
377
|
className
|
|
378
378
|
),
|
|
@@ -395,9 +395,9 @@ var SmartSelect = ({
|
|
|
395
395
|
disabled,
|
|
396
396
|
hidden
|
|
397
397
|
}) => {
|
|
398
|
-
const { formData } =
|
|
399
|
-
const { value, error, onChange, fieldRef, registerValidation } =
|
|
400
|
-
const fieldDetection =
|
|
398
|
+
const { formData } = chunkVOLW7NZ4_cjs.useSmartForm();
|
|
399
|
+
const { value, error, onChange, fieldRef, registerValidation } = chunkVOLW7NZ4_cjs.useFormField(field);
|
|
400
|
+
const fieldDetection = chunkVOLW7NZ4_cjs.useFieldDetection();
|
|
401
401
|
const hasRegistered = React6.useRef(false);
|
|
402
402
|
const hasSetDefault = React6.useRef(false);
|
|
403
403
|
const isDisabled = typeof disabled === "function" ? disabled(formData) : disabled || false;
|
|
@@ -423,14 +423,14 @@ var SmartSelect = ({
|
|
|
423
423
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex-1 min-w-0 ${className}`, children: [
|
|
424
424
|
label && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-2", children: [
|
|
425
425
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
426
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
426
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkVOLW7NZ4_cjs.Label, { className: "text-sm font-medium text-foreground", children: [
|
|
427
427
|
label,
|
|
428
428
|
" ",
|
|
429
429
|
required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-destructive", children: "*" })
|
|
430
430
|
] }),
|
|
431
|
-
info && /* @__PURE__ */ jsxRuntime.jsx(
|
|
432
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
433
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
431
|
+
info && /* @__PURE__ */ jsxRuntime.jsx(chunkVOLW7NZ4_cjs.TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(chunkVOLW7NZ4_cjs.Tooltip, { children: [
|
|
432
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVOLW7NZ4_cjs.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.InfoIcon, { className: "h-4 w-4 text-muted-foreground cursor-pointer mr-2" }) }),
|
|
433
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVOLW7NZ4_cjs.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "max-w-xs", children: info }) })
|
|
434
434
|
] }) })
|
|
435
435
|
] }),
|
|
436
436
|
subLabel && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-1", children: subLabel })
|
|
@@ -480,7 +480,7 @@ function PopoverContent({
|
|
|
480
480
|
"data-slot": "popover-content",
|
|
481
481
|
align,
|
|
482
482
|
sideOffset,
|
|
483
|
-
className:
|
|
483
|
+
className: chunkVOLW7NZ4_cjs.cn(
|
|
484
484
|
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
|
|
485
485
|
className
|
|
486
486
|
),
|
|
@@ -525,7 +525,7 @@ function Button({
|
|
|
525
525
|
Comp,
|
|
526
526
|
{
|
|
527
527
|
"data-slot": "button",
|
|
528
|
-
className:
|
|
528
|
+
className: chunkVOLW7NZ4_cjs.cn(buttonVariants({ variant, size, className })),
|
|
529
529
|
...props
|
|
530
530
|
}
|
|
531
531
|
);
|
|
@@ -538,7 +538,7 @@ function Command({
|
|
|
538
538
|
cmdk.Command,
|
|
539
539
|
{
|
|
540
540
|
"data-slot": "command",
|
|
541
|
-
className:
|
|
541
|
+
className: chunkVOLW7NZ4_cjs.cn(
|
|
542
542
|
"bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",
|
|
543
543
|
className
|
|
544
544
|
),
|
|
@@ -561,7 +561,7 @@ function CommandInput({
|
|
|
561
561
|
cmdk.Command.Input,
|
|
562
562
|
{
|
|
563
563
|
"data-slot": "command-input",
|
|
564
|
-
className:
|
|
564
|
+
className: chunkVOLW7NZ4_cjs.cn(
|
|
565
565
|
"placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
|
|
566
566
|
className
|
|
567
567
|
),
|
|
@@ -580,7 +580,7 @@ function CommandList({
|
|
|
580
580
|
cmdk.Command.List,
|
|
581
581
|
{
|
|
582
582
|
"data-slot": "command-list",
|
|
583
|
-
className:
|
|
583
|
+
className: chunkVOLW7NZ4_cjs.cn(
|
|
584
584
|
"max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",
|
|
585
585
|
className
|
|
586
586
|
),
|
|
@@ -608,7 +608,7 @@ function CommandGroup({
|
|
|
608
608
|
cmdk.Command.Group,
|
|
609
609
|
{
|
|
610
610
|
"data-slot": "command-group",
|
|
611
|
-
className:
|
|
611
|
+
className: chunkVOLW7NZ4_cjs.cn(
|
|
612
612
|
"text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",
|
|
613
613
|
className
|
|
614
614
|
),
|
|
@@ -624,7 +624,7 @@ function CommandItem({
|
|
|
624
624
|
cmdk.Command.Item,
|
|
625
625
|
{
|
|
626
626
|
"data-slot": "command-item",
|
|
627
|
-
className:
|
|
627
|
+
className: chunkVOLW7NZ4_cjs.cn(
|
|
628
628
|
"data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
629
629
|
className
|
|
630
630
|
),
|
|
@@ -659,7 +659,7 @@ function Badge({
|
|
|
659
659
|
Comp,
|
|
660
660
|
{
|
|
661
661
|
"data-slot": "badge",
|
|
662
|
-
className:
|
|
662
|
+
className: chunkVOLW7NZ4_cjs.cn(badgeVariants({ variant }), className),
|
|
663
663
|
...props
|
|
664
664
|
}
|
|
665
665
|
);
|
|
@@ -710,7 +710,7 @@ function Combobox({
|
|
|
710
710
|
]
|
|
711
711
|
}
|
|
712
712
|
) }),
|
|
713
|
-
/* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-[var(--radix-popover-trigger-width)] p-0", children: /* @__PURE__ */ jsxRuntime.jsxs(Command, { className: "w-full", shouldFilter: false, children: [
|
|
713
|
+
/* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-[var(--radix-popover-trigger-width)] p-0", children: /* @__PURE__ */ jsxRuntime.jsxs(Command, { className: "w-full", shouldFilter: false, filter: () => 1, children: [
|
|
714
714
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
715
715
|
CommandInput,
|
|
716
716
|
{
|
|
@@ -723,7 +723,7 @@ function Combobox({
|
|
|
723
723
|
/* @__PURE__ */ jsxRuntime.jsx(CommandList, { children: filteredOptions.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(CommandGroup, { className: "max-h-[200px] overflow-y-auto", children: filteredOptions.map((option) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
724
724
|
CommandItem,
|
|
725
725
|
{
|
|
726
|
-
value: option.
|
|
726
|
+
value: option.value,
|
|
727
727
|
onSelect: () => {
|
|
728
728
|
onChange(value === option.value ? "" : option.value);
|
|
729
729
|
setOpen(false);
|
|
@@ -793,9 +793,9 @@ var SmartCombobox = ({
|
|
|
793
793
|
disabled,
|
|
794
794
|
hidden
|
|
795
795
|
}) => {
|
|
796
|
-
const { formData } =
|
|
797
|
-
const { value, error, onChange, fieldRef, registerValidation } =
|
|
798
|
-
const fieldDetection =
|
|
796
|
+
const { formData } = chunkVOLW7NZ4_cjs.useSmartForm();
|
|
797
|
+
const { value, error, onChange, fieldRef, registerValidation } = chunkVOLW7NZ4_cjs.useFormField(field);
|
|
798
|
+
const fieldDetection = chunkVOLW7NZ4_cjs.useFieldDetection();
|
|
799
799
|
const hasRegistered = React6.useRef(false);
|
|
800
800
|
const hasSetDefault = React6.useRef(false);
|
|
801
801
|
const isDisabled = typeof disabled === "function" ? disabled(formData) : disabled || false;
|
|
@@ -821,14 +821,14 @@ var SmartCombobox = ({
|
|
|
821
821
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex-1 min-w-0 ${className}`, children: [
|
|
822
822
|
label && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-2", children: [
|
|
823
823
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
824
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
824
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkVOLW7NZ4_cjs.Label, { className: "text-sm font-medium text-foreground", children: [
|
|
825
825
|
label,
|
|
826
826
|
" ",
|
|
827
827
|
required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-destructive", children: "*" })
|
|
828
828
|
] }),
|
|
829
|
-
info && /* @__PURE__ */ jsxRuntime.jsx(
|
|
830
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
831
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
829
|
+
info && /* @__PURE__ */ jsxRuntime.jsx(chunkVOLW7NZ4_cjs.TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(chunkVOLW7NZ4_cjs.Tooltip, { children: [
|
|
830
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVOLW7NZ4_cjs.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.InfoIcon, { className: "h-4 w-4 text-muted-foreground cursor-pointer mr-2" }) }),
|
|
831
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVOLW7NZ4_cjs.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "max-w-xs", children: info }) })
|
|
832
832
|
] }) })
|
|
833
833
|
] }),
|
|
834
834
|
subLabel && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-1", children: subLabel })
|
|
@@ -862,7 +862,7 @@ function Calendar({
|
|
|
862
862
|
reactDayPicker.DayPicker,
|
|
863
863
|
{
|
|
864
864
|
showOutsideDays,
|
|
865
|
-
className:
|
|
865
|
+
className: chunkVOLW7NZ4_cjs.cn(
|
|
866
866
|
"bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
|
|
867
867
|
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
868
868
|
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
@@ -874,85 +874,85 @@ function Calendar({
|
|
|
874
874
|
...formatters
|
|
875
875
|
},
|
|
876
876
|
classNames: {
|
|
877
|
-
root:
|
|
878
|
-
months:
|
|
877
|
+
root: chunkVOLW7NZ4_cjs.cn("w-fit", defaultClassNames.root),
|
|
878
|
+
months: chunkVOLW7NZ4_cjs.cn(
|
|
879
879
|
"flex gap-4 flex-col md:flex-row relative",
|
|
880
880
|
defaultClassNames.months
|
|
881
881
|
),
|
|
882
|
-
month:
|
|
883
|
-
nav:
|
|
882
|
+
month: chunkVOLW7NZ4_cjs.cn("flex flex-col w-full gap-4", defaultClassNames.month),
|
|
883
|
+
nav: chunkVOLW7NZ4_cjs.cn(
|
|
884
884
|
"flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",
|
|
885
885
|
defaultClassNames.nav
|
|
886
886
|
),
|
|
887
|
-
button_previous:
|
|
887
|
+
button_previous: chunkVOLW7NZ4_cjs.cn(
|
|
888
888
|
buttonVariants({ variant: buttonVariant }),
|
|
889
889
|
"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
|
|
890
890
|
defaultClassNames.button_previous
|
|
891
891
|
),
|
|
892
|
-
button_next:
|
|
892
|
+
button_next: chunkVOLW7NZ4_cjs.cn(
|
|
893
893
|
buttonVariants({ variant: buttonVariant }),
|
|
894
894
|
"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
|
|
895
895
|
defaultClassNames.button_next
|
|
896
896
|
),
|
|
897
|
-
month_caption:
|
|
897
|
+
month_caption: chunkVOLW7NZ4_cjs.cn(
|
|
898
898
|
"flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",
|
|
899
899
|
defaultClassNames.month_caption
|
|
900
900
|
),
|
|
901
|
-
dropdowns:
|
|
901
|
+
dropdowns: chunkVOLW7NZ4_cjs.cn(
|
|
902
902
|
"w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",
|
|
903
903
|
defaultClassNames.dropdowns
|
|
904
904
|
),
|
|
905
|
-
dropdown_root:
|
|
905
|
+
dropdown_root: chunkVOLW7NZ4_cjs.cn(
|
|
906
906
|
"relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",
|
|
907
907
|
defaultClassNames.dropdown_root
|
|
908
908
|
),
|
|
909
|
-
dropdown:
|
|
909
|
+
dropdown: chunkVOLW7NZ4_cjs.cn(
|
|
910
910
|
"absolute bg-popover inset-0 opacity-0",
|
|
911
911
|
defaultClassNames.dropdown
|
|
912
912
|
),
|
|
913
|
-
caption_label:
|
|
913
|
+
caption_label: chunkVOLW7NZ4_cjs.cn(
|
|
914
914
|
"select-none font-medium",
|
|
915
915
|
captionLayout === "label" ? "text-sm" : "rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",
|
|
916
916
|
defaultClassNames.caption_label
|
|
917
917
|
),
|
|
918
918
|
table: "w-full border-collapse",
|
|
919
|
-
weekdays:
|
|
920
|
-
weekday:
|
|
919
|
+
weekdays: chunkVOLW7NZ4_cjs.cn("flex", defaultClassNames.weekdays),
|
|
920
|
+
weekday: chunkVOLW7NZ4_cjs.cn(
|
|
921
921
|
"text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",
|
|
922
922
|
defaultClassNames.weekday
|
|
923
923
|
),
|
|
924
|
-
week:
|
|
925
|
-
week_number_header:
|
|
924
|
+
week: chunkVOLW7NZ4_cjs.cn("flex w-full mt-2", defaultClassNames.week),
|
|
925
|
+
week_number_header: chunkVOLW7NZ4_cjs.cn(
|
|
926
926
|
"select-none w-(--cell-size)",
|
|
927
927
|
defaultClassNames.week_number_header
|
|
928
928
|
),
|
|
929
|
-
week_number:
|
|
929
|
+
week_number: chunkVOLW7NZ4_cjs.cn(
|
|
930
930
|
"text-[0.8rem] select-none text-muted-foreground",
|
|
931
931
|
defaultClassNames.week_number
|
|
932
932
|
),
|
|
933
|
-
day:
|
|
933
|
+
day: chunkVOLW7NZ4_cjs.cn(
|
|
934
934
|
"relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",
|
|
935
935
|
defaultClassNames.day
|
|
936
936
|
),
|
|
937
|
-
range_start:
|
|
937
|
+
range_start: chunkVOLW7NZ4_cjs.cn(
|
|
938
938
|
"rounded-l-md bg-accent",
|
|
939
939
|
defaultClassNames.range_start
|
|
940
940
|
),
|
|
941
|
-
range_middle:
|
|
942
|
-
range_end:
|
|
943
|
-
today:
|
|
941
|
+
range_middle: chunkVOLW7NZ4_cjs.cn("rounded-none", defaultClassNames.range_middle),
|
|
942
|
+
range_end: chunkVOLW7NZ4_cjs.cn("rounded-r-md bg-accent", defaultClassNames.range_end),
|
|
943
|
+
today: chunkVOLW7NZ4_cjs.cn(
|
|
944
944
|
"bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",
|
|
945
945
|
defaultClassNames.today
|
|
946
946
|
),
|
|
947
|
-
outside:
|
|
947
|
+
outside: chunkVOLW7NZ4_cjs.cn(
|
|
948
948
|
"text-muted-foreground aria-selected:text-muted-foreground",
|
|
949
949
|
defaultClassNames.outside
|
|
950
950
|
),
|
|
951
|
-
disabled:
|
|
951
|
+
disabled: chunkVOLW7NZ4_cjs.cn(
|
|
952
952
|
"text-muted-foreground opacity-50",
|
|
953
953
|
defaultClassNames.disabled
|
|
954
954
|
),
|
|
955
|
-
hidden:
|
|
955
|
+
hidden: chunkVOLW7NZ4_cjs.cn("invisible", defaultClassNames.hidden),
|
|
956
956
|
...classNames
|
|
957
957
|
},
|
|
958
958
|
components: {
|
|
@@ -962,25 +962,25 @@ function Calendar({
|
|
|
962
962
|
{
|
|
963
963
|
"data-slot": "calendar",
|
|
964
964
|
ref: rootRef,
|
|
965
|
-
className:
|
|
965
|
+
className: chunkVOLW7NZ4_cjs.cn(className2),
|
|
966
966
|
...props2
|
|
967
967
|
}
|
|
968
968
|
);
|
|
969
969
|
},
|
|
970
970
|
Chevron: ({ className: className2, orientation, ...props2 }) => {
|
|
971
971
|
if (orientation === "left") {
|
|
972
|
-
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeftIcon, { className:
|
|
972
|
+
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeftIcon, { className: chunkVOLW7NZ4_cjs.cn("size-4", className2), ...props2 });
|
|
973
973
|
}
|
|
974
974
|
if (orientation === "right") {
|
|
975
975
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
976
976
|
lucideReact.ChevronRightIcon,
|
|
977
977
|
{
|
|
978
|
-
className:
|
|
978
|
+
className: chunkVOLW7NZ4_cjs.cn("size-4", className2),
|
|
979
979
|
...props2
|
|
980
980
|
}
|
|
981
981
|
);
|
|
982
982
|
}
|
|
983
|
-
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDownIcon, { className:
|
|
983
|
+
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDownIcon, { className: chunkVOLW7NZ4_cjs.cn("size-4", className2), ...props2 });
|
|
984
984
|
},
|
|
985
985
|
DayButton: CalendarDayButton,
|
|
986
986
|
WeekNumber: ({ children, ...props2 }) => {
|
|
@@ -1014,7 +1014,7 @@ function CalendarDayButton({
|
|
|
1014
1014
|
"data-range-start": modifiers.range_start,
|
|
1015
1015
|
"data-range-end": modifiers.range_end,
|
|
1016
1016
|
"data-range-middle": modifiers.range_middle,
|
|
1017
|
-
className:
|
|
1017
|
+
className: chunkVOLW7NZ4_cjs.cn(
|
|
1018
1018
|
"data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",
|
|
1019
1019
|
defaultClassNames.day,
|
|
1020
1020
|
className
|
|
@@ -1059,7 +1059,7 @@ function ScrollArea({
|
|
|
1059
1059
|
ScrollAreaPrimitive__namespace.Root,
|
|
1060
1060
|
{
|
|
1061
1061
|
"data-slot": "scroll-area",
|
|
1062
|
-
className:
|
|
1062
|
+
className: chunkVOLW7NZ4_cjs.cn("relative", className),
|
|
1063
1063
|
...props,
|
|
1064
1064
|
children: [
|
|
1065
1065
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1086,7 +1086,7 @@ function ScrollBar({
|
|
|
1086
1086
|
{
|
|
1087
1087
|
"data-slot": "scroll-area-scrollbar",
|
|
1088
1088
|
orientation,
|
|
1089
|
-
className:
|
|
1089
|
+
className: chunkVOLW7NZ4_cjs.cn(
|
|
1090
1090
|
"flex touch-none p-px transition-colors select-none",
|
|
1091
1091
|
orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent",
|
|
1092
1092
|
orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent",
|
|
@@ -1129,7 +1129,7 @@ var SmartDatePicker = ({
|
|
|
1129
1129
|
};
|
|
1130
1130
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-[280px]", children: /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [
|
|
1131
1131
|
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1132
|
-
|
|
1132
|
+
chunkVOLW7NZ4_cjs.SmartInput,
|
|
1133
1133
|
{
|
|
1134
1134
|
field,
|
|
1135
1135
|
label,
|
|
@@ -1331,9 +1331,9 @@ var SmartTags = ({
|
|
|
1331
1331
|
info,
|
|
1332
1332
|
subLabel
|
|
1333
1333
|
}) => {
|
|
1334
|
-
const { formData } =
|
|
1335
|
-
const { value, error, onChange, fieldRef, registerValidation } =
|
|
1336
|
-
const fieldDetection =
|
|
1334
|
+
const { formData } = chunkVOLW7NZ4_cjs.useSmartForm();
|
|
1335
|
+
const { value, error, onChange, fieldRef, registerValidation } = chunkVOLW7NZ4_cjs.useFormField(field);
|
|
1336
|
+
const fieldDetection = chunkVOLW7NZ4_cjs.useFieldDetection();
|
|
1337
1337
|
const hasRegistered = React6.useRef(false);
|
|
1338
1338
|
const hasSetDefault = React6.useRef(false);
|
|
1339
1339
|
const isDisabled = typeof disabled === "function" ? disabled(formData) : disabled || false;
|
|
@@ -1405,7 +1405,7 @@ var SmartTags = ({
|
|
|
1405
1405
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex-1 min-w-0 ${className}`, children: [
|
|
1406
1406
|
label && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-2", children: [
|
|
1407
1407
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
1408
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1408
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkVOLW7NZ4_cjs.Label, { className: "text-sm font-medium text-foreground", children: [
|
|
1409
1409
|
label,
|
|
1410
1410
|
" ",
|
|
1411
1411
|
required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-destructive", children: "*" }),
|
|
@@ -1417,9 +1417,9 @@ var SmartTags = ({
|
|
|
1417
1417
|
")"
|
|
1418
1418
|
] })
|
|
1419
1419
|
] }),
|
|
1420
|
-
info && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1421
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1422
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1420
|
+
info && /* @__PURE__ */ jsxRuntime.jsx(chunkVOLW7NZ4_cjs.TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(chunkVOLW7NZ4_cjs.Tooltip, { children: [
|
|
1421
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVOLW7NZ4_cjs.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.InfoIcon, { className: "h-4 w-4 text-muted-foreground cursor-pointer mr-2" }) }),
|
|
1422
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVOLW7NZ4_cjs.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "max-w-xs", children: info }) })
|
|
1423
1423
|
] }) })
|
|
1424
1424
|
] }),
|
|
1425
1425
|
subLabel && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-1", children: subLabel })
|
|
@@ -1428,7 +1428,7 @@ var SmartTags = ({
|
|
|
1428
1428
|
"div",
|
|
1429
1429
|
{
|
|
1430
1430
|
ref: fieldRef,
|
|
1431
|
-
className:
|
|
1431
|
+
className: chunkVOLW7NZ4_cjs.cn(
|
|
1432
1432
|
"min-h-[40px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background",
|
|
1433
1433
|
"focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",
|
|
1434
1434
|
"flex flex-wrap items-center gap-2 cursor-text",
|
|
@@ -1464,7 +1464,7 @@ var SmartTags = ({
|
|
|
1464
1464
|
`${tagText}-${index}`
|
|
1465
1465
|
)),
|
|
1466
1466
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1467
|
-
|
|
1467
|
+
chunkVOLW7NZ4_cjs.Input,
|
|
1468
1468
|
{
|
|
1469
1469
|
ref: inputRef,
|
|
1470
1470
|
type: "text",
|
|
@@ -1501,5 +1501,5 @@ exports.SmartDatePicker = SmartDatePicker;
|
|
|
1501
1501
|
exports.SmartRadioGroup = SmartRadioGroup;
|
|
1502
1502
|
exports.SmartSelect = SmartSelect;
|
|
1503
1503
|
exports.SmartTags = SmartTags;
|
|
1504
|
-
//# sourceMappingURL=chunk-
|
|
1505
|
-
//# sourceMappingURL=chunk-
|
|
1504
|
+
//# sourceMappingURL=chunk-I5HYLSDJ.cjs.map
|
|
1505
|
+
//# sourceMappingURL=chunk-I5HYLSDJ.cjs.map
|