shadcn-zod-formkit 1.29.0 → 1.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +272 -126
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +13 -5
- package/dist/index.d.ts +13 -5
- package/dist/index.mjs +273 -128
- package/dist/index.mjs.map +1 -1
- package/dist/shadcn-zod-formkit-1.30.1.tgz +0 -0
- package/package.json +4 -2
- package/dist/shadcn-zod-formkit-1.29.0.tgz +0 -0
package/dist/index.d.mts
CHANGED
|
@@ -28,13 +28,13 @@ import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
|
28
28
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
29
29
|
import { ClassValue } from 'clsx';
|
|
30
30
|
|
|
31
|
-
interface Props$
|
|
31
|
+
interface Props$j {
|
|
32
32
|
title: string;
|
|
33
33
|
description: string | ReactNode;
|
|
34
34
|
className?: string;
|
|
35
35
|
variant?: "info" | "warning" | "error" | "success";
|
|
36
36
|
}
|
|
37
|
-
declare const CustomAlert: ({ title, description, className, variant, }: Props$
|
|
37
|
+
declare const CustomAlert: ({ title, description, className, variant, }: Props$j) => react_jsx_runtime.JSX.Element;
|
|
38
38
|
|
|
39
39
|
declare const validationMessages: {
|
|
40
40
|
required: string;
|
|
@@ -88,6 +88,7 @@ type FieldConfig<T, RT = Record<string, any>> = FieldProps<T, RT> | FieldConfig<
|
|
|
88
88
|
interface FieldProps<T = Record<string, any>, RT = Record<string, any>> {
|
|
89
89
|
name: keyof T;
|
|
90
90
|
label: string;
|
|
91
|
+
step?: number;
|
|
91
92
|
withAddBtn?: boolean;
|
|
92
93
|
form?: UseFormReturn<any>;
|
|
93
94
|
isRemovebleOption?: boolean;
|
|
@@ -217,7 +218,7 @@ interface FormResp<T> {
|
|
|
217
218
|
form?: UseFormReturn<any>;
|
|
218
219
|
data: T;
|
|
219
220
|
}
|
|
220
|
-
interface Props$
|
|
221
|
+
interface Props$i<T extends Record<string, any>> {
|
|
221
222
|
showIcon?: boolean;
|
|
222
223
|
showFormHeader?: boolean;
|
|
223
224
|
formTitle: string;
|
|
@@ -242,7 +243,14 @@ interface Props$h<T extends Record<string, any>> {
|
|
|
242
243
|
childrenHeader?: ReactNode;
|
|
243
244
|
listBtnConfig?: BtnConfig[];
|
|
244
245
|
}
|
|
245
|
-
declare const DynamicForm: <T extends Record<string, any>>({ formTitle, formSubTitle, fields, readOnly, record, onAnyFieldChange, onSubmit, onClick, extraValidations, children, childrenHeader, showIcon, showFormHeader, withErrorsAlert, errorAlertPosition, withCard, submitBtnClass, listBtnConfig, submitBtnLabel, submitBtnLabelSubmiting, withFormWrapper, btnGroupDirection, withSubmitBtn }: Props$
|
|
246
|
+
declare const DynamicForm: <T extends Record<string, any>>({ formTitle, formSubTitle, fields, readOnly, record, onAnyFieldChange, onSubmit, onClick, extraValidations, children, childrenHeader, showIcon, showFormHeader, withErrorsAlert, errorAlertPosition, withCard, submitBtnClass, listBtnConfig, submitBtnLabel, submitBtnLabelSubmiting, withFormWrapper, btnGroupDirection, withSubmitBtn }: Props$i<T>) => react_jsx_runtime.JSX.Element;
|
|
247
|
+
|
|
248
|
+
interface Props$h<T> {
|
|
249
|
+
onSubmit?: (resp: FormResp<T>) => void;
|
|
250
|
+
fields: FieldConfig<T>[];
|
|
251
|
+
record: any;
|
|
252
|
+
}
|
|
253
|
+
declare const WizardForm: <T extends Record<string, any>>({ fields, record, onSubmit, }: Props$h<T>) => react_jsx_runtime.JSX.Element;
|
|
246
254
|
|
|
247
255
|
declare const DynamicFormExample: () => react_jsx_runtime.JSX.Element;
|
|
248
256
|
declare const mockFields: Array<FieldProps | FieldProps[]>;
|
|
@@ -751,4 +759,4 @@ declare function TooltipContent({ className, sideOffset, children, ...props }: R
|
|
|
751
759
|
|
|
752
760
|
declare function cn(...inputs: ClassValue[]): string;
|
|
753
761
|
|
|
754
|
-
export { Accordion, AccordionContent, AccordionGroupedSwitchInput, AccordionGroupedSwitches, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, Badge, BaseInput, type BtnConfig, Button, ButtonGroup, ButtonGroupInput, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CheckListInput, Checkbox, CheckboxInput, ColorCnInput, type ColorCompProps, ColorInput, ComboboxInput, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CurrencyInput, CustomAlert, CustomInputGroup, DateInput, DateTimeInput, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DynamicForm, DynamicFormExample, Field, FieldButtonGroup, type FieldConfig, FieldContent, FieldCurrency, FieldDateTimeInput, FieldDescription, FieldError, FieldFileMultiUpload, FieldGroup, FieldKeyValueList, FieldLabel, FieldLegend, type FieldProps, FieldRepeater, FieldSeparator, FieldSet, FieldSimpleCheckList, FieldSlider, FieldStringValueList, FieldTextGroup, FieldTimeInput, FieldTitle, FileInput, FileMultiUploadInput, Form, FormControl, FormDescription, FormErrorsAlert, FormField, FormFieldsGrid, FormItem, FormLabel, FormMessage, type FormResp, GenericFilter, type GroupedOption, GroupedSwitchInput, GroupedSwitches, Input, InputFactory, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputList, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, type InputOption, type InputSetup, InputTypes, KeyValueListInput, Label, MultiSelectInput, NumberInput, OTPInput, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, type Props, RadioGroup, RadioGroupInput, RadioGroupItem, RepeaterInput, RepeaterTabsInput, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectInput, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SimpleCheckListInput, Slider, SliderInput, SortableListInput, StringValueListInput, Switch, SwitchInput, Tabs, TabsContent, TabsList, TabsTrigger, TagInput, TextAreaInput, TextInput, TextInputGroup, TextInputType, Textarea, TimeInput, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonGroupVariants, buttonVariants, cn, entitiesToGroupedOption, entitiesToInputOption, entityToGroupedOption, entityToInputOption, flattenFields, getDefaultValues, getDynamicSchema, getFieldLabel, handleOnChage, inputFieldComp, isValidField, mockFields, useFormField, validationMessages };
|
|
762
|
+
export { Accordion, AccordionContent, AccordionGroupedSwitchInput, AccordionGroupedSwitches, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, Badge, BaseInput, type BtnConfig, Button, ButtonGroup, ButtonGroupInput, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CheckListInput, Checkbox, CheckboxInput, ColorCnInput, type ColorCompProps, ColorInput, ComboboxInput, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CurrencyInput, CustomAlert, CustomInputGroup, DateInput, DateTimeInput, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DynamicForm, DynamicFormExample, Field, FieldButtonGroup, type FieldConfig, FieldContent, FieldCurrency, FieldDateTimeInput, FieldDescription, FieldError, FieldFileMultiUpload, FieldGroup, FieldKeyValueList, FieldLabel, FieldLegend, type FieldProps, FieldRepeater, FieldSeparator, FieldSet, FieldSimpleCheckList, FieldSlider, FieldStringValueList, FieldTextGroup, FieldTimeInput, FieldTitle, FileInput, FileMultiUploadInput, Form, FormControl, FormDescription, FormErrorsAlert, FormField, FormFieldsGrid, FormItem, FormLabel, FormMessage, type FormResp, GenericFilter, type GroupedOption, GroupedSwitchInput, GroupedSwitches, Input, InputFactory, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputList, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, type InputOption, type InputSetup, InputTypes, KeyValueListInput, Label, MultiSelectInput, NumberInput, OTPInput, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, type Props, RadioGroup, RadioGroupInput, RadioGroupItem, RepeaterInput, RepeaterTabsInput, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectInput, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SimpleCheckListInput, Slider, SliderInput, SortableListInput, StringValueListInput, Switch, SwitchInput, Tabs, TabsContent, TabsList, TabsTrigger, TagInput, TextAreaInput, TextInput, TextInputGroup, TextInputType, Textarea, TimeInput, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, WizardForm, badgeVariants, buttonGroupVariants, buttonVariants, cn, entitiesToGroupedOption, entitiesToInputOption, entityToGroupedOption, entityToInputOption, flattenFields, getDefaultValues, getDynamicSchema, getFieldLabel, handleOnChage, inputFieldComp, isValidField, mockFields, useFormField, validationMessages };
|
package/dist/index.d.ts
CHANGED
|
@@ -28,13 +28,13 @@ import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
|
28
28
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
29
29
|
import { ClassValue } from 'clsx';
|
|
30
30
|
|
|
31
|
-
interface Props$
|
|
31
|
+
interface Props$j {
|
|
32
32
|
title: string;
|
|
33
33
|
description: string | ReactNode;
|
|
34
34
|
className?: string;
|
|
35
35
|
variant?: "info" | "warning" | "error" | "success";
|
|
36
36
|
}
|
|
37
|
-
declare const CustomAlert: ({ title, description, className, variant, }: Props$
|
|
37
|
+
declare const CustomAlert: ({ title, description, className, variant, }: Props$j) => react_jsx_runtime.JSX.Element;
|
|
38
38
|
|
|
39
39
|
declare const validationMessages: {
|
|
40
40
|
required: string;
|
|
@@ -88,6 +88,7 @@ type FieldConfig<T, RT = Record<string, any>> = FieldProps<T, RT> | FieldConfig<
|
|
|
88
88
|
interface FieldProps<T = Record<string, any>, RT = Record<string, any>> {
|
|
89
89
|
name: keyof T;
|
|
90
90
|
label: string;
|
|
91
|
+
step?: number;
|
|
91
92
|
withAddBtn?: boolean;
|
|
92
93
|
form?: UseFormReturn<any>;
|
|
93
94
|
isRemovebleOption?: boolean;
|
|
@@ -217,7 +218,7 @@ interface FormResp<T> {
|
|
|
217
218
|
form?: UseFormReturn<any>;
|
|
218
219
|
data: T;
|
|
219
220
|
}
|
|
220
|
-
interface Props$
|
|
221
|
+
interface Props$i<T extends Record<string, any>> {
|
|
221
222
|
showIcon?: boolean;
|
|
222
223
|
showFormHeader?: boolean;
|
|
223
224
|
formTitle: string;
|
|
@@ -242,7 +243,14 @@ interface Props$h<T extends Record<string, any>> {
|
|
|
242
243
|
childrenHeader?: ReactNode;
|
|
243
244
|
listBtnConfig?: BtnConfig[];
|
|
244
245
|
}
|
|
245
|
-
declare const DynamicForm: <T extends Record<string, any>>({ formTitle, formSubTitle, fields, readOnly, record, onAnyFieldChange, onSubmit, onClick, extraValidations, children, childrenHeader, showIcon, showFormHeader, withErrorsAlert, errorAlertPosition, withCard, submitBtnClass, listBtnConfig, submitBtnLabel, submitBtnLabelSubmiting, withFormWrapper, btnGroupDirection, withSubmitBtn }: Props$
|
|
246
|
+
declare const DynamicForm: <T extends Record<string, any>>({ formTitle, formSubTitle, fields, readOnly, record, onAnyFieldChange, onSubmit, onClick, extraValidations, children, childrenHeader, showIcon, showFormHeader, withErrorsAlert, errorAlertPosition, withCard, submitBtnClass, listBtnConfig, submitBtnLabel, submitBtnLabelSubmiting, withFormWrapper, btnGroupDirection, withSubmitBtn }: Props$i<T>) => react_jsx_runtime.JSX.Element;
|
|
247
|
+
|
|
248
|
+
interface Props$h<T> {
|
|
249
|
+
onSubmit?: (resp: FormResp<T>) => void;
|
|
250
|
+
fields: FieldConfig<T>[];
|
|
251
|
+
record: any;
|
|
252
|
+
}
|
|
253
|
+
declare const WizardForm: <T extends Record<string, any>>({ fields, record, onSubmit, }: Props$h<T>) => react_jsx_runtime.JSX.Element;
|
|
246
254
|
|
|
247
255
|
declare const DynamicFormExample: () => react_jsx_runtime.JSX.Element;
|
|
248
256
|
declare const mockFields: Array<FieldProps | FieldProps[]>;
|
|
@@ -751,4 +759,4 @@ declare function TooltipContent({ className, sideOffset, children, ...props }: R
|
|
|
751
759
|
|
|
752
760
|
declare function cn(...inputs: ClassValue[]): string;
|
|
753
761
|
|
|
754
|
-
export { Accordion, AccordionContent, AccordionGroupedSwitchInput, AccordionGroupedSwitches, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, Badge, BaseInput, type BtnConfig, Button, ButtonGroup, ButtonGroupInput, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CheckListInput, Checkbox, CheckboxInput, ColorCnInput, type ColorCompProps, ColorInput, ComboboxInput, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CurrencyInput, CustomAlert, CustomInputGroup, DateInput, DateTimeInput, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DynamicForm, DynamicFormExample, Field, FieldButtonGroup, type FieldConfig, FieldContent, FieldCurrency, FieldDateTimeInput, FieldDescription, FieldError, FieldFileMultiUpload, FieldGroup, FieldKeyValueList, FieldLabel, FieldLegend, type FieldProps, FieldRepeater, FieldSeparator, FieldSet, FieldSimpleCheckList, FieldSlider, FieldStringValueList, FieldTextGroup, FieldTimeInput, FieldTitle, FileInput, FileMultiUploadInput, Form, FormControl, FormDescription, FormErrorsAlert, FormField, FormFieldsGrid, FormItem, FormLabel, FormMessage, type FormResp, GenericFilter, type GroupedOption, GroupedSwitchInput, GroupedSwitches, Input, InputFactory, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputList, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, type InputOption, type InputSetup, InputTypes, KeyValueListInput, Label, MultiSelectInput, NumberInput, OTPInput, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, type Props, RadioGroup, RadioGroupInput, RadioGroupItem, RepeaterInput, RepeaterTabsInput, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectInput, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SimpleCheckListInput, Slider, SliderInput, SortableListInput, StringValueListInput, Switch, SwitchInput, Tabs, TabsContent, TabsList, TabsTrigger, TagInput, TextAreaInput, TextInput, TextInputGroup, TextInputType, Textarea, TimeInput, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonGroupVariants, buttonVariants, cn, entitiesToGroupedOption, entitiesToInputOption, entityToGroupedOption, entityToInputOption, flattenFields, getDefaultValues, getDynamicSchema, getFieldLabel, handleOnChage, inputFieldComp, isValidField, mockFields, useFormField, validationMessages };
|
|
762
|
+
export { Accordion, AccordionContent, AccordionGroupedSwitchInput, AccordionGroupedSwitches, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, Badge, BaseInput, type BtnConfig, Button, ButtonGroup, ButtonGroupInput, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CheckListInput, Checkbox, CheckboxInput, ColorCnInput, type ColorCompProps, ColorInput, ComboboxInput, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CurrencyInput, CustomAlert, CustomInputGroup, DateInput, DateTimeInput, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DynamicForm, DynamicFormExample, Field, FieldButtonGroup, type FieldConfig, FieldContent, FieldCurrency, FieldDateTimeInput, FieldDescription, FieldError, FieldFileMultiUpload, FieldGroup, FieldKeyValueList, FieldLabel, FieldLegend, type FieldProps, FieldRepeater, FieldSeparator, FieldSet, FieldSimpleCheckList, FieldSlider, FieldStringValueList, FieldTextGroup, FieldTimeInput, FieldTitle, FileInput, FileMultiUploadInput, Form, FormControl, FormDescription, FormErrorsAlert, FormField, FormFieldsGrid, FormItem, FormLabel, FormMessage, type FormResp, GenericFilter, type GroupedOption, GroupedSwitchInput, GroupedSwitches, Input, InputFactory, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputList, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, type InputOption, type InputSetup, InputTypes, KeyValueListInput, Label, MultiSelectInput, NumberInput, OTPInput, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, type Props, RadioGroup, RadioGroupInput, RadioGroupItem, RepeaterInput, RepeaterTabsInput, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectInput, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SimpleCheckListInput, Slider, SliderInput, SortableListInput, StringValueListInput, Switch, SwitchInput, Tabs, TabsContent, TabsList, TabsTrigger, TagInput, TextAreaInput, TextInput, TextInputGroup, TextInputType, Textarea, TimeInput, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, WizardForm, badgeVariants, buttonGroupVariants, buttonVariants, cn, entitiesToGroupedOption, entitiesToInputOption, entityToGroupedOption, entityToInputOption, flattenFields, getDefaultValues, getDynamicSchema, getFieldLabel, handleOnChage, inputFieldComp, isValidField, mockFields, useFormField, validationMessages };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, CheckIcon, XIcon, MinusIcon, CircleIcon, GripVerticalIcon, ChevronUpIcon, SearchIcon, ChevronsUpDown, Check, CalendarIcon, EyeOff, Eye, Upload, Trash2, Plus,
|
|
1
|
+
import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, CheckIcon, XIcon, MinusIcon, CircleIcon, GripVerticalIcon, ChevronUpIcon, SearchIcon, ChevronsUpDown, Check, CalendarIcon, EyeOff, Eye, Upload, Info, Trash2, Plus, GripVertical, Loader2, Save, Pencil, Search, MessageCircleWarning, CircleCheck, CircleX } from 'lucide-react';
|
|
2
2
|
import { InfoCircledIcon } from '@radix-ui/react-icons';
|
|
3
3
|
import { cva } from 'class-variance-authority';
|
|
4
4
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -2184,6 +2184,10 @@ var ColorInput = class extends BaseInput {
|
|
|
2184
2184
|
}
|
|
2185
2185
|
};
|
|
2186
2186
|
var PRESET_COLORS = [
|
|
2187
|
+
"#9A275A",
|
|
2188
|
+
// QuinaMagenta
|
|
2189
|
+
"#800000",
|
|
2190
|
+
// Maroon
|
|
2187
2191
|
"#ef4444",
|
|
2188
2192
|
// red
|
|
2189
2193
|
"#f97316",
|
|
@@ -2192,18 +2196,32 @@ var PRESET_COLORS = [
|
|
|
2192
2196
|
// yellow
|
|
2193
2197
|
"#22c55e",
|
|
2194
2198
|
// green
|
|
2199
|
+
"#99EDCC",
|
|
2200
|
+
// Aquamarine
|
|
2201
|
+
"#00FF00",
|
|
2202
|
+
// lime
|
|
2203
|
+
"#00FFFF",
|
|
2204
|
+
// Aqua
|
|
2195
2205
|
"#06b6d4",
|
|
2196
2206
|
// cyan
|
|
2197
2207
|
"#3b82f6",
|
|
2198
2208
|
// blue
|
|
2199
2209
|
"#8b5cf6",
|
|
2200
2210
|
// purple
|
|
2211
|
+
"#800080",
|
|
2212
|
+
// purple
|
|
2213
|
+
"#FF00FF",
|
|
2214
|
+
// Fuchsia
|
|
2201
2215
|
"#ec4899",
|
|
2202
2216
|
// pink
|
|
2203
2217
|
"#64748b",
|
|
2204
2218
|
// slate
|
|
2205
|
-
"#000000"
|
|
2219
|
+
"#000000",
|
|
2206
2220
|
// black
|
|
2221
|
+
"#808080",
|
|
2222
|
+
// Gray
|
|
2223
|
+
"#FFFFFF"
|
|
2224
|
+
// White
|
|
2207
2225
|
];
|
|
2208
2226
|
var FieldColor = ({ form, input, isSubmitting }) => {
|
|
2209
2227
|
const [ColorCmp, _setColorCmp] = useState(ColorComp);
|
|
@@ -2256,13 +2274,13 @@ var ColorComp = React3__default.forwardRef(
|
|
|
2256
2274
|
}
|
|
2257
2275
|
};
|
|
2258
2276
|
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3", children: [
|
|
2259
|
-
/* @__PURE__ */ jsx("div", { className: "flex flex-
|
|
2277
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-row gap-2 p-2", children: PRESET_COLORS.map((presetColor) => /* @__PURE__ */ jsx(
|
|
2260
2278
|
"button",
|
|
2261
2279
|
{
|
|
2262
2280
|
type: "button",
|
|
2263
2281
|
disabled,
|
|
2264
2282
|
className: cn(
|
|
2265
|
-
"size-
|
|
2283
|
+
"flex-1 size-4 shadow-lg rounded-md border-2 border-black transition-all hover:scale-110 disabled:opacity-50 disabled:cursor-not-allowed",
|
|
2266
2284
|
color.hex === presetColor ? "border-foreground ring-2 ring-foreground/20" : "border-border hover:border-foreground/50"
|
|
2267
2285
|
),
|
|
2268
2286
|
style: { backgroundColor: presetColor },
|
|
@@ -4527,6 +4545,111 @@ var FieldFileMultiUpload = ({ input, form, isSubmitting }) => {
|
|
|
4527
4545
|
);
|
|
4528
4546
|
return /* @__PURE__ */ jsx(Fragment, { children: formField });
|
|
4529
4547
|
};
|
|
4548
|
+
var TextInputGroup = class extends BaseInput {
|
|
4549
|
+
render() {
|
|
4550
|
+
const { input, form, isSubmitting } = this;
|
|
4551
|
+
return /* @__PURE__ */ jsx(FieldTextGroup, { input, form, isSubmitting });
|
|
4552
|
+
}
|
|
4553
|
+
};
|
|
4554
|
+
var FieldTextGroup = ({ form, input, isSubmitting }) => {
|
|
4555
|
+
const [isValid2, setIsValid] = useState(isValidField(input, form));
|
|
4556
|
+
const formField = /* @__PURE__ */ jsx(
|
|
4557
|
+
FormField,
|
|
4558
|
+
{
|
|
4559
|
+
control: form.control,
|
|
4560
|
+
name: input.name,
|
|
4561
|
+
render: ({ field }) => {
|
|
4562
|
+
setIsValid(isValidField(input, form));
|
|
4563
|
+
return /* @__PURE__ */ jsxs(FormItem, { className: input.className, children: [
|
|
4564
|
+
/* @__PURE__ */ jsx(FormLabel, { children: /* @__PURE__ */ jsx("b", { children: input.label }) }),
|
|
4565
|
+
/* @__PURE__ */ jsx(FormControl, { className: "shadow-lg", children: CustomInputGroup({
|
|
4566
|
+
input,
|
|
4567
|
+
isSubmitting,
|
|
4568
|
+
field,
|
|
4569
|
+
form,
|
|
4570
|
+
isValid: isValid2
|
|
4571
|
+
}) }),
|
|
4572
|
+
input.description && /* @__PURE__ */ jsx(FormDescription, { children: input.description }),
|
|
4573
|
+
/* @__PURE__ */ jsx(FormMessage, {})
|
|
4574
|
+
] });
|
|
4575
|
+
}
|
|
4576
|
+
},
|
|
4577
|
+
input.name
|
|
4578
|
+
);
|
|
4579
|
+
return /* @__PURE__ */ jsx(Fragment, { children: formField });
|
|
4580
|
+
};
|
|
4581
|
+
var CustomInputGroup = ({
|
|
4582
|
+
value,
|
|
4583
|
+
input,
|
|
4584
|
+
field,
|
|
4585
|
+
form,
|
|
4586
|
+
isSubmitting,
|
|
4587
|
+
onChange,
|
|
4588
|
+
isValid: isValid2
|
|
4589
|
+
}) => {
|
|
4590
|
+
const groupConfig = input.inputGroupConfig;
|
|
4591
|
+
const infoTooltip = input?.infoTooltip;
|
|
4592
|
+
const autoValidate = groupConfig?.autoValidIcons ?? input.zodType ? true : false;
|
|
4593
|
+
const iconValidState = /* @__PURE__ */ jsx(CircleCheck, { style: { color: "#00bf3e" } });
|
|
4594
|
+
const iconInvalidState = /* @__PURE__ */ jsx(CircleX, { style: { color: "#ff8080" } });
|
|
4595
|
+
const iconLoadingState = /* @__PURE__ */ jsx(Loader2, { className: "animate-spin", style: { color: "#1e90ff" } });
|
|
4596
|
+
const iconsRight = groupConfig?.iconsRight ?? [];
|
|
4597
|
+
const iconsLeft = groupConfig?.iconsLeft ?? [];
|
|
4598
|
+
const textLeft = groupConfig?.textLeft;
|
|
4599
|
+
const textRight = groupConfig?.textRight;
|
|
4600
|
+
const [showPassword, setShowPassword] = useState(false);
|
|
4601
|
+
const isPasswordField = input.keyboardType === "password" /* PASSWORD */;
|
|
4602
|
+
const isNumberField = input.keyboardType === "number" /* NUMBER */;
|
|
4603
|
+
const showInputGroupAddons = iconsRight.length > 0 || textRight || autoValidate || infoTooltip || isPasswordField;
|
|
4604
|
+
return /* @__PURE__ */ jsxs(InputGroup, { children: [
|
|
4605
|
+
(iconsLeft.length > 0 || textLeft) && /* @__PURE__ */ jsxs(InputGroupAddon, { children: [
|
|
4606
|
+
textLeft && /* @__PURE__ */ jsx(InputGroupText, { children: textLeft }),
|
|
4607
|
+
iconsLeft.map((IconComponent, index) => /* @__PURE__ */ jsx(IconComponent, { size: 20 }, index))
|
|
4608
|
+
] }),
|
|
4609
|
+
/* @__PURE__ */ jsx(
|
|
4610
|
+
InputGroupInput,
|
|
4611
|
+
{
|
|
4612
|
+
placeholder: input.placeHolder,
|
|
4613
|
+
disabled: input.disabled || isSubmitting,
|
|
4614
|
+
onBlur: field?.onBlur,
|
|
4615
|
+
name: field?.name,
|
|
4616
|
+
ref: field?.ref,
|
|
4617
|
+
type: isPasswordField && !showPassword ? "password" : isNumberField ? "number" : "text",
|
|
4618
|
+
value: field?.value ?? value ?? "",
|
|
4619
|
+
onChange: (e) => {
|
|
4620
|
+
if (onChange) {
|
|
4621
|
+
onChange(e);
|
|
4622
|
+
}
|
|
4623
|
+
let value2 = e.target.value;
|
|
4624
|
+
if (isNumberField) {
|
|
4625
|
+
value2 = e.target.value === "" ? "" : Number(e.target.value);
|
|
4626
|
+
}
|
|
4627
|
+
field?.onChange(value2);
|
|
4628
|
+
isValidField(input, form);
|
|
4629
|
+
handleOnChage(value2, input, field);
|
|
4630
|
+
}
|
|
4631
|
+
}
|
|
4632
|
+
),
|
|
4633
|
+
showInputGroupAddons && /* @__PURE__ */ jsxs(InputGroupAddon, { align: "inline-end", children: [
|
|
4634
|
+
infoTooltip && /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
4635
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Info, { size: 20 }) }),
|
|
4636
|
+
/* @__PURE__ */ jsx(TooltipContent, { children: /* @__PURE__ */ jsx("p", { children: infoTooltip }) })
|
|
4637
|
+
] }),
|
|
4638
|
+
textRight && /* @__PURE__ */ jsx(InputGroupText, { children: textRight }),
|
|
4639
|
+
iconsRight.map((IconComponent, index) => /* @__PURE__ */ jsx(IconComponent, { size: 20 }, index)),
|
|
4640
|
+
isPasswordField && /* @__PURE__ */ jsx(
|
|
4641
|
+
"button",
|
|
4642
|
+
{
|
|
4643
|
+
type: "button",
|
|
4644
|
+
onClick: () => setShowPassword(!showPassword),
|
|
4645
|
+
className: "p-1",
|
|
4646
|
+
children: showPassword ? /* @__PURE__ */ jsx(EyeOff, { size: 20 }) : /* @__PURE__ */ jsx(Eye, { size: 20 })
|
|
4647
|
+
}
|
|
4648
|
+
),
|
|
4649
|
+
autoValidate && /* @__PURE__ */ jsx("div", { children: isSubmitting ? iconLoadingState : isValid2 ? iconValidState : iconInvalidState })
|
|
4650
|
+
] })
|
|
4651
|
+
] });
|
|
4652
|
+
};
|
|
4530
4653
|
var KeyValueListInput = class extends BaseInput {
|
|
4531
4654
|
render() {
|
|
4532
4655
|
const { input, form, isSubmitting } = this;
|
|
@@ -4583,29 +4706,33 @@ var FieldKeyValueList = ({ form, input, isSubmitting }) => {
|
|
|
4583
4706
|
children: [
|
|
4584
4707
|
/* @__PURE__ */ jsxs(ButtonGroup, { className: "w-full", children: [
|
|
4585
4708
|
/* @__PURE__ */ jsx(ButtonGroupText, { asChild: true, children: /* @__PURE__ */ jsx(Label$1, { htmlFor: "key", children: "Key" }) }),
|
|
4586
|
-
/* @__PURE__ */ jsx(
|
|
4587
|
-
|
|
4709
|
+
/* @__PURE__ */ jsx(
|
|
4710
|
+
CustomInputGroup,
|
|
4588
4711
|
{
|
|
4589
|
-
|
|
4712
|
+
autoValidate: true,
|
|
4590
4713
|
value: pair.key,
|
|
4591
|
-
|
|
4714
|
+
input,
|
|
4715
|
+
isValid: pair.key.trim() != "",
|
|
4716
|
+
isSubmitting,
|
|
4592
4717
|
onChange: (e) => handleChange(index, "key", e.target.value),
|
|
4593
|
-
|
|
4718
|
+
form
|
|
4594
4719
|
}
|
|
4595
|
-
)
|
|
4720
|
+
)
|
|
4596
4721
|
] }),
|
|
4597
4722
|
/* @__PURE__ */ jsxs(ButtonGroup, { className: "w-full", children: [
|
|
4598
4723
|
/* @__PURE__ */ jsx(ButtonGroupText, { asChild: true, children: /* @__PURE__ */ jsx(Label$1, { htmlFor: "value", children: "Value" }) }),
|
|
4599
|
-
/* @__PURE__ */ jsx(
|
|
4600
|
-
|
|
4724
|
+
/* @__PURE__ */ jsx(
|
|
4725
|
+
CustomInputGroup,
|
|
4601
4726
|
{
|
|
4602
|
-
|
|
4727
|
+
autoValidate: true,
|
|
4603
4728
|
value: pair.value,
|
|
4604
|
-
|
|
4729
|
+
input,
|
|
4730
|
+
isValid: pair.value.trim() != "",
|
|
4731
|
+
isSubmitting,
|
|
4605
4732
|
onChange: (e) => handleChange(index, "value", e.target.value),
|
|
4606
|
-
|
|
4733
|
+
form
|
|
4607
4734
|
}
|
|
4608
|
-
)
|
|
4735
|
+
)
|
|
4609
4736
|
] }),
|
|
4610
4737
|
input.isRemovebleOption && /* @__PURE__ */ jsx(
|
|
4611
4738
|
Button,
|
|
@@ -4736,111 +4863,6 @@ var FieldMultiSelect = ({ form, input, isSubmitting }) => {
|
|
|
4736
4863
|
input.name
|
|
4737
4864
|
);
|
|
4738
4865
|
};
|
|
4739
|
-
var TextInputGroup = class extends BaseInput {
|
|
4740
|
-
render() {
|
|
4741
|
-
const { input, form, isSubmitting } = this;
|
|
4742
|
-
return /* @__PURE__ */ jsx(FieldTextGroup, { input, form, isSubmitting });
|
|
4743
|
-
}
|
|
4744
|
-
};
|
|
4745
|
-
var FieldTextGroup = ({ form, input, isSubmitting }) => {
|
|
4746
|
-
const [isValid2, setIsValid] = useState(isValidField(input, form));
|
|
4747
|
-
const formField = /* @__PURE__ */ jsx(
|
|
4748
|
-
FormField,
|
|
4749
|
-
{
|
|
4750
|
-
control: form.control,
|
|
4751
|
-
name: input.name,
|
|
4752
|
-
render: ({ field }) => {
|
|
4753
|
-
setIsValid(isValidField(input, form));
|
|
4754
|
-
return /* @__PURE__ */ jsxs(FormItem, { className: input.className, children: [
|
|
4755
|
-
/* @__PURE__ */ jsx(FormLabel, { children: /* @__PURE__ */ jsx("b", { children: input.label }) }),
|
|
4756
|
-
/* @__PURE__ */ jsx(FormControl, { className: "shadow-lg", children: CustomInputGroup({
|
|
4757
|
-
input,
|
|
4758
|
-
isSubmitting,
|
|
4759
|
-
field,
|
|
4760
|
-
form,
|
|
4761
|
-
isValid: isValid2
|
|
4762
|
-
}) }),
|
|
4763
|
-
input.description && /* @__PURE__ */ jsx(FormDescription, { children: input.description }),
|
|
4764
|
-
/* @__PURE__ */ jsx(FormMessage, {})
|
|
4765
|
-
] });
|
|
4766
|
-
}
|
|
4767
|
-
},
|
|
4768
|
-
input.name
|
|
4769
|
-
);
|
|
4770
|
-
return /* @__PURE__ */ jsx(Fragment, { children: formField });
|
|
4771
|
-
};
|
|
4772
|
-
var CustomInputGroup = ({
|
|
4773
|
-
value,
|
|
4774
|
-
input,
|
|
4775
|
-
field,
|
|
4776
|
-
form,
|
|
4777
|
-
isSubmitting,
|
|
4778
|
-
onChange,
|
|
4779
|
-
isValid: isValid2
|
|
4780
|
-
}) => {
|
|
4781
|
-
const groupConfig = input.inputGroupConfig;
|
|
4782
|
-
const infoTooltip = input?.infoTooltip;
|
|
4783
|
-
const autoValidate = groupConfig?.autoValidIcons ?? input.zodType ? true : false;
|
|
4784
|
-
const iconValidState = /* @__PURE__ */ jsx(CircleCheck, { style: { color: "#00bf3e" } });
|
|
4785
|
-
const iconInvalidState = /* @__PURE__ */ jsx(CircleX, { style: { color: "#ff8080" } });
|
|
4786
|
-
const iconLoadingState = /* @__PURE__ */ jsx(Loader2, { className: "animate-spin", style: { color: "#1e90ff" } });
|
|
4787
|
-
const iconsRight = groupConfig?.iconsRight ?? [];
|
|
4788
|
-
const iconsLeft = groupConfig?.iconsLeft ?? [];
|
|
4789
|
-
const textLeft = groupConfig?.textLeft;
|
|
4790
|
-
const textRight = groupConfig?.textRight;
|
|
4791
|
-
const [showPassword, setShowPassword] = useState(false);
|
|
4792
|
-
const isPasswordField = input.keyboardType === "password" /* PASSWORD */;
|
|
4793
|
-
const isNumberField = input.keyboardType === "number" /* NUMBER */;
|
|
4794
|
-
const showInputGroupAddons = iconsRight.length > 0 || textRight || autoValidate || infoTooltip || isPasswordField;
|
|
4795
|
-
return /* @__PURE__ */ jsxs(InputGroup, { children: [
|
|
4796
|
-
(iconsLeft.length > 0 || textLeft) && /* @__PURE__ */ jsxs(InputGroupAddon, { children: [
|
|
4797
|
-
textLeft && /* @__PURE__ */ jsx(InputGroupText, { children: textLeft }),
|
|
4798
|
-
iconsLeft.map((IconComponent, index) => /* @__PURE__ */ jsx(IconComponent, { size: 20 }, index))
|
|
4799
|
-
] }),
|
|
4800
|
-
/* @__PURE__ */ jsx(
|
|
4801
|
-
InputGroupInput,
|
|
4802
|
-
{
|
|
4803
|
-
placeholder: input.placeHolder,
|
|
4804
|
-
disabled: input.disabled || isSubmitting,
|
|
4805
|
-
onBlur: field?.onBlur,
|
|
4806
|
-
name: field?.name,
|
|
4807
|
-
ref: field?.ref,
|
|
4808
|
-
type: isPasswordField && !showPassword ? "password" : isNumberField ? "number" : "text",
|
|
4809
|
-
value: field?.value ?? value ?? "",
|
|
4810
|
-
onChange: (e) => {
|
|
4811
|
-
if (onChange) {
|
|
4812
|
-
onChange(e);
|
|
4813
|
-
}
|
|
4814
|
-
let value2 = e.target.value;
|
|
4815
|
-
if (isNumberField) {
|
|
4816
|
-
value2 = e.target.value === "" ? "" : Number(e.target.value);
|
|
4817
|
-
}
|
|
4818
|
-
field?.onChange(value2);
|
|
4819
|
-
isValidField(input, form);
|
|
4820
|
-
handleOnChage(value2, input, field);
|
|
4821
|
-
}
|
|
4822
|
-
}
|
|
4823
|
-
),
|
|
4824
|
-
showInputGroupAddons && /* @__PURE__ */ jsxs(InputGroupAddon, { align: "inline-end", children: [
|
|
4825
|
-
infoTooltip && /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
4826
|
-
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Info, { size: 20 }) }),
|
|
4827
|
-
/* @__PURE__ */ jsx(TooltipContent, { children: /* @__PURE__ */ jsx("p", { children: infoTooltip }) })
|
|
4828
|
-
] }),
|
|
4829
|
-
textRight && /* @__PURE__ */ jsx(InputGroupText, { children: textRight }),
|
|
4830
|
-
iconsRight.map((IconComponent, index) => /* @__PURE__ */ jsx(IconComponent, { size: 20 }, index)),
|
|
4831
|
-
isPasswordField && /* @__PURE__ */ jsx(
|
|
4832
|
-
"button",
|
|
4833
|
-
{
|
|
4834
|
-
type: "button",
|
|
4835
|
-
onClick: () => setShowPassword(!showPassword),
|
|
4836
|
-
className: "p-1",
|
|
4837
|
-
children: showPassword ? /* @__PURE__ */ jsx(EyeOff, { size: 20 }) : /* @__PURE__ */ jsx(Eye, { size: 20 })
|
|
4838
|
-
}
|
|
4839
|
-
),
|
|
4840
|
-
autoValidate && /* @__PURE__ */ jsx("div", { children: isSubmitting ? iconLoadingState : isValid2 ? iconValidState : iconInvalidState })
|
|
4841
|
-
] })
|
|
4842
|
-
] });
|
|
4843
|
-
};
|
|
4844
4866
|
var NumberInput = class extends BaseInput {
|
|
4845
4867
|
render() {
|
|
4846
4868
|
const { input, form, isSubmitting } = this;
|
|
@@ -4953,6 +4975,10 @@ var FieldRepeater = ({ form, input, isSubmitting }) => {
|
|
|
4953
4975
|
});
|
|
4954
4976
|
const canAdd = !input.maxItems || fields.length < input.maxItems;
|
|
4955
4977
|
const canRemove = fields.length > (input.minItems ?? 0);
|
|
4978
|
+
const [isValid2, setIsValid] = useState(isValidField(input, form));
|
|
4979
|
+
useEffect(() => {
|
|
4980
|
+
setIsValid(isValidField(input, form));
|
|
4981
|
+
}, [input]);
|
|
4956
4982
|
return /* @__PURE__ */ jsx(
|
|
4957
4983
|
FormField,
|
|
4958
4984
|
{
|
|
@@ -4972,7 +4998,7 @@ var FieldRepeater = ({ form, input, isSubmitting }) => {
|
|
|
4972
4998
|
return /* @__PURE__ */ jsx(
|
|
4973
4999
|
"div",
|
|
4974
5000
|
{
|
|
4975
|
-
className: `grid gap-
|
|
5001
|
+
className: `grid gap-1 grid-cols-${cols}`,
|
|
4976
5002
|
children: group.map((subField) => /* @__PURE__ */ jsx(
|
|
4977
5003
|
FormField,
|
|
4978
5004
|
{
|
|
@@ -4981,11 +5007,14 @@ var FieldRepeater = ({ form, input, isSubmitting }) => {
|
|
|
4981
5007
|
render: ({ field, fieldState }) => /* @__PURE__ */ jsxs(FormItem, { className: "flex-1", children: [
|
|
4982
5008
|
/* @__PURE__ */ jsx(FormLabel, { children: subField.label }),
|
|
4983
5009
|
/* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(
|
|
4984
|
-
|
|
5010
|
+
CustomInputGroup,
|
|
4985
5011
|
{
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
5012
|
+
autoValidate: true,
|
|
5013
|
+
value: field.value,
|
|
5014
|
+
input: subField,
|
|
5015
|
+
isValid: isValid2,
|
|
5016
|
+
field,
|
|
5017
|
+
form
|
|
4989
5018
|
}
|
|
4990
5019
|
) }),
|
|
4991
5020
|
/* @__PURE__ */ jsx(FormMessage, { children: fieldState.error?.message })
|
|
@@ -5703,7 +5732,7 @@ var FieldSwitch = ({ input, form, isSubmitting }) => {
|
|
|
5703
5732
|
onCheckedChange: (event) => {
|
|
5704
5733
|
handleOnChage(event, input, field);
|
|
5705
5734
|
},
|
|
5706
|
-
disabled:
|
|
5735
|
+
disabled: input.disabled || isSubmitting
|
|
5707
5736
|
}
|
|
5708
5737
|
) })
|
|
5709
5738
|
] }) })
|
|
@@ -6295,6 +6324,122 @@ var FormWrapper = ({ form, handleSubmit, children, readOnly }) => {
|
|
|
6295
6324
|
}
|
|
6296
6325
|
) });
|
|
6297
6326
|
};
|
|
6327
|
+
function Stepper({ steps, currentStep, clickable = false, onStepClick }) {
|
|
6328
|
+
const handleStepClick = (stepNumber) => {
|
|
6329
|
+
if (clickable && onStepClick) {
|
|
6330
|
+
onStepClick(stepNumber);
|
|
6331
|
+
}
|
|
6332
|
+
};
|
|
6333
|
+
return /* @__PURE__ */ jsx("div", { className: "w-full", children: /* @__PURE__ */ jsx("div", { className: "flex flex-row gap-4 items-center justify-around", children: steps.map((step, index) => {
|
|
6334
|
+
const stepNumber = index + 1;
|
|
6335
|
+
const isCompleted = stepNumber < currentStep;
|
|
6336
|
+
const isCurrent = stepNumber === currentStep;
|
|
6337
|
+
const isUpcoming = stepNumber > currentStep;
|
|
6338
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-1 items-center", children: [
|
|
6339
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
|
|
6340
|
+
/* @__PURE__ */ jsx(
|
|
6341
|
+
"div",
|
|
6342
|
+
{
|
|
6343
|
+
onClick: () => handleStepClick(stepNumber),
|
|
6344
|
+
className: cn(
|
|
6345
|
+
"flex size-10 items-center shadow-lg justify-center rounded-full border-2 transition-all duration-300",
|
|
6346
|
+
isCompleted && "border-primary bg-primary text-primary-foreground",
|
|
6347
|
+
isCurrent && "border-primary bg-background text-primary scale-110",
|
|
6348
|
+
isUpcoming && "border-muted-foreground/60 bg-background border-b text-muted-foreground",
|
|
6349
|
+
clickable && "cursor-pointer hover:scale-125 hover:shadow-xl",
|
|
6350
|
+
!clickable && "cursor-default"
|
|
6351
|
+
),
|
|
6352
|
+
children: isCompleted ? /* @__PURE__ */ jsx(Check, { className: "size-5" }) : /* @__PURE__ */ jsx("span", { className: "text-sm font-semibold", children: stepNumber })
|
|
6353
|
+
}
|
|
6354
|
+
),
|
|
6355
|
+
step.title && /* @__PURE__ */ jsxs("div", { className: "mt-3 text-center", children: [
|
|
6356
|
+
/* @__PURE__ */ jsx(
|
|
6357
|
+
"p",
|
|
6358
|
+
{
|
|
6359
|
+
className: cn(
|
|
6360
|
+
"text-sm font-medium transition-colors",
|
|
6361
|
+
(isCompleted || isCurrent) && "text-foreground",
|
|
6362
|
+
isUpcoming && "text-muted-foreground"
|
|
6363
|
+
),
|
|
6364
|
+
children: step.title
|
|
6365
|
+
}
|
|
6366
|
+
),
|
|
6367
|
+
step.description && /* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-muted-foreground max-w-[120px]", children: step.description })
|
|
6368
|
+
] })
|
|
6369
|
+
] }),
|
|
6370
|
+
index < steps.length - 1 && /* @__PURE__ */ jsx("div", { className: "mx-2 flex-1 mb-8", children: /* @__PURE__ */ jsx(
|
|
6371
|
+
"div",
|
|
6372
|
+
{
|
|
6373
|
+
className: cn(
|
|
6374
|
+
"h-0.5 w-full transition-all duration-300",
|
|
6375
|
+
stepNumber < currentStep ? "bg-primary" : "bg-muted-foreground/30"
|
|
6376
|
+
)
|
|
6377
|
+
}
|
|
6378
|
+
) })
|
|
6379
|
+
] }, index);
|
|
6380
|
+
}) }) });
|
|
6381
|
+
}
|
|
6382
|
+
var WizardForm = ({
|
|
6383
|
+
fields,
|
|
6384
|
+
record,
|
|
6385
|
+
onSubmit
|
|
6386
|
+
}) => {
|
|
6387
|
+
const [currentStep, setCurrentStep] = useState(1);
|
|
6388
|
+
const flattenFields4 = (list) => list.flatMap((f) => Array.isArray(f) ? flattenFields4(f) : f);
|
|
6389
|
+
const allFields = flattenFields4(fields);
|
|
6390
|
+
const totalSteps = allFields.reduce(
|
|
6391
|
+
(max, f) => Math.max(max, f.step ?? 1),
|
|
6392
|
+
1
|
|
6393
|
+
);
|
|
6394
|
+
const stepFields = allFields.filter((f) => (f.step ?? 1) === currentStep);
|
|
6395
|
+
return /* @__PURE__ */ jsxs(Card, { className: "flex flex-col gap-4 px-4", children: [
|
|
6396
|
+
/* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-between mb-4 gap-2 px-4", children: [
|
|
6397
|
+
/* @__PURE__ */ jsx(
|
|
6398
|
+
Stepper,
|
|
6399
|
+
{
|
|
6400
|
+
steps: Array(totalSteps).fill({}),
|
|
6401
|
+
currentStep,
|
|
6402
|
+
clickable: true,
|
|
6403
|
+
onStepClick: setCurrentStep
|
|
6404
|
+
}
|
|
6405
|
+
),
|
|
6406
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-center space-x-4 gap-2", children: [
|
|
6407
|
+
/* @__PURE__ */ jsx(
|
|
6408
|
+
Button,
|
|
6409
|
+
{
|
|
6410
|
+
variant: "outline",
|
|
6411
|
+
className: "w-32",
|
|
6412
|
+
onClick: () => setCurrentStep((prev) => prev - 1),
|
|
6413
|
+
disabled: currentStep === 1,
|
|
6414
|
+
children: /* @__PURE__ */ jsx(ChevronLeftIcon, {})
|
|
6415
|
+
}
|
|
6416
|
+
),
|
|
6417
|
+
/* @__PURE__ */ jsx(
|
|
6418
|
+
Button,
|
|
6419
|
+
{
|
|
6420
|
+
variant: "outline",
|
|
6421
|
+
className: "w-32",
|
|
6422
|
+
onClick: () => setCurrentStep((prev) => prev + 1),
|
|
6423
|
+
disabled: currentStep > totalSteps,
|
|
6424
|
+
children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
|
|
6425
|
+
}
|
|
6426
|
+
)
|
|
6427
|
+
] })
|
|
6428
|
+
] }) }),
|
|
6429
|
+
/* @__PURE__ */ jsx(
|
|
6430
|
+
DynamicForm,
|
|
6431
|
+
{
|
|
6432
|
+
record,
|
|
6433
|
+
formSubTitle: "This is a subtitle",
|
|
6434
|
+
formTitle: "Wizard Form Example",
|
|
6435
|
+
withCard: false,
|
|
6436
|
+
errorAlertPosition: "down",
|
|
6437
|
+
fields: stepFields,
|
|
6438
|
+
onSubmit
|
|
6439
|
+
}
|
|
6440
|
+
)
|
|
6441
|
+
] });
|
|
6442
|
+
};
|
|
6298
6443
|
var DynamicFormExample = () => {
|
|
6299
6444
|
const record = {
|
|
6300
6445
|
username: "John Doe ",
|
|
@@ -6585,6 +6730,6 @@ var GenericFilter = ({
|
|
|
6585
6730
|
) }) });
|
|
6586
6731
|
};
|
|
6587
6732
|
|
|
6588
|
-
export { Accordion, AccordionContent, AccordionGroupedSwitchInput, AccordionGroupedSwitches, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, Badge, BaseInput, Button, ButtonGroup, ButtonGroupInput, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CheckListInput, Checkbox, CheckboxInput, ColorCnInput, ColorInput, ComboboxInput, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CurrencyInput, CustomAlert, CustomInputGroup, DateInput, DateTimeInput, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DynamicForm, DynamicFormExample, Field, FieldButtonGroup, FieldContent, FieldCurrency, FieldDateTimeInput, FieldDescription, FieldError, FieldFileMultiUpload, FieldGroup, FieldKeyValueList, FieldLabel, FieldLegend, FieldRepeater, FieldSeparator, FieldSet, FieldSimpleCheckList, FieldSlider, FieldStringValueList, FieldTextGroup, FieldTimeInput2 as FieldTimeInput, FieldTitle, FileInput, FileMultiUploadInput, Form, FormControl, FormDescription, FormErrorsAlert, FormField, FormFieldsGrid, FormItem, FormLabel, FormMessage, GenericFilter, GroupedSwitchInput, GroupedSwitches, Input, InputFactory, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputList, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, InputTypes, KeyValueListInput, Label, MultiSelectInput, NumberInput, OTPInput2 as OTPInput, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, RadioGroup, RadioGroupInput, RadioGroupItem, RepeaterInput, RepeaterTabsInput, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectInput, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SimpleCheckListInput, Slider, SliderInput, SortableListInput, StringValueListInput, Switch, SwitchInput, Tabs, TabsContent, TabsList, TabsTrigger, TagInput, TextAreaInput, TextInput, TextInputGroup, TextInputType, Textarea, TimeInput, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonGroupVariants, buttonVariants, cn, entitiesToGroupedOption, entitiesToInputOption, entityToGroupedOption, entityToInputOption, flattenFields, getDefaultValues, getDynamicSchema, getFieldLabel, handleOnChage, inputFieldComp, isValidField, mockFields, useFormField, validationMessages };
|
|
6733
|
+
export { Accordion, AccordionContent, AccordionGroupedSwitchInput, AccordionGroupedSwitches, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, Badge, BaseInput, Button, ButtonGroup, ButtonGroupInput, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CheckListInput, Checkbox, CheckboxInput, ColorCnInput, ColorInput, ComboboxInput, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CurrencyInput, CustomAlert, CustomInputGroup, DateInput, DateTimeInput, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DynamicForm, DynamicFormExample, Field, FieldButtonGroup, FieldContent, FieldCurrency, FieldDateTimeInput, FieldDescription, FieldError, FieldFileMultiUpload, FieldGroup, FieldKeyValueList, FieldLabel, FieldLegend, FieldRepeater, FieldSeparator, FieldSet, FieldSimpleCheckList, FieldSlider, FieldStringValueList, FieldTextGroup, FieldTimeInput2 as FieldTimeInput, FieldTitle, FileInput, FileMultiUploadInput, Form, FormControl, FormDescription, FormErrorsAlert, FormField, FormFieldsGrid, FormItem, FormLabel, FormMessage, GenericFilter, GroupedSwitchInput, GroupedSwitches, Input, InputFactory, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputList, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, InputTypes, KeyValueListInput, Label, MultiSelectInput, NumberInput, OTPInput2 as OTPInput, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, RadioGroup, RadioGroupInput, RadioGroupItem, RepeaterInput, RepeaterTabsInput, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectInput, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SimpleCheckListInput, Slider, SliderInput, SortableListInput, StringValueListInput, Switch, SwitchInput, Tabs, TabsContent, TabsList, TabsTrigger, TagInput, TextAreaInput, TextInput, TextInputGroup, TextInputType, Textarea, TimeInput, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, WizardForm, badgeVariants, buttonGroupVariants, buttonVariants, cn, entitiesToGroupedOption, entitiesToInputOption, entityToGroupedOption, entityToInputOption, flattenFields, getDefaultValues, getDynamicSchema, getFieldLabel, handleOnChage, inputFieldComp, isValidField, mockFields, useFormField, validationMessages };
|
|
6589
6734
|
//# sourceMappingURL=index.mjs.map
|
|
6590
6735
|
//# sourceMappingURL=index.mjs.map
|