@react-solutions/inputs 1.0.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +162 -98
- package/dist/index.d.mts +3116 -60
- package/dist/index.d.ts +3116 -60
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../lib/pkg/HookFormFields/FormInputTextField.tsx","../lib/pkg/FormFields/TextFields/TextInputField.tsx","../lib/pkg/HookFormFields/FormInputTextArea.tsx","../lib/pkg/HookFormFields/FormInputPasswordField.tsx","../lib/pkg/FormFields/TextFields/PasswordField.tsx","../lib/pkg/HookFormFields/FormInputNumberField.tsx","../lib/pkg/FormFields/TextFields/NumberField.tsx","../lib/pkg/HookFormFields/FormInputTelField.tsx","../lib/pkg/FormFields/TextFields/TelInputField.tsx","../lib/pkg/HookFormFields/FormInputSearchField.tsx","../lib/pkg/FormFields/TextFields/SearchInputField.tsx","../lib/pkg/HookFormFields/FormInputOTPField.tsx","../lib/pkg/FormFields/TextFields/OTPField.tsx","../lib/pkg/HookFormFields/FormInputSelect.tsx","../lib/pkg/FormFields/DropdownFields/SelectInputField.tsx","../lib/pkg/HookFormFields/FormInputMultiSelect.tsx","../lib/pkg/HookFormFields/FormInputAutoComplete.tsx","../lib/pkg/FormFields/DropdownFields/AutoCompleteField.tsx","../lib/pkg/HookFormFields/FormInputMultiAutoComplete.tsx","../lib/pkg/HookFormFields/FormInputColorPicker.tsx","../lib/pkg/FormFields/DropdownFields/ColorPickerField.tsx","../lib/pkg/HookFormFields/FormInputFileUpload.tsx","../lib/pkg/FormFields/DropdownFields/FileUploadField.tsx","../lib/pkg/HookFormFields/FormInputDatePicker.tsx","../lib/pkg/FormFields/DateFields/DatePickerField.tsx","../lib/pkg/HookFormFields/FormInputTimePicker.tsx","../lib/pkg/FormFields/DateFields/TimePickerField.tsx","../lib/pkg/HookFormFields/FormInputTimeClock.tsx","../lib/pkg/FormFields/DateFields/TimeClockField.tsx","../lib/pkg/HookFormFields/FormInputCalender.tsx","../lib/pkg/FormFields/DateFields/DateCalendarField.tsx","../lib/pkg/HookFormFields/FormInputCheckBox.tsx","../lib/pkg/FormFields/BoxFields/CheckBoxField.tsx","../lib/pkg/HookFormFields/FormInputCheckBoxGroup.tsx","../lib/pkg/FormFields/BoxFields/CheckBoxFieldGroup.tsx","../lib/pkg/HookFormFields/FormInputSwitch.tsx","../lib/pkg/FormFields/BoxFields/SwitchField.tsx","../lib/pkg/HookFormFields/FormInputSlider.tsx","../lib/pkg/FormFields/BoxFields/SliderField.tsx","../lib/pkg/HookFormFields/FormInputRadioButton.tsx","../lib/pkg/FormFields/BoxFields/RadioButtonField.tsx","../lib/pkg/HookFormFields/FormInputRadioButtonGroup.tsx","../lib/pkg/FormFields/BoxFields/RadioButtonFieldGroup.tsx","../lib/pkg/FormBuild/Form.tsx","../lib/pkg/FormBuild/HookForm.tsx","../lib/index.ts"],"sourcesContent":["import { memo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\nimport TextInputField from \"../FormFields/TextFields/TextInputField\";\r\nimport type { IFormInputFields } from \"./types\";\r\nimport React from \"react\";\r\nconst FormInputTextField = memo(\r\n\t({ name, label, control, defaultValue = \"\", onChange, ...props }: IFormInputFields) => {\r\n\t\treturn (\r\n\t\t\t<Controller\r\n\t\t\t\tname={name}\r\n\t\t\t\tcontrol={control}\r\n\t\t\t\tdefaultValue={defaultValue}\r\n\t\t\t\trender={({ field, fieldState: { error } }) => {\r\n\t\t\t\t\tconst { size, ...restProps } = props;\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<TextInputField\r\n\t\t\t\t\t\t\t{...restProps}\r\n\t\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\t\tlabel={label}\r\n\t\t\t\t\t\t\tvalue={field.value ?? \"\"}\r\n\t\t\t\t\t\t\tonChange={(e) => {\r\n\t\t\t\t\t\t\t\tfield.onChange(e);\r\n\t\t\t\t\t\t\t\tonChange?.(e.target.value);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tonBlur={field.onBlur}\r\n\t\t\t\t\t\t\tsize={size as any}\r\n\t\t\t\t\t\t\terror={error}\r\n\t\t\t\t\t\t\thelperText={error?.message}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t);\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nFormInputTextField.displayName = \"FormInputTextField\";\r\n\r\nexport default FormInputTextField;\r\n","import { FormControl, InputAdornment, TextField, type TextFieldProps } from \"@mui/material\";\r\nimport React, { type ChangeEvent, type FocusEvent } from \"react\";\r\nimport { type ForwardedRef, forwardRef, memo, useCallback, useMemo } from \"react\";\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n\tmessage?: string;\r\n} | null;\r\n\r\n/**\r\n * Resize options for textarea\r\n */\r\nexport type ResizeOption = \"none\" | \"both\" | \"horizontal\" | \"vertical\";\r\n\r\n/**\r\n * Text transformation options\r\n */\r\nexport type TextTransformOption = \"uppercase\" | \"lowercase\" | \"capitalize\";\r\n\r\n/**\r\n * Extended Text Input Field Props\r\n * Extends MUI TextFieldProps with custom text field props\r\n */\r\nexport interface ITextInputFieldProps\r\n\textends Omit<\r\n\t\tTextFieldProps,\r\n\t\t\"value\" | \"onChange\" | \"name\" | \"type\" | \"error\" | \"inputRef\" | \"multiline\"\r\n\t> {\r\n\t/** Field name for form identification */\r\n\tname?: string;\r\n\t/** Label text for the text field */\r\n\tlabel?: string;\r\n\t/** Current text value */\r\n\tvalue: string;\r\n\t/** Error object with optional message */\r\n\terror?: FieldError;\r\n\t/** Helper text to display below field */\r\n\thelperText?: string;\r\n\t/** Whether the field is disabled */\r\n\tdisabled?: boolean;\r\n\t/** Placeholder text */\r\n\tplaceholder?: string;\r\n\t/** TextField variant */\r\n\tvariant?: TextFieldProps[\"variant\"];\r\n\t/** TextField size */\r\n\tsize?: TextFieldProps[\"size\"];\r\n\t/** TextField color */\r\n\tcolor?: TextFieldProps[\"color\"];\r\n\t/** Full width of the field */\r\n\tfullWidth?: boolean;\r\n\t/** Required field indicator */\r\n\trequired?: boolean;\r\n\t/** Whether to enable multiline input (textarea) */\r\n\tmultiline?: boolean;\r\n\t/** Number of rows for multiline input */\r\n\trows?: number;\r\n\t/** Minimum number of rows for multiline input */\r\n\tminRows?: number;\r\n\t/** Maximum number of rows for multiline input */\r\n\tmaxRows?: number;\r\n\t/** Resize option for textarea (none, both, horizontal, vertical) */\r\n\tresize?: ResizeOption;\r\n\t/** Maximum length of input */\r\n\tmaxLength?: number;\r\n\t/** Minimum length of input */\r\n\tminLength?: number;\r\n\t/** Input type (text, email, number, tel, url, etc.) */\r\n\ttype?: string;\r\n\t/** Auto complete attribute */\r\n\tautoComplete?: string;\r\n\t/** Start adornment (icon or element before input) */\r\n\tstartAdornment?: React.ReactNode;\r\n\t/** End adornment (icon or element after input) */\r\n\tendAdornment?: React.ReactNode;\r\n\t/** Callback fired when the value changes */\r\n\tonChange?: (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;\r\n\t/** Callback fired when field receives focus */\r\n\tonFocus?: (event: FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;\r\n\t/** Callback fired when field loses focus */\r\n\tonBlur?: (event: FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;\r\n\t/** Callback fired on Enter key press */\r\n\tonEnterPress?: (value: string) => void;\r\n\t/** Custom styles for the TextField */\r\n\tinputStyles?: TextFieldProps[\"sx\"];\r\n\t/** Custom styles for FormControl */\r\n\tformControlStyles?: React.ComponentProps<typeof FormControl>[\"sx\"];\r\n\t/** Custom slot props for MUI v7 */\r\n\tslotProps?: TextFieldProps[\"slotProps\"];\r\n\t/** Custom slots for MUI v7 */\r\n\tslots?: TextFieldProps[\"slots\"];\r\n\t/** Text transformation option */\r\n\ttextTransform?: TextTransformOption;\r\n}\r\n\r\nconst TextInputField = memo(\r\n\tforwardRef<HTMLDivElement, ITextInputFieldProps>(\r\n\t\t(\r\n\t\t\t{\r\n\t\t\t\tname,\r\n\t\t\t\tlabel,\r\n\t\t\t\tvalue,\r\n\t\t\t\tonChange,\r\n\t\t\t\tonFocus,\r\n\t\t\t\tonBlur,\r\n\t\t\t\tonEnterPress,\r\n\t\t\t\terror,\r\n\t\t\t\thelperText,\r\n\t\t\t\tdisabled = false,\r\n\t\t\t\tplaceholder,\r\n\t\t\t\tvariant = \"outlined\",\r\n\t\t\t\tsize,\r\n\t\t\t\tcolor = \"primary\",\r\n\t\t\t\tfullWidth = true,\r\n\t\t\t\trequired,\r\n\t\t\t\tmultiline = false,\r\n\t\t\t\trows,\r\n\t\t\t\tminRows,\r\n\t\t\t\tmaxRows,\r\n\t\t\t\tresize = \"both\",\r\n\t\t\t\tmaxLength,\r\n\t\t\t\tminLength,\r\n\t\t\t\ttype = \"text\",\r\n\t\t\t\tautoComplete = \"off\",\r\n\t\t\t\tstartAdornment,\r\n\t\t\t\tendAdornment,\r\n\t\t\t\tinputStyles,\r\n\t\t\t\tformControlStyles,\r\n\t\t\t\tslotProps,\r\n\t\t\t\tslots,\r\n\t\t\t\ttextTransform,\r\n\t\t\t\t...textFieldProps\r\n\t\t\t},\r\n\t\t\tref: ForwardedRef<HTMLDivElement>\r\n\t\t) => {\r\n\t\t\t// Handle Enter key press\r\n\t\t\tconst handleKeyDown = useCallback(\r\n\t\t\t\t(event: React.KeyboardEvent<HTMLDivElement>) => {\r\n\t\t\t\t\tif (event.key === \"Enter\" && !multiline && onEnterPress) {\r\n\t\t\t\t\t\tonEnterPress(value);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Call original onKeyDown if provided\r\n\t\t\t\t\tif (textFieldProps.onKeyDown) {\r\n\t\t\t\t\t\ttextFieldProps.onKeyDown(event);\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t[multiline, onEnterPress, value, textFieldProps.onKeyDown]\r\n\t\t\t);\r\n\r\n\t\t\t// Handle text change with transformation\r\n\t\t\tconst handleChange = useCallback(\r\n\t\t\t\t(event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\r\n\t\t\t\t\tif (onChange) {\r\n\t\t\t\t\t\tif (textTransform) {\r\n\t\t\t\t\t\t\tconst { value } = event.target;\r\n\t\t\t\t\t\t\tlet transformedValue = value;\r\n\r\n\t\t\t\t\t\t\tswitch (textTransform) {\r\n\t\t\t\t\t\t\t\tcase \"uppercase\":\r\n\t\t\t\t\t\t\t\t\ttransformedValue = value.toUpperCase();\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\tcase \"lowercase\":\r\n\t\t\t\t\t\t\t\t\ttransformedValue = value.toLowerCase();\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\tcase \"capitalize\":\r\n\t\t\t\t\t\t\t\t\ttransformedValue = value.replace(/\\b\\w/g, (char) => char.toUpperCase());\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tevent.target.value = transformedValue;\r\n\t\t\t\t\t\t\tonChange(event);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tonChange(event);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t[onChange, textTransform]\r\n\t\t\t);\r\n\r\n\t\t\t// Build input props\r\n\t\t\tconst inputProps = useMemo(\r\n\t\t\t\t() => ({\r\n\t\t\t\t\tmaxLength,\r\n\t\t\t\t\tminLength,\r\n\t\t\t\t\t...((textFieldProps as any).inputProps || {}),\r\n\t\t\t\t}),\r\n\t\t\t\t[maxLength, minLength, textFieldProps]\r\n\t\t\t);\r\n\r\n\t\t\t// Memoize adornments\r\n\t\t\tconst startAdornmentElement = useMemo(\r\n\t\t\t\t() =>\r\n\t\t\t\t\tstartAdornment ?\r\n\t\t\t\t\t\t<InputAdornment position=\"start\">{startAdornment}</InputAdornment>\r\n\t\t\t\t\t:\tundefined,\r\n\t\t\t\t[startAdornment]\r\n\t\t\t);\r\n\r\n\t\t\tconst endAdornmentElement = useMemo(\r\n\t\t\t\t() =>\r\n\t\t\t\t\tendAdornment ? <InputAdornment position=\"end\">{endAdornment}</InputAdornment> : undefined,\r\n\t\t\t\t[endAdornment]\r\n\t\t\t);\r\n\r\n\t\t\t// Build slotProps for MUI v7\r\n\t\t\tconst finalSlotProps = useMemo(\r\n\t\t\t\t() => ({\r\n\t\t\t\t\t...slotProps,\r\n\t\t\t\t\tinput: {\r\n\t\t\t\t\t\t...slotProps?.input,\r\n\t\t\t\t\t\tinputProps,\r\n\t\t\t\t\t\t...(startAdornmentElement && {\r\n\t\t\t\t\t\t\tstartAdornment: startAdornmentElement,\r\n\t\t\t\t\t\t}),\r\n\t\t\t\t\t\t...(endAdornmentElement && {\r\n\t\t\t\t\t\t\tendAdornment: endAdornmentElement,\r\n\t\t\t\t\t\t}),\r\n\t\t\t\t\t},\r\n\t\t\t\t}),\r\n\t\t\t\t[slotProps, inputProps, startAdornmentElement, endAdornmentElement]\r\n\t\t\t);\r\n\r\n\t\t\t// Build sx styles with resize for textarea\r\n\t\t\tconst finalInputStyles = useMemo(\r\n\t\t\t\t() =>\r\n\t\t\t\t\tmultiline ?\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t...inputStyles,\r\n\t\t\t\t\t\t\t\"& textarea\": {\r\n\t\t\t\t\t\t\t\tresize: resize,\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t:\tinputStyles,\r\n\t\t\t\t[multiline, inputStyles, resize]\r\n\t\t\t);\r\n\r\n\t\t\t// Memoize helper text\r\n\t\t\tconst displayHelperText = useMemo(\r\n\t\t\t\t() => helperText ?? (error?.message ? error.message : undefined),\r\n\t\t\t\t[helperText, error?.message]\r\n\t\t\t);\r\n\r\n\t\t\treturn (\r\n\t\t\t\t<FormControl\r\n\t\t\t\t\terror={!!error}\r\n\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\trequired={required}\r\n\t\t\t\t\tfullWidth={fullWidth}\r\n\t\t\t\t\tsx={formControlStyles}\r\n\t\t\t\t>\r\n\t\t\t\t\t<TextField\r\n\t\t\t\t\t\t{...textFieldProps}\r\n\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\tlabel={label}\r\n\t\t\t\t\t\tvalue={value}\r\n\t\t\t\t\t\tonChange={handleChange}\r\n\t\t\t\t\t\tonFocus={onFocus}\r\n\t\t\t\t\t\tonBlur={onBlur}\r\n\t\t\t\t\t\tonKeyDown={handleKeyDown}\r\n\t\t\t\t\t\tplaceholder={placeholder}\r\n\t\t\t\t\t\tvariant={variant}\r\n\t\t\t\t\t\tsize={size}\r\n\t\t\t\t\t\tcolor={color}\r\n\t\t\t\t\t\tfullWidth={fullWidth}\r\n\t\t\t\t\t\trequired={required}\r\n\t\t\t\t\t\terror={!!error}\r\n\t\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\t\tmultiline={multiline}\r\n\t\t\t\t\t\trows={rows}\r\n\t\t\t\t\t\tminRows={minRows}\r\n\t\t\t\t\t\tmaxRows={maxRows}\r\n\t\t\t\t\t\ttype={multiline ? undefined : type}\r\n\t\t\t\t\t\tautoComplete={autoComplete}\r\n\t\t\t\t\t\tslotProps={finalSlotProps}\r\n\t\t\t\t\t\tslots={slots}\r\n\t\t\t\t\t\tsx={finalInputStyles}\r\n\t\t\t\t\t\tref={ref}\r\n\t\t\t\t\t\thelperText={displayHelperText}\r\n\t\t\t\t\t/>\r\n\t\t\t\t</FormControl>\r\n\t\t\t);\r\n\t\t}\r\n\t)\r\n);\r\n\r\nTextInputField.displayName = \"TextInputField\";\r\n\r\nexport default TextInputField;\r\n","import { memo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\nimport TextInputField from \"../FormFields/TextFields/TextInputField\";\r\nimport type { IFormInputTextAreaFields } from \"./types\";\r\nimport React from \"react\";\r\nconst FormInputTextArea = memo(\r\n\t({\r\n\t\tname,\r\n\t\tlabel,\r\n\t\tcontrol,\r\n\t\trows,\r\n\t\tminRows,\r\n\t\tmaxRows,\r\n\t\tresize,\r\n\t\tdefaultValue = \"\",\r\n\t\tonChange,\r\n\t\t...props\r\n\t}: IFormInputTextAreaFields) => {\r\n\t\treturn (\r\n\t\t\t<Controller\r\n\t\t\t\tname={name}\r\n\t\t\t\tcontrol={control}\r\n\t\t\t\tdefaultValue={defaultValue}\r\n\t\t\t\trender={({ field, fieldState: { error } }) => {\r\n\t\t\t\t\tconst { size, ...restProps } = props;\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<TextInputField\r\n\t\t\t\t\t\t\t{...restProps}\r\n\t\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\t\tlabel={label}\r\n\t\t\t\t\t\t\tvalue={field.value ?? \"\"}\r\n\t\t\t\t\t\t\tonChange={(e) => {\r\n\t\t\t\t\t\t\t\tfield.onChange(e);\r\n\t\t\t\t\t\t\t\tonChange?.(e.target.value);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tonBlur={field.onBlur}\r\n\t\t\t\t\t\t\tmultiline\r\n\t\t\t\t\t\t\trows={rows}\r\n\t\t\t\t\t\t\tminRows={minRows}\r\n\t\t\t\t\t\t\tmaxRows={maxRows}\r\n\t\t\t\t\t\t\tresize={resize}\r\n\t\t\t\t\t\t\tsize={size as any}\r\n\t\t\t\t\t\t\terror={error}\r\n\t\t\t\t\t\t\thelperText={error?.message}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t);\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nFormInputTextArea.displayName = \"FormInputTextArea\";\r\n\r\nexport default FormInputTextArea;\r\n","import { memo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\nimport PasswordField from \"../FormFields/TextFields/PasswordField\";\r\nimport type { IFormInputFields } from \"./types\";\r\nimport React from \"react\";\r\nconst FormInputPasswordField = memo(\r\n\t({ name, label, control, size, defaultValue = \"\", onChange, ...props }: IFormInputFields) => {\r\n\t\treturn (\r\n\t\t\t<Controller\r\n\t\t\t\tname={name}\r\n\t\t\t\tcontrol={control}\r\n\t\t\t\tdefaultValue={defaultValue}\r\n\t\t\t\trender={({ field, fieldState: { error } }) => {\r\n\t\t\t\t\tconst { size: sizeProp, ...restProps } = props;\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<PasswordField\r\n\t\t\t\t\t\t\t{...restProps}\r\n\t\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\t\tlabel={label}\r\n\t\t\t\t\t\t\tvalue={field.value ?? \"\"}\r\n\t\t\t\t\t\t\tonChange={(e) => {\r\n\t\t\t\t\t\t\t\tfield.onChange(e);\r\n\t\t\t\t\t\t\t\tonChange?.(e.target.value);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tonBlur={field.onBlur}\r\n\t\t\t\t\t\t\terror={error}\r\n\t\t\t\t\t\t\thelperText={error?.message}\r\n\t\t\t\t\t\t\tsize={(size ?? sizeProp) as any}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t);\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nFormInputPasswordField.displayName = \"FormInputPasswordField\";\r\n\r\nexport default FormInputPasswordField;\r\n","import Visibility from \"@mui/icons-material/Visibility\";\r\nimport VisibilityOff from \"@mui/icons-material/VisibilityOff\";\r\nimport {\r\n\tFormControl,\r\n\tFormHelperText,\r\n\tIconButton,\r\n\ttype IconButtonProps,\r\n\tInputAdornment,\r\n\tTextField,\r\n\ttype TextFieldProps,\r\n} from \"@mui/material\";\r\nimport React, { type ChangeEvent, type FocusEvent } from \"react\";\r\nimport { type ForwardedRef, forwardRef, useState, memo, useCallback, useMemo } from \"react\";\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n\tmessage?: string;\r\n} | null;\r\n\r\n/**\r\n * Password strength level\r\n */\r\nexport type PasswordStrength = \"weak\" | \"medium\" | \"strong\" | \"very-strong\";\r\n\r\n/**\r\n * Extended Password Field Props\r\n * Extends MUI TextFieldProps with custom password field props\r\n */\r\nexport interface IPasswordFieldProps\r\n\textends Omit<TextFieldProps, \"value\" | \"onChange\" | \"name\" | \"type\" | \"error\" | \"inputRef\"> {\r\n\t/** Field name for form identification */\r\n\tname?: string;\r\n\t/** Label text for the password field */\r\n\tlabel?: string;\r\n\t/** Current password value */\r\n\tvalue: string;\r\n\t/** Error object with optional message */\r\n\terror?: FieldError;\r\n\t/** Helper text to display below field */\r\n\thelperText?: string;\r\n\t/** Whether the field is disabled */\r\n\tdisabled?: boolean;\r\n\t/** Placeholder text */\r\n\tplaceholder?: string;\r\n\t/** TextField variant */\r\n\tvariant?: TextFieldProps[\"variant\"];\r\n\t/** TextField size */\r\n\tsize?: TextFieldProps[\"size\"];\r\n\t/** TextField color */\r\n\tcolor?: TextFieldProps[\"color\"];\r\n\t/** Full width of the field */\r\n\tfullWidth?: boolean;\r\n\t/** Required field indicator */\r\n\trequired?: boolean;\r\n\t/** Whether to show password strength indicator */\r\n\tshowPasswordStrength?: boolean;\r\n\t/** Minimum password length */\r\n\tminLength?: number;\r\n\t/** Maximum password length */\r\n\tmaxLength?: number;\r\n\t/** Whether to show password by default */\r\n\tdefaultShowPassword?: boolean;\r\n\t/** Custom visibility toggle icon (when password is visible) */\r\n\tvisibilityIcon?: React.ReactNode;\r\n\t/** Custom visibility off icon (when password is hidden) */\r\n\tvisibilityOffIcon?: React.ReactNode;\r\n\t/** Custom icon button props */\r\n\ticonButtonProps?: IconButtonProps;\r\n\t/** Callback fired when the value changes */\r\n\tonChange?: (event: ChangeEvent<HTMLInputElement>) => void;\r\n\t/** Callback fired when field receives focus */\r\n\tonFocus?: (event: FocusEvent<HTMLInputElement>) => void;\r\n\t/** Callback fired when field loses focus */\r\n\tonBlur?: (event: FocusEvent<HTMLInputElement>) => void;\r\n\t/** Callback fired when password visibility toggles */\r\n\tonVisibilityToggle?: (isVisible: boolean) => void;\r\n\t/** Custom function to calculate password strength */\r\n\tgetPasswordStrength?: (password: string) => PasswordStrength;\r\n\t/** Custom styles for the TextField */\r\n\tinputStyles?: TextFieldProps[\"sx\"];\r\n\t/** Custom styles for FormControl */\r\n\tformControlStyles?: React.ComponentProps<typeof FormControl>[\"sx\"];\r\n\t/** Custom slot props for MUI v7 */\r\n\tslotProps?: TextFieldProps[\"slotProps\"];\r\n\t/** Custom slots for MUI v7 */\r\n\tslots?: TextFieldProps[\"slots\"];\r\n}\r\n\r\n/**\r\n * Calculate password strength\r\n */\r\nconst calculatePasswordStrength = (password: string): PasswordStrength => {\r\n\tif (!password) return \"weak\";\r\n\r\n\tlet strength = 0;\r\n\r\n\t// Length check\r\n\tif (password.length >= 8) strength++;\r\n\tif (password.length >= 12) strength++;\r\n\r\n\t// Character variety checks\r\n\tif (/[a-z]/.test(password)) strength++;\r\n\tif (/[A-Z]/.test(password)) strength++;\r\n\tif (/[0-9]/.test(password)) strength++;\r\n\tif (/[^a-zA-Z0-9]/.test(password)) strength++;\r\n\r\n\tif (strength <= 2) return \"weak\";\r\n\tif (strength <= 4) return \"medium\";\r\n\tif (strength <= 5) return \"strong\";\r\n\treturn \"very-strong\";\r\n};\r\n\r\n/**\r\n * Get password strength color\r\n */\r\nconst getPasswordStrengthColor = (strength: PasswordStrength): string => {\r\n\tswitch (strength) {\r\n\t\tcase \"weak\":\r\n\t\t\treturn \"#f44336\"; // red\r\n\t\tcase \"medium\":\r\n\t\t\treturn \"#ff9800\"; // orange\r\n\t\tcase \"strong\":\r\n\t\t\treturn \"#4caf50\"; // green\r\n\t\tcase \"very-strong\":\r\n\t\t\treturn \"#2196f3\"; // blue\r\n\t\tdefault:\r\n\t\t\treturn \"#9e9e9e\"; // grey\r\n\t}\r\n};\r\n\r\nconst PasswordField = memo(\r\n\tforwardRef<HTMLInputElement, IPasswordFieldProps>(\r\n\t\t(\r\n\t\t\t{\r\n\t\t\t\tname,\r\n\t\t\t\tlabel,\r\n\t\t\t\tvalue,\r\n\t\t\t\tonChange,\r\n\t\t\t\tonFocus,\r\n\t\t\t\tonBlur,\r\n\t\t\t\tonVisibilityToggle,\r\n\t\t\t\terror,\r\n\t\t\t\thelperText,\r\n\t\t\t\tdisabled = false,\r\n\t\t\t\tplaceholder,\r\n\t\t\t\tvariant = \"outlined\",\r\n\t\t\t\tsize,\r\n\t\t\t\tcolor,\r\n\t\t\t\tfullWidth = true,\r\n\t\t\t\trequired,\r\n\t\t\t\tshowPasswordStrength = false,\r\n\t\t\t\tminLength,\r\n\t\t\t\tmaxLength,\r\n\t\t\t\tdefaultShowPassword = false,\r\n\t\t\t\tvisibilityIcon = <Visibility />,\r\n\t\t\t\tvisibilityOffIcon = <VisibilityOff />,\r\n\t\t\t\ticonButtonProps,\r\n\t\t\t\tgetPasswordStrength = calculatePasswordStrength,\r\n\t\t\t\tinputStyles,\r\n\t\t\t\tformControlStyles,\r\n\t\t\t\tslotProps,\r\n\t\t\t\tslots,\r\n\t\t\t\t...textFieldProps\r\n\t\t\t},\r\n\t\t\tref: ForwardedRef<HTMLInputElement>\r\n\t\t) => {\r\n\t\t\tconst [showPassword, setShowPassword] = useState<boolean>(defaultShowPassword);\r\n\r\n\t\t\t// Toggle password visibility\r\n\t\t\tconst togglePasswordVisibility = useCallback(() => {\r\n\t\t\t\tsetShowPassword((prev) => {\r\n\t\t\t\t\tconst newVisibility = !prev;\r\n\t\t\t\t\tif (onVisibilityToggle) {\r\n\t\t\t\t\t\tonVisibilityToggle(newVisibility);\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn newVisibility;\r\n\t\t\t\t});\r\n\t\t\t}, [onVisibilityToggle]);\r\n\r\n\t\t\t// Calculate password strength\r\n\t\t\tconst passwordStrength = useMemo(\r\n\t\t\t\t() => (showPasswordStrength ? getPasswordStrength(value) : null),\r\n\t\t\t\t[showPasswordStrength, value]\r\n\t\t\t);\r\n\r\n\t\t\t// Get strength indicator\r\n\t\t\tconst getStrengthIndicator = () => {\r\n\t\t\t\tif (!passwordStrength || !value) return null;\r\n\r\n\t\t\t\tconst strengthColor = getPasswordStrengthColor(passwordStrength);\r\n\t\t\t\tconst strengthText =\r\n\t\t\t\t\tpasswordStrength.charAt(0).toUpperCase() + passwordStrength.slice(1).replace(\"-\", \" \");\r\n\r\n\t\t\t\treturn (\r\n\t\t\t\t\t<div style={{ marginTop: \"4px\", fontSize: \"0.75rem\" }}>\r\n\t\t\t\t\t\t<span style={{ color: strengthColor, fontWeight: 500 }}>Strength: {strengthText}</span>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t);\r\n\t\t\t};\r\n\r\n\t\t\t// Handle onChange with validation\r\n\t\t\tconst handleChange = useCallback(\r\n\t\t\t\t(event: ChangeEvent<HTMLInputElement>) => {\r\n\t\t\t\t\tconst newValue = event.target.value;\r\n\r\n\t\t\t\t\t// Check max length\r\n\t\t\t\t\tif (maxLength && newValue.length > maxLength) {\r\n\t\t\t\t\t\treturn; // Don't update if exceeds max length\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (onChange) {\r\n\t\t\t\t\t\tonChange(event);\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t[maxLength, onChange]\r\n\t\t\t);\r\n\r\n\t\t\t// Memoize end adornment\r\n\t\t\tconst endAdornmentElement = useMemo(\r\n\t\t\t\t() => (\r\n\t\t\t\t\t<InputAdornment position=\"end\">\r\n\t\t\t\t\t\t<IconButton\r\n\t\t\t\t\t\t\tonClick={togglePasswordVisibility}\r\n\t\t\t\t\t\t\tonMouseDown={(e) => e.preventDefault()}\r\n\t\t\t\t\t\t\tedge=\"end\"\r\n\t\t\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\t\t\t{...iconButtonProps}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{showPassword ? visibilityOffIcon : visibilityIcon}\r\n\t\t\t\t\t\t</IconButton>\r\n\t\t\t\t\t</InputAdornment>\r\n\t\t\t\t),\r\n\t\t\t\t[\r\n\t\t\t\t\ttogglePasswordVisibility,\r\n\t\t\t\t\tdisabled,\r\n\t\t\t\t\ticonButtonProps,\r\n\t\t\t\t\tshowPassword,\r\n\t\t\t\t\tvisibilityOffIcon,\r\n\t\t\t\t\tvisibilityIcon,\r\n\t\t\t\t]\r\n\t\t\t);\r\n\r\n\t\t\t// Memoize slot props\r\n\t\t\tconst finalSlotProps = useMemo(\r\n\t\t\t\t() => ({\r\n\t\t\t\t\t...slotProps,\r\n\t\t\t\t\tinput: {\r\n\t\t\t\t\t\t...slotProps?.input,\r\n\t\t\t\t\t\t...(minLength || maxLength ?\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tinputProps: {\r\n\t\t\t\t\t\t\t\t\tminLength,\r\n\t\t\t\t\t\t\t\t\tmaxLength,\r\n\t\t\t\t\t\t\t\t\t...((slotProps?.input as any)?.inputProps || {}),\r\n\t\t\t\t\t\t\t\t\t...((textFieldProps as any).inputProps || {}),\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t:\t{}),\r\n\t\t\t\t\t\tendAdornment: endAdornmentElement,\r\n\t\t\t\t\t},\r\n\t\t\t\t}),\r\n\t\t\t\t[slotProps, minLength, maxLength, textFieldProps, endAdornmentElement]\r\n\t\t\t);\r\n\r\n\t\t\t// Memoize helper text\r\n\t\t\tconst displayHelperText = useMemo(\r\n\t\t\t\t() => helperText ?? (error?.message ? error.message : undefined),\r\n\t\t\t\t[helperText, error?.message]\r\n\t\t\t);\r\n\r\n\t\t\treturn (\r\n\t\t\t\t<FormControl\r\n\t\t\t\t\tfullWidth={fullWidth}\r\n\t\t\t\t\terror={!!error}\r\n\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\trequired={required}\r\n\t\t\t\t\tsx={formControlStyles}\r\n\t\t\t\t>\r\n\t\t\t\t\t<TextField\r\n\t\t\t\t\t\t{...textFieldProps}\r\n\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\tlabel={label}\r\n\t\t\t\t\t\ttype={showPassword ? \"text\" : \"password\"}\r\n\t\t\t\t\t\tvalue={value}\r\n\t\t\t\t\t\tonChange={handleChange}\r\n\t\t\t\t\t\tonFocus={onFocus}\r\n\t\t\t\t\t\tonBlur={onBlur}\r\n\t\t\t\t\t\tplaceholder={placeholder}\r\n\t\t\t\t\t\tvariant={variant}\r\n\t\t\t\t\t\tsize={size}\r\n\t\t\t\t\t\tcolor={color}\r\n\t\t\t\t\t\tfullWidth={fullWidth}\r\n\t\t\t\t\t\trequired={required}\r\n\t\t\t\t\t\terror={!!error}\r\n\t\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\t\tslotProps={finalSlotProps}\r\n\t\t\t\t\t\tslots={slots}\r\n\t\t\t\t\t\tsx={inputStyles}\r\n\t\t\t\t\t\tref={ref}\r\n\t\t\t\t\t\thelperText={displayHelperText}\r\n\t\t\t\t\t/>\r\n\t\t\t\t\t{showPasswordStrength && getStrengthIndicator()}\r\n\t\t\t\t\t{error && !helperText && error.message && (\r\n\t\t\t\t\t\t<FormHelperText>{error.message}</FormHelperText>\r\n\t\t\t\t\t)}\r\n\t\t\t\t\t{!error && helperText && <FormHelperText>{helperText}</FormHelperText>}\r\n\t\t\t\t</FormControl>\r\n\t\t\t);\r\n\t\t}\r\n\t)\r\n);\r\n\r\nPasswordField.displayName = \"PasswordField\";\r\n\r\nexport default PasswordField;\r\n","import { memo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\nimport NumberField from \"../FormFields/TextFields/NumberField\";\r\nimport type { IFormInputNumberFields } from \"./types\";\r\nimport React from \"react\";\r\nconst FormInputNumberField = memo(\r\n\t({\r\n\t\tname,\r\n\t\tlabel,\r\n\t\tcontrol,\r\n\t\tpattern,\r\n\t\tmin,\r\n\t\tmax,\r\n\t\tstep,\r\n\t\tallowDecimals,\r\n\t\tdecimalPlaces,\r\n\t\tdefaultValue = \"\",\r\n\t\tonChange,\r\n\t\t...props\r\n\t}: IFormInputNumberFields) => {\r\n\t\treturn (\r\n\t\t\t<Controller\r\n\t\t\t\tname={name}\r\n\t\t\t\tcontrol={control}\r\n\t\t\t\tdefaultValue={defaultValue}\r\n\t\t\t\trender={({ field, fieldState: { error } }) => {\r\n\t\t\t\t\tconst { size, ...restProps } = props;\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<NumberField\r\n\t\t\t\t\t\t\t{...restProps}\r\n\t\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\t\tlabel={label}\r\n\t\t\t\t\t\t\tvalue={field.value ?? \"\"}\r\n\t\t\t\t\t\t\tonChange={(e) => {\r\n\t\t\t\t\t\t\t\tfield.onChange(e);\r\n\t\t\t\t\t\t\t\tonChange?.(e.target.value);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tonBlur={field.onBlur}\r\n\t\t\t\t\t\t\tpattern={pattern}\r\n\t\t\t\t\t\t\tmin={min}\r\n\t\t\t\t\t\t\tmax={max}\r\n\t\t\t\t\t\t\tstep={step}\r\n\t\t\t\t\t\t\tallowDecimals={allowDecimals}\r\n\t\t\t\t\t\t\tdecimalPlaces={decimalPlaces}\r\n\t\t\t\t\t\t\tsize={size as any}\r\n\t\t\t\t\t\t\terror={error}\r\n\t\t\t\t\t\t\thelperText={error?.message}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t);\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nFormInputNumberField.displayName = \"FormInputNumberField\";\r\n\r\nexport default FormInputNumberField;\r\n","import { FormControl, InputAdornment, TextField, type TextFieldProps } from \"@mui/material\";\r\nimport React, { type ChangeEvent, type FocusEvent } from \"react\";\r\nimport {\r\n\ttype ForwardedRef,\r\n\tforwardRef,\r\n\tuseState,\r\n\tuseEffect,\r\n\tuseCallback,\r\n\tmemo,\r\n\tuseMemo,\r\n} from \"react\";\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n\tmessage?: string;\r\n} | null;\r\n\r\n/**\r\n * Number pattern types\r\n */\r\nexport type NumberPattern =\r\n\t| \"phone\"\r\n\t| \"credit-card\"\r\n\t| \"currency\"\r\n\t| \"ssn\"\r\n\t| \"zip-code\"\r\n\t| \"decimal\"\r\n\t| \"integer\"\r\n\t| \"percentage\"\r\n\t| \"custom\";\r\n\r\n/**\r\n * Extract only digits from a string\r\n */\r\nconst extractDigits = (value: string): string => {\r\n\treturn value.replace(/\\D/g, \"\");\r\n};\r\n\r\n/**\r\n * Format value according to pattern (X represents digits)\r\n * Example: pattern \"XXX-XXXX\" with digits \"1234567\" -> \"123-4567\"\r\n */\r\nconst formatByPattern = (digits: string, pattern: string): string => {\r\n\tif (!pattern || !digits) return digits;\r\n\tlet formatted = \"\";\r\n\tlet digitIndex = 0;\r\n\tfor (let i = 0; i < pattern.length && digitIndex < digits.length; i++) {\r\n\t\tif (pattern[i] === \"X\") {\r\n\t\t\tformatted += digits[digitIndex];\r\n\t\t\tdigitIndex++;\r\n\t\t} else {\r\n\t\t\tformatted += pattern[i];\r\n\t\t}\r\n\t}\r\n\treturn formatted;\r\n};\r\n\r\n/**\r\n * Generate placeholder from pattern\r\n */\r\nconst generatePlaceholderFromPattern = (pattern: string): string => {\r\n\tif (!pattern) return \"\";\r\n\treturn pattern.replace(/X/g, \"0\");\r\n};\r\n\r\n/**\r\n * Format phone number (XXX) XXX-XXXX\r\n */\r\nconst formatPhoneNumber = (value: string): string => {\r\n\tconst numbers = extractDigits(value);\r\n\tif (numbers.length <= 3) return numbers;\r\n\tif (numbers.length <= 6) return `(${numbers.slice(0, 3)}) ${numbers.slice(3)}`;\r\n\treturn `(${numbers.slice(0, 3)}) ${numbers.slice(3, 6)}-${numbers.slice(6, 10)}`;\r\n};\r\n\r\n/**\r\n * Format credit card XXXX XXXX XXXX XXXX\r\n */\r\nconst formatCreditCard = (value: string): string => {\r\n\tconst numbers = value.replace(/\\D/g, \"\");\r\n\tconst formatted = numbers.match(/.{1,4}/g)?.join(\" \") || numbers;\r\n\treturn formatted.slice(0, 19); // Max 16 digits + 3 spaces\r\n};\r\n\r\n/**\r\n * Format currency $X,XXX.XX\r\n */\r\nconst formatCurrency = (value: string, allowDecimals: boolean = true): string => {\r\n\tconst numbers = value.replace(/[^\\d.]/g, \"\");\r\n\tif (!allowDecimals) {\r\n\t\treturn numbers.replace(/\\D/g, \"\");\r\n\t}\r\n\t// Allow only one decimal point\r\n\tconst parts = numbers.split(\".\");\r\n\tif (parts.length > 2) {\r\n\t\treturn parts[0] + \".\" + parts.slice(1).join(\"\");\r\n\t}\r\n\tif (parts.length === 2 && parts[1].length > 2) {\r\n\t\treturn parts[0] + \".\" + parts[1].slice(0, 2);\r\n\t}\r\n\treturn numbers;\r\n};\r\n\r\n/**\r\n * Format SSN XXX-XX-XXXX\r\n */\r\nconst formatSSN = (value: string): string => {\r\n\tconst numbers = value.replace(/\\D/g, \"\");\r\n\tif (numbers.length <= 3) return numbers;\r\n\tif (numbers.length <= 5) return `${numbers.slice(0, 3)}-${numbers.slice(3)}`;\r\n\treturn `${numbers.slice(0, 3)}-${numbers.slice(3, 5)}-${numbers.slice(5, 9)}`;\r\n};\r\n\r\n/**\r\n * Format ZIP code XXXXX or XXXXX-XXXX\r\n */\r\nconst formatZipCode = (value: string): string => {\r\n\tconst numbers = value.replace(/\\D/g, \"\");\r\n\tif (numbers.length <= 5) return numbers;\r\n\treturn `${numbers.slice(0, 5)}-${numbers.slice(5, 9)}`;\r\n};\r\n\r\n/**\r\n * Format percentage XX%\r\n */\r\nconst formatPercentage = (value: string): string => {\r\n\tconst numbers = value.replace(/\\D/g, \"\");\r\n\treturn numbers.slice(0, 3); // Max 100%\r\n};\r\n\r\n/**\r\n * Extended Number Input Field Props\r\n * Extends MUI TextFieldProps with custom number field props\r\n */\r\nexport interface INumberInputFieldProps\r\n\textends Omit<TextFieldProps, \"value\" | \"onChange\" | \"name\" | \"type\" | \"error\" | \"inputRef\"> {\r\n\t/** Field name for form identification */\r\n\tname?: string;\r\n\t/** Label text for the number field */\r\n\tlabel?: string;\r\n\t/** Current number value (as string to support formatted values) */\r\n\tvalue: string;\r\n\t/** Error object with optional message */\r\n\terror?: FieldError;\r\n\t/** Helper text to display below field */\r\n\thelperText?: string;\r\n\t/** Whether the field is disabled */\r\n\tdisabled?: boolean;\r\n\t/** Placeholder text */\r\n\tplaceholder?: string;\r\n\t/** TextField variant */\r\n\tvariant?: TextFieldProps[\"variant\"];\r\n\t/** TextField size */\r\n\tsize?: TextFieldProps[\"size\"];\r\n\t/** TextField color */\r\n\tcolor?: TextFieldProps[\"color\"];\r\n\t/** Full width of the field */\r\n\tfullWidth?: boolean;\r\n\t/** Required field indicator */\r\n\trequired?: boolean;\r\n\t/** Number pattern type or pattern string (e.g., \"XXX-XXXX\" where X represents digits) */\r\n\tpattern?: NumberPattern | string;\r\n\t/** Custom regex pattern (used when pattern is \"custom\") */\r\n\tcustomPattern?: RegExp;\r\n\t/** Custom formatter function */\r\n\tcustomFormatter?: (value: string) => string;\r\n\t/** Minimum value */\r\n\tmin?: number;\r\n\t/** Maximum value */\r\n\tmax?: number;\r\n\t/** Step value for number input */\r\n\tstep?: number;\r\n\t/** Allow decimal numbers (for decimal pattern) */\r\n\tallowDecimals?: boolean;\r\n\t/** Number of decimal places */\r\n\tdecimalPlaces?: number;\r\n\t/** Start adornment (icon or element before input) */\r\n\tstartAdornment?: React.ReactNode;\r\n\t/** End adornment (icon or element after input) */\r\n\tendAdornment?: React.ReactNode;\r\n\t/** Callback fired when the value changes (returns formatted string) */\r\n\tonChange?: (event: ChangeEvent<HTMLInputElement>) => void;\r\n\t/** Callback fired when field receives focus */\r\n\tonFocus?: (event: FocusEvent<HTMLInputElement>) => void;\r\n\t/** Callback fired when field loses focus */\r\n\tonBlur?: (event: FocusEvent<HTMLInputElement>) => void;\r\n\t/** Callback fired on Enter key press */\r\n\tonEnterPress?: (value: string) => void;\r\n\t/** Custom styles for the TextField */\r\n\tinputStyles?: TextFieldProps[\"sx\"];\r\n\t/** Custom styles for FormControl */\r\n\tformControlStyles?: React.ComponentProps<typeof FormControl>[\"sx\"];\r\n\t/** Custom slot props for MUI v7 */\r\n\tslotProps?: TextFieldProps[\"slotProps\"];\r\n\t/** Custom slots for MUI v7 */\r\n\tslots?: TextFieldProps[\"slots\"];\r\n}\r\n\r\nconst NumberField = memo(\r\n\tforwardRef<HTMLDivElement, INumberInputFieldProps>(\r\n\t\t(\r\n\t\t\t{\r\n\t\t\t\tname,\r\n\t\t\t\tlabel,\r\n\t\t\t\tvalue,\r\n\t\t\t\tonChange,\r\n\t\t\t\tonFocus,\r\n\t\t\t\tonBlur,\r\n\t\t\t\tonEnterPress,\r\n\t\t\t\terror,\r\n\t\t\t\thelperText,\r\n\t\t\t\tdisabled = false,\r\n\t\t\t\tplaceholder,\r\n\t\t\t\tvariant = \"outlined\",\r\n\t\t\t\tsize,\r\n\t\t\t\tcolor = \"primary\",\r\n\t\t\t\tfullWidth = true,\r\n\t\t\t\trequired,\r\n\t\t\t\tpattern = \"integer\",\r\n\t\t\t\tcustomPattern,\r\n\t\t\t\tcustomFormatter,\r\n\t\t\t\tmin,\r\n\t\t\t\tmax,\r\n\t\t\t\tstep,\r\n\t\t\t\tallowDecimals = true,\r\n\t\t\t\tdecimalPlaces = 2,\r\n\t\t\t\tstartAdornment,\r\n\t\t\t\tendAdornment,\r\n\t\t\t\tinputStyles,\r\n\t\t\t\tformControlStyles,\r\n\t\t\t\tslotProps,\r\n\t\t\t\tslots,\r\n\t\t\t\t...textFieldProps\r\n\t\t\t},\r\n\t\t\tref: ForwardedRef<HTMLDivElement>\r\n\t\t) => {\r\n\t\t\tconst [displayValue, setDisplayValue] = useState<string>(value);\r\n\r\n\t\t\t// Check if pattern is a string (pattern string) or a NumberPattern type\r\n\t\t\tconst isPatternString = typeof pattern === \"string\" && pattern.includes(\"X\");\r\n\t\t\tconst activePatternString = isPatternString ? pattern : undefined;\r\n\t\t\tconst activePatternType =\r\n\t\t\t\tisPatternString ? undefined : (pattern as NumberPattern | undefined);\r\n\r\n\t\t\t// Format value based on pattern\r\n\t\t\tconst formatValue = useCallback(\r\n\t\t\t\t(inputValue: string): string => {\r\n\t\t\t\t\tif (!inputValue) return \"\";\r\n\r\n\t\t\t\t\t// If pattern string is provided (from pattern prop), use it for formatting\r\n\t\t\t\t\tif (activePatternString) {\r\n\t\t\t\t\t\tconst digits = extractDigits(inputValue);\r\n\t\t\t\t\t\treturn formatByPattern(digits, activePatternString);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Use predefined pattern types\r\n\t\t\t\t\tswitch (activePatternType) {\r\n\t\t\t\t\t\tcase \"phone\":\r\n\t\t\t\t\t\t\treturn formatPhoneNumber(inputValue);\r\n\t\t\t\t\t\tcase \"credit-card\":\r\n\t\t\t\t\t\t\treturn formatCreditCard(inputValue);\r\n\t\t\t\t\t\tcase \"currency\":\r\n\t\t\t\t\t\t\treturn formatCurrency(inputValue, allowDecimals);\r\n\t\t\t\t\t\tcase \"ssn\":\r\n\t\t\t\t\t\t\treturn formatSSN(inputValue);\r\n\t\t\t\t\t\tcase \"zip-code\":\r\n\t\t\t\t\t\t\treturn formatZipCode(inputValue);\r\n\t\t\t\t\t\tcase \"percentage\":\r\n\t\t\t\t\t\t\treturn formatPercentage(inputValue);\r\n\t\t\t\t\t\tcase \"decimal\":\r\n\t\t\t\t\t\t\treturn formatCurrency(inputValue, allowDecimals);\r\n\t\t\t\t\t\tcase \"integer\":\r\n\t\t\t\t\t\t\treturn extractDigits(inputValue);\r\n\t\t\t\t\t\tcase \"custom\":\r\n\t\t\t\t\t\t\tif (customFormatter) {\r\n\t\t\t\t\t\t\t\treturn customFormatter(inputValue);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif (customPattern) {\r\n\t\t\t\t\t\t\t\tconst numbers = extractDigits(inputValue);\r\n\t\t\t\t\t\t\t\treturn numbers;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn extractDigits(inputValue);\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\treturn extractDigits(inputValue);\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t[activePatternString, activePatternType, allowDecimals, customFormatter, customPattern]\r\n\t\t\t);\r\n\r\n\t\t\t// Update display value when value prop changes\r\n\t\t\tuseEffect(() => {\r\n\t\t\t\tconst formatted = formatValue(value);\r\n\t\t\t\tsetDisplayValue((prev) => {\r\n\t\t\t\t\tif (prev !== formatted) {\r\n\t\t\t\t\t\treturn formatted;\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn prev;\r\n\t\t\t\t});\r\n\t\t\t}, [value, formatValue]);\r\n\r\n\t\t\t// Validate input based on pattern\r\n\t\t\tconst isValidInput = (inputValue: string, key: string): boolean => {\r\n\t\t\t\t// Allow backspace, delete, tab, escape, enter\r\n\t\t\t\tif ([\"Backspace\", \"Delete\", \"Tab\", \"Escape\", \"Enter\"].includes(key)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Allow Ctrl/Cmd + A, C, V, X\r\n\t\t\t\tif (key === \"a\" || key === \"c\" || key === \"v\" || key === \"x\") {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// For decimal pattern, allow decimal point\r\n\t\t\t\tif (\r\n\t\t\t\t\t(activePatternType === \"decimal\" || activePatternType === \"currency\") &&\r\n\t\t\t\t\tallowDecimals &&\r\n\t\t\t\t\tkey === \".\"\r\n\t\t\t\t) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Check if it's a number\r\n\t\t\t\tif (!/^\\d$/.test(key)) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Pattern string validation - check if we've reached max digits\r\n\t\t\t\tif (activePatternString) {\r\n\t\t\t\t\tconst maxDigits = (activePatternString.match(/X/g) || []).length;\r\n\t\t\t\t\tconst currentDigits = extractDigits(inputValue);\r\n\t\t\t\t\treturn currentDigits.length < maxDigits;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Custom pattern validation\r\n\t\t\t\tif (activePatternType === \"custom\" && customPattern) {\r\n\t\t\t\t\tconst testValue = inputValue + key;\r\n\t\t\t\t\treturn customPattern.test(testValue);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn true;\r\n\t\t\t};\r\n\r\n\t\t\t// Handle input change\r\n\t\t\tconst handleChange = (event: ChangeEvent<HTMLInputElement>) => {\r\n\t\t\t\tconst inputValue = event.target.value;\r\n\t\t\t\tconst formattedValue = formatValue(inputValue);\r\n\t\t\t\tsetDisplayValue(formattedValue);\r\n\r\n\t\t\t\t// For pattern-based formatting, return only digits in onChange\r\n\t\t\t\tconst digitsOnly = activePatternString ? extractDigits(inputValue) : formattedValue;\r\n\r\n\t\t\t\t// Create synthetic event with formatted value\r\n\t\t\t\tconst syntheticEvent = {\r\n\t\t\t\t\t...event,\r\n\t\t\t\t\ttarget: {\r\n\t\t\t\t\t\t...event.target,\r\n\t\t\t\t\t\tvalue: digitsOnly,\r\n\t\t\t\t\t},\r\n\t\t\t\t\tcurrentTarget: {\r\n\t\t\t\t\t\t...event.currentTarget,\r\n\t\t\t\t\t\tvalue: digitsOnly,\r\n\t\t\t\t\t},\r\n\t\t\t\t} as ChangeEvent<HTMLInputElement>;\r\n\r\n\t\t\t\tif (onChange) {\r\n\t\t\t\t\tonChange(syntheticEvent);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\t// Handle paste event\r\n\t\t\tconst handlePaste = (event: React.ClipboardEvent<HTMLInputElement>) => {\r\n\t\t\t\tif (disabled) return;\r\n\t\t\t\tevent.preventDefault();\r\n\t\t\t\tconst pastedText = event.clipboardData.getData(\"text\");\r\n\t\t\t\tconst digits = extractDigits(pastedText);\r\n\r\n\t\t\t\t// Limit by pattern string if provided\r\n\t\t\t\tconst maxDigits =\r\n\t\t\t\t\tactivePatternString ? (activePatternString.match(/X/g) || []).length : undefined;\r\n\t\t\t\tconst limitedDigits = maxDigits ? digits.slice(0, maxDigits) : digits;\r\n\r\n\t\t\t\tconst formattedValue =\r\n\t\t\t\t\tactivePatternString ?\r\n\t\t\t\t\t\tformatByPattern(limitedDigits, activePatternString)\r\n\t\t\t\t\t:\tformatValue(limitedDigits);\r\n\r\n\t\t\t\tsetDisplayValue(formattedValue);\r\n\r\n\t\t\t\t// Create synthetic event\r\n\t\t\t\tconst syntheticEvent = {\r\n\t\t\t\t\t...event,\r\n\t\t\t\t\ttarget: {\r\n\t\t\t\t\t\t...event.target,\r\n\t\t\t\t\t\tvalue: limitedDigits,\r\n\t\t\t\t\t},\r\n\t\t\t\t\tcurrentTarget: {\r\n\t\t\t\t\t\t...event.currentTarget,\r\n\t\t\t\t\t\tvalue: limitedDigits,\r\n\t\t\t\t\t},\r\n\t\t\t\t} as unknown as ChangeEvent<HTMLInputElement>;\r\n\r\n\t\t\t\tif (onChange) {\r\n\t\t\t\t\tonChange(syntheticEvent);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\t// Handle key down to prevent non-numeric input\r\n\t\t\tconst handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\r\n\t\t\t\tconst input = event.currentTarget.querySelector(\"input\");\r\n\t\t\t\tif (!input) return;\r\n\r\n\t\t\t\tconst currentValue = input.value || \"\";\r\n\t\t\t\tconst key = event.key;\r\n\r\n\t\t\t\t// Allow special keys\r\n\t\t\t\tif (\r\n\t\t\t\t\t[\r\n\t\t\t\t\t\t\"Backspace\",\r\n\t\t\t\t\t\t\"Delete\",\r\n\t\t\t\t\t\t\"Tab\",\r\n\t\t\t\t\t\t\"Escape\",\r\n\t\t\t\t\t\t\"Enter\",\r\n\t\t\t\t\t\t\"ArrowLeft\",\r\n\t\t\t\t\t\t\"ArrowRight\",\r\n\t\t\t\t\t\t\"ArrowUp\",\r\n\t\t\t\t\t\t\"ArrowDown\",\r\n\t\t\t\t\t\t\"Home\",\r\n\t\t\t\t\t\t\"End\",\r\n\t\t\t\t\t].includes(key)\r\n\t\t\t\t) {\r\n\t\t\t\t\tif (key === \"Enter\" && onEnterPress) {\r\n\t\t\t\t\t\tonEnterPress(displayValue);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (textFieldProps.onKeyDown) {\r\n\t\t\t\t\t\ttextFieldProps.onKeyDown(event);\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Allow Ctrl/Cmd combinations\r\n\t\t\t\tif (event.ctrlKey || event.metaKey) {\r\n\t\t\t\t\tif (textFieldProps.onKeyDown) {\r\n\t\t\t\t\t\ttextFieldProps.onKeyDown(event);\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Validate input\r\n\t\t\t\tif (!isValidInput(currentValue, key)) {\r\n\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (textFieldProps.onKeyDown) {\r\n\t\t\t\t\ttextFieldProps.onKeyDown(event);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\t// Build input props\r\n\t\t\tconst inputProps = useMemo(\r\n\t\t\t\t() => ({\r\n\t\t\t\t\tmin,\r\n\t\t\t\t\tmax,\r\n\t\t\t\t\tstep,\r\n\t\t\t\t\tinputMode:\r\n\t\t\t\t\t\tactivePatternType === \"phone\" ? \"tel\"\r\n\t\t\t\t\t\t: activePatternType === \"decimal\" || activePatternType === \"currency\" ? \"decimal\"\r\n\t\t\t\t\t\t: \"numeric\",\r\n\t\t\t\t\tmaxLength: activePatternString ? activePatternString.length : undefined,\r\n\t\t\t\t\t...((textFieldProps as any).inputProps || {}),\r\n\t\t\t\t}),\r\n\t\t\t\t[min, max, step, activePatternType, activePatternString, textFieldProps]\r\n\t\t\t);\r\n\r\n\t\t\t// Memoize adornments\r\n\t\t\tconst startAdornmentElement = useMemo(\r\n\t\t\t\t() =>\r\n\t\t\t\t\tstartAdornment ?\r\n\t\t\t\t\t\t<InputAdornment position=\"start\">{startAdornment}</InputAdornment>\r\n\t\t\t\t\t:\tundefined,\r\n\t\t\t\t[startAdornment]\r\n\t\t\t);\r\n\r\n\t\t\tconst endAdornmentElement = useMemo(\r\n\t\t\t\t() =>\r\n\t\t\t\t\tendAdornment ? <InputAdornment position=\"end\">{endAdornment}</InputAdornment> : undefined,\r\n\t\t\t\t[endAdornment]\r\n\t\t\t);\r\n\r\n\t\t\t// Build slotProps for MUI v7\r\n\t\t\tconst finalSlotProps = useMemo(\r\n\t\t\t\t() => ({\r\n\t\t\t\t\t...slotProps,\r\n\t\t\t\t\tinput: {\r\n\t\t\t\t\t\t...slotProps?.input,\r\n\t\t\t\t\t\tinputProps,\r\n\t\t\t\t\t\t...(startAdornmentElement && {\r\n\t\t\t\t\t\t\tstartAdornment: startAdornmentElement,\r\n\t\t\t\t\t\t}),\r\n\t\t\t\t\t\t...(endAdornmentElement && {\r\n\t\t\t\t\t\t\tendAdornment: endAdornmentElement,\r\n\t\t\t\t\t\t}),\r\n\t\t\t\t\t},\r\n\t\t\t\t}),\r\n\t\t\t\t[slotProps, inputProps, startAdornmentElement, endAdornmentElement]\r\n\t\t\t);\r\n\r\n\t\t\t// Determine input type\r\n\t\t\tconst inputType = useMemo(\r\n\t\t\t\t() =>\r\n\t\t\t\t\tactivePatternType === \"phone\" ? \"tel\"\r\n\t\t\t\t\t: activePatternType === \"decimal\" || activePatternType === \"currency\" ?\r\n\t\t\t\t\t\t\"text\" // Use text to allow formatting\r\n\t\t\t\t\t:\t\"text\", // Use text for all patterns to allow formatting\r\n\t\t\t\t[activePatternType]\r\n\t\t\t);\r\n\r\n\t\t\t// Memoize placeholder\r\n\t\t\tconst displayPlaceholder = useMemo(\r\n\t\t\t\t() =>\r\n\t\t\t\t\tplaceholder ||\r\n\t\t\t\t\t(activePatternString ? generatePlaceholderFromPattern(activePatternString) : placeholder),\r\n\t\t\t\t[placeholder, activePatternString]\r\n\t\t\t);\r\n\r\n\t\t\t// Memoize helper text\r\n\t\t\tconst displayHelperText = useMemo(\r\n\t\t\t\t() => helperText ?? (error?.message ? error.message : undefined),\r\n\t\t\t\t[helperText, error?.message]\r\n\t\t\t);\r\n\r\n\t\t\treturn (\r\n\t\t\t\t<FormControl\r\n\t\t\t\t\terror={!!error}\r\n\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\trequired={required}\r\n\t\t\t\t\tfullWidth={fullWidth}\r\n\t\t\t\t\tsx={formControlStyles}\r\n\t\t\t\t>\r\n\t\t\t\t\t<TextField\r\n\t\t\t\t\t\t{...textFieldProps}\r\n\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\tlabel={label}\r\n\t\t\t\t\t\tvalue={displayValue}\r\n\t\t\t\t\t\tonChange={handleChange}\r\n\t\t\t\t\t\tonFocus={onFocus}\r\n\t\t\t\t\t\tonBlur={onBlur}\r\n\t\t\t\t\t\tonKeyDown={handleKeyDown}\r\n\t\t\t\t\t\tonPaste={handlePaste}\r\n\t\t\t\t\t\tplaceholder={displayPlaceholder}\r\n\t\t\t\t\t\tvariant={variant}\r\n\t\t\t\t\t\tsize={size}\r\n\t\t\t\t\t\tcolor={color}\r\n\t\t\t\t\t\tfullWidth={fullWidth}\r\n\t\t\t\t\t\trequired={required}\r\n\t\t\t\t\t\terror={!!error}\r\n\t\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\t\ttype={inputType}\r\n\t\t\t\t\t\tautoComplete=\"off\"\r\n\t\t\t\t\t\tslotProps={finalSlotProps}\r\n\t\t\t\t\t\tslots={slots}\r\n\t\t\t\t\t\tsx={inputStyles}\r\n\t\t\t\t\t\tref={ref}\r\n\t\t\t\t\t\thelperText={displayHelperText}\r\n\t\t\t\t\t/>\r\n\t\t\t\t</FormControl>\r\n\t\t\t);\r\n\t\t}\r\n\t)\r\n);\r\n\r\nNumberField.displayName = \"NumberField\";\r\n\r\nexport default NumberField;\r\n","import { memo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\nimport TelInputField from \"../FormFields/TextFields/TelInputField\";\r\nimport type { IFormInputFields } from \"./types\";\r\nimport React from \"react\";\r\nconst FormInputTelField = memo(\r\n\t({ name, label, control, defaultValue = \"\", onChange, ...props }: IFormInputFields) => {\r\n\t\treturn (\r\n\t\t\t<Controller\r\n\t\t\t\tname={name}\r\n\t\t\t\tcontrol={control}\r\n\t\t\t\tdefaultValue={defaultValue}\r\n\t\t\t\trender={({ field, fieldState: { error } }) => {\r\n\t\t\t\t\tconst { size, ...restProps } = props;\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<TelInputField\r\n\t\t\t\t\t\t\t{...restProps}\r\n\t\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\t\tlabel={label}\r\n\t\t\t\t\t\t\tvalue={field.value ?? \"\"}\r\n\t\t\t\t\t\t\tonChange={(e) => {\r\n\t\t\t\t\t\t\t\tfield.onChange(e);\r\n\t\t\t\t\t\t\t\tonChange?.(e.target.value);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tonBlur={field.onBlur}\r\n\t\t\t\t\t\t\tsize={size as any}\r\n\t\t\t\t\t\t\terror={error}\r\n\t\t\t\t\t\t\thelperText={error?.message}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t);\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nFormInputTelField.displayName = \"FormInputTelField\";\r\n\r\nexport default FormInputTelField;\r\n","import {\r\n\tFormControl,\r\n\ttype FormControlProps,\r\n\tInputAdornment,\r\n\tTextField,\r\n\ttype TextFieldProps,\r\n} from \"@mui/material\";\r\nimport React, { type ChangeEvent, type FocusEvent } from \"react\";\r\nimport {\r\n\ttype ForwardedRef,\r\n\tforwardRef,\r\n\tuseState,\r\n\tuseEffect,\r\n\tuseRef,\r\n\tmemo,\r\n\tuseCallback,\r\n\tuseMemo,\r\n} from \"react\";\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n\tmessage?: string;\r\n} | null;\r\n\r\n/**\r\n * Extract only digits from a string\r\n */\r\nconst extractDigits = (value: string): string => {\r\n\treturn value.replace(/\\D/g, \"\");\r\n};\r\n\r\n/**\r\n * Format phone number according to pattern\r\n * Example: pattern \"XXX-XXXX\" with digits \"1234567\" -> \"123-4567\"\r\n */\r\nconst formatByPattern = (digits: string, pattern: string): string => {\r\n\tif (!pattern || !digits) return digits;\r\n\tlet formatted = \"\";\r\n\tlet digitIndex = 0;\r\n\tfor (let i = 0; i < pattern.length && digitIndex < digits.length; i++) {\r\n\t\tif (pattern[i] === \"X\") {\r\n\t\t\tformatted += digits[digitIndex];\r\n\t\t\tdigitIndex++;\r\n\t\t} else {\r\n\t\t\tformatted += pattern[i];\r\n\t\t}\r\n\t}\r\n\treturn formatted;\r\n};\r\n\r\n/**\r\n * Generate placeholder from pattern\r\n */\r\nconst generatePlaceholder = (pattern: string): string => {\r\n\tif (!pattern) return \"0000000000\";\r\n\treturn pattern.replace(/X/g, \"0\");\r\n};\r\n\r\n/**\r\n * Extended Tel Input Field Props\r\n * Extends MUI TextFieldProps with custom tel field props\r\n */\r\nexport interface ITelInputFieldProps\r\n\textends Omit<TextFieldProps, \"value\" | \"onChange\" | \"name\" | \"type\" | \"error\" | \"inputRef\"> {\r\n\t/** Field name for form identification */\r\n\tname?: string;\r\n\t/** Label text for the tel field */\r\n\tlabel?: string;\r\n\t/** Current tel value (digits only, formatting is handled internally) */\r\n\tvalue: string;\r\n\t/** Error object with optional message */\r\n\terror?: FieldError;\r\n\t/** Helper text to display below field */\r\n\thelperText?: string;\r\n\t/** Whether the field is disabled */\r\n\tdisabled?: boolean;\r\n\t/** Placeholder text (auto-generated from pattern if not provided) */\r\n\tplaceholder?: string;\r\n\t/** TextField variant */\r\n\tvariant?: TextFieldProps[\"variant\"];\r\n\t/** TextField size */\r\n\tsize?: TextFieldProps[\"size\"];\r\n\t/** TextField color */\r\n\tcolor?: TextFieldProps[\"color\"];\r\n\t/** Full width of the field */\r\n\tfullWidth?: boolean;\r\n\t/** Required field indicator */\r\n\trequired?: boolean;\r\n\t/** Pattern string (e.g., \"XXX-XXXX\" where X represents digits) */\r\n\tpattern?: string;\r\n\t/** Maximum length (defaults to pattern length if pattern provided) */\r\n\tmaxLength?: number;\r\n\t/** Country code to display */\r\n\tcountryCode?: string;\r\n\t/** Whether to show country code */\r\n\tshowCountryCode?: boolean;\r\n\t/** Start adornment (icon or element before input) */\r\n\tstartAdornment?: React.ReactNode;\r\n\t/** End adornment (icon or element after input) */\r\n\tendAdornment?: React.ReactNode;\r\n\t/** Callback fired when the value changes (returns digits only) */\r\n\tonChange?: (event: ChangeEvent<HTMLInputElement>) => void;\r\n\t/** Callback fired when field receives focus */\r\n\tonFocus?: (event: FocusEvent<HTMLInputElement>) => void;\r\n\t/** Callback fired when field loses focus */\r\n\tonBlur?: (event: FocusEvent<HTMLInputElement>) => void;\r\n\t/** Callback fired on Enter key press */\r\n\tonEnterPress?: (value: string) => void;\r\n\t/** Custom styles for the TextField */\r\n\tinputStyles?: TextFieldProps[\"sx\"];\r\n\t/** Custom styles for FormControl */\r\n\tformControlStyles?: FormControlProps[\"sx\"];\r\n\t/** Custom styles for country code display */\r\n\tcountryCodeStyles?: React.CSSProperties;\r\n\t/** Custom slot props for MUI v7 */\r\n\tslotProps?: TextFieldProps[\"slotProps\"];\r\n\t/** Custom slots for MUI v7 */\r\n\tslots?: TextFieldProps[\"slots\"];\r\n}\r\n\r\nconst TeliField = memo(\r\n\tforwardRef<HTMLDivElement, ITelInputFieldProps>(\r\n\t\t(\r\n\t\t\t{\r\n\t\t\t\tname,\r\n\t\t\t\tlabel,\r\n\t\t\t\tvalue,\r\n\t\t\t\tonChange,\r\n\t\t\t\tonFocus,\r\n\t\t\t\tonBlur,\r\n\t\t\t\tonEnterPress,\r\n\t\t\t\terror,\r\n\t\t\t\thelperText,\r\n\t\t\t\tdisabled = false,\r\n\t\t\t\tplaceholder,\r\n\t\t\t\tvariant = \"outlined\",\r\n\t\t\t\tsize,\r\n\t\t\t\tcolor = \"primary\",\r\n\t\t\t\tfullWidth = true,\r\n\t\t\t\trequired,\r\n\t\t\t\tpattern = \"XXXXXXXXXX\",\r\n\t\t\t\tmaxLength,\r\n\t\t\t\tcountryCode = \"+1\",\r\n\t\t\t\tshowCountryCode = false,\r\n\t\t\t\tstartAdornment,\r\n\t\t\t\tendAdornment,\r\n\t\t\t\tinputStyles,\r\n\t\t\t\tformControlStyles,\r\n\t\t\t\tcountryCodeStyles,\r\n\t\t\t\tslotProps,\r\n\t\t\t\tslots,\r\n\t\t\t\t...textFieldProps\r\n\t\t\t},\r\n\t\t\tref: ForwardedRef<HTMLDivElement>\r\n\t\t) => {\r\n\t\t\tconst [displayValue, setDisplayValue] = useState<string>(\"\");\r\n\t\t\tconst inputRef = useRef<HTMLInputElement>(null);\r\n\r\n\t\t\t// Calculate max length from pattern if not provided\r\n\t\t\tconst calculatedMaxLength = maxLength || (pattern ? pattern.length : 15);\r\n\r\n\t\t\t// Update display value when value prop changes\r\n\t\t\tuseEffect(() => {\r\n\t\t\t\tconst digits = extractDigits(value);\r\n\t\t\t\tconst formatted = pattern ? formatByPattern(digits, pattern) : digits;\r\n\t\t\t\tsetDisplayValue((prev) => {\r\n\t\t\t\t\tif (prev !== formatted) {\r\n\t\t\t\t\t\treturn formatted;\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn prev;\r\n\t\t\t\t});\r\n\r\n\t\t\t\t// Set cursor position to end when value changes externally\r\n\t\t\t\tif (inputRef.current) {\r\n\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\tif (inputRef.current) {\r\n\t\t\t\t\t\t\tconst cursorPosition = formatted.length;\r\n\t\t\t\t\t\t\tinputRef.current.setSelectionRange(cursorPosition, cursorPosition);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}, 0);\r\n\t\t\t\t}\r\n\t\t\t}, [value, pattern]);\r\n\r\n\t\t\t// Handle input change\r\n\t\t\tconst handleChange = useCallback(\r\n\t\t\t\t(event: ChangeEvent<HTMLInputElement>) => {\r\n\t\t\t\t\tif (disabled) return;\r\n\r\n\t\t\t\t\tconst inputValue = event.target.value;\r\n\t\t\t\t\tconst digits = extractDigits(inputValue);\r\n\r\n\t\t\t\t\t// Enforce maxLength\r\n\t\t\t\t\tconst limitedDigits = calculatedMaxLength ? digits.slice(0, calculatedMaxLength) : digits;\r\n\r\n\t\t\t\t\t// Format the value\r\n\t\t\t\t\tconst formattedValue = pattern ? formatByPattern(limitedDigits, pattern) : limitedDigits;\r\n\r\n\t\t\t\t\tsetDisplayValue(formattedValue);\r\n\r\n\t\t\t\t\t// Create synthetic event with digits only\r\n\t\t\t\t\tconst syntheticEvent = {\r\n\t\t\t\t\t\t...event,\r\n\t\t\t\t\t\ttarget: {\r\n\t\t\t\t\t\t\t...event.target,\r\n\t\t\t\t\t\t\tvalue: limitedDigits,\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tcurrentTarget: {\r\n\t\t\t\t\t\t\t...event.currentTarget,\r\n\t\t\t\t\t\t\tvalue: limitedDigits,\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t} as ChangeEvent<HTMLInputElement>;\r\n\r\n\t\t\t\t\tif (onChange) {\r\n\t\t\t\t\t\tonChange(syntheticEvent);\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t[disabled, calculatedMaxLength, pattern, onChange]\r\n\t\t\t);\r\n\r\n\t\t\t// Handle paste event\r\n\t\t\tconst handlePaste = useCallback(\r\n\t\t\t\t(event: React.ClipboardEvent<HTMLInputElement>) => {\r\n\t\t\t\t\tif (disabled) return;\r\n\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t\tconst pastedText = event.clipboardData.getData(\"text\");\r\n\t\t\t\t\tconst digits = extractDigits(pastedText);\r\n\t\t\t\t\tconst limitedDigits = calculatedMaxLength ? digits.slice(0, calculatedMaxLength) : digits;\r\n\r\n\t\t\t\t\tconst formattedValue = pattern ? formatByPattern(limitedDigits, pattern) : limitedDigits;\r\n\r\n\t\t\t\t\tsetDisplayValue(formattedValue);\r\n\r\n\t\t\t\t\t// Create synthetic event\r\n\t\t\t\t\tconst syntheticEvent = {\r\n\t\t\t\t\t\t...event,\r\n\t\t\t\t\t\ttarget: {\r\n\t\t\t\t\t\t\t...event.target,\r\n\t\t\t\t\t\t\tvalue: limitedDigits,\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tcurrentTarget: {\r\n\t\t\t\t\t\t\t...event.currentTarget,\r\n\t\t\t\t\t\t\tvalue: limitedDigits,\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t} as unknown as ChangeEvent<HTMLInputElement>;\r\n\r\n\t\t\t\t\tif (onChange) {\r\n\t\t\t\t\t\tonChange(syntheticEvent);\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t[disabled, calculatedMaxLength, pattern, onChange]\r\n\t\t\t);\r\n\r\n\t\t\t// Handle key down to prevent non-numeric input\r\n\t\t\tconst handleKeyDown = useCallback(\r\n\t\t\t\t(event: React.KeyboardEvent<HTMLDivElement>) => {\r\n\t\t\t\t\tif (disabled) return;\r\n\r\n\t\t\t\t\tconst key = event.key;\r\n\t\t\t\t\tconst isNumber = /[0-9]/.test(key);\r\n\t\t\t\t\tconst isAllowedKey =\r\n\t\t\t\t\t\tkey === \"Backspace\" ||\r\n\t\t\t\t\t\tkey === \"Delete\" ||\r\n\t\t\t\t\t\tkey === \"Tab\" ||\r\n\t\t\t\t\t\tkey === \"Escape\" ||\r\n\t\t\t\t\t\tkey === \"Enter\" ||\r\n\t\t\t\t\t\tkey === \"ArrowLeft\" ||\r\n\t\t\t\t\t\tkey === \"ArrowRight\" ||\r\n\t\t\t\t\t\tkey === \"ArrowUp\" ||\r\n\t\t\t\t\t\tkey === \"ArrowDown\" ||\r\n\t\t\t\t\t\tkey === \"Home\" ||\r\n\t\t\t\t\t\tkey === \"End\" ||\r\n\t\t\t\t\t\t((event.ctrlKey || event.metaKey) &&\r\n\t\t\t\t\t\t\t(key === \"a\" || key === \"c\" || key === \"v\" || key === \"x\"));\r\n\r\n\t\t\t\t\tif (!isNumber && !isAllowedKey) {\r\n\t\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (key === \"Enter\" && onEnterPress) {\r\n\t\t\t\t\t\tonEnterPress(extractDigits(displayValue));\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (textFieldProps.onKeyDown) {\r\n\t\t\t\t\t\ttextFieldProps.onKeyDown(event);\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t[disabled, onEnterPress, displayValue, textFieldProps.onKeyDown]\r\n\t\t\t);\r\n\r\n\t\t\t// Build input props\r\n\t\t\tconst inputProps = useMemo(\r\n\t\t\t\t() => ({\r\n\t\t\t\t\tmaxLength: calculatedMaxLength,\r\n\t\t\t\t\tinputMode: \"tel\",\r\n\t\t\t\t\tautoComplete: \"tel\",\r\n\t\t\t\t\t...((textFieldProps as any).inputProps || {}),\r\n\t\t\t\t}),\r\n\t\t\t\t[calculatedMaxLength, textFieldProps]\r\n\t\t\t);\r\n\r\n\t\t\t// Build start adornment with country code if needed\r\n\t\t\tconst finalStartAdornment = useMemo(\r\n\t\t\t\t() =>\r\n\t\t\t\t\tshowCountryCode ?\r\n\t\t\t\t\t\t<InputAdornment\r\n\t\t\t\t\t\t\tposition=\"start\"\r\n\t\t\t\t\t\t\tsx={countryCodeStyles}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{countryCode}\r\n\t\t\t\t\t\t</InputAdornment>\r\n\t\t\t\t\t: startAdornment ? <InputAdornment position=\"start\">{startAdornment}</InputAdornment>\r\n\t\t\t\t\t: undefined,\r\n\t\t\t\t[showCountryCode, countryCodeStyles, countryCode, startAdornment]\r\n\t\t\t);\r\n\r\n\t\t\t// Memoize end adornment\r\n\t\t\tconst endAdornmentElement = useMemo(\r\n\t\t\t\t() =>\r\n\t\t\t\t\tendAdornment ? <InputAdornment position=\"end\">{endAdornment}</InputAdornment> : undefined,\r\n\t\t\t\t[endAdornment]\r\n\t\t\t);\r\n\r\n\t\t\t// Build slotProps for MUI v7\r\n\t\t\tconst finalSlotProps = useMemo(\r\n\t\t\t\t() => ({\r\n\t\t\t\t\t...slotProps,\r\n\t\t\t\t\tinput: {\r\n\t\t\t\t\t\t...slotProps?.input,\r\n\t\t\t\t\t\tinputProps,\r\n\t\t\t\t\t\t...(finalStartAdornment && {\r\n\t\t\t\t\t\t\tstartAdornment: finalStartAdornment,\r\n\t\t\t\t\t\t}),\r\n\t\t\t\t\t\t...(endAdornmentElement && {\r\n\t\t\t\t\t\t\tendAdornment: endAdornmentElement,\r\n\t\t\t\t\t\t}),\r\n\t\t\t\t\t},\r\n\t\t\t\t}),\r\n\t\t\t\t[slotProps, inputProps, finalStartAdornment, endAdornmentElement]\r\n\t\t\t);\r\n\r\n\t\t\t// Generate placeholder from pattern if not provided\r\n\t\t\tconst displayPlaceholder = useMemo(\r\n\t\t\t\t() => placeholder || (pattern ? generatePlaceholder(pattern) : \"\"),\r\n\t\t\t\t[placeholder, pattern]\r\n\t\t\t);\r\n\r\n\t\t\t// Memoize helper text\r\n\t\t\tconst displayHelperText = useMemo(\r\n\t\t\t\t() => helperText ?? (error?.message ? error.message : undefined),\r\n\t\t\t\t[helperText, error?.message]\r\n\t\t\t);\r\n\r\n\t\t\treturn (\r\n\t\t\t\t<FormControl\r\n\t\t\t\t\terror={!!error}\r\n\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\trequired={required}\r\n\t\t\t\t\tfullWidth={fullWidth}\r\n\t\t\t\t\tsx={formControlStyles}\r\n\t\t\t\t>\r\n\t\t\t\t\t<TextField\r\n\t\t\t\t\t\t{...textFieldProps}\r\n\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\tlabel={label}\r\n\t\t\t\t\t\tvalue={displayValue}\r\n\t\t\t\t\t\tonChange={handleChange}\r\n\t\t\t\t\t\tonFocus={onFocus}\r\n\t\t\t\t\t\tonBlur={onBlur}\r\n\t\t\t\t\t\tonKeyDown={handleKeyDown}\r\n\t\t\t\t\t\tonPaste={handlePaste}\r\n\t\t\t\t\t\tplaceholder={displayPlaceholder}\r\n\t\t\t\t\t\tvariant={variant}\r\n\t\t\t\t\t\tsize={size}\r\n\t\t\t\t\t\tcolor={color}\r\n\t\t\t\t\t\tfullWidth={fullWidth}\r\n\t\t\t\t\t\trequired={required}\r\n\t\t\t\t\t\terror={!!error}\r\n\t\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\t\ttype=\"tel\"\r\n\t\t\t\t\t\tautoComplete=\"tel\"\r\n\t\t\t\t\t\tslotProps={finalSlotProps}\r\n\t\t\t\t\t\tslots={slots}\r\n\t\t\t\t\t\tsx={inputStyles}\r\n\t\t\t\t\t\tref={ref}\r\n\t\t\t\t\t\tinputRef={inputRef}\r\n\t\t\t\t\t\thelperText={displayHelperText}\r\n\t\t\t\t\t/>\r\n\t\t\t\t</FormControl>\r\n\t\t\t);\r\n\t\t}\r\n\t)\r\n);\r\n\r\nTeliField.displayName = \"TeliField\";\r\n\r\nexport default TeliField;\r\n","import { memo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\nimport SearchInputField from \"../FormFields/TextFields/SearchInputField\";\r\nimport type { IFormInputFields } from \"./types\";\r\nimport React from \"react\";\r\nconst FormInputSearchField = memo(\r\n\t({ name, label, control, defaultValue = \"\", onChange, ...props }: IFormInputFields) => {\r\n\t\treturn (\r\n\t\t\t<Controller\r\n\t\t\t\tname={name}\r\n\t\t\t\tcontrol={control}\r\n\t\t\t\tdefaultValue={defaultValue}\r\n\t\t\t\trender={({ field, fieldState: { error } }) => {\r\n\t\t\t\t\tconst { size, ...restProps } = props;\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<SearchInputField\r\n\t\t\t\t\t\t\t{...restProps}\r\n\t\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\t\tlabel={label}\r\n\t\t\t\t\t\t\tvalue={field.value ?? \"\"}\r\n\t\t\t\t\t\t\tonChange={(e) => {\r\n\t\t\t\t\t\t\t\tfield.onChange(e);\r\n\t\t\t\t\t\t\t\tonChange?.(e.target.value);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tonBlur={field.onBlur}\r\n\t\t\t\t\t\t\tsize={size as any}\r\n\t\t\t\t\t\t\terror={error}\r\n\t\t\t\t\t\t\thelperText={error?.message}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t);\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nFormInputSearchField.displayName = \"FormInputSearchField\";\r\n\r\nexport default FormInputSearchField;\r\n","import Close from \"@mui/icons-material/Close\";\r\nimport Search from \"@mui/icons-material/Search\";\r\nimport {\r\n\tFormControl,\r\n\tIconButton,\r\n\ttype IconButtonProps,\r\n\tInputAdornment,\r\n\tTextField,\r\n\ttype TextFieldProps,\r\n} from \"@mui/material\";\r\nimport React, { type ChangeEvent, type FocusEvent } from \"react\";\r\nimport {\r\n\ttype ForwardedRef,\r\n\tforwardRef,\r\n\tuseEffect,\r\n\tuseRef,\r\n\tmemo,\r\n\tuseCallback,\r\n\tuseMemo,\r\n} from \"react\";\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n\tmessage?: string;\r\n} | null;\r\n\r\n/**\r\n * Extended Search Input Field Props\r\n * Extends MUI TextFieldProps with custom search field props\r\n */\r\nexport interface ISearchInputFieldProps\r\n\textends Omit<TextFieldProps, \"value\" | \"onChange\" | \"name\" | \"type\" | \"error\" | \"inputRef\"> {\r\n\t/** Field name for form identification */\r\n\tname?: string;\r\n\t/** Label text for the search field */\r\n\tlabel?: string;\r\n\t/** Current search value */\r\n\tvalue: string;\r\n\t/** Error object with optional message */\r\n\terror?: FieldError;\r\n\t/** Helper text to display below field */\r\n\thelperText?: string;\r\n\t/** Whether the field is disabled */\r\n\tdisabled?: boolean;\r\n\t/** Placeholder text */\r\n\tplaceholder?: string;\r\n\t/** TextField variant */\r\n\tvariant?: TextFieldProps[\"variant\"];\r\n\t/** TextField size */\r\n\tsize?: TextFieldProps[\"size\"];\r\n\t/** TextField color */\r\n\tcolor?: TextFieldProps[\"color\"];\r\n\t/** Full width of the field */\r\n\tfullWidth?: boolean;\r\n\t/** Required field indicator */\r\n\trequired?: boolean;\r\n\t/** Whether to show clear button */\r\n\tshowClearButton?: boolean;\r\n\t/** Whether to show search button */\r\n\tshowSearchButton?: boolean;\r\n\t/** Custom clear icon */\r\n\tclearIcon?: React.ReactNode;\r\n\t/** Custom search icon */\r\n\tsearchIcon?: React.ReactNode;\r\n\t/** Custom icon button props for clear button */\r\n\tclearButtonProps?: IconButtonProps;\r\n\t/** Custom icon button props for search button */\r\n\tsearchButtonProps?: IconButtonProps;\r\n\t/** Callback fired when the value changes */\r\n\tonChange?: (event: ChangeEvent<HTMLInputElement>) => void;\r\n\t/** Callback fired when field receives focus */\r\n\tonFocus?: (event: FocusEvent<HTMLInputElement>) => void;\r\n\t/** Callback fired when field loses focus */\r\n\tonBlur?: (event: FocusEvent<HTMLInputElement>) => void;\r\n\t/** Callback fired when search button is clicked */\r\n\tonSearch?: (value: string) => void;\r\n\t/** Callback fired when clear button is clicked */\r\n\tonClear?: () => void;\r\n\t/** Callback fired on Enter key press */\r\n\tonEnterPress?: (value: string) => void;\r\n\t/** Enable debounce for search (default: true) */\r\n\tenableDebounce?: boolean;\r\n\t/** Debounce delay in milliseconds (default: 300) */\r\n\tdebounceDelay?: number;\r\n\t/** Enable throttle for search (default: false) */\r\n\tenableThrottle?: boolean;\r\n\t/** Throttle delay in milliseconds (default: 300) */\r\n\tthrottleDelay?: number;\r\n\t/** Custom styles for the TextField */\r\n\tinputStyles?: TextFieldProps[\"sx\"];\r\n\t/** Custom styles for FormControl */\r\n\tformControlStyles?: React.ComponentProps<typeof FormControl>[\"sx\"];\r\n\t/** Custom slot props for MUI v7 */\r\n\tslotProps?: TextFieldProps[\"slotProps\"];\r\n\t/** Custom slots for MUI v7 */\r\n\tslots?: TextFieldProps[\"slots\"];\r\n}\r\n\r\nconst SearchField = memo(\r\n\tforwardRef<HTMLInputElement, ISearchInputFieldProps>(\r\n\t\t(\r\n\t\t\t{\r\n\t\t\t\tname,\r\n\t\t\t\tlabel,\r\n\t\t\t\tvalue,\r\n\t\t\t\tonChange,\r\n\t\t\t\tonFocus,\r\n\t\t\t\tonBlur,\r\n\t\t\t\tonSearch,\r\n\t\t\t\tonClear,\r\n\t\t\t\tonEnterPress,\r\n\t\t\t\terror,\r\n\t\t\t\thelperText,\r\n\t\t\t\tdisabled = false,\r\n\t\t\t\tplaceholder,\r\n\t\t\t\tvariant = \"outlined\",\r\n\t\t\t\tsize,\r\n\t\t\t\tcolor = \"primary\",\r\n\t\t\t\tfullWidth = true,\r\n\t\t\t\trequired,\r\n\t\t\t\tshowClearButton = true,\r\n\t\t\t\tshowSearchButton = true,\r\n\t\t\t\tclearIcon,\r\n\t\t\t\tsearchIcon,\r\n\t\t\t\tclearButtonProps,\r\n\t\t\t\tsearchButtonProps,\r\n\t\t\t\tenableDebounce = true,\r\n\t\t\t\tdebounceDelay = 300,\r\n\t\t\t\tenableThrottle = false,\r\n\t\t\t\tthrottleDelay = 300,\r\n\t\t\t\tinputStyles,\r\n\t\t\t\tformControlStyles,\r\n\t\t\t\tslotProps,\r\n\t\t\t\tslots,\r\n\t\t\t\t...textFieldProps\r\n\t\t\t},\r\n\t\t\tref: ForwardedRef<HTMLInputElement>\r\n\t\t) => {\r\n\t\t\t// Refs for debounce and throttle timers\r\n\t\t\tconst debounceTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\r\n\t\t\tconst throttleTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\r\n\t\t\tconst lastThrottleCallRef = useRef<number>(0);\r\n\r\n\t\t\t// Cleanup timers on unmount\r\n\t\t\tuseEffect(() => {\r\n\t\t\t\treturn () => {\r\n\t\t\t\t\tif (debounceTimerRef.current) {\r\n\t\t\t\t\t\tclearTimeout(debounceTimerRef.current);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (throttleTimerRef.current) {\r\n\t\t\t\t\t\tclearTimeout(throttleTimerRef.current);\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t}, []);\r\n\r\n\t\t\t// Debounced search function\r\n\t\t\tconst debouncedSearch = useCallback(\r\n\t\t\t\t(searchVal: string) => {\r\n\t\t\t\t\tif (debounceTimerRef.current) {\r\n\t\t\t\t\t\tclearTimeout(debounceTimerRef.current);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdebounceTimerRef.current = setTimeout(() => {\r\n\t\t\t\t\t\tif (onSearch) {\r\n\t\t\t\t\t\t\tonSearch(searchVal);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}, debounceDelay);\r\n\t\t\t\t},\r\n\t\t\t\t[onSearch, debounceDelay]\r\n\t\t\t);\r\n\r\n\t\t\t// Throttled search function\r\n\t\t\tconst throttledSearch = useCallback(\r\n\t\t\t\t(searchVal: string) => {\r\n\t\t\t\t\tconst now = Date.now();\r\n\t\t\t\t\tconst timeSinceLastCall = now - lastThrottleCallRef.current;\r\n\r\n\t\t\t\t\tif (timeSinceLastCall >= throttleDelay) {\r\n\t\t\t\t\t\tlastThrottleCallRef.current = now;\r\n\t\t\t\t\t\tif (onSearch) {\r\n\t\t\t\t\t\t\tonSearch(searchVal);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (throttleTimerRef.current) {\r\n\t\t\t\t\t\t\tclearTimeout(throttleTimerRef.current);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthrottleTimerRef.current = setTimeout(() => {\r\n\t\t\t\t\t\t\tlastThrottleCallRef.current = Date.now();\r\n\t\t\t\t\t\t\tif (onSearch) {\r\n\t\t\t\t\t\t\t\tonSearch(searchVal);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}, throttleDelay - timeSinceLastCall);\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t[onSearch, throttleDelay]\r\n\t\t\t);\r\n\r\n\t\t\t// Handle onChange with search callback (with debounce/throttle)\r\n\t\t\tconst handleChange = useCallback(\r\n\t\t\t\t(event: ChangeEvent<HTMLInputElement>) => {\r\n\t\t\t\t\tconst newValue = event.target.value;\r\n\r\n\t\t\t\t\t// Always call onChange immediately for controlled input\r\n\t\t\t\t\tif (onChange) {\r\n\t\t\t\t\t\tonChange(event);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Apply debounce or throttle to onSearch if enabled\r\n\t\t\t\t\tif (onSearch) {\r\n\t\t\t\t\t\tif (enableDebounce && !enableThrottle) {\r\n\t\t\t\t\t\t\tdebouncedSearch(newValue);\r\n\t\t\t\t\t\t} else if (enableThrottle && !enableDebounce) {\r\n\t\t\t\t\t\t\tthrottledSearch(newValue);\r\n\t\t\t\t\t\t} else if (enableDebounce && enableThrottle) {\r\n\t\t\t\t\t\t\t// If both are enabled, debounce takes precedence\r\n\t\t\t\t\t\t\tdebouncedSearch(newValue);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// No debounce or throttle, call immediately\r\n\t\t\t\t\t\t\tonSearch(newValue);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t[onChange, onSearch, enableDebounce, enableThrottle, debouncedSearch, throttledSearch]\r\n\t\t\t);\r\n\r\n\t\t\t// Handle clear button click\r\n\t\t\tconst handleClear = useCallback(() => {\r\n\t\t\t\t// Clear any pending timers\r\n\t\t\t\tif (debounceTimerRef.current) {\r\n\t\t\t\t\tclearTimeout(debounceTimerRef.current);\r\n\t\t\t\t\tdebounceTimerRef.current = null;\r\n\t\t\t\t}\r\n\t\t\t\tif (throttleTimerRef.current) {\r\n\t\t\t\t\tclearTimeout(throttleTimerRef.current);\r\n\t\t\t\t\tthrottleTimerRef.current = null;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (onClear) {\r\n\t\t\t\t\tonClear();\r\n\t\t\t\t}\r\n\t\t\t\tif (onSearch) {\r\n\t\t\t\t\t// Clear immediately without debounce/throttle\r\n\t\t\t\t\tonSearch(\"\");\r\n\t\t\t\t}\r\n\t\t\t\t// Create a synthetic event to trigger onChange with empty value\r\n\t\t\t\tconst syntheticEvent = {\r\n\t\t\t\t\ttarget: { value: \"\", name: name || \"\" },\r\n\t\t\t\t\tcurrentTarget: { value: \"\", name: name || \"\" },\r\n\t\t\t\t} as ChangeEvent<HTMLInputElement>;\r\n\t\t\t\tif (onChange) {\r\n\t\t\t\t\tonChange(syntheticEvent);\r\n\t\t\t\t}\r\n\t\t\t}, [onClear, onSearch, onChange, name, debounceTimerRef, throttleTimerRef]);\r\n\r\n\t\t\t// Handle search button click\r\n\t\t\tconst handleSearch = useCallback(() => {\r\n\t\t\t\t// Clear any pending timers and search immediately\r\n\t\t\t\tif (debounceTimerRef.current) {\r\n\t\t\t\t\tclearTimeout(debounceTimerRef.current);\r\n\t\t\t\t\tdebounceTimerRef.current = null;\r\n\t\t\t\t}\r\n\t\t\t\tif (throttleTimerRef.current) {\r\n\t\t\t\t\tclearTimeout(throttleTimerRef.current);\r\n\t\t\t\t\tthrottleTimerRef.current = null;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (onSearch) {\r\n\t\t\t\t\t// Search immediately without debounce/throttle when button is clicked\r\n\t\t\t\t\tonSearch(value);\r\n\t\t\t\t}\r\n\t\t\t}, [onSearch, value, debounceTimerRef, throttleTimerRef]);\r\n\r\n\t\t\t// Handle Enter key press\r\n\t\t\tconst handleKeyDown = useCallback(\r\n\t\t\t\t(event: React.KeyboardEvent<HTMLInputElement>) => {\r\n\t\t\t\t\tif (event.key === \"Enter\") {\r\n\t\t\t\t\t\t// Clear any pending timers when Enter is pressed\r\n\t\t\t\t\t\tif (debounceTimerRef.current) {\r\n\t\t\t\t\t\t\tclearTimeout(debounceTimerRef.current);\r\n\t\t\t\t\t\t\tdebounceTimerRef.current = null;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (throttleTimerRef.current) {\r\n\t\t\t\t\t\t\tclearTimeout(throttleTimerRef.current);\r\n\t\t\t\t\t\t\tthrottleTimerRef.current = null;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (onEnterPress) {\r\n\t\t\t\t\t\t\tonEnterPress(value);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// Also trigger search immediately on Enter\r\n\t\t\t\t\t\tif (onSearch) {\r\n\t\t\t\t\t\t\tonSearch(value);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Call original onKeyDown if provided\r\n\t\t\t\t\tif (textFieldProps.onKeyDown) {\r\n\t\t\t\t\t\ttextFieldProps.onKeyDown(event);\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t[\r\n\t\t\t\t\tonEnterPress,\r\n\t\t\t\t\tonSearch,\r\n\t\t\t\t\tvalue,\r\n\t\t\t\t\tdebounceTimerRef,\r\n\t\t\t\t\tthrottleTimerRef,\r\n\t\t\t\t\ttextFieldProps.onKeyDown,\r\n\t\t\t\t]\r\n\t\t\t);\r\n\r\n\t\t\t// Build end adornment with clear and search buttons\r\n\t\t\tconst endAdornment = useMemo(\r\n\t\t\t\t() => (\r\n\t\t\t\t\t<InputAdornment position=\"end\">\r\n\t\t\t\t\t\t{showClearButton && value && (\r\n\t\t\t\t\t\t\t<IconButton\r\n\t\t\t\t\t\t\t\tonClick={handleClear}\r\n\t\t\t\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\t\t\t\tedge=\"end\"\r\n\t\t\t\t\t\t\t\tsize={size}\r\n\t\t\t\t\t\t\t\t{...clearButtonProps}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t{clearIcon || <Close />}\r\n\t\t\t\t\t\t\t</IconButton>\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t{showSearchButton && (\r\n\t\t\t\t\t\t\t<IconButton\r\n\t\t\t\t\t\t\t\tonClick={handleSearch}\r\n\t\t\t\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\t\t\t\tedge=\"end\"\r\n\t\t\t\t\t\t\t\tsize={size}\r\n\t\t\t\t\t\t\t\t{...searchButtonProps}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t{searchIcon || <Search />}\r\n\t\t\t\t\t\t\t</IconButton>\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t</InputAdornment>\r\n\t\t\t\t),\r\n\t\t\t\t[\r\n\t\t\t\t\tshowClearButton,\r\n\t\t\t\t\tvalue,\r\n\t\t\t\t\thandleClear,\r\n\t\t\t\t\tdisabled,\r\n\t\t\t\t\tsize,\r\n\t\t\t\t\tclearButtonProps,\r\n\t\t\t\t\tclearIcon,\r\n\t\t\t\t\tshowSearchButton,\r\n\t\t\t\t\thandleSearch,\r\n\t\t\t\t\tsearchButtonProps,\r\n\t\t\t\t\tsearchIcon,\r\n\t\t\t\t]\r\n\t\t\t);\r\n\r\n\t\t\t// Memoize helper text\r\n\t\t\tconst displayHelperText = useMemo(\r\n\t\t\t\t() => helperText ?? (error?.message ? error.message : undefined),\r\n\t\t\t\t[helperText, error?.message]\r\n\t\t\t);\r\n\r\n\t\t\treturn (\r\n\t\t\t\t<FormControl\r\n\t\t\t\t\terror={!!error}\r\n\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\trequired={required}\r\n\t\t\t\t\tfullWidth={fullWidth}\r\n\t\t\t\t\tsx={formControlStyles}\r\n\t\t\t\t>\r\n\t\t\t\t\t<TextField\r\n\t\t\t\t\t\t{...textFieldProps}\r\n\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\tlabel={label}\r\n\t\t\t\t\t\tvalue={value}\r\n\t\t\t\t\t\tonChange={handleChange}\r\n\t\t\t\t\t\tonFocus={onFocus}\r\n\t\t\t\t\t\tonBlur={onBlur}\r\n\t\t\t\t\t\tonKeyDown={handleKeyDown}\r\n\t\t\t\t\t\tplaceholder={placeholder}\r\n\t\t\t\t\t\tvariant={variant}\r\n\t\t\t\t\t\tsize={size}\r\n\t\t\t\t\t\tcolor={color}\r\n\t\t\t\t\t\tfullWidth={fullWidth}\r\n\t\t\t\t\t\trequired={required}\r\n\t\t\t\t\t\terror={!!error}\r\n\t\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\t\tslotProps={{\r\n\t\t\t\t\t\t\t...slotProps,\r\n\t\t\t\t\t\t\tinput: {\r\n\t\t\t\t\t\t\t\t...slotProps?.input,\r\n\t\t\t\t\t\t\t\tendAdornment,\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t\tslots={slots}\r\n\t\t\t\t\t\tsx={inputStyles}\r\n\t\t\t\t\t\tref={ref}\r\n\t\t\t\t\t\thelperText={displayHelperText}\r\n\t\t\t\t\t/>\r\n\t\t\t\t</FormControl>\r\n\t\t\t);\r\n\t\t}\r\n\t)\r\n);\r\n\r\nSearchField.displayName = \"SearchField\";\r\n\r\nexport default SearchField;\r\n","import { memo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\nimport OTPField from \"../FormFields/TextFields/OTPField\";\r\nimport type { IFormInputFields } from \"./types\";\r\nimport React from \"react\";\r\nconst FormInputOTPField = memo(\r\n\t({ name, label, control, defaultValue = \"\", onChange, ...props }: IFormInputFields) => {\r\n\t\treturn (\r\n\t\t\t<Controller\r\n\t\t\t\tname={name}\r\n\t\t\t\tcontrol={control}\r\n\t\t\t\tdefaultValue={defaultValue}\r\n\t\t\t\trender={({ field, fieldState: { error } }) => {\r\n\t\t\t\t\tconst { size, ...restProps } = props;\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<OTPField\r\n\t\t\t\t\t\t\t{...restProps}\r\n\t\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\t\tlabel={label}\r\n\t\t\t\t\t\t\tvalue={field.value ?? \"\"}\r\n\t\t\t\t\t\t\tonChange={(value) => {\r\n\t\t\t\t\t\t\t\tfield.onChange(value);\r\n\t\t\t\t\t\t\t\tonChange?.(value);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tonBlur={field.onBlur}\r\n\t\t\t\t\t\t\tsize={size as any}\r\n\t\t\t\t\t\t\terror={error}\r\n\t\t\t\t\t\t\thelperText={error?.message}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t);\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nFormInputOTPField.displayName = \"FormInputOTPField\";\r\n\r\nexport default FormInputOTPField;\r\n","import {\r\n\tFormControl,\r\n\ttype FormControlProps,\r\n\tFormHelperText,\r\n\tTextField,\r\n\ttype TextFieldProps,\r\n\tBox,\r\n} from \"@mui/material\";\r\nimport React, { type ChangeEvent, type FocusEvent } from \"react\";\r\nimport { type ForwardedRef, forwardRef, useState, useRef, useEffect } from \"react\";\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n\tmessage?: string;\r\n} | null;\r\n\r\n/**\r\n * Extended OTP Input Field Props\r\n */\r\nexport interface IOTPInputFieldProps\r\n\textends Omit<\r\n\t\tTextFieldProps,\r\n\t\t\"value\" | \"onChange\" | \"name\" | \"type\" | \"error\" | \"inputRef\" | \"multiline\" | \"variant\" | \"size\"\r\n\t> {\r\n\t/** Field name for form identification */\r\n\tname?: string;\r\n\t/** Label text for the OTP field */\r\n\tlabel?: string;\r\n\t/** Current OTP value (string of digits) */\r\n\tvalue: string;\r\n\t/** Error object with optional message */\r\n\terror?: FieldError;\r\n\t/** Helper text to display below field */\r\n\thelperText?: string;\r\n\t/** Whether the field is disabled */\r\n\tdisabled?: boolean;\r\n\t/** Number of OTP input boxes (default: 6) */\r\n\tlength?: number;\r\n\t/** TextField variant */\r\n\tvariant?: TextFieldProps[\"variant\"];\r\n\t/** TextField size */\r\n\tsize?: TextFieldProps[\"size\"];\r\n\t/** TextField color */\r\n\tcolor?: TextFieldProps[\"color\"];\r\n\t/** Full width of the field */\r\n\tfullWidth?: boolean;\r\n\t/** Required field indicator */\r\n\trequired?: boolean;\r\n\t/** Spacing between OTP boxes */\r\n\tspacing?: number;\r\n\t/** Whether to auto-focus first input on mount */\r\n\tautoFocus?: boolean;\r\n\t/** Whether to auto-submit when all boxes are filled */\r\n\tautoSubmit?: boolean;\r\n\t/** Callback fired when the value changes */\r\n\tonChange?: (value: string) => void;\r\n\t/** Callback fired when all OTP boxes are filled */\r\n\tonComplete?: (value: string) => void;\r\n\t/** Callback fired when field receives focus */\r\n\tonFocus?: (event: FocusEvent<HTMLInputElement>) => void;\r\n\t/** Callback fired when field loses focus */\r\n\tonBlur?: (event: FocusEvent<HTMLInputElement>) => void;\r\n\t/** Callback fired on Enter key press */\r\n\tonEnterPress?: (value: string) => void;\r\n\t/** Custom styles for the OTP container */\r\n\tcontainerStyles?: React.CSSProperties;\r\n\t/** Custom styles for individual OTP input boxes */\r\n\tinputStyles?: TextFieldProps[\"sx\"];\r\n\t/** Custom styles for FormControl */\r\n\tformControlStyles?: FormControlProps[\"sx\"];\r\n\t/** Custom slot props for MUI v7 */\r\n\tslotProps?: TextFieldProps[\"slotProps\"];\r\n\t/** Custom slots for MUI v7 */\r\n\tslots?: TextFieldProps[\"slots\"];\r\n}\r\n\r\nconst OTPField = forwardRef<HTMLDivElement, IOTPInputFieldProps>(\r\n\t(\r\n\t\t{\r\n\t\t\tname,\r\n\t\t\tlabel,\r\n\t\t\tvalue,\r\n\t\t\tonChange,\r\n\t\t\tonComplete,\r\n\t\t\tonFocus,\r\n\t\t\tonBlur,\r\n\t\t\tonEnterPress,\r\n\t\t\terror,\r\n\t\t\thelperText,\r\n\t\t\tdisabled = false,\r\n\t\t\tvariant = \"outlined\",\r\n\t\t\tsize,\r\n\t\t\tcolor = \"primary\",\r\n\t\t\tfullWidth = true,\r\n\t\t\trequired,\r\n\t\t\tlength = 6,\r\n\t\t\tspacing = 1,\r\n\t\t\tautoFocus = false,\r\n\t\t\tautoSubmit = false,\r\n\t\t\tcontainerStyles,\r\n\t\t\tinputStyles,\r\n\t\t\tformControlStyles,\r\n\t\t\tslotProps,\r\n\t\t\tslots,\r\n\t\t\t...textFieldProps\r\n\t\t},\r\n\t\tref: ForwardedRef<HTMLDivElement>\r\n\t) => {\r\n\t\tconst [otpValues, setOtpValues] = useState<string[]>(Array(length).fill(\"\"));\r\n\t\tconst inputRefs = useRef<(HTMLInputElement | null)[]>([]);\r\n\t\tconst lastSentValueRef = useRef<string>(\"\");\r\n\t\tconst isInternalUpdateRef = useRef<boolean>(false);\r\n\t\tconst otpValuesRef = useRef<string[]>(Array(length).fill(\"\"));\r\n\t\tconst inputSessionActiveRef = useRef<boolean>(false);\r\n\t\tconst inputSessionTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\r\n\r\n\t\t// Keep ref in sync with state\r\n\t\tuseEffect(() => {\r\n\t\t\totpValuesRef.current = otpValues;\r\n\t\t}, [otpValues]);\r\n\r\n\t\t// Update internal state when value prop changes (only from external changes)\r\n\t\tuseEffect(() => {\r\n\t\t\tconst currentOtpString = otpValuesRef.current.join(\"\");\r\n\r\n\t\t\t// If we're in an active input session, preserve positions unless value is clearly external\r\n\t\t\tif (inputSessionActiveRef.current) {\r\n\t\t\t\t// If the value prop matches what we just sent, don't reset\r\n\t\t\t\tif (value === lastSentValueRef.current) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t// If value represents the same digits (even if positions differ), preserve our state\r\n\t\t\t\t// This handles cases where parent normalizes the value\r\n\t\t\t\tconst currentDigits = currentOtpString;\r\n\t\t\t\tconst incomingDigits = value || \"\";\r\n\t\t\t\tif (currentDigits === incomingDigits && currentDigits.length > 0) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t// If incoming value has same digit count and matches our sent value's digits, preserve\r\n\t\t\t\tif (\r\n\t\t\t\t\tincomingDigits.length === currentDigits.length &&\r\n\t\t\t\t\tincomingDigits === lastSentValueRef.current\r\n\t\t\t\t) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Skip if this update was triggered internally\r\n\t\t\tif (isInternalUpdateRef.current) {\r\n\t\t\t\tisInternalUpdateRef.current = false;\r\n\t\t\t\t// If the value prop matches what we just sent, don't reset the positions\r\n\t\t\t\tif (value === lastSentValueRef.current) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Only update if value prop is different from our current state\r\n\t\t\tif (value !== currentOtpString) {\r\n\t\t\t\tif (value) {\r\n\t\t\t\t\tconst values = value.split(\"\").slice(0, length);\r\n\t\t\t\t\tconst paddedValues = [...values, ...Array(length - values.length).fill(\"\")];\r\n\t\t\t\t\tsetOtpValues(paddedValues);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsetOtpValues(Array(length).fill(\"\"));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}, [value, length]);\r\n\r\n\t\t// Focus first input on mount if autoFocus is true\r\n\t\tuseEffect(() => {\r\n\t\t\tif (autoFocus && inputRefs.current[0]) {\r\n\t\t\t\tinputRefs.current[0].focus();\r\n\t\t\t}\r\n\t\t}, [autoFocus]);\r\n\r\n\t\t// Cleanup timeout on unmount\r\n\t\tuseEffect(() => {\r\n\t\t\treturn () => {\r\n\t\t\t\tif (inputSessionTimeoutRef.current) {\r\n\t\t\t\t\tclearTimeout(inputSessionTimeoutRef.current);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t}, []);\r\n\r\n\t\t// Handle input change\r\n\t\tconst handleChange = (\r\n\t\t\tindex: number,\r\n\t\t\tevent: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>\r\n\t\t) => {\r\n\t\t\tif (disabled) return;\r\n\r\n\t\t\tconst inputValue = (event.target as HTMLInputElement).value;\r\n\r\n\t\t\t// If input is empty, clear the current box\r\n\t\t\tif (inputValue === \"\") {\r\n\t\t\t\tupdateValue(index, \"\", false);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Extract the last character (handles paste or typing over selected text)\r\n\t\t\tconst lastChar = inputValue.slice(-1);\r\n\r\n\t\t\t// Only allow digits - update the value at the current index\r\n\t\t\tif (/^\\d$/.test(lastChar)) {\r\n\t\t\t\t// Always auto-focus next when entering a digit (from any box position)\r\n\t\t\t\t// This allows continuous typing from any position to the end\r\n\t\t\t\t// Values remain filled as you type through them\r\n\t\t\t\tupdateValue(index, lastChar, true);\r\n\t\t\t}\r\n\t\t\t// Non-digits are already prevented in keyDown handler, but if they somehow get through,\r\n\t\t\t// the controlled component will maintain the correct value via the value prop\r\n\t\t};\r\n\r\n\t\t// Update value at specific index\r\n\t\tconst updateValue = (index: number, newValue: string, shouldAutoFocusNext: boolean = true) => {\r\n\t\t\tconst newOtpValues = [...otpValues];\r\n\t\t\tnewOtpValues[index] = newValue;\r\n\r\n\t\t\t// Mark this as an internal update to prevent useEffect from resetting positions\r\n\t\t\tisInternalUpdateRef.current = true;\r\n\r\n\t\t\t// Activate input session to preserve positions during typing\r\n\t\t\tinputSessionActiveRef.current = true;\r\n\r\n\t\t\t// Clear existing timeout\r\n\t\t\tif (inputSessionTimeoutRef.current) {\r\n\t\t\t\tclearTimeout(inputSessionTimeoutRef.current);\r\n\t\t\t}\r\n\r\n\t\t\t// Deactivate input session after 500ms of no input\r\n\t\t\tinputSessionTimeoutRef.current = setTimeout(() => {\r\n\t\t\t\tinputSessionActiveRef.current = false;\r\n\t\t\t}, 500);\r\n\r\n\t\t\tsetOtpValues(newOtpValues);\r\n\r\n\t\t\tconst otpString = newOtpValues.join(\"\");\r\n\t\t\t// Track the value we're sending to onChange\r\n\t\t\tlastSentValueRef.current = otpString;\r\n\r\n\t\t\tif (onChange) {\r\n\t\t\t\tonChange(otpString);\r\n\t\t\t}\r\n\r\n\t\t\t// Auto-focus next input if value is entered and we should auto-focus\r\n\t\t\t// Auto-focus regardless of whether it was replacing or not, to allow continuous typing\r\n\t\t\t// Use setTimeout to ensure focus happens after state update\r\n\t\t\tif (newValue && index < length - 1 && shouldAutoFocusNext) {\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tinputRefs.current[index + 1]?.focus();\r\n\t\t\t\t}, 0);\r\n\t\t\t}\r\n\r\n\t\t\t// Check if all boxes are filled\r\n\t\t\tif (newOtpValues.every((val) => val !== \"\")) {\r\n\t\t\t\tif (onComplete) {\r\n\t\t\t\t\tonComplete(otpString);\r\n\t\t\t\t}\r\n\t\t\t\tif (autoSubmit && onEnterPress) {\r\n\t\t\t\t\tonEnterPress(otpString);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Handle key down\r\n\t\tconst handleKeyDown = (index: number, event: React.KeyboardEvent<HTMLDivElement>) => {\r\n\t\t\tif (disabled) return;\r\n\r\n\t\t\tconst key = event.key;\r\n\r\n\t\t\t// Handle backspace\r\n\t\t\tif (key === \"Backspace\") {\r\n\t\t\t\tif (otpValues[index] === \"\" && index > 0) {\r\n\t\t\t\t\t// Move to previous input and clear it\r\n\t\t\t\t\tinputRefs.current[index - 1]?.focus();\r\n\t\t\t\t\tupdateValue(index - 1, \"\", false);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Clear current input\r\n\t\t\t\t\tupdateValue(index, \"\", false);\r\n\t\t\t\t}\r\n\t\t\t\tevent.preventDefault();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Handle delete\r\n\t\t\tif (key === \"Delete\") {\r\n\t\t\t\tupdateValue(index, \"\", false);\r\n\t\t\t\tevent.preventDefault();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Handle arrow keys\r\n\t\t\tif (key === \"ArrowLeft\" && index > 0) {\r\n\t\t\t\tinputRefs.current[index - 1]?.focus();\r\n\t\t\t\tevent.preventDefault();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (key === \"ArrowRight\" && index < length - 1) {\r\n\t\t\t\tinputRefs.current[index + 1]?.focus();\r\n\t\t\t\tevent.preventDefault();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Handle Enter key\r\n\t\t\tif (key === \"Enter\" && onEnterPress) {\r\n\t\t\t\tconst otpString = otpValues.join(\"\");\r\n\t\t\t\tonEnterPress(otpString);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Handle paste\r\n\t\t\tif ((event.ctrlKey || event.metaKey) && key === \"v\") {\r\n\t\t\t\t// Let the paste event handle it\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Handle digit input - ensure it goes to the current box\r\n\t\t\tif (/^\\d$/.test(key)) {\r\n\t\t\t\t// The onChange handler will process this, but we ensure the value goes to current index\r\n\t\t\t\t// by allowing the default behavior which will trigger onChange\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Only allow digits and navigation keys\r\n\t\t\tif (![\"Tab\", \"Escape\", \"Home\", \"End\"].includes(key)) {\r\n\t\t\t\tevent.preventDefault();\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Handle paste\r\n\t\tconst handlePaste = (index: number, event: React.ClipboardEvent<HTMLDivElement>) => {\r\n\t\t\tif (disabled) return;\r\n\r\n\t\t\tevent.preventDefault();\r\n\t\t\tconst pastedText = event.clipboardData.getData(\"text\");\r\n\t\t\tconst digits = pastedText.replace(/\\D/g, \"\").slice(0, length);\r\n\r\n\t\t\tif (digits.length === 0) return;\r\n\r\n\t\t\tconst newOtpValues = [...otpValues];\r\n\t\t\tlet startIndex = index;\r\n\r\n\t\t\t// Fill from current index or from start\r\n\t\t\tfor (let i = 0; i < digits.length && startIndex + i < length; i++) {\r\n\t\t\t\tnewOtpValues[startIndex + i] = digits[i];\r\n\t\t\t}\r\n\r\n\t\t\tsetOtpValues(newOtpValues);\r\n\r\n\t\t\tconst otpString = newOtpValues.join(\"\");\r\n\t\t\tif (onChange) {\r\n\t\t\t\tonChange(otpString);\r\n\t\t\t}\r\n\r\n\t\t\t// Focus the next empty input or the last input\r\n\t\t\tconst nextEmptyIndex = newOtpValues.findIndex((val) => val === \"\");\r\n\t\t\tconst focusIndex =\r\n\t\t\t\tnextEmptyIndex !== -1 ? nextEmptyIndex : Math.min(startIndex + digits.length, length - 1);\r\n\t\t\tinputRefs.current[focusIndex]?.focus();\r\n\r\n\t\t\t// Check if all boxes are filled\r\n\t\t\tif (newOtpValues.every((val) => val !== \"\")) {\r\n\t\t\t\tif (onComplete) {\r\n\t\t\t\t\tonComplete(otpString);\r\n\t\t\t\t}\r\n\t\t\t\tif (autoSubmit && onEnterPress) {\r\n\t\t\t\t\tonEnterPress(otpString);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Handle focus\r\n\t\tconst handleFocus = (\r\n\t\t\t_index: number,\r\n\t\t\tevent: FocusEvent<HTMLInputElement | HTMLTextAreaElement>\r\n\t\t) => {\r\n\t\t\t// Select all text on focus\r\n\t\t\t(event.target as HTMLInputElement).select();\r\n\t\t\tif (onFocus) {\r\n\t\t\t\tonFocus(event as FocusEvent<HTMLInputElement>);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Handle blur\r\n\t\tconst handleBlur = (\r\n\t\t\t_index: number,\r\n\t\t\tevent: FocusEvent<HTMLInputElement | HTMLTextAreaElement>\r\n\t\t) => {\r\n\t\t\tif (onBlur) {\r\n\t\t\t\tonBlur(event as FocusEvent<HTMLInputElement>);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\treturn (\r\n\t\t\t<FormControl\r\n\t\t\t\terror={!!error}\r\n\t\t\t\tdisabled={disabled}\r\n\t\t\t\trequired={required}\r\n\t\t\t\tfullWidth={fullWidth}\r\n\t\t\t\tsx={formControlStyles}\r\n\t\t\t>\r\n\t\t\t\t{label && (\r\n\t\t\t\t\t<Box\r\n\t\t\t\t\t\tcomponent=\"label\"\r\n\t\t\t\t\t\tsx={{ mb: 1, display: \"block\" }}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t{label}\r\n\t\t\t\t\t\t{required && <span style={{ color: \"error.main\" }}> *</span>}\r\n\t\t\t\t\t</Box>\r\n\t\t\t\t)}\r\n\t\t\t\t<Box\r\n\t\t\t\t\tref={ref}\r\n\t\t\t\t\tsx={{\r\n\t\t\t\t\t\tdisplay: \"flex\",\r\n\t\t\t\t\t\tgap: spacing,\r\n\t\t\t\t\t\tjustifyContent: \"flex-start\",\r\n\t\t\t\t\t\t...containerStyles,\r\n\t\t\t\t\t}}\r\n\t\t\t\t>\r\n\t\t\t\t\t{otpValues.map((otpValue, index) => (\r\n\t\t\t\t\t\t<TextField\r\n\t\t\t\t\t\t\tkey={index}\r\n\t\t\t\t\t\t\tinputRef={(el) => {\r\n\t\t\t\t\t\t\t\tinputRefs.current[index] = el;\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tname={name ? `${name}-${index}` : undefined}\r\n\t\t\t\t\t\t\tvalue={otpValue}\r\n\t\t\t\t\t\t\tonChange={(e) => handleChange(index, e)}\r\n\t\t\t\t\t\t\tonKeyDown={(e) => handleKeyDown(index, e)}\r\n\t\t\t\t\t\t\tonPaste={(e) => handlePaste(index, e)}\r\n\t\t\t\t\t\t\tonFocus={(e) => handleFocus(index, e)}\r\n\t\t\t\t\t\t\tonBlur={(e) => handleBlur(index, e)}\r\n\t\t\t\t\t\t\tvariant={variant}\r\n\t\t\t\t\t\t\tsize={size}\r\n\t\t\t\t\t\t\tcolor={color}\r\n\t\t\t\t\t\t\terror={!!error}\r\n\t\t\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\t\t\trequired={required}\r\n\t\t\t\t\t\t\tslotProps={{\r\n\t\t\t\t\t\t\t\t...slotProps,\r\n\t\t\t\t\t\t\t\tinput: {\r\n\t\t\t\t\t\t\t\t\t...slotProps?.input,\r\n\t\t\t\t\t\t\t\t\tinputProps: {\r\n\t\t\t\t\t\t\t\t\t\tmaxLength: 1,\r\n\t\t\t\t\t\t\t\t\t\tinputMode: \"numeric\",\r\n\t\t\t\t\t\t\t\t\t\tpattern: \"[0-9]*\",\r\n\t\t\t\t\t\t\t\t\t\tstyle: {\r\n\t\t\t\t\t\t\t\t\t\t\ttextAlign: \"center\",\r\n\t\t\t\t\t\t\t\t\t\t\tfontSize: size === \"small\" ? \"1rem\" : \"1.25rem\",\r\n\t\t\t\t\t\t\t\t\t\t\tfontWeight: \"bold\",\r\n\t\t\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t\t\t...((slotProps?.input as any)?.inputProps || {}),\r\n\t\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tslots={slots}\r\n\t\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\t\twidth: size === \"small\" ? \"40px\" : \"48px\",\r\n\t\t\t\t\t\t\t\t...inputStyles,\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t{...textFieldProps}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t))}\r\n\t\t\t\t</Box>\r\n\t\t\t\t{error && (\r\n\t\t\t\t\t<FormHelperText>{helperText ?? (error?.message ? error.message : \"\")}</FormHelperText>\r\n\t\t\t\t)}\r\n\t\t\t\t{!error && helperText && <FormHelperText>{helperText}</FormHelperText>}\r\n\t\t\t</FormControl>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nOTPField.displayName = \"OTPField\";\r\n\r\nexport default OTPField;\r\n","import { memo, useMemo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\nimport SelectInputField from \"../FormFields/DropdownFields/SelectInputField\";\r\nimport type { IFormInputFieldsWithOptions } from \"./types\";\r\nimport React from \"react\";\r\nconst FormInputSelect = memo(\r\n\t({\r\n\t\tname,\r\n\t\tlabel,\r\n\t\tcontrol,\r\n\t\toptions = [],\r\n\t\tdefaultValue = \"\",\r\n\t\tonChange,\r\n\t\t...props\r\n\t}: IFormInputFieldsWithOptions) => {\r\n\t\tconst memoizedOptions = useMemo(() => options, [options]);\r\n\r\n\t\treturn (\r\n\t\t\t<Controller\r\n\t\t\t\tname={name}\r\n\t\t\t\tcontrol={control}\r\n\t\t\t\tdefaultValue={defaultValue}\r\n\t\t\t\trender={({ field, fieldState: { error } }) => {\r\n\t\t\t\t\tconst { size, ...restProps } = props;\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<SelectInputField\r\n\t\t\t\t\t\t\t{...restProps}\r\n\t\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\t\tlabel={label}\r\n\t\t\t\t\t\t\toptions={memoizedOptions}\r\n\t\t\t\t\t\t\tvalue={field.value ?? \"\"}\r\n\t\t\t\t\t\t\tonChange={(e) => {\r\n\t\t\t\t\t\t\t\tfield.onChange(e);\r\n\t\t\t\t\t\t\t\tonChange?.(e.target.value);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tonBlur={field.onBlur}\r\n\t\t\t\t\t\t\tsize={size as any}\r\n\t\t\t\t\t\t\terror={error}\r\n\t\t\t\t\t\t\thelperText={error?.message}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t);\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nFormInputSelect.displayName = \"FormInputSelect\";\r\n\r\nexport default FormInputSelect;\r\n","import {\r\n\tFormControl,\r\n\tFormHelperText,\r\n\tInputLabel,\r\n\tMenuItem,\r\n\ttype MenuItemProps,\r\n\tSelect,\r\n\ttype SelectChangeEvent,\r\n\ttype SelectProps,\r\n} from \"@mui/material\";\r\nimport React, { type SyntheticEvent } from \"react\";\r\nimport { type ForwardedRef, forwardRef } from \"react\";\r\n\r\n/**\r\n * Base option type for Select\r\n */\r\nexport type SelectOption = {\r\n\tname: string;\r\n\tvalue: string | number;\r\n\tdisabled?: boolean;\r\n\t[key: string]: unknown;\r\n};\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n\tmessage?: string;\r\n} | null;\r\n\r\n/**\r\n * Extended Select Input Props\r\n * Extends MUI SelectProps with custom form field props\r\n */\r\nexport interface ISelectInputFieldProps\r\n\textends Omit<\r\n\t\tSelectProps<string | number | (string | number)[]>,\r\n\t\t\"value\" | \"onChange\" | \"name\" | \"error\" | \"children\" | \"renderValue\"\r\n\t> {\r\n\t/** Field name for form identification */\r\n\tname?: string;\r\n\t/** Label text for the select field */\r\n\tlabel?: string;\r\n\t/** Current selected value(s) */\r\n\tvalue: string | number | (string | number)[] | \"\";\r\n\t/** Options array to display in dropdown */\r\n\toptions: SelectOption[];\r\n\t/** Error object with optional message */\r\n\terror?: FieldError;\r\n\t/** Helper text to display below select */\r\n\thelperText?: string;\r\n\t/** Whether the field is disabled */\r\n\tdisabled?: boolean;\r\n\t/** Select variant */\r\n\tvariant?: SelectProps[\"variant\"];\r\n\t/** Select size */\r\n\tsize?: SelectProps[\"size\"];\r\n\t/** Select color */\r\n\tcolor?: SelectProps[\"color\"];\r\n\t/** Full width of the field */\r\n\tfullWidth?: boolean;\r\n\t/** Required field indicator */\r\n\trequired?: boolean;\r\n\t/** Whether to allow multiple selections */\r\n\tmultiple?: boolean;\r\n\t/** Custom icon for dropdown indicator */\r\n\ticon?: React.ReactNode;\r\n\t/** Custom render function for selected value(s) */\r\n\trenderValue?: SelectProps<string | number | (string | number)[]>[\"renderValue\"];\r\n\t/** Custom render function for menu items */\r\n\trenderMenuItem?: (option: SelectOption, index: number) => React.ReactNode;\r\n\t/** Custom styles for MenuItem - can be static styles or a function that receives (option, index) */\r\n\tmenuItemStyles?:\r\n\t\t| MenuItemProps[\"sx\"]\r\n\t\t| ((option: SelectOption, index: number) => MenuItemProps[\"sx\"]);\r\n\t/** Custom styles for the Select */\r\n\tselectStyles?: SelectProps[\"sx\"];\r\n\t/** Custom styles for FormControl */\r\n\tformControlStyles?: React.ComponentProps<typeof FormControl>[\"sx\"];\r\n\t/** Custom styles for InputLabel */\r\n\tlabelStyles?: React.ComponentProps<typeof InputLabel>[\"sx\"];\r\n\t/** Callback fired when the value changes */\r\n\tonChange?: (\r\n\t\tevent: SelectChangeEvent<string | number | (string | number)[]>,\r\n\t\tchild?: React.ReactNode\r\n\t) => void;\r\n\t/** Callback fired when menu opens */\r\n\tonOpen?: (event: SyntheticEvent) => void;\r\n\t/** Callback fired when menu closes */\r\n\tonClose?: (event: SyntheticEvent) => void;\r\n\t/** Custom slot props for MUI v7 */\r\n\tslotProps?: SelectProps[\"slotProps\"];\r\n\t/** Custom slots for MUI v7 */\r\n\tslots?: SelectProps[\"slots\"];\r\n\t/** Display empty value */\r\n\tdisplayEmpty?: boolean;\r\n\t/** Auto width for menu */\r\n\tautoWidth?: boolean;\r\n\t/** Native select element */\r\n\tnative?: boolean;\r\n\t/** Menu props */\r\n\tMenuProps?: SelectProps[\"MenuProps\"];\r\n}\r\n\r\nconst SelectInputField = forwardRef<HTMLInputElement, ISelectInputFieldProps>(\r\n\t(\r\n\t\t{\r\n\t\t\tname,\r\n\t\t\tlabel,\r\n\t\t\tvalue,\r\n\t\t\tonChange,\r\n\t\t\tonOpen,\r\n\t\t\tonClose,\r\n\t\t\toptions,\r\n\t\t\terror,\r\n\t\t\thelperText,\r\n\t\t\tdisabled = false,\r\n\t\t\tvariant = \"outlined\",\r\n\t\t\tsize,\r\n\t\t\tcolor,\r\n\t\t\tfullWidth = true,\r\n\t\t\trequired,\r\n\t\t\tmultiple = false,\r\n\t\t\ticon,\r\n\t\t\trenderValue,\r\n\t\t\trenderMenuItem,\r\n\t\t\tmenuItemStyles,\r\n\t\t\tselectStyles,\r\n\t\t\tformControlStyles,\r\n\t\t\tlabelStyles,\r\n\t\t\tslotProps,\r\n\t\t\tslots,\r\n\t\t\tdisplayEmpty = false,\r\n\t\t\tautoWidth = false,\r\n\t\t\tnative = false,\r\n\t\t\tMenuProps,\r\n\t\t\t...selectProps\r\n\t\t},\r\n\t\tref: ForwardedRef<HTMLInputElement>\r\n\t) => {\r\n\t\t// Default render value function\r\n\t\tconst defaultRenderValue = (\r\n\t\t\tselected: string | number | (string | number)[]\r\n\t\t): React.ReactNode => {\r\n\t\t\tif (multiple && Array.isArray(selected)) {\r\n\t\t\t\tif (selected.length === 0) return \"\";\r\n\t\t\t\treturn selected\r\n\t\t\t\t\t.map((val) => {\r\n\t\t\t\t\t\tconst option = options.find((opt) => opt.value === val);\r\n\t\t\t\t\t\treturn option?.name ?? String(val);\r\n\t\t\t\t\t})\r\n\t\t\t\t\t.join(\", \");\r\n\t\t\t}\r\n\t\t\tif (!multiple && selected !== \"\" && selected !== null && selected !== undefined) {\r\n\t\t\t\tconst option = options.find((opt) => opt.value === selected);\r\n\t\t\t\treturn option?.name ?? String(selected);\r\n\t\t\t}\r\n\t\t\treturn \"\";\r\n\t\t};\r\n\r\n\t\t// Default render menu item function\r\n\t\tconst defaultRenderMenuItem = (option: SelectOption, index: number): React.ReactNode => {\r\n\t\t\tconst menuItemSx =\r\n\t\t\t\ttypeof menuItemStyles === \"function\" ?\r\n\t\t\t\t\t(menuItemStyles as (option: SelectOption, index: number) => MenuItemProps[\"sx\"])(\r\n\t\t\t\t\t\toption,\r\n\t\t\t\t\t\tindex\r\n\t\t\t\t\t)\r\n\t\t\t\t:\tmenuItemStyles;\r\n\r\n\t\t\treturn (\r\n\t\t\t\t<MenuItem\r\n\t\t\t\t\tkey={`${option.value}-${index}`}\r\n\t\t\t\t\tvalue={option.value}\r\n\t\t\t\t\tdisabled={option.disabled}\r\n\t\t\t\t\tsx={menuItemSx}\r\n\t\t\t\t>\r\n\t\t\t\t\t{renderMenuItem ? renderMenuItem(option, index) : option.name}\r\n\t\t\t\t</MenuItem>\r\n\t\t\t);\r\n\t\t};\r\n\r\n\t\t// Handle onChange with proper typing\r\n\t\tconst handleChange = (\r\n\t\t\tevent: SelectChangeEvent<string | number | (string | number)[]>,\r\n\t\t\tchild?: React.ReactNode\r\n\t\t) => {\r\n\t\t\tif (onChange) {\r\n\t\t\t\tonChange(event, child);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tconst labelId = label ? `${name || \"select\"}-label` : undefined;\r\n\t\tconst selectId = label ? `${name || \"select\"}-select` : undefined;\r\n\r\n\t\treturn (\r\n\t\t\t<FormControl\r\n\t\t\t\tfullWidth={fullWidth}\r\n\t\t\t\terror={!!error}\r\n\t\t\t\tdisabled={disabled}\r\n\t\t\t\trequired={required}\r\n\t\t\t\tsize={size}\r\n\t\t\t\tvariant={variant}\r\n\t\t\t\tsx={formControlStyles}\r\n\t\t\t>\r\n\t\t\t\t{label && (\r\n\t\t\t\t\t<InputLabel\r\n\t\t\t\t\t\tid={labelId}\r\n\t\t\t\t\t\tsx={labelStyles}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t{label}\r\n\t\t\t\t\t</InputLabel>\r\n\t\t\t\t)}\r\n\t\t\t\t<Select\r\n\t\t\t\t\t{...selectProps}\r\n\t\t\t\t\tlabelId={labelId}\r\n\t\t\t\t\tid={selectId}\r\n\t\t\t\t\tname={name}\r\n\t\t\t\t\tvalue={value}\r\n\t\t\t\t\tlabel={label}\r\n\t\t\t\t\tonChange={handleChange}\r\n\t\t\t\t\tonOpen={onOpen}\r\n\t\t\t\t\tonClose={onClose}\r\n\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\tmultiple={multiple}\r\n\t\t\t\t\tdisplayEmpty={displayEmpty}\r\n\t\t\t\t\tautoWidth={autoWidth}\r\n\t\t\t\t\tnative={native}\r\n\t\t\t\t\tMenuProps={MenuProps}\r\n\t\t\t\t\tIconComponent={icon as React.ElementType}\r\n\t\t\t\t\trenderValue={renderValue ?? defaultRenderValue}\r\n\t\t\t\t\tslotProps={slotProps}\r\n\t\t\t\t\tslots={slots}\r\n\t\t\t\t\tsx={selectStyles}\r\n\t\t\t\t\tref={ref}\r\n\t\t\t\t>\r\n\t\t\t\t\t{options &&\r\n\t\t\t\t\t\tArray.isArray(options) &&\r\n\t\t\t\t\t\toptions.map((option, index) => defaultRenderMenuItem(option, index))}\r\n\t\t\t\t</Select>\r\n\t\t\t\t{error && (\r\n\t\t\t\t\t<FormHelperText>{helperText ?? (error?.message ? error.message : \"\")}</FormHelperText>\r\n\t\t\t\t)}\r\n\t\t\t\t{!error && helperText && <FormHelperText>{helperText}</FormHelperText>}\r\n\t\t\t</FormControl>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nSelectInputField.displayName = \"SelectInputField\";\r\n\r\nexport default SelectInputField;\r\n","import { memo, useMemo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\nimport SelectInputField from \"../FormFields/DropdownFields/SelectInputField\";\r\nimport type { IFormInputFieldsWithOptions } from \"./types\";\r\nimport React from \"react\";\r\nconst FormInputMultiSelect = memo(\r\n\t({\r\n\t\tname,\r\n\t\tlabel,\r\n\t\tcontrol,\r\n\t\toptions = [],\r\n\t\tdefaultValue = [],\r\n\t\tonChange,\r\n\t\t...props\r\n\t}: IFormInputFieldsWithOptions) => {\r\n\t\tconst memoizedOptions = useMemo(() => options, [options]);\r\n\r\n\t\treturn (\r\n\t\t\t<Controller\r\n\t\t\t\tname={name}\r\n\t\t\t\tcontrol={control}\r\n\t\t\t\tdefaultValue={defaultValue}\r\n\t\t\t\trender={({ field, fieldState: { error } }) => {\r\n\t\t\t\t\tconst { size, ...restProps } = props;\r\n\t\t\t\t\tconst fieldValue = Array.isArray(field.value) ? field.value : [];\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<SelectInputField\r\n\t\t\t\t\t\t\t{...restProps}\r\n\t\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\t\tlabel={label}\r\n\t\t\t\t\t\t\toptions={memoizedOptions}\r\n\t\t\t\t\t\t\tmultiple\r\n\t\t\t\t\t\t\tvalue={fieldValue}\r\n\t\t\t\t\t\t\tonChange={(e) => {\r\n\t\t\t\t\t\t\t\tfield.onChange(e);\r\n\t\t\t\t\t\t\t\tonChange?.(e.target.value);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tonBlur={field.onBlur}\r\n\t\t\t\t\t\t\tsize={size as any}\r\n\t\t\t\t\t\t\terror={error}\r\n\t\t\t\t\t\t\thelperText={error?.message}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t);\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nFormInputMultiSelect.displayName = \"FormInputMultiSelect\";\r\n\r\nexport default FormInputMultiSelect;\r\n","import { memo, useMemo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\nimport AutoCompleteField from \"../FormFields/DropdownFields/AutoCompleteField\";\r\nimport type { IFormInputFieldsWithOptions } from \"./types\";\r\nimport React from \"react\";\r\nconst FormInputAutoComplete = memo(\r\n\t({\r\n\t\tname,\r\n\t\tlabel,\r\n\t\tcontrol,\r\n\t\toptions = [],\r\n\t\tdisabled,\r\n\t\tplaceholder,\r\n\t\tdefaultValue = null,\r\n\t\tonChange,\r\n\t\t...props\r\n\t}: IFormInputFieldsWithOptions) => {\r\n\t\r\n\t\treturn (\r\n\t\t\t<Controller\r\n\t\t\t\tname={name}\r\n\t\t\t\tcontrol={control}\r\n\t\t\t\tdefaultValue={defaultValue}\r\n\t\t\t\trender={({ field, fieldState: { error } }) => {\r\n\t\t\t\t\tconst { value, onBlur } = field;\r\n\t\t\t\t\tconst { size, ...restProps } = props;\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<AutoCompleteField\r\n\t\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\t\tlabel={label}\r\n\t\t\t\t\t\t\tplaceholder={placeholder}\r\n\t\t\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\t\t\toptions={options}\r\n\t\t\t\t\t\t\tvalue={value ?? null}\r\n\t\t\t\t\t\t\tsize={size as any}\r\n\t\t\t\t\t\t\terror={error}\r\n\t\t\t\t\t\t\thelperText={error?.message}\r\n\t\t\t\t\t\t\t{...restProps}\r\n\t\t\t\t\t\t\tonChange={(_, newValue) => {\r\n\t\t\t\t\t\t\t\tfield.onChange(newValue);\r\n\t\t\t\t\t\t\t\tonChange?.(newValue);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tonBlur={onBlur}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t);\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nFormInputAutoComplete.displayName = \"FormInputAutoComplete\";\r\n\r\nexport default FormInputAutoComplete;\r\n","import {\r\n Autocomplete,\r\n type AutocompleteChangeReason,\r\n type AutocompleteCloseReason,\r\n type AutocompleteInputChangeReason,\r\n type AutocompleteProps,\r\n FormControl,\r\n FormHelperText,\r\n TextField,\r\n type TextFieldProps,\r\n} from \"@mui/material\";\r\nimport type { FilterOptionsState } from \"@mui/material/useAutocomplete\";\r\nimport React, { type ForwardedRef, forwardRef, memo, type SyntheticEvent, useCallback } from \"react\";\r\n\r\nexport type AutoCompleteOption = {\r\n name: string;\r\n value: string | number;\r\n [key: string]: unknown;\r\n};\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n message?: string;\r\n} | null;\r\n\r\n/**\r\n * Extended Autocomplete Input Props\r\n * Extends MUI AutocompleteProps with custom form field props\r\n */\r\nexport interface IAutoCompleteInputProps<\r\n T extends AutoCompleteOption = AutoCompleteOption,\r\n Multiple extends boolean = false,\r\n DisableClearable extends boolean = false,\r\n FreeSolo extends boolean = false,\r\n> extends Omit<\r\n AutocompleteProps<T, Multiple, DisableClearable, FreeSolo>,\r\n \"renderInput\" | \"options\" | \"value\" | \"onChange\" | \"getOptionLabel\" | \"isOptionEqualToValue\" | \"renderOption\"\r\n > {\r\n /** Field name for form identification */\r\n name?: string;\r\n /** Label text for the input field */\r\n label?: string;\r\n /** Current selected value */\r\n value: Multiple extends true ? T[] : T | null;\r\n /** Options array to display in dropdown */\r\n options: T[];\r\n /** Error object with optional message */\r\n error?: FieldError;\r\n /** Helper text to display below input */\r\n helperText?: string;\r\n /** Whether the field is disabled */\r\n disabled?: boolean;\r\n /** Placeholder text */\r\n placeholder?: string;\r\n /** TextField variant */\r\n variant?: TextFieldProps[\"variant\"];\r\n /** TextField size */\r\n size?: TextFieldProps[\"size\"];\r\n /** TextField color */\r\n color?: TextFieldProps[\"color\"];\r\n /** Full width of the field */\r\n fullWidth?: boolean;\r\n /** Required field indicator */\r\n required?: boolean;\r\n /** Custom function to get option label (defaults to option.name) */\r\n getOptionLabel?: (option: T | string) => string;\r\n /** Custom function to check option equality (defaults to comparing option.name) */\r\n isOptionEqualToValue?: (option: T, value: T) => boolean;\r\n /** Custom render function for options */\r\n renderOption?: (\r\n props: React.HTMLAttributes<HTMLLIElement>,\r\n option: T,\r\n state?: { selected: boolean; inputValue: string },\r\n ) => React.ReactNode;\r\n /** Callback fired when the value changes */\r\n onChange?: (\r\n event: SyntheticEvent,\r\n newValue: Multiple extends true ? T[] : T | null,\r\n reason?: AutocompleteChangeReason,\r\n ) => void;\r\n /** Callback fired when input value changes */\r\n onInputChange?: (event: SyntheticEvent, newInputValue: string, reason: AutocompleteInputChangeReason) => void;\r\n /** Callback fired when popup opens */\r\n onOpen?: (event: SyntheticEvent) => void;\r\n /** Callback fired when popup closes */\r\n onClose?: (event: SyntheticEvent, reason: AutocompleteCloseReason) => void;\r\n /** Custom icon for popup indicator */\r\n popupIcon?: React.ReactNode;\r\n /** Custom styles for the TextField */\r\n inputStyles?: TextFieldProps[\"sx\"];\r\n /** Custom styles for the Autocomplete */\r\n autocompleteStyles?: AutocompleteProps<T, Multiple, DisableClearable, FreeSolo>[\"sx\"];\r\n /** Custom styles for FormControl */\r\n formControlStyles?: React.ComponentProps<typeof FormControl>[\"sx\"];\r\n /** Whether to show loading state */\r\n loading?: boolean;\r\n /** Text to show when loading */\r\n loadingText?: React.ReactNode;\r\n /** Text to show when no options available */\r\n noOptionsText?: React.ReactNode;\r\n /** Text to show when options are being filtered */\r\n filterText?: string;\r\n /** Custom filter options function */\r\n filterOptions?: (options: T[], state: FilterOptionsState<T>) => T[];\r\n /** Whether to highlight the first option */\r\n autoHighlight?: boolean;\r\n /** Whether to select the first option on highlight */\r\n autoSelect?: boolean;\r\n /** Whether to disable portal rendering */\r\n disablePortal?: boolean;\r\n /** Whether to disable list wrapping */\r\n disableListWrap?: boolean;\r\n /** Custom slot props for MUI v7 */\r\n slotProps?: AutocompleteProps<T, Multiple, DisableClearable, FreeSolo>[\"slotProps\"];\r\n /** Custom slots for MUI v7 */\r\n slots?: AutocompleteProps<T, Multiple, DisableClearable, FreeSolo>[\"slots\"];\r\n}\r\n\r\nconst AutoCompleteField = memo(\r\n forwardRef<HTMLDivElement, IAutoCompleteInputProps<AutoCompleteOption, boolean, boolean, boolean>>(\r\n (\r\n {\r\n name,\r\n label,\r\n value,\r\n onChange,\r\n onInputChange,\r\n onOpen,\r\n onClose,\r\n options,\r\n error,\r\n helperText,\r\n disabled = false,\r\n placeholder,\r\n variant = \"outlined\",\r\n size,\r\n color,\r\n fullWidth = true,\r\n required,\r\n getOptionLabel,\r\n isOptionEqualToValue,\r\n renderOption,\r\n popupIcon,\r\n inputStyles,\r\n autocompleteStyles,\r\n formControlStyles,\r\n loading = false,\r\n loadingText = \"Loading...\",\r\n noOptionsText = \"No options\",\r\n filterOptions,\r\n autoHighlight = true,\r\n autoSelect = false,\r\n disablePortal = false,\r\n disableListWrap = false,\r\n slotProps,\r\n slots,\r\n ...autocompleteProps\r\n },\r\n ref: ForwardedRef<HTMLDivElement>,\r\n ) => {\r\n // Default getOptionLabel function\r\n const defaultGetOptionLabel = useCallback((option: AutoCompleteOption | string): string => {\r\n if (typeof option === \"string\") return option;\r\n return option?.name ?? String(option?.value ?? \"\");\r\n }, []);\r\n\r\n // Default isOptionEqualToValue function\r\n const defaultIsOptionEqualToValue = useCallback(\r\n (option: AutoCompleteOption, value: AutoCompleteOption): boolean => {\r\n return option?.name === value?.name && option?.value === value?.value;\r\n },\r\n [],\r\n );\r\n\r\n // Handle onChange with proper typing\r\n const handleChange = useCallback(\r\n (event: SyntheticEvent, newValue: any, reason?: AutocompleteChangeReason) => {\r\n if (onChange) {\r\n onChange(event, newValue, reason);\r\n }\r\n },\r\n [onChange],\r\n );\r\n\r\n return (\r\n <FormControl fullWidth={fullWidth} error={!!error} sx={formControlStyles}>\r\n <Autocomplete<AutoCompleteOption, boolean, boolean, boolean>\r\n options={options}\r\n value={value as any}\r\n onChange={handleChange}\r\n onInputChange={onInputChange}\r\n onOpen={onOpen}\r\n onClose={onClose}\r\n getOptionLabel={getOptionLabel ? getOptionLabel : defaultGetOptionLabel}\r\n isOptionEqualToValue={isOptionEqualToValue ? isOptionEqualToValue : defaultIsOptionEqualToValue}\r\n disabled={disabled}\r\n loading={loading}\r\n loadingText={loadingText}\r\n noOptionsText={noOptionsText}\r\n filterOptions={filterOptions}\r\n autoHighlight={autoHighlight}\r\n autoSelect={autoSelect}\r\n disablePortal={disablePortal}\r\n disableListWrap={disableListWrap}\r\n popupIcon={popupIcon}\r\n slotProps={slotProps}\r\n slots={slots}\r\n sx={autocompleteStyles}\r\n ref={ref}\r\n {...autocompleteProps}\r\n renderInput={(params) => (\r\n <TextField\r\n {...params}\r\n name={name}\r\n label={label}\r\n variant={variant}\r\n size={size}\r\n color={color}\r\n placeholder={placeholder}\r\n required={required}\r\n error={!!error}\r\n disabled={disabled}\r\n slotProps={{\r\n input: {\r\n ...params.InputProps,\r\n inputProps: {\r\n ...params.inputProps,\r\n },\r\n },\r\n }}\r\n sx={inputStyles}\r\n helperText={helperText ?? \"\"}\r\n />\r\n )}\r\n />\r\n {error && !helperText && error.message && <FormHelperText>{error.message}</FormHelperText>}\r\n </FormControl>\r\n );\r\n },\r\n ),\r\n);\r\n\r\nAutoCompleteField.displayName = \"AutoCompleteField\";\r\n\r\nexport default AutoCompleteField;\r\n","import { memo, useMemo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\nimport AutoCompleteField from \"../FormFields/DropdownFields/AutoCompleteField\";\r\nimport type { IFormInputFieldsWithOptions } from \"./types\";\r\nimport React from \"react\";\r\nconst FormInputMultiAutoComplete = memo(\r\n\t({\r\n\t\tname,\r\n\t\tlabel,\r\n\t\tcontrol,\r\n\t\toptions = [],\r\n\t\tdisabled,\r\n\t\tplaceholder,\r\n\t\tdefaultValue = [],\r\n\t\tonChange,\r\n\t\t...props\r\n\t}: IFormInputFieldsWithOptions) => {\r\n\t\tconst memoizedOptions = useMemo(() => options, [options]);\r\n\r\n\t\treturn (\r\n\t\t\t<Controller\r\n\t\t\t\tname={name}\r\n\t\t\t\tcontrol={control}\r\n\t\t\t\tdefaultValue={defaultValue}\r\n\t\t\t\trender={({ field, fieldState: { error } }) => {\r\n\t\t\t\t\tconst { value, onBlur } = field;\r\n\t\t\t\t\tconst { size, ...restProps } = props;\r\n\t\t\t\t\tconst fieldValue = Array.isArray(value) ? value : [];\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<AutoCompleteField\r\n\t\t\t\t\t\t\t{...restProps}\r\n\t\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\t\tlabel={label}\r\n\t\t\t\t\t\t\tplaceholder={placeholder}\r\n\t\t\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\t\t\toptions={memoizedOptions}\r\n\t\t\t\t\t\t\tmultiple\r\n\t\t\t\t\t\t\tvalue={fieldValue}\r\n\t\t\t\t\t\t\tonChange={(_, newValue) => {\r\n\t\t\t\t\t\t\t\tfield.onChange(newValue);\r\n\t\t\t\t\t\t\t\tonChange?.(newValue);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tonBlur={onBlur}\r\n\t\t\t\t\t\t\tsize={size as any}\r\n\t\t\t\t\t\t\terror={error}\r\n\t\t\t\t\t\t\thelperText={error?.message}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t);\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nFormInputMultiAutoComplete.displayName = \"FormInputMultiAutoComplete\";\r\n\r\nexport default FormInputMultiAutoComplete;\r\n","import { memo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\nimport ColorPickerField from \"../FormFields/DropdownFields/ColorPickerField\";\r\nimport type { IFormInputFields } from \"./types\";\r\nimport React from \"react\";\r\nconst FormInputColorPicker = memo(\r\n\t({ name, label, control, defaultValue = \"#000000\", onChange, ...props }: IFormInputFields) => {\r\n\t\treturn (\r\n\t\t\t<Controller\r\n\t\t\t\tname={name}\r\n\t\t\t\tcontrol={control}\r\n\t\t\t\tdefaultValue={defaultValue}\r\n\t\t\t\trender={({ field, fieldState: { error } }) => {\r\n\t\t\t\t\tconst { size, ...restProps } = props;\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<ColorPickerField\r\n\t\t\t\t\t\t\t{...restProps}\r\n\t\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\t\tlabel={label}\r\n\t\t\t\t\t\t\tvalue={field.value ?? defaultValue}\r\n\t\t\t\t\t\t\tonChange={(color) => {\r\n\t\t\t\t\t\t\t\tfield.onChange(color);\r\n\t\t\t\t\t\t\t\tonChange?.(color);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tonBlur={field.onBlur}\r\n\t\t\t\t\t\t\tsize={size as any}\r\n\t\t\t\t\t\t\terror={error}\r\n\t\t\t\t\t\t\thelperText={error?.message}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t);\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nFormInputColorPicker.displayName = \"FormInputColorPicker\";\r\n\r\nexport default FormInputColorPicker;\r\n","import { Box, FormControl, type FormControlProps, InputAdornment, TextField, type TextFieldProps } from '@mui/material';\r\nimport React, {\r\n type ChangeEvent,\r\n type FocusEvent,\r\n type ForwardedRef,\r\n forwardRef,\r\n memo,\r\n useCallback,\r\n useEffect,\r\n useMemo,\r\n useRef,\r\n useState,\r\n} from 'react';\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n message?: string;\r\n} | null;\r\n\r\n/**\r\n * Color format types\r\n */\r\nexport type ColorFormat = 'hex' | 'rgb' | 'rgba' | 'hsl' | 'hsla';\r\n\r\n/**\r\n * Color value type - can be string (hex) or object (rgb/rgba/hsl/hsla)\r\n */\r\nexport type ColorValue = string | RGBColor | RGBAColor | HSLColor | HSLAColor;\r\n\r\n/**\r\n * RGB color object\r\n */\r\nexport interface RGBColor {\r\n r: number;\r\n g: number;\r\n b: number;\r\n}\r\n\r\n/**\r\n * RGBA color object\r\n */\r\nexport interface RGBAColor extends RGBColor {\r\n a: number;\r\n}\r\n\r\n/**\r\n * HSL color object\r\n */\r\nexport interface HSLColor {\r\n h: number;\r\n s: number;\r\n l: number;\r\n}\r\n\r\n/**\r\n * HSL color object with alpha\r\n */\r\nexport interface HSLAColor extends HSLColor {\r\n a: number;\r\n}\r\n\r\n/**\r\n * Extended Color Picker Field Props\r\n */\r\nexport interface IColorPickerFieldProps\r\n extends Omit<\r\n TextFieldProps,\r\n 'value' | 'onChange' | 'name' | 'type' | 'error' | 'inputRef' | 'multiline' | 'variant' | 'size'\r\n > {\r\n /** Field name for form identification */\r\n name?: string;\r\n /** Label text for the color picker field */\r\n label?: string;\r\n /** Current color value (hex string or color object) */\r\n value: string;\r\n /** Error object with optional message */\r\n error?: FieldError;\r\n /** Helper text to display below field */\r\n helperText?: string;\r\n /** Whether the field is disabled */\r\n disabled?: boolean;\r\n /** Placeholder text */\r\n placeholder?: string;\r\n /** TextField variant */\r\n variant?: TextFieldProps['variant'];\r\n /** TextField size */\r\n size?: TextFieldProps['size'];\r\n /** TextField color */\r\n color?: TextFieldProps['color'];\r\n /** Full width of the field */\r\n fullWidth?: boolean;\r\n /** Required field indicator */\r\n required?: boolean;\r\n /** Color format (hex, rgb, rgba, hsl, hsla) */\r\n format?: ColorFormat;\r\n /** Whether to show color preview swatch */\r\n showPreview?: boolean;\r\n /** Whether to show native color input */\r\n showNativeInput?: boolean;\r\n /** Whether to show popover picker */\r\n showPopoverPicker?: boolean;\r\n /** Preset colors to display */\r\n presetColors?: string[];\r\n /** Whether to show preset colors */\r\n showPresetColors?: boolean;\r\n /** Callback fired when the color changes */\r\n onChange?: (value: string) => void;\r\n /** Callback fired when field receives focus */\r\n onFocus?: (event: FocusEvent<HTMLInputElement>) => void;\r\n /** Callback fired when field loses focus */\r\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void;\r\n /** Callback fired on Enter key press */\r\n onEnterPress?: (value: string) => void;\r\n /** Custom styles for the color preview swatch */\r\n previewStyles?: React.CSSProperties;\r\n /** Custom styles for FormControl */\r\n formControlStyles?: FormControlProps['sx'];\r\n /** Custom styles for TextField */\r\n inputStyles?: TextFieldProps['sx'];\r\n /** Custom slot props for MUI v7 */\r\n slotProps?: TextFieldProps['slotProps'];\r\n /** Custom slots for MUI v7 */\r\n slots?: TextFieldProps['slots'];\r\n}\r\n\r\n/**\r\n * Convert hex to RGB (utility function for future format conversions)\r\n * @internal - Exported for potential future use with rgb/rgba formats\r\n */\r\nexport const hexToRgb = (hex: string): RGBColor | null => {\r\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\r\n return result\r\n ? {\r\n r: parseInt(result[1], 16),\r\n g: parseInt(result[2], 16),\r\n b: parseInt(result[3], 16),\r\n }\r\n : null;\r\n};\r\n\r\n/**\r\n * Convert RGB to hex (utility function for future format conversions)\r\n * @internal - Exported for potential future use with rgb/rgba formats\r\n */\r\nexport const rgbToHex = (r: number, g: number, b: number): string => {\r\n return '#' + [r, g, b].map((x) => x.toString(16).padStart(2, '0')).join('');\r\n};\r\n\r\n/**\r\n * Validate hex color\r\n */\r\nconst isValidHex = (color: string): boolean => {\r\n return /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(color);\r\n};\r\n\r\n/**\r\n * Normalize hex color (ensure # prefix and 6 digits)\r\n */\r\nconst normalizeHex = (color: string): string => {\r\n let hex = color.replace('#', '');\r\n if (hex.length === 3) {\r\n hex = hex\r\n .split('')\r\n .map((char) => char + char)\r\n .join('');\r\n }\r\n return '#' + hex;\r\n};\r\n\r\nconst ColorPickerField = memo(\r\n forwardRef<HTMLDivElement, IColorPickerFieldProps>(\r\n (\r\n {\r\n name,\r\n label,\r\n value,\r\n onChange,\r\n onFocus,\r\n onBlur,\r\n onEnterPress,\r\n error,\r\n helperText,\r\n disabled = false,\r\n placeholder = '#000000',\r\n variant = 'outlined',\r\n size,\r\n color = 'primary',\r\n fullWidth = true,\r\n required,\r\n format = 'hex',\r\n showPreview = true,\r\n showNativeInput = true,\r\n showPopoverPicker = true,\r\n presetColors = ['#000000', '#FFFFFF', '#FF0000', '#00FF00', '#0000FF', '#FFFF00', '#FF00FF', '#00FFFF'],\r\n showPresetColors = false,\r\n previewStyles,\r\n formControlStyles,\r\n inputStyles,\r\n slotProps,\r\n slots,\r\n ...textFieldProps\r\n },\r\n ref: ForwardedRef<HTMLDivElement>,\r\n ) => {\r\n const [internalValue, setInternalValue] = useState<string>(value || '');\r\n const colorInputRef = useRef<HTMLInputElement | null>(null);\r\n const popoverAnchorRef = useRef<HTMLDivElement | null>(null);\r\n\r\n // Update internal value when prop changes\r\n useEffect(() => {\r\n if (value !== undefined) {\r\n setInternalValue(value || '');\r\n }\r\n }, [value]);\r\n\r\n // Normalize hex value\r\n const normalizedValue = isValidHex(internalValue) ? normalizeHex(internalValue) : internalValue || '';\r\n\r\n // Handle input change\r\n const handleChange = useCallback(\r\n (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\r\n if (disabled) return;\r\n\r\n const newValue = (event.target as HTMLInputElement).value;\r\n setInternalValue(newValue);\r\n\r\n if (onChange) {\r\n onChange(newValue);\r\n }\r\n },\r\n [onChange],\r\n );\r\n\r\n // Handle native color input change\r\n const handleColorInputChange = useCallback(\r\n (event: ChangeEvent<HTMLInputElement>) => {\r\n if (disabled) return;\r\n event.stopPropagation();\r\n\r\n const newValue = event.target.value;\r\n setInternalValue(newValue);\r\n\r\n if (onChange) {\r\n onChange(newValue);\r\n }\r\n },\r\n [onChange],\r\n );\r\n\r\n // Handle preview swatch click - directly open native color picker\r\n const handlePreviewClick = useCallback(\r\n (event: React.MouseEvent<HTMLDivElement>) => {\r\n if (disabled) return;\r\n event.preventDefault();\r\n event.stopPropagation();\r\n // Trigger the hidden native color input\r\n if (colorInputRef.current) {\r\n colorInputRef.current.click();\r\n }\r\n },\r\n [disabled, colorInputRef],\r\n );\r\n\r\n // Handle key down\r\n const handleKeyDown = useCallback(\r\n (event: React.KeyboardEvent<HTMLDivElement>) => {\r\n if (event.key === 'Enter' && onEnterPress) {\r\n onEnterPress(normalizedValue);\r\n }\r\n if (textFieldProps.onKeyDown) {\r\n textFieldProps.onKeyDown(event);\r\n }\r\n },\r\n [onEnterPress, normalizedValue, textFieldProps.onKeyDown],\r\n );\r\n\r\n // Memoize preview swatch\r\n const previewSwatch = useMemo(\r\n () => (\r\n <InputAdornment position=\"start\">\r\n <Box\r\n ref={popoverAnchorRef}\r\n onClick={!disabled ? handlePreviewClick : undefined}\r\n sx={{\r\n width: size === 'small' ? 24 : 32,\r\n height: size === 'small' ? 24 : 32,\r\n borderRadius: 1,\r\n border: '1px solid',\r\n borderColor: error ? 'error.main' : 'divider',\r\n backgroundColor: normalizedValue,\r\n cursor: !disabled ? 'pointer' : 'default',\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'center',\r\n transition: 'all 0.2s',\r\n '&:hover': {\r\n opacity: !disabled ? 0.8 : 1,\r\n },\r\n ...previewStyles,\r\n }}\r\n title={!disabled ? 'Click to open color picker' : undefined}\r\n />\r\n </InputAdornment>\r\n ),\r\n [popoverAnchorRef, disabled, handlePreviewClick, size, error, normalizedValue, previewStyles],\r\n );\r\n\r\n // Build slotProps for MUI v7\r\n const finalSlotProps = useMemo(\r\n () => ({\r\n ...slotProps,\r\n input: {\r\n ...slotProps?.input,\r\n inputProps: {\r\n ...((slotProps?.input as any)?.inputProps || {}),\r\n },\r\n ...(showPreview && {\r\n startAdornment: previewSwatch,\r\n }),\r\n },\r\n }),\r\n [slotProps, showPreview, previewSwatch],\r\n );\r\n\r\n // Memoize helper text\r\n const displayHelperText = useMemo(\r\n () => helperText ?? (error?.message ? error.message : undefined),\r\n [helperText, error?.message],\r\n );\r\n\r\n return (\r\n <FormControl\r\n error={!!error}\r\n disabled={disabled}\r\n required={required}\r\n fullWidth={fullWidth}\r\n sx={formControlStyles}\r\n >\r\n <TextField\r\n {...textFieldProps}\r\n ref={ref}\r\n name={name}\r\n label={label}\r\n value={normalizedValue}\r\n onChange={handleChange}\r\n onFocus={onFocus}\r\n onBlur={onBlur}\r\n onKeyDown={handleKeyDown}\r\n placeholder={placeholder}\r\n variant={variant}\r\n size={size}\r\n color={color}\r\n fullWidth={fullWidth}\r\n required={required}\r\n error={!!error}\r\n disabled={disabled}\r\n slotProps={finalSlotProps}\r\n slots={slots}\r\n sx={inputStyles}\r\n helperText={displayHelperText}\r\n />\r\n {/* Hidden native color input - triggered when clicking preview swatch */}\r\n <input\r\n ref={colorInputRef}\r\n type=\"color\"\r\n value={normalizedValue}\r\n onChange={handleColorInputChange}\r\n disabled={disabled}\r\n style={{\r\n position: 'absolute',\r\n width: 0,\r\n height: 0,\r\n opacity: 0,\r\n pointerEvents: 'none',\r\n visibility: 'hidden',\r\n }}\r\n aria-hidden=\"true\"\r\n />\r\n </FormControl>\r\n );\r\n },\r\n ),\r\n);\r\n\r\nColorPickerField.displayName = 'ColorPickerField';\r\n\r\nexport default ColorPickerField;\r\n","import type { TextFieldProps } from \"@mui/material\";\r\nimport { memo, useRef } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\nimport FileUploadField from \"../FormFields/DropdownFields/FileUploadField\";\r\nimport type { IFormInputFields } from \"./types\";\r\nimport React from \"react\";\r\nconst FormInputFileUpload = memo(\r\n\t({ name, label, control, size, defaultValue = null, onChange, ...props }: IFormInputFields) => {\r\n\t\tconst fileRef = useRef(null);\r\n\r\n\t\treturn (\r\n\t\t\t<Controller\r\n\t\t\t\tname={name}\r\n\t\t\t\tcontrol={control}\r\n\t\t\t\tdefaultValue={defaultValue}\r\n\t\t\t\trender={({ field, fieldState: { error } }) => (\r\n\t\t\t\t\t<FileUploadField\r\n\t\t\t\t\t\t{...props}\r\n\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\tlabel={label}\r\n\t\t\t\t\t\tvalue={field.value ?? null}\r\n\t\t\t\t\t\tsize={size as TextFieldProps[\"size\"]}\r\n\t\t\t\t\t\tref={fileRef}\r\n\t\t\t\t\t\tonChange={(files) => {\r\n\t\t\t\t\t\t\tfield.onChange(files);\r\n\t\t\t\t\t\t\tonChange?.(files);\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t\tonBlur={field.onBlur}\r\n\t\t\t\t\t\terror={error}\r\n\t\t\t\t\t\thelperText={error?.message}\r\n\t\t\t\t\t/>\r\n\t\t\t\t)}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nFormInputFileUpload.displayName = \"FormInputFileUpload\";\r\n\r\nexport default FormInputFileUpload;\r\n","import Clear from \"@mui/icons-material/Clear\";\r\nimport CloudUploadIcon from \"@mui/icons-material/CloudUpload\";\r\nimport {\r\n\ttype ButtonProps,\r\n\tFormControl,\r\n\tFormHelperText,\r\n\tIconButton,\r\n\tInputAdornment,\r\n\tTextField,\r\n\ttype TextFieldProps,\r\n} from \"@mui/material\";\r\nimport React, {\r\n\ttype ChangeEvent,\r\n\ttype DragEvent,\r\n\ttype ForwardedRef,\r\n\tforwardRef,\r\n\tuseRef,\r\n\tuseState,\r\n} from \"react\";\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n\tmessage?: string;\r\n} | null;\r\n\r\n/**\r\n * File value type\r\n */\r\nexport type FileValue = File | File[] | null | undefined;\r\n\r\n/**\r\n * Extended File Upload Field Props\r\n * Extends MUI TextFieldProps with custom file upload props\r\n */\r\nexport interface IFileUploadFieldProps\r\n\textends Omit<TextFieldProps, \"value\" | \"onChange\" | \"name\" | \"type\" | \"error\" | \"onDrop\"> {\r\n\t/** Field name for form identification */\r\n\tname?: string;\r\n\t/** Label text for the file upload field */\r\n\tlabel?: string;\r\n\t/** Current file value */\r\n\tvalue?: File | File[] | { name: string } | null;\r\n\t/** Error object with optional message */\r\n\terror?: FieldError;\r\n\t/** Helper text to display below field */\r\n\thelperText?: string;\r\n\t/** Whether the field is disabled */\r\n\tdisabled?: boolean;\r\n\t/** File types to accept (e.g., \"image/*\", \".pdf,.doc\") */\r\n\taccept?: string;\r\n\t/** Whether to allow multiple file selection */\r\n\tmultiple?: boolean;\r\n\t/** Maximum file size in bytes */\r\n\tmaxSize?: number;\r\n\t/** Minimum file size in bytes */\r\n\tminSize?: number;\r\n\t/** Allowed file types (MIME types or extensions) */\r\n\tallowedTypes?: string[];\r\n\t/** Whether to show file preview */\r\n\tshowPreview?: boolean;\r\n\t/** Whether to enable drag and drop */\r\n\tenableDragDrop?: boolean;\r\n\t/** Placeholder text */\r\n\tplaceholder?: string;\r\n\t/** TextField variant */\r\n\tvariant?: TextFieldProps[\"variant\"];\r\n\t/** TextField size */\r\n\tsize?: TextFieldProps[\"size\"];\r\n\t/** TextField color */\r\n\tcolor?: TextFieldProps[\"color\"];\r\n\t/** Full width of the field */\r\n\tfullWidth?: boolean;\r\n\t/** Required field indicator */\r\n\trequired?: boolean;\r\n\t/** Upload button text */\r\n\tbuttonText?: string;\r\n\t/** Upload button variant */\r\n\tbuttonVariant?: ButtonProps[\"variant\"];\r\n\t/** Upload button color */\r\n\tbuttonColor?: ButtonProps[\"color\"];\r\n\t/** Upload button size */\r\n\tbuttonSize?: ButtonProps[\"size\"];\r\n\t/** Custom upload icon */\r\n\tuploadIcon?: React.ReactNode;\r\n\t/** Callback fired when file(s) change */\r\n\tonChange?: (file: File | File[] | undefined) => void;\r\n\t/** Callback fired when file is selected */\r\n\tonFileSelect?: (file: File | File[] | undefined) => void;\r\n\t/** Callback fired when file is removed */\r\n\tonFileRemove?: () => void;\r\n\t/** Callback fired on file validation error */\r\n\tonValidationError?: (error: string) => void;\r\n\t/** Callback fired when file is dropped (drag and drop) */\r\n\tonDrop?: (files: FileList) => void;\r\n\t/** Custom styles for the TextField */\r\n\tinputStyles?: TextFieldProps[\"sx\"];\r\n\t/** Custom styles for the Button */\r\n\tbuttonStyles?: ButtonProps[\"sx\"];\r\n\t/** Custom styles for FormControl */\r\n\tformControlStyles?: React.ComponentProps<typeof FormControl>[\"sx\"];\r\n\t/** Custom styles for the container */\r\n\tcontainerStyles?: React.CSSProperties;\r\n\t/** Custom slot props for MUI v7 */\r\n\tslotProps?: TextFieldProps[\"slotProps\"];\r\n\t/** Custom slots for MUI v7 */\r\n\tslots?: TextFieldProps[\"slots\"];\r\n}\r\n\r\nconst FileUploadField = forwardRef<HTMLInputElement, IFileUploadFieldProps>(\r\n\t(\r\n\t\t{\r\n\t\t\tname,\r\n\t\t\tlabel,\r\n\t\t\tvalue,\r\n\t\t\tonChange,\r\n\t\t\tonFileSelect,\r\n\t\t\tonFileRemove,\r\n\t\t\tonValidationError,\r\n\t\t\tonDrop,\r\n\t\t\terror,\r\n\t\t\thelperText,\r\n\t\t\tdisabled = false,\r\n\t\t\taccept,\r\n\t\t\tmultiple = false,\r\n\t\t\tmaxSize,\r\n\t\t\tminSize,\r\n\t\t\tallowedTypes,\r\n\t\t\tshowPreview = true,\r\n\t\t\tenableDragDrop = false,\r\n\t\t\tplaceholder = \"No file chosen\",\r\n\t\t\tvariant = \"outlined\",\r\n\t\t\tsize,\r\n\t\t\tcolor,\r\n\t\t\tfullWidth = true,\r\n\t\t\trequired,\r\n\t\t\tbuttonText = \"Upload\",\r\n\t\t\tbuttonVariant = \"contained\",\r\n\t\t\tbuttonColor = \"primary\",\r\n\t\t\tbuttonSize,\r\n\t\t\tuploadIcon = <CloudUploadIcon />,\r\n\t\t\tinputStyles,\r\n\t\t\tbuttonStyles,\r\n\t\t\tformControlStyles,\r\n\t\t\tcontainerStyles,\r\n\t\t\tslotProps,\r\n\t\t\tslots,\r\n\t\t\t...textFieldProps\r\n\t\t},\r\n\t\tref: ForwardedRef<HTMLInputElement>\r\n\t) => {\r\n\t\tconst internalRef = useRef<HTMLInputElement | null>(null);\r\n\t\tconst [isDragging, setIsDragging] = useState(false);\r\n\t\tconst [, setDragCounter] = useState(0);\r\n\r\n\t\t// Get the file input ref (either forwarded ref or internal ref)\r\n\t\tconst fileInputRef = ref && typeof ref === \"object\" && \"current\" in ref ? ref : internalRef;\r\n\r\n\t\t// Get file name(s) from value\r\n\t\tconst getFileName = (): string => {\r\n\t\t\tif (!value) return \"\";\r\n\t\t\tif (value instanceof File) return value.name;\r\n\t\t\tif (Array.isArray(value)) {\r\n\t\t\t\tif (value.length === 0) return \"\";\r\n\t\t\t\tif (value.length === 1) return value[0].name;\r\n\t\t\t\treturn `${value.length} files selected`;\r\n\t\t\t}\r\n\t\t\tif (typeof value === \"object\" && \"name\" in value) {\r\n\t\t\t\treturn value.name;\r\n\t\t\t}\r\n\t\t\treturn \"\";\r\n\t\t};\r\n\r\n\t\t// Validate file\r\n\t\tconst validateFile = (file: File): string | null => {\r\n\t\t\t// Check file size\r\n\t\t\tif (maxSize && file.size > maxSize) {\r\n\t\t\t\treturn `File size exceeds maximum allowed size of ${formatFileSize(maxSize)}`;\r\n\t\t\t}\r\n\t\t\tif (minSize && file.size < minSize) {\r\n\t\t\t\treturn `File size is below minimum required size of ${formatFileSize(minSize)}`;\r\n\t\t\t}\r\n\r\n\t\t\t// Check file type\r\n\t\t\tif (allowedTypes && allowedTypes.length > 0) {\r\n\t\t\t\tconst fileType = file.type || getFileExtension(file.name);\r\n\t\t\t\tconst isAllowed = allowedTypes.some((type) => {\r\n\t\t\t\t\tif (type.startsWith(\".\")) {\r\n\t\t\t\t\t\treturn file.name.toLowerCase().endsWith(type.toLowerCase());\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn fileType.includes(type) || fileType === type;\r\n\t\t\t\t});\r\n\t\t\t\tif (!isAllowed) {\r\n\t\t\t\t\treturn `File type not allowed. Allowed types: ${allowedTypes.join(\", \")}`;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn null;\r\n\t\t};\r\n\r\n\t\t// Format file size\r\n\t\tconst formatFileSize = (bytes: number): string => {\r\n\t\t\tif (bytes === 0) return \"0 Bytes\";\r\n\t\t\tconst k = 1024;\r\n\t\t\tconst sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\"];\r\n\t\t\tconst i = Math.floor(Math.log(bytes) / Math.log(k));\r\n\t\t\treturn Math.round((bytes / Math.pow(k, i)) * 100) / 100 + \" \" + sizes[i];\r\n\t\t};\r\n\r\n\t\t// Get file extension\r\n\t\tconst getFileExtension = (filename: string): string => {\r\n\t\t\treturn filename.slice(((filename.lastIndexOf(\".\") - 1) >>> 0) + 2);\r\n\t\t};\r\n\r\n\t\t// Handle file change\r\n\t\tconst handleFileChange = (event: ChangeEvent<HTMLInputElement>) => {\r\n\t\t\tconst files = event.target.files;\r\n\t\t\tif (!files || files.length === 0) {\r\n\t\t\t\tif (onChange) onChange(undefined);\r\n\t\t\t\tif (onFileSelect) onFileSelect(undefined);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst fileArray = Array.from(files);\r\n\t\t\tlet validFiles: File[] = [];\r\n\t\t\tlet hasError = false;\r\n\r\n\t\t\t// Validate each file\r\n\t\t\tfor (const file of fileArray) {\r\n\t\t\t\tconst validationError = validateFile(file);\r\n\t\t\t\tif (validationError) {\r\n\t\t\t\t\thasError = true;\r\n\t\t\t\t\tif (onValidationError) {\r\n\t\t\t\t\t\tonValidationError(validationError);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvalidFiles.push(file);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (validFiles.length > 0) {\r\n\t\t\t\tconst result = multiple ? validFiles : validFiles[0];\r\n\t\t\t\tif (onChange) onChange(result);\r\n\t\t\t\tif (onFileSelect) onFileSelect(result);\r\n\t\t\t} else if (hasError && onValidationError) {\r\n\t\t\t\t// Error already handled\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Handle button click\r\n\t\tconst handleButtonClick = () => {\r\n\t\t\tif (!disabled) {\r\n\t\t\t\tfileInputRef.current?.click();\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Handle file remove\r\n\t\tconst handleFileRemove = () => {\r\n\t\t\tif (fileInputRef.current) {\r\n\t\t\t\tfileInputRef.current.value = \"\";\r\n\t\t\t}\r\n\t\t\tif (onChange) onChange(undefined);\r\n\t\t\tif (onFileRemove) onFileRemove();\r\n\t\t};\r\n\r\n\t\t// Handle drag and drop\r\n\t\tconst handleDragEnter = (e: DragEvent<HTMLDivElement>) => {\r\n\t\t\te.preventDefault();\r\n\t\t\te.stopPropagation();\r\n\t\t\tsetDragCounter((prev) => prev + 1);\r\n\t\t\tif (e.dataTransfer.items && e.dataTransfer.items.length > 0) {\r\n\t\t\t\tsetIsDragging(true);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tconst handleDragLeave = (e: DragEvent<HTMLDivElement>) => {\r\n\t\t\te.preventDefault();\r\n\t\t\te.stopPropagation();\r\n\t\t\tsetDragCounter((prev) => {\r\n\t\t\t\tconst newCounter = prev - 1;\r\n\t\t\t\tif (newCounter === 0) {\r\n\t\t\t\t\tsetIsDragging(false);\r\n\t\t\t\t}\r\n\t\t\t\treturn newCounter;\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\tconst handleDragOver = (e: DragEvent<HTMLDivElement>) => {\r\n\t\t\te.preventDefault();\r\n\t\t\te.stopPropagation();\r\n\t\t};\r\n\r\n\t\tconst handleDrop = (e: DragEvent<HTMLDivElement>) => {\r\n\t\t\te.preventDefault();\r\n\t\t\te.stopPropagation();\r\n\t\t\tsetIsDragging(false);\r\n\t\t\tsetDragCounter(0);\r\n\r\n\t\t\tif (disabled) return;\r\n\r\n\t\t\tconst files = e.dataTransfer.files;\r\n\t\t\tif (files && files.length > 0) {\r\n\t\t\t\tif (onDrop) {\r\n\t\t\t\t\tonDrop(files);\r\n\t\t\t\t}\r\n\t\t\t\t// Create a synthetic event to reuse handleFileChange\r\n\t\t\t\tconst syntheticEvent = {\r\n\t\t\t\t\ttarget: { files },\r\n\t\t\t\t} as ChangeEvent<HTMLInputElement>;\r\n\t\t\t\thandleFileChange(syntheticEvent);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tconst fileName = getFileName();\r\n\t\tconst displayValue = showPreview && fileName ? fileName : placeholder;\r\n\r\n\t\treturn (\r\n\t\t\t<FormControl\r\n\t\t\t\terror={!!error}\r\n\t\t\t\tdisabled={disabled}\r\n\t\t\t\trequired={required}\r\n\t\t\t\tfullWidth={fullWidth}\r\n\t\t\t\tsx={formControlStyles}\r\n\t\t\t>\r\n\t\t\t\t<div\r\n\t\t\t\t\tstyle={containerStyles}\r\n\t\t\t\t\tonDragEnter={enableDragDrop ? handleDragEnter : undefined}\r\n\t\t\t\t\tonDragLeave={enableDragDrop ? handleDragLeave : undefined}\r\n\t\t\t\t\tonDragOver={enableDragDrop ? handleDragOver : undefined}\r\n\t\t\t\t\tonDrop={enableDragDrop ? handleDrop : undefined}\r\n\t\t\t\t>\r\n\t\t\t\t\t<input\r\n\t\t\t\t\t\ttype=\"file\"\r\n\t\t\t\t\t\taccept={accept}\r\n\t\t\t\t\t\tmultiple={multiple}\r\n\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\tid={name ? `file-upload-${name}` : undefined}\r\n\t\t\t\t\t\tonChange={handleFileChange}\r\n\t\t\t\t\t\tstyle={{ display: \"none\" }}\r\n\t\t\t\t\t\tref={fileInputRef}\r\n\t\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\t/>\r\n\t\t\t\t\t<TextField\r\n\t\t\t\t\t\t{...textFieldProps}\r\n\t\t\t\t\t\tlabel={label}\r\n\t\t\t\t\t\tvalue={displayValue}\r\n\t\t\t\t\t\tplaceholder={placeholder}\r\n\t\t\t\t\t\tvariant={variant}\r\n\t\t\t\t\t\tsize={size}\r\n\t\t\t\t\t\tcolor={color}\r\n\t\t\t\t\t\tfullWidth={fullWidth}\r\n\t\t\t\t\t\trequired={required}\r\n\t\t\t\t\t\terror={!!error}\r\n\t\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\tsx={inputStyles}\r\n\t\t\t\t\t\tslotProps={{\r\n\t\t\t\t\t\t\t...slotProps,\r\n\t\t\t\t\t\t\tinput: {\r\n\t\t\t\t\t\t\t\t...slotProps?.input,\r\n\t\t\t\t\t\t\t\treadOnly: true,\r\n\t\t\t\t\t\t\t\tendAdornment: (\r\n\t\t\t\t\t\t\t\t\t<InputAdornment position=\"end\">\r\n\t\t\t\t\t\t\t\t\t\t{showPreview && fileName && (\r\n\t\t\t\t\t\t\t\t\t\t\t<IconButton\r\n\t\t\t\t\t\t\t\t\t\t\t\tonClick={handleFileRemove}\r\n\t\t\t\t\t\t\t\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<Clear />\r\n\t\t\t\t\t\t\t\t\t\t\t</IconButton>\r\n\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t<IconButton\r\n\t\t\t\t\t\t\t\t\t\t\tonClick={handleButtonClick}\r\n\t\t\t\t\t\t\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\t\t\t\t\t\t\tsx={buttonStyles}\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t{uploadIcon}\r\n\t\t\t\t\t\t\t\t\t\t</IconButton>\r\n\t\t\t\t\t\t\t\t\t</InputAdornment>\r\n\t\t\t\t\t\t\t\t),\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t\tslots={slots}\r\n\t\t\t\t\t\thelperText={helperText ?? (error?.message ? error.message : undefined)}\r\n\t\t\t\t\t/>\r\n\t\t\t\t\t{enableDragDrop && isDragging && (\r\n\t\t\t\t\t\t<div\r\n\t\t\t\t\t\t\tstyle={{\r\n\t\t\t\t\t\t\t\tposition: \"absolute\",\r\n\t\t\t\t\t\t\t\ttop: 0,\r\n\t\t\t\t\t\t\t\tleft: 0,\r\n\t\t\t\t\t\t\t\tright: 0,\r\n\t\t\t\t\t\t\t\tbottom: 0,\r\n\t\t\t\t\t\t\t\tbackgroundColor: \"rgba(0, 0, 0, 0.05)\",\r\n\t\t\t\t\t\t\t\tborder: \"2px dashed\",\r\n\t\t\t\t\t\t\t\tborderColor: \"primary.main\",\r\n\t\t\t\t\t\t\t\tborderRadius: 4,\r\n\t\t\t\t\t\t\t\tdisplay: \"flex\",\r\n\t\t\t\t\t\t\t\talignItems: \"center\",\r\n\t\t\t\t\t\t\t\tjustifyContent: \"center\",\r\n\t\t\t\t\t\t\t\tzIndex: 1000,\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\tDrop files here\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t)}\r\n\t\t\t\t</div>\r\n\t\t\t\t{error && !helperText && error.message && <FormHelperText>{error.message}</FormHelperText>}\r\n\t\t\t</FormControl>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nFileUploadField.displayName = \"FileUploadField\";\r\n\r\nexport default FileUploadField;\r\n","import type { TextFieldProps } from \"@mui/material\";\r\nimport { memo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\nimport DatePickerField from \"../FormFields/DateFields/DatePickerField\";\r\nimport type { IFormInputDateFields } from \"./types\";\r\nimport React from \"react\";\r\nconst FormInputDatePicker = memo(\r\n\t({\r\n\t\tname,\r\n\t\tlabel,\r\n\t\tcontrol,\r\n\t\tsize,\r\n\t\treadOnly,\r\n\t\tshouldDisableDate,\r\n\t\tdisabled,\r\n\t\tplaceholder,\r\n\t\tdefaultValue = null,\r\n\t\tonChange,\r\n\t\t...props\r\n\t}: IFormInputDateFields) => {\r\n\t\treturn (\r\n\t\t\t<Controller\r\n\t\t\t\tname={name}\r\n\t\t\t\tcontrol={control}\r\n\t\t\t\tdefaultValue={defaultValue}\r\n\t\t\t\trender={({ field, fieldState: { error } }) => {\r\n\t\t\t\t\t// Exclude views prop as DatePicker uses DateView[], not TimeView[]\r\n\t\t\t\t\tconst { views, ampm, ampmInClock, timezone, ...restProps } = props;\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<DatePickerField\r\n\t\t\t\t\t\t\t{...restProps}\r\n\t\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\t\tlabel={label}\r\n\t\t\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\t\t\tvalue={field.value ?? null}\r\n\t\t\t\t\t\t\tonChange={(newValue) => {\r\n\t\t\t\t\t\t\t\tfield.onChange(newValue);\r\n\t\t\t\t\t\t\t\tonChange?.(newValue);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tonBlur={field.onBlur}\r\n\t\t\t\t\t\t\tshouldDisableDate={shouldDisableDate}\r\n\t\t\t\t\t\t\tsize={size as TextFieldProps[\"size\"]}\r\n\t\t\t\t\t\t\terror={error}\r\n\t\t\t\t\t\t\thelperText={error?.message}\r\n\t\t\t\t\t\t\treadOnly={readOnly}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t);\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nFormInputDatePicker.displayName = \"FormInputDatePicker\";\r\n\r\nexport default FormInputDatePicker;\r\n","import ClearIcon from \"@mui/icons-material/Clear\";\r\nimport {\r\n\tBox,\r\n\tFormControl,\r\n\tFormHelperText,\r\n\tFormLabel,\r\n\ttype FormLabelProps,\r\n\tIconButton,\r\n\tTextField,\r\n\ttype TextFieldProps,\r\n} from \"@mui/material\";\r\nimport { DatePicker, type DatePickerProps, LocalizationProvider } from \"@mui/x-date-pickers\";\r\n// @ts-ignore\r\nimport { AdapterDateFns } from \"@mui/x-date-pickers/AdapterDateFns\";\r\nimport React, { type ForwardedRef, forwardRef, useRef } from \"react\";\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n\tmessage?: string;\r\n} | null;\r\n\r\n/**\r\n * Extended Date Picker Field Props\r\n * Extends MUI DatePickerProps with custom form field props\r\n */\r\nexport interface IDatePickerFieldProps\r\n\textends Omit<\r\n\t\tDatePickerProps,\r\n\t\t\"value\" | \"onChange\" | \"defaultValue\" | \"slots\" | \"slotProps\" | \"renderInput\"\r\n\t> {\r\n\t/** Field name for form identification */\r\n\tname?: string;\r\n\t/** Label text for the date picker */\r\n\tlabel?: string;\r\n\ttitle?: boolean;\r\n\t/** Current selected date value */\r\n\tvalue: Date | null;\r\n\t/** Default date value */\r\n\tdefaultValue?: Date | null;\r\n\t/** Error object with optional message */\r\n\terror?: FieldError;\r\n\t/** Helper text to display below field */\r\n\thelperText?: string;\r\n\t/** Whether the field is disabled */\r\n\tdisabled?: boolean;\r\n\t/** Full width of the field */\r\n\tfullWidth?: boolean;\r\n\t/** Required field indicator */\r\n\trequired?: boolean;\r\n\t/** Minimum selectable date */\r\n\tminDate?: Date;\r\n\t/** Maximum selectable date */\r\n\tmaxDate?: Date;\r\n\t/** Function to disable specific dates */\r\n\tshouldDisableDate?: (date: Date) => boolean;\r\n\t/** Function to disable specific months */\r\n\tshouldDisableMonth?: (month: Date) => boolean;\r\n\t/** Function to disable specific years */\r\n\tshouldDisableYear?: (year: Date) => boolean;\r\n\t/** TextField size */\r\n\tsize?: TextFieldProps[\"size\"];\r\n\t/** TextField variant */\r\n\tvariant?: TextFieldProps[\"variant\"];\r\n\t/** TextField color */\r\n\tcolor?: TextFieldProps[\"color\"];\r\n\t/** Placeholder text */\r\n\tplaceholder?: string;\r\n\t/** Whether the field is read-only */\r\n\treadOnly?: boolean;\r\n\t/** Whether to show clear button */\r\n\tshowClearButton?: boolean;\r\n\t/** Whether to disable past dates */\r\n\tdisablePast?: boolean;\r\n\t/** Whether to disable future dates */\r\n\tdisableFuture?: boolean;\r\n\t/** Reference date for the calendar */\r\n\treferenceDate?: Date;\r\n\t/** Controlled view state */\r\n\tview?: \"day\" | \"month\" | \"year\";\r\n\t/** Format for displaying the date */\r\n\tformat?: string;\r\n\t/** Whether to open the calendar on focus */\r\n\topenTo?: \"day\" | \"month\" | \"year\";\r\n\t/** Custom styles for the DatePicker */\r\n\tpickerStyles?: DatePickerProps[\"sx\"];\r\n\t/** Custom styles for FormControl */\r\n\tformControlStyles?: React.ComponentProps<typeof FormControl>[\"sx\"];\r\n\t/** Custom styles for FormLabel */\r\n\tformLabelStyles?: FormLabelProps[\"sx\"];\r\n\t/** Custom styles for the container Box */\r\n\tcontainerStyles?: React.ComponentProps<typeof Box>[\"sx\"];\r\n\t/** Custom styles for the TextField */\r\n\ttextFieldStyles?: TextFieldProps[\"sx\"];\r\n\t/** Callback fired when the date changes */\r\n\tonChange?: (value: Date | null) => void;\r\n\t/** Callback fired when the field receives focus */\r\n\tonFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;\r\n\t/** Callback fired when the field loses focus */\r\n\tonBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;\r\n\t/** Callback fired when a view change is requested */\r\n\tonViewChange?: (view: \"day\" | \"month\" | \"year\") => void;\r\n\t/** Callback fired when a month change is requested */\r\n\tonMonthChange?: (month: Date) => void;\r\n\t/** Callback fired when a year change is requested */\r\n\tonYearChange?: (year: Date) => void;\r\n\t/** Callback fired when the calendar opens */\r\n\tonOpen?: () => void;\r\n\t/** Callback fired when the calendar closes */\r\n\tonClose?: () => void;\r\n\t/** Custom slot props for MUI v7 */\r\n\tslotProps?: DatePickerProps[\"slotProps\"];\r\n\t/** Custom slots for MUI v7 */\r\n\tslots?: DatePickerProps[\"slots\"];\r\n\t/** Date adapter to use (defaults to AdapterDateFns) */\r\n\tdateAdapter?: typeof AdapterDateFns;\r\n\t/** Whether to reduce animations */\r\n\treduceAnimations?: boolean;\r\n\t/** Auto focus the input */\r\n\tautoFocus?: boolean;\r\n}\r\n\r\nconst DatePickerField = forwardRef<HTMLDivElement, IDatePickerFieldProps>(\r\n\t(\r\n\t\t{\r\n\t\t\tname,\r\n\t\t\tlabel,\r\n\t\t\tvalue,\r\n\t\t\tdefaultValue,\r\n\t\t\tonChange,\r\n\t\t\tonFocus,\r\n\t\t\tonBlur,\r\n\t\t\tonViewChange,\r\n\t\t\tonMonthChange,\r\n\t\t\tonYearChange,\r\n\t\t\tonOpen,\r\n\t\t\tonClose,\r\n\t\t\terror,\r\n\t\t\thelperText,\r\n\t\t\tdisabled = false,\r\n\t\t\tfullWidth = true,\r\n\t\t\trequired,\r\n\t\t\tminDate,\r\n\t\t\tmaxDate,\r\n\t\t\tshouldDisableDate,\r\n\t\t\tshouldDisableMonth,\r\n\t\t\tshouldDisableYear,\r\n\t\t\tsize = \"medium\",\r\n\t\t\tvariant = \"outlined\",\r\n\t\t\tcolor = \"primary\",\r\n\t\t\tplaceholder,\r\n\t\t\treadOnly = false,\r\n\t\t\tshowClearButton = true,\r\n\t\t\tdisablePast = false,\r\n\t\t\tdisableFuture = false,\r\n\t\t\treferenceDate,\r\n\t\t\tview,\r\n\t\t\tformat,\r\n\t\t\topenTo = \"day\",\r\n\t\t\tpickerStyles,\r\n\t\t\tformControlStyles,\r\n\t\t\tformLabelStyles,\r\n\t\t\tcontainerStyles,\r\n\t\t\ttextFieldStyles,\r\n\t\t\tslotProps,\r\n\t\t\tslots,\r\n\t\t\ttitle = false,\r\n\t\t\tdateAdapter = AdapterDateFns,\r\n\t\t\treduceAnimations = false,\r\n\t\t\tautoFocus = false,\r\n\t\t\t...datePickerProps\r\n\t\t},\r\n\t\tref: ForwardedRef<HTMLDivElement>\r\n\t) => {\r\n\t\tconst inputRef = useRef<HTMLInputElement | null>(null);\r\n\r\n\t\t// Handle onChange with proper typing\r\n\t\tconst handleChange = (newValue: Date | null) => {\r\n\t\t\tif (onChange) {\r\n\t\t\t\tonChange(newValue);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Handle clear button click\r\n\t\tconst handleClear = () => {\r\n\t\t\tif (onChange) {\r\n\t\t\t\tonChange(null);\r\n\t\t\t}\r\n\t\t\tif (inputRef.current) {\r\n\t\t\t\tinputRef.current.focus();\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Default placeholder\r\n\t\tconst defaultPlaceholder = placeholder || \"MM/DD/YYYY\";\r\n\r\n\t\t// Merge slotProps with textField configuration\r\n\t\tconst mergedSlotProps = {\r\n\t\t\t...slotProps,\r\n\t\t\ttextField: {\r\n\t\t\t\t...slotProps?.textField,\r\n\t\t\t\terror: !!error,\r\n\t\t\t\tsize,\r\n\t\t\t\tvariant,\r\n\t\t\t\tcolor,\r\n\t\t\t\thelperText: error ? (helperText ?? error.message) : helperText,\r\n\t\t\t\tfullWidth,\r\n\t\t\t\tplaceholder: defaultPlaceholder,\r\n\t\t\t\tautoFocus,\r\n\t\t\t\tonFocus,\r\n\t\t\t\tonBlur,\r\n\t\t\t\tinputRef: ref || inputRef,\r\n\t\t\t\tclearable: showClearButton,\r\n\t\t\t\tshowClear: !!value,\r\n\t\t\t\tonClear: handleClear,\r\n\t\t\t\tsx: {\r\n\t\t\t\t\t...textFieldStyles,\r\n\t\t\t\t\t...((\r\n\t\t\t\t\t\tslotProps?.textField &&\r\n\t\t\t\t\t\ttypeof slotProps.textField === \"object\" &&\r\n\t\t\t\t\t\t\"sx\" in slotProps.textField\r\n\t\t\t\t\t) ?\r\n\t\t\t\t\t\tslotProps.textField.sx\r\n\t\t\t\t\t:\t{}),\r\n\t\t\t\t},\r\n\t\t\t\tInputProps: {\r\n\t\t\t\t\t...((\r\n\t\t\t\t\t\tslotProps?.textField &&\r\n\t\t\t\t\t\ttypeof slotProps.textField === \"object\" &&\r\n\t\t\t\t\t\t\"InputProps\" in slotProps.textField\r\n\t\t\t\t\t) ?\r\n\t\t\t\t\t\tslotProps.textField.InputProps\r\n\t\t\t\t\t:\t{}),\r\n\t\t\t\t},\r\n\t\t\t} as unknown as Partial<TextFieldProps>,\r\n\t\t};\r\n\r\n\t\treturn (\r\n\t\t\t<FormControl\r\n\t\t\t\terror={!!error}\r\n\t\t\t\tdisabled={disabled}\r\n\t\t\t\trequired={required}\r\n\t\t\t\tfullWidth={fullWidth}\r\n\t\t\t\tsx={formControlStyles}\r\n\t\t\t>\r\n\t\t\t\t{label && title && (\r\n\t\t\t\t\t<FormLabel\r\n\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\tmb: 1,\r\n\t\t\t\t\t\t\t...formLabelStyles,\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t{label}\r\n\t\t\t\t\t</FormLabel>\r\n\t\t\t\t)}\r\n\t\t\t\t<Box\r\n\t\t\t\t\tref={ref}\r\n\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t...containerStyles,\r\n\t\t\t\t\t}}\r\n\t\t\t\t>\r\n\t\t\t\t\t<LocalizationProvider dateAdapter={dateAdapter}>\r\n\t\t\t\t\t\t<DatePicker\r\n\t\t\t\t\t\t\t{...datePickerProps}\r\n\t\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\t\tenableAccessibleFieldDOMStructure={false}\r\n\t\t\t\t\t\t\tlabel={label}\r\n\t\t\t\t\t\t\tvalue={value}\r\n\t\t\t\t\t\t\tdefaultValue={defaultValue}\r\n\t\t\t\t\t\t\tonChange={handleChange}\r\n\t\t\t\t\t\t\tonViewChange={onViewChange}\r\n\t\t\t\t\t\t\tonMonthChange={onMonthChange}\r\n\t\t\t\t\t\t\tonYearChange={onYearChange}\r\n\t\t\t\t\t\t\tonOpen={onOpen}\r\n\t\t\t\t\t\t\tonClose={onClose}\r\n\t\t\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\t\t\tminDate={minDate}\r\n\t\t\t\t\t\t\tmaxDate={maxDate}\r\n\t\t\t\t\t\t\tshouldDisableDate={shouldDisableDate}\r\n\t\t\t\t\t\t\tshouldDisableMonth={shouldDisableMonth}\r\n\t\t\t\t\t\t\tshouldDisableYear={shouldDisableYear}\r\n\t\t\t\t\t\t\tdisablePast={disablePast}\r\n\t\t\t\t\t\t\tdisableFuture={disableFuture}\r\n\t\t\t\t\t\t\treferenceDate={referenceDate}\r\n\t\t\t\t\t\t\tview={view}\r\n\t\t\t\t\t\t\tformat={format}\r\n\t\t\t\t\t\t\topenTo={openTo}\r\n\t\t\t\t\t\t\treduceAnimations={reduceAnimations}\r\n\t\t\t\t\t\t\tslotProps={mergedSlotProps}\r\n\t\t\t\t\t\t\tslots={{ ...slots, textField: ActionableTextField }}\r\n\t\t\t\t\t\t\tsx={pickerStyles}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t</LocalizationProvider>\r\n\t\t\t\t</Box>\r\n\t\t\t\t{!error && helperText && <FormHelperText>{helperText}</FormHelperText>}\r\n\t\t\t</FormControl>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nconst ActionableTextField = forwardRef((props: any, ref) => {\r\n\tconst { clearable, onClear, showClear, InputProps, slotProps, ...other } = props;\r\n\treturn (\r\n\t\t<TextField\r\n\t\t\t{...other}\r\n\t\t\tref={ref}\r\n\t\t\tslotProps={{\r\n\t\t\t\t...slotProps,\r\n\t\t\t\tinput: {\r\n\t\t\t\t\t...InputProps,\r\n\t\t\t\t\t...slotProps?.input,\r\n\t\t\t\t\tendAdornment: (\r\n\t\t\t\t\t\t<React.Fragment>\r\n\t\t\t\t\t\t\t{clearable && showClear && (\r\n\t\t\t\t\t\t\t\t<IconButton\r\n\t\t\t\t\t\t\t\t\tonClick={onClear}\r\n\t\t\t\t\t\t\t\t\tsize=\"small\"\r\n\t\t\t\t\t\t\t\t\tedge=\"end\"\r\n\t\t\t\t\t\t\t\t\tsx={{ marginRight: 0.5 }}\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t<ClearIcon fontSize=\"small\" />\r\n\t\t\t\t\t\t\t\t</IconButton>\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t{InputProps?.endAdornment}\r\n\t\t\t\t\t\t\t{slotProps?.input?.endAdornment}\r\n\t\t\t\t\t\t</React.Fragment>\r\n\t\t\t\t\t),\r\n\t\t\t\t},\r\n\t\t\t}}\r\n\t\t/>\r\n\t);\r\n});\r\n\r\nActionableTextField.displayName = \"ActionableDatePickerTextField\";\r\n\r\nDatePickerField.displayName = \"DatePickerField\";\r\n\r\nexport default DatePickerField;\r\n","import { memo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\nimport TimePickerField from \"../FormFields/DateFields/TimePickerField\";\r\nimport type { IFormInputDateFields } from \"./types\";\r\nimport React from \"react\";\r\nconst FormInputTimePicker = memo(\r\n\t({\r\n\t\tname,\r\n\t\tlabel,\r\n\t\tcontrol,\r\n\t\tampm = true,\r\n\t\ttimezone,\r\n\t\tdefaultValue = null,\r\n\t\tonChange,\r\n\t\t...props\r\n\t}: IFormInputDateFields) => {\r\n\t\treturn (\r\n\t\t\t<Controller\r\n\t\t\t\tname={name}\r\n\t\t\t\tcontrol={control}\r\n\t\t\t\tdefaultValue={defaultValue}\r\n\t\t\t\trender={({ field, fieldState: { error } }) => {\r\n\t\t\t\t\tconst { size, ...restProps } = props;\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<TimePickerField\r\n\t\t\t\t\t\t\t{...restProps}\r\n\t\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\t\tlabel={label}\r\n\t\t\t\t\t\t\tvalue={field.value ?? null}\r\n\t\t\t\t\t\t\tonChange={(newValue) => {\r\n\t\t\t\t\t\t\t\tfield.onChange(newValue);\r\n\t\t\t\t\t\t\t\tonChange?.(newValue);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tonBlur={field.onBlur}\r\n\t\t\t\t\t\t\tampm={ampm}\r\n\t\t\t\t\t\t\ttimezone={timezone}\r\n\t\t\t\t\t\t\tsize={size as any}\r\n\t\t\t\t\t\t\terror={error}\r\n\t\t\t\t\t\t\thelperText={error?.message}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t);\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nFormInputTimePicker.displayName = \"FormInputTimePicker\";\r\n\r\nexport default FormInputTimePicker;\r\n","import ClearIcon from \"@mui/icons-material/Clear\";\n\nimport {\n\tBox,\n\tFormControl,\n\tFormHelperText,\n\tFormLabel,\n\ttype FormLabelProps,\n\tIconButton,\n\tTextField,\n\ttype TextFieldProps,\n} from \"@mui/material\";\nimport { LocalizationProvider, TimePicker, type TimePickerProps } from \"@mui/x-date-pickers\";\n// @ts-ignore\nimport { AdapterDateFns } from \"@mui/x-date-pickers/AdapterDateFns\";\nimport React, { type ForwardedRef, forwardRef, useRef } from \"react\";\n\n/**\n * Error object type\n */\nexport type FieldError = {\n\tmessage?: string;\n} | null;\n\n/**\n * Extended Time Picker Field Props\n * Extends MUI TimePickerProps with custom form field props\n */\nexport interface ITimePickerFieldProps\n\textends Omit<\n\t\tTimePickerProps,\n\t\t\"value\" | \"onChange\" | \"defaultValue\" | \"slots\" | \"slotProps\" | \"renderInput\" | \"onViewChange\"\n\t> {\n\t/** Field name for form identification */\n\tname?: string;\n\t/** Label text for the time picker */\n\tlabel?: string;\n\t/** Current selected time value */\n\tvalue: Date | null;\n\t/** Default time value */\n\tdefaultValue?: Date | null;\n\t/** Error object with optional message */\n\terror?: FieldError;\n\t/** Helper text to display below field */\n\thelperText?: string;\n\t/** Whether the field is disabled */\n\tdisabled?: boolean;\n\t/** Full width of the field */\n\tfullWidth?: boolean;\n\t/** Whether to show title */\n\ttitle?: boolean;\n\t/** Required field indicator */\n\trequired?: boolean;\n\t/** Minimum selectable time */\n\tminTime?: Date;\n\t/** Maximum selectable time */\n\tmaxTime?: Date;\n\t/** Function to disable specific times */\n\tshouldDisableTime?: (time: Date, view: \"hours\" | \"minutes\" | \"seconds\") => boolean;\n\t/** TextField size */\n\tsize?: TextFieldProps[\"size\"];\n\t/** TextField variant */\n\tvariant?: TextFieldProps[\"variant\"];\n\t/** TextField color */\n\tcolor?: TextFieldProps[\"color\"];\n\t/** Placeholder text */\n\tplaceholder?: string;\n\t/** Whether the field is read-only */\n\treadOnly?: boolean;\n\t/** Whether to show clear button */\n\tshowClearButton?: boolean;\n\t/** Whether to disable past times */\n\tdisablePast?: boolean;\n\t/** Whether to disable future times */\n\tdisableFuture?: boolean;\n\t/** Whether to use 12-hour format */\n\tampm?: boolean;\n\t/** Available views (hours, minutes, seconds) */\n\tviews?: (\"hours\" | \"minutes\" | \"seconds\")[];\n\t/** Controlled view state */\n\tview?: \"hours\" | \"minutes\" | \"seconds\";\n\t/** Default view */\n\topenTo?: \"hours\" | \"minutes\" | \"seconds\";\n\t/** Format for displaying the time */\n\tformat?: string;\n\t/** Custom styles for the TimePicker */\n\tpickerStyles?: TimePickerProps[\"sx\"];\n\t/** Custom styles for FormControl */\n\tformControlStyles?: React.ComponentProps<typeof FormControl>[\"sx\"];\n\t/** Custom styles for FormLabel */\n\tformLabelStyles?: FormLabelProps[\"sx\"];\n\t/** Custom styles for the container Box */\n\tcontainerStyles?: React.ComponentProps<typeof Box>[\"sx\"];\n\t/** Custom styles for the TextField */\n\ttextFieldStyles?: TextFieldProps[\"sx\"];\n\t/** Callback fired when the time changes */\n\tonChange?: (value: Date | null) => void;\n\t/** Callback fired when the field receives focus */\n\tonFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;\n\t/** Callback fired when the field loses focus */\n\tonBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;\n\t/** Callback fired when a view change is requested */\n\tonViewChange?: (view: \"hours\" | \"minutes\" | \"seconds\" | \"meridiem\") => void;\n\t/** Callback fired when the picker opens */\n\tonOpen?: () => void;\n\t/** Callback fired when the picker closes */\n\tonClose?: () => void;\n\t/** Custom slot props for MUI v7 */\n\tslotProps?: TimePickerProps[\"slotProps\"];\n\t/** Custom slots for MUI v7 */\n\tslots?: TimePickerProps[\"slots\"];\n\t/** Date adapter to use (defaults to AdapterDateFns) */\n\tdateAdapter?: typeof AdapterDateFns;\n\t/** Auto focus the input */\n\tautoFocus?: boolean;\n}\n\nconst TimePickerField = forwardRef<HTMLDivElement, ITimePickerFieldProps>(\n\t(\n\t\t{\n\t\t\tname,\n\t\t\tlabel,\n\t\t\ttitle,\n\t\t\tvalue,\n\t\t\tdefaultValue,\n\t\t\tonChange,\n\t\t\tonFocus,\n\t\t\tonBlur,\n\t\t\tonViewChange,\n\t\t\tonOpen,\n\t\t\tonClose,\n\t\t\terror,\n\t\t\thelperText,\n\t\t\tdisabled = false,\n\t\t\tfullWidth = true,\n\t\t\trequired,\n\t\t\tminTime,\n\t\t\tmaxTime,\n\t\t\tshouldDisableTime,\n\t\t\tsize = \"medium\",\n\t\t\tvariant = \"outlined\",\n\t\t\tcolor = \"primary\",\n\t\t\tplaceholder,\n\t\t\treadOnly = false,\n\t\t\tshowClearButton = true,\n\t\t\tdisablePast = false,\n\t\t\tdisableFuture = false,\n\t\t\tampm = true,\n\t\t\tviews,\n\t\t\tview,\n\t\t\topenTo = \"hours\",\n\t\t\tformat,\n\t\t\tpickerStyles,\n\t\t\tformControlStyles,\n\t\t\tformLabelStyles,\n\t\t\tcontainerStyles,\n\t\t\ttextFieldStyles,\n\t\t\tslotProps,\n\t\t\tslots,\n\t\t\tdateAdapter = AdapterDateFns,\n\t\t\tautoFocus = false,\n\t\t\t...timePickerProps\n\t\t},\n\t\tref: ForwardedRef<HTMLDivElement>\n\t) => {\n\t\tconst inputRef = useRef<HTMLInputElement | null>(null);\n\n\t\t// Handle onChange with proper typing\n\t\tconst handleChange = (newValue: Date | null) => {\n\t\t\tif (onChange) {\n\t\t\t\tonChange(newValue);\n\t\t\t}\n\t\t};\n\n\t\t// Handle clear button click\n\t\tconst handleClear = () => {\n\t\t\tif (onChange) {\n\t\t\t\tonChange(null);\n\t\t\t}\n\t\t\tif (inputRef.current) {\n\t\t\t\tinputRef.current.focus();\n\t\t\t}\n\t\t};\n\n\t\t// Default placeholder\n\t\tconst defaultPlaceholder = placeholder || (ampm ? \"hh:mm AM/PM\" : \"hh:mm\");\n\n\t\t// Merge slotProps with textField configuration\n\t\tconst mergedSlotProps = {\n\t\t\t...slotProps,\n\t\t\ttextField: {\n\t\t\t\t...slotProps?.textField,\n\t\t\t\terror: !!error,\n\t\t\t\tsize,\n\t\t\t\tvariant,\n\t\t\t\tcolor,\n\t\t\t\thelperText: error ? (helperText ?? error.message) : helperText,\n\t\t\t\tfullWidth,\n\t\t\t\tplaceholder: defaultPlaceholder,\n\t\t\t\tautoFocus,\n\t\t\t\tonFocus,\n\t\t\t\tonBlur,\n\t\t\t\tinputRef: ref || inputRef,\n\t\t\t\tclearable: showClearButton,\n\t\t\t\tshowClear: !!value,\n\t\t\t\tonClear: handleClear,\n\t\t\t\tsx: {\n\t\t\t\t\t...textFieldStyles,\n\t\t\t\t\t...((\n\t\t\t\t\t\tslotProps?.textField &&\n\t\t\t\t\t\ttypeof slotProps.textField === \"object\" &&\n\t\t\t\t\t\t\"sx\" in slotProps.textField\n\t\t\t\t\t) ?\n\t\t\t\t\t\tslotProps.textField.sx\n\t\t\t\t\t:\t{}),\n\t\t\t\t},\n\t\t\t\tInputProps: {\n\t\t\t\t\t...((\n\t\t\t\t\t\tslotProps?.textField &&\n\t\t\t\t\t\ttypeof slotProps.textField === \"object\" &&\n\t\t\t\t\t\t\"InputProps\" in slotProps.textField\n\t\t\t\t\t) ?\n\t\t\t\t\t\tslotProps.textField.InputProps\n\t\t\t\t\t:\t{}),\n\t\t\t\t},\n\t\t\t} as unknown as Partial<TextFieldProps>,\n\t\t};\n\n\t\treturn (\n\t\t\t<FormControl\n\t\t\t\terror={!!error}\n\t\t\t\tdisabled={disabled}\n\t\t\t\trequired={required}\n\t\t\t\tfullWidth={fullWidth}\n\t\t\t\tsx={formControlStyles}\n\t\t\t>\n\t\t\t\t{label && title && (\n\t\t\t\t\t<FormLabel\n\t\t\t\t\t\tsx={{\n\t\t\t\t\t\t\tmb: 1,\n\t\t\t\t\t\t\t...formLabelStyles,\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t{label}\n\t\t\t\t\t</FormLabel>\n\t\t\t\t)}\n\t\t\t\t<Box\n\t\t\t\t\tref={ref}\n\t\t\t\t\tsx={{\n\t\t\t\t\t\t...containerStyles,\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<LocalizationProvider dateAdapter={dateAdapter}>\n\t\t\t\t\t\t<TimePicker\n\t\t\t\t\t\t\t{...timePickerProps}\n\t\t\t\t\t\t\tname={name}\n\t\t\t\t\t\t\tenableAccessibleFieldDOMStructure={false}\n\t\t\t\t\t\t\tlabel={label ? undefined : label}\n\t\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\t\tonViewChange={onViewChange}\n\t\t\t\t\t\t\tonOpen={onOpen}\n\t\t\t\t\t\t\tonClose={onClose}\n\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\tminTime={minTime}\n\t\t\t\t\t\t\tmaxTime={maxTime}\n\t\t\t\t\t\t\tshouldDisableTime={shouldDisableTime}\n\t\t\t\t\t\t\tdisablePast={disablePast}\n\t\t\t\t\t\t\tdisableFuture={disableFuture}\n\t\t\t\t\t\t\tampm={ampm}\n\t\t\t\t\t\t\tviews={views}\n\t\t\t\t\t\t\tview={view}\n\t\t\t\t\t\t\topenTo={openTo}\n\t\t\t\t\t\t\tformat={format}\n\t\t\t\t\t\t\tslotProps={mergedSlotProps}\n\t\t\t\t\t\t\tslots={{ ...slots, textField: ActionableTextField }}\n\t\t\t\t\t\t\tsx={pickerStyles}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</LocalizationProvider>\n\t\t\t\t</Box>\n\n\t\t\t\t{!error && helperText && (\n\t\t\t\t\t<FormHelperText sx={{ margin: \"4px\" }}>{helperText}</FormHelperText>\n\t\t\t\t)}\n\t\t\t</FormControl>\n\t\t);\n\t}\n);\nconst ActionableTextField = forwardRef((props: any, ref) => {\n\tconst { clearable, onClear, showClear, InputProps, slotProps, ...other } = props;\n\treturn (\n\t\t<TextField\n\t\t\t{...other}\n\t\t\tref={ref}\n\t\t\tslotProps={{\n\t\t\t\t...slotProps,\n\t\t\t\tinput: {\n\t\t\t\t\t...InputProps,\n\t\t\t\t\t...slotProps?.input,\n\t\t\t\t\tendAdornment: (\n\t\t\t\t\t\t<React.Fragment>\n\t\t\t\t\t\t\t{clearable && showClear && (\n\t\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\t\tonClick={onClear}\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\tedge=\"end\"\n\t\t\t\t\t\t\t\t\tsx={{ marginRight: 0.5 }}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ClearIcon fontSize=\"small\" />\n\t\t\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{InputProps?.endAdornment}\n\t\t\t\t\t\t\t{slotProps?.input?.endAdornment}\n\t\t\t\t\t\t</React.Fragment>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t}}\n\t\t/>\n\t);\n});\nActionableTextField.displayName = \"ActionableTimePickerTextField\";\n\nTimePickerField.displayName = \"TimePickerField\";\n\nexport default TimePickerField;\n","import { Box, FormLabel } from \"@mui/material\";\r\nimport { memo, useMemo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\nimport TimeClockField from \"../FormFields/DateFields/TimeClockField\";\r\nimport type { IFormInputDateFields } from \"./types\";\r\nimport React from \"react\";\r\nconst FormInputTimeClock = memo(\r\n\t({\r\n\t\tname,\r\n\t\tlabel,\r\n\t\tcontrol,\r\n\t\treadOnly,\r\n\t\tdisabled,\r\n\t\tampm = true,\r\n\t\tviews,\r\n\t\tampmInClock = true,\r\n\t\tdisablePast = false,\r\n\t\tdefaultValue = null,\r\n\t\tonChange,\r\n\t\t...props\r\n\t}: IFormInputDateFields) => {\r\n\t\tconst ampmValue = useMemo(() => (typeof ampm === \"boolean\" ? ampm : undefined), [ampm]);\r\n\r\n\t\treturn (\r\n\t\t\t<Box\r\n\t\t\t\tsx={{\r\n\t\t\t\t\tborder: (t) => `1px solid ${t.palette.grey[600]}`,\r\n\t\t\t\t\tborderRadius: (t) => t.spacing(0.5),\r\n\t\t\t\t\tdisplay: \"flex\",\r\n\t\t\t\t\tflexDirection: \"column\",\r\n\t\t\t\t}}\r\n\t\t\t>\r\n\t\t\t\t<FormLabel\r\n\t\t\t\t\tsx={(t) => ({\r\n\t\t\t\t\t\tborderBottom: `1px solid ${t.palette.grey[600]}`,\r\n\t\t\t\t\t\tpadding: (t) => t.spacing(1),\r\n\t\t\t\t\t})}\r\n\t\t\t\t>\r\n\t\t\t\t\t{label}\r\n\t\t\t\t</FormLabel>\r\n\t\t\t\t<Controller\r\n\t\t\t\t\tname={name}\r\n\t\t\t\t\tcontrol={control}\r\n\t\t\t\t\tdefaultValue={defaultValue}\r\n\t\t\t\t\trender={({ field, fieldState: { error } }) => (\r\n\t\t\t\t\t\t<TimeClockField\r\n\t\t\t\t\t\t\t{...props}\r\n\t\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\t\tvalue={field.value ?? null}\r\n\t\t\t\t\t\t\tonChange={(newValue) => {\r\n\t\t\t\t\t\t\t\tfield.onChange(newValue);\r\n\t\t\t\t\t\t\t\tonChange?.(newValue);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tampm={ampmValue}\r\n\t\t\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\t\t\treadOnly={readOnly}\r\n\t\t\t\t\t\t\tampmInClock={ampmInClock}\r\n\t\t\t\t\t\t\tdisablePast={disablePast}\r\n\t\t\t\t\t\t\tviews={views}\r\n\t\t\t\t\t\t\terror={error}\r\n\t\t\t\t\t\t\thelperText={error?.message}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t)}\r\n\t\t\t\t/>\r\n\t\t\t</Box>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nFormInputTimeClock.displayName = \"FormInputTimeClock\";\r\n\r\nexport default FormInputTimeClock;\r\n","import { Box, Button, FormControl, FormHelperText, Stack, type ButtonProps, type FormLabelProps } from '@mui/material';\r\nimport { LocalizationProvider, TimeClock, type TimeClockProps, type TimeView } from '@mui/x-date-pickers';\r\n// @ts-ignore\r\nimport { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';\r\nimport React, { forwardRef, useState, type ForwardedRef } from 'react';\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n message?: string;\r\n} | null;\r\n\r\n/**\r\n * Extended Time Clock Field Props\r\n * Extends MUI TimeClockProps with custom form field props\r\n */\r\nexport interface ITimeClockFieldProps\r\n extends Omit<\r\n TimeClockProps<TimeView>,\r\n 'value' | 'onChange' | 'defaultValue' | 'slots' | 'slotProps' | 'view' | 'onViewChange'\r\n > {\r\n /** Field name for form identification */\r\n name?: string;\r\n /** Label text for the time clock */\r\n label?: React.ReactNode;\r\n /** Current selected time value */\r\n value: Date | null;\r\n /** Default time value */\r\n defaultValue?: Date | null;\r\n /** Error object with optional message */\r\n error?: FieldError;\r\n /** Helper text to display below time clock */\r\n helperText?: string;\r\n /** Whether the field is disabled */\r\n disabled?: boolean;\r\n /** Full width of the field */\r\n fullWidth?: boolean;\r\n /** Required field indicator */\r\n required?: boolean;\r\n /** Available views (hours, minutes, seconds) */\r\n views?: TimeView[];\r\n /** Whether to show AM/PM in the clock */\r\n ampmInClock?: boolean;\r\n /** Whether to use 12-hour format */\r\n ampm?: boolean;\r\n /** Whether to disable past times */\r\n disablePast?: boolean;\r\n /** Whether to disable future times */\r\n disableFuture?: boolean;\r\n /** Minimum selectable time */\r\n minTime?: Date;\r\n /** Maximum selectable time */\r\n maxTime?: Date;\r\n /** Function to disable specific times */\r\n shouldDisableTime?: (time: Date, view: TimeView) => boolean;\r\n /** Custom styles for the TimeClock */\r\n clockStyles?: TimeClockProps<TimeView>['sx'];\r\n /** Custom styles for FormControl */\r\n formControlStyles?: React.ComponentProps<typeof FormControl>['sx'];\r\n /** Custom styles for FormLabel */\r\n formLabelStyles?: FormLabelProps['sx'];\r\n /** Custom styles for the container Box */\r\n containerStyles?: React.ComponentProps<typeof Box>['sx'];\r\n /** Custom styles for the view buttons Stack */\r\n buttonsStackStyles?: React.ComponentProps<typeof Stack>['sx'];\r\n /** Custom styles for view buttons */\r\n buttonStyles?: ButtonProps['sx'];\r\n /** Custom styles for active view button */\r\n activeButtonStyles?: ButtonProps['sx'];\r\n /** Whether to show view selector buttons */\r\n showViewButtons?: boolean;\r\n /** Initial view */\r\n initialView?: TimeView;\r\n /** Controlled view state */\r\n view?: TimeView;\r\n /** Callback fired when the time changes */\r\n onChange?: (value: Date | null) => void;\r\n /** Callback fired when a view change is requested */\r\n onViewChange?: (view: TimeView) => void;\r\n /** Custom slot props for MUI v7 */\r\n slotProps?: TimeClockProps<TimeView>['slotProps'];\r\n /** Custom slots for MUI v7 */\r\n slots?: TimeClockProps<TimeView>['slots'];\r\n /** Date adapter to use (defaults to AdapterDateFns) */\r\n dateAdapter?: typeof AdapterDateFns;\r\n /** Auto focus */\r\n autoFocus?: boolean;\r\n}\r\n\r\nconst TimeClockField = forwardRef<HTMLDivElement, ITimeClockFieldProps>(\r\n (\r\n {\r\n name,\r\n label,\r\n value,\r\n defaultValue,\r\n onChange,\r\n error,\r\n helperText,\r\n disabled = false,\r\n fullWidth = false,\r\n required,\r\n views = ['hours', 'minutes'],\r\n ampmInClock = false,\r\n ampm = true,\r\n disablePast = false,\r\n disableFuture = false,\r\n minTime,\r\n maxTime,\r\n shouldDisableTime,\r\n clockStyles,\r\n formControlStyles,\r\n formLabelStyles,\r\n containerStyles,\r\n buttonsStackStyles,\r\n buttonStyles,\r\n activeButtonStyles,\r\n showViewButtons = true,\r\n initialView = 'hours',\r\n view: controlledView,\r\n onViewChange: controlledOnViewChange,\r\n slotProps,\r\n slots,\r\n dateAdapter = AdapterDateFns,\r\n autoFocus = false,\r\n ...timeClockProps\r\n },\r\n ref: ForwardedRef<HTMLDivElement>,\r\n ) => {\r\n // Internal view state (only used if view is not controlled)\r\n const [internalView, setInternalView] = useState<TimeView>(initialView);\r\n\r\n // Use controlled view if provided, otherwise use internal state\r\n const view = controlledView ?? internalView;\r\n const setView = controlledOnViewChange ?? setInternalView;\r\n\r\n // Handle onChange with proper typing\r\n const handleChange = (newValue: Date | null) => {\r\n if (onChange) {\r\n onChange(newValue);\r\n }\r\n };\r\n\r\n // Handle view change\r\n const handleViewChange = (newView: TimeView) => {\r\n setView(newView);\r\n };\r\n\r\n return (\r\n <FormControl error={!!error} disabled={disabled} required={required} fullWidth={fullWidth} sx={formControlStyles}>\r\n <Box\r\n ref={ref}\r\n sx={{\r\n ...containerStyles,\r\n }}\r\n mt={2}\r\n mb={2}\r\n >\r\n {showViewButtons && views && views.length > 1 && (\r\n <Stack\r\n direction=\"row\"\r\n justifyContent=\"center\"\r\n spacing={1}\r\n sx={{\r\n ...buttonsStackStyles,\r\n }}\r\n >\r\n {views.map((v) => (\r\n <Button\r\n key={v}\r\n size=\"small\"\r\n variant={view === v ? 'contained' : 'outlined'}\r\n onClick={() => handleViewChange(v)}\r\n disabled={disabled}\r\n sx={\r\n view === v\r\n ? {\r\n ...(buttonStyles as any),\r\n ...(activeButtonStyles as any),\r\n }\r\n : (buttonStyles as any)\r\n }\r\n >\r\n {v}\r\n </Button>\r\n ))}\r\n </Stack>\r\n )}\r\n <LocalizationProvider dateAdapter={dateAdapter}>\r\n <TimeClock\r\n {...timeClockProps}\r\n value={value}\r\n defaultValue={defaultValue}\r\n onChange={handleChange}\r\n view={view}\r\n onViewChange={handleViewChange}\r\n disabled={disabled}\r\n views={views}\r\n ampmInClock={ampmInClock}\r\n ampm={ampm}\r\n disablePast={disablePast}\r\n disableFuture={disableFuture}\r\n minTime={minTime}\r\n maxTime={maxTime}\r\n shouldDisableTime={shouldDisableTime}\r\n autoFocus={autoFocus}\r\n slotProps={slotProps}\r\n slots={slots}\r\n sx={clockStyles}\r\n />\r\n </LocalizationProvider>\r\n </Box>\r\n {error && (\r\n <FormHelperText sx={{ margin: '4px' }}>{helperText ?? (error?.message ? error.message : '')}</FormHelperText>\r\n )}\r\n {!error && helperText && <FormHelperText sx={{ margin: '4px' }}>{helperText}</FormHelperText>}\r\n </FormControl>\r\n );\r\n },\r\n);\r\n\r\nTimeClockField.displayName = 'TimeClockField';\r\n\r\nexport default TimeClockField;\r\n","import { Box, FormLabel } from \"@mui/material\";\r\nimport { memo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\nimport DateCalendarField from \"../FormFields/DateFields/DateCalendarField\";\r\nimport type { IFormInputDateFields } from \"./types\";\r\nimport React from \"react\";\r\nconst FormInputCalendar = memo(\r\n\t({\r\n\t\tname,\r\n\t\tlabel,\r\n\t\tcontrol,\r\n\t\treadOnly,\r\n\t\tdisabled,\r\n\t\tdefaultValue = null,\r\n\t\tonChange,\r\n\t\t...props\r\n\t}: IFormInputDateFields) => {\r\n\t\treturn (\r\n\t\t\t<Box\r\n\t\t\t\tsx={{\r\n\t\t\t\t\tborder: (t) => `1px solid ${t.palette.grey[600]}`,\r\n\t\t\t\t\tborderRadius: (t) => t.spacing(0.5),\r\n\t\t\t\t\tdisplay: \"flex\",\r\n\t\t\t\t\tflexDirection: \"column\",\r\n\t\t\t\t}}\r\n\t\t\t>\r\n\t\t\t\t<FormLabel\r\n\t\t\t\t\tsx={(t) => ({\r\n\t\t\t\t\t\tborderBottom: `1px solid ${t.palette.grey[600]}`,\r\n\t\t\t\t\t\tpadding: (t) => t.spacing(1),\r\n\t\t\t\t\t})}\r\n\t\t\t\t>\r\n\t\t\t\t\t{label}\r\n\t\t\t\t</FormLabel>\r\n\t\t\t\t<Controller\r\n\t\t\t\t\tname={name}\r\n\t\t\t\t\tcontrol={control}\r\n\t\t\t\t\tdefaultValue={defaultValue}\r\n\t\t\t\t\trender={({ field, fieldState: { error } }) => {\r\n\t\t\t\t\t\tconst { views, ...restProps } = props;\r\n\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t<DateCalendarField\r\n\t\t\t\t\t\t\t\t{...restProps}\r\n\t\t\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\t\t\tvalue={field.value ?? null}\r\n\t\t\t\t\t\t\t\tonChange={(newValue) => {\r\n\t\t\t\t\t\t\t\t\tfield.onChange(newValue);\r\n\t\t\t\t\t\t\t\t\tonChange?.(newValue);\r\n\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\t\t\t\treadOnly={readOnly}\r\n\t\t\t\t\t\t\t\terror={error}\r\n\t\t\t\t\t\t\t\thelperText={error?.message}\r\n\t\t\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\t\t\theight: \"300px\",\r\n\t\t\t\t\t\t\t\t\t...restProps.sx,\r\n\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}}\r\n\t\t\t\t/>\r\n\t\t\t</Box>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nFormInputCalendar.displayName = \"FormInputCalendar\";\r\n\r\nexport default FormInputCalendar;\r\n","import { Box, FormControl, FormHelperText, type FormLabelProps } from '@mui/material';\r\nimport { DateCalendar, type DateCalendarProps, LocalizationProvider } from '@mui/x-date-pickers';\r\nimport { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';\r\n\r\nimport React, { type ForwardedRef, forwardRef } from 'react';\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n message?: string;\r\n} | null;\r\n\r\n/**\r\n * Extended Date Calendar Field Props\r\n * Extends MUI DateCalendarProps with custom form field props\r\n */\r\nexport interface IDateCalendarFieldProps\r\n extends Omit<DateCalendarProps, 'value' | 'onChange' | 'defaultValue' | 'slots' | 'slotProps'> {\r\n /** Field name for form identification */\r\n name?: string;\r\n /** Label text for the calendar */\r\n label?: React.ReactNode;\r\n /** Current selected date value */\r\n value: Date | null;\r\n /** Default date value */\r\n defaultValue?: Date | null;\r\n /** Error object with optional message */\r\n error?: FieldError;\r\n /** Helper text to display below calendar */\r\n helperText?: string;\r\n /** Whether the field is disabled */\r\n disabled?: boolean;\r\n /** Full width of the field */\r\n fullWidth?: boolean;\r\n /** Required field indicator */\r\n required?: boolean;\r\n /** Minimum selectable date */\r\n minDate?: Date;\r\n /** Maximum selectable date */\r\n maxDate?: Date;\r\n /** Function to disable specific dates */\r\n shouldDisableDate?: (date: Date) => boolean;\r\n /** Function to disable specific months */\r\n shouldDisableMonth?: (month: Date) => boolean;\r\n /** Function to disable specific years */\r\n shouldDisableYear?: (year: Date) => boolean;\r\n /** Custom styles for the DateCalendar */\r\n calendarStyles?: DateCalendarProps['sx'];\r\n /** Custom styles for FormControl */\r\n formControlStyles?: React.ComponentProps<typeof FormControl>['sx'];\r\n /** Custom styles for FormLabel */\r\n formLabelStyles?: FormLabelProps['sx'];\r\n /** Custom styles for the container Box */\r\n containerStyles?: React.ComponentProps<typeof Box>['sx'];\r\n /** Callback fired when the date changes */\r\n onChange?: (value: Date | null) => void;\r\n /** Callback fired when a view change is requested */\r\n onViewChange?: (view: 'day' | 'month' | 'year') => void;\r\n /** Callback fired when a month change is requested */\r\n onMonthChange?: (month: Date) => void;\r\n /** Callback fired when a year change is requested */\r\n onYearChange?: (year: Date) => void;\r\n /** Custom slot props for MUI v7 */\r\n slotProps?: DateCalendarProps['slotProps'];\r\n /** Custom slots for MUI v7 */\r\n slots?: DateCalendarProps['slots'];\r\n /** Date adapter to use (defaults to AdapterDateFns) */\r\n dateAdapter?: typeof AdapterDateFns;\r\n /** Whether to show days outside current month */\r\n showDaysOutsideCurrentMonth?: boolean;\r\n /** Whether to disable past dates */\r\n disablePast?: boolean;\r\n /** Whether to disable future dates */\r\n disableFuture?: boolean;\r\n /** Reference date for the calendar */\r\n referenceDate?: Date;\r\n /** Controlled view state */\r\n view?: 'day' | 'month' | 'year';\r\n}\r\n\r\nconst DateCalendarField = forwardRef<HTMLDivElement, IDateCalendarFieldProps>(\r\n (\r\n {\r\n name,\r\n label,\r\n value,\r\n defaultValue,\r\n onChange,\r\n onViewChange,\r\n onMonthChange,\r\n onYearChange,\r\n error,\r\n helperText,\r\n disabled = false,\r\n fullWidth = false,\r\n required,\r\n minDate,\r\n maxDate,\r\n shouldDisableDate,\r\n shouldDisableMonth,\r\n shouldDisableYear,\r\n calendarStyles,\r\n formControlStyles,\r\n formLabelStyles,\r\n containerStyles,\r\n slotProps,\r\n slots,\r\n dateAdapter = AdapterDateFns,\r\n showDaysOutsideCurrentMonth = false,\r\n disablePast = false,\r\n disableFuture = false,\r\n referenceDate,\r\n view,\r\n ...dateCalendarProps\r\n },\r\n ref: ForwardedRef<HTMLDivElement>,\r\n ) => {\r\n // Handle onChange with proper typing\r\n const handleChange = (newValue: Date | null) => {\r\n if (onChange) {\r\n onChange(newValue);\r\n }\r\n };\r\n\r\n return (\r\n <FormControl error={!!error} disabled={disabled} required={required} fullWidth={fullWidth} sx={formControlStyles}>\r\n <Box\r\n ref={ref}\r\n sx={{\r\n ...containerStyles,\r\n }}\r\n >\r\n <LocalizationProvider dateAdapter={dateAdapter}>\r\n <DateCalendar\r\n {...dateCalendarProps}\r\n value={value}\r\n defaultValue={defaultValue}\r\n onChange={handleChange}\r\n onViewChange={onViewChange}\r\n onMonthChange={onMonthChange}\r\n onYearChange={onYearChange}\r\n disabled={disabled}\r\n minDate={minDate}\r\n maxDate={maxDate}\r\n shouldDisableDate={shouldDisableDate}\r\n shouldDisableMonth={shouldDisableMonth}\r\n shouldDisableYear={shouldDisableYear}\r\n showDaysOutsideCurrentMonth={showDaysOutsideCurrentMonth}\r\n disablePast={disablePast}\r\n disableFuture={disableFuture}\r\n referenceDate={referenceDate}\r\n view={view}\r\n slotProps={slotProps}\r\n slots={slots}\r\n sx={calendarStyles}\r\n />\r\n </LocalizationProvider>\r\n </Box>\r\n {error && (\r\n <FormHelperText sx={{ margin: '4px' }}>{helperText ?? (error?.message ? error.message : '')}</FormHelperText>\r\n )}\r\n {!error && helperText && <FormHelperText sx={{ margin: '4px' }}>{helperText}</FormHelperText>}\r\n </FormControl>\r\n );\r\n },\r\n);\r\n\r\nDateCalendarField.displayName = 'DateCalendarField';\r\n\r\nexport default DateCalendarField;\r\n","import { memo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\nimport CheckBoxField from \"../FormFields/BoxFields/CheckBoxField\";\r\nimport type { IFormInputFields } from \"./types\";\r\nimport React from \"react\";\r\nconst FormInputCheckBox = memo(\r\n\t({ name, label, control, defaultValue = false, onChange, ...props }: IFormInputFields) => {\r\n\t\treturn (\r\n\t\t\t<Controller\r\n\t\t\t\tname={name}\r\n\t\t\t\tcontrol={control}\r\n\t\t\t\tdefaultValue={defaultValue}\r\n\t\t\t\trender={({ field, fieldState: { error } }) => {\r\n\t\t\t\t\tconst { size, ...restProps } = props;\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<CheckBoxField\r\n\t\t\t\t\t\t\t{...restProps}\r\n\t\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\t\tlabel={label}\r\n\t\t\t\t\t\t\tvalue={field.value ?? false}\r\n\t\t\t\t\t\t\tonChange={(checked) => {\r\n\t\t\t\t\t\t\t\tfield.onChange(checked);\r\n\t\t\t\t\t\t\t\tonChange?.(checked);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tonBlur={field.onBlur}\r\n\t\t\t\t\t\t\tsize={size as any}\r\n\t\t\t\t\t\t\terror={error}\r\n\t\t\t\t\t\t\thelperText={error?.message}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t);\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nFormInputCheckBox.displayName = \"FormInputCheckBox\";\r\n\r\nexport default FormInputCheckBox;\r\n","import {\r\n\tCheckbox,\r\n\ttype CheckboxProps,\r\n\tFormControl,\r\n\tFormControlLabel,\r\n\ttype FormControlLabelProps,\r\n\tFormHelperText,\r\n} from \"@mui/material\";\r\nimport React, { type ChangeEvent } from \"react\";\r\nimport { type ForwardedRef, forwardRef } from \"react\";\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n\tmessage?: string;\r\n} | null;\r\n\r\n/**\r\n * Extended Checkbox Field Props\r\n * Extends MUI CheckboxProps with custom form field props\r\n */\r\nexport interface ICheckboxFieldProps extends Omit<CheckboxProps, \"checked\" | \"onChange\" | \"name\"> {\r\n\t/** Field name for form identification */\r\n\tname?: string;\r\n\t/** Label text for the checkbox */\r\n\tlabel?: React.ReactNode;\r\n\t/** Current checked state */\r\n\tvalue: boolean;\r\n\t/** Error object with optional message */\r\n\terror?: FieldError;\r\n\t/** Helper text to display below checkbox */\r\n\thelperText?: string;\r\n\t/** Whether the field is disabled */\r\n\tdisabled?: boolean;\r\n\t/** Checkbox color */\r\n\tcolor?: CheckboxProps[\"color\"];\r\n\t/** Checkbox size */\r\n\tsize?: CheckboxProps[\"size\"];\r\n\t/** Full width of the field */\r\n\tfullWidth?: boolean;\r\n\t/** Required field indicator */\r\n\trequired?: boolean;\r\n\t/** Label placement */\r\n\tlabelPlacement?: FormControlLabelProps[\"labelPlacement\"];\r\n\t/** Callback fired when the value changes */\r\n\tonChange?: (checked: boolean) => void;\r\n\t/** Callback fired when checkbox is clicked */\r\n\tonClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\r\n\t/** Callback fired when checkbox receives focus */\r\n\tonFocus?: CheckboxProps[\"onFocus\"];\r\n\t/** Callback fired when checkbox loses focus */\r\n\tonBlur?: CheckboxProps[\"onBlur\"];\r\n\t/** Custom icon for checked state */\r\n\tcheckedIcon?: React.ReactNode;\r\n\t/** Custom icon for unchecked state */\r\n\ticon?: React.ReactNode;\r\n\t/** Custom styles for the Checkbox */\r\n\tcheckboxStyles?: CheckboxProps[\"sx\"];\r\n\t/** Custom styles for FormControlLabel */\r\n\tlabelStyles?: FormControlLabelProps[\"sx\"];\r\n\t/** Custom styles for FormControl */\r\n\tformControlStyles?: React.ComponentProps<typeof FormControl>[\"sx\"];\r\n\t/** Indeterminate state */\r\n\tindeterminate?: boolean;\r\n\t/** Custom slot props for MUI v7 */\r\n\tslotProps?: CheckboxProps[\"slotProps\"];\r\n\t/** Custom slots for MUI v7 */\r\n\tslots?: CheckboxProps[\"slots\"];\r\n}\r\n\r\nconst CheckboxField = forwardRef<HTMLButtonElement, ICheckboxFieldProps>(\r\n\t(\r\n\t\t{\r\n\t\t\tname,\r\n\t\t\tlabel,\r\n\t\t\tvalue,\r\n\t\t\tonChange,\r\n\t\t\tonClick,\r\n\t\t\tonFocus,\r\n\t\t\tonBlur,\r\n\t\t\terror,\r\n\t\t\thelperText,\r\n\t\t\tdisabled = false,\r\n\t\t\tcolor = \"primary\",\r\n\t\t\tsize,\r\n\t\t\tfullWidth = false,\r\n\t\t\trequired,\r\n\t\t\tlabelPlacement = \"end\",\r\n\t\t\tcheckedIcon,\r\n\t\t\ticon,\r\n\t\t\tindeterminate = false,\r\n\t\t\tcheckboxStyles,\r\n\t\t\tlabelStyles,\r\n\t\t\tformControlStyles,\r\n\t\t\tslotProps,\r\n\t\t\tslots,\r\n\t\t\t...checkboxProps\r\n\t\t},\r\n\t\tref: ForwardedRef<HTMLButtonElement>\r\n\t) => {\r\n\t\t// Handle onChange with proper typing\r\n\t\tconst handleChange = (_event: ChangeEvent<HTMLInputElement>, checked: boolean) => {\r\n\t\t\tif (onChange) {\r\n\t\t\t\tonChange(checked);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Handle click event\r\n\t\tconst handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\r\n\t\t\tif (onClick) {\r\n\t\t\t\tonClick(event);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\treturn (\r\n\t\t\t<FormControl\r\n\t\t\t\terror={!!error}\r\n\t\t\t\tdisabled={disabled}\r\n\t\t\t\trequired={required}\r\n\t\t\t\tfullWidth={fullWidth}\r\n\t\t\t\tsize={size === \"large\" ? \"medium\" : size}\r\n\t\t\t\tsx={formControlStyles}\r\n\t\t\t>\r\n\t\t\t\t<FormControlLabel\r\n\t\t\t\t\tcontrol={\r\n\t\t\t\t\t\t<Checkbox\r\n\t\t\t\t\t\t\t{...checkboxProps}\r\n\t\t\t\t\t\t\tchecked={value}\r\n\t\t\t\t\t\t\tindeterminate={indeterminate}\r\n\t\t\t\t\t\t\tonChange={handleChange}\r\n\t\t\t\t\t\t\tonClick={handleClick}\r\n\t\t\t\t\t\t\tonFocus={onFocus}\r\n\t\t\t\t\t\t\tonBlur={onBlur}\r\n\t\t\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\t\t\tcolor={color}\r\n\t\t\t\t\t\t\tsize={size}\r\n\t\t\t\t\t\t\tcheckedIcon={checkedIcon}\r\n\t\t\t\t\t\t\ticon={icon}\r\n\t\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\t\tslotProps={slotProps}\r\n\t\t\t\t\t\t\tslots={slots}\r\n\t\t\t\t\t\t\tsx={checkboxStyles}\r\n\t\t\t\t\t\t\tref={ref}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlabel={label}\r\n\t\t\t\t\tlabelPlacement={labelPlacement}\r\n\t\t\t\t\tsx={labelStyles}\r\n\t\t\t\t/>\r\n\t\t\t\t{error && (\r\n\t\t\t\t\t<FormHelperText>{helperText ?? (error?.message ? error.message : \"\")}</FormHelperText>\r\n\t\t\t\t)}\r\n\t\t\t\t{!error && helperText && <FormHelperText>{helperText}</FormHelperText>}\r\n\t\t\t</FormControl>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nCheckboxField.displayName = \"CheckboxField\";\r\n\r\nexport default CheckboxField;\r\n","import { memo, useMemo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\nimport CheckBoxFieldGroup from \"../FormFields/BoxFields/CheckBoxFieldGroup\";\r\nimport type { IFormInputCheckBoxGroupFields } from \"./types\";\r\nimport React from \"react\";\r\nconst FormInputCheckBoxGroup = memo(\r\n\t({\r\n\t\tname,\r\n\t\tlabel,\r\n\t\tcontrol,\r\n\t\toptions = [],\r\n\t\tdefaultValue = [],\r\n\t\tonChange,\r\n\t\trow,\r\n\t\tcolor,\r\n\t\tlabelPlacement,\r\n\t\t...props\r\n\t}: IFormInputCheckBoxGroupFields) => {\r\n\t\t// Convert options to CheckboxOption format - memoized\r\n\t\tconst checkboxOptions = useMemo(\r\n\t\t\t() =>\r\n\t\t\t\toptions.map((option) => ({\r\n\t\t\t\t\tvalue: option.value,\r\n\t\t\t\t\tlabel: option.name,\r\n\t\t\t\t\tdisabled: option.disabled,\r\n\t\t\t\t})),\r\n\t\t\t[options]\r\n\t\t);\r\n\r\n\t\treturn (\r\n\t\t\t<Controller\r\n\t\t\t\tname={name}\r\n\t\t\t\tcontrol={control}\r\n\t\t\t\tdefaultValue={defaultValue}\r\n\t\t\t\trender={({ field, fieldState: { error } }) => {\r\n\t\t\t\t\tconst { size, ...restProps } = props;\r\n\t\t\t\t\tconst fieldValue = Array.isArray(field.value) ? field.value : [];\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<CheckBoxFieldGroup\r\n\t\t\t\t\t\t\t{...restProps}\r\n\t\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\t\tlabel={label}\r\n\t\t\t\t\t\t\tvalue={fieldValue}\r\n\t\t\t\t\t\t\toptions={checkboxOptions}\r\n\t\t\t\t\t\t\tonChange={(value) => {\r\n\t\t\t\t\t\t\t\tfield.onChange(value);\r\n\t\t\t\t\t\t\t\tonChange?.(value);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tonBlur={field.onBlur}\r\n\t\t\t\t\t\t\trow={row}\r\n\t\t\t\t\t\t\tcolor={color}\r\n\t\t\t\t\t\t\tlabelPlacement={labelPlacement}\r\n\t\t\t\t\t\t\tsize={size as any}\r\n\t\t\t\t\t\t\terror={error}\r\n\t\t\t\t\t\t\thelperText={error?.message}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t);\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nFormInputCheckBoxGroup.displayName = \"FormInputCheckBoxGroup\";\r\n\r\nexport default FormInputCheckBoxGroup;\r\n","import {\r\n Box,\r\n Checkbox,\r\n type CheckboxProps,\r\n FormControl,\r\n FormControlLabel,\r\n type FormControlLabelProps,\r\n type FormControlProps,\r\n FormHelperText,\r\n FormLabel,\r\n type FormLabelProps,\r\n type SxProps,\r\n type Theme\r\n} from \"@mui/material\";\r\nimport React, { type ChangeEvent, type FocusEvent, type ForwardedRef, forwardRef } from \"react\";\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n message?: string;\r\n} | null;\r\n\r\n/**\r\n * Checkbox option type\r\n */\r\nexport type CheckboxOption = {\r\n value: string | number;\r\n label: React.ReactNode;\r\n disabled?: boolean;\r\n};\r\n\r\n/**\r\n * Extended Checkbox Group Field Props\r\n */\r\nexport interface ICheckboxFieldGroupProps extends Omit<\r\n FormControlProps,\r\n \"error\" | \"disabled\" | \"required\" | \"fullWidth\" | \"color\" | \"size\" | \"onChange\" | \"onFocus\" | \"onBlur\" | \"onClick\"\r\n> {\r\n /** Field name for form identification */\r\n name?: string;\r\n /** Label text for the checkbox group */\r\n label?: React.ReactNode;\r\n /** Array of selected values */\r\n value: (string | number)[];\r\n /** Array of checkbox options */\r\n options: CheckboxOption[];\r\n /** Error object with optional message */\r\n error?: FieldError;\r\n /** Helper text to display below field */\r\n helperText?: string;\r\n /** Whether the field is disabled */\r\n disabled?: boolean;\r\n /** Full width of the field */\r\n fullWidth?: boolean;\r\n /** Required field indicator */\r\n required?: boolean;\r\n /** Checkbox color */\r\n color?: CheckboxProps[\"color\"];\r\n /** Checkbox size */\r\n size?: CheckboxProps[\"size\"];\r\n /** Label placement relative to checkbox */\r\n labelPlacement?: FormControlLabelProps[\"labelPlacement\"];\r\n /** Whether to display checkboxes in a row */\r\n row?: boolean;\r\n /** Custom icon for checked state */\r\n checkedIcon?: React.ReactNode;\r\n /** Custom icon for unchecked state */\r\n icon?: React.ReactNode;\r\n /** Custom styles for individual checkboxes */\r\n checkboxStyles?: CheckboxProps[\"sx\"];\r\n /** Custom styles for checkbox labels */\r\n labelStyles?: FormControlLabelProps[\"sx\"];\r\n /** Custom styles for FormControl */\r\n formControlStyles?: FormControlProps[\"sx\"];\r\n /** Custom styles for FormLabel */\r\n formLabelStyles?: FormLabelProps[\"sx\"];\r\n /** Callback fired when the value changes */\r\n onChange?: (value: (string | number)[]) => void;\r\n /** Callback fired when a checkbox receives focus */\r\n onFocus?: (event: FocusEvent<HTMLButtonElement>, value: string | number) => void;\r\n /** Callback fired when a checkbox loses focus */\r\n onBlur?: (event: FocusEvent<HTMLButtonElement>, value: string | number) => void;\r\n /** Callback fired when a checkbox is clicked */\r\n onClick?: (event: React.MouseEvent<HTMLButtonElement>, value: string | number) => void;\r\n /** Custom render function for checkboxes */\r\n renderCheckbox?: (\r\n option: CheckboxOption,\r\n index: number,\r\n isChecked: boolean,\r\n handleChange: (event: ChangeEvent<HTMLInputElement>) => void\r\n ) => React.ReactNode;\r\n /** Custom slot props for MUI v7 */\r\n slotProps?: {\r\n checkbox?: CheckboxProps[\"slotProps\"];\r\n formControlLabel?: FormControlLabelProps[\"slotProps\"];\r\n };\r\n /** Custom slots for MUI v7 */\r\n slots?: {\r\n checkbox?: CheckboxProps[\"slots\"];\r\n };\r\n /** FormLabel props */\r\n formLabelProps?: Omit<FormLabelProps, \"children\">;\r\n /** FormControlLabel props */\r\n formControlLabelProps?: Omit<FormControlLabelProps, \"control\" | \"label\" | \"value\">;\r\n /** xsProps */\r\n sxProps?: SxProps<Theme>;\r\n}\r\n\r\nconst CheckboxFieldGroup = forwardRef<HTMLDivElement, ICheckboxFieldGroupProps>(\r\n (\r\n {\r\n name,\r\n label,\r\n value,\r\n options,\r\n onChange,\r\n onFocus,\r\n onBlur,\r\n onClick,\r\n error,\r\n helperText,\r\n disabled = false,\r\n fullWidth = true,\r\n required,\r\n color = \"primary\",\r\n size,\r\n labelPlacement = \"end\",\r\n row = false,\r\n checkedIcon,\r\n icon,\r\n checkboxStyles,\r\n labelStyles,\r\n formControlStyles,\r\n renderCheckbox,\r\n slotProps,\r\n sxProps,\r\n slots,\r\n formLabelStyles,\r\n formLabelProps,\r\n formControlLabelProps,\r\n ...formControlProps\r\n },\r\n ref: ForwardedRef<HTMLDivElement>\r\n ) => {\r\n // Handle checkbox change\r\n const handleChange = (optionValue: string | number) => (event: ChangeEvent<HTMLInputElement>) => {\r\n if (disabled) {\r\n return;\r\n }\r\n\r\n const isChecked = event.target.checked;\r\n let newValue: (string | number)[];\r\n\r\n if (isChecked) {\r\n // Add to selection\r\n newValue = [...value, optionValue];\r\n } else {\r\n // Remove from selection\r\n newValue = value.filter((val) => val !== optionValue);\r\n }\r\n\r\n if (onChange) {\r\n onChange(newValue);\r\n }\r\n };\r\n\r\n // Handle focus\r\n const handleFocus = (optionValue: string | number) => (event: FocusEvent<HTMLButtonElement>) => {\r\n if (onFocus) {\r\n onFocus(event, optionValue);\r\n }\r\n };\r\n\r\n // Handle blur\r\n const handleBlur = (optionValue: string | number) => (event: FocusEvent<HTMLButtonElement>) => {\r\n if (onBlur) {\r\n onBlur(event, optionValue);\r\n }\r\n };\r\n\r\n // Handle click\r\n const handleClick = (optionValue: string | number) => (event: React.MouseEvent<HTMLButtonElement>) => {\r\n if (onClick) {\r\n onClick(event, optionValue);\r\n }\r\n };\r\n\r\n // Default render function for checkboxes\r\n const defaultRenderCheckbox = (\r\n option: CheckboxOption,\r\n index: number,\r\n isChecked: boolean,\r\n handleChangeFn: (event: ChangeEvent<HTMLInputElement>) => void\r\n ) => {\r\n return (\r\n <FormControlLabel\r\n key={`${option.value}-${index}`}\r\n control={\r\n <Checkbox\r\n name={name ? `${name}-${option.value}` : undefined}\r\n checked={isChecked}\r\n onChange={handleChangeFn}\r\n onFocus={handleFocus(option.value)}\r\n onBlur={handleBlur(option.value)}\r\n onClick={handleClick(option.value)}\r\n disabled={disabled || option.disabled}\r\n color={color}\r\n size={size}\r\n checkedIcon={checkedIcon}\r\n icon={icon}\r\n slotProps={slotProps?.checkbox}\r\n slots={slots?.checkbox}\r\n sx={checkboxStyles}\r\n />\r\n }\r\n label={option.label}\r\n labelPlacement={labelPlacement}\r\n slotProps={slotProps?.formControlLabel}\r\n sx={labelStyles}\r\n {...formControlLabelProps}\r\n />\r\n );\r\n };\r\n\r\n return (\r\n <FormControl\r\n {...(formControlProps as any)}\r\n error={!!error}\r\n disabled={disabled}\r\n required={required}\r\n fullWidth={fullWidth}\r\n component=\"fieldset\"\r\n sx={formControlStyles}\r\n >\r\n {label && (\r\n <FormLabel component=\"legend\" sx={formLabelStyles} {...formLabelProps}>\r\n {label}\r\n </FormLabel>\r\n )}\r\n <Box\r\n ref={ref}\r\n sx={{\r\n display: \"flex\",\r\n flexDirection: row ? \"row\" : \"column\",\r\n flexWrap: row ? \"wrap\" : \"nowrap\",\r\n gap: 1,\r\n mt: label ? 1 : 0,\r\n ...sxProps\r\n }}\r\n >\r\n {options.map((option, index) => {\r\n const isChecked = value.includes(option.value);\r\n const changeHandler = handleChange(option.value);\r\n\r\n if (renderCheckbox) {\r\n return renderCheckbox(option, index, isChecked, changeHandler);\r\n }\r\n\r\n return defaultRenderCheckbox(option, index, isChecked, changeHandler);\r\n })}\r\n </Box>\r\n {error && <FormHelperText>{helperText ?? (error?.message ? error.message : \"\")}</FormHelperText>}\r\n {!error && helperText && <FormHelperText>{helperText}</FormHelperText>}\r\n </FormControl>\r\n );\r\n }\r\n);\r\n\r\nCheckboxFieldGroup.displayName = \"CheckboxFieldGroup\";\r\n\r\nexport default CheckboxFieldGroup;\r\n","import { memo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\nimport SwitchField from \"../FormFields/BoxFields/SwitchField\";\r\nimport type { IFormInputFields } from \"./types\";\r\nimport React from \"react\";\r\nconst FormInputSwitch = memo(\r\n\t({ name, label, control, defaultValue = false, onChange, ...props }: IFormInputFields) => {\r\n\t\treturn (\r\n\t\t\t<Controller\r\n\t\t\t\tname={name}\r\n\t\t\t\tcontrol={control}\r\n\t\t\t\tdefaultValue={defaultValue}\r\n\t\t\t\trender={({ field, fieldState: { error } }) => {\r\n\t\t\t\t\tconst { size, ...restProps } = props;\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<SwitchField\r\n\t\t\t\t\t\t\t{...restProps}\r\n\t\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\t\tlabel={label}\r\n\t\t\t\t\t\t\tvalue={field.value ?? false}\r\n\t\t\t\t\t\t\tonChange={(checked) => {\r\n\t\t\t\t\t\t\t\tfield.onChange(checked);\r\n\t\t\t\t\t\t\t\tonChange?.(checked);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tonBlur={field.onBlur}\r\n\t\t\t\t\t\t\tsize={size as any}\r\n\t\t\t\t\t\t\terror={error}\r\n\t\t\t\t\t\t\thelperText={error?.message}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t);\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nFormInputSwitch.displayName = \"FormInputSwitch\";\r\n\r\nexport default FormInputSwitch;\r\n","import {\r\n\tFormControl,\r\n\ttype FormControlProps,\r\n\tFormControlLabel,\r\n\ttype FormControlLabelProps,\r\n\tFormHelperText,\r\n\tSwitch,\r\n\ttype SwitchProps,\r\n} from \"@mui/material\";\r\nimport React, { type ChangeEvent } from \"react\";\r\nimport { type ForwardedRef, forwardRef } from \"react\";\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n\tmessage?: string;\r\n} | null;\r\n\r\n/**\r\n * Extended Switch Field Props\r\n * Extends MUI SwitchProps with custom form field props\r\n */\r\nexport interface ISwitchFieldProps extends Omit<SwitchProps, \"checked\" | \"onChange\" | \"name\"> {\r\n\t/** Field name for form identification */\r\n\tname?: string;\r\n\t/** Label text for the switch */\r\n\tlabel?: React.ReactNode;\r\n\t/** Current checked state */\r\n\tvalue: boolean;\r\n\t/** Error object with optional message */\r\n\terror?: FieldError;\r\n\t/** Helper text to display below switch */\r\n\thelperText?: string;\r\n\t/** Whether the field is disabled */\r\n\tdisabled?: boolean;\r\n\t/** Switch color */\r\n\tcolor?: SwitchProps[\"color\"];\r\n\t/** Switch size */\r\n\tsize?: SwitchProps[\"size\"];\r\n\t/** Full width of the field */\r\n\tfullWidth?: boolean;\r\n\t/** Required field indicator */\r\n\trequired?: boolean;\r\n\t/** Label placement */\r\n\tlabelPlacement?: FormControlLabelProps[\"labelPlacement\"];\r\n\t/** Edge placement for the switch */\r\n\tedge?: SwitchProps[\"edge\"];\r\n\t/** Custom icon for checked state */\r\n\tcheckedIcon?: React.ReactNode;\r\n\t/** Custom icon for unchecked state */\r\n\ticon?: React.ReactNode;\r\n\t/** Custom styles for the Switch */\r\n\tswitchStyles?: SwitchProps[\"sx\"];\r\n\t/** Custom styles for FormControlLabel */\r\n\tlabelStyles?: FormControlLabelProps[\"sx\"];\r\n\t/** Custom styles for FormControl */\r\n\tformControlStyles?: FormControlProps[\"sx\"];\r\n\t/** Callback fired when the value changes */\r\n\tonChange?: (checked: boolean) => void;\r\n\t/** Callback fired when switch is clicked */\r\n\tonClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\r\n\t/** Callback fired when switch receives focus */\r\n\tonFocus?: SwitchProps[\"onFocus\"];\r\n\t/** Callback fired when switch loses focus */\r\n\tonBlur?: SwitchProps[\"onBlur\"];\r\n\t/** Custom slot props for MUI v7 */\r\n\tslotProps?: SwitchProps[\"slotProps\"];\r\n\t/** Custom slots for MUI v7 */\r\n\tslots?: SwitchProps[\"slots\"];\r\n\t/** FormControlLabel props */\r\n\tformControlLabelProps?: Omit<FormControlLabelProps, \"control\" | \"label\" | \"checked\">;\r\n}\r\n\r\nconst SwitchField = forwardRef<HTMLButtonElement, ISwitchFieldProps>(\r\n\t(\r\n\t\t{\r\n\t\t\tname,\r\n\t\t\tlabel,\r\n\t\t\tvalue,\r\n\t\t\tonChange,\r\n\t\t\tonClick,\r\n\t\t\tonFocus,\r\n\t\t\tonBlur,\r\n\t\t\terror,\r\n\t\t\thelperText,\r\n\t\t\tdisabled = false,\r\n\t\t\tcolor = \"primary\",\r\n\t\t\tsize,\r\n\t\t\tfullWidth = false,\r\n\t\t\trequired,\r\n\t\t\tlabelPlacement = \"end\",\r\n\t\t\tedge,\r\n\t\t\tswitchStyles,\r\n\t\t\tlabelStyles,\r\n\t\t\tformControlStyles,\r\n\t\t\tslotProps,\r\n\t\t\tslots,\r\n\t\t\tformControlLabelProps,\r\n\t\t\t...switchProps\r\n\t\t},\r\n\t\tref: ForwardedRef<HTMLButtonElement>\r\n\t) => {\r\n\t\t// Handle onChange with proper typing\r\n\t\tconst handleChange = (_event: ChangeEvent<HTMLInputElement>, checked: boolean) => {\r\n\t\t\tif (onChange) {\r\n\t\t\t\tonChange(checked);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Handle click event\r\n\t\tconst handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\r\n\t\t\tif (onClick) {\r\n\t\t\t\tonClick(event);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tconst switchComponent = (\r\n\t\t\t// <Switch {...switchProps} />\r\n\t\t\t<Switch\r\n\t\t\t\t{...switchProps}\r\n\t\t\t\tchecked={value}\r\n\t\t\t\tonChange={handleChange}\r\n\t\t\t\tonClick={handleClick}\r\n\t\t\t\tonFocus={onFocus}\r\n\t\t\t\tonBlur={onBlur}\r\n\t\t\t\tdisabled={disabled}\r\n\t\t\t\tcolor={color}\r\n\t\t\t\tsize={size}\r\n\t\t\t\tedge={edge}\r\n\t\t\t\tname={name}\r\n\t\t\t\tslotProps={slotProps}\r\n\t\t\t\tslots={slots}\r\n\t\t\t\tsx={switchStyles}\r\n\t\t\t\tref={ref}\r\n\t\t\t/>\r\n\t\t);\r\n\r\n\t\t// If no label, just return the switch (matches standard MUI Switch)\r\n\t\tif (!label) {\r\n\t\t\treturn (\r\n\t\t\t\t<FormControl\r\n\t\t\t\t\terror={!!error}\r\n\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\trequired={required}\r\n\t\t\t\t\tfullWidth={fullWidth}\r\n\t\t\t\t\tsx={{\r\n\t\t\t\t\t\tdisplay: \"inline-flex\",\r\n\t\t\t\t\t\tflexDirection: \"column\",\r\n\t\t\t\t\t\t...formControlStyles,\r\n\t\t\t\t\t}}\r\n\t\t\t\t>\r\n\t\t\t\t\t{switchComponent}\r\n\t\t\t\t\t{(error || helperText) && (\r\n\t\t\t\t\t\t<FormHelperText\r\n\t\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\t\tmarginLeft: 0,\r\n\t\t\t\t\t\t\t\tmarginRight: 0,\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{error ? (helperText ?? (error?.message ? error.message : \"\")) : helperText}\r\n\t\t\t\t\t\t</FormHelperText>\r\n\t\t\t\t\t)}\r\n\t\t\t\t</FormControl>\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\t// With label, use FormControlLabel (standard MUI pattern)\r\n\t\treturn (\r\n\t\t\t<FormControl\r\n\t\t\t\terror={!!error}\r\n\t\t\t\tdisabled={disabled}\r\n\t\t\t\trequired={required}\r\n\t\t\t\tfullWidth={fullWidth}\r\n\t\t\t\tsize={size}\r\n\t\t\t\tsx={{\r\n\t\t\t\t\tdisplay: \"flex\",\r\n\t\t\t\t\tflexDirection: \"column\",\r\n\t\t\t\t\t...formControlStyles,\r\n\t\t\t\t}}\r\n\t\t\t>\r\n\t\t\t\t<FormControlLabel\r\n\t\t\t\t\tcontrol={switchComponent}\r\n\t\t\t\t\tlabel={label}\r\n\t\t\t\t\tlabelPlacement={labelPlacement}\r\n\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\tsx={labelStyles}\r\n\t\t\t\t\t{...formControlLabelProps}\r\n\t\t\t\t/>\r\n\t\t\t\t{(error || helperText) && (\r\n\t\t\t\t\t<FormHelperText\r\n\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\tmarginLeft: labelPlacement === \"start\" ? \"72px\" : 0,\r\n\t\t\t\t\t\t\tmarginRight: 0,\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t{error ? (helperText ?? (error?.message ? error.message : \"\")) : helperText}\r\n\t\t\t\t\t</FormHelperText>\r\n\t\t\t\t)}\r\n\t\t\t</FormControl>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nSwitchField.displayName = \"SwitchField\";\r\n\r\nexport default SwitchField;\r\n","import { memo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\nimport SliderField from \"../FormFields/BoxFields/SliderField\";\r\nimport type { IFormInputFields } from \"./types\";\r\nimport React from \"react\";\r\nconst FormInputSlider = memo(\r\n\t({ name, label, control, defaultValue = 0, onChange, ...props }: IFormInputFields) => {\r\n\t\treturn (\r\n\t\t\t<Controller\r\n\t\t\t\tname={name}\r\n\t\t\t\tcontrol={control}\r\n\t\t\t\tdefaultValue={defaultValue}\r\n\t\t\t\trender={({ field, fieldState: { error } }) => {\r\n\t\t\t\t\tconst { size, ...restProps } = props;\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<SliderField\r\n\t\t\t\t\t\t\t{...restProps}\r\n\t\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\t\tlabel={label}\r\n\t\t\t\t\t\t\tvalue={field.value ?? defaultValue}\r\n\t\t\t\t\t\t\tonChange={(value) => {\r\n\t\t\t\t\t\t\t\tfield.onChange(value);\r\n\t\t\t\t\t\t\t\tonChange?.(value);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tonBlur={field.onBlur}\r\n\t\t\t\t\t\t\tsize={size as any}\r\n\t\t\t\t\t\t\terror={error}\r\n\t\t\t\t\t\t\thelperText={error?.message}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t);\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nFormInputSlider.displayName = \"FormInputSlider\";\r\n\r\nexport default FormInputSlider;\r\n","import {\r\n\tFormControl,\r\n\ttype FormControlProps,\r\n\tFormHelperText,\r\n\tFormLabel,\r\n\ttype FormLabelProps,\r\n\tSlider,\r\n\ttype SliderProps,\r\n} from \"@mui/material\";\r\nimport React, { type SyntheticEvent } from \"react\";\r\nimport { type ForwardedRef, forwardRef } from \"react\";\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n\tmessage?: string;\r\n} | null;\r\n\r\n/**\r\n * Extended Slider Field Props\r\n * Extends MUI SliderProps with custom form field props\r\n */\r\nexport interface ISliderFieldProps\r\n\textends Omit<SliderProps, \"value\" | \"onChange\" | \"onChangeCommitted\" | \"name\" | \"orientation\"> {\r\n\t/** Field name for form identification */\r\n\tname?: string;\r\n\t/** Label text for the slider */\r\n\tlabel?: React.ReactNode;\r\n\t/** Current slider value(s) */\r\n\tvalue: number | number[];\r\n\t/** Error object with optional message */\r\n\terror?: FieldError;\r\n\t/** Helper text to display below slider */\r\n\thelperText?: string;\r\n\t/** Whether the field is disabled */\r\n\tdisabled?: boolean;\r\n\t/** Full width of the field */\r\n\tfullWidth?: boolean;\r\n\t/** Required field indicator */\r\n\trequired?: boolean;\r\n\t/** Slider orientation - horizontal or vertical */\r\n\torientation?: \"horizontal\" | \"vertical\";\r\n\t/** Minimum value (default: 0) */\r\n\tmin?: number;\r\n\t/** Maximum value (default: 100) */\r\n\tmax?: number;\r\n\t/** Step value (default: 1) */\r\n\tstep?: number | null;\r\n\t/** Whether to show value label */\r\n\tvalueLabelDisplay?: SliderProps[\"valueLabelDisplay\"];\r\n\t/** Custom format for value label */\r\n\tvalueLabelFormat?: SliderProps[\"valueLabelFormat\"];\r\n\t/** Slider color */\r\n\tcolor?: SliderProps[\"color\"];\r\n\t/** Slider size */\r\n\tsize?: SliderProps[\"size\"];\r\n\t/** Marks on the slider */\r\n\tmarks?: boolean | SliderProps[\"marks\"];\r\n\t/** Track display mode */\r\n\ttrack?: SliderProps[\"track\"];\r\n\t/** Custom styles for the Slider */\r\n\tsliderStyles?: SliderProps[\"sx\"];\r\n\t/** Custom styles for FormControl */\r\n\tformControlStyles?: FormControlProps[\"sx\"];\r\n\t/** Custom styles for FormLabel */\r\n\tformLabelStyles?: FormLabelProps[\"sx\"];\r\n\t/** Callback fired when the value changes (during drag) */\r\n\tonChange?: (value: number | number[]) => void;\r\n\t/** Callback fired when the value change is committed (on mouse up) */\r\n\tonChangeCommitted?: (value: number | number[]) => void;\r\n\t/** Callback fired when slider receives focus */\r\n\tonFocus?: (event: SyntheticEvent) => void;\r\n\t/** Callback fired when slider loses focus */\r\n\tonBlur?: (event: SyntheticEvent) => void;\r\n\t/** Custom slot props for MUI v7 */\r\n\tslotProps?: SliderProps[\"slotProps\"];\r\n\t/** Custom slots for MUI v7 */\r\n\tslots?: SliderProps[\"slots\"];\r\n\t/** FormLabel props */\r\n\tformLabelProps?: Omit<FormLabelProps, \"children\">;\r\n}\r\n\r\nconst SliderField = forwardRef<HTMLSpanElement, ISliderFieldProps>(\r\n\t(\r\n\t\t{\r\n\t\t\tname,\r\n\t\t\tlabel,\r\n\t\t\tvalue,\r\n\t\t\tonChange,\r\n\t\t\tonChangeCommitted,\r\n\t\t\tonFocus,\r\n\t\t\tonBlur,\r\n\t\t\terror,\r\n\t\t\thelperText,\r\n\t\t\tdisabled = false,\r\n\t\t\tfullWidth = true,\r\n\t\t\trequired,\r\n\t\t\torientation = \"horizontal\",\r\n\t\t\tmin = 0,\r\n\t\t\tmax = 100,\r\n\t\t\tstep = 1,\r\n\t\t\tvalueLabelDisplay = \"auto\",\r\n\t\t\tvalueLabelFormat,\r\n\t\t\tcolor = \"primary\",\r\n\t\t\tsize,\r\n\t\t\tmarks,\r\n\t\t\ttrack = \"normal\",\r\n\t\t\tsliderStyles,\r\n\t\t\tformControlStyles,\r\n\t\t\tformLabelStyles,\r\n\t\t\tslotProps,\r\n\t\t\tslots,\r\n\t\t\tformLabelProps,\r\n\t\t\t...sliderProps\r\n\t\t},\r\n\t\tref: ForwardedRef<HTMLSpanElement>\r\n\t) => {\r\n\t\t// Handle onChange with proper typing\r\n\t\tconst handleChange = (_event: Event, newValue: number | number[], _activeThumb: number) => {\r\n\t\t\tif (onChange) {\r\n\t\t\t\tonChange(newValue);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Handle onChangeCommitted with proper typing\r\n\t\tconst handleChangeCommitted = (_event: Event | SyntheticEvent, newValue: number | number[]) => {\r\n\t\t\tif (onChangeCommitted) {\r\n\t\t\t\tonChangeCommitted(newValue);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// For vertical sliders, we need special handling\r\n\t\tconst isVertical = orientation === \"vertical\";\r\n\r\n\t\treturn (\r\n\t\t\t<FormControl\r\n\t\t\t\terror={!!error}\r\n\t\t\t\tdisabled={disabled}\r\n\t\t\t\trequired={required}\r\n\t\t\t\tfullWidth={fullWidth && !isVertical}\r\n\t\t\t\tsx={{\r\n\t\t\t\t\t...formControlStyles,\r\n\t\t\t\t\t...(isVertical && {\r\n\t\t\t\t\t\tdisplay: \"flex\",\r\n\t\t\t\t\t\tflexDirection: \"column\",\r\n\t\t\t\t\t\talignItems: \"flex-start\",\r\n\t\t\t\t\t\theight: \"100%\",\r\n\t\t\t\t\t\twidth: \"auto\",\r\n\t\t\t\t\t}),\r\n\t\t\t\t}}\r\n\t\t\t>\r\n\t\t\t\t{label && (\r\n\t\t\t\t\t<FormLabel\r\n\t\t\t\t\t\tsx={formLabelStyles}\r\n\t\t\t\t\t\t{...formLabelProps}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t{label}\r\n\t\t\t\t\t</FormLabel>\r\n\t\t\t\t)}\r\n\t\t\t\t<Slider\r\n\t\t\t\t\t{...sliderProps}\r\n\t\t\t\t\tname={name}\r\n\t\t\t\t\tvalue={value}\r\n\t\t\t\t\tonChange={handleChange}\r\n\t\t\t\t\tonChangeCommitted={handleChangeCommitted}\r\n\t\t\t\t\tonFocus={onFocus}\r\n\t\t\t\t\tonBlur={onBlur}\r\n\t\t\t\t\torientation={orientation}\r\n\t\t\t\t\tmin={min}\r\n\t\t\t\t\tmax={max}\r\n\t\t\t\t\tstep={step}\r\n\t\t\t\t\tvalueLabelDisplay={valueLabelDisplay}\r\n\t\t\t\t\tvalueLabelFormat={valueLabelFormat}\r\n\t\t\t\t\tcolor={color}\r\n\t\t\t\t\tsize={size}\r\n\t\t\t\t\tmarks={marks === true ? true : marks || false}\r\n\t\t\t\t\ttrack={track}\r\n\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\tslotProps={slotProps}\r\n\t\t\t\t\tslots={slots}\r\n\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t...sliderStyles,\r\n\t\t\t\t\t\t...(isVertical && {\r\n\t\t\t\t\t\t\theight: \"100%\",\r\n\t\t\t\t\t\t\t\"& .MuiSlider-track\": {\r\n\t\t\t\t\t\t\t\twidth: \"6px\",\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\"& .MuiSlider-rail\": {\r\n\t\t\t\t\t\t\t\twidth: \"6px\",\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t}),\r\n\t\t\t\t\t}}\r\n\t\t\t\t\tref={ref}\r\n\t\t\t\t/>\r\n\t\t\t\t{error && (\r\n\t\t\t\t\t<FormHelperText>{helperText ?? (error?.message ? error.message : \"\")}</FormHelperText>\r\n\t\t\t\t)}\r\n\t\t\t\t{!error && helperText && <FormHelperText>{helperText}</FormHelperText>}\r\n\t\t\t</FormControl>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nSliderField.displayName = \"SliderField\";\r\n\r\nexport default SliderField;\r\n","import { memo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\nimport RadioButtonField from \"../FormFields/BoxFields/RadioButtonField\";\r\nimport type { IFormInputRadioFields } from \"./types\";\r\nimport React from \"react\";\r\nconst FormInputRadioButton = memo(\r\n\t({\r\n\t\tname,\r\n\t\tlabel,\r\n\t\tcontrol,\r\n\t\tchecked = false,\r\n\t\tdefaultValue = false,\r\n\t\tonChange,\r\n\t\tcolor,\r\n\t\tlabelPlacement,\r\n\t\t...props\r\n\t}: IFormInputRadioFields) => {\r\n\t\treturn (\r\n\t\t\t<Controller\r\n\t\t\t\tname={name}\r\n\t\t\t\tcontrol={control}\r\n\t\t\t\tdefaultValue={defaultValue}\r\n\t\t\t\trender={({ field, fieldState: { error } }) => {\r\n\t\t\t\t\tconst { size, ...restProps } = props;\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<RadioButtonField\r\n\t\t\t\t\t\t\t{...restProps}\r\n\t\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\t\tlabel={label}\r\n\t\t\t\t\t\t\tvalue={field.value ?? false}\r\n\t\t\t\t\t\t\tonChange={(checkedValue) => {\r\n\t\t\t\t\t\t\t\tfield.onChange(checkedValue);\r\n\t\t\t\t\t\t\t\tonChange?.(checkedValue);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tonBlur={field.onBlur}\r\n\t\t\t\t\t\t\tcolor={color}\r\n\t\t\t\t\t\t\tlabelPlacement={labelPlacement}\r\n\t\t\t\t\t\t\tsize={size as any}\r\n\t\t\t\t\t\t\terror={error}\r\n\t\t\t\t\t\t\thelperText={error?.message}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t);\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nFormInputRadioButton.displayName = \"FormInputRadioButton\";\r\n\r\nexport default FormInputRadioButton;\r\n","import {\r\n\tFormControl,\r\n\tFormControlLabel,\r\n\ttype FormControlLabelProps,\r\n\tFormHelperText,\r\n\tRadio,\r\n\ttype RadioProps,\r\n} from \"@mui/material\";\r\nimport React, { type ChangeEvent } from \"react\";\r\nimport { type ForwardedRef, forwardRef } from \"react\";\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n\tmessage?: string;\r\n} | null;\r\n\r\n/**\r\n * Extended Radio Button Field Props\r\n * Extends MUI RadioProps with custom form field props\r\n */\r\nexport interface IRadioButtonFieldProps extends Omit<RadioProps, \"checked\" | \"onChange\" | \"name\"> {\r\n\t/** Field name for form identification */\r\n\tname?: string;\r\n\t/** Label text for the radio button */\r\n\tlabel?: React.ReactNode;\r\n\t/** Current checked state */\r\n\tvalue: boolean;\r\n\t/** Error object with optional message */\r\n\terror?: FieldError;\r\n\t/** Helper text to display below radio button */\r\n\thelperText?: string;\r\n\t/** Whether the field is disabled */\r\n\tdisabled?: boolean;\r\n\t/** Radio color */\r\n\tcolor?: RadioProps[\"color\"];\r\n\t/** Radio size */\r\n\tsize?: RadioProps[\"size\"];\r\n\t/** Full width of the field */\r\n\tfullWidth?: boolean;\r\n\t/** Required field indicator */\r\n\trequired?: boolean;\r\n\t/** Label placement */\r\n\tlabelPlacement?: FormControlLabelProps[\"labelPlacement\"];\r\n\t/** Callback fired when the value changes */\r\n\tonChange?: (checked: boolean) => void;\r\n\t/** Callback fired when radio button is clicked */\r\n\tonClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\r\n\t/** Callback fired when radio button receives focus */\r\n\tonFocus?: RadioProps[\"onFocus\"];\r\n\t/** Callback fired when radio button loses focus */\r\n\tonBlur?: RadioProps[\"onBlur\"];\r\n\t/** Custom icon for checked state */\r\n\tcheckedIcon?: React.ReactNode;\r\n\t/** Custom icon for unchecked state */\r\n\ticon?: React.ReactNode;\r\n\t/** Custom styles for the Radio */\r\n\tradioStyles?: RadioProps[\"sx\"];\r\n\t/** Custom styles for FormControlLabel */\r\n\tlabelStyles?: FormControlLabelProps[\"sx\"];\r\n\t/** Custom styles for FormControl */\r\n\tformControlStyles?: React.ComponentProps<typeof FormControl>[\"sx\"];\r\n\t/** Custom slot props for MUI v7 */\r\n\tslotProps?: RadioProps[\"slotProps\"];\r\n\t/** Custom slots for MUI v7 */\r\n\tslots?: RadioProps[\"slots\"];\r\n\t/** FormControlLabel props */\r\n\tformControlLabelProps?: Omit<FormControlLabelProps, \"control\" | \"label\" | \"value\">;\r\n}\r\n\r\nconst RadioButtonField = forwardRef<HTMLButtonElement, IRadioButtonFieldProps>(\r\n\t(\r\n\t\t{\r\n\t\t\tname,\r\n\t\t\tlabel,\r\n\t\t\tvalue,\r\n\t\t\tonChange,\r\n\t\t\tonClick,\r\n\t\t\tonFocus,\r\n\t\t\tonBlur,\r\n\t\t\terror,\r\n\t\t\thelperText,\r\n\t\t\tdisabled = false,\r\n\t\t\tcolor = \"primary\",\r\n\t\t\tsize,\r\n\t\t\tfullWidth = false,\r\n\t\t\trequired,\r\n\t\t\tlabelPlacement = \"end\",\r\n\t\t\tcheckedIcon,\r\n\t\t\ticon,\r\n\t\t\tradioStyles,\r\n\t\t\tlabelStyles,\r\n\t\t\tformControlStyles,\r\n\t\t\tslotProps,\r\n\t\t\tslots,\r\n\t\t\tformControlLabelProps,\r\n\t\t\t...radioProps\r\n\t\t},\r\n\t\tref: ForwardedRef<HTMLButtonElement>\r\n\t) => {\r\n\t\t// Handle onChange with proper typing\r\n\t\tconst handleChange = (_event: ChangeEvent<HTMLInputElement>, checked: boolean) => {\r\n\t\t\tif (onChange) {\r\n\t\t\t\tonChange(checked);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Handle click event\r\n\t\tconst handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\r\n\t\t\tif (onClick) {\r\n\t\t\t\tonClick(event);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\treturn (\r\n\t\t\t<FormControl\r\n\t\t\t\terror={!!error}\r\n\t\t\t\tdisabled={disabled}\r\n\t\t\t\trequired={required}\r\n\t\t\t\tfullWidth={fullWidth}\r\n\t\t\t\tsize={size}\r\n\t\t\t\tsx={formControlStyles}\r\n\t\t\t>\r\n\t\t\t\t<FormControlLabel\r\n\t\t\t\t\tcontrol={\r\n\t\t\t\t\t\t<Radio\r\n\t\t\t\t\t\t\t{...radioProps}\r\n\t\t\t\t\t\t\tchecked={value}\r\n\t\t\t\t\t\t\tonChange={handleChange}\r\n\t\t\t\t\t\t\tonClick={handleClick}\r\n\t\t\t\t\t\t\tonFocus={onFocus}\r\n\t\t\t\t\t\t\tonBlur={onBlur}\r\n\t\t\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\t\t\tcolor={color}\r\n\t\t\t\t\t\t\tsize={size}\r\n\t\t\t\t\t\t\tcheckedIcon={checkedIcon}\r\n\t\t\t\t\t\t\ticon={icon}\r\n\t\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\t\tslotProps={slotProps}\r\n\t\t\t\t\t\t\tslots={slots}\r\n\t\t\t\t\t\t\tsx={radioStyles}\r\n\t\t\t\t\t\t\tref={ref}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlabel={label}\r\n\t\t\t\t\tlabelPlacement={labelPlacement}\r\n\t\t\t\t\tsx={labelStyles}\r\n\t\t\t\t\t{...formControlLabelProps}\r\n\t\t\t\t/>\r\n\t\t\t\t{error && (\r\n\t\t\t\t\t<FormHelperText>{helperText ?? (error?.message ? error.message : \"\")}</FormHelperText>\r\n\t\t\t\t)}\r\n\t\t\t\t{!error && helperText && <FormHelperText>{helperText}</FormHelperText>}\r\n\t\t\t</FormControl>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nRadioButtonField.displayName = \"RadioButtonField\";\r\n\r\nexport default RadioButtonField;\r\n","import { memo, useMemo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\nimport RadioButtonFieldGroup from \"../FormFields/BoxFields/RadioButtonFieldGroup\";\r\nimport type { IFormInputFieldsWithOptions } from \"./types\";\r\nimport React from \"react\";\r\nconst FormInputRadioButtonGroup = memo(\r\n\t({\r\n\t\tname,\r\n\t\tlabel,\r\n\t\tcontrol,\r\n\t\toptions = [],\r\n\t\tdefaultValue = \"\",\r\n\t\tonChange,\r\n\t\t...props\r\n\t}: IFormInputFieldsWithOptions) => {\r\n\t\tconst memoizedOptions = useMemo(() => (Array.isArray(options) ? options : []), [options]);\r\n\r\n\t\treturn (\r\n\t\t\t<Controller\r\n\t\t\t\tname={name}\r\n\t\t\t\tcontrol={control}\r\n\t\t\t\tdefaultValue={defaultValue}\r\n\t\t\t\trender={({ field, fieldState: { error } }) => {\r\n\t\t\t\t\tconst { size, ...restProps } = props;\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<RadioButtonFieldGroup\r\n\t\t\t\t\t\t\t{...restProps}\r\n\t\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\t\tlabel={label}\r\n\t\t\t\t\t\t\tvalue={field.value ?? \"\"}\r\n\t\t\t\t\t\t\tonChange={(value) => {\r\n\t\t\t\t\t\t\t\tfield.onChange(value);\r\n\t\t\t\t\t\t\t\tonChange?.(value);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tonBlur={field.onBlur}\r\n\t\t\t\t\t\t\toptions={memoizedOptions}\r\n\t\t\t\t\t\t\tsize={size as any}\r\n\t\t\t\t\t\t\terror={error}\r\n\t\t\t\t\t\t\thelperText={error?.message}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t);\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nFormInputRadioButtonGroup.displayName = \"FormInputRadioButtonGroup\";\r\n\r\nexport default FormInputRadioButtonGroup;\r\n","import {\r\n\tFormControl,\r\n\tFormControlLabel,\r\n\ttype FormControlLabelProps,\r\n\ttype FormControlProps,\r\n\tFormHelperText,\r\n\tFormLabel,\r\n\ttype FormLabelProps,\r\n\tRadio,\r\n\tRadioGroup,\r\n\ttype RadioGroupProps,\r\n\ttype RadioProps,\r\n\ttype SxProps,\r\n\ttype Theme,\r\n} from \"@mui/material\";\r\nimport React, { type ChangeEvent, type ForwardedRef, forwardRef } from \"react\";\r\n\r\n/**\r\n * Base option type for Radio Button Group\r\n */\r\nexport type RadioOption = {\r\n\tname: string;\r\n\tvalue: string | number;\r\n\tdisabled?: boolean;\r\n\t[key: string]: unknown;\r\n};\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n\tmessage?: string;\r\n} | null;\r\n\r\n/**\r\n * Extended Radio Button Group Props\r\n * Extends MUI RadioGroupProps with custom form field props\r\n */\r\nexport interface IRadioButtonGroupFieldProps\r\n\textends Omit<\r\n\t\tRadioGroupProps,\r\n\t\t\"value\" | \"onChange\" | \"name\" | \"children\" | \"onFocus\" | \"onBlur\" | \"onClick\"\r\n\t> {\r\n\t/** Field name for form identification */\r\n\tname?: string;\r\n\t/** Label text for the radio group */\r\n\tlabel?: React.ReactNode;\r\n\t/** Current selected value */\r\n\tvalue: string | number | null | undefined;\r\n\t/** Options array to display as radio buttons */\r\n\toptions: RadioOption[];\r\n\t/** Error object with optional message */\r\n\terror?: FieldError;\r\n\t/** Helper text to display below radio group */\r\n\thelperText?: string;\r\n\t/** Whether the field is disabled */\r\n\tdisabled?: boolean;\r\n\t/** Radio color */\r\n\tcolor?: RadioProps[\"color\"];\r\n\t/** Radio size */\r\n\tsize?: RadioProps[\"size\"];\r\n\t/** Full width of the field */\r\n\tfullWidth?: boolean;\r\n\t/** Required field indicator */\r\n\trequired?: boolean;\r\n\t/** Label placement for each radio button */\r\n\tlabelPlacement?: FormControlLabelProps[\"labelPlacement\"];\r\n\t/** Row layout (horizontal) or column layout (vertical) */\r\n\trow?: boolean;\r\n\t/** Custom icon for checked state */\r\n\tcheckedIcon?: React.ReactNode;\r\n\t/** Custom icon for unchecked state */\r\n\ticon?: React.ReactNode;\r\n\t/** Custom styles for individual Radio components */\r\n\tradioStyles?: RadioProps[\"sx\"];\r\n\t/** Custom styles for FormControlLabel components */\r\n\tlabelStyles?: FormControlLabelProps[\"sx\"];\r\n\t/** Custom styles for FormControl */\r\n\tformControlStyles?: FormControlProps[\"sx\"];\r\n\t/** Custom styles for FormLabel */\r\n\tformLabelStyles?: FormLabelProps[\"sx\"];\r\n\t/** Custom styles for RadioGroup */\r\n\tradioGroupStyles?: RadioGroupProps[\"sx\"];\r\n\t/** Custom render function for radio buttons */\r\n\trenderRadio?: (option: RadioOption, index: number) => React.ReactNode;\r\n\t/** Callback fired when the value changes */\r\n\tonChange?: (value: string | number) => void;\r\n\t/** Callback fired when a radio button is clicked */\r\n\tonClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\r\n\t/** Callback fired when a radio button receives focus */\r\n\tonFocus?: RadioProps[\"onFocus\"];\r\n\t/** Callback fired when a radio button loses focus */\r\n\tonBlur?: RadioProps[\"onBlur\"];\r\n\t/** Custom slot props for MUI v7 */\r\n\tslotProps?: {\r\n\t\tradio?: RadioProps[\"slotProps\"];\r\n\t\tformControlLabel?: FormControlLabelProps[\"slotProps\"];\r\n\t};\r\n\t/** Custom slots for MUI v7 */\r\n\tslots?: {\r\n\t\tradio?: RadioProps[\"slots\"];\r\n\t\tformControlLabel?: FormControlLabelProps[\"slots\"];\r\n\t};\r\n\t/** FormLabel props */\r\n\tformLabelProps?: Omit<FormLabelProps, \"children\">;\r\n\t/** FormControlLabel props */\r\n\tformControlLabelProps?: Omit<FormControlLabelProps, \"control\" | \"label\" | \"value\">;\r\n\t/** Custom styles for RadioGroup */\r\n\tsxProps?: SxProps<Theme>;\r\n}\r\n\r\nconst RadioButtonFieldGroup = forwardRef<HTMLDivElement, IRadioButtonGroupFieldProps>(\r\n\t(\r\n\t\t{\r\n\t\t\tname,\r\n\t\t\tlabel,\r\n\t\t\tvalue,\r\n\t\t\tonChange,\r\n\t\t\tonClick,\r\n\t\t\tonFocus,\r\n\t\t\tonBlur,\r\n\t\t\toptions,\r\n\t\t\terror,\r\n\t\t\thelperText,\r\n\t\t\tdisabled = false,\r\n\t\t\tcolor = \"primary\",\r\n\t\t\tsize,\r\n\t\t\tfullWidth = false,\r\n\t\t\trequired,\r\n\t\t\tlabelPlacement = \"end\",\r\n\t\t\trow = false,\r\n\t\t\tcheckedIcon,\r\n\t\t\ticon,\r\n\t\t\tradioStyles,\r\n\t\t\tlabelStyles,\r\n\t\t\tformControlStyles,\r\n\t\t\tformLabelStyles,\r\n\t\t\trenderRadio,\r\n\t\t\tsxProps,\r\n\t\t\tslotProps,\r\n\t\t\tslots,\r\n\t\t\tformLabelProps,\r\n\t\t\tformControlLabelProps,\r\n\t\t\t...radioGroupProps\r\n\t\t},\r\n\t\tref: ForwardedRef<HTMLDivElement>\r\n\t) => {\r\n\t\t// Handle onChange with proper typing\r\n\t\tconst handleChange = (event: ChangeEvent<HTMLInputElement>) => {\r\n\t\t\tconst newValue = event.target.value;\r\n\t\t\t// Convert to number if the value matches a numeric option\r\n\t\t\tconst numericValue = options.find((opt) => String(opt.value) === newValue)?.value;\r\n\t\t\tconst finalValue = typeof numericValue === \"number\" ? numericValue : newValue;\r\n\t\t\tif (onChange) {\r\n\t\t\t\tonChange(finalValue);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Handle click event\r\n\t\tconst handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\r\n\t\t\tif (onClick) {\r\n\t\t\t\tonClick(event);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Default render function for radio buttons\r\n\t\tconst defaultRenderRadio = (option: RadioOption) => (\r\n\t\t\t<FormControlLabel\r\n\t\t\t\tkey={option.value}\r\n\t\t\t\tvalue={String(option.value)}\r\n\t\t\t\tcontrol={\r\n\t\t\t\t\t<Radio\r\n\t\t\t\t\t\tcolor={color}\r\n\t\t\t\t\t\tsize={size}\r\n\t\t\t\t\t\tdisabled={disabled || option.disabled}\r\n\t\t\t\t\t\tcheckedIcon={checkedIcon}\r\n\t\t\t\t\t\ticon={icon}\r\n\t\t\t\t\t\tonClick={handleClick}\r\n\t\t\t\t\t\tonFocus={onFocus}\r\n\t\t\t\t\t\tonBlur={onBlur}\r\n\t\t\t\t\t\tslotProps={slotProps?.radio}\r\n\t\t\t\t\t\tslots={slots?.radio}\r\n\t\t\t\t\t\tsx={radioStyles}\r\n\t\t\t\t\t/>\r\n\t\t\t\t}\r\n\t\t\t\tlabel={option.name}\r\n\t\t\t\tlabelPlacement={labelPlacement}\r\n\t\t\t\tdisabled={disabled || option.disabled}\r\n\t\t\t\tsx={labelStyles}\r\n\t\t\t\t{...formControlLabelProps}\r\n\t\t\t\tslotProps={slotProps?.formControlLabel}\r\n\t\t\t\tslots={slots?.formControlLabel}\r\n\t\t\t/>\r\n\t\t);\r\n\r\n\t\treturn (\r\n\t\t\t<FormControl\r\n\t\t\t\tcomponent=\"fieldset\"\r\n\t\t\t\terror={!!error}\r\n\t\t\t\tdisabled={disabled}\r\n\t\t\t\trequired={required}\r\n\t\t\t\tfullWidth={fullWidth}\r\n\t\t\t\tsx={formControlStyles}\r\n\t\t\t>\r\n\t\t\t\t{label && (\r\n\t\t\t\t\t<FormLabel\r\n\t\t\t\t\t\tcomponent=\"legend\"\r\n\t\t\t\t\t\tsx={formLabelStyles}\r\n\t\t\t\t\t\t{...formLabelProps}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t{label}\r\n\t\t\t\t\t</FormLabel>\r\n\t\t\t\t)}\r\n\t\t\t\t<RadioGroup\r\n\t\t\t\t\tname={name}\r\n\t\t\t\t\tvalue={value !== null ? String(value) : \"\"}\r\n\t\t\t\t\tonChange={handleChange}\r\n\t\t\t\t\trow={row}\r\n\t\t\t\t\tref={ref}\r\n\t\t\t\t\tsx={sxProps}\r\n\t\t\t\t\t{...radioGroupProps}\r\n\t\t\t\t>\r\n\t\t\t\t\t{options &&\r\n\t\t\t\t\t\tArray.isArray(options) &&\r\n\t\t\t\t\t\toptions.map((option, index) =>\r\n\t\t\t\t\t\t\trenderRadio ? renderRadio(option, index) : defaultRenderRadio(option)\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t</RadioGroup>\r\n\t\t\t\t{error && (\r\n\t\t\t\t\t<FormHelperText>{helperText ?? (error?.message ? error.message : \"\")}</FormHelperText>\r\n\t\t\t\t)}\r\n\t\t\t\t{!error && helperText && <FormHelperText>{helperText}</FormHelperText>}\r\n\t\t\t</FormControl>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nRadioButtonFieldGroup.displayName = \"RadioButtonFieldGroup\";\r\n\r\nexport default RadioButtonFieldGroup;\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport { useState } from \"react\";\r\nimport { Box, Paper, Typography, Button, Divider } from \"@mui/material\";\r\n\r\n// Import all FormInputs (not HookFormFields)\r\nimport TextInputField from \"../FormFields/TextFields/TextInputField\";\r\nimport PasswordField from \"../FormFields/TextFields/PasswordField\";\r\nimport NumberField from \"../FormFields/TextFields/NumberField\";\r\nimport TelInputField from \"../FormFields/TextFields/TelInputField\";\r\nimport SearchInputField from \"../FormFields/TextFields/SearchInputField\";\r\nimport OTPField from \"../FormFields/TextFields/OTPField\";\r\nimport SelectInputField from \"../FormFields/DropdownFields/SelectInputField\";\r\nimport AutoCompleteField from \"../FormFields/DropdownFields/AutoCompleteField\";\r\nimport ColorPickerField from \"../FormFields/DropdownFields/ColorPickerField\";\r\nimport FileUploadField from \"../FormFields/DropdownFields/FileUploadField\";\r\nimport DatePickerField from \"../FormFields/DateFields/DatePickerField\";\r\nimport TimePickerField from \"../FormFields/DateFields/TimePickerField\";\r\nimport TimeClockField from \"../FormFields/DateFields/TimeClockField\";\r\nimport DateCalendarField from \"../FormFields/DateFields/DateCalendarField\";\r\nimport CheckBoxField from \"../FormFields/BoxFields/CheckBoxField\";\r\nimport CheckBoxFieldGroup from \"../FormFields/BoxFields/CheckBoxFieldGroup\";\r\nimport SwitchField from \"../FormFields/BoxFields/SwitchField\";\r\nimport SliderField from \"../FormFields/BoxFields/SliderField\";\r\nimport RadioButtonField from \"../FormFields/BoxFields/RadioButtonField\";\r\nimport RadioButtonFieldGroup from \"../FormFields/BoxFields/RadioButtonFieldGroup\";\r\n\r\nimport type { Option } from \"../HookFormFields/types\";\r\n\r\nconst NormalForm = () => {\r\n // Form state\r\n const [formData, setFormData] = useState({\r\n text: \"\",\r\n textarea: \"\",\r\n password: \"\",\r\n number: \"\",\r\n tel: \"\",\r\n search: \"\",\r\n otp: \"\",\r\n select: \"\",\r\n multiselect: [] as (string | number)[],\r\n autocomplete: null as Option | null,\r\n multiautocomplete: [] as Option[],\r\n color: \"#000000\",\r\n file: null as File | File[] | null,\r\n date: null as Date | null,\r\n time: null as Date | null,\r\n timeclock: null as Date | null,\r\n calendar: null as Date | null,\r\n checkbox: false,\r\n checkboxgroup: [] as (string | number)[],\r\n switch: false,\r\n slider: 0,\r\n singleradio: false,\r\n radiogroup: \"\",\r\n });\r\n\r\n const [errors, setErrors] = useState<Record<string, string>>({});\r\n\r\n // Options for dropdowns\r\n const selectOptions: Option[] = [\r\n { name: \"Option 1\", value: \"opt1\" },\r\n { name: \"Option 2\", value: \"opt2\" },\r\n { name: \"Option 3\", value: \"opt3\" },\r\n ];\r\n\r\n const checkboxOptions = [\r\n { value: \"check1\", label: \"Checkbox 1\" },\r\n { value: \"check2\", label: \"Checkbox 2\" },\r\n { value: \"check3\", label: \"Checkbox 3\" },\r\n ];\r\n\r\n const radioOptions = [\r\n { name: \"Radio 1\", value: \"radio1\" },\r\n { name: \"Radio 2\", value: \"radio2\" },\r\n { name: \"Radio 3\", value: \"radio3\" },\r\n ];\r\n\r\n const handleChange = (field: string) => (value: any) => {\r\n setFormData((prev) => ({ ...prev, [field]: value }));\r\n // Clear error when user types\r\n if (errors[field]) {\r\n setErrors((prev) => {\r\n const newErrors = { ...prev };\r\n delete newErrors[field];\r\n return newErrors;\r\n });\r\n }\r\n };\r\n\r\n const handleSubmit = (e: React.FormEvent) => {\r\n e.preventDefault();\r\n console.log(\"Normal Form Data:\", formData);\r\n // Simple validation\r\n const newErrors: Record<string, string> = {};\r\n if (!formData.text) newErrors.text = \"Text is required\";\r\n if (!formData.password) newErrors.password = \"Password is required\";\r\n setErrors(newErrors);\r\n };\r\n\r\n return (\r\n <Paper sx={{ p: 3, maxWidth: 1200, mx: \"auto\" }}>\r\n <Typography variant=\"h4\" gutterBottom>\r\n Normal Form (Direct FormInputs)\r\n </Typography>\r\n <Typography variant=\"body2\" color=\"text.secondary\" gutterBottom>\r\n Using FormInputs directly with useState\r\n </Typography>\r\n <Divider sx={{ my: 2 }} />\r\n\r\n <form onSubmit={handleSubmit}>\r\n <Box\r\n sx={{\r\n display: \"grid\",\r\n gridTemplateColumns: { xs: \"1fr\", md: \"repeat(3, 1fr)\" },\r\n gap: 2,\r\n }}\r\n >\r\n <Box sx={{ display: \"flex\", flexDirection: \"column\", gap: 1.5 }}>\r\n {/* Text Inputs */}\r\n <TextInputField\r\n name=\"text\"\r\n label=\"Text Field\"\r\n value={formData.text}\r\n onChange={(e) => handleChange(\"text\")(e.target.value)}\r\n error={errors.text ? { message: errors.text } : null}\r\n />\r\n <PasswordField\r\n name=\"password\"\r\n label=\"Password\"\r\n value={formData.password}\r\n onChange={(e) => handleChange(\"password\")(e.target.value)}\r\n error={errors.password ? { message: errors.password } : null}\r\n />\r\n </Box>\r\n\r\n <TextInputField\r\n name=\"textarea\"\r\n label=\"Text Area\"\r\n value={formData.textarea}\r\n onChange={(e) => handleChange(\"textarea\")(e.target.value)}\r\n multiline\r\n rows={4}\r\n />\r\n <Box sx={{ display: \"flex\", flexDirection: \"column\", gap: 1.5 }}>\r\n <NumberField\r\n name=\"number\"\r\n label=\"Number\"\r\n pattern=\"credit-card\"\r\n value={formData.number}\r\n onChange={(e) => handleChange(\"number\")(e.target.value)}\r\n />\r\n <TelInputField\r\n name=\"tel\"\r\n label=\"Telephone\"\r\n pattern=\"XX-XXXX-XXXX\"\r\n value={formData.tel}\r\n onChange={(e) => handleChange(\"tel\")(e.target.value)}\r\n />\r\n </Box>\r\n\r\n <SearchInputField\r\n name=\"search\"\r\n label=\"Search\"\r\n value={formData.search}\r\n onChange={(e) => handleChange(\"search\")(e.target.value)}\r\n />\r\n\r\n <OTPField\r\n name=\"otp\"\r\n value={formData.otp}\r\n onChange={handleChange(\"otp\")}\r\n length={6}\r\n spacing={2}\r\n />\r\n\r\n {/* Dropdowns */}\r\n <SelectInputField\r\n name=\"select\"\r\n label=\"Select\"\r\n value={formData.select}\r\n onChange={(e) => handleChange(\"select\")(e.target.value)}\r\n options={selectOptions}\r\n />\r\n\r\n <SelectInputField\r\n name=\"multiselect\"\r\n label=\"Multi Select\"\r\n value={formData.multiselect}\r\n onChange={(e) => handleChange(\"multiselect\")(e.target.value)}\r\n options={selectOptions}\r\n multiple\r\n />\r\n\r\n <AutoCompleteField\r\n name=\"autocomplete\"\r\n label=\"Autocomplete\"\r\n value={formData.autocomplete}\r\n onChange={(_, newValue) => handleChange(\"autocomplete\")(newValue)}\r\n options={selectOptions}\r\n />\r\n\r\n <AutoCompleteField\r\n name=\"multiautocomplete\"\r\n label=\"Multi Autocomplete\"\r\n value={formData.multiautocomplete}\r\n onChange={(_, newValue) =>\r\n handleChange(\"multiautocomplete\")(newValue)\r\n }\r\n options={selectOptions}\r\n multiple\r\n />\r\n\r\n <ColorPickerField\r\n name=\"color\"\r\n label=\"Color Picker\"\r\n value={formData.color}\r\n onChange={handleChange(\"color\")}\r\n />\r\n\r\n <FileUploadField\r\n name=\"file\"\r\n label=\"File Upload\"\r\n value={formData.file}\r\n onChange={handleChange(\"file\")}\r\n />\r\n\r\n {/* Date/Time */}\r\n <DatePickerField\r\n name=\"date\"\r\n value={formData.date}\r\n onChange={handleChange(\"date\")}\r\n />\r\n <Box>\r\n <TimePickerField\r\n name=\"time\"\r\n value={formData.time}\r\n onChange={handleChange(\"time\")}\r\n />\r\n <Box\r\n sx={{\r\n display: \"grid\",\r\n gridTemplateColumns: { md: \"1fr 1fr\" },\r\n gap: 2,\r\n mt: 2,\r\n }}\r\n >\r\n <CheckBoxFieldGroup\r\n name=\"checkboxgroup\"\r\n label=\"Checkbox Group\"\r\n value={formData.checkboxgroup}\r\n onChange={handleChange(\"checkboxgroup\")}\r\n options={checkboxOptions}\r\n />\r\n <RadioButtonFieldGroup\r\n name=\"radiogroup\"\r\n label=\"Radio Group\"\r\n value={formData.radiogroup}\r\n onChange={handleChange(\"radiogroup\")}\r\n options={radioOptions}\r\n />\r\n </Box>\r\n <Box sx={{ display: \"flex\", gap: 2, mt: 2 }}>\r\n <CheckBoxField\r\n name=\"checkbox\"\r\n label=\"Checkbox\"\r\n value={formData.checkbox}\r\n onChange={handleChange(\"checkbox\")}\r\n />\r\n\r\n <RadioButtonField\r\n name=\"singleradio\"\r\n label=\"Radio\"\r\n value={formData.singleradio}\r\n onChange={handleChange(\"singleradio\")}\r\n />\r\n <SwitchField\r\n name=\"switch\"\r\n label=\"Switch\"\r\n value={formData.switch}\r\n onChange={handleChange(\"switch\")}\r\n />\r\n </Box>\r\n </Box>\r\n <Box\r\n sx={{ border: 1, borderColor: \"grey.300\", borderRadius: 1, p: 2 }}\r\n >\r\n <TimeClockField\r\n name=\"timeclock\"\r\n label=\"Time Clock\"\r\n value={formData.timeclock}\r\n onChange={handleChange(\"timeclock\")}\r\n />\r\n </Box>\r\n\r\n <Box\r\n sx={{ border: 1, borderColor: \"grey.300\", borderRadius: 1, p: 2 }}\r\n >\r\n <DateCalendarField\r\n name=\"calendar\"\r\n label=\"Calendar\"\r\n value={formData.calendar}\r\n onChange={handleChange(\"calendar\")}\r\n />\r\n </Box>\r\n\r\n {/* Box Inputs */}\r\n\r\n <SliderField\r\n name=\"slider\"\r\n label=\"Slider\"\r\n value={formData.slider}\r\n onChange={handleChange(\"slider\")}\r\n min={0}\r\n max={100}\r\n />\r\n\r\n <Box\r\n sx={{\r\n gridColumn: { xs: \"1\", md: \"1 / -1\" },\r\n display: \"flex\",\r\n gap: 2,\r\n justifyContent: \"flex-end\",\r\n }}\r\n >\r\n <Button\r\n variant=\"outlined\"\r\n onClick={() =>\r\n setFormData({\r\n text: \"\",\r\n textarea: \"\",\r\n password: \"\",\r\n number: \"\",\r\n tel: \"\",\r\n search: \"\",\r\n otp: \"\",\r\n select: \"\",\r\n multiselect: [],\r\n autocomplete: null,\r\n multiautocomplete: [],\r\n color: \"#000000\",\r\n file: null,\r\n date: null,\r\n time: null,\r\n timeclock: null,\r\n calendar: null,\r\n checkbox: false,\r\n checkboxgroup: [],\r\n switch: false,\r\n slider: 0,\r\n singleradio: false,\r\n radiogroup: \"\",\r\n })\r\n }\r\n >\r\n Reset\r\n </Button>\r\n <Button type=\"submit\" variant=\"contained\">\r\n Submit\r\n </Button>\r\n </Box>\r\n </Box>\r\n </form>\r\n </Paper>\r\n );\r\n};\r\n\r\nexport default NormalForm;\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\n// import { zodResolver } from '@hookform/resolvers/zod';\r\nimport { Box, Button, Divider, Paper, Typography } from \"@mui/material\";\r\nimport { type Control, useForm } from \"react-hook-form\";\r\n\r\n// import * as z from 'zod';\r\nimport {\r\n FormInputAutoComplete,\r\n FormInputCalendar,\r\n FormInputCheckBox,\r\n FormInputCheckBoxGroup,\r\n FormInputColorPicker,\r\n FormInputDatePicker,\r\n FormInputFileUpload,\r\n FormInputMultiAutoComplete,\r\n FormInputMultiSelect,\r\n FormInputNumberField,\r\n FormInputOTPField,\r\n FormInputPasswordField,\r\n FormInputRadioButtonGroup,\r\n FormInputSearchField,\r\n FormInputSelect,\r\n FormInputSingleRadio,\r\n FormInputSlider,\r\n FormInputSwitch,\r\n FormInputTelField,\r\n FormInputTextArea,\r\n FormInputTextField,\r\n FormInputTimeClock,\r\n FormInputTimePicker\r\n} from \"../HookFormFields\";\r\n\r\ninterface FormData {\r\n text: string;\r\n textarea: string;\r\n password: string;\r\n number: string;\r\n tel: string;\r\n search: string;\r\n otp: string;\r\n select: string;\r\n multiselect: (string | number)[];\r\n autocomplete: any;\r\n multiautocomplete: any[];\r\n color: string;\r\n file: File | File[] | null;\r\n date: Date | null;\r\n time: Date | null;\r\n timeclock: Date | null;\r\n calendar: Date | null;\r\n checkbox: boolean;\r\n checkboxgroup: (string | number)[];\r\n switch: boolean;\r\n slider: number;\r\n singleradio: boolean;\r\n radiogroup: string;\r\n}\r\n\r\ntype FormControl = {\r\n control: Control<any>;\r\n handleSubmit: (e: (data: FormData) => void) => (e?: any) => Promise<void>;\r\n formState: {\r\n errors: Record<string, any>;\r\n };\r\n reset: () => void;\r\n};\r\nconst size = \"small\";\r\n\r\n// const schema = z.object({\r\n// text: z.string().min(3, { message: 'Text must be at least 3 characters' }),\r\n// textarea: z.string().min(10, { message: 'Description must be at least 10 characters' }),\r\n// password: z.string().min(6, { message: 'Password must be at least 6 characters' }),\r\n// number: z.string().min(1, { message: 'Number is required' }),\r\n// tel: z.string().min(10, { message: 'Phone number must be at least 10 characters' }),\r\n// search: z.string().min(3, { message: 'Search term must be at least 3 characters' }),\r\n// otp: z.string().min(4, { message: 'OTP must be at least 4 characters' }),\r\n// select: z.string().min(1, { message: 'Please select an option' }),\r\n// multiselect: z.array(z.union([z.string(), z.number()])).min(1, { message: 'Select at least one option' }),\r\n// autocomplete: z.any().refine((val) => val, { message: 'Please select an option' }),\r\n// multiautocomplete: z.array(z.any()).min(1, { message: 'Select at least one option' }),\r\n// color: z.string().min(1, { message: 'Color is required' }),\r\n// file: z.any().refine((val) => val, { message: 'File is required' }),\r\n// date: z\r\n// .date()\r\n// .nullable()\r\n// .refine((val) => val !== null, { message: 'Date is required' }),\r\n// time: z\r\n// .date()\r\n// .nullable()\r\n// .refine((val) => val !== null, { message: 'Time is required' }),\r\n// timeclock: z\r\n// .date()\r\n// .nullable()\r\n// .refine((val) => val !== null, { message: 'Time is required' }),\r\n// calendar: z\r\n// .date()\r\n// .nullable()\r\n// .refine((val) => val !== null, { message: 'Date is required' }),\r\n// checkbox: z.boolean().refine((val) => val === true, { message: 'Must be checked' }),\r\n// checkboxgroup: z.array(z.union([z.string(), z.number()])).min(1, { message: 'Select at least one option' }),\r\n// switch: z.boolean().refine((val) => val === true, { message: 'Must be switched on' }),\r\n// slider: z.number().min(1, { message: 'Value must be greater than 0' }),\r\n// singleradio: z.boolean().refine((val) => val === true, { message: 'Must be selected' }),\r\n// radiogroup: z.string().min(1, { message: 'Please select an option' }),\r\n// });\r\n\r\nconst ReactHookForm = () => {\r\n const {\r\n control,\r\n handleSubmit,\r\n formState: { errors },\r\n reset\r\n }: FormControl = useForm<any>({\r\n defaultValues: {\r\n text: \"\",\r\n textarea: \"\",\r\n password: \"\",\r\n number: \"\",\r\n tel: \"\",\r\n search: \"\",\r\n otp: \"\",\r\n select: \"\",\r\n multiselect: [],\r\n autocomplete: null,\r\n multiautocomplete: [],\r\n color: \"\",\r\n file: null,\r\n date: null,\r\n time: null,\r\n timeclock: null,\r\n calendar: null,\r\n checkbox: false,\r\n checkboxgroup: [],\r\n switch: false,\r\n slider: 0,\r\n singleradio: false,\r\n radiogroup: \"\"\r\n }\r\n // resolver: zodResolver(schema),\r\n });\r\n\r\n // Options for dropdowns\r\n const selectOptions = [\r\n { name: \"Option 1\", value: \"opt1\" },\r\n { name: \"Option 2\", value: \"opt2\" },\r\n { name: \"Option 3\", value: \"opt3\" }\r\n ];\r\n\r\n const checkboxOptions = [\r\n { name: \"Checkbox 1\", value: \"check1\" },\r\n { name: \"Checkbox 2\", value: \"check2\" },\r\n { name: \"Checkbox 3\", value: \"check3\" }\r\n ];\r\n\r\n const radioOptions = [\r\n { name: \"Radio 1\", value: \"radio1\" },\r\n { name: \"Radio 2\", value: \"radio2\" },\r\n { name: \"Radio 3\", value: \"radio3\" }\r\n ];\r\n\r\n const onSubmit = (data: FormData) => {\r\n console.log(\"React Hook Form Data:\", data);\r\n };\r\n\r\n return (\r\n <Paper sx={{ p: 3, maxWidth: 1200, mx: \"auto\" }}>\r\n <Typography variant=\"h4\" gutterBottom>\r\n React Hook Form (HookFormFields)\r\n </Typography>\r\n <Typography variant=\"body2\" color=\"text.secondary\" gutterBottom>\r\n Using HookFormFields with react-hook-form\r\n </Typography>\r\n <Divider sx={{ my: 2 }} />\r\n\r\n <form onSubmit={handleSubmit(onSubmit)}>\r\n <Box\r\n sx={{\r\n display: \"grid\",\r\n gridTemplateColumns: { xs: \"1fr\", md: \"repeat(3, 1fr)\" },\r\n gap: 2\r\n }}\r\n >\r\n <Box sx={{ display: \"flex\", flexDirection: \"column\", gap: 1.5 }}>\r\n {/* Text Inputs */}\r\n <FormInputTextField name=\"text\" label=\"Text Field\" control={control} size={size} />\r\n <FormInputPasswordField name=\"password\" label=\"Password\" control={control} size={size} />\r\n </Box>\r\n <FormInputTextArea name=\"textarea\" label=\"Text Area\" control={control} rows={4} size={size} />\r\n <Box sx={{ display: \"flex\", flexDirection: \"column\", gap: 1.5 }}>\r\n <FormInputNumberField name=\"number\" label=\"Number\" pattern=\"zip-code\" control={control} size={size} />\r\n\r\n <FormInputTelField\r\n name=\"tel\"\r\n label=\"Telephone\"\r\n pattern=\"XX-XXX-XXXXXX-X-XX\"\r\n control={control}\r\n size={size}\r\n />\r\n </Box>\r\n <FormInputSearchField name=\"search\" label=\"Search\" control={control} size={size} />\r\n\r\n <FormInputOTPField name=\"otp\" control={control} spacing={2} size={size} />\r\n\r\n {/* Dropdowns */}\r\n <FormInputSelect name=\"select\" label=\"Select\" control={control} options={selectOptions} size={size} />\r\n\r\n <FormInputMultiSelect\r\n name=\"multiselect\"\r\n label=\"Multi Select\"\r\n control={control}\r\n options={selectOptions}\r\n size={size}\r\n />\r\n\r\n <FormInputAutoComplete\r\n name=\"autocomplete\"\r\n label=\"Autocomplete\"\r\n control={control}\r\n options={selectOptions}\r\n size={size}\r\n />\r\n\r\n <FormInputMultiAutoComplete\r\n name=\"multiautocomplete\"\r\n label=\"Multi Autocomplete\"\r\n control={control}\r\n options={selectOptions}\r\n size={size}\r\n />\r\n\r\n <FormInputColorPicker name=\"color\" label=\"Color Picker\" control={control} size={size} />\r\n\r\n <FormInputFileUpload name=\"file\" label=\"File Upload\" control={control} size={size} />\r\n\r\n {/* Date/Time */}\r\n <FormInputDatePicker name=\"date\" control={control} size={size} />\r\n\r\n <Box>\r\n <FormInputTimePicker name=\"time\" control={control} size={size} />\r\n <Box\r\n sx={{\r\n display: \"grid\",\r\n gridTemplateColumns: { md: \"1fr 1fr\" },\r\n gap: 2,\r\n mt: 2\r\n }}\r\n >\r\n <FormInputCheckBoxGroup\r\n name=\"checkboxgroup\"\r\n label=\"Select Options\"\r\n control={control}\r\n options={checkboxOptions}\r\n size={size}\r\n />\r\n <FormInputRadioButtonGroup\r\n name=\"radiogroup\"\r\n label=\"Radio Group\"\r\n control={control}\r\n options={radioOptions}\r\n size={size}\r\n />\r\n </Box>\r\n <Box sx={{ display: \"flex\", gap: 2, mt: 2 }}>\r\n <FormInputCheckBox name=\"checkbox\" label=\"Checkbox\" control={control} size={size} />\r\n <FormInputSingleRadio name=\"singleradio\" label=\"Radio\" control={control} size={size} />\r\n <FormInputSwitch name=\"switch\" label=\"Switch\" control={control} size={size} />\r\n </Box>\r\n </Box>\r\n <Box sx={{ border: 1, borderColor: \"grey.300\", borderRadius: 1, p: 2 }}>\r\n <FormInputTimeClock name=\"timeclock\" label=\"Time Clock\" control={control} size={size} />\r\n </Box>\r\n <Box sx={{ border: 1, borderColor: \"grey.300\", borderRadius: 1, p: 2 }}>\r\n <FormInputCalendar name=\"calendar\" label=\"Calendar\" control={control} size={size} />\r\n </Box>\r\n {/* Box Inputs */}\r\n <Box>\r\n <FormInputSlider name=\"slider\" label=\"Slider\" control={control} size={size} />\r\n </Box>\r\n <Box\r\n sx={{\r\n gridColumn: { xs: \"1\", md: \"1 / -1\" },\r\n display: \"flex\",\r\n gap: 2,\r\n justifyContent: \"flex-end\"\r\n }}\r\n >\r\n <Button variant=\"outlined\" onClick={() => reset()}>\r\n Reset\r\n </Button>\r\n <Button type=\"submit\" variant=\"contained\">\r\n Submit\r\n </Button>\r\n </Box>\r\n </Box>\r\n </form>\r\n </Paper>\r\n );\r\n};\r\n\r\nexport default ReactHookForm;\r\n","// HookFormFields Imports\r\nimport {\r\n\tFormInputTextField,\r\n\tFormInputTextArea,\r\n\tFormInputPasswordField,\r\n\tFormInputNumberField,\r\n\tFormInputTelField,\r\n\tFormInputSearchField,\r\n\tFormInputOTPField,\r\n\tFormInputSelect,\r\n\tFormInputMultiSelect,\r\n\tFormInputAutoComplete,\r\n\tFormInputMultiAutoComplete,\r\n\tFormInputColorPicker,\r\n\tFormInputFileUpload,\r\n\tFormInputDatePicker,\r\n\tFormInputTimePicker,\r\n\tFormInputTimeClock,\r\n\tFormInputCalendar,\r\n\tFormInputCheckBox,\r\n\tFormInputCheckBoxGroup,\r\n\tFormInputSwitch,\r\n\tFormInputSlider,\r\n\tFormInputSingleRadio,\r\n\tFormInputRadioButtonGroup,\r\n} from \"./pkg/HookFormFields\";\r\n\r\nimport type {\r\n\tIFormInputFields,\r\n\tIFormInputFieldsWithOptions,\r\n\tIFormInputDateFields,\r\n\tIFormInputNumberFields,\r\n\tIFormInputTextAreaFields,\r\n\tIFormInputRadioFields,\r\n\tIFormInputCheckBoxGroupFields,\r\n\tOption,\r\n} from \"./pkg/HookFormFields\";\r\n\r\n// FormFields Imports\r\nimport TextInputField from \"./pkg/FormFields/TextFields/TextInputField\";\r\nimport PasswordField from \"./pkg/FormFields/TextFields/PasswordField\";\r\nimport NumberField from \"./pkg/FormFields/TextFields/NumberField\";\r\nimport TelInputField from \"./pkg/FormFields/TextFields/TelInputField\";\r\nimport SearchInputField from \"./pkg/FormFields/TextFields/SearchInputField\";\r\nimport OTPField from \"./pkg/FormFields/TextFields/OTPField\";\r\n\r\nimport SelectInputField from \"./pkg/FormFields/DropdownFields/SelectInputField\";\r\nimport AutoCompleteField from \"./pkg/FormFields/DropdownFields/AutoCompleteField\";\r\nimport ColorPickerField from \"./pkg/FormFields/DropdownFields/ColorPickerField\";\r\nimport FileUploadField from \"./pkg/FormFields/DropdownFields/FileUploadField\";\r\n\r\nimport DatePickerField from \"./pkg/FormFields/DateFields/DatePickerField\";\r\nimport TimePickerField from \"./pkg/FormFields/DateFields/TimePickerField\";\r\nimport TimeClockField from \"./pkg/FormFields/DateFields/TimeClockField\";\r\nimport DateCalendarField from \"./pkg/FormFields/DateFields/DateCalendarField\";\r\n\r\nimport CheckBoxField from \"./pkg/FormFields/BoxFields/CheckBoxField\";\r\nimport CheckBoxFieldGroup from \"./pkg/FormFields/BoxFields/CheckBoxFieldGroup\";\r\nimport RadioButtonField from \"./pkg/FormFields/BoxFields/RadioButtonField\";\r\nimport RadioButtonFieldGroup from \"./pkg/FormFields/BoxFields/RadioButtonFieldGroup\";\r\nimport SwitchField from \"./pkg/FormFields/BoxFields/SwitchField\";\r\nimport SliderField from \"./pkg/FormFields/BoxFields/SliderField\";\r\nimport NormalForm from \"./pkg/FormBuild/Form\";\r\nimport ReactHookForm from \"./pkg/FormBuild/HookForm\";\r\n\r\nexport { NormalForm as DemoForm, ReactHookForm as DemoHookForm };\r\n// Named Exports\r\nexport {\r\n\t// HookFormFields\r\n\tFormInputTextField,\r\n\tFormInputTextArea,\r\n\tFormInputPasswordField,\r\n\tFormInputNumberField,\r\n\tFormInputTelField,\r\n\tFormInputSearchField,\r\n\tFormInputOTPField,\r\n\tFormInputSelect,\r\n\tFormInputMultiSelect,\r\n\tFormInputAutoComplete,\r\n\tFormInputMultiAutoComplete,\r\n\tFormInputColorPicker,\r\n\tFormInputFileUpload,\r\n\tFormInputDatePicker,\r\n\tFormInputTimePicker,\r\n\tFormInputTimeClock,\r\n\tFormInputCalendar,\r\n\tFormInputCheckBox,\r\n\tFormInputCheckBoxGroup,\r\n\tFormInputSwitch,\r\n\tFormInputSlider,\r\n\tFormInputSingleRadio,\r\n\tFormInputRadioButtonGroup,\r\n\t// FormFields\r\n\tTextInputField,\r\n\tPasswordField,\r\n\tNumberField,\r\n\tTelInputField,\r\n\tSearchInputField,\r\n\tOTPField,\r\n\tSelectInputField,\r\n\tAutoCompleteField,\r\n\tColorPickerField,\r\n\tFileUploadField,\r\n\tDatePickerField,\r\n\tTimePickerField,\r\n\tTimeClockField,\r\n\tDateCalendarField,\r\n\tCheckBoxField,\r\n\tCheckBoxFieldGroup,\r\n\tRadioButtonField,\r\n\tRadioButtonFieldGroup,\r\n\tSwitchField,\r\n\tSliderField,\r\n};\r\n\r\n// Type Exports\r\nexport type {\r\n\tIFormInputFields,\r\n\tIFormInputFieldsWithOptions,\r\n\tIFormInputDateFields,\r\n\tIFormInputNumberFields,\r\n\tIFormInputTextAreaFields,\r\n\tIFormInputRadioFields,\r\n\tIFormInputCheckBoxGroupFields,\r\n\tOption,\r\n};\r\n\r\n// Default Export\r\nconst FormFields = {\r\n\t// HookFormFields\r\n\tFormInputTextField,\r\n\tFormInputTextArea,\r\n\tFormInputPasswordField,\r\n\tFormInputNumberField,\r\n\tFormInputTelField,\r\n\tFormInputSearchField,\r\n\tFormInputOTPField,\r\n\tFormInputSelect,\r\n\tFormInputMultiSelect,\r\n\tFormInputAutoComplete,\r\n\tFormInputMultiAutoComplete,\r\n\tFormInputColorPicker,\r\n\tFormInputFileUpload,\r\n\tFormInputDatePicker,\r\n\tFormInputTimePicker,\r\n\tFormInputTimeClock,\r\n\tFormInputCalendar,\r\n\tFormInputCheckBox,\r\n\tFormInputCheckBoxGroup,\r\n\tFormInputSwitch,\r\n\tFormInputSlider,\r\n\tFormInputSingleRadio,\r\n\tFormInputRadioButtonGroup,\r\n\t// FormFields\r\n\tTextInputField,\r\n\tPasswordField,\r\n\tNumberField,\r\n\tTelInputField,\r\n\tSearchInputField,\r\n\tOTPField,\r\n\tSelectInputField,\r\n\tAutoCompleteField,\r\n\tColorPickerField,\r\n\tFileUploadField,\r\n\tDatePickerField,\r\n\tTimePickerField,\r\n\tTimeClockField,\r\n\tDateCalendarField,\r\n\tCheckBoxField,\r\n\tCheckBoxFieldGroup,\r\n\tRadioButtonField,\r\n\tRadioButtonFieldGroup,\r\n\tSwitchField,\r\n\tSliderField,\r\n};\r\n\r\nexport default FormFields;\r\n"],"mappings":"mmBAAA,OAAS,QAAAA,OAAY,QACrB,OAAS,cAAAC,OAAkB,kBCD3B,OAAS,eAAAC,GAAa,kBAAAC,GAAgB,aAAAC,OAAsC,gBAE5E,OAA4B,cAAAC,GAAY,QAAAC,GAAM,eAAAC,GAAa,WAAAC,OAAe,QAgMpE,cAAAC,OAAA,oBAlGN,IAAMC,GAAiBC,GACtBC,GACC,CACCC,EAmCAC,IACI,CApCJ,IAAAC,EAAAF,EACC,MAAAG,EACA,MAAAC,EACA,MAAAC,EACA,SAAAC,EACA,QAAAC,EACA,OAAAC,EACA,aAAAC,EACA,MAAAC,EACA,WAAAC,EACA,SAAAC,EAAW,GACX,YAAAC,EACA,QAAAC,EAAU,WACV,KAAAC,EACA,MAAAC,EAAQ,UACR,UAAAC,EAAY,GACZ,SAAAC,EACA,UAAAC,EAAY,GACZ,KAAAC,EACA,QAAAC,EACA,QAAAC,EACA,OAAAC,EAAS,OACT,UAAAC,EACA,UAAAC,EACA,KAAAC,EAAO,OACP,aAAAC,EAAe,MACf,eAAAC,EACA,aAAAC,EACA,YAAAC,EACA,kBAAAC,EACA,UAAAC,EACA,MAAAC,EACA,cAAAC,CAnIJ,EAmGGhC,EAiCIiC,EAAAC,EAjCJlC,EAiCI,CAhCH,OACA,QACA,QACA,WACA,UACA,SACA,eACA,QACA,aACA,WACA,cACA,UACA,OACA,QACA,YACA,WACA,YACA,OACA,UACA,UACA,SACA,YACA,YACA,OACA,eACA,iB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AAAC,GACA,YAAAC,GACA,cAAAC,GACA,iBAAAC,GACA,SAAAC,GACA,iBAAAC,GACA,kBAAAC,GACA,iBAAAC,GACA,gBAAAC,GACA,gBAAAC,GACA,gBAAAC,GACA,eAAAC,GACA,kBAAAC,GACA,cAAAC,GACA,mBAAAC,GACA,iBAAAC,GACA,sBAAAC,GACA,YAAAC,GACA,YAAAC,EACD,EAEOC,GAAQ5C","names":["memo","Controller","FormControl","InputAdornment","TextField","forwardRef","memo","useCallback","useMemo","jsx","TextInputField","memo","forwardRef","_a","ref","_b","name","label","value","onChange","onFocus","onBlur","onEnterPress","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","multiline","rows","minRows","maxRows","resize","maxLength","minLength","type","autoComplete","startAdornment","endAdornment","inputStyles","formControlStyles","slotProps","slots","textTransform","textFieldProps","__objRest","handleKeyDown","useCallback","event","handleChange","transformedValue","char","inputProps","useMemo","__spreadValues","startAdornmentElement","InputAdornment","endAdornmentElement","finalSlotProps","__spreadProps","finalInputStyles","displayHelperText","FormControl","TextField","TextInputField_default","jsx","FormInputTextField","memo","_a","_b","name","label","control","defaultValue","onChange","props","__objRest","Controller","field","error","size","restProps","TextInputField_default","__spreadProps","__spreadValues","e","FormInputTextField_default","memo","Controller","jsx","FormInputTextArea","memo","_a","_b","name","label","control","rows","minRows","maxRows","resize","defaultValue","onChange","props","__objRest","Controller","field","error","size","restProps","TextInputField_default","__spreadProps","__spreadValues","e","FormInputTextArea_default","memo","Controller","Visibility","VisibilityOff","FormControl","FormHelperText","IconButton","InputAdornment","TextField","forwardRef","useState","memo","useCallback","useMemo","jsx","jsxs","calculatePasswordStrength","password","strength","getPasswordStrengthColor","PasswordField","memo","forwardRef","_a","ref","_b","name","label","value","onChange","onFocus","onBlur","onVisibilityToggle","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","showPasswordStrength","minLength","maxLength","defaultShowPassword","visibilityIcon","Visibility","visibilityOffIcon","VisibilityOff","iconButtonProps","getPasswordStrength","inputStyles","formControlStyles","slotProps","slots","textFieldProps","__objRest","showPassword","setShowPassword","useState","togglePasswordVisibility","useCallback","prev","newVisibility","passwordStrength","useMemo","getStrengthIndicator","strengthColor","strengthText","handleChange","event","newValue","endAdornmentElement","InputAdornment","IconButton","__spreadProps","__spreadValues","e","finalSlotProps","displayHelperText","FormControl","TextField","FormHelperText","PasswordField_default","jsx","FormInputPasswordField","memo","_a","_b","name","label","control","size","defaultValue","onChange","props","__objRest","Controller","field","error","sizeProp","restProps","PasswordField_default","__spreadProps","__spreadValues","e","FormInputPasswordField_default","memo","Controller","FormControl","InputAdornment","TextField","forwardRef","useState","useEffect","useCallback","memo","useMemo","jsx","extractDigits","value","formatByPattern","digits","pattern","formatted","digitIndex","i","generatePlaceholderFromPattern","formatPhoneNumber","numbers","formatCreditCard","_a","formatCurrency","allowDecimals","parts","formatSSN","formatZipCode","formatPercentage","NumberField","memo","forwardRef","ref","_b","name","label","onChange","onFocus","onBlur","onEnterPress","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","customPattern","customFormatter","min","max","step","decimalPlaces","startAdornment","endAdornment","inputStyles","formControlStyles","slotProps","slots","textFieldProps","__objRest","displayValue","setDisplayValue","useState","isPatternString","activePatternString","activePatternType","formatValue","useCallback","inputValue","useEffect","prev","isValidInput","key","maxDigits","testValue","handleChange","event","formattedValue","digitsOnly","syntheticEvent","__spreadProps","__spreadValues","handlePaste","pastedText","limitedDigits","handleKeyDown","input","currentValue","inputProps","useMemo","startAdornmentElement","InputAdornment","endAdornmentElement","finalSlotProps","inputType","displayPlaceholder","displayHelperText","FormControl","TextField","NumberField_default","jsx","FormInputNumberField","memo","_a","_b","name","label","control","pattern","min","max","step","allowDecimals","decimalPlaces","defaultValue","onChange","props","__objRest","Controller","field","error","size","restProps","NumberField_default","__spreadProps","__spreadValues","e","FormInputNumberField_default","memo","Controller","FormControl","InputAdornment","TextField","forwardRef","useState","useEffect","useRef","memo","useCallback","useMemo","jsx","extractDigits","value","formatByPattern","digits","pattern","formatted","digitIndex","i","generatePlaceholder","TeliField","memo","forwardRef","_a","ref","_b","name","label","onChange","onFocus","onBlur","onEnterPress","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","maxLength","countryCode","showCountryCode","startAdornment","endAdornment","inputStyles","formControlStyles","countryCodeStyles","slotProps","slots","textFieldProps","__objRest","displayValue","setDisplayValue","useState","inputRef","useRef","calculatedMaxLength","useEffect","prev","cursorPosition","handleChange","useCallback","event","inputValue","limitedDigits","formattedValue","syntheticEvent","__spreadProps","__spreadValues","handlePaste","pastedText","handleKeyDown","key","isNumber","isAllowedKey","inputProps","useMemo","finalStartAdornment","InputAdornment","endAdornmentElement","finalSlotProps","displayPlaceholder","displayHelperText","FormControl","TextField","TelInputField_default","jsx","FormInputTelField","memo","_a","_b","name","label","control","defaultValue","onChange","props","__objRest","Controller","field","error","size","restProps","TelInputField_default","__spreadProps","__spreadValues","e","FormInputTelField_default","memo","Controller","Close","Search","FormControl","IconButton","InputAdornment","TextField","forwardRef","useEffect","useRef","memo","useCallback","useMemo","jsx","jsxs","SearchField","memo","forwardRef","_a","ref","_b","name","label","value","onChange","onFocus","onBlur","onSearch","onClear","onEnterPress","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","showClearButton","showSearchButton","clearIcon","searchIcon","clearButtonProps","searchButtonProps","enableDebounce","debounceDelay","enableThrottle","throttleDelay","inputStyles","formControlStyles","slotProps","slots","textFieldProps","__objRest","debounceTimerRef","useRef","throttleTimerRef","lastThrottleCallRef","useEffect","debouncedSearch","useCallback","searchVal","throttledSearch","now","timeSinceLastCall","handleChange","event","newValue","handleClear","handleSearch","handleKeyDown","endAdornment","useMemo","InputAdornment","IconButton","__spreadProps","__spreadValues","Close","Search","displayHelperText","FormControl","TextField","SearchInputField_default","jsx","FormInputSearchField","memo","_a","_b","name","label","control","defaultValue","onChange","props","__objRest","Controller","field","error","size","restProps","SearchInputField_default","__spreadProps","__spreadValues","e","FormInputSearchField_default","memo","Controller","FormControl","FormHelperText","TextField","Box","forwardRef","useState","useRef","useEffect","jsx","jsxs","OTPField","forwardRef","_a","ref","_b","name","label","value","onChange","onComplete","onFocus","onBlur","onEnterPress","error","helperText","disabled","variant","size","color","fullWidth","required","length","spacing","autoFocus","autoSubmit","containerStyles","inputStyles","formControlStyles","slotProps","slots","textFieldProps","__objRest","otpValues","setOtpValues","useState","inputRefs","useRef","lastSentValueRef","isInternalUpdateRef","otpValuesRef","inputSessionActiveRef","inputSessionTimeoutRef","useEffect","currentOtpString","currentDigits","incomingDigits","values","paddedValues","handleChange","index","event","inputValue","updateValue","lastChar","newValue","shouldAutoFocusNext","newOtpValues","otpString","val","handleKeyDown","_c","key","handlePaste","digits","startIndex","i","nextEmptyIndex","focusIndex","handleFocus","_index","handleBlur","FormControl","Box","__spreadValues","otpValue","TextField","el","e","__spreadProps","FormHelperText","OTPField_default","jsx","FormInputOTPField","memo","_a","_b","name","label","control","defaultValue","onChange","props","__objRest","Controller","field","error","size","restProps","OTPField_default","__spreadProps","__spreadValues","value","FormInputOTPField_default","memo","useMemo","Controller","FormControl","FormHelperText","InputLabel","MenuItem","Select","forwardRef","jsx","jsxs","SelectInputField","forwardRef","_a","ref","_b","name","label","value","onChange","onOpen","onClose","options","error","helperText","disabled","variant","size","color","fullWidth","required","multiple","icon","renderValue","renderMenuItem","menuItemStyles","selectStyles","formControlStyles","labelStyles","slotProps","slots","displayEmpty","autoWidth","native","MenuProps","selectProps","__objRest","defaultRenderValue","selected","val","option","opt","defaultRenderMenuItem","index","menuItemSx","MenuItem","handleChange","event","child","labelId","selectId","FormControl","InputLabel","Select","__spreadProps","__spreadValues","FormHelperText","SelectInputField_default","jsx","FormInputSelect","memo","_a","_b","name","label","control","options","defaultValue","onChange","props","__objRest","memoizedOptions","useMemo","Controller","field","error","size","restProps","SelectInputField_default","__spreadProps","__spreadValues","e","FormInputSelect_default","memo","useMemo","Controller","jsx","FormInputMultiSelect","memo","_a","_b","name","label","control","options","defaultValue","onChange","props","__objRest","memoizedOptions","useMemo","Controller","field","error","size","restProps","fieldValue","SelectInputField_default","__spreadProps","__spreadValues","e","FormInputMultiSelect_default","memo","Controller","Autocomplete","FormControl","FormHelperText","TextField","forwardRef","memo","useCallback","jsx","jsxs","AutoCompleteField","memo","forwardRef","_a","ref","_b","name","label","value","onChange","onInputChange","onOpen","onClose","options","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","getOptionLabel","isOptionEqualToValue","renderOption","popupIcon","inputStyles","autocompleteStyles","formControlStyles","loading","loadingText","noOptionsText","filterOptions","autoHighlight","autoSelect","disablePortal","disableListWrap","slotProps","slots","autocompleteProps","__objRest","defaultGetOptionLabel","useCallback","option","defaultIsOptionEqualToValue","handleChange","event","newValue","reason","FormControl","Autocomplete","__spreadProps","__spreadValues","params","TextField","FormHelperText","AutoCompleteField_default","jsx","FormInputAutoComplete","memo","_a","_b","name","label","control","options","disabled","placeholder","defaultValue","onChange","props","__objRest","Controller","field","error","value","onBlur","size","restProps","AutoCompleteField_default","__spreadProps","__spreadValues","_","newValue","FormInputAutoComplete_default","memo","useMemo","Controller","jsx","FormInputMultiAutoComplete","memo","_a","_b","name","label","control","options","disabled","placeholder","defaultValue","onChange","props","__objRest","memoizedOptions","useMemo","Controller","field","error","value","onBlur","size","restProps","fieldValue","AutoCompleteField_default","__spreadProps","__spreadValues","_","newValue","FormInputMultiAutoComplete_default","memo","Controller","Box","FormControl","InputAdornment","TextField","forwardRef","memo","useCallback","useEffect","useMemo","useRef","useState","jsx","jsxs","isValidHex","color","normalizeHex","hex","char","ColorPickerField","memo","forwardRef","_a","ref","_b","name","label","value","onChange","onFocus","onBlur","onEnterPress","error","helperText","disabled","placeholder","variant","size","fullWidth","required","format","showPreview","showNativeInput","showPopoverPicker","presetColors","showPresetColors","previewStyles","formControlStyles","inputStyles","slotProps","slots","textFieldProps","__objRest","internalValue","setInternalValue","useState","colorInputRef","useRef","popoverAnchorRef","useEffect","normalizedValue","handleChange","useCallback","event","newValue","handleColorInputChange","handlePreviewClick","handleKeyDown","previewSwatch","useMemo","jsx","InputAdornment","Box","__spreadValues","finalSlotProps","__spreadProps","displayHelperText","jsxs","FormControl","TextField","ColorPickerField_default","jsx","FormInputColorPicker","memo","_a","_b","name","label","control","defaultValue","onChange","props","__objRest","Controller","field","error","size","restProps","ColorPickerField_default","__spreadProps","__spreadValues","color","FormInputColorPicker_default","memo","useRef","Controller","Clear","CloudUploadIcon","FormControl","FormHelperText","IconButton","InputAdornment","TextField","forwardRef","useRef","useState","jsx","jsxs","FileUploadField","forwardRef","_a","ref","_b","name","label","value","onChange","onFileSelect","onFileRemove","onValidationError","onDrop","error","helperText","disabled","accept","multiple","maxSize","minSize","allowedTypes","showPreview","enableDragDrop","placeholder","variant","size","color","fullWidth","required","buttonText","buttonVariant","buttonColor","buttonSize","uploadIcon","CloudUploadIcon","inputStyles","buttonStyles","formControlStyles","containerStyles","slotProps","slots","textFieldProps","__objRest","internalRef","useRef","isDragging","setIsDragging","useState","setDragCounter","fileInputRef","getFileName","validateFile","file","formatFileSize","fileType","getFileExtension","type","bytes","k","sizes","i","filename","handleFileChange","event","files","fileArray","validFiles","hasError","validationError","result","handleButtonClick","handleFileRemove","handleDragEnter","e","prev","handleDragLeave","newCounter","handleDragOver","handleDrop","fileName","displayValue","FormControl","TextField","__spreadProps","__spreadValues","InputAdornment","IconButton","Clear","FormHelperText","FileUploadField_default","jsx","FormInputFileUpload","memo","_a","_b","name","label","control","size","defaultValue","onChange","props","__objRest","fileRef","useRef","Controller","field","error","FileUploadField_default","__spreadProps","__spreadValues","files","FormInputFileUpload_default","memo","Controller","ClearIcon","Box","FormControl","FormHelperText","FormLabel","IconButton","TextField","DatePicker","LocalizationProvider","AdapterDateFns","React","forwardRef","useRef","jsx","jsxs","DatePickerField","forwardRef","_a","ref","_b","name","label","value","defaultValue","onChange","onFocus","onBlur","onViewChange","onMonthChange","onYearChange","onOpen","onClose","error","helperText","disabled","fullWidth","required","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear","size","variant","color","placeholder","readOnly","showClearButton","disablePast","disableFuture","referenceDate","view","format","openTo","pickerStyles","formControlStyles","formLabelStyles","containerStyles","textFieldStyles","slotProps","slots","title","dateAdapter","AdapterDateFns","reduceAnimations","autoFocus","datePickerProps","__objRest","inputRef","useRef","handleChange","newValue","handleClear","defaultPlaceholder","mergedSlotProps","__spreadProps","__spreadValues","FormControl","FormLabel","Box","LocalizationProvider","DatePicker","ActionableTextField","FormHelperText","props","clearable","onClear","showClear","InputProps","other","TextField","React","IconButton","ClearIcon","DatePickerField_default","jsx","FormInputDatePicker","memo","_a","_b","name","label","control","size","readOnly","shouldDisableDate","disabled","placeholder","defaultValue","onChange","props","__objRest","Controller","field","error","views","ampm","ampmInClock","timezone","restProps","DatePickerField_default","__spreadProps","__spreadValues","newValue","FormInputDatePicker_default","memo","Controller","ClearIcon","Box","FormControl","FormHelperText","FormLabel","IconButton","TextField","LocalizationProvider","TimePicker","AdapterDateFns","React","forwardRef","useRef","jsx","jsxs","TimePickerField","forwardRef","_a","ref","_b","name","label","title","value","defaultValue","onChange","onFocus","onBlur","onViewChange","onOpen","onClose","error","helperText","disabled","fullWidth","required","minTime","maxTime","shouldDisableTime","size","variant","color","placeholder","readOnly","showClearButton","disablePast","disableFuture","ampm","views","view","openTo","format","pickerStyles","formControlStyles","formLabelStyles","containerStyles","textFieldStyles","slotProps","slots","dateAdapter","AdapterDateFns","autoFocus","timePickerProps","__objRest","inputRef","useRef","handleChange","newValue","handleClear","defaultPlaceholder","mergedSlotProps","__spreadProps","__spreadValues","FormControl","FormLabel","Box","LocalizationProvider","TimePicker","ActionableTextField","FormHelperText","props","clearable","onClear","showClear","InputProps","other","TextField","React","IconButton","ClearIcon","TimePickerField_default","jsx","FormInputTimePicker","memo","_a","_b","name","label","control","ampm","timezone","defaultValue","onChange","props","__objRest","Controller","field","error","size","restProps","TimePickerField_default","__spreadProps","__spreadValues","newValue","FormInputTimePicker_default","Box","FormLabel","memo","useMemo","Controller","Box","Button","FormControl","FormHelperText","Stack","LocalizationProvider","TimeClock","AdapterDateFns","forwardRef","useState","jsx","jsxs","TimeClockField","forwardRef","_a","ref","_b","name","label","value","defaultValue","onChange","error","helperText","disabled","fullWidth","required","views","ampmInClock","ampm","disablePast","disableFuture","minTime","maxTime","shouldDisableTime","clockStyles","formControlStyles","formLabelStyles","containerStyles","buttonsStackStyles","buttonStyles","activeButtonStyles","showViewButtons","initialView","controlledView","controlledOnViewChange","slotProps","slots","dateAdapter","AdapterDateFns","autoFocus","timeClockProps","__objRest","internalView","setInternalView","useState","view","setView","handleChange","newValue","handleViewChange","newView","FormControl","Box","__spreadValues","Stack","v","Button","LocalizationProvider","TimeClock","__spreadProps","FormHelperText","TimeClockField_default","jsx","jsxs","FormInputTimeClock","memo","_a","_b","name","label","control","readOnly","disabled","ampm","views","ampmInClock","disablePast","defaultValue","onChange","props","__objRest","ampmValue","useMemo","Box","t","FormLabel","Controller","field","error","TimeClockField_default","__spreadProps","__spreadValues","newValue","FormInputTimeClock_default","Box","FormLabel","memo","Controller","Box","FormControl","FormHelperText","DateCalendar","LocalizationProvider","AdapterDateFns","forwardRef","jsx","jsxs","DateCalendarField","forwardRef","_a","ref","_b","name","label","value","defaultValue","onChange","onViewChange","onMonthChange","onYearChange","error","helperText","disabled","fullWidth","required","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear","calendarStyles","formControlStyles","formLabelStyles","containerStyles","slotProps","slots","dateAdapter","AdapterDateFns","showDaysOutsideCurrentMonth","disablePast","disableFuture","referenceDate","view","dateCalendarProps","__objRest","handleChange","newValue","FormControl","Box","__spreadValues","LocalizationProvider","DateCalendar","__spreadProps","FormHelperText","DateCalendarField_default","jsx","jsxs","FormInputCalendar","memo","_a","_b","name","label","control","readOnly","disabled","defaultValue","onChange","props","__objRest","Box","t","FormLabel","Controller","field","error","views","restProps","DateCalendarField_default","__spreadProps","__spreadValues","newValue","FormInputCalender_default","memo","Controller","Checkbox","FormControl","FormControlLabel","FormHelperText","forwardRef","jsx","jsxs","CheckboxField","forwardRef","_a","ref","_b","name","label","value","onChange","onClick","onFocus","onBlur","error","helperText","disabled","color","size","fullWidth","required","labelPlacement","checkedIcon","icon","indeterminate","checkboxStyles","labelStyles","formControlStyles","slotProps","slots","checkboxProps","__objRest","handleChange","_event","checked","handleClick","event","FormControl","FormControlLabel","Checkbox","__spreadProps","__spreadValues","FormHelperText","CheckBoxField_default","jsx","FormInputCheckBox","memo","_a","_b","name","label","control","defaultValue","onChange","props","__objRest","Controller","field","error","size","restProps","CheckBoxField_default","__spreadProps","__spreadValues","checked","FormInputCheckBox_default","memo","useMemo","Controller","Box","Checkbox","FormControl","FormControlLabel","FormHelperText","FormLabel","forwardRef","jsx","jsxs","CheckboxFieldGroup","forwardRef","_a","ref","_b","name","label","value","options","onChange","onFocus","onBlur","onClick","error","helperText","disabled","fullWidth","required","color","size","labelPlacement","row","checkedIcon","icon","checkboxStyles","labelStyles","formControlStyles","renderCheckbox","slotProps","sxProps","slots","formLabelStyles","formLabelProps","formControlLabelProps","formControlProps","__objRest","handleChange","optionValue","event","isChecked","newValue","val","handleFocus","handleBlur","handleClick","defaultRenderCheckbox","option","index","handleChangeFn","FormControlLabel","__spreadValues","Checkbox","FormControl","__spreadProps","FormLabel","Box","changeHandler","FormHelperText","CheckBoxFieldGroup_default","jsx","FormInputCheckBoxGroup","memo","_a","_b","name","label","control","options","defaultValue","onChange","row","color","labelPlacement","props","__objRest","checkboxOptions","useMemo","option","Controller","field","error","size","restProps","fieldValue","CheckBoxFieldGroup_default","__spreadProps","__spreadValues","value","FormInputCheckBoxGroup_default","memo","Controller","FormControl","FormControlLabel","FormHelperText","Switch","forwardRef","jsx","jsxs","SwitchField","forwardRef","_a","ref","_b","name","label","value","onChange","onClick","onFocus","onBlur","error","helperText","disabled","color","size","fullWidth","required","labelPlacement","edge","switchStyles","labelStyles","formControlStyles","slotProps","slots","formControlLabelProps","switchProps","__objRest","handleChange","_event","checked","handleClick","event","switchComponent","Switch","__spreadProps","__spreadValues","FormControl","FormControlLabel","FormHelperText","SwitchField_default","jsx","FormInputSwitch","memo","_a","_b","name","label","control","defaultValue","onChange","props","__objRest","Controller","field","error","size","restProps","SwitchField_default","__spreadProps","__spreadValues","checked","FormInputSwitch_default","memo","Controller","FormControl","FormHelperText","FormLabel","Slider","forwardRef","jsx","jsxs","SliderField","forwardRef","_a","ref","_b","name","label","value","onChange","onChangeCommitted","onFocus","onBlur","error","helperText","disabled","fullWidth","required","orientation","min","max","step","valueLabelDisplay","valueLabelFormat","color","size","marks","track","sliderStyles","formControlStyles","formLabelStyles","slotProps","slots","formLabelProps","sliderProps","__objRest","handleChange","_event","newValue","_activeThumb","handleChangeCommitted","isVertical","FormControl","__spreadValues","FormLabel","__spreadProps","Slider","FormHelperText","SliderField_default","jsx","FormInputSlider","memo","_a","_b","name","label","control","defaultValue","onChange","props","__objRest","Controller","field","error","size","restProps","SliderField_default","__spreadProps","__spreadValues","value","FormInputSlider_default","memo","Controller","FormControl","FormControlLabel","FormHelperText","Radio","forwardRef","jsx","jsxs","RadioButtonField","forwardRef","_a","ref","_b","name","label","value","onChange","onClick","onFocus","onBlur","error","helperText","disabled","color","size","fullWidth","required","labelPlacement","checkedIcon","icon","radioStyles","labelStyles","formControlStyles","slotProps","slots","formControlLabelProps","radioProps","__objRest","handleChange","_event","checked","handleClick","event","FormControl","FormControlLabel","__spreadValues","Radio","__spreadProps","FormHelperText","RadioButtonField_default","jsx","FormInputRadioButton","memo","_a","_b","name","label","control","checked","defaultValue","onChange","color","labelPlacement","props","__objRest","Controller","field","error","size","restProps","RadioButtonField_default","__spreadProps","__spreadValues","checkedValue","FormInputRadioButton_default","memo","useMemo","Controller","FormControl","FormControlLabel","FormHelperText","FormLabel","Radio","RadioGroup","forwardRef","jsx","jsxs","RadioButtonFieldGroup","forwardRef","_a","ref","_b","name","label","value","onChange","onClick","onFocus","onBlur","options","error","helperText","disabled","color","size","fullWidth","required","labelPlacement","row","checkedIcon","icon","radioStyles","labelStyles","formControlStyles","formLabelStyles","renderRadio","sxProps","slotProps","slots","formLabelProps","formControlLabelProps","radioGroupProps","__objRest","handleChange","event","newValue","numericValue","opt","handleClick","defaultRenderRadio","option","FormControlLabel","__spreadProps","__spreadValues","Radio","FormControl","FormLabel","RadioGroup","index","FormHelperText","RadioButtonFieldGroup_default","jsx","FormInputRadioButtonGroup","memo","_a","_b","name","label","control","options","defaultValue","onChange","props","__objRest","memoizedOptions","useMemo","Controller","field","error","size","restProps","RadioButtonFieldGroup_default","__spreadProps","__spreadValues","value","FormInputRadioButtonGroup_default","useState","Box","Paper","Typography","Button","Divider","jsx","jsxs","NormalForm","formData","setFormData","useState","errors","setErrors","selectOptions","checkboxOptions","radioOptions","handleChange","field","value","prev","__spreadProps","__spreadValues","newErrors","Paper","Typography","Divider","e","Box","TextInputField_default","PasswordField_default","NumberField_default","TelInputField_default","SearchInputField_default","OTPField_default","SelectInputField_default","AutoCompleteField_default","_","newValue","ColorPickerField_default","FileUploadField_default","DatePickerField_default","TimePickerField_default","CheckBoxFieldGroup_default","RadioButtonFieldGroup_default","CheckBoxField_default","RadioButtonField_default","SwitchField_default","TimeClockField_default","DateCalendarField_default","SliderField_default","Button","Form_default","Box","Button","Divider","Paper","Typography","useForm","jsx","jsxs","size","ReactHookForm","control","handleSubmit","errors","reset","useForm","selectOptions","checkboxOptions","radioOptions","Paper","Typography","Divider","data","Box","FormInputTextField_default","FormInputPasswordField_default","FormInputTextArea_default","FormInputNumberField_default","FormInputTelField_default","FormInputSearchField_default","FormInputOTPField_default","FormInputSelect_default","FormInputMultiSelect_default","FormInputAutoComplete_default","FormInputMultiAutoComplete_default","FormInputColorPicker_default","FormInputFileUpload_default","FormInputDatePicker_default","FormInputTimePicker_default","FormInputCheckBoxGroup_default","FormInputRadioButtonGroup_default","FormInputCheckBox_default","FormInputRadioButton_default","FormInputSwitch_default","FormInputTimeClock_default","FormInputCalender_default","FormInputSlider_default","Button","HookForm_default","FormFields","FormInputTextField_default","FormInputTextArea_default","FormInputPasswordField_default","FormInputNumberField_default","FormInputTelField_default","FormInputSearchField_default","FormInputOTPField_default","FormInputSelect_default","FormInputMultiSelect_default","FormInputAutoComplete_default","FormInputMultiAutoComplete_default","FormInputColorPicker_default","FormInputFileUpload_default","FormInputDatePicker_default","FormInputTimePicker_default","FormInputTimeClock_default","FormInputCalender_default","FormInputCheckBox_default","FormInputCheckBoxGroup_default","FormInputSwitch_default","FormInputSlider_default","FormInputRadioButton_default","FormInputRadioButtonGroup_default","TextInputField_default","PasswordField_default","NumberField_default","TelInputField_default","SearchInputField_default","OTPField_default","SelectInputField_default","AutoCompleteField_default","ColorPickerField_default","FileUploadField_default","DatePickerField_default","TimePickerField_default","TimeClockField_default","DateCalendarField_default","CheckBoxField_default","CheckBoxFieldGroup_default","RadioButtonField_default","RadioButtonFieldGroup_default","SwitchField_default","SliderField_default","index_default"]}
|
|
1
|
+
{"version":3,"sources":["../lib/pkg/FormBuild/Form.tsx","../lib/pkg/FormFields/BoxFields/CheckBoxField.tsx","../lib/pkg/FormFields/BoxFields/CheckBoxFieldGroup.tsx","../lib/pkg/FormFields/BoxFields/RadioButtonField.tsx","../lib/pkg/FormFields/BoxFields/RadioButtonFieldGroup.tsx","../lib/pkg/FormFields/BoxFields/SliderField.tsx","../lib/pkg/FormFields/BoxFields/SwitchField.tsx","../lib/pkg/FormFields/BoxFields/ToggleButtonField.tsx","../lib/pkg/FormFields/DateFields/DateCalendarField.tsx","../lib/pkg/FormFields/DateFields/DatePickerField.tsx","../lib/pkg/FormFields/DateFields/TimeClockField.tsx","../lib/pkg/FormFields/DateFields/TimePickerField.tsx","../lib/pkg/FormFields/DropdownFields/AutoCompleteField.tsx","../lib/pkg/FormFields/DropdownFields/ColorPickerField.tsx","../lib/pkg/FormFields/DropdownFields/FileUploadField.tsx","../lib/pkg/FormFields/DropdownFields/SelectInputField.tsx","../lib/pkg/FormFields/TextFields/NumberField.tsx","../lib/pkg/FormFields/TextFields/OTPField.tsx","../lib/pkg/FormFields/TextFields/PasswordField.tsx","../lib/pkg/FormFields/TextFields/SearchInputField.tsx","../lib/pkg/FormFields/TextFields/TelInputField.tsx","../lib/pkg/FormFields/TextFields/TextInputField.tsx","../lib/pkg/FormBuild/HookForm.tsx","../lib/pkg/HookFormFields/FormInputNumberField.tsx","../lib/pkg/HookFormFields/FormInputOTPField.tsx","../lib/pkg/HookFormFields/FormInputPasswordField.tsx","../lib/pkg/HookFormFields/FormInputSearchField.tsx","../lib/pkg/HookFormFields/FormInputTelField.tsx","../lib/pkg/HookFormFields/FormInputTextArea.tsx","../lib/pkg/HookFormFields/FormInputTextField.tsx","../lib/pkg/HookFormFields/FormInputAutoComplete.tsx","../lib/pkg/HookFormFields/FormInputColorPicker.tsx","../lib/pkg/HookFormFields/FormInputFileUpload.tsx","../lib/pkg/HookFormFields/FormInputMultiAutoComplete.tsx","../lib/pkg/HookFormFields/FormInputMultiSelect.tsx","../lib/pkg/HookFormFields/FormInputSelect.tsx","../lib/pkg/HookFormFields/FormInputCalendar.tsx","../lib/pkg/HookFormFields/FormInputDatePicker.tsx","../lib/pkg/HookFormFields/FormInputTimeClock.tsx","../lib/pkg/HookFormFields/FormInputTimePicker.tsx","../lib/pkg/HookFormFields/FormInputCheckBox.tsx","../lib/pkg/HookFormFields/FormInputCheckBoxGroup.tsx","../lib/pkg/HookFormFields/FormInputRadioButton.tsx","../lib/pkg/HookFormFields/FormInputRadioButtonGroup.tsx","../lib/pkg/HookFormFields/FormInputSlider.tsx","../lib/pkg/HookFormFields/FormInputSwitch.tsx","../lib/pkg/HookFormFields/FormInputToggleButton.tsx","../lib/index.ts"],"sourcesContent":["\"use client\";\r\n/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport { Box, Button, Divider, Paper, Typography } from \"@mui/material\";\r\nimport React, { useState } from \"react\";\r\n\r\nimport CheckBoxField from \"../FormFields/BoxFields/CheckBoxField\";\r\nimport CheckBoxFieldGroup from \"../FormFields/BoxFields/CheckBoxFieldGroup\";\r\nimport RadioButtonField from \"../FormFields/BoxFields/RadioButtonField\";\r\nimport RadioButtonFieldGroup from \"../FormFields/BoxFields/RadioButtonFieldGroup\";\r\nimport SliderField from \"../FormFields/BoxFields/SliderField\";\r\nimport SwitchField from \"../FormFields/BoxFields/SwitchField\";\r\nimport ToggleButtonField from \"../FormFields/BoxFields/ToggleButtonField\";\r\nimport DateCalendarField from \"../FormFields/DateFields/DateCalendarField\";\r\nimport DatePickerField from \"../FormFields/DateFields/DatePickerField\";\r\nimport TimeClockField from \"../FormFields/DateFields/TimeClockField\";\r\nimport TimePickerField from \"../FormFields/DateFields/TimePickerField\";\r\nimport AutoCompleteField from \"../FormFields/DropdownFields/AutoCompleteField\";\r\nimport ColorPickerField from \"../FormFields/DropdownFields/ColorPickerField\";\r\nimport FileUploadField from \"../FormFields/DropdownFields/FileUploadField\";\r\nimport SelectInputField from \"../FormFields/DropdownFields/SelectInputField\";\r\nimport NumberField from \"../FormFields/TextFields/NumberField\";\r\nimport OTPField from \"../FormFields/TextFields/OTPField\";\r\nimport PasswordField from \"../FormFields/TextFields/PasswordField\";\r\nimport SearchInputField from \"../FormFields/TextFields/SearchInputField\";\r\nimport TelInputField from \"../FormFields/TextFields/TelInputField\";\r\n// Import all FormInputs (not HookFormFields)\r\nimport TextInputField from \"../FormFields/TextFields/TextInputField\";\r\nimport type { Option } from \"../HookFormFields/types\";\r\n\r\nconst NormalForm = () => {\r\n // Form state\r\n const [formData, setFormData] = useState({\r\n text: \"\",\r\n textarea: \"\",\r\n password: \"\",\r\n number: \"\",\r\n tel: \"\",\r\n search: \"\",\r\n otp: \"\",\r\n select: \"\",\r\n multiselect: [] as (string | number)[],\r\n autocomplete: null as Option | null,\r\n multiautocomplete: [] as Option[],\r\n color: \"#000000\",\r\n file: null as File | File[] | null,\r\n date: null as Date | null,\r\n time: null as Date | null,\r\n timeclock: null as Date | null,\r\n calendar: null as Date | null,\r\n checkbox: false,\r\n checkboxgroup: [] as (string | number)[],\r\n switch: false,\r\n slider: 0,\r\n singleradio: false,\r\n radiogroup: \"\",\r\n status: \"ACTIVE\"\r\n });\r\n\r\n const [errors, setErrors] = useState<Record<string, string>>({});\r\n\r\n // Options for dropdowns\r\n const selectOptions: Option[] = [\r\n { name: \"Option 1\", value: \"opt1\" },\r\n { name: \"Option 2\", value: \"opt2\" },\r\n { name: \"Option 3\", value: \"opt3\" }\r\n ];\r\n\r\n const checkboxOptions = [\r\n { value: \"check1\", label: \"Checkbox 1\" },\r\n { value: \"check2\", label: \"Checkbox 2\" },\r\n { value: \"check3\", label: \"Checkbox 3\" }\r\n ];\r\n\r\n const radioOptions = [\r\n { name: \"Radio 1\", value: \"radio1\" },\r\n { name: \"Radio 2\", value: \"radio2\" },\r\n { name: \"Radio 3\", value: \"radio3\" }\r\n ];\r\n\r\n const handleChange = (field: string) => (value: any) => {\r\n setFormData((prev) => ({ ...prev, [field]: value }));\r\n // Clear error when user types\r\n if (errors[field]) {\r\n setErrors((prev) => {\r\n const newErrors = { ...prev };\r\n delete newErrors[field];\r\n return newErrors;\r\n });\r\n }\r\n };\r\n\r\n const handleSubmit = (e: React.SubmitEvent) => {\r\n e.preventDefault();\r\n console.log(\"Normal Form Data:\", formData);\r\n };\r\n\r\n return (\r\n <Paper sx={{ padding: 3, maxWidth: \"100%\", margin: \"auto\" }}>\r\n <Typography variant=\"h4\" gutterBottom>\r\n Normal Form (Direct FormInputs)\r\n </Typography>\r\n <Typography variant=\"body2\" color=\"text.secondary\" gutterBottom>\r\n Using FormInputs directly with useState\r\n </Typography>\r\n <Divider sx={{ my: 2 }} />\r\n\r\n <form onSubmit={handleSubmit}>\r\n <Box\r\n sx={{\r\n display: \"grid\",\r\n gridTemplateColumns: { xs: \"1fr\", md: \"1fr 1fr\" },\r\n gap: 2\r\n }}\r\n >\r\n <Box sx={{ display: \"flex\", flexDirection: \"column\", gap: 1.5 }}>\r\n {/* Text Inputs */}\r\n <TextInputField\r\n name=\"text\"\r\n label=\"Text Field\"\r\n value={formData.text}\r\n onChange={(e) => handleChange(\"text\")(e.target.value)}\r\n error={errors.text ? { message: errors.text } : null}\r\n />\r\n <PasswordField\r\n name=\"password\"\r\n label=\"Password\"\r\n value={formData.password}\r\n onChange={(e) => handleChange(\"password\")(e.target.value)}\r\n error={errors.password ? { message: errors.password } : null}\r\n />\r\n </Box>\r\n\r\n <TextInputField\r\n name=\"textarea\"\r\n label=\"Text Area\"\r\n value={formData.textarea}\r\n onChange={(e) => handleChange(\"textarea\")(e.target.value)}\r\n multiline\r\n rows={4}\r\n />\r\n <Box sx={{ display: \"flex\", flexDirection: \"column\", gap: 1.5 }}>\r\n <NumberField\r\n name=\"number\"\r\n label=\"Number\"\r\n pattern=\"credit-card\"\r\n value={formData.number}\r\n onChange={(e) => handleChange(\"number\")(e.target.value)}\r\n />\r\n <TelInputField\r\n name=\"tel\"\r\n label=\"Telephone\"\r\n pattern=\"XX-XXXX-XXXX\"\r\n value={formData.tel}\r\n onChange={(e) => handleChange(\"tel\")(e.target.value)}\r\n />\r\n </Box>\r\n\r\n <SearchInputField\r\n name=\"search\"\r\n label=\"Search\"\r\n value={formData.search}\r\n onChange={(e) => handleChange(\"search\")(e.target.value)}\r\n />\r\n\r\n <OTPField name=\"otp\" value={formData.otp} onChange={handleChange(\"otp\")} length={6} spacing={2} />\r\n\r\n {/* Dropdowns */}\r\n <SelectInputField\r\n name=\"select\"\r\n label=\"Select\"\r\n value={formData.select}\r\n onChange={(e) => handleChange(\"select\")(e.target.value)}\r\n options={selectOptions}\r\n />\r\n\r\n <SelectInputField\r\n name=\"multiselect\"\r\n label=\"Multi Select\"\r\n value={formData.multiselect}\r\n onChange={(e) => handleChange(\"multiselect\")(e.target.value)}\r\n options={selectOptions}\r\n multiple\r\n />\r\n\r\n <AutoCompleteField\r\n name=\"autocomplete\"\r\n label=\"Autocomplete\"\r\n value={formData.autocomplete}\r\n onChange={(_, newValue) => handleChange(\"autocomplete\")(newValue)}\r\n options={selectOptions}\r\n />\r\n\r\n <AutoCompleteField\r\n name=\"multiautocomplete\"\r\n label=\"Multi Autocomplete\"\r\n value={formData.multiautocomplete}\r\n onChange={(_, newValue) => handleChange(\"multiautocomplete\")(newValue)}\r\n options={selectOptions}\r\n multiple\r\n />\r\n\r\n <ColorPickerField name=\"color\" label=\"Color Picker\" value={formData.color} onChange={handleChange(\"color\")} />\r\n\r\n <FileUploadField name=\"file\" label=\"File Upload\" value={formData.file} onChange={handleChange(\"file\")} />\r\n\r\n {/* Date/Time */}\r\n <DatePickerField name=\"date\" value={formData.date} onChange={handleChange(\"date\")} />\r\n <Box>\r\n <TimePickerField name=\"time\" value={formData.time} onChange={handleChange(\"time\")} />\r\n <Box\r\n sx={{\r\n display: \"grid\",\r\n gridTemplateColumns: { md: \"1fr 1fr\" },\r\n gap: 2,\r\n mt: 2\r\n }}\r\n >\r\n <CheckBoxFieldGroup\r\n name=\"checkboxgroup\"\r\n label=\"Checkbox Group\"\r\n value={formData.checkboxgroup}\r\n onChange={handleChange(\"checkboxgroup\")}\r\n options={checkboxOptions}\r\n />\r\n <RadioButtonFieldGroup\r\n name=\"radiogroup\"\r\n label=\"Radio Group\"\r\n value={formData.radiogroup}\r\n onChange={handleChange(\"radiogroup\")}\r\n options={radioOptions}\r\n />\r\n </Box>\r\n <Box sx={{ display: \"flex\", gap: 2, mt: 2 }}>\r\n <CheckBoxField\r\n name=\"checkbox\"\r\n label=\"Checkbox\"\r\n value={formData.checkbox}\r\n onChange={handleChange(\"checkbox\")}\r\n />\r\n\r\n <RadioButtonField\r\n name=\"singleradio\"\r\n label=\"Radio\"\r\n value={formData.singleradio}\r\n onChange={handleChange(\"singleradio\")}\r\n />\r\n <SwitchField name=\"switch\" label=\"Switch\" value={formData.switch} onChange={handleChange(\"switch\")} />\r\n </Box>\r\n </Box>\r\n <Box sx={{ border: 1, borderColor: \"grey.300\", borderRadius: 1, p: 2 }}>\r\n <TimeClockField\r\n name=\"timeclock\"\r\n label=\"Time Clock\"\r\n value={formData.timeclock}\r\n onChange={handleChange(\"timeclock\")}\r\n />\r\n </Box>\r\n\r\n <Box sx={{ border: 1, borderColor: \"grey.300\", borderRadius: 1, p: 2 }}>\r\n <DateCalendarField\r\n name=\"calendar\"\r\n label=\"Calendar\"\r\n value={formData.calendar}\r\n onChange={handleChange(\"calendar\")}\r\n />\r\n </Box>\r\n\r\n {/* Box Inputs */}\r\n\r\n <SliderField\r\n name=\"slider\"\r\n label=\"Slider\"\r\n value={formData.slider}\r\n onChange={handleChange(\"slider\")}\r\n min={0}\r\n max={100}\r\n />\r\n\r\n <ToggleButtonField\r\n name=\"status\"\r\n label=\"Status\"\r\n value={formData.status}\r\n onChange={handleChange(\"status\")}\r\n options={[\r\n { name: \"Active\", value: \"ACTIVE\", color: \"success\" },\r\n { name: \"Inactive\", value: \"INACTIVE\", color: \"error\" }\r\n ]}\r\n exclusive\r\n fullWidth\r\n />\r\n\r\n <Box\r\n sx={{\r\n gridColumn: { xs: \"1\", md: \"1 / -1\" },\r\n display: \"flex\",\r\n gap: 2,\r\n justifyContent: \"flex-end\"\r\n }}\r\n >\r\n <Button\r\n variant=\"outlined\"\r\n onClick={() =>\r\n setFormData({\r\n text: \"\",\r\n textarea: \"\",\r\n password: \"\",\r\n number: \"\",\r\n tel: \"\",\r\n search: \"\",\r\n otp: \"\",\r\n select: \"\",\r\n multiselect: [],\r\n autocomplete: null,\r\n multiautocomplete: [],\r\n color: \"#000000\",\r\n file: null,\r\n date: null,\r\n time: null,\r\n timeclock: null,\r\n calendar: null,\r\n checkbox: false,\r\n checkboxgroup: [],\r\n switch: false,\r\n slider: 0,\r\n singleradio: false,\r\n radiogroup: \"\",\r\n status: \"ACTIVE\"\r\n })\r\n }\r\n >\r\n Reset\r\n </Button>\r\n <Button type=\"submit\" variant=\"contained\">\r\n Submit\r\n </Button>\r\n </Box>\r\n </Box>\r\n </form>\r\n </Paper>\r\n );\r\n};\r\n\r\nexport default NormalForm;\r\n","\"use client\";\r\nimport {\r\n Checkbox,\r\n type CheckboxProps,\r\n FormControl,\r\n FormControlLabel,\r\n type FormControlLabelProps,\r\n FormHelperText\r\n} from \"@mui/material\";\r\nimport React, { type ChangeEvent, type ForwardedRef, forwardRef } from \"react\";\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n message?: string;\r\n} | null;\r\n\r\n/**\r\n * Extended Checkbox Field Props\r\n * Extends MUI CheckboxProps with custom form field props\r\n */\r\nexport interface ICheckboxFieldProps extends Omit<CheckboxProps, \"checked\" | \"onChange\" | \"name\"> {\r\n /** Field name for form identification */\r\n name?: string;\r\n /** Label text for the checkbox */\r\n label?: React.ReactNode;\r\n /** Current checked state */\r\n value: boolean;\r\n /** Error object with optional message */\r\n error?: FieldError;\r\n /** Helper text to display below checkbox */\r\n helperText?: string;\r\n /** Whether the field is disabled */\r\n disabled?: boolean;\r\n /** Checkbox color */\r\n color?: CheckboxProps[\"color\"];\r\n /** Checkbox size */\r\n size?: CheckboxProps[\"size\"];\r\n /** Full width of the field */\r\n fullWidth?: boolean;\r\n /** Required field indicator */\r\n required?: boolean;\r\n /** Label placement */\r\n labelPlacement?: FormControlLabelProps[\"labelPlacement\"];\r\n /** Callback fired when the value changes */\r\n onChange?: (checked: boolean) => void;\r\n /** Callback fired when checkbox is clicked */\r\n onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\r\n /** Callback fired when checkbox receives focus */\r\n onFocus?: CheckboxProps[\"onFocus\"];\r\n /** Callback fired when checkbox loses focus */\r\n onBlur?: CheckboxProps[\"onBlur\"];\r\n /** Custom icon for checked state */\r\n checkedIcon?: React.ReactNode;\r\n /** Custom icon for unchecked state */\r\n icon?: React.ReactNode;\r\n /** Custom styles for the Checkbox */\r\n checkboxStyles?: CheckboxProps[\"sx\"];\r\n /** Custom styles for FormControlLabel */\r\n labelStyles?: FormControlLabelProps[\"sx\"];\r\n /** Custom styles for FormControl */\r\n formControlStyles?: React.ComponentProps<typeof FormControl>[\"sx\"];\r\n /** Indeterminate state */\r\n indeterminate?: boolean;\r\n /** Custom slot props for MUI v7 */\r\n slotProps?: CheckboxProps[\"slotProps\"];\r\n /** Custom slots for MUI v7 */\r\n slots?: CheckboxProps[\"slots\"];\r\n}\r\n\r\n/**\r\n * Checkbox Field Component\r\n *\r\n * A customizable checkbox field built on top of Material UI Checkbox and FormControl.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a flexible checkbox with support for: error handling, helper text, custom icons,\r\n * styling overrides, label placement, and standard checkbox behaviors. It integrates seamlessly with form\r\n * management libraries like React Hook Form through the use of `forwardRef`.\r\n *\r\n * @param {string} [name] - {string} Field name for form identification\r\n * @param {string | React.ReactNode} [label] - {string | React.ReactNode} Label text for the checkbox\r\n * @param {boolean} value - {boolean} Current checked state (controlled component)\r\n * @param {FieldError} [error] - {FieldError} Error object with optional message\r\n * @param {string} [helperText] - {string} Helper text to display below checkbox\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {'primary'|'secondary'|'success'|'error'|'info'|'warning'} [color='primary'] - {'primary'|'secondary'|'success'|'error'|'info'|'warning'} Checkbox color\r\n * @param {'small'|'medium'|'large'} [size] - {'small'|'medium'|'large'} Checkbox size (maps to 'medium' for 'large')\r\n * @param {boolean} [fullWidth=false] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {'start'|'end'} [labelPlacement='end'] - {'start'|'end'} Label placement relative to checkbox\r\n * @param {(checked: boolean) => void} [onChange] - {(checked: boolean) => void} Callback fired when value changes\r\n * @param {(event: React.MouseEvent<HTMLButtonElement>) => void} [onClick] - {(event: React.MouseEvent<HTMLButtonElement>) => void} Callback fired when clicked\r\n * @param {React.FocusEventHandler<HTMLButtonElement>} [onFocus] - {React.FocusEventHandler<HTMLButtonElement>} Callback when focused\r\n * @param {React.FocusEventHandler<HTMLButtonElement>} [onBlur] - {React.FocusEventHandler<HTMLButtonElement>} Callback when blurred\r\n * @param {React.ReactNode} [checkedIcon] - {React.ReactNode} Custom icon for checked state\r\n * @param {React.ReactNode} [icon] - {React.ReactNode} Custom icon for unchecked state\r\n * @param {React.CSSProperties} [checkboxStyles] - {React.CSSProperties} Custom styles for Checkbox component\r\n * @param {React.CSSProperties} [labelStyles] - {React.CSSProperties} Custom styles for FormControlLabel\r\n * @param {React.CSSProperties} [formControlStyles] - {React.CSSProperties} Custom styles for FormControl container\r\n * @param {boolean} [indeterminate=false] - {boolean} Indeterminate state\r\n * @param {Object} [slotProps] - {Object} Custom slot props\r\n * @param {Object} [slots] - {Object} Custom slots\r\n *\r\n * @returns {JSX.Element} The Checkbox Field component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import CheckboxField from \"@react-solutions/inputs\";\r\n * import { useState } from \"react\";\r\n *\r\n * function MyForm() {\r\n * const [isChecked, setIsChecked] = useState(false);\r\n *\r\n * return (\r\n * <CheckboxField\r\n * name=\"myCheckbox\"\r\n * label=\"Accept terms\"\r\n * value={isChecked}\r\n * onChange={(checked) => setIsChecked(checked)}\r\n * error={error}\r\n * helperText={helperText}\r\n * required\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst CheckboxField = forwardRef<HTMLButtonElement, ICheckboxFieldProps>(\r\n (\r\n {\r\n name,\r\n label,\r\n value,\r\n onChange,\r\n onClick,\r\n onFocus,\r\n onBlur,\r\n error,\r\n helperText,\r\n disabled = false,\r\n color = \"primary\",\r\n size,\r\n fullWidth = false,\r\n required,\r\n labelPlacement = \"end\",\r\n checkedIcon,\r\n icon,\r\n indeterminate = false,\r\n checkboxStyles,\r\n labelStyles,\r\n formControlStyles,\r\n slotProps,\r\n slots,\r\n ...checkboxProps\r\n },\r\n ref: ForwardedRef<HTMLButtonElement>\r\n ) => {\r\n // Handle onChange with proper typing\r\n const handleChange = (_event: ChangeEvent<HTMLInputElement>, checked: boolean) => {\r\n if (onChange) {\r\n onChange(checked);\r\n }\r\n };\r\n\r\n // Handle click event\r\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\r\n if (onClick) {\r\n onClick(event);\r\n }\r\n };\r\n\r\n return (\r\n <FormControl\r\n error={!!error}\r\n disabled={disabled}\r\n required={required}\r\n fullWidth={fullWidth}\r\n size={size === \"large\" ? \"medium\" : size}\r\n sx={formControlStyles}\r\n >\r\n <FormControlLabel\r\n control={\r\n <Checkbox\r\n {...checkboxProps}\r\n checked={value}\r\n indeterminate={indeterminate}\r\n onChange={handleChange}\r\n onClick={handleClick}\r\n onFocus={onFocus}\r\n onBlur={onBlur}\r\n disabled={disabled}\r\n color={color}\r\n size={size}\r\n checkedIcon={checkedIcon}\r\n icon={icon}\r\n name={name}\r\n slotProps={slotProps}\r\n slots={slots}\r\n sx={checkboxStyles}\r\n ref={ref}\r\n />\r\n }\r\n label={label}\r\n labelPlacement={labelPlacement}\r\n sx={labelStyles}\r\n />\r\n {error && <FormHelperText>{helperText ?? (error?.message ? error.message : \"\")}</FormHelperText>}\r\n {!error && helperText && <FormHelperText>{helperText}</FormHelperText>}\r\n </FormControl>\r\n );\r\n }\r\n);\r\n\r\nCheckboxField.displayName = \"CheckboxField\";\r\n\r\nexport default CheckboxField;\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\n\"use client\";\r\nimport {\r\n Box,\r\n Checkbox,\r\n type CheckboxProps,\r\n FormControl,\r\n FormControlLabel,\r\n type FormControlLabelProps,\r\n type FormControlProps,\r\n FormHelperText,\r\n FormLabel,\r\n type FormLabelProps,\r\n type SxProps,\r\n type Theme\r\n} from \"@mui/material\";\r\nimport React, { type ChangeEvent, type FocusEvent, type ForwardedRef, forwardRef } from \"react\";\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n message?: string;\r\n} | null;\r\n\r\n/**\r\n * Checkbox option type\r\n */\r\nexport type CheckboxOption = {\r\n value: string | number;\r\n label: React.ReactNode;\r\n disabled?: boolean;\r\n};\r\n\r\n/**\r\n * Extended Checkbox Group Field Props\r\n */\r\nexport interface ICheckboxFieldGroupProps extends Omit<\r\n FormControlProps,\r\n \"error\" | \"disabled\" | \"required\" | \"fullWidth\" | \"color\" | \"size\" | \"onChange\" | \"onFocus\" | \"onBlur\" | \"onClick\"\r\n> {\r\n /** Field name for form identification */\r\n name?: string;\r\n /** Label text for the checkbox group */\r\n label?: React.ReactNode;\r\n /** Array of selected values */\r\n value: (string | number)[];\r\n /** Array of checkbox options */\r\n options: CheckboxOption[];\r\n /** Error object with optional message */\r\n error?: FieldError;\r\n /** Helper text to display below field */\r\n helperText?: string;\r\n /** Whether the field is disabled */\r\n disabled?: boolean;\r\n /** Full width of the field */\r\n fullWidth?: boolean;\r\n /** Required field indicator */\r\n required?: boolean;\r\n /** Checkbox color */\r\n color?: CheckboxProps[\"color\"];\r\n /** Checkbox size */\r\n size?: CheckboxProps[\"size\"];\r\n /** Label placement relative to checkbox */\r\n labelPlacement?: FormControlLabelProps[\"labelPlacement\"];\r\n /** Whether to display checkboxes in a row */\r\n row?: boolean;\r\n /** Custom icon for checked state */\r\n checkedIcon?: React.ReactNode;\r\n /** Custom icon for unchecked state */\r\n icon?: React.ReactNode;\r\n /** Custom styles for individual checkboxes */\r\n checkboxStyles?: CheckboxProps[\"sx\"];\r\n /** Custom styles for checkbox labels */\r\n labelStyles?: FormControlLabelProps[\"sx\"];\r\n /** Custom styles for FormControl */\r\n formControlStyles?: FormControlProps[\"sx\"];\r\n /** Custom styles for FormLabel */\r\n formLabelStyles?: FormLabelProps[\"sx\"];\r\n /** Callback fired when the value changes */\r\n onChange?: (value: (string | number)[]) => void;\r\n /** Callback fired when a checkbox receives focus */\r\n onFocus?: (event: FocusEvent<HTMLButtonElement>, value: string | number) => void;\r\n /** Callback fired when a checkbox loses focus */\r\n onBlur?: (event: FocusEvent<HTMLButtonElement>, value: string | number) => void;\r\n /** Callback fired when a checkbox is clicked */\r\n onClick?: (event: React.MouseEvent<HTMLButtonElement>, value: string | number) => void;\r\n /** Custom render function for checkboxes */\r\n renderCheckbox?: (\r\n option: CheckboxOption,\r\n index: number,\r\n isChecked: boolean,\r\n handleChange: (event: ChangeEvent<HTMLInputElement>) => void\r\n ) => React.ReactNode;\r\n /** Custom slot props for MUI v7 */\r\n slotProps?: {\r\n checkbox?: CheckboxProps[\"slotProps\"];\r\n formControlLabel?: FormControlLabelProps[\"slotProps\"];\r\n };\r\n /** Custom slots for MUI v7 */\r\n slots?: {\r\n checkbox?: CheckboxProps[\"slots\"];\r\n };\r\n /** FormLabel props */\r\n formLabelProps?: Omit<FormLabelProps, \"children\">;\r\n /** FormControlLabel props */\r\n formControlLabelProps?: Omit<FormControlLabelProps, \"control\" | \"label\" | \"value\">;\r\n /** xsProps */\r\n sxProps?: SxProps<Theme>;\r\n}\r\n\r\n/**\r\n * Checkbox Field Group Component\r\n *\r\n * A customizable group of checkboxes built on top of Material UI Checkbox and FormControl.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a group of flexible checkboxes with support for: error handling, helper text, custom icons,\r\n * styling overrides, label placement, row/column layout, and standard checkbox behaviors. It integrates seamlessly with form\r\n * management libraries like React Hook Form through the use of `forwardRef`.\r\n *\r\n * @param {string} [name] - {string} Field name for form identification\r\n * @param {string | React.ReactNode} [label] - {string | React.ReactNode} Label text for the checkbox group\r\n * @param {(string | number)[]} value - {(string | number)[]} Array of selected values (controlled component)\r\n * @param {CheckboxOption[]} options - {CheckboxOption[]} Array of checkbox options\r\n * @param {FieldError} [error] - {FieldError} Error object with optional message\r\n * @param {string} [helperText] - {string} Helper text to display below field\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {boolean} [fullWidth=true] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {'primary'|'secondary'|'success'|'error'|'info'|'warning'} [color='primary'] - {'primary'|'secondary'|'success'|'error'|'info'|'warning'} Checkbox color\r\n * @param {'small'|'medium'|'large'} [size] - {'small'|'medium'|'large'} Checkbox size\r\n * @param {'start'|'end'} [labelPlacement='end'] - {'start'|'end'} Label placement relative to checkbox\r\n * @param {boolean} [row=false] - {boolean} Whether to display checkboxes in a row\r\n * @param {React.ReactNode} [checkedIcon] - {React.ReactNode} Custom icon for checked state\r\n * @param {React.ReactNode} [icon] - {React.ReactNode} Custom icon for unchecked state\r\n * @param {SxProps<Theme>} [checkboxStyles] - {SxProps<Theme>} Custom styles for individual checkboxes\r\n * @param {SxProps<Theme>} [labelStyles] - {SxProps<Theme>} Custom styles for checkbox labels\r\n * @param {SxProps<Theme>} [formControlStyles] - {SxProps<Theme>} Custom styles for FormControl container\r\n * @param {SxProps<Theme>} [formLabelStyles] - {SxProps<Theme>} Custom styles for FormLabel\r\n * @param {(value: (string | number)[]) => void} [onChange] - {(value: (string | number)[]) => void} Callback fired when value changes\r\n * @param {Function} [onFocus] - {Function} Callback when focused\r\n * @param {Function} [onBlur] - {Function} Callback when blurred\r\n * @param {Function} [onClick] - {Function} Callback when clicked\r\n * @param {Function} [renderCheckbox] - {Function} Custom render function for checkboxes\r\n * @param {Object} [slotProps] - {Object} Custom slot props\r\n * @param {Object} [slots] - {Object} Custom slots\r\n * @param {SxProps<Theme>} [sxProps] - {SxProps<Theme>} Custom styles for the Box container\r\n *\r\n * @returns {JSX.Element} The Checkbox Field Group component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import CheckboxFieldGroup from \"@react-solutions/inputs\";\r\n * import { useState } from \"react\";\r\n *\r\n * function MyForm() {\r\n * const [values, setValues] = useState([\"opt1\"]);\r\n * const options = [\r\n * { value: \"opt1\", label: \"Option 1\" },\r\n * { value: \"opt2\", label: \"Option 2\" }\r\n * ];\r\n *\r\n * return (\r\n * <CheckboxFieldGroup\r\n * name=\"myCheckGroup\"\r\n * label=\"Select options\"\r\n * value={values}\r\n * options={options}\r\n * onChange={(newValues) => setValues(newValues)}\r\n * row\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst CheckboxFieldGroup = forwardRef<HTMLDivElement, ICheckboxFieldGroupProps>(\r\n (\r\n {\r\n name,\r\n label,\r\n value,\r\n options,\r\n onChange,\r\n onFocus,\r\n onBlur,\r\n onClick,\r\n error,\r\n helperText,\r\n disabled = false,\r\n fullWidth = true,\r\n required,\r\n color = \"primary\",\r\n size,\r\n labelPlacement = \"end\",\r\n row = false,\r\n checkedIcon,\r\n icon,\r\n checkboxStyles,\r\n labelStyles,\r\n formControlStyles,\r\n renderCheckbox,\r\n slotProps,\r\n sxProps,\r\n slots,\r\n formLabelStyles,\r\n formLabelProps,\r\n formControlLabelProps,\r\n ...formControlProps\r\n },\r\n ref: ForwardedRef<HTMLDivElement>\r\n ) => {\r\n // Handle checkbox change\r\n const handleChange = (optionValue: string | number) => (event: ChangeEvent<HTMLInputElement>) => {\r\n if (disabled) {\r\n return;\r\n }\r\n\r\n const isChecked = event.target.checked;\r\n let newValue: (string | number)[];\r\n\r\n if (isChecked) {\r\n // Add to selection\r\n newValue = [...value, optionValue];\r\n } else {\r\n // Remove from selection\r\n newValue = value.filter((val) => val !== optionValue);\r\n }\r\n\r\n if (onChange) {\r\n onChange(newValue);\r\n }\r\n };\r\n\r\n // Handle focus\r\n const handleFocus = (optionValue: string | number) => (event: FocusEvent<HTMLButtonElement>) => {\r\n if (onFocus) {\r\n onFocus(event, optionValue);\r\n }\r\n };\r\n\r\n // Handle blur\r\n const handleBlur = (optionValue: string | number) => (event: FocusEvent<HTMLButtonElement>) => {\r\n if (onBlur) {\r\n onBlur(event, optionValue);\r\n }\r\n };\r\n\r\n // Handle click\r\n const handleClick = (optionValue: string | number) => (event: React.MouseEvent<HTMLButtonElement>) => {\r\n if (onClick) {\r\n onClick(event, optionValue);\r\n }\r\n };\r\n\r\n // Default render function for checkboxes\r\n const defaultRenderCheckbox = (\r\n option: CheckboxOption,\r\n index: number,\r\n isChecked: boolean,\r\n handleChangeFn: (event: ChangeEvent<HTMLInputElement>) => void\r\n ) => {\r\n return (\r\n <FormControlLabel\r\n key={`${option.value}-${index}`}\r\n control={\r\n <Checkbox\r\n name={name ? `${name}-${option.value}` : undefined}\r\n checked={isChecked}\r\n onChange={handleChangeFn}\r\n onFocus={handleFocus(option.value)}\r\n onBlur={handleBlur(option.value)}\r\n onClick={handleClick(option.value)}\r\n disabled={disabled || option.disabled}\r\n color={color}\r\n size={size}\r\n checkedIcon={checkedIcon}\r\n icon={icon}\r\n slotProps={slotProps?.checkbox}\r\n slots={slots?.checkbox}\r\n sx={checkboxStyles}\r\n />\r\n }\r\n label={option.label}\r\n labelPlacement={labelPlacement}\r\n slotProps={slotProps?.formControlLabel}\r\n sx={labelStyles}\r\n {...formControlLabelProps}\r\n />\r\n );\r\n };\r\n\r\n return (\r\n <FormControl\r\n {...(formControlProps as any)}\r\n error={!!error}\r\n disabled={disabled}\r\n required={required}\r\n fullWidth={fullWidth}\r\n component=\"fieldset\"\r\n sx={formControlStyles}\r\n >\r\n {label && (\r\n <FormLabel component=\"legend\" sx={formLabelStyles} {...formLabelProps}>\r\n {label}\r\n </FormLabel>\r\n )}\r\n <Box\r\n ref={ref}\r\n sx={{\r\n display: \"flex\",\r\n flexDirection: row ? \"row\" : \"column\",\r\n flexWrap: row ? \"wrap\" : \"nowrap\",\r\n gap: 1,\r\n mt: label ? 1 : 0,\r\n ...sxProps\r\n }}\r\n >\r\n {options.map((option, index) => {\r\n const isChecked = value.includes(option.value);\r\n const changeHandler = handleChange(option.value);\r\n\r\n if (renderCheckbox) {\r\n return renderCheckbox(option, index, isChecked, changeHandler);\r\n }\r\n\r\n return defaultRenderCheckbox(option, index, isChecked, changeHandler);\r\n })}\r\n </Box>\r\n {error && <FormHelperText>{helperText ?? (error?.message ? error.message : \"\")}</FormHelperText>}\r\n {!error && helperText && <FormHelperText>{helperText}</FormHelperText>}\r\n </FormControl>\r\n );\r\n }\r\n);\r\n\r\nCheckboxFieldGroup.displayName = \"CheckboxFieldGroup\";\r\n\r\nexport default CheckboxFieldGroup;\r\n","\"use client\";\r\nimport {\r\n FormControl,\r\n FormControlLabel,\r\n type FormControlLabelProps,\r\n FormHelperText,\r\n Radio,\r\n type RadioProps\r\n} from \"@mui/material\";\r\nimport React, { type ChangeEvent, type ForwardedRef, forwardRef } from \"react\";\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n message?: string;\r\n} | null;\r\n\r\n/**\r\n * Extended Radio Button Field Props\r\n * Extends MUI RadioProps with custom form field props\r\n */\r\nexport interface IRadioButtonFieldProps extends Omit<RadioProps, \"checked\" | \"onChange\" | \"name\"> {\r\n /** Field name for form identification */\r\n name?: string;\r\n /** Label text for the radio button */\r\n label?: React.ReactNode;\r\n /** Current checked state */\r\n value: boolean;\r\n /** Error object with optional message */\r\n error?: FieldError;\r\n /** Helper text to display below radio button */\r\n helperText?: string;\r\n /** Whether the field is disabled */\r\n disabled?: boolean;\r\n /** Radio color */\r\n color?: RadioProps[\"color\"];\r\n /** Radio size */\r\n size?: RadioProps[\"size\"];\r\n /** Full width of the field */\r\n fullWidth?: boolean;\r\n /** Required field indicator */\r\n required?: boolean;\r\n /** Label placement */\r\n labelPlacement?: FormControlLabelProps[\"labelPlacement\"];\r\n /** Callback fired when the value changes */\r\n onChange?: (checked: boolean) => void;\r\n /** Callback fired when radio button is clicked */\r\n onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\r\n /** Callback fired when radio button receives focus */\r\n onFocus?: RadioProps[\"onFocus\"];\r\n /** Callback fired when radio button loses focus */\r\n onBlur?: RadioProps[\"onBlur\"];\r\n /** Custom icon for checked state */\r\n checkedIcon?: React.ReactNode;\r\n /** Custom icon for unchecked state */\r\n icon?: React.ReactNode;\r\n /** Custom styles for the Radio */\r\n radioStyles?: RadioProps[\"sx\"];\r\n /** Custom styles for FormControlLabel */\r\n labelStyles?: FormControlLabelProps[\"sx\"];\r\n /** Custom styles for FormControl */\r\n formControlStyles?: React.ComponentProps<typeof FormControl>[\"sx\"];\r\n /** Custom slot props for MUI v7 */\r\n slotProps?: RadioProps[\"slotProps\"];\r\n /** Custom slots for MUI v7 */\r\n slots?: RadioProps[\"slots\"];\r\n /** FormControlLabel props */\r\n formControlLabelProps?: Omit<FormControlLabelProps, \"control\" | \"label\" | \"value\">;\r\n}\r\n\r\n/**\r\n * Radio Button Field Component\r\n *\r\n * A customizable radio button field built on top of Material UI Radio and FormControl.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a flexible radio button with support for: error handling, helper text, custom icons,\r\n * styling overrides, label placement, and standard radio behaviors. It integrates seamlessly with form\r\n * management libraries like React Hook Form through the use of `forwardRef`.\r\n *\r\n * @param {string} [name] - {string} Field name for form identification\r\n * @param {string | React.ReactNode} [label] - {string | React.ReactNode} Label text for the radio button\r\n * @param {boolean} value - {boolean} Current checked state (controlled component)\r\n * @param {FieldError} [error] - {FieldError} Error object with optional message\r\n * @param {string} [helperText] - {string} Helper text to display below radio button\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {'primary'|'secondary'|'success'|'error'|'info'|'warning'} [color='primary'] - {'primary'|'secondary'|'success'|'error'|'info'|'warning'} Radio color\r\n * @param {'small'|'medium'|'large'} [size] - {'small'|'medium'|'large'} Radio size\r\n * @param {boolean} [fullWidth=false] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {'start'|'end'} [labelPlacement='end'] - {'start'|'end'} Label placement relative to radio button\r\n * @param {(checked: boolean) => void} [onChange] - {(checked: boolean) => void} Callback fired when value changes\r\n * @param {(event: React.MouseEvent<HTMLButtonElement>) => void} [onClick] - {(event: React.MouseEvent<HTMLButtonElement>) => void} Callback fired when clicked\r\n * @param {React.FocusEventHandler<HTMLButtonElement>} [onFocus] - {React.FocusEventHandler<HTMLButtonElement>} Callback when focused\r\n * @param {React.FocusEventHandler<HTMLButtonElement>} [onBlur] - {React.FocusEventHandler<HTMLButtonElement>} Callback when blurred\r\n * @param {React.ReactNode} [checkedIcon] - {React.ReactNode} Custom icon for checked state\r\n * @param {React.ReactNode} [icon] - {React.ReactNode} Custom icon for unchecked state\r\n * @param {React.CSSProperties} [radioStyles] - {React.CSSProperties} Custom styles for Radio component\r\n * @param {React.CSSProperties} [labelStyles] - {React.CSSProperties} Custom styles for FormControlLabel\r\n * @param {React.CSSProperties} [formControlStyles] - {React.CSSProperties} Custom styles for FormControl container\r\n * @param {Object} [slotProps] - {Object} Custom slot props\r\n * @param {Object} [slots] - {Object} Custom slots\r\n *\r\n * @returns {JSX.Element} The Radio Button Field component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import RadioButtonField from \"@react-solutions/inputs\";\r\n * import { useState } from \"react\";\r\n *\r\n * function MyForm() {\r\n * const [isSelected, setIsSelected] = useState(false);\r\n *\r\n * return (\r\n * <RadioButtonField\r\n * name=\"myRadio\"\r\n * label=\"Option 1\"\r\n * value={isSelected}\r\n * onChange={(checked) => setIsSelected(checked)}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst RadioButtonField = forwardRef<HTMLButtonElement, IRadioButtonFieldProps>(\r\n (\r\n {\r\n name,\r\n label,\r\n value,\r\n onChange,\r\n onClick,\r\n onFocus,\r\n onBlur,\r\n error,\r\n helperText,\r\n disabled = false,\r\n color = \"primary\",\r\n size,\r\n fullWidth = false,\r\n required,\r\n labelPlacement = \"end\",\r\n checkedIcon,\r\n icon,\r\n radioStyles,\r\n labelStyles,\r\n formControlStyles,\r\n slotProps,\r\n slots,\r\n formControlLabelProps,\r\n ...radioProps\r\n },\r\n ref: ForwardedRef<HTMLButtonElement>\r\n ) => {\r\n // Handle onChange with proper typing\r\n const handleChange = (_event: ChangeEvent<HTMLInputElement>, checked: boolean) => {\r\n if (onChange) {\r\n onChange(checked);\r\n }\r\n };\r\n\r\n // Handle click event\r\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\r\n if (onClick) {\r\n onClick(event);\r\n }\r\n };\r\n\r\n return (\r\n <FormControl\r\n error={!!error}\r\n disabled={disabled}\r\n required={required}\r\n fullWidth={fullWidth}\r\n size={size}\r\n sx={formControlStyles}\r\n >\r\n <FormControlLabel\r\n control={\r\n <Radio\r\n {...radioProps}\r\n checked={value}\r\n onChange={handleChange}\r\n onClick={handleClick}\r\n onFocus={onFocus}\r\n onBlur={onBlur}\r\n disabled={disabled}\r\n color={color}\r\n size={size}\r\n checkedIcon={checkedIcon}\r\n icon={icon}\r\n name={name}\r\n slotProps={slotProps}\r\n slots={slots}\r\n sx={radioStyles}\r\n ref={ref}\r\n />\r\n }\r\n label={label}\r\n labelPlacement={labelPlacement}\r\n sx={labelStyles}\r\n {...formControlLabelProps}\r\n />\r\n {error && <FormHelperText>{helperText ?? (error?.message ? error.message : \"\")}</FormHelperText>}\r\n {!error && helperText && <FormHelperText>{helperText}</FormHelperText>}\r\n </FormControl>\r\n );\r\n }\r\n);\r\n\r\nRadioButtonField.displayName = \"RadioButtonField\";\r\n\r\nexport default RadioButtonField;\r\n","\"use client\";\r\nimport {\r\n FormControl,\r\n FormControlLabel,\r\n type FormControlLabelProps,\r\n type FormControlProps,\r\n FormHelperText,\r\n FormLabel,\r\n type FormLabelProps,\r\n Radio,\r\n RadioGroup,\r\n type RadioGroupProps,\r\n type RadioProps,\r\n type SxProps,\r\n type Theme\r\n} from \"@mui/material\";\r\nimport React, { type ChangeEvent, type ForwardedRef, forwardRef } from \"react\";\r\n\r\n/**\r\n * Base option type for Radio Button Group\r\n */\r\nexport type RadioOption = {\r\n name: string;\r\n value: string | number;\r\n disabled?: boolean;\r\n [key: string]: unknown;\r\n};\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n message?: string;\r\n} | null;\r\n\r\n/**\r\n * Extended Radio Button Group Props\r\n * Extends MUI RadioGroupProps with custom form field props\r\n */\r\nexport interface IRadioButtonGroupFieldProps extends Omit<\r\n RadioGroupProps,\r\n \"value\" | \"onChange\" | \"name\" | \"children\" | \"onFocus\" | \"onBlur\" | \"onClick\"\r\n> {\r\n /** Field name for form identification */\r\n name?: string;\r\n /** Label text for the radio group */\r\n label?: React.ReactNode;\r\n /** Current selected value */\r\n value: string | number | null | undefined;\r\n /** Options array to display as radio buttons */\r\n options: RadioOption[];\r\n /** Error object with optional message */\r\n error?: FieldError;\r\n /** Helper text to display below radio group */\r\n helperText?: string;\r\n /** Whether the field is disabled */\r\n disabled?: boolean;\r\n /** Radio color */\r\n color?: RadioProps[\"color\"];\r\n /** Radio size */\r\n size?: RadioProps[\"size\"];\r\n /** Full width of the field */\r\n fullWidth?: boolean;\r\n /** Required field indicator */\r\n required?: boolean;\r\n /** Label placement for each radio button */\r\n labelPlacement?: FormControlLabelProps[\"labelPlacement\"];\r\n /** Row layout (horizontal) or column layout (vertical) */\r\n row?: boolean;\r\n /** Custom icon for checked state */\r\n checkedIcon?: React.ReactNode;\r\n /** Custom icon for unchecked state */\r\n icon?: React.ReactNode;\r\n /** Custom styles for individual Radio components */\r\n radioStyles?: RadioProps[\"sx\"];\r\n /** Custom styles for FormControlLabel components */\r\n labelStyles?: FormControlLabelProps[\"sx\"];\r\n /** Custom styles for FormControl */\r\n formControlStyles?: FormControlProps[\"sx\"];\r\n /** Custom styles for FormLabel */\r\n formLabelStyles?: FormLabelProps[\"sx\"];\r\n /** Custom styles for RadioGroup */\r\n radioGroupStyles?: RadioGroupProps[\"sx\"];\r\n /** Custom render function for radio buttons */\r\n renderRadio?: (option: RadioOption, index: number) => React.ReactNode;\r\n /** Callback fired when the value changes */\r\n onChange?: (value: string | number) => void;\r\n /** Callback fired when a radio button is clicked */\r\n onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\r\n /** Callback fired when a radio button receives focus */\r\n onFocus?: RadioProps[\"onFocus\"];\r\n /** Callback fired when a radio button loses focus */\r\n onBlur?: RadioProps[\"onBlur\"];\r\n /** Custom slot props for MUI v7 */\r\n slotProps?: {\r\n radio?: RadioProps[\"slotProps\"];\r\n formControlLabel?: FormControlLabelProps[\"slotProps\"];\r\n };\r\n /** Custom slots for MUI v7 */\r\n slots?: {\r\n radio?: RadioProps[\"slots\"];\r\n formControlLabel?: FormControlLabelProps[\"slots\"];\r\n };\r\n /** FormLabel props */\r\n formLabelProps?: Omit<FormLabelProps, \"children\">;\r\n /** FormControlLabel props */\r\n formControlLabelProps?: Omit<FormControlLabelProps, \"control\" | \"label\" | \"value\">;\r\n /** Custom styles for RadioGroup */\r\n sxProps?: SxProps<Theme>;\r\n}\r\n\r\n/**\r\n * Radio Button Field Group Component\r\n *\r\n * A customizable group of radio buttons built on top of Material UI RadioGroup and FormControl.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a group of flexible radio buttons with support for: error handling, helper text, custom icons,\r\n * styling overrides, label placement, row/column layout, and standard radio behaviors. It integrates seamlessly with form\r\n * management libraries like React Hook Form through the use of `forwardRef`.\r\n *\r\n * @param {string} [name] - {string} Field name for form identification\r\n * @param {string | React.ReactNode} [label] - {string | React.ReactNode} Label text for the radio group\r\n * @param {string | number | null | undefined} value - {string | number | null | undefined} Current selected value (controlled component)\r\n * @param {RadioOption[]} options - {RadioOption[]} Array of radio options\r\n * @param {FieldError} [error] - {FieldError} Error object with optional message\r\n * @param {string} [helperText] - {string} Helper text to display below radio group\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {'primary'|'secondary'|'success'|'error'|'info'|'warning'} [color='primary'] - {'primary'|'secondary'|'success'|'error'|'info'|'warning'} Radio color\r\n * @param {'small'|'medium'|'large'} [size] - {'small'|'medium'|'large'} Radio size\r\n * @param {boolean} [fullWidth=false] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {'start'|'end'} [labelPlacement='end'] - {'start'|'end'} Label placement relative to each radio button\r\n * @param {boolean} [row=false] - {boolean} Row layout (horizontal) or column layout (vertical)\r\n * @param {React.ReactNode} [checkedIcon] - {React.ReactNode} Custom icon for checked state\r\n * @param {React.ReactNode} [icon] - {React.ReactNode} Custom icon for unchecked state\r\n * @param {RadioProps[\"sx\"]} [radioStyles] - {RadioProps[\"sx\"]} Custom styles for individual Radio components\r\n * @param {FormControlLabelProps[\"sx\"]} [labelStyles] - {FormControlLabelProps[\"sx\"]} Custom styles for FormControlLabel components\r\n * @param {FormControlProps[\"sx\"]} [formControlStyles] - {FormControlProps[\"sx\"]} Custom styles for FormControl\r\n * @param {FormLabelProps[\"sx\"]} [formLabelStyles] - {FormLabelProps[\"sx\"]} Custom styles for FormLabel\r\n * @param {RadioGroupProps[\"sx\"]} [radioGroupStyles] - {RadioGroupProps[\"sx\"]} Custom styles for RadioGroup\r\n * @param {(value: string | number) => void} [onChange] - {(value: string | number) => void} Callback fired when value changes\r\n * @param {(event: React.MouseEvent<HTMLButtonElement>) => void} [onClick] - {(event: React.MouseEvent<HTMLButtonElement>) => void} Callback fired when a radio button is clicked\r\n * @param {RadioProps[\"onFocus\"]} [onFocus] - {RadioProps[\"onFocus\"]} Callback when focused\r\n * @param {RadioProps[\"onBlur\"]} [onBlur] - {RadioProps[\"onBlur\"]} Callback when blurred\r\n * @param {(option: RadioOption, index: number) => React.ReactNode} [renderRadio] - {(option: RadioOption, index: number) => React.ReactNode} Custom render function for radio buttons\r\n * @param {Object} [slotProps] - {Object} Custom slot props\r\n * @param {Object} [slots] - {Object} Custom slots\r\n * @param {SxProps<Theme>} [sxProps] - {SxProps<Theme>} Custom styles for RadioGroup container\r\n *\r\n * @returns {JSX.Element} The Radio Button Field Group component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import RadioButtonFieldGroup from \"@react-solutions/inputs\";\r\n * import { useState } from \"react\";\r\n *\r\n * function MyForm() {\r\n * const [value, setValue] = useState(\"opt1\");\r\n * const options = [\r\n * { name: \"Option 1\", value: \"opt1\" },\r\n * { name: \"Option 2\", value: \"opt2\" }\r\n * ];\r\n *\r\n * return (\r\n * <RadioButtonFieldGroup\r\n * name=\"myRadioGroup\"\r\n * label=\"Select an option\"\r\n * value={value}\r\n * options={options}\r\n * onChange={(val) => setValue(val)}\r\n * row\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst RadioButtonFieldGroup = forwardRef<HTMLDivElement, IRadioButtonGroupFieldProps>(\r\n (\r\n {\r\n name,\r\n label,\r\n value,\r\n onChange,\r\n onClick,\r\n onFocus,\r\n onBlur,\r\n options,\r\n error,\r\n helperText,\r\n disabled = false,\r\n color = \"primary\",\r\n size,\r\n fullWidth = false,\r\n required,\r\n labelPlacement = \"end\",\r\n row = false,\r\n checkedIcon,\r\n icon,\r\n radioStyles,\r\n labelStyles,\r\n formControlStyles,\r\n formLabelStyles,\r\n renderRadio,\r\n sxProps,\r\n slotProps,\r\n slots,\r\n formLabelProps,\r\n formControlLabelProps,\r\n ...radioGroupProps\r\n },\r\n ref: ForwardedRef<HTMLDivElement>\r\n ) => {\r\n // Handle onChange with proper typing\r\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\r\n const newValue = event.target.value;\r\n // Convert to number if the value matches a numeric option\r\n const numericValue = options.find((opt) => String(opt.value) === newValue)?.value;\r\n const finalValue = typeof numericValue === \"number\" ? numericValue : newValue;\r\n if (onChange) {\r\n onChange(finalValue);\r\n }\r\n };\r\n\r\n // Handle click event\r\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\r\n if (onClick) {\r\n onClick(event);\r\n }\r\n };\r\n\r\n // Default render function for radio buttons\r\n const defaultRenderRadio = (option: RadioOption) => (\r\n <FormControlLabel\r\n key={option.value}\r\n value={String(option.value)}\r\n control={\r\n <Radio\r\n color={color}\r\n size={size}\r\n disabled={disabled || option.disabled}\r\n checkedIcon={checkedIcon}\r\n icon={icon}\r\n onClick={handleClick}\r\n onFocus={onFocus}\r\n onBlur={onBlur}\r\n slotProps={slotProps?.radio}\r\n slots={slots?.radio}\r\n sx={radioStyles}\r\n />\r\n }\r\n label={option.name}\r\n labelPlacement={labelPlacement}\r\n disabled={disabled || option.disabled}\r\n sx={labelStyles}\r\n {...formControlLabelProps}\r\n slotProps={slotProps?.formControlLabel}\r\n slots={slots?.formControlLabel}\r\n />\r\n );\r\n\r\n return (\r\n <FormControl\r\n component=\"fieldset\"\r\n error={!!error}\r\n disabled={disabled}\r\n required={required}\r\n fullWidth={fullWidth}\r\n sx={formControlStyles}\r\n >\r\n {label && (\r\n <FormLabel component=\"legend\" sx={formLabelStyles} {...formLabelProps}>\r\n {label}\r\n </FormLabel>\r\n )}\r\n <RadioGroup\r\n name={name}\r\n value={value !== null ? String(value) : \"\"}\r\n onChange={handleChange}\r\n row={row}\r\n ref={ref}\r\n sx={sxProps}\r\n {...radioGroupProps}\r\n >\r\n {options &&\r\n Array.isArray(options) &&\r\n options.map((option, index) => (renderRadio ? renderRadio(option, index) : defaultRenderRadio(option)))}\r\n </RadioGroup>\r\n {error && <FormHelperText>{helperText ?? (error?.message ? error.message : \"\")}</FormHelperText>}\r\n {!error && helperText && <FormHelperText>{helperText}</FormHelperText>}\r\n </FormControl>\r\n );\r\n }\r\n);\r\n\r\nRadioButtonFieldGroup.displayName = \"RadioButtonFieldGroup\";\r\n\r\nexport default RadioButtonFieldGroup;\r\n","\"use client\";\r\nimport {\r\n FormControl,\r\n type FormControlProps,\r\n FormHelperText,\r\n FormLabel,\r\n type FormLabelProps,\r\n Slider,\r\n type SliderProps\r\n} from \"@mui/material\";\r\nimport React, { type ForwardedRef, forwardRef, type SyntheticEvent } from \"react\";\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n message?: string;\r\n} | null;\r\n\r\n/**\r\n * Extended Slider Field Props\r\n * Extends MUI SliderProps with custom form field props\r\n */\r\nexport interface ISliderFieldProps extends Omit<\r\n SliderProps,\r\n \"value\" | \"onChange\" | \"onChangeCommitted\" | \"name\" | \"orientation\"\r\n> {\r\n /** Field name for form identification */\r\n name?: string;\r\n /** Label text for the slider */\r\n label?: React.ReactNode;\r\n /** Current slider value(s) */\r\n value: number | number[];\r\n /** Error object with optional message */\r\n error?: FieldError;\r\n /** Helper text to display below slider */\r\n helperText?: string;\r\n /** Whether the field is disabled */\r\n disabled?: boolean;\r\n /** Full width of the field */\r\n fullWidth?: boolean;\r\n /** Required field indicator */\r\n required?: boolean;\r\n /** Slider orientation - horizontal or vertical */\r\n orientation?: \"horizontal\" | \"vertical\";\r\n /** Minimum value (default: 0) */\r\n min?: number;\r\n /** Maximum value (default: 100) */\r\n max?: number;\r\n /** Step value (default: 1) */\r\n step?: number | null;\r\n /** Whether to show value label */\r\n valueLabelDisplay?: SliderProps[\"valueLabelDisplay\"];\r\n /** Custom format for value label */\r\n valueLabelFormat?: SliderProps[\"valueLabelFormat\"];\r\n /** Slider color */\r\n color?: SliderProps[\"color\"];\r\n /** Slider size */\r\n size?: SliderProps[\"size\"];\r\n /** Marks on the slider */\r\n marks?: boolean | SliderProps[\"marks\"];\r\n /** Track display mode */\r\n track?: SliderProps[\"track\"];\r\n /** Custom styles for the Slider */\r\n sliderStyles?: SliderProps[\"sx\"];\r\n /** Custom styles for FormControl */\r\n formControlStyles?: FormControlProps[\"sx\"];\r\n /** Custom styles for FormLabel */\r\n formLabelStyles?: FormLabelProps[\"sx\"];\r\n /** Callback fired when the value changes (during drag) */\r\n onChange?: (value: number | number[]) => void;\r\n /** Callback fired when the value change is committed (on mouse up) */\r\n onChangeCommitted?: (value: number | number[]) => void;\r\n /** Callback fired when slider receives focus */\r\n onFocus?: (event: SyntheticEvent) => void;\r\n /** Callback fired when slider loses focus */\r\n onBlur?: (event: SyntheticEvent) => void;\r\n /** Custom slot props for MUI v7 */\r\n slotProps?: SliderProps[\"slotProps\"];\r\n /** Custom slots for MUI v7 */\r\n slots?: SliderProps[\"slots\"];\r\n /** FormLabel props */\r\n formLabelProps?: Omit<FormLabelProps, \"children\">;\r\n}\r\n\r\n/**\r\n * Slider Field Component\r\n *\r\n * A customizable slider field built on top of Material UI Slider and FormControl.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a flexible slider for range selections with support for: error handling, helper text, custom marks,\r\n * styling overrides, orientation (horizontal/vertical), and standard slider behaviors. It integrates seamlessly with form\r\n * management libraries like React Hook Form through the use of `forwardRef`.\r\n *\r\n * @param {string} [name] - {string} Field name for form identification\r\n * @param {string | React.ReactNode} [label] - {string | React.ReactNode} Label text for the slider\r\n * @param {number | number[]} value - {number | number[]} Current slider value(s) (controlled component)\r\n * @param {FieldError} [error] - {FieldError} Error object with optional message\r\n * @param {string} [helperText] - {string} Helper text to display below slider\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {boolean} [fullWidth=true] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {'horizontal'|'vertical'} [orientation='horizontal'] - {'horizontal'|'vertical'} Slider orientation\r\n * @param {number} [min=0] - {number} Minimum value\r\n * @param {number} [max=100] - {number} Maximum value\r\n * @param {number|null} [step=1] - {number|null} Step value\r\n * @param {'on'|'auto'|'off'} [valueLabelDisplay='auto'] - {'on'|'auto'|'off'} Whether to show value label\r\n * @param {React.ReactNode | ((value: number, index: number) => React.ReactNode)} [valueLabelFormat] - {React.ReactNode} Custom format for value label\r\n * @param {'primary'|'secondary'|'success'|'error'|'info'|'warning'} [color='primary'] - {'primary'|'secondary'|'success'|'error'|'info'|'warning'} Slider color\r\n * @param {'small'|'medium'} [size] - {'small'|'medium'} Slider size\r\n * @param {boolean | SliderProps['marks']} [marks] - {boolean | SliderProps['marks']} Marks on the slider\r\n * @param {'normal'|'inverted'|false} [track='normal'] - {'normal'|'inverted'|false} Track display mode\r\n * @param {SliderProps['sx']} [sliderStyles] - {SliderProps['sx']} Custom styles for the Slider component\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {FormLabelProps['sx']} [formLabelStyles] - {FormLabelProps['sx']} Custom styles for FormLabel\r\n * @param {(value: number | number[]) => void} [onChange] - {(value: number | number[]) => void} Callback fired when value changes\r\n * @param {(value: number | number[]) => void} [onChangeCommitted] - {(value: number | number[]) => void} Callback fired when value change is committed\r\n * @param {(event: SyntheticEvent) => void} [onFocus] - {(event: SyntheticEvent) => void} Callback when focused\r\n * @param {(event: SyntheticEvent) => void} [onBlur] - {(event: SyntheticEvent) => void} Callback when blurred\r\n * @param {Object} [slotProps] - {Object} Custom slot props\r\n * @param {Object} [slots] - {Object} Custom slots\r\n *\r\n * @returns {JSX.Element} The Slider Field component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import SliderField from \"@react-solutions/inputs\";\r\n * import { useState } from \"react\";\r\n *\r\n * function MyForm() {\r\n * const [val, setVal] = useState(30);\r\n *\r\n * return (\r\n * <SliderField\r\n * name=\"mySlider\"\r\n * label=\"Volume\"\r\n * value={val}\r\n * onChange={(newVal) => setVal(newVal as number)}\r\n * min={0}\r\n * max={100}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst SliderField = forwardRef<HTMLSpanElement, ISliderFieldProps>(\r\n (\r\n {\r\n name,\r\n label,\r\n value,\r\n onChange,\r\n onChangeCommitted,\r\n onFocus,\r\n onBlur,\r\n error,\r\n helperText,\r\n disabled = false,\r\n fullWidth = true,\r\n required,\r\n orientation = \"horizontal\",\r\n min = 0,\r\n max = 100,\r\n step = 1,\r\n valueLabelDisplay = \"auto\",\r\n valueLabelFormat,\r\n color = \"primary\",\r\n size,\r\n marks,\r\n track = \"normal\",\r\n sliderStyles,\r\n formControlStyles,\r\n formLabelStyles,\r\n slotProps,\r\n slots,\r\n formLabelProps,\r\n ...sliderProps\r\n },\r\n ref: ForwardedRef<HTMLSpanElement>\r\n ) => {\r\n // Handle onChange with proper typing\r\n const handleChange = (_event: Event, newValue: number | number[], _activeThumb: number) => {\r\n if (onChange) {\r\n onChange(newValue);\r\n }\r\n };\r\n\r\n // Handle onChangeCommitted with proper typing\r\n const handleChangeCommitted = (_event: Event | SyntheticEvent, newValue: number | number[]) => {\r\n if (onChangeCommitted) {\r\n onChangeCommitted(newValue);\r\n }\r\n };\r\n\r\n // For vertical sliders, we need special handling\r\n const isVertical = orientation === \"vertical\";\r\n\r\n return (\r\n <FormControl\r\n error={!!error}\r\n disabled={disabled}\r\n required={required}\r\n fullWidth={fullWidth && !isVertical}\r\n sx={{\r\n ...formControlStyles,\r\n ...(isVertical && {\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n alignItems: \"flex-start\",\r\n height: \"100%\",\r\n width: \"auto\"\r\n })\r\n }}\r\n >\r\n {label && (\r\n <FormLabel sx={formLabelStyles} {...formLabelProps}>\r\n {label}\r\n </FormLabel>\r\n )}\r\n <Slider\r\n {...sliderProps}\r\n name={name}\r\n value={value}\r\n onChange={handleChange}\r\n onChangeCommitted={handleChangeCommitted}\r\n onFocus={onFocus}\r\n onBlur={onBlur}\r\n orientation={orientation}\r\n min={min}\r\n max={max}\r\n step={step}\r\n valueLabelDisplay={valueLabelDisplay}\r\n valueLabelFormat={valueLabelFormat}\r\n color={color}\r\n size={size}\r\n marks={marks === true ? true : marks || false}\r\n track={track}\r\n disabled={disabled}\r\n slotProps={slotProps}\r\n slots={slots}\r\n sx={{\r\n ...sliderStyles,\r\n ...(isVertical && {\r\n height: \"100%\",\r\n \"& .MuiSlider-track\": {\r\n width: \"6px\"\r\n },\r\n \"& .MuiSlider-rail\": {\r\n width: \"6px\"\r\n }\r\n })\r\n }}\r\n ref={ref}\r\n />\r\n {error && <FormHelperText>{helperText ?? (error?.message ? error.message : \"\")}</FormHelperText>}\r\n {!error && helperText && <FormHelperText>{helperText}</FormHelperText>}\r\n </FormControl>\r\n );\r\n }\r\n);\r\n\r\nSliderField.displayName = \"SliderField\";\r\n\r\nexport default SliderField;\r\n","\"use client\";\r\nimport {\r\n FormControl,\r\n FormControlLabel,\r\n type FormControlLabelProps,\r\n type FormControlProps,\r\n FormHelperText,\r\n Switch,\r\n type SwitchProps\r\n} from \"@mui/material\";\r\nimport React, { type ChangeEvent, type ForwardedRef, forwardRef } from \"react\";\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n message?: string;\r\n} | null;\r\n\r\n/**\r\n * Extended Switch Field Props\r\n * Extends MUI SwitchProps with custom form field props\r\n */\r\nexport interface ISwitchFieldProps extends Omit<SwitchProps, \"checked\" | \"onChange\" | \"name\"> {\r\n /** Field name for form identification */\r\n name?: string;\r\n /** Label text for the switch */\r\n label?: React.ReactNode;\r\n /** Current checked state */\r\n value: boolean;\r\n /** Error object with optional message */\r\n error?: FieldError;\r\n /** Helper text to display below switch */\r\n helperText?: string;\r\n /** Whether the field is disabled */\r\n disabled?: boolean;\r\n /** Switch color */\r\n color?: SwitchProps[\"color\"];\r\n /** Switch size */\r\n size?: SwitchProps[\"size\"];\r\n /** Full width of the field */\r\n fullWidth?: boolean;\r\n /** Required field indicator */\r\n required?: boolean;\r\n /** Label placement */\r\n labelPlacement?: FormControlLabelProps[\"labelPlacement\"];\r\n /** Edge placement for the switch */\r\n edge?: SwitchProps[\"edge\"];\r\n /** Custom icon for checked state */\r\n checkedIcon?: React.ReactNode;\r\n /** Custom icon for unchecked state */\r\n icon?: React.ReactNode;\r\n /** Custom styles for the Switch */\r\n switchStyles?: SwitchProps[\"sx\"];\r\n /** Custom styles for FormControlLabel */\r\n labelStyles?: FormControlLabelProps[\"sx\"];\r\n /** Custom styles for FormControl */\r\n formControlStyles?: FormControlProps[\"sx\"];\r\n /** Callback fired when the value changes */\r\n onChange?: (checked: boolean) => void;\r\n /** Callback fired when switch is clicked */\r\n onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\r\n /** Callback fired when switch receives focus */\r\n onFocus?: SwitchProps[\"onFocus\"];\r\n /** Callback fired when switch loses focus */\r\n onBlur?: SwitchProps[\"onBlur\"];\r\n /** Custom slot props for MUI v7 */\r\n slotProps?: SwitchProps[\"slotProps\"];\r\n /** Custom slots for MUI v7 */\r\n slots?: SwitchProps[\"slots\"];\r\n /** FormControlLabel props */\r\n formControlLabelProps?: Omit<FormControlLabelProps, \"control\" | \"label\" | \"checked\">;\r\n}\r\n\r\n/**\r\n * Switch Field Component\r\n *\r\n * A customizable switch field built on top of Material UI Switch and FormControl.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a flexible switch for binary choices with support for: error handling, helper text, custom icons,\r\n * styling overrides, label placement, and standard switch behaviors. It integrates seamlessly with form\r\n * management libraries like React Hook Form through the use of `forwardRef`.\r\n *\r\n * @param {string} [name] - {string} Field name for form identification\r\n * @param {string | React.ReactNode} [label] - {string | React.ReactNode} Label text for the switch\r\n * @param {boolean} value - {boolean} Current checked state (controlled component)\r\n * @param {FieldError} [error] - {FieldError} Error object with optional message\r\n * @param {string} [helperText] - {string} Helper text to display below switch\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {'primary'|'secondary'|'success'|'error'|'info'|'warning'} [color='primary'] - {'primary'|'secondary'|'success'|'error'|'info'|'warning'} Switch color\r\n * @param {'small'|'medium'} [size] - {'small'|'medium'} Switch size\r\n * @param {boolean} [fullWidth=false] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {'start'|'end'|'top'|'bottom'} [labelPlacement='end'] - {'start'|'end'|'top'|'bottom'} Label placement relative to switch\r\n * @param {'start'|'end'|false} [edge] - {'start'|'end'|false} Edge placement for the switch\r\n * @param {React.ReactNode} [checkedIcon] - {React.ReactNode} Custom icon for checked state\r\n * @param {React.ReactNode} [icon] - {React.ReactNode} Custom icon for unchecked state\r\n * @param {SwitchProps['sx']} [switchStyles] - {SwitchProps['sx']} Custom styles for the Switch component\r\n * @param {FormControlLabelProps['sx']} [labelStyles] - {FormControlLabelProps['sx']} Custom styles for FormControlLabel\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {(checked: boolean) => void} [onChange] - {(checked: boolean) => void} Callback fired when value changes\r\n * @param {(event: React.MouseEvent<HTMLButtonElement>) => void} [onClick] - {(event: React.MouseEvent<HTMLButtonElement>) => void} Callback fired when clicked\r\n * @param {SwitchProps['onFocus']} [onFocus] - {SwitchProps['onFocus']} Callback when focused\r\n * @param {SwitchProps['onBlur']} [onBlur] - {SwitchProps['onBlur']} Callback when blurred\r\n * @param {Object} [slotProps] - {Object} Custom slot props\r\n * @param {Object} [slots] - {Object} Custom slots\r\n *\r\n * @returns {JSX.Element} The Switch Field component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import SwitchField from \"@react-solutions/inputs\";\r\n * import { useState } from \"react\";\r\n *\r\n * function MyForm() {\r\n * const [isEnabled, setIsEnabled] = useState(false);\r\n *\r\n * return (\r\n * <SwitchField\r\n * name=\"mySwitch\"\r\n * label=\"Enable notifications\"\r\n * value={isEnabled}\r\n * onChange={(checked) => setIsEnabled(checked)}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst SwitchField = forwardRef<HTMLButtonElement, ISwitchFieldProps>(\r\n (\r\n {\r\n name,\r\n label,\r\n value,\r\n onChange,\r\n onClick,\r\n onFocus,\r\n onBlur,\r\n error,\r\n helperText,\r\n disabled = false,\r\n color = \"primary\",\r\n size,\r\n fullWidth = false,\r\n required,\r\n labelPlacement = \"end\",\r\n edge,\r\n switchStyles,\r\n labelStyles,\r\n formControlStyles,\r\n slotProps,\r\n slots,\r\n formControlLabelProps,\r\n ...switchProps\r\n },\r\n ref: ForwardedRef<HTMLButtonElement>\r\n ) => {\r\n // Handle onChange with proper typing\r\n const handleChange = (_event: ChangeEvent<HTMLInputElement>, checked: boolean) => {\r\n if (onChange) {\r\n onChange(checked);\r\n }\r\n };\r\n\r\n // Handle click event\r\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\r\n if (onClick) {\r\n onClick(event);\r\n }\r\n };\r\n\r\n const switchComponent = (\r\n // <Switch {...switchProps} />\r\n <Switch\r\n {...switchProps}\r\n checked={value}\r\n onChange={handleChange}\r\n onClick={handleClick}\r\n onFocus={onFocus}\r\n onBlur={onBlur}\r\n disabled={disabled}\r\n color={color}\r\n size={size}\r\n edge={edge}\r\n name={name}\r\n slotProps={slotProps}\r\n slots={slots}\r\n sx={switchStyles}\r\n ref={ref}\r\n />\r\n );\r\n\r\n // If no label, just return the switch (matches standard MUI Switch)\r\n if (!label) {\r\n return (\r\n <FormControl\r\n error={!!error}\r\n disabled={disabled}\r\n required={required}\r\n fullWidth={fullWidth}\r\n sx={{\r\n display: \"inline-flex\",\r\n flexDirection: \"column\",\r\n ...formControlStyles\r\n }}\r\n >\r\n {switchComponent}\r\n {(error || helperText) && (\r\n <FormHelperText\r\n sx={{\r\n marginLeft: 0,\r\n marginRight: 0\r\n }}\r\n >\r\n {error ? (helperText ?? (error?.message ? error.message : \"\")) : helperText}\r\n </FormHelperText>\r\n )}\r\n </FormControl>\r\n );\r\n }\r\n\r\n // With label, use FormControlLabel (standard MUI pattern)\r\n return (\r\n <FormControl\r\n error={!!error}\r\n disabled={disabled}\r\n required={required}\r\n fullWidth={fullWidth}\r\n size={size}\r\n sx={{\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n ...formControlStyles\r\n }}\r\n >\r\n <FormControlLabel\r\n control={switchComponent}\r\n label={label}\r\n labelPlacement={labelPlacement}\r\n disabled={disabled}\r\n sx={labelStyles}\r\n {...formControlLabelProps}\r\n />\r\n {(error || helperText) && (\r\n <FormHelperText\r\n sx={{\r\n marginLeft: labelPlacement === \"start\" ? \"72px\" : 0,\r\n marginRight: 0\r\n }}\r\n >\r\n {error ? (helperText ?? (error?.message ? error.message : \"\")) : helperText}\r\n </FormHelperText>\r\n )}\r\n </FormControl>\r\n );\r\n }\r\n);\r\n\r\nSwitchField.displayName = \"SwitchField\";\r\n\r\nexport default SwitchField;\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\n\"use client\";\r\nimport {\r\n FormControl,\r\n FormHelperText,\r\n FormLabel,\r\n type FormLabelProps,\r\n ToggleButton,\r\n ToggleButtonGroup,\r\n type ToggleButtonGroupProps,\r\n type ToggleButtonProps\r\n} from \"@mui/material\";\r\nimport React, { type ForwardedRef, forwardRef } from \"react\";\r\n\r\n/**\r\n * Base option type for Toggle Button Group\r\n */\r\nexport type ToggleOption = {\r\n name: string;\r\n value: string | number;\r\n disabled?: boolean;\r\n color?: ToggleButtonProps[\"color\"];\r\n [key: string]: unknown;\r\n};\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n message?: string;\r\n} | null;\r\n\r\n/**\r\n * Extended Toggle Button Group Props\r\n * Extends MUI ToggleButtonGroupProps with custom form field props\r\n */\r\nexport interface IToggleButtonFieldProps extends Omit<\r\n ToggleButtonGroupProps,\r\n \"value\" | \"onChange\" | \"name\" | \"children\"\r\n> {\r\n /** Field name for form identification */\r\n name?: string;\r\n /** Label text for the group */\r\n label?: React.ReactNode;\r\n /** Title text to display when hovering over label */\r\n title?: string;\r\n /** Current selected value(s) */\r\n value: any;\r\n /** Options array to display as toggle buttons */\r\n options: ToggleOption[];\r\n /** Error object with optional message */\r\n error?: FieldError;\r\n /** Helper text to display below the group */\r\n helperText?: string;\r\n /** Whether the field is disabled */\r\n disabled?: boolean;\r\n /** Full width of the field */\r\n fullWidth?: boolean;\r\n /** Required field indicator */\r\n required?: boolean;\r\n /** Toggle size */\r\n size?: ToggleButtonGroupProps[\"size\"];\r\n /** Toggle orientation */\r\n orientation?: ToggleButtonGroupProps[\"orientation\"];\r\n /** Whether to allow multiple selection */\r\n exclusive?: boolean;\r\n /** Custom styles for individual ToggleButton components */\r\n buttonStyles?: ToggleButtonProps[\"sx\"];\r\n /** Custom styles for FormControl */\r\n formControlStyles?: React.ComponentProps<typeof FormControl>[\"sx\"];\r\n /** Custom styles for FormLabel */\r\n formLabelStyles?: FormLabelProps[\"sx\"];\r\n /** Custom styles for ToggleButtonGroup */\r\n groupStyles?: ToggleButtonGroupProps[\"sx\"];\r\n /** Callback fired when the value changes */\r\n onChange?: (value: any) => void;\r\n /** Custom render function for toggle buttons */\r\n renderButton?: (option: ToggleOption, index: number) => React.ReactNode;\r\n}\r\n\r\n/**\r\n * Toggle Button Field Component\r\n *\r\n * A customizable toggle button group field built on top of Material UI ToggleButtonGroup and FormControl.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a group of flexible toggle buttons for single or multiple selections with support for:\r\n * error handling, helper text, custom colors per button, styling overrides, and standard toggle behaviors.\r\n * It integrates seamlessly with form management libraries like React Hook Form through the use of `forwardRef`.\r\n *\r\n * @param {string} [name] - {string} Field name for form identification\r\n * @param {string | React.ReactNode} [label] - {string | React.ReactNode} Label text for the group\r\n * @param {boolean} [title=false] - {boolean} Whether to show label as title\r\n * @param {any} value - {any} Current selected value(s) (controlled component)\r\n * @param {ToggleOption[]} options - {ToggleOption[]} Array of toggle options\r\n * @param {FieldError} [error] - {FieldError} Error object with optional message\r\n * @param {string} [helperText] - {string} Helper text to display below the group\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {boolean} [fullWidth=false] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {'small'|'medium'|'large'} [size='medium'] - {'small'|'medium'|'large'} Toggle size\r\n * @param {'horizontal'|'vertical'} [orientation='horizontal'] - {'horizontal'|'vertical'} Toggle orientation\r\n * @param {boolean} [exclusive=true] - {boolean} Whether to allow only single selection\r\n * @param {ToggleButtonProps['sx']} [buttonStyles] - {ToggleButtonProps['sx']} Custom styles for individual ToggleButton components\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {FormLabelProps['sx']} [formLabelStyles] - {FormLabelProps['sx']} Custom styles for FormLabel\r\n * @param {ToggleButtonGroupProps['sx']} [groupStyles] - {ToggleButtonGroupProps['sx']} Custom styles for ToggleButtonGroup\r\n * @param {(value: any) => void} [onChange] - {(value: any) => void} Callback fired when value changes\r\n * @param {(option: ToggleOption, index: number) => React.ReactNode} [renderButton] - {(option: ToggleOption, index: number) => React.ReactNode} Custom render function for toggle buttons\r\n *\r\n * @returns {JSX.Element} The Toggle Button Field component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import ToggleButtonField from \"@react-solutions/inputs\";\r\n * import { useState } from \"react\";\r\n *\r\n * function MyForm() {\r\n * const [status, setStatus] = useState(\"ACTIVE\");\r\n *\r\n * return (\r\n * <ToggleButtonField\r\n * name=\"status\"\r\n * label=\"Status\"\r\n * value={status}\r\n * options={[\r\n * { name: \"Active\", value: \"ACTIVE\", color: \"success\" },\r\n * { name: \"Inactive\", value: \"INACTIVE\", color: \"error\" }\r\n * ]}\r\n * exclusive\r\n * onChange={(val) => setStatus(val)}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst ToggleButtonField = forwardRef<HTMLDivElement, IToggleButtonFieldProps>(\r\n (\r\n {\r\n name,\r\n label,\r\n title = false,\r\n value,\r\n onChange,\r\n options,\r\n error,\r\n helperText,\r\n disabled = false,\r\n fullWidth = false,\r\n required,\r\n size = \"medium\",\r\n orientation = \"horizontal\",\r\n exclusive = true,\r\n buttonStyles,\r\n formControlStyles,\r\n formLabelStyles,\r\n groupStyles,\r\n renderButton,\r\n ...groupProps\r\n },\r\n ref: ForwardedRef<HTMLDivElement>\r\n ) => {\r\n // Handle onChange with proper typing\r\n const handleChange = (event: React.MouseEvent<HTMLElement>, newValue: any) => {\r\n if (exclusive && newValue === null) {\r\n // Prevent deselecting in exclusive mode if required or desired behavior\r\n // return;\r\n }\r\n if (onChange) {\r\n onChange(newValue);\r\n }\r\n };\r\n\r\n // Default render function for toggle buttons\r\n const defaultRenderButton = (option: ToggleOption) => (\r\n <ToggleButton\r\n key={option.value}\r\n value={option.value}\r\n disabled={disabled || option.disabled}\r\n color={option.color || groupProps.color || \"primary\"}\r\n sx={{\r\n flex: fullWidth ? 1 : undefined,\r\n ...buttonStyles\r\n }}\r\n >\r\n {option.name}\r\n </ToggleButton>\r\n );\r\n\r\n return (\r\n <FormControl error={!!error} disabled={disabled} required={required} fullWidth={fullWidth} sx={formControlStyles}>\r\n {label && (\r\n <FormLabel\r\n sx={{\r\n mb: 1,\r\n ...formLabelStyles\r\n }}\r\n >\r\n {label}\r\n </FormLabel>\r\n )}\r\n <ToggleButtonGroup\r\n {...groupProps}\r\n ref={ref}\r\n value={value}\r\n onChange={handleChange}\r\n exclusive={exclusive}\r\n size={size}\r\n orientation={orientation}\r\n fullWidth={fullWidth}\r\n disabled={disabled}\r\n sx={{\r\n ...groupStyles\r\n }}\r\n >\r\n {options &&\r\n Array.isArray(options) &&\r\n options.map((option, index) => (renderButton ? renderButton(option, index) : defaultRenderButton(option)))}\r\n </ToggleButtonGroup>\r\n {(error || helperText) && (\r\n <FormHelperText sx={{ margin: \"4px\" }}>{error ? (helperText ?? error.message) : helperText}</FormHelperText>\r\n )}\r\n </FormControl>\r\n );\r\n }\r\n);\r\n\r\nToggleButtonField.displayName = \"ToggleButtonField\";\r\n\r\nexport default ToggleButtonField;\r\n","\"use client\";\r\nimport { Box, FormControl, FormHelperText, type FormLabelProps } from \"@mui/material\";\r\nimport { DateCalendar, type DateCalendarProps, LocalizationProvider } from \"@mui/x-date-pickers\";\r\nimport { AdapterDateFns } from \"@mui/x-date-pickers/AdapterDateFns\";\r\nimport React, { type ForwardedRef, forwardRef } from \"react\";\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n message?: string;\r\n} | null;\r\n\r\n/**\r\n * Extended Date Calendar Field Props\r\n * Extends MUI DateCalendarProps with custom form field props\r\n */\r\nexport interface IDateCalendarFieldProps extends Omit<\r\n DateCalendarProps<Date>,\r\n \"value\" | \"onChange\" | \"defaultValue\" | \"slots\" | \"slotProps\"\r\n> {\r\n /** Field name for form identification */\r\n name?: string;\r\n /** Label text for the calendar */\r\n label?: React.ReactNode;\r\n /** Current selected date value */\r\n value: Date | null;\r\n /** Default date value */\r\n defaultValue?: Date | null;\r\n /** Error object with optional message */\r\n error?: FieldError;\r\n /** Helper text to display below calendar */\r\n helperText?: string;\r\n /** Whether the field is disabled */\r\n disabled?: boolean;\r\n /** Full width of the field */\r\n fullWidth?: boolean;\r\n /** Required field indicator */\r\n required?: boolean;\r\n /** Minimum selectable date */\r\n minDate?: Date;\r\n /** Maximum selectable date */\r\n maxDate?: Date;\r\n /** Function to disable specific dates */\r\n shouldDisableDate?: (date: Date) => boolean;\r\n /** Function to disable specific months */\r\n shouldDisableMonth?: (month: Date) => boolean;\r\n /** Function to disable specific years */\r\n shouldDisableYear?: (year: Date) => boolean;\r\n /** Custom styles for the DateCalendar */\r\n calendarStyles?: DateCalendarProps<Date>[\"sx\"];\r\n /** Custom styles for FormControl */\r\n formControlStyles?: React.ComponentProps<typeof FormControl>[\"sx\"];\r\n /** Custom styles for FormLabel */\r\n formLabelStyles?: FormLabelProps[\"sx\"];\r\n /** Custom styles for the container Box */\r\n containerStyles?: React.ComponentProps<typeof Box>[\"sx\"];\r\n /** Callback fired when the date changes */\r\n onChange?: (value: Date | null) => void;\r\n /** Callback fired when a view change is requested */\r\n onViewChange?: (view: \"day\" | \"month\" | \"year\") => void;\r\n /** Callback fired when a month change is requested */\r\n onMonthChange?: (month: Date) => void;\r\n /** Callback fired when a year change is requested */\r\n onYearChange?: (year: Date) => void;\r\n /** Custom slot props for MUI v7 */\r\n slotProps?: DateCalendarProps<Date>[\"slotProps\"];\r\n /** Custom slots for MUI v7 */\r\n slots?: DateCalendarProps<Date>[\"slots\"];\r\n /** Date adapter to use (defaults to AdapterDateFns) */\r\n dateAdapter?: typeof AdapterDateFns;\r\n /** Whether to show days outside current month */\r\n showDaysOutsideCurrentMonth?: boolean;\r\n /** Whether to disable past dates */\r\n disablePast?: boolean;\r\n /** Whether to disable future dates */\r\n disableFuture?: boolean;\r\n /** Reference date for the calendar */\r\n referenceDate?: Date;\r\n /** Controlled view state */\r\n view?: \"day\" | \"month\" | \"year\";\r\n}\r\n\r\n/**\r\n * Date Calendar Field Component\r\n *\r\n * A customizable inline date calendar field built on top of Material UI X DateCalendar and FormControl.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides an inline calendar for date selection with support for: error handling, helper text,\r\n * date constraints (min/max), disabling specific dates/months/years, and standard calendar behaviors.\r\n * It integrates seamlessly with form management libraries like React Hook Form through the use of `forwardRef`.\r\n *\r\n * @param {string} [name] - {string} Field name for form identification\r\n * @param {string | React.ReactNode} [label] - {string | React.ReactNode} Label text for the calendar\r\n * @param {Date | null} value - {Date | null} Current selected date value (controlled component)\r\n * @param {Date | null} [defaultValue] - {Date | null} Default date value\r\n * @param {FieldError} [error] - {FieldError} Error object with optional message\r\n * @param {string} [helperText] - {string} Helper text to display below calendar\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {boolean} [fullWidth=false] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {Date} [minDate] - {Date} Minimum selectable date\r\n * @param {Date} [maxDate] - {Date} Maximum selectable date\r\n * @param {(date: Date) => boolean} [shouldDisableDate] - {(date: Date) => boolean} Function to disable specific dates\r\n * @param {(month: Date) => boolean} [shouldDisableMonth] - {(month: Date) => boolean} Function to disable specific months\r\n * @param {(year: Date) => boolean} [shouldDisableYear] - {(year: Date) => boolean} Function to disable specific years\r\n * @param {DateCalendarProps['sx']} [calendarStyles] - {DateCalendarProps['sx']} Custom styles for the DateCalendar component\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {FormLabelProps['sx']} [formLabelStyles] - {FormLabelProps['sx']} Custom styles for FormLabel\r\n * @param {BoxProps['sx']} [containerStyles] - {BoxProps['sx']} Custom styles for the container Box\r\n * @param {(value: Date | null) => void} [onChange] - {(value: Date | null) => void} Callback fired when the date changes\r\n * @param {(view: 'day' | 'month' | 'year') => void} [onViewChange] - {Function} Callback fired when a view change is requested\r\n * @param {(month: Date) => void} [onMonthChange] - {Function} Callback fired when a month change is requested\r\n * @param {(year: Date) => void} [onYearChange] - {Function} Callback fired when a year change is requested\r\n * @param {Object} [slotProps] - {Object} Custom slot props for MUI X v7\r\n * @param {Object} [slots] - {Object} Custom slots for MUI X v7\r\n * @param {typeof AdapterDateFns} [dateAdapter=AdapterDateFns] - {Type} Date adapter to use\r\n * @param {boolean} [showDaysOutsideCurrentMonth=false] - {boolean} Whether to show days outside current month\r\n * @param {boolean} [disablePast=false] - {boolean} Whether to disable past dates\r\n * @param {boolean} [disableFuture=false] - {boolean} Whether to disable future dates\r\n * @param {Date} [referenceDate] - {Date} Reference date for the calendar\r\n * @param {'day' | 'month' | 'year'} [view] - {'day' | 'month' | 'year'} Controlled view state\r\n *\r\n * @returns {JSX.Element} The Date Calendar Field component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import DateCalendarField from \"@react-solutions/inputs\";\r\n * import { useState } from \"react\";\r\n *\r\n * function MyForm() {\r\n * const [selectedDate, setSelectedDate] = useState<Date | null>(new Date());\r\n *\r\n * return (\r\n * <DateCalendarField\r\n * name=\"myCalendar\"\r\n * label=\"Select Date\"\r\n * value={selectedDate}\r\n * onChange={(date) => setSelectedDate(date)}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst DateCalendarField = forwardRef<HTMLDivElement, IDateCalendarFieldProps>(\r\n (\r\n {\r\n name,\r\n label,\r\n value,\r\n defaultValue,\r\n onChange,\r\n onViewChange,\r\n onMonthChange,\r\n onYearChange,\r\n error,\r\n helperText,\r\n disabled = false,\r\n fullWidth = false,\r\n required,\r\n minDate,\r\n maxDate,\r\n shouldDisableDate,\r\n shouldDisableMonth,\r\n shouldDisableYear,\r\n calendarStyles,\r\n formControlStyles,\r\n formLabelStyles,\r\n containerStyles,\r\n slotProps,\r\n slots,\r\n dateAdapter = AdapterDateFns,\r\n showDaysOutsideCurrentMonth = false,\r\n disablePast = false,\r\n disableFuture = false,\r\n referenceDate,\r\n view,\r\n ...dateCalendarProps\r\n },\r\n ref: ForwardedRef<HTMLDivElement>\r\n ) => {\r\n // Handle onChange with proper typing\r\n const handleChange = (newValue: Date | null) => {\r\n if (onChange) {\r\n onChange(newValue);\r\n }\r\n };\r\n\r\n return (\r\n <FormControl error={!!error} disabled={disabled} required={required} fullWidth={fullWidth} sx={formControlStyles}>\r\n <Box\r\n ref={ref}\r\n sx={{\r\n ...containerStyles\r\n }}\r\n >\r\n <LocalizationProvider dateAdapter={dateAdapter}>\r\n <DateCalendar\r\n {...dateCalendarProps}\r\n value={value}\r\n defaultValue={defaultValue}\r\n onChange={handleChange}\r\n onViewChange={onViewChange}\r\n onMonthChange={onMonthChange}\r\n onYearChange={onYearChange}\r\n disabled={disabled}\r\n minDate={minDate}\r\n maxDate={maxDate}\r\n shouldDisableDate={shouldDisableDate}\r\n shouldDisableMonth={shouldDisableMonth}\r\n shouldDisableYear={shouldDisableYear}\r\n showDaysOutsideCurrentMonth={showDaysOutsideCurrentMonth}\r\n disablePast={disablePast}\r\n disableFuture={disableFuture}\r\n referenceDate={referenceDate}\r\n view={view}\r\n slotProps={slotProps}\r\n slots={slots}\r\n sx={calendarStyles}\r\n />\r\n </LocalizationProvider>\r\n </Box>\r\n {error && (\r\n <FormHelperText sx={{ margin: \"4px\" }}>{helperText ?? (error?.message ? error.message : \"\")}</FormHelperText>\r\n )}\r\n {!error && helperText && <FormHelperText sx={{ margin: \"4px\" }}>{helperText}</FormHelperText>}\r\n </FormControl>\r\n );\r\n }\r\n);\r\n\r\nDateCalendarField.displayName = \"DateCalendarField\";\r\n\r\nexport default DateCalendarField;\r\n","\"use client\";\r\nimport ClearIcon from \"@mui/icons-material/Clear\";\r\nimport {\r\n Box,\r\n FormControl,\r\n FormHelperText,\r\n FormLabel,\r\n type FormLabelProps,\r\n IconButton,\r\n InputAdornment,\r\n type TextFieldProps\r\n} from \"@mui/material\";\r\nimport { DatePicker, type DatePickerProps, LocalizationProvider } from \"@mui/x-date-pickers\";\r\n// @ts-ignore\r\nimport { AdapterDateFns } from \"@mui/x-date-pickers/AdapterDateFns\";\r\nimport React, { type ForwardedRef, forwardRef, useRef } from \"react\";\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n message?: string;\r\n} | null;\r\n\r\n/**\r\n * Extended Date Picker Field Props\r\n * Extends MUI DatePickerProps with custom form field props\r\n */\r\nexport interface IDatePickerFieldProps extends Omit<\r\n DatePickerProps<Date>,\r\n \"value\" | \"onChange\" | \"defaultValue\" | \"slots\" | \"slotProps\" | \"renderInput\"\r\n> {\r\n /** Field name for form identification */\r\n name?: string;\r\n /** Label text for the date picker */\r\n label?: string;\r\n title?: boolean;\r\n /** Current selected date value */\r\n value: Date | null;\r\n /** Default date value */\r\n defaultValue?: Date | null;\r\n /** Error object with optional message */\r\n error?: FieldError;\r\n /** Helper text to display below field */\r\n helperText?: string;\r\n /** Whether the field is disabled */\r\n disabled?: boolean;\r\n /** Full width of the field */\r\n fullWidth?: boolean;\r\n /** Required field indicator */\r\n required?: boolean;\r\n /** Minimum selectable date */\r\n minDate?: Date;\r\n /** Maximum selectable date */\r\n maxDate?: Date;\r\n /** Function to disable specific dates */\r\n shouldDisableDate?: (date: Date) => boolean;\r\n /** Function to disable specific months */\r\n shouldDisableMonth?: (month: Date) => boolean;\r\n /** Function to disable specific years */\r\n shouldDisableYear?: (year: Date) => boolean;\r\n /** TextField size */\r\n size?: TextFieldProps[\"size\"];\r\n /** TextField variant */\r\n variant?: TextFieldProps[\"variant\"];\r\n /** TextField color */\r\n color?: TextFieldProps[\"color\"];\r\n /** Placeholder text */\r\n placeholder?: string;\r\n /** Whether the field is read-only */\r\n readOnly?: boolean;\r\n /** Whether to show clear button */\r\n showClearButton?: boolean;\r\n /** Whether to disable past dates */\r\n disablePast?: boolean;\r\n /** Whether to disable future dates */\r\n disableFuture?: boolean;\r\n /** Reference date for the calendar */\r\n referenceDate?: Date;\r\n /** Controlled view state */\r\n view?: \"day\" | \"month\" | \"year\";\r\n /** Format for displaying the date */\r\n format?: string;\r\n /** Whether to open the calendar on focus */\r\n openTo?: \"day\" | \"month\" | \"year\";\r\n /** Custom styles for the DatePicker */\r\n pickerStyles?: DatePickerProps<Date>[\"sx\"];\r\n /** Custom styles for FormControl */\r\n formControlStyles?: React.ComponentProps<typeof FormControl>[\"sx\"];\r\n /** Custom styles for FormLabel */\r\n formLabelStyles?: FormLabelProps[\"sx\"];\r\n /** Custom styles for the container Box */\r\n containerStyles?: React.ComponentProps<typeof Box>[\"sx\"];\r\n /** Custom styles for the TextField */\r\n textFieldStyles?: TextFieldProps[\"sx\"];\r\n /** Callback fired when the date changes */\r\n onChange?: (value: Date | null) => void;\r\n /** Callback fired when the field receives focus */\r\n onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;\r\n /** Callback fired when the field loses focus */\r\n onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;\r\n /** Callback fired when a view change is requested */\r\n onViewChange?: (view: \"day\" | \"month\" | \"year\") => void;\r\n /** Callback fired when a month change is requested */\r\n onMonthChange?: (month: Date) => void;\r\n /** Callback fired when a year change is requested */\r\n onYearChange?: (year: Date) => void;\r\n /** Callback fired when the calendar opens */\r\n onOpen?: () => void;\r\n /** Callback fired when the calendar closes */\r\n onClose?: () => void;\r\n /** Custom slot props for MUI v7 */\r\n slotProps?: DatePickerProps<Date>[\"slotProps\"];\r\n /** Custom slots for MUI v7 */\r\n slots?: DatePickerProps<Date>[\"slots\"];\r\n /** Date adapter to use (defaults to AdapterDateFns) */\r\n dateAdapter?: typeof AdapterDateFns;\r\n /** Whether to reduce animations */\r\n reduceAnimations?: boolean;\r\n /** Auto focus the input */\r\n autoFocus?: boolean;\r\n}\r\n\r\n/**\r\n * Date Picker Field Component\r\n *\r\n * A customizable date picker field built on top of Material UI X DatePicker and FormControl.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a flexible date picker with support for: error handling, helper text, clear button,\r\n * custom formatting, date constraints (min/max), and standard date picker behaviors.\r\n * It integrates seamlessly with form management libraries like React Hook Form through the use of `forwardRef`.\r\n *\r\n * @param {string} [name] - {string} Field name for form identification\r\n * @param {string | React.ReactNode} [label] - {string | React.ReactNode} Label text for the date picker\r\n * @param {boolean} [title=false] - {boolean} Whether to show label as a separate title above the picker\r\n * @param {Date | null} value - {Date | null} Current selected date value (controlled component)\r\n * @param {Date | null} [defaultValue] - {Date | null} Default date value\r\n * @param {FieldError} [error] - {FieldError} Error object with optional message\r\n * @param {string} [helperText] - {string} Helper text to display below field\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {boolean} [fullWidth=true] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {Date} [minDate] - {Date} Minimum selectable date\r\n * @param {Date} [maxDate] - {Date} Maximum selectable date\r\n * @param {(date: Date) => boolean} [shouldDisableDate] - {Function} Function to disable specific dates\r\n * @param {(month: Date) => boolean} [shouldDisableMonth] - {Function} Function to disable specific months\r\n * @param {(year: Date) => boolean} [shouldDisableYear] - {Function} Function to disable specific years\r\n * @param {TextFieldProps['size']} [size='medium'] - {TextFieldProps['size']} TextField size\r\n * @param {TextFieldProps['variant']} [variant='outlined'] - {TextFieldProps['variant']} TextField variant\r\n * @param {TextFieldProps['color']} [color='primary'] - {TextFieldProps['color']} TextField color\r\n * @param {string} [placeholder] - {string} Placeholder text\r\n * @param {boolean} [readOnly=false] - {boolean} Whether the field is read-only\r\n * @param {boolean} [showClearButton=true] - {boolean} Whether to show clear button\r\n * @param {boolean} [disablePast=false] - {boolean} Whether to disable past dates\r\n * @param {boolean} [disableFuture=false] - {boolean} Whether to disable future dates\r\n * @param {Date} [referenceDate] - {Date} Reference date for the calendar\r\n * @param {'day' | 'month' | 'year'} [view] - {'day' | 'month' | 'year'} Controlled view state\r\n * @param {string} [format] - {string} Format for displaying the date\r\n * @param {'day' | 'month' | 'year'} [openTo='day'] - {string} Whether to open the calendar on focus\r\n * @param {DatePickerProps['sx']} [pickerStyles] - {DatePickerProps['sx']} Custom styles for the DatePicker component\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {FormLabelProps['sx']} [formLabelStyles] - {FormLabelProps['sx']} Custom styles for FormLabel\r\n * @param {BoxProps['sx']} [containerStyles] - {BoxProps['sx']} Custom styles for the container Box\r\n * @param {TextFieldProps['sx']} [textFieldStyles] - {TextFieldProps['sx']} Custom styles for the internal TextField\r\n * @param {(value: Date | null) => void} [onChange] - {(value: Date | null) => void} Callback fired when value changes\r\n * @param {(event: React.FocusEvent<HTMLInputElement>) => void} [onFocus] - {Function} Callback when field receives focus\r\n * @param {(event: React.FocusEvent<HTMLInputElement>) => void} [onBlur] - {Function} Callback when field loses focus\r\n * @param {Function} [onViewChange] - {Function} Callback fired when a view change is requested\r\n * @param {Function} [onMonthChange] - {Function} Callback fired when a month change is requested\r\n * @param {Function} [onYearChange] - {Function} Callback fired when a year change is requested\r\n * @param {Function} [onOpen] - {Function} Callback fired when the calendar opens\r\n * @param {Function} [onClose] - {Function} Callback fired when the calendar closes\r\n * @param {Object} [slotProps] - {Object} Custom slot props for MUI X v7\r\n * @param {Object} [slots] - {Object} Custom slots for MUI X v7\r\n * @param {typeof AdapterDateFns} [dateAdapter=AdapterDateFns] - {Type} Date adapter to use\r\n * @param {boolean} [reduceAnimations=false] - {boolean} Whether to reduce animations\r\n * @param {boolean} [autoFocus=false] - {boolean} Auto focus the input\r\n *\r\n * @returns {JSX.Element} The Date Picker Field component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import DatePickerField from \"@react-solutions/inputs\";\r\n * import { useState } from \"react\";\r\n *\r\n * function MyForm() {\r\n * const [date, setDate] = useState<Date | null>(null);\r\n *\r\n * return (\r\n * <DatePickerField\r\n * name=\"myDatePicker\"\r\n * label=\"Select Date\"\r\n * value={date}\r\n * onChange={(newDate) => setDate(newDate)}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst DatePickerField = forwardRef<HTMLDivElement, IDatePickerFieldProps>(\r\n (\r\n {\r\n name,\r\n label,\r\n value,\r\n defaultValue,\r\n onChange,\r\n onFocus,\r\n onBlur,\r\n onViewChange,\r\n onMonthChange,\r\n onYearChange,\r\n onOpen,\r\n onClose,\r\n error,\r\n helperText,\r\n disabled = false,\r\n fullWidth = true,\r\n required,\r\n minDate,\r\n maxDate,\r\n shouldDisableDate,\r\n shouldDisableMonth,\r\n shouldDisableYear,\r\n size = \"medium\",\r\n variant = \"outlined\",\r\n color = \"primary\",\r\n placeholder,\r\n readOnly = false,\r\n showClearButton = true,\r\n disablePast = false,\r\n disableFuture = false,\r\n referenceDate,\r\n view,\r\n format,\r\n openTo = \"day\",\r\n pickerStyles,\r\n formControlStyles,\r\n formLabelStyles,\r\n containerStyles,\r\n textFieldStyles,\r\n slotProps,\r\n slots,\r\n title = false,\r\n dateAdapter = AdapterDateFns,\r\n reduceAnimations = false,\r\n autoFocus = false,\r\n ...datePickerProps\r\n },\r\n ref: ForwardedRef<HTMLDivElement>\r\n ) => {\r\n const inputRef = useRef<HTMLInputElement | null>(null);\r\n\r\n // Handle onChange with proper typing\r\n const handleChange = (newValue: Date | null) => {\r\n if (onChange) {\r\n onChange(newValue);\r\n }\r\n };\r\n\r\n // Handle clear button click\r\n const handleClear = () => {\r\n if (onChange) {\r\n onChange(null);\r\n }\r\n if (inputRef.current) {\r\n inputRef.current.focus();\r\n }\r\n };\r\n\r\n // Default placeholder\r\n const defaultPlaceholder = placeholder || \"MM/DD/YYYY\";\r\n\r\n // Merge slotProps with textField configuration\r\n const mergedSlotProps = {\r\n ...slotProps,\r\n textField: {\r\n ...slotProps?.textField,\r\n error: !!error,\r\n size,\r\n variant,\r\n color,\r\n helperText: error ? (helperText ?? error.message) : helperText,\r\n fullWidth,\r\n placeholder: defaultPlaceholder,\r\n autoFocus,\r\n onFocus,\r\n onBlur,\r\n inputRef: ref || inputRef,\r\n sx: {\r\n ...textFieldStyles,\r\n ...(slotProps?.textField && typeof slotProps.textField === \"object\" && \"sx\" in slotProps.textField\r\n ? slotProps.textField.sx\r\n : {})\r\n },\r\n InputProps: {\r\n ...(slotProps?.textField && typeof slotProps.textField === \"object\" && \"InputProps\" in slotProps.textField\r\n ? slotProps.textField.InputProps\r\n : {}),\r\n endAdornment: (\r\n <React.Fragment>\r\n {showClearButton && value && (\r\n <InputAdornment position=\"end\">\r\n <IconButton onClick={handleClear} size=\"small\" edge=\"end\" sx={{ marginRight: 0.5 }}>\r\n <ClearIcon fontSize=\"small\" />\r\n </IconButton>\r\n </InputAdornment>\r\n )}\r\n {/* @ts-ignore */}\r\n {slotProps?.textField?.InputProps?.endAdornment}\r\n </React.Fragment>\r\n )\r\n }\r\n }\r\n };\r\n\r\n return (\r\n <FormControl error={!!error} disabled={disabled} required={required} fullWidth={fullWidth} sx={formControlStyles}>\r\n {label && title && (\r\n <FormLabel\r\n sx={{\r\n marginBottom: 1,\r\n ...formLabelStyles\r\n }}\r\n >\r\n {label}\r\n </FormLabel>\r\n )}\r\n <Box\r\n ref={ref}\r\n sx={{\r\n ...containerStyles\r\n }}\r\n >\r\n <LocalizationProvider dateAdapter={dateAdapter}>\r\n <DatePicker\r\n {...datePickerProps}\r\n name={name}\r\n label={label}\r\n value={value}\r\n defaultValue={defaultValue}\r\n onChange={handleChange}\r\n onViewChange={onViewChange}\r\n onMonthChange={onMonthChange}\r\n onYearChange={onYearChange}\r\n onOpen={onOpen}\r\n onClose={onClose}\r\n disabled={disabled}\r\n minDate={minDate}\r\n maxDate={maxDate}\r\n shouldDisableDate={shouldDisableDate}\r\n shouldDisableMonth={shouldDisableMonth}\r\n shouldDisableYear={shouldDisableYear}\r\n disablePast={disablePast}\r\n disableFuture={disableFuture}\r\n referenceDate={referenceDate}\r\n view={view}\r\n format={format}\r\n openTo={openTo}\r\n reduceAnimations={reduceAnimations}\r\n slotProps={mergedSlotProps as any}\r\n slots={slots}\r\n sx={pickerStyles}\r\n />\r\n </LocalizationProvider>\r\n </Box>\r\n {!error && helperText && <FormHelperText>{helperText}</FormHelperText>}\r\n </FormControl>\r\n );\r\n }\r\n);\r\n\r\nDatePickerField.displayName = \"DatePickerField\";\r\n\r\nexport default DatePickerField;\r\n","\"use client\";\r\nimport { Box, Button, type ButtonProps, FormControl, FormHelperText, type FormLabelProps, Stack } from \"@mui/material\";\r\nimport { LocalizationProvider, TimeClock, type TimeClockProps, type TimeView } from \"@mui/x-date-pickers\";\r\n// @ts-ignore\r\nimport { AdapterDateFns } from \"@mui/x-date-pickers/AdapterDateFns\";\r\nimport React, { type ForwardedRef, forwardRef, useState } from \"react\";\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n message?: string;\r\n} | null;\r\n\r\n/**\r\n * Extended Time Clock Field Props\r\n * Extends MUI TimeClockProps with custom form field props\r\n */\r\nexport interface ITimeClockFieldProps extends Omit<\r\n TimeClockProps<Date>,\r\n \"value\" | \"onChange\" | \"defaultValue\" | \"slots\" | \"slotProps\" | \"view\" | \"onViewChange\"\r\n> {\r\n /** Field name for form identification */\r\n name?: string;\r\n /** Label text for the time clock */\r\n label?: React.ReactNode;\r\n /** Current selected time value */\r\n value: Date | null;\r\n /** Default time value */\r\n defaultValue?: Date | null;\r\n /** Error object with optional message */\r\n error?: FieldError;\r\n /** Helper text to display below time clock */\r\n helperText?: string;\r\n /** Whether the field is disabled */\r\n disabled?: boolean;\r\n /** Full width of the field */\r\n fullWidth?: boolean;\r\n /** Required field indicator */\r\n required?: boolean;\r\n /** Available views (hours, minutes, seconds) */\r\n views?: TimeView[];\r\n /** Whether to show AM/PM in the clock */\r\n ampmInClock?: boolean;\r\n /** Whether to use 12-hour format */\r\n ampm?: boolean;\r\n /** Whether to disable past times */\r\n disablePast?: boolean;\r\n /** Whether to disable future times */\r\n disableFuture?: boolean;\r\n /** Minimum selectable time */\r\n minTime?: Date;\r\n /** Maximum selectable time */\r\n maxTime?: Date;\r\n /** Function to disable specific times */\r\n shouldDisableTime?: (time: Date, view: TimeView) => boolean;\r\n /** Custom styles for the TimeClock */\r\n clockStyles?: TimeClockProps<Date>[\"sx\"];\r\n /** Custom styles for FormControl */\r\n formControlStyles?: React.ComponentProps<typeof FormControl>[\"sx\"];\r\n /** Custom styles for FormLabel */\r\n formLabelStyles?: FormLabelProps[\"sx\"];\r\n /** Custom styles for the container Box */\r\n containerStyles?: React.ComponentProps<typeof Box>[\"sx\"];\r\n /** Custom styles for the view buttons Stack */\r\n buttonsStackStyles?: React.ComponentProps<typeof Stack>[\"sx\"];\r\n /** Custom styles for view buttons */\r\n buttonStyles?: ButtonProps[\"sx\"];\r\n /** Custom styles for active view button */\r\n activeButtonStyles?: ButtonProps[\"sx\"];\r\n /** Whether to show view selector buttons */\r\n showViewButtons?: boolean;\r\n /** Initial view */\r\n initialView?: TimeView;\r\n /** Controlled view state */\r\n view?: TimeView;\r\n /** Callback fired when the time changes */\r\n onChange?: (value: Date | null) => void;\r\n /** Callback fired when a view change is requested */\r\n onViewChange?: (view: TimeView) => void;\r\n /** Custom slot props for MUI v7 */\r\n slotProps?: TimeClockProps<Date>[\"slotProps\"];\r\n /** Custom slots for MUI v7 */\r\n slots?: TimeClockProps<Date>[\"slots\"];\r\n /** Date adapter to use (defaults to AdapterDateFns) */\r\n dateAdapter?: typeof AdapterDateFns;\r\n /** Auto focus */\r\n autoFocus?: boolean;\r\n}\r\n\r\n/**\r\n * Time Clock Field Component\r\n *\r\n * A customizable inline time clock field built on top of Material UI X TimeClock and FormControl.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides an inline clock for time selection with support for: error handling, helper text,\r\n * AM/PM support, time constraints (min/max), and standard clock behaviors.\r\n * It integrates seamlessly with form management libraries like React Hook Form through the use of `forwardRef`.\r\n *\r\n * @param {string} [name] - {string} Field name for form identification\r\n * @param {string | React.ReactNode} [label] - {string | React.ReactNode} Label text for the time clock\r\n * @param {Date | null} value - {Date | null} Current selected time value (controlled component)\r\n * @param {Date | null} [defaultValue] - {Date | null} Default time value\r\n * @param {FieldError} [error] - {FieldError} Error object with optional message\r\n * @param {string} [helperText] - {string} Helper text to display below time clock\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {boolean} [fullWidth=false] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {TimeView[]} [views=['hours', 'minutes']] - {TimeView[]} Available views (hours, minutes, seconds)\r\n * @param {boolean} [ampmInClock=false] - {boolean} Whether to show AM/PM in the clock\r\n * @param {boolean} [ampm=true] - {boolean} Whether to use 12-hour format\r\n * @param {boolean} [disablePast=false] - {boolean} Whether to disable past times\r\n * @param {boolean} [disableFuture=false] - {boolean} Whether to disable future times\r\n * @param {Date} [minTime] - {Date} Minimum selectable time\r\n * @param {Date} [maxTime] - {Date} Maximum selectable time\r\n * @param {(time: Date, view: TimeView) => boolean} [shouldDisableTime] - {Function} Function to disable specific times\r\n * @param {TimeClockProps<TimeView>['sx']} [clockStyles] - {TimeClockProps<TimeView>['sx']} Custom styles for the TimeClock component\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {FormLabelProps['sx']} [formLabelStyles] - {FormLabelProps['sx']} Custom styles for FormLabel\r\n * @param {BoxProps['sx']} [containerStyles] - {BoxProps['sx']} Custom styles for the container Box\r\n * @param {StackProps['sx']} [buttonsStackStyles] - {StackProps['sx']} Custom styles for the view buttons Stack\r\n * @param {ButtonProps['sx']} [buttonStyles] - {ButtonProps['sx']} Custom styles for view buttons\r\n * @param {ButtonProps['sx']} [activeButtonStyles] - {ButtonProps['sx']} Custom styles for active view button\r\n * @param {boolean} [showViewButtons=true] - {boolean} Whether to show view selector buttons\r\n * @param {TimeView} [initialView='hours'] - {TimeView} Initial view\r\n * @param {TimeView} [view] - {TimeView} Controlled view state\r\n * @param {(value: Date | null) => void} [onChange] - {(value: Date | null) => void} Callback fired when value changes\r\n * @param {(view: TimeView) => void} [onViewChange] - {Function} Callback fired when a view change is requested\r\n * @param {Object} [slotProps] - {Object} Custom slot props for MUI X v7\r\n * @param {Object} [slots] - {Object} Custom slots for MUI X v7\r\n * @param {typeof AdapterDateFns} [dateAdapter=AdapterDateFns] - {Type} Date adapter to use\r\n * @param {boolean} [autoFocus=false] - {boolean} Auto focus\r\n *\r\n * @returns {JSX.Element} The Time Clock Field component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import TimeClockField from \"@react-solutions/inputs\";\r\n * import { useState } from \"react\";\r\n *\r\n * function MyForm() {\r\n * const [time, setTime] = useState<Date | null>(new Date());\r\n *\r\n * return (\r\n * <TimeClockField\r\n * name=\"myTimeClock\"\r\n * label=\"Select Time\"\r\n * value={time}\r\n * onChange={(newTime) => setTime(newTime)}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst TimeClockField = forwardRef<HTMLDivElement, ITimeClockFieldProps>(\r\n (\r\n {\r\n name,\r\n label,\r\n value,\r\n defaultValue,\r\n onChange,\r\n error,\r\n helperText,\r\n disabled = false,\r\n fullWidth = false,\r\n required,\r\n views = [\"hours\", \"minutes\"],\r\n ampmInClock = false,\r\n ampm = true,\r\n disablePast = false,\r\n disableFuture = false,\r\n minTime,\r\n maxTime,\r\n shouldDisableTime,\r\n clockStyles,\r\n formControlStyles,\r\n formLabelStyles,\r\n containerStyles,\r\n buttonsStackStyles,\r\n buttonStyles,\r\n activeButtonStyles,\r\n showViewButtons = true,\r\n initialView = \"hours\",\r\n view: controlledView,\r\n onViewChange: controlledOnViewChange,\r\n slotProps,\r\n slots,\r\n dateAdapter = AdapterDateFns,\r\n autoFocus = false,\r\n ...timeClockProps\r\n },\r\n ref: ForwardedRef<HTMLDivElement>\r\n ) => {\r\n // Internal view state (only used if view is not controlled)\r\n const [internalView, setInternalView] = useState<TimeView>(initialView);\r\n\r\n // Use controlled view if provided, otherwise use internal state\r\n const view = controlledView ?? internalView;\r\n const setView = controlledOnViewChange ?? setInternalView;\r\n\r\n // Handle onChange with proper typing\r\n const handleChange = (newValue: Date | null) => {\r\n if (onChange) {\r\n onChange(newValue);\r\n }\r\n };\r\n\r\n // Handle view change\r\n const handleViewChange = (newView: TimeView) => {\r\n setView(newView);\r\n };\r\n\r\n return (\r\n <FormControl error={!!error} disabled={disabled} required={required} fullWidth={fullWidth} sx={formControlStyles}>\r\n <Box\r\n ref={ref}\r\n sx={{\r\n ...containerStyles\r\n }}\r\n mt={2}\r\n mb={2}\r\n >\r\n {showViewButtons && views && views.length > 1 && (\r\n <Stack\r\n spacing={1}\r\n sx={{\r\n display: \"flex\",\r\n flexDirection: \"row\",\r\n justifyContent: \"center\",\r\n alignItems: \"center\",\r\n ...buttonsStackStyles\r\n }}\r\n >\r\n {views.map((v) => (\r\n <Button\r\n key={v}\r\n size=\"small\"\r\n variant={view === v ? \"contained\" : \"outlined\"}\r\n onClick={() => handleViewChange(v)}\r\n disabled={disabled}\r\n sx={\r\n view === v\r\n ? {\r\n ...(buttonStyles as any),\r\n ...(activeButtonStyles as any)\r\n }\r\n : (buttonStyles as any)\r\n }\r\n >\r\n {v}\r\n </Button>\r\n ))}\r\n </Stack>\r\n )}\r\n <LocalizationProvider dateAdapter={dateAdapter}>\r\n <TimeClock\r\n {...timeClockProps}\r\n value={value}\r\n defaultValue={defaultValue}\r\n onChange={handleChange}\r\n view={view}\r\n onViewChange={handleViewChange}\r\n disabled={disabled}\r\n views={views}\r\n ampmInClock={ampmInClock}\r\n ampm={ampm}\r\n disablePast={disablePast}\r\n disableFuture={disableFuture}\r\n minTime={minTime}\r\n maxTime={maxTime}\r\n shouldDisableTime={shouldDisableTime}\r\n autoFocus={autoFocus}\r\n slotProps={slotProps}\r\n slots={slots}\r\n sx={clockStyles}\r\n />\r\n </LocalizationProvider>\r\n </Box>\r\n {error && (\r\n <FormHelperText sx={{ margin: \"4px\" }}>{helperText ?? (error?.message ? error.message : \"\")}</FormHelperText>\r\n )}\r\n {!error && helperText && <FormHelperText sx={{ margin: \"4px\" }}>{helperText}</FormHelperText>}\r\n </FormControl>\r\n );\r\n }\r\n);\r\n\r\nTimeClockField.displayName = \"TimeClockField\";\r\n\r\nexport default TimeClockField;\r\n","\"use client\";\r\nimport ClearIcon from \"@mui/icons-material/Clear\";\r\nimport {\r\n Box,\r\n FormControl,\r\n FormHelperText,\r\n FormLabel,\r\n type FormLabelProps,\r\n IconButton,\r\n InputAdornment,\r\n type TextFieldProps\r\n} from \"@mui/material\";\r\nimport { LocalizationProvider, TimePicker, type TimePickerProps } from \"@mui/x-date-pickers\";\r\n// @ts-ignore\r\nimport { AdapterDateFns } from \"@mui/x-date-pickers/AdapterDateFns\";\r\nimport React, { type ForwardedRef, forwardRef, useRef } from \"react\";\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n message?: string;\r\n} | null;\r\n\r\n/**\r\n * Extended Time Picker Field Props\r\n * Extends MUI TimePickerProps with custom form field props\r\n */\r\nexport interface ITimePickerFieldProps extends Omit<\r\n TimePickerProps<Date>,\r\n \"value\" | \"onChange\" | \"defaultValue\" | \"slots\" | \"slotProps\" | \"renderInput\" | \"onViewChange\"\r\n> {\r\n /** Field name for form identification */\r\n name?: string;\r\n /** Label text for the time picker */\r\n label?: string;\r\n /** Current selected time value */\r\n value: Date | null;\r\n /** Default time value */\r\n defaultValue?: Date | null;\r\n /** Error object with optional message */\r\n error?: FieldError;\r\n /** Helper text to display below field */\r\n helperText?: string;\r\n /** Whether the field is disabled */\r\n disabled?: boolean;\r\n /** Full width of the field */\r\n fullWidth?: boolean;\r\n /** Whether to show title */\r\n title?: boolean;\r\n /** Required field indicator */\r\n required?: boolean;\r\n /** Minimum selectable time */\r\n minTime?: Date;\r\n /** Maximum selectable time */\r\n maxTime?: Date;\r\n /** Function to disable specific times */\r\n shouldDisableTime?: (time: Date, view: \"hours\" | \"minutes\" | \"seconds\") => boolean;\r\n /** TextField size */\r\n size?: TextFieldProps[\"size\"];\r\n /** TextField variant */\r\n variant?: TextFieldProps[\"variant\"];\r\n /** TextField color */\r\n color?: TextFieldProps[\"color\"];\r\n /** Placeholder text */\r\n placeholder?: string;\r\n /** Whether the field is read-only */\r\n readOnly?: boolean;\r\n /** Whether to show clear button */\r\n showClearButton?: boolean;\r\n /** Whether to disable past times */\r\n disablePast?: boolean;\r\n /** Whether to disable future times */\r\n disableFuture?: boolean;\r\n /** Whether to use 12-hour format */\r\n ampm?: boolean;\r\n /** Available views (hours, minutes, seconds) */\r\n views?: (\"hours\" | \"minutes\" | \"seconds\")[];\r\n /** Controlled view state */\r\n view?: \"hours\" | \"minutes\" | \"seconds\";\r\n /** Default view */\r\n openTo?: \"hours\" | \"minutes\" | \"seconds\";\r\n /** Format for displaying the time */\r\n format?: string;\r\n /** Custom styles for the TimePicker */\r\n pickerStyles?: TimePickerProps<Date>[\"sx\"];\r\n /** Custom styles for FormControl */\r\n formControlStyles?: React.ComponentProps<typeof FormControl>[\"sx\"];\r\n /** Custom styles for FormLabel */\r\n formLabelStyles?: FormLabelProps[\"sx\"];\r\n /** Custom styles for the container Box */\r\n containerStyles?: React.ComponentProps<typeof Box>[\"sx\"];\r\n /** Custom styles for the TextField */\r\n textFieldStyles?: TextFieldProps[\"sx\"];\r\n /** Callback fired when the time changes */\r\n onChange?: (value: Date | null) => void;\r\n /** Callback fired when the field receives focus */\r\n onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;\r\n /** Callback fired when the field loses focus */\r\n onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;\r\n /** Callback fired when a view change is requested */\r\n onViewChange?: (view: \"hours\" | \"minutes\" | \"seconds\" | \"meridiem\") => void;\r\n /** Callback fired when the picker opens */\r\n onOpen?: () => void;\r\n /** Callback fired when the picker closes */\r\n onClose?: () => void;\r\n /** Custom slot props for MUI v7 */\r\n slotProps?: TimePickerProps<Date>[\"slotProps\"];\r\n /** Custom slots for MUI v7 */\r\n slots?: TimePickerProps<Date>[\"slots\"];\r\n /** Date adapter to use (defaults to AdapterDateFns) */\r\n dateAdapter?: typeof AdapterDateFns;\r\n /** Auto focus the input */\r\n autoFocus?: boolean;\r\n}\r\n\r\n/**\r\n * Time Picker Field Component\r\n *\r\n * A customizable time picker field built on top of Material UI X TimePicker and FormControl.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a flexible time picker with support for: error handling, helper text, clear button,\r\n * AM/PM support, time constraints (min/max), and standard time picker behaviors.\r\n * It integrates seamlessly with form management libraries like React Hook Form through the use of `forwardRef`.\r\n *\r\n * @param {string} [name] - {string} Field name for form identification\r\n * @param {string | React.ReactNode} [label] - {string | React.ReactNode} Label text for the time picker\r\n * @param {Date | null} value - {Date | null} Current selected time value (controlled component)\r\n * @param {Date | null} [defaultValue] - {Date | null} Default time value\r\n * @param {FieldError} [error] - {FieldError} Error object with optional message\r\n * @param {string} [helperText] - {string} Helper text to display below field\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {boolean} [fullWidth=true] - {boolean} Whether the field should take full width\r\n * @param {boolean} [title=false] - {boolean} Whether to show label as a separate title above the picker\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {Date} [minTime] - {Date} Minimum selectable time\r\n * @param {Date} [maxTime] - {Date} Maximum selectable time\r\n * @param {(time: Date, view: string) => boolean} [shouldDisableTime] - {Function} Function to disable specific times\r\n * @param {TextFieldProps['size']} [size='medium'] - {TextFieldProps['size']} TextField size\r\n * @param {TextFieldProps['variant']} [variant='outlined'] - {TextFieldProps['variant']} TextField variant\r\n * @param {TextFieldProps['color']} [color='primary'] - {TextFieldProps['color']} TextField color\r\n * @param {string} [placeholder] - {string} Placeholder text\r\n * @param {boolean} [readOnly=false] - {boolean} Whether the field is read-only\r\n * @param {boolean} [showClearButton=true] - {boolean} Whether to show clear button\r\n * @param {boolean} [disablePast=false] - {boolean} Whether to disable past times\r\n * @param {boolean} [disableFuture=false] - {boolean} Whether to disable future times\r\n * @param {boolean} [ampm=true] - {boolean} Whether to use 12-hour format\r\n * @param {string[]} [views] - {string[]} Available views (hours, minutes, seconds)\r\n * @param {string} [view] - {string} Controlled view state\r\n * @param {string} [openTo='hours'] - {string} Default view to open\r\n * @param {string} [format] - {string} Format for displaying the time\r\n * @param {TimePickerProps['sx']} [pickerStyles] - {TimePickerProps['sx']} Custom styles for the TimePicker component\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {FormLabelProps['sx']} [formLabelStyles] - {FormLabelProps['sx']} Custom styles for FormLabel\r\n * @param {BoxProps['sx']} [containerStyles] - {BoxProps['sx']} Custom styles for the container Box\r\n * @param {TextFieldProps['sx']} [textFieldStyles] - {TextFieldProps['sx']} Custom styles for the internal TextField\r\n * @param {(value: Date | null) => void} [onChange] - {(value: Date | null) => void} Callback fired when value changes\r\n * @param {(event: React.FocusEvent<HTMLInputElement>) => void} [onFocus] - {Function} Callback when field receives focus\r\n * @param {(event: React.FocusEvent<HTMLInputElement>) => void} [onBlur] - {Function} Callback when field loses focus\r\n * @param {Function} [onViewChange] - {Function} Callback fired when a view change is requested\r\n * @param {Function} [onOpen] - {Function} Callback fired when the picker opens\r\n * @param {Function} [onClose] - {Function} Callback fired when the picker closes\r\n * @param {Object} [slotProps] - {Object} Custom slot props for MUI X v7\r\n * @param {Object} [slots] - {Object} Custom slots for MUI X v7\r\n * @param {typeof AdapterDateFns} [dateAdapter=AdapterDateFns] - {Type} Date adapter to use\r\n * @param {boolean} [autoFocus=false] - {boolean} Auto focus the input\r\n *\r\n * @returns {JSX.Element} The Time Picker Field component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import TimePickerField from \"@react-solutions/inputs\";\r\n * import { useState } from \"react\";\r\n *\r\n * function MyForm() {\r\n * const [time, setTime] = useState<Date | null>(null);\r\n *\r\n * return (\r\n * <TimePickerField\r\n * name=\"myTimePicker\"\r\n * label=\"Select Time\"\r\n * value={time}\r\n * onChange={(newTime) => setTime(newTime)}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst TimePickerField = forwardRef<HTMLDivElement, ITimePickerFieldProps>(\r\n (\r\n {\r\n name,\r\n label,\r\n title,\r\n value,\r\n defaultValue,\r\n onChange,\r\n onFocus,\r\n onBlur,\r\n onViewChange,\r\n onOpen,\r\n onClose,\r\n error,\r\n helperText,\r\n disabled = false,\r\n fullWidth = true,\r\n required,\r\n minTime,\r\n maxTime,\r\n shouldDisableTime,\r\n size = \"medium\",\r\n variant = \"outlined\",\r\n color = \"primary\",\r\n placeholder,\r\n readOnly = false,\r\n showClearButton = true,\r\n disablePast = false,\r\n disableFuture = false,\r\n ampm = true,\r\n views,\r\n view,\r\n openTo = \"hours\",\r\n format,\r\n pickerStyles,\r\n formControlStyles,\r\n formLabelStyles,\r\n containerStyles,\r\n textFieldStyles,\r\n slotProps,\r\n slots,\r\n dateAdapter = AdapterDateFns,\r\n autoFocus = false,\r\n ...timePickerProps\r\n },\r\n ref: ForwardedRef<HTMLDivElement>\r\n ) => {\r\n const inputRef = useRef<HTMLInputElement | null>(null);\r\n\r\n // Handle onChange with proper typing\r\n const handleChange = (newValue: Date | null) => {\r\n if (onChange) {\r\n onChange(newValue);\r\n }\r\n };\r\n\r\n // Handle clear button click\r\n const handleClear = () => {\r\n if (onChange) {\r\n onChange(null);\r\n }\r\n if (inputRef.current) {\r\n inputRef.current.focus();\r\n }\r\n };\r\n\r\n // Default placeholder\r\n const defaultPlaceholder = placeholder || (ampm ? \"hh:mm AM/PM\" : \"hh:mm\");\r\n\r\n // Merge slotProps with textField configuration\r\n const mergedSlotProps = {\r\n ...slotProps,\r\n textField: {\r\n ...slotProps?.textField,\r\n error: !!error,\r\n size,\r\n variant,\r\n color,\r\n helperText: error ? (helperText ?? error.message) : helperText,\r\n fullWidth,\r\n placeholder: defaultPlaceholder,\r\n autoFocus,\r\n onFocus,\r\n onBlur,\r\n inputRef: ref || inputRef,\r\n sx: {\r\n ...textFieldStyles,\r\n ...(slotProps?.textField && typeof slotProps.textField === \"object\" && \"sx\" in slotProps.textField\r\n ? slotProps.textField.sx\r\n : {})\r\n },\r\n InputProps: {\r\n ...(slotProps?.textField && typeof slotProps.textField === \"object\" && \"InputProps\" in slotProps.textField\r\n ? slotProps.textField.InputProps\r\n : {}),\r\n endAdornment: (\r\n <React.Fragment>\r\n {showClearButton && value && (\r\n <InputAdornment position=\"end\">\r\n <IconButton onClick={handleClear} size=\"small\" edge=\"end\" sx={{ marginRight: 0.5 }}>\r\n <ClearIcon fontSize=\"small\" />\r\n </IconButton>\r\n </InputAdornment>\r\n )}\r\n {/* @ts-ignore */}\r\n {slotProps?.textField?.InputProps?.endAdornment}\r\n </React.Fragment>\r\n )\r\n }\r\n }\r\n };\r\n\r\n return (\r\n <FormControl error={!!error} disabled={disabled} required={required} fullWidth={fullWidth} sx={formControlStyles}>\r\n {label && title && (\r\n <FormLabel\r\n sx={{\r\n mb: 1,\r\n ...formLabelStyles\r\n }}\r\n >\r\n {label}\r\n </FormLabel>\r\n )}\r\n <Box\r\n ref={ref}\r\n sx={{\r\n ...containerStyles\r\n }}\r\n >\r\n <LocalizationProvider dateAdapter={dateAdapter}>\r\n <TimePicker\r\n {...timePickerProps}\r\n name={name}\r\n label={label ? undefined : label}\r\n value={value}\r\n defaultValue={defaultValue}\r\n onChange={handleChange}\r\n onViewChange={onViewChange}\r\n onOpen={onOpen}\r\n onClose={onClose}\r\n disabled={disabled}\r\n minTime={minTime}\r\n maxTime={maxTime}\r\n shouldDisableTime={shouldDisableTime}\r\n disablePast={disablePast}\r\n disableFuture={disableFuture}\r\n ampm={ampm}\r\n views={views}\r\n view={view}\r\n openTo={openTo}\r\n format={format}\r\n slotProps={mergedSlotProps as any}\r\n slots={slots}\r\n sx={pickerStyles}\r\n />\r\n </LocalizationProvider>\r\n </Box>\r\n\r\n {!error && helperText && <FormHelperText sx={{ margin: \"4px\" }}>{helperText}</FormHelperText>}\r\n </FormControl>\r\n );\r\n }\r\n);\r\n\r\nTimePickerField.displayName = \"TimePickerField\";\r\n\r\nexport default TimePickerField;\r\n","\"use client\";\r\nimport {\r\n Autocomplete,\r\n type AutocompleteChangeReason,\r\n type AutocompleteCloseReason,\r\n type AutocompleteInputChangeReason,\r\n type AutocompleteProps,\r\n FormControl,\r\n FormHelperText,\r\n TextField,\r\n type TextFieldProps\r\n} from \"@mui/material\";\r\nimport type { FilterOptionsState } from \"@mui/material/useAutocomplete\";\r\nimport React, { type ForwardedRef, forwardRef, memo, type SyntheticEvent, useCallback } from \"react\";\r\n\r\nexport type AutoCompleteOption = {\r\n name: string;\r\n value: string | number;\r\n [key: string]: unknown;\r\n};\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n message?: string;\r\n} | null;\r\n\r\n/**\r\n * Extended Autocomplete Input Props\r\n * Extends MUI AutocompleteProps with custom form field props\r\n */\r\nexport interface IAutoCompleteInputProps<\r\n T extends AutoCompleteOption = AutoCompleteOption,\r\n Multiple extends boolean = false,\r\n DisableClearable extends boolean = false,\r\n FreeSolo extends boolean = false\r\n> extends Omit<\r\n AutocompleteProps<T, Multiple, DisableClearable, FreeSolo>,\r\n \"renderInput\" | \"options\" | \"value\" | \"onChange\" | \"getOptionLabel\" | \"isOptionEqualToValue\" | \"renderOption\"\r\n> {\r\n /** Field name for form identification */\r\n name?: string;\r\n /** Label text for the input field */\r\n label?: string;\r\n /** Current selected value */\r\n value: Multiple extends true ? T[] : T | null;\r\n /** Options array to display in dropdown */\r\n options: T[];\r\n /** Error object with optional message */\r\n error?: FieldError;\r\n /** Helper text to display below input */\r\n helperText?: string;\r\n /** Whether the field is disabled */\r\n disabled?: boolean;\r\n /** Placeholder text */\r\n placeholder?: string;\r\n /** TextField variant */\r\n variant?: TextFieldProps[\"variant\"];\r\n /** TextField size */\r\n size?: TextFieldProps[\"size\"];\r\n /** TextField color */\r\n color?: TextFieldProps[\"color\"];\r\n /** Full width of the field */\r\n fullWidth?: boolean;\r\n /** Required field indicator */\r\n required?: boolean;\r\n /** Custom function to get option label (defaults to option.name) */\r\n getOptionLabel?: (option: T | string) => string;\r\n /** Custom function to check option equality (defaults to comparing option.name) */\r\n isOptionEqualToValue?: (option: T, value: T) => boolean;\r\n /** Custom render function for options */\r\n renderOption?: (\r\n props: React.HTMLAttributes<HTMLLIElement>,\r\n option: T,\r\n state?: { selected: boolean; inputValue: string }\r\n ) => React.ReactNode;\r\n /** Callback fired when the value changes */\r\n onChange?: (\r\n event: SyntheticEvent,\r\n newValue: Multiple extends true ? T[] : T | null,\r\n reason?: AutocompleteChangeReason\r\n ) => void;\r\n /** Callback fired when input value changes */\r\n onInputChange?: (event: SyntheticEvent, newInputValue: string, reason: AutocompleteInputChangeReason) => void;\r\n /** Callback fired when popup opens */\r\n onOpen?: (event: SyntheticEvent) => void;\r\n /** Callback fired when popup closes */\r\n onClose?: (event: SyntheticEvent, reason: AutocompleteCloseReason) => void;\r\n /** Custom icon for popup indicator */\r\n popupIcon?: React.ReactNode;\r\n /** Custom styles for the TextField */\r\n inputStyles?: TextFieldProps[\"sx\"];\r\n /** Custom styles for the Autocomplete */\r\n autocompleteStyles?: AutocompleteProps<T, Multiple, DisableClearable, FreeSolo>[\"sx\"];\r\n /** Custom styles for FormControl */\r\n formControlStyles?: React.ComponentProps<typeof FormControl>[\"sx\"];\r\n /** Whether to show loading state */\r\n loading?: boolean;\r\n /** Text to show when loading */\r\n loadingText?: React.ReactNode;\r\n /** Text to show when no options available */\r\n noOptionsText?: React.ReactNode;\r\n /** Text to show when options are being filtered */\r\n filterText?: string;\r\n /** Custom filter options function */\r\n filterOptions?: (options: T[], state: FilterOptionsState<T>) => T[];\r\n /** Whether to highlight the first option */\r\n autoHighlight?: boolean;\r\n /** Whether to select the first option on highlight */\r\n autoSelect?: boolean;\r\n /** Whether to disable portal rendering */\r\n disablePortal?: boolean;\r\n /** Whether to disable list wrapping */\r\n disableListWrap?: boolean;\r\n /** Custom slot props for MUI v7 */\r\n slotProps?: AutocompleteProps<T, Multiple, DisableClearable, FreeSolo>[\"slotProps\"];\r\n /** Custom slots for MUI v7 */\r\n slots?: AutocompleteProps<T, Multiple, DisableClearable, FreeSolo>[\"slots\"];\r\n}\r\n\r\n/**\r\n * AutoComplete Field Component\r\n *\r\n * A highly customizable autocomplete search and dropdown field built on top of Material UI Autocomplete and TextField.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a searchable dropdown with support for: single/multiple selection, remote/local options,\r\n * error handling, helper text, custom option rendering, and standard autocomplete behaviors.\r\n * It integrates seamlessly with form management libraries like React Hook Form through the use of `forwardRef`.\r\n *\r\n * @param {string} [name] - {string} Field name for form identification\r\n * @param {string} [label] - {string} Label text for the input field\r\n * @param {T | T[] | null} value - {T | T[] | null} Current selected value(s) (controlled component)\r\n * @param {T[]} options - {T[]} Array of options to display in dropdown\r\n * @param {FieldError} [error] - {FieldError} Error object with optional message\r\n * @param {string} [helperText] - {string} Helper text to display below input\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {string} [placeholder] - {string} Placeholder text\r\n * @param {TextFieldProps['variant']} [variant='outlined'] - {TextFieldProps['variant']} TextField variant\r\n * @param {TextFieldProps['size']} [size] - {TextFieldProps['size']} TextField size\r\n * @param {TextFieldProps['color']} [color] - {TextFieldProps['color']} TextField color\r\n * @param {boolean} [fullWidth=true] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {Function} [getOptionLabel] - {Function} Custom function to get option label\r\n * @param {Function} [isOptionEqualToValue] - {Function} Custom function to check option equality\r\n * @param {Function} [renderOption] - {Function} Custom render function for options\r\n * @param {Function} [onChange] - {Function} Callback fired when value changes\r\n * @param {Function} [onInputChange] - {Function} Callback fired when input value changes\r\n * @param {Function} [onOpen] - {Function} Callback fired when popup opens\r\n * @param {Function} [onClose] - {Function} Callback fired when popup closes\r\n * @param {React.ReactNode} [popupIcon] - {React.ReactNode} Custom icon for popup indicator\r\n * @param {TextFieldProps['sx']} [inputStyles] - {TextFieldProps['sx']} Custom styles for the internal TextField\r\n * @param {AutocompleteProps['sx']} [autocompleteStyles] - {AutocompleteProps['sx']} Custom styles for the Autocomplete component\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {boolean} [loading=false] - {boolean} Whether to show loading state\r\n * @param {React.ReactNode} [loadingText='Loading...'] - {React.ReactNode} Text to show when loading\r\n * @param {React.ReactNode} [noOptionsText='No options'] - {React.ReactNode} Text to show when no options available\r\n * @param {Function} [filterOptions] - {Function} Custom filter options function\r\n * @param {boolean} [autoHighlight=true] - {boolean} Whether to highlight the first option\r\n * @param {boolean} [autoSelect=false] - {boolean} Whether to select the first option on highlight\r\n * @param {boolean} [disablePortal=false] - {boolean} Whether to disable portal rendering\r\n * @param {Object} [slotProps] - {Object} Custom slot props for MUI v7\r\n * @param {Object} [slots] - {Object} Custom slots for MUI v7\r\n *\r\n * @returns {JSX.Element} The AutoComplete Field component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import AutoCompleteField from \"@react-solutions/inputs\";\r\n * import { useState } from \"react\";\r\n *\r\n * function MyForm() {\r\n * const [val, setVal] = useState(null);\r\n * const options = [{ name: \"Option 1\", value: 1 }, { name: \"Option 2\", value: 2 }];\r\n *\r\n * return (\r\n * <AutoCompleteField\r\n * name=\"myAutocomplete\"\r\n * label=\"Select Option\"\r\n * value={val}\r\n * options={options}\r\n * onChange={(e, newVal) => setVal(newVal)}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst AutoCompleteField = memo(\r\n forwardRef<HTMLDivElement, IAutoCompleteInputProps<AutoCompleteOption, boolean, boolean, boolean>>(\r\n (\r\n {\r\n name,\r\n label,\r\n value,\r\n onChange,\r\n onInputChange,\r\n onOpen,\r\n onClose,\r\n options,\r\n error,\r\n helperText,\r\n disabled = false,\r\n placeholder,\r\n variant = \"outlined\",\r\n size,\r\n color,\r\n fullWidth = true,\r\n required,\r\n getOptionLabel,\r\n isOptionEqualToValue,\r\n renderOption,\r\n popupIcon,\r\n inputStyles,\r\n autocompleteStyles,\r\n formControlStyles,\r\n loading = false,\r\n loadingText = \"Loading...\",\r\n noOptionsText = \"No options\",\r\n filterOptions,\r\n autoHighlight = true,\r\n autoSelect = false,\r\n disablePortal = false,\r\n disableListWrap = false,\r\n slotProps,\r\n slots,\r\n ...autocompleteProps\r\n },\r\n ref: ForwardedRef<HTMLDivElement>\r\n ) => {\r\n // Default getOptionLabel function\r\n const defaultGetOptionLabel = useCallback((option: AutoCompleteOption | string): string => {\r\n if (typeof option === \"string\") {\r\n return option;\r\n }\r\n return option?.name ?? String(option?.value ?? \"\");\r\n }, []);\r\n\r\n // Default isOptionEqualToValue function\r\n const defaultIsOptionEqualToValue = useCallback(\r\n (option: AutoCompleteOption, value: AutoCompleteOption): boolean => {\r\n return option?.name === value?.name && option?.value === value?.value;\r\n },\r\n []\r\n );\r\n\r\n // Handle onChange with proper typing\r\n const handleChange = useCallback(\r\n (event: SyntheticEvent, newValue: any, reason?: AutocompleteChangeReason) => {\r\n if (onChange) {\r\n onChange(event, newValue, reason);\r\n }\r\n },\r\n [onChange]\r\n );\r\n\r\n return (\r\n <FormControl fullWidth={fullWidth} error={!!error} sx={formControlStyles}>\r\n <Autocomplete<AutoCompleteOption, boolean, boolean, boolean>\r\n options={options}\r\n value={value as any}\r\n onChange={handleChange}\r\n onInputChange={onInputChange}\r\n onOpen={onOpen}\r\n onClose={onClose}\r\n getOptionLabel={getOptionLabel ? getOptionLabel : defaultGetOptionLabel}\r\n isOptionEqualToValue={isOptionEqualToValue ? isOptionEqualToValue : defaultIsOptionEqualToValue}\r\n disabled={disabled}\r\n loading={loading}\r\n loadingText={loadingText}\r\n noOptionsText={noOptionsText}\r\n filterOptions={filterOptions}\r\n autoHighlight={autoHighlight}\r\n autoSelect={autoSelect}\r\n disablePortal={disablePortal}\r\n disableListWrap={disableListWrap}\r\n popupIcon={popupIcon}\r\n slotProps={slotProps}\r\n slots={slots}\r\n sx={autocompleteStyles}\r\n ref={ref}\r\n {...autocompleteProps}\r\n renderInput={(params) => (\r\n <TextField\r\n {...params}\r\n name={name}\r\n label={label}\r\n variant={variant}\r\n size={size}\r\n color={color}\r\n placeholder={placeholder}\r\n required={required}\r\n error={!!error}\r\n disabled={disabled}\r\n sx={inputStyles}\r\n helperText={helperText ?? \"\"}\r\n />\r\n )}\r\n />\r\n {error && !helperText && error.message && <FormHelperText>{error.message}</FormHelperText>}\r\n </FormControl>\r\n );\r\n }\r\n )\r\n);\r\n\r\nAutoCompleteField.displayName = \"AutoCompleteField\";\r\n\r\nexport default AutoCompleteField;\r\n","\"use client\";\r\nimport { Box, FormControl, type FormControlProps, InputAdornment, TextField, type TextFieldProps } from \"@mui/material\";\r\nimport React, {\r\n type ChangeEvent,\r\n type FocusEvent,\r\n type ForwardedRef,\r\n forwardRef,\r\n memo,\r\n useCallback,\r\n useEffect,\r\n useMemo,\r\n useRef,\r\n useState\r\n} from \"react\";\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n message?: string;\r\n} | null;\r\n\r\n/**\r\n * Color format types\r\n */\r\nexport type ColorFormat = \"hex\" | \"rgb\" | \"rgba\" | \"hsl\" | \"hsla\";\r\n\r\n/**\r\n * Color value type - can be string (hex) or object (rgb/rgba/hsl/hsla)\r\n */\r\nexport type ColorValue = string | RGBColor | RGBAColor | HSLColor | HSLAColor;\r\n\r\n/**\r\n * RGB color object\r\n */\r\nexport interface RGBColor {\r\n r: number;\r\n g: number;\r\n b: number;\r\n}\r\n\r\n/**\r\n * RGBA color object\r\n */\r\nexport interface RGBAColor extends RGBColor {\r\n a: number;\r\n}\r\n\r\n/**\r\n * HSL color object\r\n */\r\nexport interface HSLColor {\r\n h: number;\r\n s: number;\r\n l: number;\r\n}\r\n\r\n/**\r\n * HSL color object with alpha\r\n */\r\nexport interface HSLAColor extends HSLColor {\r\n a: number;\r\n}\r\n\r\n/**\r\n * Extended Color Picker Field Props\r\n */\r\nexport interface IColorPickerFieldProps extends Omit<\r\n TextFieldProps,\r\n \"value\" | \"onChange\" | \"name\" | \"type\" | \"error\" | \"inputRef\" | \"multiline\" | \"variant\" | \"size\"\r\n> {\r\n /** Field name for form identification */\r\n name?: string;\r\n /** Label text for the color picker field */\r\n label?: string;\r\n /** Current color value (hex string or color object) */\r\n value: string;\r\n /** Error object with optional message */\r\n error?: FieldError;\r\n /** Helper text to display below field */\r\n helperText?: string;\r\n /** Whether the field is disabled */\r\n disabled?: boolean;\r\n /** Placeholder text */\r\n placeholder?: string;\r\n /** TextField variant */\r\n variant?: TextFieldProps[\"variant\"];\r\n /** TextField size */\r\n size?: TextFieldProps[\"size\"];\r\n /** TextField color */\r\n color?: TextFieldProps[\"color\"];\r\n /** Full width of the field */\r\n fullWidth?: boolean;\r\n /** Required field indicator */\r\n required?: boolean;\r\n /** Color format (hex, rgb, rgba, hsl, hsla) */\r\n format?: ColorFormat;\r\n /** Whether to show color preview swatch */\r\n showPreview?: boolean;\r\n /** Whether to show native color input */\r\n showNativeInput?: boolean;\r\n /** Whether to show popover picker */\r\n showPopoverPicker?: boolean;\r\n /** Preset colors to display */\r\n presetColors?: string[];\r\n /** Whether to show preset colors */\r\n showPresetColors?: boolean;\r\n /** Callback fired when the color changes */\r\n onChange?: (value: string) => void;\r\n /** Callback fired when field receives focus */\r\n onFocus?: (event: FocusEvent<HTMLInputElement>) => void;\r\n /** Callback fired when field loses focus */\r\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void;\r\n /** Callback fired on Enter key press */\r\n onEnterPress?: (value: string) => void;\r\n /** Custom styles for the color preview swatch */\r\n previewStyles?: React.CSSProperties;\r\n /** Custom styles for FormControl */\r\n formControlStyles?: FormControlProps[\"sx\"];\r\n /** Custom styles for TextField */\r\n inputStyles?: TextFieldProps[\"sx\"];\r\n /** Custom slot props for MUI v7 */\r\n slotProps?: TextFieldProps[\"slotProps\"];\r\n /** Custom slots for MUI v7 */\r\n slots?: TextFieldProps[\"slots\"];\r\n}\r\n\r\n/**\r\n * Convert hex to RGB (utility function for future format conversions)\r\n * @internal - Exported for potential future use with rgb/rgba formats\r\n */\r\nexport const hexToRgb = (hex: string): RGBColor | null => {\r\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\r\n return result\r\n ? {\r\n r: parseInt(result[1], 16),\r\n g: parseInt(result[2], 16),\r\n b: parseInt(result[3], 16)\r\n }\r\n : null;\r\n};\r\n\r\n/**\r\n * Convert RGB to hex (utility function for future format conversions)\r\n * @internal - Exported for potential future use with rgb/rgba formats\r\n */\r\nexport const rgbToHex = (r: number, g: number, b: number): string => {\r\n return `#${[r, g, b].map((x) => x.toString(16).padStart(2, \"0\")).join(\"\")}`;\r\n};\r\n\r\n/**\r\n * Validate hex color\r\n */\r\nconst isValidHex = (color: string): boolean => {\r\n return /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(color);\r\n};\r\n\r\n/**\r\n * Normalize hex color (ensure # prefix and 6 digits)\r\n */\r\nconst normalizeHex = (color: string): string => {\r\n let hex = color.replace(\"#\", \"\");\r\n if (hex.length === 3) {\r\n hex = hex\r\n .split(\"\")\r\n .map((char) => char + char)\r\n .join(\"\");\r\n }\r\n return `#${hex}`;\r\n};\r\n\r\n/**\r\n * Color Picker Field Component\r\n *\r\n * A customizable color picker field built on top of Material UI TextField and native color input.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a color selection input with support for: hex values, color preview swatch,\r\n * native color picker integration, error handling, helper text, and standard text field behaviors.\r\n * It integrates seamlessly with form management libraries like React Hook Form through the use of `forwardRef`.\r\n *\r\n * @param {string} [name] - {string} Field name for form identification\r\n * @param {string} [label] - {string} Label text for the color picker field\r\n * @param {string} value - {string} Current color value (hex string)\r\n * @param {FieldError} [error] - {FieldError} Error object with optional message\r\n * @param {string} [helperText] - {string} Helper text to display below field\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {string} [placeholder='#000000'] - {string} Placeholder text\r\n * @param {TextFieldProps['variant']} [variant='outlined'] - {TextFieldProps['variant']} TextField variant\r\n * @param {TextFieldProps['size']} [size] - {TextFieldProps['size']} TextField size\r\n * @param {TextFieldProps['color']|'primary'} [color='primary'] - {TextFieldProps['color']} TextField color\r\n * @param {boolean} [fullWidth=true] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {ColorFormat} [format='hex'] - {ColorFormat} Color format (currently hex supported)\r\n * @param {boolean} [showPreview=true] - {boolean} Whether to show color preview swatch\r\n * @param {(value: string) => void} [onChange] - {(value: string) => void} Callback fired when value changes\r\n * @param {Function} [onFocus] - {Function} Callback when field receives focus\r\n * @param {Function} [onBlur] - {Function} Callback when field loses focus\r\n * @param {Function} [onEnterPress] - {Function} Callback fired on Enter key press\r\n * @param {React.CSSProperties} [previewStyles] - {React.CSSProperties} Custom styles for the color preview swatch\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {TextFieldProps['sx']} [inputStyles] - {TextFieldProps['sx']} Custom styles for TextField\r\n * @param {Object} [slotProps] - {Object} Custom slot props for MUI v7\r\n * @param {Object} [slots] - {Object} Custom slots for MUI v7\r\n *\r\n * @returns {JSX.Element} The Color Picker Field component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import ColorPickerField from \"@react-solutions/inputs\";\r\n * import { useState } from \"react\";\r\n *\r\n * function MyForm() {\r\n * const [color, setColor] = useState(\"#3f51b5\");\r\n *\r\n * return (\r\n * <ColorPickerField\r\n * name=\"brandColor\"\r\n * label=\"Choose Brand Color\"\r\n * value={color}\r\n * onChange={(newColor) => setColor(newColor)}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst ColorPickerField = memo(\r\n forwardRef<HTMLDivElement, IColorPickerFieldProps>(\r\n (\r\n {\r\n name,\r\n label,\r\n value,\r\n onChange,\r\n onFocus,\r\n onBlur,\r\n onEnterPress,\r\n error,\r\n helperText,\r\n disabled = false,\r\n placeholder = \"#000000\",\r\n variant = \"outlined\",\r\n size,\r\n color = \"primary\",\r\n fullWidth = true,\r\n required,\r\n format = \"hex\",\r\n showPreview = true,\r\n showNativeInput = true,\r\n showPopoverPicker = true,\r\n presetColors = [\"#000000\", \"#FFFFFF\", \"#FF0000\", \"#00FF00\", \"#0000FF\", \"#FFFF00\", \"#FF00FF\", \"#00FFFF\"],\r\n showPresetColors = false,\r\n previewStyles,\r\n formControlStyles,\r\n inputStyles,\r\n slotProps,\r\n slots,\r\n ...textFieldProps\r\n },\r\n ref: ForwardedRef<HTMLDivElement>\r\n ) => {\r\n const [internalValue, setInternalValue] = useState<string>(value || \"\");\r\n const colorInputRef = useRef<HTMLInputElement | null>(null);\r\n const popoverAnchorRef = useRef<HTMLDivElement | null>(null);\r\n\r\n // Update internal value when prop changes\r\n useEffect(() => {\r\n if (value !== undefined) {\r\n setInternalValue(value || \"\");\r\n }\r\n }, [value]);\r\n\r\n // Normalize hex value\r\n const normalizedValue = isValidHex(internalValue) ? normalizeHex(internalValue) : internalValue || \"\";\r\n\r\n // Handle input change\r\n const handleChange = useCallback(\r\n (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\r\n if (disabled) {\r\n return;\r\n }\r\n\r\n const newValue = (event.target as HTMLInputElement).value;\r\n setInternalValue(newValue);\r\n\r\n if (onChange) {\r\n onChange(newValue);\r\n }\r\n },\r\n [onChange]\r\n );\r\n\r\n // Handle native color input change\r\n const handleColorInputChange = useCallback(\r\n (event: ChangeEvent<HTMLInputElement>) => {\r\n if (disabled) {\r\n return;\r\n }\r\n event.stopPropagation();\r\n\r\n const newValue = event.target.value;\r\n setInternalValue(newValue);\r\n\r\n if (onChange) {\r\n onChange(newValue);\r\n }\r\n },\r\n [onChange]\r\n );\r\n\r\n // Handle preview swatch click - directly open native color picker\r\n const handlePreviewClick = useCallback(\r\n (event: React.MouseEvent<HTMLDivElement>) => {\r\n if (disabled) {\r\n return;\r\n }\r\n event.preventDefault();\r\n event.stopPropagation();\r\n // Trigger the hidden native color input\r\n if (colorInputRef.current) {\r\n colorInputRef.current.click();\r\n }\r\n },\r\n [disabled, colorInputRef]\r\n );\r\n\r\n // Handle key down\r\n const handleKeyDown = useCallback(\r\n (event: React.KeyboardEvent<HTMLDivElement>) => {\r\n if (event.key === \"Enter\" && onEnterPress) {\r\n onEnterPress(normalizedValue);\r\n }\r\n if (textFieldProps.onKeyDown) {\r\n textFieldProps.onKeyDown(event);\r\n }\r\n },\r\n [onEnterPress, normalizedValue, textFieldProps.onKeyDown]\r\n );\r\n\r\n // Memoize preview swatch\r\n const previewSwatch = useMemo(\r\n () => (\r\n <InputAdornment position=\"start\">\r\n <Box\r\n ref={popoverAnchorRef}\r\n onClick={!disabled ? handlePreviewClick : undefined}\r\n sx={{\r\n width: size === \"small\" ? 24 : 32,\r\n height: size === \"small\" ? 24 : 32,\r\n borderRadius: 1,\r\n border: \"1px solid\",\r\n borderColor: error ? \"error.main\" : \"divider\",\r\n backgroundColor: normalizedValue,\r\n cursor: !disabled ? \"pointer\" : \"default\",\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n justifyContent: \"center\",\r\n transition: \"all 0.2s\",\r\n \"&:hover\": {\r\n opacity: !disabled ? 0.8 : 1\r\n },\r\n ...previewStyles\r\n }}\r\n title={!disabled ? \"Click to open color picker\" : undefined}\r\n />\r\n </InputAdornment>\r\n ),\r\n [popoverAnchorRef, disabled, handlePreviewClick, size, error, normalizedValue, previewStyles]\r\n );\r\n\r\n // Build slotProps for MUI v7\r\n const finalSlotProps = useMemo(\r\n () => ({\r\n ...slotProps,\r\n input: {\r\n ...slotProps?.input,\r\n inputProps: {\r\n ...((slotProps?.input as any)?.inputProps || {})\r\n },\r\n ...(showPreview && {\r\n startAdornment: previewSwatch\r\n })\r\n }\r\n }),\r\n [slotProps, showPreview, previewSwatch]\r\n );\r\n\r\n // Memoize helper text\r\n const displayHelperText = useMemo(\r\n () => helperText ?? (error?.message ? error.message : undefined),\r\n [helperText, error?.message]\r\n );\r\n\r\n return (\r\n <FormControl\r\n error={!!error}\r\n disabled={disabled}\r\n required={required}\r\n fullWidth={fullWidth}\r\n sx={formControlStyles}\r\n >\r\n <TextField\r\n {...textFieldProps}\r\n ref={ref}\r\n name={name}\r\n label={label}\r\n value={normalizedValue}\r\n onChange={handleChange}\r\n onFocus={onFocus}\r\n onBlur={onBlur}\r\n onKeyDown={handleKeyDown}\r\n placeholder={placeholder}\r\n variant={variant}\r\n size={size}\r\n color={color}\r\n fullWidth={fullWidth}\r\n required={required}\r\n error={!!error}\r\n disabled={disabled}\r\n slotProps={finalSlotProps}\r\n slots={slots}\r\n sx={inputStyles}\r\n helperText={displayHelperText}\r\n />\r\n {/* Hidden native color input - triggered when clicking preview swatch */}\r\n <input\r\n ref={colorInputRef}\r\n type=\"color\"\r\n value={normalizedValue}\r\n onChange={handleColorInputChange}\r\n disabled={disabled}\r\n style={{\r\n position: \"absolute\",\r\n width: 0,\r\n height: 0,\r\n opacity: 0,\r\n pointerEvents: \"none\",\r\n visibility: \"hidden\"\r\n }}\r\n aria-hidden=\"true\"\r\n />\r\n </FormControl>\r\n );\r\n }\r\n )\r\n);\r\n\r\nColorPickerField.displayName = \"ColorPickerField\";\r\n\r\nexport default ColorPickerField;\r\n","\"use client\";\r\nimport Clear from \"@mui/icons-material/Clear\";\r\nimport CloudUploadIcon from \"@mui/icons-material/CloudUpload\";\r\nimport {\r\n type ButtonProps,\r\n FormControl,\r\n FormHelperText,\r\n IconButton,\r\n InputAdornment,\r\n TextField,\r\n type TextFieldProps\r\n} from \"@mui/material\";\r\nimport React, { type ChangeEvent, type DragEvent, type ForwardedRef, forwardRef, useRef, useState } from \"react\";\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n message?: string;\r\n} | null;\r\n\r\n/**\r\n * File value type\r\n */\r\nexport type FileValue = File | File[] | null | undefined;\r\n\r\n/**\r\n * Extended File Upload Field Props\r\n * Extends MUI TextFieldProps with custom file upload props\r\n */\r\nexport interface IFileUploadFieldProps extends Omit<\r\n TextFieldProps,\r\n \"value\" | \"onChange\" | \"name\" | \"type\" | \"error\" | \"onDrop\"\r\n> {\r\n /** Field name for form identification */\r\n name?: string;\r\n /** Label text for the file upload field */\r\n label?: string;\r\n /** Current file value */\r\n value?: File | File[] | { name: string } | null;\r\n /** Error object with optional message */\r\n error?: FieldError;\r\n /** Helper text to display below field */\r\n helperText?: string;\r\n /** Whether the field is disabled */\r\n disabled?: boolean;\r\n /** File types to accept (e.g., \"image/*\", \".pdf,.doc\") */\r\n accept?: string;\r\n /** Whether to allow multiple file selection */\r\n multiple?: boolean;\r\n /** Maximum file size in bytes */\r\n maxSize?: number;\r\n /** Minimum file size in bytes */\r\n minSize?: number;\r\n /** Allowed file types (MIME types or extensions) */\r\n allowedTypes?: string[];\r\n /** Whether to show file preview */\r\n showPreview?: boolean;\r\n /** Whether to enable drag and drop */\r\n enableDragDrop?: boolean;\r\n /** Placeholder text */\r\n placeholder?: string;\r\n /** TextField variant */\r\n variant?: TextFieldProps[\"variant\"];\r\n /** TextField size */\r\n size?: TextFieldProps[\"size\"];\r\n /** TextField color */\r\n color?: TextFieldProps[\"color\"];\r\n /** Full width of the field */\r\n fullWidth?: boolean;\r\n /** Required field indicator */\r\n required?: boolean;\r\n /** Upload button text */\r\n buttonText?: string;\r\n /** Upload button variant */\r\n buttonVariant?: ButtonProps[\"variant\"];\r\n /** Upload button color */\r\n buttonColor?: ButtonProps[\"color\"];\r\n /** Upload button size */\r\n buttonSize?: ButtonProps[\"size\"];\r\n /** Custom upload icon */\r\n uploadIcon?: React.ReactNode;\r\n /** Callback fired when file(s) change */\r\n onChange?: (file: File | File[] | undefined) => void;\r\n /** Callback fired when file is selected */\r\n onFileSelect?: (file: File | File[] | undefined) => void;\r\n /** Callback fired when file is removed */\r\n onFileRemove?: () => void;\r\n /** Callback fired on file validation error */\r\n onValidationError?: (error: string) => void;\r\n /** Callback fired when file is dropped (drag and drop) */\r\n onDrop?: (files: FileList) => void;\r\n /** Custom styles for the TextField */\r\n inputStyles?: TextFieldProps[\"sx\"];\r\n /** Custom styles for the Button */\r\n buttonStyles?: ButtonProps[\"sx\"];\r\n /** Custom styles for FormControl */\r\n formControlStyles?: React.ComponentProps<typeof FormControl>[\"sx\"];\r\n /** Custom styles for the container */\r\n containerStyles?: React.CSSProperties;\r\n /** Custom slot props for MUI v7 */\r\n slotProps?: TextFieldProps[\"slotProps\"];\r\n /** Custom slots for MUI v7 */\r\n slots?: TextFieldProps[\"slots\"];\r\n}\r\n\r\n/**\r\n * File Upload Field Component\r\n *\r\n * A versatile file upload field built on top of Material UI TextField and native file input.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a file selection interface with support for: single/multiple files,\r\n * drag and drop, file validation (size, type), file preview, clear functionality, and standard form field behaviors.\r\n * It integrates seamlessly with form management libraries like React Hook Form through the use of `forwardRef`.\r\n *\r\n * @param {string} [name] - {string} Field name for form identification\r\n * @param {string} [label] - {string} Label text for the file upload field\r\n * @param {File | File[] | { name: string } | null} [value] - {File | File[] | { name: string } | null} Current file(s)\r\n * @param {FieldError} [error] - {FieldError} Error object with optional message\r\n * @param {string} [helperText] - {string} Helper text to display below field\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {string} [accept] - {string} File types to accept (e.g., \"image/*\", \".pdf\")\r\n * @param {boolean} [multiple=false] - {boolean} Whether to allow multiple file selection\r\n * @param {number} [maxSize] - {number} Maximum file size in bytes\r\n * @param {number} [minSize] - {number} Minimum file size in bytes\r\n * @param {string[]} [allowedTypes] - {string[]} Allowed file types (MIME types or extensions)\r\n * @param {boolean} [showPreview=true] - {boolean} Whether to show file name preview\r\n * @param {boolean} [enableDragDrop=false] - {boolean} Whether to enable drag and drop\r\n * @param {string} [placeholder='No file chosen'] - {string} Placeholder text\r\n * @param {TextFieldProps['variant']} [variant='outlined'] - {TextFieldProps['variant']} TextField variant\r\n * @param {TextFieldProps['size']} [size] - {TextFieldProps['size']} TextField size\r\n * @param {TextFieldProps['color']} [color] - {TextFieldProps['color']} TextField color\r\n * @param {boolean} [fullWidth=true] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {string} [buttonText='Upload'] - {string} Upload button text\r\n * @param {ButtonProps['variant']} [buttonVariant='contained'] - {ButtonProps['variant']} Upload button variant\r\n * @param {ButtonProps['color']} [buttonColor='primary'] - {ButtonProps['color']} Upload button color\r\n * @param {ButtonProps['size']} [buttonSize] - {ButtonProps['size']} Upload button size\r\n * @param {React.ReactNode} [uploadIcon] - {React.ReactNode} Custom upload icon\r\n * @param {(file: File | File[] | undefined) => void} [onChange] - {(file: File | File[] | undefined) => void} Callback fired when files change\r\n * @param {Function} [onFileSelect] - {Function} Callback fired when file is selected\r\n * @param {Function} [onFileRemove] - {Function} Callback fired when file is removed\r\n * @param {(error: string) => void} [onValidationError] - {(error: string) => void} Callback fired on validation error\r\n * @param {(files: FileList) => void} [onDrop] - {(files: FileList) => void} Callback fired when file is dropped\r\n * @param {TextFieldProps['sx']} [inputStyles] - {TextFieldProps['sx']} Custom styles for the internal TextField\r\n * @param {ButtonProps['sx']} [buttonStyles] - {ButtonProps['sx']} Custom styles for the Upload button\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {React.CSSProperties} [containerStyles] - {React.CSSProperties} Custom styles for the container\r\n * @param {Object} [slotProps] - {Object} Custom slot props for MUI v7\r\n * @param {Object} [slots] - {Object} Custom slots for MUI v7\r\n *\r\n * @returns {JSX.Element} The File Upload Field component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import FileUploadField from \"@react-solutions/inputs\";\r\n * import { useState } from \"react\";\r\n *\r\n * function MyForm() {\r\n * const [file, setFile] = useState<File | File[] | undefined>(null);\r\n *\r\n * return (\r\n * <FileUploadField\r\n * name=\"resume\"\r\n * label=\"Upload Resume\"\r\n * value={file}\r\n * onChange={(newFile) => setFile(newFile)}\r\n * accept=\".pdf,.doc,.docx\"\r\n * enableDragDrop\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst FileUploadField = forwardRef<HTMLInputElement, IFileUploadFieldProps>(\r\n (\r\n {\r\n name,\r\n label,\r\n value,\r\n onChange,\r\n onFileSelect,\r\n onFileRemove,\r\n onValidationError,\r\n onDrop,\r\n error,\r\n helperText,\r\n disabled = false,\r\n accept,\r\n multiple = false,\r\n maxSize,\r\n minSize,\r\n allowedTypes,\r\n showPreview = true,\r\n enableDragDrop = false,\r\n placeholder = \"No file chosen\",\r\n variant = \"outlined\",\r\n size,\r\n color,\r\n fullWidth = true,\r\n required,\r\n buttonText = \"Upload\",\r\n buttonVariant = \"contained\",\r\n buttonColor = \"primary\",\r\n buttonSize,\r\n uploadIcon = <CloudUploadIcon />,\r\n inputStyles,\r\n buttonStyles,\r\n formControlStyles,\r\n containerStyles,\r\n slotProps,\r\n slots,\r\n ...textFieldProps\r\n },\r\n ref: ForwardedRef<HTMLInputElement>\r\n ) => {\r\n const internalRef = useRef<HTMLInputElement | null>(null);\r\n const [isDragging, setIsDragging] = useState(false);\r\n const [, setDragCounter] = useState(0);\r\n\r\n // Get the file input ref (either forwarded ref or internal ref)\r\n const fileInputRef = ref && typeof ref === \"object\" && \"current\" in ref ? ref : internalRef;\r\n\r\n // Get file name(s) from value\r\n const getFileName = (): string => {\r\n if (!value) {\r\n return \"\";\r\n }\r\n if (value instanceof File) {\r\n return value.name;\r\n }\r\n if (Array.isArray(value)) {\r\n if (value.length === 0) {\r\n return \"\";\r\n }\r\n if (value.length === 1) {\r\n return value[0].name;\r\n }\r\n return `${value.length} files selected`;\r\n }\r\n if (typeof value === \"object\" && \"name\" in value) {\r\n return value.name;\r\n }\r\n return \"\";\r\n };\r\n\r\n // Validate file\r\n const validateFile = (file: File): string | null => {\r\n // Check file size\r\n if (maxSize && file.size > maxSize) {\r\n return `File size exceeds maximum allowed size of ${formatFileSize(maxSize)}`;\r\n }\r\n if (minSize && file.size < minSize) {\r\n return `File size is below minimum required size of ${formatFileSize(minSize)}`;\r\n }\r\n\r\n // Check file type\r\n if (allowedTypes && allowedTypes.length > 0) {\r\n const fileType = file.type || getFileExtension(file.name);\r\n const isAllowed = allowedTypes.some((type) => {\r\n if (type.startsWith(\".\")) {\r\n return file.name.toLowerCase().endsWith(type.toLowerCase());\r\n }\r\n return fileType.includes(type) || fileType === type;\r\n });\r\n if (!isAllowed) {\r\n return `File type not allowed. Allowed types: ${allowedTypes.join(\", \")}`;\r\n }\r\n }\r\n\r\n return null;\r\n };\r\n\r\n // Format file size\r\n const formatFileSize = (bytes: number): string => {\r\n if (bytes === 0) {\r\n return \"0 Bytes\";\r\n }\r\n const k = 1024;\r\n const sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\"];\r\n const i = Math.floor(Math.log(bytes) / Math.log(k));\r\n return `${Math.round((bytes / k ** i) * 100) / 100} ${sizes[i]}`;\r\n };\r\n\r\n // Get file extension\r\n const getFileExtension = (filename: string): string => {\r\n return filename.slice(((filename.lastIndexOf(\".\") - 1) >>> 0) + 2);\r\n };\r\n\r\n // Handle file change\r\n const handleFileChange = (event: ChangeEvent<HTMLInputElement>) => {\r\n const { files } = event.target;\r\n if (!files || files.length === 0) {\r\n if (onChange) {\r\n onChange(undefined);\r\n }\r\n if (onFileSelect) {\r\n onFileSelect(undefined);\r\n }\r\n return;\r\n }\r\n\r\n const fileArray = Array.from(files);\r\n const validFiles: File[] = [];\r\n let hasError = false;\r\n\r\n // Validate each file\r\n for (const file of fileArray) {\r\n const validationError = validateFile(file);\r\n if (validationError) {\r\n hasError = true;\r\n if (onValidationError) {\r\n onValidationError(validationError);\r\n }\r\n } else {\r\n validFiles.push(file);\r\n }\r\n }\r\n\r\n if (validFiles.length > 0) {\r\n const result = multiple ? validFiles : validFiles[0];\r\n if (onChange) {\r\n onChange(result);\r\n }\r\n if (onFileSelect) {\r\n onFileSelect(result);\r\n }\r\n } else if (hasError && onValidationError) {\r\n // Error already handled\r\n }\r\n };\r\n\r\n // Handle button click\r\n const handleButtonClick = () => {\r\n if (!disabled) {\r\n fileInputRef.current?.click();\r\n }\r\n };\r\n\r\n // Handle file remove\r\n const handleFileRemove = () => {\r\n if (fileInputRef.current) {\r\n fileInputRef.current.value = \"\";\r\n }\r\n if (onChange) {\r\n onChange(undefined);\r\n }\r\n if (onFileRemove) {\r\n onFileRemove();\r\n }\r\n };\r\n\r\n // Handle drag and drop\r\n const handleDragEnter = (e: DragEvent<HTMLDivElement>) => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n setDragCounter((prev) => prev + 1);\r\n if (e.dataTransfer.items && e.dataTransfer.items.length > 0) {\r\n setIsDragging(true);\r\n }\r\n };\r\n\r\n const handleDragLeave = (e: DragEvent<HTMLDivElement>) => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n setDragCounter((prev) => {\r\n const newCounter = prev - 1;\r\n if (newCounter === 0) {\r\n setIsDragging(false);\r\n }\r\n return newCounter;\r\n });\r\n };\r\n\r\n const handleDragOver = (e: DragEvent<HTMLDivElement>) => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n };\r\n\r\n const handleDrop = (e: DragEvent<HTMLDivElement>) => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n setIsDragging(false);\r\n setDragCounter(0);\r\n\r\n if (disabled) {\r\n return;\r\n }\r\n\r\n const { files } = e.dataTransfer;\r\n if (files && files.length > 0) {\r\n if (onDrop) {\r\n onDrop(files);\r\n }\r\n // Create a synthetic event to reuse handleFileChange\r\n const syntheticEvent = {\r\n target: { files }\r\n } as ChangeEvent<HTMLInputElement>;\r\n handleFileChange(syntheticEvent);\r\n }\r\n };\r\n\r\n const fileName = getFileName();\r\n const displayValue = showPreview && fileName ? fileName : placeholder;\r\n\r\n return (\r\n <FormControl error={!!error} disabled={disabled} required={required} fullWidth={fullWidth} sx={formControlStyles}>\r\n <div\r\n style={containerStyles}\r\n onDragEnter={enableDragDrop ? handleDragEnter : undefined}\r\n onDragLeave={enableDragDrop ? handleDragLeave : undefined}\r\n onDragOver={enableDragDrop ? handleDragOver : undefined}\r\n onDrop={enableDragDrop ? handleDrop : undefined}\r\n >\r\n <input\r\n type=\"file\"\r\n accept={accept}\r\n multiple={multiple}\r\n name={name}\r\n id={name ? `file-upload-${name}` : undefined}\r\n onChange={handleFileChange}\r\n style={{ display: \"none\" }}\r\n ref={fileInputRef}\r\n disabled={disabled}\r\n />\r\n <TextField\r\n {...textFieldProps}\r\n label={label}\r\n value={displayValue}\r\n placeholder={placeholder}\r\n variant={variant}\r\n size={size}\r\n color={color}\r\n fullWidth={fullWidth}\r\n required={required}\r\n error={!!error}\r\n disabled={disabled}\r\n name={name}\r\n sx={inputStyles}\r\n slotProps={{\r\n ...slotProps,\r\n input: {\r\n ...slotProps?.input,\r\n readOnly: true,\r\n endAdornment: (\r\n <InputAdornment position=\"end\">\r\n {showPreview && fileName && (\r\n <IconButton onClick={handleFileRemove} disabled={disabled}>\r\n <Clear />\r\n </IconButton>\r\n )}\r\n <IconButton onClick={handleButtonClick} disabled={disabled} sx={buttonStyles}>\r\n {uploadIcon}\r\n </IconButton>\r\n </InputAdornment>\r\n )\r\n }\r\n }}\r\n slots={slots}\r\n helperText={helperText ?? (error?.message ? error.message : undefined)}\r\n />\r\n {enableDragDrop && isDragging && (\r\n <div\r\n style={{\r\n position: \"absolute\",\r\n top: 0,\r\n left: 0,\r\n right: 0,\r\n bottom: 0,\r\n backgroundColor: \"rgba(0, 0, 0, 0.05)\",\r\n border: \"2px dashed\",\r\n borderColor: \"primary.main\",\r\n borderRadius: 4,\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n justifyContent: \"center\",\r\n zIndex: 1000\r\n }}\r\n >\r\n Drop files here\r\n </div>\r\n )}\r\n </div>\r\n {error && !helperText && error.message && <FormHelperText>{error.message}</FormHelperText>}\r\n </FormControl>\r\n );\r\n }\r\n);\r\n\r\nFileUploadField.displayName = \"FileUploadField\";\r\n\r\nexport default FileUploadField;\r\n","\"use client\";\r\nimport {\r\n FormControl,\r\n FormHelperText,\r\n InputLabel,\r\n MenuItem,\r\n type MenuItemProps,\r\n Select,\r\n type SelectChangeEvent,\r\n type SelectProps\r\n} from \"@mui/material\";\r\nimport React, { type ForwardedRef, forwardRef, type SyntheticEvent } from \"react\";\r\n\r\n/**\r\n * Base option type for Select\r\n */\r\nexport type SelectOption = {\r\n name: string;\r\n value: string | number;\r\n disabled?: boolean;\r\n [key: string]: unknown;\r\n};\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n message?: string;\r\n} | null;\r\n\r\n/**\r\n * Extended Select Input Props\r\n * Extends MUI SelectProps with custom form field props\r\n */\r\nexport interface ISelectInputFieldProps extends Omit<\r\n SelectProps<string | number | (string | number)[]>,\r\n \"value\" | \"onChange\" | \"name\" | \"error\" | \"children\" | \"renderValue\"\r\n> {\r\n /** Field name for form identification */\r\n name?: string;\r\n /** Label text for the select field */\r\n label?: string;\r\n /** Current selected value(s) */\r\n value: string | number | (string | number)[] | \"\";\r\n /** Options array to display in dropdown */\r\n options: SelectOption[];\r\n /** Error object with optional message */\r\n error?: FieldError;\r\n /** Helper text to display below select */\r\n helperText?: string;\r\n /** Whether the field is disabled */\r\n disabled?: boolean;\r\n /** Select variant */\r\n variant?: SelectProps[\"variant\"];\r\n /** Select size */\r\n size?: SelectProps[\"size\"];\r\n /** Select color */\r\n color?: SelectProps[\"color\"];\r\n /** Full width of the field */\r\n fullWidth?: boolean;\r\n /** Required field indicator */\r\n required?: boolean;\r\n /** Whether to allow multiple selections */\r\n multiple?: boolean;\r\n /** Custom icon for dropdown indicator */\r\n icon?: React.ReactNode;\r\n /** Custom render function for selected value(s) */\r\n renderValue?: SelectProps<string | number | (string | number)[]>[\"renderValue\"];\r\n /** Custom render function for menu items */\r\n renderMenuItem?: (option: SelectOption, index: number) => React.ReactNode;\r\n /** Custom styles for MenuItem - can be static styles or a function that receives (option, index) */\r\n menuItemStyles?: MenuItemProps[\"sx\"] | ((option: SelectOption, index: number) => MenuItemProps[\"sx\"]);\r\n /** Custom styles for the Select */\r\n selectStyles?: SelectProps[\"sx\"];\r\n /** Custom styles for FormControl */\r\n formControlStyles?: React.ComponentProps<typeof FormControl>[\"sx\"];\r\n /** Custom styles for InputLabel */\r\n labelStyles?: React.ComponentProps<typeof InputLabel>[\"sx\"];\r\n /** Callback fired when the value changes */\r\n onChange?: (event: SelectChangeEvent<string | number | (string | number)[]>, child?: React.ReactNode) => void;\r\n /** Callback fired when menu opens */\r\n onOpen?: (event: SyntheticEvent) => void;\r\n /** Callback fired when menu closes */\r\n onClose?: (event: SyntheticEvent) => void;\r\n /** Custom slot props for MUI v7 */\r\n slotProps?: SelectProps[\"slotProps\"];\r\n /** Custom slots for MUI v7 */\r\n slots?: SelectProps[\"slots\"];\r\n /** Display empty value */\r\n displayEmpty?: boolean;\r\n /** Auto width for menu */\r\n autoWidth?: boolean;\r\n /** Native select element */\r\n native?: boolean;\r\n /** Menu props */\r\n MenuProps?: SelectProps[\"MenuProps\"];\r\n}\r\n\r\n/**\r\n * Select Input Field Component\r\n *\r\n * A customizable dropdown selection field built on top of Material UI Select and FormControl.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a flexible dropdown with support for: single/multiple selection,\r\n * error handling, helper text, custom menu item rendering, and standard select behaviors.\r\n * It integrates seamlessly with form management libraries like React Hook Form through the use of `forwardRef`.\r\n *\r\n * @param {string} [name] - {string} Field name for form identification\r\n * @param {string} [label] - {string} Label text for the select field\r\n * @param {string | number | (string | number)[] | ''} value - {string | number | (string | number)[] | ''} Current selected value(s) (controlled component)\r\n * @param {SelectOption[]} options - {SelectOption[]} Array of options to display in dropdown\r\n * @param {FieldError} [error] - {FieldError} Error object with optional message\r\n * @param {string} [helperText] - {string} Helper text to display below select\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {SelectProps['variant']} [variant='outlined'] - {SelectProps['variant']} Select variant\r\n * @param {SelectProps['size']} [size] - {SelectProps['size']} Select size\r\n * @param {SelectProps['color']} [color] - {SelectProps['color']} Select color\r\n * @param {boolean} [fullWidth=true] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {boolean} [multiple=false] - {boolean} Whether to allow multiple selections\r\n * @param {React.ReactNode} [icon] - {React.ReactNode} Custom icon for dropdown indicator\r\n * @param {SelectProps['renderValue']} [renderValue] - {Function} Custom render function for selected value(s)\r\n * @param {Function} [renderMenuItem] - {Function} Custom render function for menu items\r\n * @param {MenuItemProps['sx'] | Function} [menuItemStyles] - {Object|Function} Custom styles for MenuItem\r\n * @param {SelectProps['sx']} [selectStyles] - {SelectProps['sx']} Custom styles for the Select component\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {InputLabelProps['sx']} [labelStyles] - {InputLabelProps['sx']} Custom styles for InputLabel\r\n * @param {Function} [onChange] - {Function} Callback fired when value changes\r\n * @param {Function} [onOpen] - {Function} Callback fired when menu opens\r\n * @param {Function} [onClose] - {Function} Callback fired when menu closes\r\n * @param {Object} [slotProps] - {Object} Custom slot props for MUI v7\r\n * @param {Object} [slots] - {Object} Custom slots for MUI v7\r\n * @param {boolean} [displayEmpty=false] - {boolean} Whether to display empty value\r\n * @param {boolean} [autoWidth=false] - {boolean} Whether the menu should have auto width\r\n * @param {boolean} [native=false] - {boolean} Whether to use native select element\r\n * @param {SelectProps['MenuProps']} [MenuProps] - {Object} Custom Menu props\r\n *\r\n * @returns {JSX.Element} The Select Input Field component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import SelectInputField from \"@react-solutions/inputs\";\r\n * import { useState } from \"react\";\r\n *\r\n * function MyForm() {\r\n * const [val, setVal] = useState(\"\");\r\n * const options = [{ name: \"Option 1\", value: \"1\" }, { name: \"Option 2\", value: \"2\" }];\r\n *\r\n * return (\r\n * <SelectInputField\r\n * name=\"mySelect\"\r\n * label=\"Select Option\"\r\n * value={val}\r\n * options={options}\r\n * onChange={(e) => setVal(e.target.value)}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst SelectInputField = forwardRef<HTMLInputElement, ISelectInputFieldProps>(\r\n (\r\n {\r\n name,\r\n label,\r\n value,\r\n onChange,\r\n onOpen,\r\n onClose,\r\n options,\r\n error,\r\n helperText,\r\n disabled = false,\r\n variant = \"outlined\",\r\n size,\r\n color,\r\n fullWidth = true,\r\n required,\r\n multiple = false,\r\n icon,\r\n renderValue,\r\n renderMenuItem,\r\n menuItemStyles,\r\n selectStyles,\r\n formControlStyles,\r\n labelStyles,\r\n slotProps,\r\n slots,\r\n displayEmpty = false,\r\n autoWidth = false,\r\n native = false,\r\n MenuProps,\r\n ...selectProps\r\n },\r\n ref: ForwardedRef<HTMLInputElement>\r\n ) => {\r\n // Default render value function\r\n const defaultRenderValue = (selected: string | number | (string | number)[]): React.ReactNode => {\r\n if (multiple && Array.isArray(selected)) {\r\n if (selected.length === 0) {\r\n return \"\";\r\n }\r\n return selected\r\n .map((val) => {\r\n const option = options.find((opt) => opt.value === val);\r\n return option?.name ?? String(val);\r\n })\r\n .join(\", \");\r\n }\r\n if (!multiple && selected !== \"\" && selected !== null && selected !== undefined) {\r\n const option = options.find((opt) => opt.value === selected);\r\n return option?.name ?? String(selected);\r\n }\r\n return \"\";\r\n };\r\n\r\n // Default render menu item function\r\n const defaultRenderMenuItem = (option: SelectOption, index: number): React.ReactNode => {\r\n const menuItemSx =\r\n typeof menuItemStyles === \"function\"\r\n ? (menuItemStyles as (option: SelectOption, index: number) => MenuItemProps[\"sx\"])(option, index)\r\n : menuItemStyles;\r\n\r\n return (\r\n <MenuItem key={`${option.value}-${index}`} value={option.value} disabled={option.disabled} sx={menuItemSx}>\r\n {renderMenuItem ? renderMenuItem(option, index) : option.name}\r\n </MenuItem>\r\n );\r\n };\r\n\r\n // Handle onChange with proper typing\r\n const handleChange = (event: SelectChangeEvent<string | number | (string | number)[]>, child?: React.ReactNode) => {\r\n if (onChange) {\r\n onChange(event, child);\r\n }\r\n };\r\n\r\n const labelId = label ? `${name || \"select\"}-label` : undefined;\r\n const selectId = label ? `${name || \"select\"}-select` : undefined;\r\n\r\n return (\r\n <FormControl\r\n fullWidth={fullWidth}\r\n error={!!error}\r\n disabled={disabled}\r\n required={required}\r\n size={size}\r\n variant={variant}\r\n sx={formControlStyles}\r\n >\r\n {label && (\r\n <InputLabel id={labelId} sx={labelStyles}>\r\n {label}\r\n </InputLabel>\r\n )}\r\n <Select\r\n {...selectProps}\r\n labelId={labelId}\r\n id={selectId}\r\n name={name}\r\n value={value}\r\n label={label}\r\n onChange={handleChange}\r\n onOpen={onOpen}\r\n onClose={onClose}\r\n disabled={disabled}\r\n multiple={multiple}\r\n displayEmpty={displayEmpty}\r\n autoWidth={autoWidth}\r\n native={native}\r\n MenuProps={MenuProps}\r\n IconComponent={icon as React.ElementType}\r\n renderValue={renderValue ?? defaultRenderValue}\r\n slotProps={slotProps}\r\n slots={slots}\r\n sx={selectStyles}\r\n ref={ref}\r\n >\r\n {options && Array.isArray(options) && options.map((option, index) => defaultRenderMenuItem(option, index))}\r\n </Select>\r\n {error && <FormHelperText>{helperText ?? (error?.message ? error.message : \"\")}</FormHelperText>}\r\n {!error && helperText && <FormHelperText>{helperText}</FormHelperText>}\r\n </FormControl>\r\n );\r\n }\r\n);\r\n\r\nSelectInputField.displayName = \"SelectInputField\";\r\n\r\nexport default SelectInputField;\r\n","\"use client\";\r\nimport { FormControl, InputAdornment, TextField, type TextFieldProps } from \"@mui/material\";\r\nimport React, {\r\n type ChangeEvent,\r\n type FocusEvent,\r\n type ForwardedRef,\r\n forwardRef,\r\n memo,\r\n useCallback,\r\n useEffect,\r\n useMemo,\r\n useState\r\n} from \"react\";\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n message?: string;\r\n} | null;\r\n\r\n/**\r\n * Number pattern types\r\n */\r\nexport type NumberPattern =\r\n | \"phone\"\r\n | \"credit-card\"\r\n | \"currency\"\r\n | \"ssn\"\r\n | \"zip-code\"\r\n | \"decimal\"\r\n | \"integer\"\r\n | \"percentage\"\r\n | \"custom\";\r\n\r\n/**\r\n * Extract only digits from a string\r\n */\r\nconst extractDigits = (value: string): string => {\r\n return value.replace(/\\D/g, \"\");\r\n};\r\n\r\n/**\r\n * Format value according to pattern (X represents digits)\r\n * Example: pattern \"XXX-XXXX\" with digits \"1234567\" -> \"123-4567\"\r\n */\r\nconst formatByPattern = (digits: string, pattern: string): string => {\r\n if (!pattern || !digits) {\r\n return digits;\r\n }\r\n let formatted = \"\";\r\n let digitIndex = 0;\r\n for (let i = 0; i < pattern.length && digitIndex < digits.length; i++) {\r\n if (pattern[i] === \"X\") {\r\n formatted += digits[digitIndex];\r\n digitIndex++;\r\n } else {\r\n formatted += pattern[i];\r\n }\r\n }\r\n return formatted;\r\n};\r\n\r\n/**\r\n * Generate placeholder from pattern\r\n */\r\nconst generatePlaceholderFromPattern = (pattern: string): string => {\r\n if (!pattern) {\r\n return \"\";\r\n }\r\n return pattern.replace(/X/g, \"0\");\r\n};\r\n\r\n/**\r\n * Format phone number (XXX) XXX-XXXX\r\n */\r\nconst formatPhoneNumber = (value: string): string => {\r\n const numbers = extractDigits(value);\r\n if (numbers.length <= 3) {\r\n return numbers;\r\n }\r\n if (numbers.length <= 6) {\r\n return `(${numbers.slice(0, 3)}) ${numbers.slice(3)}`;\r\n }\r\n return `(${numbers.slice(0, 3)}) ${numbers.slice(3, 6)}-${numbers.slice(6, 10)}`;\r\n};\r\n\r\n/**\r\n * Format credit card XXXX XXXX XXXX XXXX\r\n */\r\nconst formatCreditCard = (value: string): string => {\r\n const numbers = value.replace(/\\D/g, \"\");\r\n const formatted = numbers.match(/.{1,4}/g)?.join(\" \") || numbers;\r\n return formatted.slice(0, 19); // Max 16 digits + 3 spaces\r\n};\r\n\r\n/**\r\n * Format currency $X,XXX.XX\r\n */\r\nconst formatCurrency = (value: string, allowDecimals: boolean = true): string => {\r\n const numbers = value.replace(/[^\\d.]/g, \"\");\r\n if (!allowDecimals) {\r\n return numbers.replace(/\\D/g, \"\");\r\n }\r\n // Allow only one decimal point\r\n const parts = numbers.split(\".\");\r\n if (parts.length > 2) {\r\n return `${parts[0]}.${parts.slice(1).join(\"\")}`;\r\n }\r\n if (parts.length === 2 && parts[1].length > 2) {\r\n return `${parts[0]}.${parts[1].slice(0, 2)}`;\r\n }\r\n return numbers;\r\n};\r\n\r\n/**\r\n * Format SSN XXX-XX-XXXX\r\n */\r\nconst formatSSN = (value: string): string => {\r\n const numbers = value.replace(/\\D/g, \"\");\r\n if (numbers.length <= 3) {\r\n return numbers;\r\n }\r\n if (numbers.length <= 5) {\r\n return `${numbers.slice(0, 3)}-${numbers.slice(3)}`;\r\n }\r\n return `${numbers.slice(0, 3)}-${numbers.slice(3, 5)}-${numbers.slice(5, 9)}`;\r\n};\r\n\r\n/**\r\n * Format ZIP code XXXXX or XXXXX-XXXX\r\n */\r\nconst formatZipCode = (value: string): string => {\r\n const numbers = value.replace(/\\D/g, \"\");\r\n if (numbers.length <= 5) {\r\n return numbers;\r\n }\r\n return `${numbers.slice(0, 5)}-${numbers.slice(5, 9)}`;\r\n};\r\n\r\n/**\r\n * Format percentage XX%\r\n */\r\nconst formatPercentage = (value: string): string => {\r\n const numbers = value.replace(/\\D/g, \"\");\r\n return numbers.slice(0, 3); // Max 100%\r\n};\r\n\r\n/**\r\n * Extended Number Input Field Props\r\n * Extends MUI TextFieldProps with custom number field props\r\n */\r\nexport interface INumberInputFieldProps extends Omit<\r\n TextFieldProps,\r\n \"value\" | \"onChange\" | \"name\" | \"type\" | \"error\" | \"inputRef\"\r\n> {\r\n /** Field name for form identification */\r\n name?: string;\r\n /** Label text for the number field */\r\n label?: string;\r\n /** Current number value (as string to support formatted values) */\r\n value: string;\r\n /** Error object with optional message */\r\n error?: FieldError;\r\n /** Helper text to display below field */\r\n helperText?: string;\r\n /** Whether the field is disabled */\r\n disabled?: boolean;\r\n /** Placeholder text */\r\n placeholder?: string;\r\n /** TextField variant */\r\n variant?: TextFieldProps[\"variant\"];\r\n /** TextField size */\r\n size?: TextFieldProps[\"size\"];\r\n /** TextField color */\r\n color?: TextFieldProps[\"color\"];\r\n /** Full width of the field */\r\n fullWidth?: boolean;\r\n /** Required field indicator */\r\n required?: boolean;\r\n /** Number pattern type or pattern string (e.g., \"XXX-XXXX\" where X represents digits) */\r\n pattern?: NumberPattern | string;\r\n /** Custom regex pattern (used when pattern is \"custom\") */\r\n customPattern?: RegExp;\r\n /** Custom formatter function */\r\n customFormatter?: (value: string) => string;\r\n /** Minimum value */\r\n min?: number;\r\n /** Maximum value */\r\n max?: number;\r\n /** Step value for number input */\r\n step?: number;\r\n /** Allow decimal numbers (for decimal pattern) */\r\n allowDecimals?: boolean;\r\n /** Number of decimal places */\r\n decimalPlaces?: number;\r\n /** Start adornment (icon or element before input) */\r\n startAdornment?: React.ReactNode;\r\n /** End adornment (icon or element after input) */\r\n endAdornment?: React.ReactNode;\r\n /** Callback fired when the value changes (returns formatted string) */\r\n onChange?: (event: ChangeEvent<HTMLInputElement>) => void;\r\n /** Callback fired when field receives focus */\r\n onFocus?: (event: FocusEvent<HTMLInputElement>) => void;\r\n /** Callback fired when field loses focus */\r\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void;\r\n /** Callback fired on Enter key press */\r\n onEnterPress?: (value: string) => void;\r\n /** Custom styles for the TextField */\r\n inputStyles?: TextFieldProps[\"sx\"];\r\n /** Custom styles for FormControl */\r\n formControlStyles?: React.ComponentProps<typeof FormControl>[\"sx\"];\r\n /** Custom slot props for MUI v7 */\r\n slotProps?: TextFieldProps[\"slotProps\"];\r\n /** Custom slots for MUI v7 */\r\n slots?: TextFieldProps[\"slots\"];\r\n}\r\n\r\n/**\r\n * Number Field Component\r\n *\r\n * A highly customizable numeric input field built on top of Material UI TextField and FormControl.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a numeric input with advanced formatting support for: phone numbers,\r\n * credit cards, currency, SSN, ZIP codes, percentages, decimals, and custom patterns.\r\n * It handles input validation, automatic formatting, and integrates seamlessly with React Hook Form.\r\n *\r\n * @param {string} [name] - {string} Field name for form identification\r\n * @param {string} [label] - {string} Label text for the number field\r\n * @param {string} value - {string} Current number value (controlled component)\r\n * @param {FieldError} [error] - {FieldError} Error object with optional message\r\n * @param {string} [helperText] - {string} Helper text to display below field\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {string} [placeholder] - {string} Placeholder text\r\n * @param {TextFieldProps['variant']} [variant='outlined'] - {TextFieldProps['variant']} TextField variant\r\n * @param {TextFieldProps['size']} [size] - {TextFieldProps['size']} TextField size\r\n * @param {TextFieldProps['color']} [color='primary'] - {TextFieldProps['color']} TextField color\r\n * @param {boolean} [fullWidth=true] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {NumberPattern | string} [pattern='integer'] - {NumberPattern | string} Number pattern type or custom pattern string\r\n * @param {RegExp} [customPattern] - {RegExp} Custom regex pattern (for pattern=\"custom\")\r\n * @param {(value: string) => string} [customFormatter] - {Function} Custom formatter function\r\n * @param {number} [min] - {number} Minimum value\r\n * @param {number} [max] - {number} Maximum value\r\n * @param {number} [step] - {number} Step value for number input\r\n * @param {boolean} [allowDecimals=true] - {boolean} Whether to allow decimal numbers\r\n * @param {number} [decimalPlaces=2] - {number} Number of decimal places allowed\r\n * @param {React.ReactNode} [startAdornment] - {React.ReactNode} Adornment before input\r\n * @param {React.ReactNode} [endAdornment] - {React.ReactNode} Adornment after input\r\n * @param {Function} [onChange] - {Function} Callback fired when value changes\r\n * @param {Function} [onFocus] - {Function} Callback when field receives focus\r\n * @param {Function} [onBlur] - {Function} Callback when field loses focus\r\n * @param {Function} [onEnterPress] - {Function} Callback fired on Enter key press\r\n * @param {TextFieldProps['sx']} [inputStyles] - {TextFieldProps['sx']} Custom styles for the TextField\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {Object} [slotProps] - {Object} Custom slot props for MUI v7\r\n * @param {Object} [slots] - {Object} Custom slots for MUI v7\r\n *\r\n * @returns {JSX.Element} The Number Field component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import NumberField from \"@react-solutions/inputs\";\r\n * import { useState } from \"react\";\r\n *\r\n * function MyForm() {\r\n * const [phone, setPhone] = useState(\"\");\r\n *\r\n * return (\r\n * <NumberField\r\n * name=\"phone\"\r\n * label=\"Phone Number\"\r\n * value={phone}\r\n * pattern=\"phone\"\r\n * onChange={(e) => setPhone(e.target.value)}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst NumberField = memo(\r\n forwardRef<HTMLDivElement, INumberInputFieldProps>(\r\n (\r\n {\r\n name,\r\n label,\r\n value,\r\n onChange,\r\n onFocus,\r\n onBlur,\r\n onEnterPress,\r\n error,\r\n helperText,\r\n disabled = false,\r\n placeholder,\r\n variant = \"outlined\",\r\n size,\r\n color = \"primary\",\r\n fullWidth = true,\r\n required,\r\n pattern = \"integer\",\r\n customPattern,\r\n customFormatter,\r\n min,\r\n max,\r\n step,\r\n allowDecimals = true,\r\n decimalPlaces = 2,\r\n startAdornment,\r\n endAdornment,\r\n inputStyles,\r\n formControlStyles,\r\n slotProps,\r\n slots,\r\n ...textFieldProps\r\n },\r\n ref: ForwardedRef<HTMLDivElement>\r\n ) => {\r\n const [displayValue, setDisplayValue] = useState<string>(value);\r\n\r\n // Check if pattern is a string (pattern string) or a NumberPattern type\r\n const isPatternString = typeof pattern === \"string\" && pattern.includes(\"X\");\r\n const activePatternString = isPatternString ? pattern : undefined;\r\n const activePatternType = isPatternString ? undefined : (pattern as NumberPattern | undefined);\r\n\r\n // Format value based on pattern\r\n const formatValue = useCallback(\r\n (inputValue: string): string => {\r\n if (!inputValue) {\r\n return \"\";\r\n }\r\n\r\n // If pattern string is provided (from pattern prop), use it for formatting\r\n if (activePatternString) {\r\n const digits = extractDigits(inputValue);\r\n return formatByPattern(digits, activePatternString);\r\n }\r\n\r\n // Use predefined pattern types\r\n switch (activePatternType) {\r\n case \"phone\":\r\n return formatPhoneNumber(inputValue);\r\n case \"credit-card\":\r\n return formatCreditCard(inputValue);\r\n case \"currency\":\r\n return formatCurrency(inputValue, allowDecimals);\r\n case \"ssn\":\r\n return formatSSN(inputValue);\r\n case \"zip-code\":\r\n return formatZipCode(inputValue);\r\n case \"percentage\":\r\n return formatPercentage(inputValue);\r\n case \"decimal\":\r\n return formatCurrency(inputValue, allowDecimals);\r\n case \"integer\":\r\n return extractDigits(inputValue);\r\n case \"custom\":\r\n if (customFormatter) {\r\n return customFormatter(inputValue);\r\n }\r\n if (customPattern) {\r\n const numbers = extractDigits(inputValue);\r\n return numbers;\r\n }\r\n return extractDigits(inputValue);\r\n default:\r\n return extractDigits(inputValue);\r\n }\r\n },\r\n [activePatternString, activePatternType, allowDecimals, customFormatter, customPattern]\r\n );\r\n\r\n // Update display value when value prop changes\r\n useEffect(() => {\r\n const formatted = formatValue(value);\r\n setDisplayValue((prev) => {\r\n if (prev !== formatted) {\r\n return formatted;\r\n }\r\n return prev;\r\n });\r\n }, [value, formatValue]);\r\n\r\n // Validate input based on pattern\r\n const isValidInput = (inputValue: string, key: string): boolean => {\r\n // Allow backspace, delete, tab, escape, enter\r\n if ([\"Backspace\", \"Delete\", \"Tab\", \"Escape\", \"Enter\"].includes(key)) {\r\n return true;\r\n }\r\n\r\n // Allow Ctrl/Cmd + A, C, V, X\r\n if (key === \"a\" || key === \"c\" || key === \"v\" || key === \"x\") {\r\n return true;\r\n }\r\n\r\n // For decimal pattern, allow decimal point\r\n if ((activePatternType === \"decimal\" || activePatternType === \"currency\") && allowDecimals && key === \".\") {\r\n return true;\r\n }\r\n\r\n // Check if it's a number\r\n if (!/^\\d$/.test(key)) {\r\n return false;\r\n }\r\n\r\n // Pattern string validation - check if we've reached max digits\r\n if (activePatternString) {\r\n const maxDigits = (activePatternString.match(/X/g) || []).length;\r\n const currentDigits = extractDigits(inputValue);\r\n return currentDigits.length < maxDigits;\r\n }\r\n\r\n // Custom pattern validation\r\n if (activePatternType === \"custom\" && customPattern) {\r\n const testValue = inputValue + key;\r\n return customPattern.test(testValue);\r\n }\r\n\r\n return true;\r\n };\r\n\r\n // Handle input change\r\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\r\n const inputValue = event.target.value;\r\n const formattedValue = formatValue(inputValue);\r\n setDisplayValue(formattedValue);\r\n\r\n // For pattern-based formatting, return only digits in onChange\r\n const digitsOnly = activePatternString ? extractDigits(inputValue) : formattedValue;\r\n\r\n // Create synthetic event with formatted value\r\n const syntheticEvent = {\r\n ...event,\r\n target: {\r\n ...event.target,\r\n value: digitsOnly\r\n },\r\n currentTarget: {\r\n ...event.currentTarget,\r\n value: digitsOnly\r\n }\r\n } as ChangeEvent<HTMLInputElement>;\r\n\r\n if (onChange) {\r\n onChange(syntheticEvent);\r\n }\r\n };\r\n\r\n // Handle paste event\r\n const handlePaste = (event: React.ClipboardEvent<HTMLInputElement>) => {\r\n if (disabled) {\r\n return;\r\n }\r\n event.preventDefault();\r\n const pastedText = event.clipboardData.getData(\"text\");\r\n const digits = extractDigits(pastedText);\r\n\r\n // Limit by pattern string if provided\r\n const maxDigits = activePatternString ? (activePatternString.match(/X/g) || []).length : undefined;\r\n const limitedDigits = maxDigits ? digits.slice(0, maxDigits) : digits;\r\n\r\n const formattedValue = activePatternString\r\n ? formatByPattern(limitedDigits, activePatternString)\r\n : formatValue(limitedDigits);\r\n\r\n setDisplayValue(formattedValue);\r\n\r\n // Create synthetic event\r\n const syntheticEvent = {\r\n ...event,\r\n target: {\r\n ...event.target,\r\n value: limitedDigits\r\n },\r\n currentTarget: {\r\n ...event.currentTarget,\r\n value: limitedDigits\r\n }\r\n } as unknown as ChangeEvent<HTMLInputElement>;\r\n\r\n if (onChange) {\r\n onChange(syntheticEvent);\r\n }\r\n };\r\n\r\n // Handle key down to prevent non-numeric input\r\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\r\n const input = event.currentTarget.querySelector(\"input\");\r\n if (!input) {\r\n return;\r\n }\r\n\r\n const currentValue = input.value || \"\";\r\n const { key } = event;\r\n\r\n // Allow special keys\r\n if (\r\n [\r\n \"Backspace\",\r\n \"Delete\",\r\n \"Tab\",\r\n \"Escape\",\r\n \"Enter\",\r\n \"ArrowLeft\",\r\n \"ArrowRight\",\r\n \"ArrowUp\",\r\n \"ArrowDown\",\r\n \"Home\",\r\n \"End\"\r\n ].includes(key)\r\n ) {\r\n if (key === \"Enter\" && onEnterPress) {\r\n onEnterPress(displayValue);\r\n }\r\n if (textFieldProps.onKeyDown) {\r\n textFieldProps.onKeyDown(event);\r\n }\r\n return;\r\n }\r\n\r\n // Allow Ctrl/Cmd combinations\r\n if (event.ctrlKey || event.metaKey) {\r\n if (textFieldProps.onKeyDown) {\r\n textFieldProps.onKeyDown(event);\r\n }\r\n return;\r\n }\r\n\r\n // Validate input\r\n if (!isValidInput(currentValue, key)) {\r\n event.preventDefault();\r\n return;\r\n }\r\n\r\n if (textFieldProps.onKeyDown) {\r\n textFieldProps.onKeyDown(event);\r\n }\r\n };\r\n\r\n // Build input props\r\n const inputProps = useMemo(\r\n () => ({\r\n min,\r\n max,\r\n step,\r\n inputMode:\r\n activePatternType === \"phone\"\r\n ? \"tel\"\r\n : activePatternType === \"decimal\" || activePatternType === \"currency\"\r\n ? \"decimal\"\r\n : \"numeric\",\r\n maxLength: activePatternString ? activePatternString.length : undefined,\r\n ...((textFieldProps as any).inputProps || {})\r\n }),\r\n [min, max, step, activePatternType, activePatternString, textFieldProps]\r\n );\r\n\r\n // Memoize adornments\r\n const startAdornmentElement = useMemo(\r\n () => (startAdornment ? <InputAdornment position=\"start\">{startAdornment}</InputAdornment> : undefined),\r\n [startAdornment]\r\n );\r\n\r\n const endAdornmentElement = useMemo(\r\n () => (endAdornment ? <InputAdornment position=\"end\">{endAdornment}</InputAdornment> : undefined),\r\n [endAdornment]\r\n );\r\n\r\n // Build slotProps for MUI v7\r\n const finalSlotProps = useMemo(\r\n () => ({\r\n ...slotProps,\r\n input: {\r\n ...slotProps?.input,\r\n inputProps,\r\n ...(startAdornmentElement && {\r\n startAdornment: startAdornmentElement\r\n }),\r\n ...(endAdornmentElement && {\r\n endAdornment: endAdornmentElement\r\n })\r\n }\r\n }),\r\n [slotProps, inputProps, startAdornmentElement, endAdornmentElement]\r\n );\r\n\r\n // Determine input type\r\n const inputType = useMemo(\r\n () =>\r\n activePatternType === \"phone\"\r\n ? \"tel\"\r\n : activePatternType === \"decimal\" || activePatternType === \"currency\"\r\n ? \"text\" // Use text to allow formatting\r\n : \"text\", // Use text for all patterns to allow formatting\r\n [activePatternType]\r\n );\r\n\r\n // Memoize placeholder\r\n const displayPlaceholder = useMemo(\r\n () => placeholder || (activePatternString ? generatePlaceholderFromPattern(activePatternString) : placeholder),\r\n [placeholder, activePatternString]\r\n );\r\n\r\n // Memoize helper text\r\n const displayHelperText = useMemo(\r\n () => helperText ?? (error?.message ? error.message : undefined),\r\n [helperText, error?.message]\r\n );\r\n\r\n return (\r\n <FormControl\r\n error={!!error}\r\n disabled={disabled}\r\n required={required}\r\n fullWidth={fullWidth}\r\n sx={formControlStyles}\r\n >\r\n <TextField\r\n {...textFieldProps}\r\n name={name}\r\n label={label}\r\n value={displayValue}\r\n onChange={handleChange}\r\n onFocus={onFocus}\r\n onBlur={onBlur}\r\n onKeyDown={handleKeyDown}\r\n onPaste={handlePaste}\r\n placeholder={displayPlaceholder}\r\n variant={variant}\r\n size={size}\r\n color={color}\r\n fullWidth={fullWidth}\r\n required={required}\r\n error={!!error}\r\n disabled={disabled}\r\n type={inputType}\r\n autoComplete=\"off\"\r\n slotProps={finalSlotProps}\r\n slots={slots}\r\n sx={inputStyles}\r\n ref={ref}\r\n helperText={displayHelperText}\r\n />\r\n </FormControl>\r\n );\r\n }\r\n )\r\n);\r\n\r\nNumberField.displayName = \"NumberField\";\r\n\r\nexport default NumberField;\r\n","\"use client\";\r\nimport { Box, FormControl, type FormControlProps, FormHelperText, TextField, type TextFieldProps } from \"@mui/material\";\r\nimport React, {\r\n type ChangeEvent,\r\n type FocusEvent,\r\n type ForwardedRef,\r\n forwardRef,\r\n useEffect,\r\n useRef,\r\n useState\r\n} from \"react\";\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n message?: string;\r\n} | null;\r\n\r\n/**\r\n * Extended OTP Input Field Props\r\n */\r\nexport interface IOTPInputFieldProps extends Omit<\r\n TextFieldProps,\r\n \"value\" | \"onChange\" | \"name\" | \"type\" | \"error\" | \"inputRef\" | \"multiline\" | \"variant\" | \"size\"\r\n> {\r\n /** Field name for form identification */\r\n name?: string;\r\n /** Label text for the OTP field */\r\n label?: string;\r\n /** Current OTP value (string of digits) */\r\n value: string;\r\n /** Error object with optional message */\r\n error?: FieldError;\r\n /** Helper text to display below field */\r\n helperText?: string;\r\n /** Whether the field is disabled */\r\n disabled?: boolean;\r\n /** Number of OTP input boxes (default: 6) */\r\n length?: number;\r\n /** TextField variant */\r\n variant?: TextFieldProps[\"variant\"];\r\n /** TextField size */\r\n size?: TextFieldProps[\"size\"];\r\n /** TextField color */\r\n color?: TextFieldProps[\"color\"];\r\n /** Full width of the field */\r\n fullWidth?: boolean;\r\n /** Required field indicator */\r\n required?: boolean;\r\n /** Spacing between OTP boxes */\r\n spacing?: number;\r\n /** Whether to auto-focus first input on mount */\r\n autoFocus?: boolean;\r\n /** Whether to auto-submit when all boxes are filled */\r\n autoSubmit?: boolean;\r\n /** Callback fired when the value changes */\r\n onChange?: (value: string) => void;\r\n /** Callback fired when all OTP boxes are filled */\r\n onComplete?: (value: string) => void;\r\n /** Callback fired when field receives focus */\r\n onFocus?: (event: FocusEvent<HTMLInputElement>) => void;\r\n /** Callback fired when field loses focus */\r\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void;\r\n /** Callback fired on Enter key press */\r\n onEnterPress?: (value: string) => void;\r\n /** Custom styles for the OTP container */\r\n containerStyles?: React.CSSProperties;\r\n /** Custom styles for individual OTP input boxes */\r\n inputStyles?: TextFieldProps[\"sx\"];\r\n /** Custom styles for FormControl */\r\n formControlStyles?: FormControlProps[\"sx\"];\r\n /** Custom slot props for MUI v7 */\r\n slotProps?: TextFieldProps[\"slotProps\"];\r\n /** Custom slots for MUI v7 */\r\n slots?: TextFieldProps[\"slots\"];\r\n}\r\n\r\n/**\r\n * OTP Field Component\r\n *\r\n * A specialized multi-box input field for One-Time Passwords (OTP) built on top of Material UI TextField.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a series of individual input boxes for OTP entry with support for:\r\n * automatic focus shifting, backspace handling, pasting multiple digits, error handling, and completion callbacks.\r\n * It integrates seamlessly with form management libraries like React Hook Form through the use of `forwardRef`.\r\n *\r\n * @param {string} [name] - {string} Field name for form identification\r\n * @param {string} [label] - {string} Label text for the OTP field\r\n * @param {string} value - {string} Current OTP value (string of digits)\r\n * @param {FieldError} [error] - {FieldError} Error object with optional message\r\n * @param {string} [helperText] - {string} Helper text to display below field\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {number} [length=6] - {number} Number of OTP input boxes\r\n * @param {TextFieldProps['variant']} [variant='outlined'] - {TextFieldProps['variant']} TextField variant\r\n * @param {TextFieldProps['size']} [size] - {TextFieldProps['size']} TextField size\r\n * @param {TextFieldProps['color']} [color='primary'] - {TextFieldProps['color']} TextField color\r\n * @param {boolean} [fullWidth=true] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {number} [spacing=1] - {number} Spacing between OTP boxes\r\n * @param {boolean} [autoFocus=false] - {boolean} Whether to auto-focus first input on mount\r\n * @param {boolean} [autoSubmit=false] - {boolean} Whether to auto-submit when all boxes are filled\r\n * @param {(value: string) => void} [onChange] - {(value: string) => void} Callback fired when value changes\r\n * @param {(value: string) => void} [onComplete] - {(value: string) => void} Callback fired when all boxes are filled\r\n * @param {Function} [onFocus] - {Function} Callback when field receives focus\r\n * @param {Function} [onBlur] - {Function} Callback when field loses focus\r\n * @param {Function} [onEnterPress] - {Function} Callback fired on Enter key press\r\n * @param {React.CSSProperties} [containerStyles] - {React.CSSProperties} Custom styles for the OTP container\r\n * @param {TextFieldProps['sx']} [inputStyles] - {TextFieldProps['sx']} Custom styles for individual OTP input boxes\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {Object} [slotProps] - {Object} Custom slot props for MUI v7\r\n * @param {Object} [slots] - {Object} Custom slots for MUI v7\r\n *\r\n * @returns {JSX.Element} The OTP Field component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import OTPField from \"@react-solutions/inputs\";\r\n * import { useState } from \"react\";\r\n *\r\n * function MyForm() {\r\n * const [otp, setOtp] = useState(\"\");\r\n *\r\n * return (\r\n * <OTPField\r\n * name=\"otp\"\r\n * label=\"Enter Verification Code\"\r\n * value={otp}\r\n * length={6}\r\n * onChange={(val) => setOtp(val)}\r\n * onComplete={(val) => console.log(\"OTP Complete:\", val)}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst OTPField = forwardRef<HTMLDivElement, IOTPInputFieldProps>(\r\n (\r\n {\r\n name,\r\n label,\r\n value,\r\n onChange,\r\n onComplete,\r\n onFocus,\r\n onBlur,\r\n onEnterPress,\r\n error,\r\n helperText,\r\n disabled = false,\r\n variant = \"outlined\",\r\n size,\r\n color = \"primary\",\r\n fullWidth = true,\r\n required,\r\n length = 6,\r\n spacing = 1,\r\n autoFocus = false,\r\n autoSubmit = false,\r\n containerStyles,\r\n inputStyles,\r\n formControlStyles,\r\n slotProps,\r\n slots,\r\n ...textFieldProps\r\n },\r\n ref: ForwardedRef<HTMLDivElement>\r\n ) => {\r\n const [otpValues, setOtpValues] = useState<string[]>(Array(length).fill(\"\"));\r\n const inputRefs = useRef<(HTMLInputElement | null)[]>([]);\r\n const lastSentValueRef = useRef<string>(\"\");\r\n const isInternalUpdateRef = useRef<boolean>(false);\r\n const otpValuesRef = useRef<string[]>(Array(length).fill(\"\"));\r\n const inputSessionActiveRef = useRef<boolean>(false);\r\n const inputSessionTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\r\n\r\n // Keep ref in sync with state\r\n useEffect(() => {\r\n otpValuesRef.current = otpValues;\r\n }, [otpValues]);\r\n\r\n // Update internal state when value prop changes (only from external changes)\r\n useEffect(() => {\r\n const currentOtpString = otpValuesRef.current.join(\"\");\r\n\r\n // If we're in an active input session, preserve positions unless value is clearly external\r\n if (inputSessionActiveRef.current) {\r\n // If the value prop matches what we just sent, don't reset\r\n if (value === lastSentValueRef.current) {\r\n return;\r\n }\r\n // If value represents the same digits (even if positions differ), preserve our state\r\n // This handles cases where parent normalizes the value\r\n const currentDigits = currentOtpString;\r\n const incomingDigits = value || \"\";\r\n if (currentDigits === incomingDigits && currentDigits.length > 0) {\r\n return;\r\n }\r\n // If incoming value has same digit count and matches our sent value's digits, preserve\r\n if (incomingDigits.length === currentDigits.length && incomingDigits === lastSentValueRef.current) {\r\n return;\r\n }\r\n }\r\n\r\n // Skip if this update was triggered internally\r\n if (isInternalUpdateRef.current) {\r\n isInternalUpdateRef.current = false;\r\n // If the value prop matches what we just sent, don't reset the positions\r\n if (value === lastSentValueRef.current) {\r\n return;\r\n }\r\n }\r\n\r\n // Only update if value prop is different from our current state\r\n if (value !== currentOtpString) {\r\n if (value) {\r\n const values = value.split(\"\").slice(0, length);\r\n const paddedValues = [...values, ...Array(length - values.length).fill(\"\")];\r\n setOtpValues(paddedValues);\r\n } else {\r\n setOtpValues(Array(length).fill(\"\"));\r\n }\r\n }\r\n }, [value, length]);\r\n\r\n // Focus first input on mount if autoFocus is true\r\n useEffect(() => {\r\n if (autoFocus && inputRefs.current[0]) {\r\n inputRefs.current[0].focus();\r\n }\r\n }, [autoFocus]);\r\n\r\n // Cleanup timeout on unmount\r\n useEffect(() => {\r\n return () => {\r\n if (inputSessionTimeoutRef.current) {\r\n clearTimeout(inputSessionTimeoutRef.current);\r\n }\r\n };\r\n }, []);\r\n\r\n // Handle input change\r\n const handleChange = (index: number, event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\r\n if (disabled) {\r\n return;\r\n }\r\n\r\n const inputValue = (event.target as HTMLInputElement).value;\r\n\r\n // If input is empty, clear the current box\r\n if (inputValue === \"\") {\r\n updateValue(index, \"\", false);\r\n return;\r\n }\r\n\r\n // Extract the last character (handles paste or typing over selected text)\r\n const lastChar = inputValue.slice(-1);\r\n\r\n // Only allow digits - update the value at the current index\r\n if (/^\\d$/.test(lastChar)) {\r\n // Always auto-focus next when entering a digit (from any box position)\r\n // This allows continuous typing from any position to the end\r\n // Values remain filled as you type through them\r\n updateValue(index, lastChar, true);\r\n }\r\n // Non-digits are already prevented in keyDown handler, but if they somehow get through,\r\n // the controlled component will maintain the correct value via the value prop\r\n };\r\n\r\n // Update value at specific index\r\n const updateValue = (index: number, newValue: string, shouldAutoFocusNext: boolean = true) => {\r\n const newOtpValues = [...otpValues];\r\n newOtpValues[index] = newValue;\r\n\r\n // Mark this as an internal update to prevent useEffect from resetting positions\r\n isInternalUpdateRef.current = true;\r\n\r\n // Activate input session to preserve positions during typing\r\n inputSessionActiveRef.current = true;\r\n\r\n // Clear existing timeout\r\n if (inputSessionTimeoutRef.current) {\r\n clearTimeout(inputSessionTimeoutRef.current);\r\n }\r\n\r\n // Deactivate input session after 500ms of no input\r\n inputSessionTimeoutRef.current = setTimeout(() => {\r\n inputSessionActiveRef.current = false;\r\n }, 500);\r\n\r\n setOtpValues(newOtpValues);\r\n\r\n const otpString = newOtpValues.join(\"\");\r\n // Track the value we're sending to onChange\r\n lastSentValueRef.current = otpString;\r\n\r\n if (onChange) {\r\n onChange(otpString);\r\n }\r\n\r\n // Auto-focus next input if value is entered and we should auto-focus\r\n // Auto-focus regardless of whether it was replacing or not, to allow continuous typing\r\n // Use setTimeout to ensure focus happens after state update\r\n if (newValue && index < length - 1 && shouldAutoFocusNext) {\r\n setTimeout(() => {\r\n inputRefs.current[index + 1]?.focus();\r\n }, 0);\r\n }\r\n\r\n // Check if all boxes are filled\r\n if (newOtpValues.every((val) => val !== \"\")) {\r\n if (onComplete) {\r\n onComplete(otpString);\r\n }\r\n if (autoSubmit && onEnterPress) {\r\n onEnterPress(otpString);\r\n }\r\n }\r\n };\r\n\r\n // Handle key down\r\n const handleKeyDown = (index: number, event: React.KeyboardEvent<HTMLDivElement>) => {\r\n if (disabled) {\r\n return;\r\n }\r\n\r\n const { key } = event;\r\n\r\n // Handle backspace\r\n if (key === \"Backspace\") {\r\n if (otpValues[index] === \"\" && index > 0) {\r\n // Move to previous input and clear it\r\n inputRefs.current[index - 1]?.focus();\r\n updateValue(index - 1, \"\", false);\r\n } else {\r\n // Clear current input\r\n updateValue(index, \"\", false);\r\n }\r\n event.preventDefault();\r\n return;\r\n }\r\n\r\n // Handle delete\r\n if (key === \"Delete\") {\r\n updateValue(index, \"\", false);\r\n event.preventDefault();\r\n return;\r\n }\r\n\r\n // Handle arrow keys\r\n if (key === \"ArrowLeft\" && index > 0) {\r\n inputRefs.current[index - 1]?.focus();\r\n event.preventDefault();\r\n return;\r\n }\r\n if (key === \"ArrowRight\" && index < length - 1) {\r\n inputRefs.current[index + 1]?.focus();\r\n event.preventDefault();\r\n return;\r\n }\r\n\r\n // Handle Enter key\r\n if (key === \"Enter\" && onEnterPress) {\r\n const otpString = otpValues.join(\"\");\r\n onEnterPress(otpString);\r\n return;\r\n }\r\n\r\n // Handle paste\r\n if ((event.ctrlKey || event.metaKey) && key === \"v\") {\r\n // Let the paste event handle it\r\n return;\r\n }\r\n\r\n // Handle digit input - ensure it goes to the current box\r\n if (/^\\d$/.test(key)) {\r\n // The onChange handler will process this, but we ensure the value goes to current index\r\n // by allowing the default behavior which will trigger onChange\r\n return;\r\n }\r\n\r\n // Only allow digits and navigation keys\r\n if (![\"Tab\", \"Escape\", \"Home\", \"End\"].includes(key)) {\r\n event.preventDefault();\r\n }\r\n };\r\n\r\n // Handle paste\r\n const handlePaste = (index: number, event: React.ClipboardEvent<HTMLDivElement>) => {\r\n if (disabled) {\r\n return;\r\n }\r\n\r\n event.preventDefault();\r\n const pastedText = event.clipboardData.getData(\"text\");\r\n const digits = pastedText.replace(/\\D/g, \"\").slice(0, length);\r\n\r\n if (digits.length === 0) {\r\n return;\r\n }\r\n\r\n const newOtpValues = [...otpValues];\r\n const startIndex = index;\r\n\r\n // Fill from current index or from start\r\n for (let i = 0; i < digits.length && startIndex + i < length; i++) {\r\n newOtpValues[startIndex + i] = digits[i];\r\n }\r\n\r\n setOtpValues(newOtpValues);\r\n\r\n const otpString = newOtpValues.join(\"\");\r\n if (onChange) {\r\n onChange(otpString);\r\n }\r\n\r\n // Focus the next empty input or the last input\r\n const nextEmptyIndex = newOtpValues.findIndex((val) => val === \"\");\r\n const focusIndex = nextEmptyIndex !== -1 ? nextEmptyIndex : Math.min(startIndex + digits.length, length - 1);\r\n inputRefs.current[focusIndex]?.focus();\r\n\r\n // Check if all boxes are filled\r\n if (newOtpValues.every((val) => val !== \"\")) {\r\n if (onComplete) {\r\n onComplete(otpString);\r\n }\r\n if (autoSubmit && onEnterPress) {\r\n onEnterPress(otpString);\r\n }\r\n }\r\n };\r\n\r\n // Handle focus\r\n const handleFocus = (_index: number, event: FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => {\r\n // Select all text on focus\r\n (event.target as HTMLInputElement).select();\r\n if (onFocus) {\r\n onFocus(event as FocusEvent<HTMLInputElement>);\r\n }\r\n };\r\n\r\n // Handle blur\r\n const handleBlur = (_index: number, event: FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => {\r\n if (onBlur) {\r\n onBlur(event as FocusEvent<HTMLInputElement>);\r\n }\r\n };\r\n\r\n return (\r\n <FormControl error={!!error} disabled={disabled} required={required} fullWidth={fullWidth} sx={formControlStyles}>\r\n {label && (\r\n <Box component=\"label\" sx={{ mb: 1, display: \"block\" }}>\r\n {label}\r\n {required && <span style={{ color: \"error.main\" }}> *</span>}\r\n </Box>\r\n )}\r\n <Box\r\n ref={ref}\r\n sx={{\r\n display: \"flex\",\r\n gap: spacing,\r\n justifyContent: \"flex-start\",\r\n ...containerStyles\r\n }}\r\n >\r\n {otpValues.map((otpValue, index) => (\r\n <TextField\r\n key={index}\r\n inputRef={(el) => {\r\n inputRefs.current[index] = el;\r\n }}\r\n name={name ? `${name}-${index}` : undefined}\r\n value={otpValue}\r\n onChange={(e) => handleChange(index, e)}\r\n onKeyDown={(e) => handleKeyDown(index, e)}\r\n onPaste={(e) => handlePaste(index, e)}\r\n onFocus={(e) => handleFocus(index, e)}\r\n onBlur={(e) => handleBlur(index, e)}\r\n variant={variant}\r\n size={size}\r\n color={color}\r\n error={!!error}\r\n disabled={disabled}\r\n required={required}\r\n slotProps={{\r\n ...slotProps,\r\n input: {\r\n ...slotProps?.input,\r\n inputProps: {\r\n maxLength: 1,\r\n inputMode: \"numeric\",\r\n pattern: \"[0-9]*\",\r\n style: {\r\n textAlign: \"center\",\r\n fontSize: size === \"small\" ? \"1rem\" : \"1.25rem\",\r\n fontWeight: \"bold\"\r\n },\r\n ...((slotProps?.input as any)?.inputProps || {})\r\n }\r\n }\r\n }}\r\n slots={slots}\r\n sx={{\r\n width: size === \"small\" ? \"40px\" : \"48px\",\r\n ...inputStyles\r\n }}\r\n {...textFieldProps}\r\n />\r\n ))}\r\n </Box>\r\n {error && <FormHelperText>{helperText ?? (error?.message ? error.message : \"\")}</FormHelperText>}\r\n {!error && helperText && <FormHelperText>{helperText}</FormHelperText>}\r\n </FormControl>\r\n );\r\n }\r\n);\r\n\r\nOTPField.displayName = \"OTPField\";\r\n\r\nexport default OTPField;\r\n","\"use client\";\r\nimport Visibility from \"@mui/icons-material/Visibility\";\r\nimport VisibilityOff from \"@mui/icons-material/VisibilityOff\";\r\nimport {\r\n FormControl,\r\n FormHelperText,\r\n IconButton,\r\n type IconButtonProps,\r\n InputAdornment,\r\n TextField,\r\n type TextFieldProps\r\n} from \"@mui/material\";\r\nimport React, {\r\n type ChangeEvent,\r\n type FocusEvent,\r\n type ForwardedRef,\r\n forwardRef,\r\n memo,\r\n useCallback,\r\n useMemo,\r\n useState\r\n} from \"react\";\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n message?: string;\r\n} | null;\r\n\r\n/**\r\n * Password strength level\r\n */\r\nexport type PasswordStrength = \"weak\" | \"medium\" | \"strong\" | \"very-strong\";\r\n\r\n/**\r\n * Extended Password Field Props\r\n * Extends MUI TextFieldProps with custom password field props\r\n */\r\nexport interface IPasswordFieldProps extends Omit<\r\n TextFieldProps,\r\n \"value\" | \"onChange\" | \"name\" | \"type\" | \"error\" | \"inputRef\"\r\n> {\r\n /** Field name for form identification */\r\n name?: string;\r\n /** Label text for the password field */\r\n label?: string;\r\n /** Current password value */\r\n value: string;\r\n /** Error object with optional message */\r\n error?: FieldError;\r\n /** Helper text to display below field */\r\n helperText?: string;\r\n /** Whether the field is disabled */\r\n disabled?: boolean;\r\n /** Placeholder text */\r\n placeholder?: string;\r\n /** TextField variant */\r\n variant?: TextFieldProps[\"variant\"];\r\n /** TextField size */\r\n size?: TextFieldProps[\"size\"];\r\n /** TextField color */\r\n color?: TextFieldProps[\"color\"];\r\n /** Full width of the field */\r\n fullWidth?: boolean;\r\n /** Required field indicator */\r\n required?: boolean;\r\n /** Whether to show password strength indicator */\r\n showPasswordStrength?: boolean;\r\n /** Minimum password length */\r\n minLength?: number;\r\n /** Maximum password length */\r\n maxLength?: number;\r\n /** Whether to show password by default */\r\n defaultShowPassword?: boolean;\r\n /** Custom visibility toggle icon (when password is visible) */\r\n visibilityIcon?: React.ReactNode;\r\n /** Custom visibility off icon (when password is hidden) */\r\n visibilityOffIcon?: React.ReactNode;\r\n /** Custom icon button props */\r\n iconButtonProps?: IconButtonProps;\r\n /** Callback fired when the value changes */\r\n onChange?: (event: ChangeEvent<HTMLInputElement>) => void;\r\n /** Callback fired when field receives focus */\r\n onFocus?: (event: FocusEvent<HTMLInputElement>) => void;\r\n /** Callback fired when field loses focus */\r\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void;\r\n /** Callback fired when password visibility toggles */\r\n onVisibilityToggle?: (isVisible: boolean) => void;\r\n /** Custom function to calculate password strength */\r\n getPasswordStrength?: (password: string) => PasswordStrength;\r\n /** Custom styles for the TextField */\r\n inputStyles?: TextFieldProps[\"sx\"];\r\n /** Custom styles for FormControl */\r\n formControlStyles?: React.ComponentProps<typeof FormControl>[\"sx\"];\r\n /** Custom slot props for MUI v7 */\r\n slotProps?: TextFieldProps[\"slotProps\"];\r\n /** Custom slots for MUI v7 */\r\n slots?: TextFieldProps[\"slots\"];\r\n}\r\n\r\n/**\r\n * Calculate password strength\r\n */\r\nconst calculatePasswordStrength = (password: string): PasswordStrength => {\r\n if (!password) {\r\n return \"weak\";\r\n }\r\n\r\n let strength = 0;\r\n\r\n // Length check\r\n if (password.length >= 8) {\r\n strength++;\r\n }\r\n if (password.length >= 12) {\r\n strength++;\r\n }\r\n\r\n // Character variety checks\r\n if (/[a-z]/.test(password)) {\r\n strength++;\r\n }\r\n if (/[A-Z]/.test(password)) {\r\n strength++;\r\n }\r\n if (/[0-9]/.test(password)) {\r\n strength++;\r\n }\r\n if (/[^a-zA-Z0-9]/.test(password)) {\r\n strength++;\r\n }\r\n\r\n if (strength <= 2) {\r\n return \"weak\";\r\n }\r\n if (strength <= 4) {\r\n return \"medium\";\r\n }\r\n if (strength <= 5) {\r\n return \"strong\";\r\n }\r\n return \"very-strong\";\r\n};\r\n\r\n/**\r\n * Get password strength color\r\n */\r\nconst getPasswordStrengthColor = (strength: PasswordStrength): string => {\r\n switch (strength) {\r\n case \"weak\":\r\n return \"#f44336\"; // red\r\n case \"medium\":\r\n return \"#ff9800\"; // orange\r\n case \"strong\":\r\n return \"#4caf50\"; // green\r\n case \"very-strong\":\r\n return \"#2196f3\"; // blue\r\n default:\r\n return \"#9e9e9e\"; // grey\r\n }\r\n};\r\n\r\n/**\r\n * Password Field Component\r\n *\r\n * A specialized password input field built on top of Material UI TextField with visibility toggle.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a secure password input with support for: visibility toggling,\r\n * password strength indicator, error handling, helper text, and length validation.\r\n * It integrates seamlessly with form management libraries like React Hook Form through the use of `forwardRef`.\r\n *\r\n * @param {string} [name] - {string} Field name for form identification\r\n * @param {string} [label] - {string} Label text for the password field\r\n * @param {string} value - {string} Current password value (controlled component)\r\n * @param {FieldError} [error] - {FieldError} Error object with optional message\r\n * @param {string} [helperText] - {string} Helper text to display below field\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {string} [placeholder] - {string} Placeholder text\r\n * @param {TextFieldProps['variant']} [variant='outlined'] - {TextFieldProps['variant']} TextField variant\r\n * @param {TextFieldProps['size']} [size] - {TextFieldProps['size']} TextField size\r\n * @param {TextFieldProps['color']} [color] - {TextFieldProps['color']} TextField color\r\n * @param {boolean} [fullWidth=true] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {boolean} [showPasswordStrength=false] - {boolean} Whether to show password strength indicator\r\n * @param {number} [minLength] - {number} Minimum password length\r\n * @param {number} [maxLength] - {number} Maximum password length\r\n * @param {boolean} [defaultShowPassword=false] - {boolean} Whether to show password by default\r\n * @param {React.ReactNode} [visibilityIcon] - {React.ReactNode} Custom visibility icon\r\n * @param {React.ReactNode} [visibilityOffIcon] - {React.ReactNode} Custom visibility off icon\r\n * @param {IconButtonProps} [iconButtonProps] - {IconButtonProps} Custom icon button props\r\n * @param {Function} [onChange] - {Function} Callback fired when value changes\r\n * @param {Function} [onFocus] - {Function} Callback when field receives focus\r\n * @param {Function} [onBlur] - {Function} Callback when field loses focus\r\n * @param {Function} [onVisibilityToggle] - {Function} Callback when visibility toggles\r\n * @param {Function} [getPasswordStrength] - {Function} Custom strength calculation function\r\n * @param {TextFieldProps['sx']} [inputStyles] - {TextFieldProps['sx']} Custom styles for the TextField\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {Object} [slotProps] - {Object} Custom slot props for MUI v7\r\n * @param {Object} [slots] - {Object} Custom slots for MUI v7\r\n *\r\n * @returns {JSX.Element} The Password Field component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import PasswordField from \"@react-solutions/inputs\";\r\n * import { useState } from \"react\";\r\n *\r\n * function MyForm() {\r\n * const [pwd, setPwd] = useState(\"\");\r\n *\r\n * return (\r\n * <PasswordField\r\n * name=\"password\"\r\n * label=\"Password\"\r\n * value={pwd}\r\n * showPasswordStrength\r\n * onChange={(e) => setPwd(e.target.value)}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst PasswordField = memo(\r\n forwardRef<HTMLInputElement, IPasswordFieldProps>(\r\n (\r\n {\r\n name,\r\n label,\r\n value,\r\n onChange,\r\n onFocus,\r\n onBlur,\r\n onVisibilityToggle,\r\n error,\r\n helperText,\r\n disabled = false,\r\n placeholder,\r\n variant = \"outlined\",\r\n size,\r\n color,\r\n fullWidth = true,\r\n required,\r\n showPasswordStrength = false,\r\n minLength,\r\n maxLength,\r\n defaultShowPassword = false,\r\n visibilityIcon = <Visibility />,\r\n visibilityOffIcon = <VisibilityOff />,\r\n iconButtonProps,\r\n getPasswordStrength = calculatePasswordStrength,\r\n inputStyles,\r\n formControlStyles,\r\n slotProps,\r\n slots,\r\n ...textFieldProps\r\n },\r\n ref: ForwardedRef<HTMLInputElement>\r\n ) => {\r\n const [showPassword, setShowPassword] = useState<boolean>(defaultShowPassword);\r\n\r\n // Toggle password visibility\r\n const togglePasswordVisibility = useCallback(() => {\r\n setShowPassword((prev) => {\r\n const newVisibility = !prev;\r\n if (onVisibilityToggle) {\r\n onVisibilityToggle(newVisibility);\r\n }\r\n return newVisibility;\r\n });\r\n }, [onVisibilityToggle]);\r\n\r\n // Calculate password strength\r\n const passwordStrength = useMemo(\r\n () => (showPasswordStrength ? getPasswordStrength(value) : null),\r\n [showPasswordStrength, value]\r\n );\r\n\r\n // Get strength indicator\r\n const getStrengthIndicator = () => {\r\n if (!passwordStrength || !value) {\r\n return null;\r\n }\r\n\r\n const strengthColor = getPasswordStrengthColor(passwordStrength);\r\n const strengthText = passwordStrength.charAt(0).toUpperCase() + passwordStrength.slice(1).replace(\"-\", \" \");\r\n\r\n return (\r\n <div style={{ marginTop: \"4px\", fontSize: \"0.75rem\" }}>\r\n <span style={{ color: strengthColor, fontWeight: 500 }}>Strength: {strengthText}</span>\r\n </div>\r\n );\r\n };\r\n\r\n // Handle onChange with validation\r\n const handleChange = useCallback(\r\n (event: ChangeEvent<HTMLInputElement>) => {\r\n const newValue = event.target.value;\r\n\r\n // Check max length\r\n if (maxLength && newValue.length > maxLength) {\r\n return; // Don't update if exceeds max length\r\n }\r\n\r\n if (onChange) {\r\n onChange(event);\r\n }\r\n },\r\n [maxLength, onChange]\r\n );\r\n\r\n // Memoize end adornment\r\n const endAdornmentElement = useMemo(\r\n () => (\r\n <InputAdornment position=\"end\">\r\n <IconButton\r\n onClick={togglePasswordVisibility}\r\n onMouseDown={(e) => e.preventDefault()}\r\n edge=\"end\"\r\n disabled={disabled}\r\n {...iconButtonProps}\r\n >\r\n {showPassword ? visibilityOffIcon : visibilityIcon}\r\n </IconButton>\r\n </InputAdornment>\r\n ),\r\n [togglePasswordVisibility, disabled, iconButtonProps, showPassword, visibilityOffIcon, visibilityIcon]\r\n );\r\n\r\n // Memoize slot props\r\n const finalSlotProps = useMemo(\r\n () => ({\r\n ...slotProps,\r\n input: {\r\n ...slotProps?.input,\r\n ...(minLength || maxLength\r\n ? {\r\n inputProps: {\r\n minLength,\r\n maxLength,\r\n ...((slotProps?.input as any)?.inputProps || {}),\r\n ...((textFieldProps as any).inputProps || {})\r\n }\r\n }\r\n : {}),\r\n endAdornment: endAdornmentElement\r\n }\r\n }),\r\n [slotProps, minLength, maxLength, textFieldProps, endAdornmentElement]\r\n );\r\n\r\n // Memoize helper text\r\n const displayHelperText = useMemo(\r\n () => helperText ?? (error?.message ? error.message : undefined),\r\n [helperText, error?.message]\r\n );\r\n\r\n return (\r\n <FormControl\r\n fullWidth={fullWidth}\r\n error={!!error}\r\n disabled={disabled}\r\n required={required}\r\n sx={formControlStyles}\r\n >\r\n <TextField\r\n {...textFieldProps}\r\n name={name}\r\n label={label}\r\n type={showPassword ? \"text\" : \"password\"}\r\n value={value}\r\n onChange={handleChange}\r\n onFocus={onFocus}\r\n onBlur={onBlur}\r\n placeholder={placeholder}\r\n variant={variant}\r\n size={size}\r\n color={color}\r\n fullWidth={fullWidth}\r\n required={required}\r\n error={!!error}\r\n disabled={disabled}\r\n slotProps={finalSlotProps}\r\n slots={slots}\r\n sx={inputStyles}\r\n ref={ref}\r\n helperText={displayHelperText}\r\n />\r\n {showPasswordStrength && getStrengthIndicator()}\r\n {error && !helperText && error.message && <FormHelperText>{error.message}</FormHelperText>}\r\n {!error && helperText && <FormHelperText>{helperText}</FormHelperText>}\r\n </FormControl>\r\n );\r\n }\r\n )\r\n);\r\n\r\nPasswordField.displayName = \"PasswordField\";\r\n\r\nexport default PasswordField;\r\n","\"use client\";\r\nimport Close from \"@mui/icons-material/Close\";\r\nimport Search from \"@mui/icons-material/Search\";\r\nimport {\r\n FormControl,\r\n IconButton,\r\n type IconButtonProps,\r\n InputAdornment,\r\n TextField,\r\n type TextFieldProps\r\n} from \"@mui/material\";\r\nimport React, {\r\n type ChangeEvent,\r\n type FocusEvent,\r\n type ForwardedRef,\r\n forwardRef,\r\n memo,\r\n useCallback,\r\n useEffect,\r\n useMemo,\r\n useRef\r\n} from \"react\";\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n message?: string;\r\n} | null;\r\n\r\n/**\r\n * Extended Search Input Field Props\r\n * Extends MUI TextFieldProps with custom search field props\r\n */\r\nexport interface ISearchInputFieldProps extends Omit<\r\n TextFieldProps,\r\n \"value\" | \"onChange\" | \"name\" | \"type\" | \"error\" | \"inputRef\"\r\n> {\r\n /** Field name for form identification */\r\n name?: string;\r\n /** Label text for the search field */\r\n label?: string;\r\n /** Current search value */\r\n value: string;\r\n /** Error object with optional message */\r\n error?: FieldError;\r\n /** Helper text to display below field */\r\n helperText?: string;\r\n /** Whether the field is disabled */\r\n disabled?: boolean;\r\n /** Placeholder text */\r\n placeholder?: string;\r\n /** TextField variant */\r\n variant?: TextFieldProps[\"variant\"];\r\n /** TextField size */\r\n size?: TextFieldProps[\"size\"];\r\n /** TextField color */\r\n color?: TextFieldProps[\"color\"];\r\n /** Full width of the field */\r\n fullWidth?: boolean;\r\n /** Required field indicator */\r\n required?: boolean;\r\n /** Whether to show clear button */\r\n showClearButton?: boolean;\r\n /** Whether to show search button */\r\n showSearchButton?: boolean;\r\n /** Custom clear icon */\r\n clearIcon?: React.ReactNode;\r\n /** Custom search icon */\r\n searchIcon?: React.ReactNode;\r\n /** Custom icon button props for clear button */\r\n clearButtonProps?: IconButtonProps;\r\n /** Custom icon button props for search button */\r\n searchButtonProps?: IconButtonProps;\r\n /** Callback fired when the value changes */\r\n onChange?: (event: ChangeEvent<HTMLInputElement>) => void;\r\n /** Callback fired when field receives focus */\r\n onFocus?: (event: FocusEvent<HTMLInputElement>) => void;\r\n /** Callback fired when field loses focus */\r\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void;\r\n /** Callback fired when search button is clicked */\r\n onSearch?: (value: string) => void;\r\n /** Callback fired when clear button is clicked */\r\n onClear?: () => void;\r\n /** Callback fired on Enter key press */\r\n onEnterPress?: (value: string) => void;\r\n /** Enable debounce for search (default: true) */\r\n enableDebounce?: boolean;\r\n /** Debounce delay in milliseconds (default: 300) */\r\n debounceDelay?: number;\r\n /** Enable throttle for search (default: false) */\r\n enableThrottle?: boolean;\r\n /** Throttle delay in milliseconds (default: 300) */\r\n throttleDelay?: number;\r\n /** Custom styles for the TextField */\r\n inputStyles?: TextFieldProps[\"sx\"];\r\n /** Custom styles for FormControl */\r\n formControlStyles?: React.ComponentProps<typeof FormControl>[\"sx\"];\r\n /** Custom slot props for MUI v7 */\r\n slotProps?: TextFieldProps[\"slotProps\"];\r\n /** Custom slots for MUI v7 */\r\n slots?: TextFieldProps[\"slots\"];\r\n}\r\n\r\n/**\r\n * Search Input Field Component\r\n *\r\n * A specialized search input field built on top of Material UI TextField with search and clear functionality.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a robust search interface with support for: debounced/throttled search callbacks,\r\n * clear button, search button, Enter key handling, error handling, and helper text.\r\n * It integrates seamlessly with form management libraries like React Hook Form through the use of `forwardRef`.\r\n *\r\n * @param {string} [name] - {string} Field name for form identification\r\n * @param {string} [label] - {string} Label text for the search field\r\n * @param {string} value - {string} Current search value (controlled component)\r\n * @param {FieldError} [error] - {FieldError} Error object with optional message\r\n * @param {string} [helperText] - {string} Helper text to display below field\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {string} [placeholder] - {string} Placeholder text\r\n * @param {TextFieldProps['variant']} [variant='outlined'] - {TextFieldProps['variant']} TextField variant\r\n * @param {TextFieldProps['size']} [size] - {TextFieldProps['size']} TextField size\r\n * @param {TextFieldProps['color']} [color='primary'] - {TextFieldProps['color']} TextField color\r\n * @param {boolean} [fullWidth=true] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {boolean} [showClearButton=true] - {boolean} Whether to show clear button when input has value\r\n * @param {boolean} [showSearchButton=true] - {boolean} Whether to show search button icon\r\n * @param {React.ReactNode} [clearIcon] - {React.ReactNode} Custom clear icon\r\n * @param {React.ReactNode} [searchIcon] - {React.ReactNode} Custom search icon\r\n * @param {IconButtonProps} [clearButtonProps] - {IconButtonProps} Custom props for clear button\r\n * @param {IconButtonProps} [searchButtonProps] - {IconButtonProps} Custom props for search button\r\n * @param {Function} [onChange] - {Function} Callback fired when value changes\r\n * @param {Function} [onFocus] - {Function} Callback when field receives focus\r\n * @param {Function} [onBlur] - {Function} Callback when field loses focus\r\n * @param {(value: string) => void} [onSearch] - {(value: string) => void} Callback fired for search (can be debounced/throttled)\r\n * @param {Function} [onClear] - {Function} Callback fired when clear button is clicked\r\n * @param {Function} [onEnterPress] - {Function} Callback fired on Enter key press\r\n * @param {boolean} [enableDebounce=true] - {boolean} Enable debounce for search callback\r\n * @param {number} [debounceDelay=300] - {number} Debounce delay in milliseconds\r\n * @param {boolean} [enableThrottle=false] - {boolean} Enable throttle for search callback\r\n * @param {number} [throttleDelay=300] - {number} Throttle delay in milliseconds\r\n * @param {TextFieldProps['sx']} [inputStyles] - {TextFieldProps['sx']} Custom styles for the TextField\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {Object} [slotProps] - {Object} Custom slot props for MUI v7\r\n * @param {Object} [slots] - {Object} Custom slots for MUI v7\r\n *\r\n * @returns {JSX.Element} The Search Input Field component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import SearchField from \"@react-solutions/inputs\";\r\n * import { useState } from \"react\";\r\n *\r\n * function MyForm() {\r\n * const [search, setSearch] = useState(\"\");\r\n *\r\n * return (\r\n * <SearchField\r\n * name=\"userSearch\"\r\n * label=\"Search Users\"\r\n * value={search}\r\n * onSearch={(val) => console.log(\"Searching for:\", val)}\r\n * onChange={(e) => setSearch(e.target.value)}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst SearchField = memo(\r\n forwardRef<HTMLInputElement, ISearchInputFieldProps>(\r\n (\r\n {\r\n name,\r\n label,\r\n value,\r\n onChange,\r\n onFocus,\r\n onBlur,\r\n onSearch,\r\n onClear,\r\n onEnterPress,\r\n error,\r\n helperText,\r\n disabled = false,\r\n placeholder,\r\n variant = \"outlined\",\r\n size,\r\n color = \"primary\",\r\n fullWidth = true,\r\n required,\r\n showClearButton = true,\r\n showSearchButton = true,\r\n clearIcon,\r\n searchIcon,\r\n clearButtonProps,\r\n searchButtonProps,\r\n enableDebounce = true,\r\n debounceDelay = 300,\r\n enableThrottle = false,\r\n throttleDelay = 300,\r\n inputStyles,\r\n formControlStyles,\r\n slotProps,\r\n slots,\r\n ...textFieldProps\r\n },\r\n ref: ForwardedRef<HTMLInputElement>\r\n ) => {\r\n // Refs for debounce and throttle timers\r\n const debounceTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\r\n const throttleTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\r\n const lastThrottleCallRef = useRef<number>(0);\r\n\r\n // Cleanup timers on unmount\r\n useEffect(() => {\r\n return () => {\r\n if (debounceTimerRef.current) {\r\n clearTimeout(debounceTimerRef.current);\r\n }\r\n if (throttleTimerRef.current) {\r\n clearTimeout(throttleTimerRef.current);\r\n }\r\n };\r\n }, []);\r\n\r\n // Debounced search function\r\n const debouncedSearch = useCallback(\r\n (searchVal: string) => {\r\n if (debounceTimerRef.current) {\r\n clearTimeout(debounceTimerRef.current);\r\n }\r\n debounceTimerRef.current = setTimeout(() => {\r\n if (onSearch) {\r\n onSearch(searchVal);\r\n }\r\n }, debounceDelay);\r\n },\r\n [onSearch, debounceDelay]\r\n );\r\n\r\n // Throttled search function\r\n const throttledSearch = useCallback(\r\n (searchVal: string) => {\r\n const now = Date.now();\r\n const timeSinceLastCall = now - lastThrottleCallRef.current;\r\n\r\n if (timeSinceLastCall >= throttleDelay) {\r\n lastThrottleCallRef.current = now;\r\n if (onSearch) {\r\n onSearch(searchVal);\r\n }\r\n } else {\r\n if (throttleTimerRef.current) {\r\n clearTimeout(throttleTimerRef.current);\r\n }\r\n throttleTimerRef.current = setTimeout(() => {\r\n lastThrottleCallRef.current = Date.now();\r\n if (onSearch) {\r\n onSearch(searchVal);\r\n }\r\n }, throttleDelay - timeSinceLastCall);\r\n }\r\n },\r\n [onSearch, throttleDelay]\r\n );\r\n\r\n // Handle onChange with search callback (with debounce/throttle)\r\n const handleChange = useCallback(\r\n (event: ChangeEvent<HTMLInputElement>) => {\r\n const newValue = event.target.value;\r\n\r\n // Always call onChange immediately for controlled input\r\n if (onChange) {\r\n onChange(event);\r\n }\r\n\r\n // Apply debounce or throttle to onSearch if enabled\r\n if (onSearch) {\r\n if (enableDebounce && !enableThrottle) {\r\n debouncedSearch(newValue);\r\n } else if (enableThrottle && !enableDebounce) {\r\n throttledSearch(newValue);\r\n } else if (enableDebounce && enableThrottle) {\r\n // If both are enabled, debounce takes precedence\r\n debouncedSearch(newValue);\r\n } else {\r\n // No debounce or throttle, call immediately\r\n onSearch(newValue);\r\n }\r\n }\r\n },\r\n [onChange, onSearch, enableDebounce, enableThrottle, debouncedSearch, throttledSearch]\r\n );\r\n\r\n // Handle clear button click\r\n const handleClear = useCallback(() => {\r\n // Clear any pending timers\r\n if (debounceTimerRef.current) {\r\n clearTimeout(debounceTimerRef.current);\r\n debounceTimerRef.current = null;\r\n }\r\n if (throttleTimerRef.current) {\r\n clearTimeout(throttleTimerRef.current);\r\n throttleTimerRef.current = null;\r\n }\r\n\r\n if (onClear) {\r\n onClear();\r\n }\r\n if (onSearch) {\r\n // Clear immediately without debounce/throttle\r\n onSearch(\"\");\r\n }\r\n // Create a synthetic event to trigger onChange with empty value\r\n const syntheticEvent = {\r\n target: { value: \"\", name: name || \"\" },\r\n currentTarget: { value: \"\", name: name || \"\" }\r\n } as ChangeEvent<HTMLInputElement>;\r\n if (onChange) {\r\n onChange(syntheticEvent);\r\n }\r\n }, [onClear, onSearch, onChange, name, debounceTimerRef, throttleTimerRef]);\r\n\r\n // Handle search button click\r\n const handleSearch = useCallback(() => {\r\n // Clear any pending timers and search immediately\r\n if (debounceTimerRef.current) {\r\n clearTimeout(debounceTimerRef.current);\r\n debounceTimerRef.current = null;\r\n }\r\n if (throttleTimerRef.current) {\r\n clearTimeout(throttleTimerRef.current);\r\n throttleTimerRef.current = null;\r\n }\r\n\r\n if (onSearch) {\r\n // Search immediately without debounce/throttle when button is clicked\r\n onSearch(value);\r\n }\r\n }, [onSearch, value, debounceTimerRef, throttleTimerRef]);\r\n\r\n // Handle Enter key press\r\n const handleKeyDown = useCallback(\r\n (event: React.KeyboardEvent<HTMLInputElement>) => {\r\n if (event.key === \"Enter\") {\r\n // Clear any pending timers when Enter is pressed\r\n if (debounceTimerRef.current) {\r\n clearTimeout(debounceTimerRef.current);\r\n debounceTimerRef.current = null;\r\n }\r\n if (throttleTimerRef.current) {\r\n clearTimeout(throttleTimerRef.current);\r\n throttleTimerRef.current = null;\r\n }\r\n\r\n if (onEnterPress) {\r\n onEnterPress(value);\r\n }\r\n // Also trigger search immediately on Enter\r\n if (onSearch) {\r\n onSearch(value);\r\n }\r\n }\r\n // Call original onKeyDown if provided\r\n if (textFieldProps.onKeyDown) {\r\n textFieldProps.onKeyDown(event);\r\n }\r\n },\r\n [onEnterPress, onSearch, value, debounceTimerRef, throttleTimerRef, textFieldProps.onKeyDown]\r\n );\r\n\r\n // Build end adornment with clear and search buttons\r\n const endAdornment = useMemo(\r\n () => (\r\n <InputAdornment position=\"end\">\r\n {showClearButton && value && (\r\n <IconButton onClick={handleClear} disabled={disabled} edge=\"end\" size={size} {...clearButtonProps}>\r\n {clearIcon || <Close />}\r\n </IconButton>\r\n )}\r\n {showSearchButton && (\r\n <IconButton onClick={handleSearch} disabled={disabled} edge=\"end\" size={size} {...searchButtonProps}>\r\n {searchIcon || <Search />}\r\n </IconButton>\r\n )}\r\n </InputAdornment>\r\n ),\r\n [\r\n showClearButton,\r\n value,\r\n handleClear,\r\n disabled,\r\n size,\r\n clearButtonProps,\r\n clearIcon,\r\n showSearchButton,\r\n handleSearch,\r\n searchButtonProps,\r\n searchIcon\r\n ]\r\n );\r\n\r\n // Memoize helper text\r\n const displayHelperText = useMemo(\r\n () => helperText ?? (error?.message ? error.message : undefined),\r\n [helperText, error?.message]\r\n );\r\n\r\n return (\r\n <FormControl\r\n error={!!error}\r\n disabled={disabled}\r\n required={required}\r\n fullWidth={fullWidth}\r\n sx={formControlStyles}\r\n >\r\n <TextField\r\n {...textFieldProps}\r\n name={name}\r\n label={label}\r\n value={value}\r\n onChange={handleChange}\r\n onFocus={onFocus}\r\n onBlur={onBlur}\r\n onKeyDown={handleKeyDown}\r\n placeholder={placeholder}\r\n variant={variant}\r\n size={size}\r\n color={color}\r\n fullWidth={fullWidth}\r\n required={required}\r\n error={!!error}\r\n disabled={disabled}\r\n slotProps={{\r\n ...slotProps,\r\n input: {\r\n ...slotProps?.input,\r\n endAdornment\r\n }\r\n }}\r\n slots={slots}\r\n sx={inputStyles}\r\n ref={ref}\r\n helperText={displayHelperText}\r\n />\r\n </FormControl>\r\n );\r\n }\r\n )\r\n);\r\n\r\nSearchField.displayName = \"SearchField\";\r\n\r\nexport default SearchField;\r\n","\"use client\";\r\nimport { FormControl, type FormControlProps, InputAdornment, TextField, type TextFieldProps } from \"@mui/material\";\r\nimport React, {\r\n type ChangeEvent,\r\n type FocusEvent,\r\n type ForwardedRef,\r\n forwardRef,\r\n memo,\r\n useCallback,\r\n useEffect,\r\n useMemo,\r\n useRef,\r\n useState\r\n} from \"react\";\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n message?: string;\r\n} | null;\r\n\r\n/**\r\n * Extract only digits from a string\r\n */\r\nconst extractDigits = (value: string): string => {\r\n return value.replace(/\\D/g, \"\");\r\n};\r\n\r\n/**\r\n * Format phone number according to pattern\r\n * Example: pattern \"XXX-XXXX\" with digits \"1234567\" -> \"123-4567\"\r\n */\r\nconst formatByPattern = (digits: string, pattern: string): string => {\r\n if (!pattern || !digits) {\r\n return digits;\r\n }\r\n let formatted = \"\";\r\n let digitIndex = 0;\r\n for (let i = 0; i < pattern.length && digitIndex < digits.length; i++) {\r\n if (pattern[i] === \"X\") {\r\n formatted += digits[digitIndex];\r\n digitIndex++;\r\n } else {\r\n formatted += pattern[i];\r\n }\r\n }\r\n return formatted;\r\n};\r\n\r\n/**\r\n * Generate placeholder from pattern\r\n */\r\nconst generatePlaceholder = (pattern: string): string => {\r\n if (!pattern) {\r\n return \"0000000000\";\r\n }\r\n return pattern.replace(/X/g, \"0\");\r\n};\r\n\r\n/**\r\n * Extended Tel Input Field Props\r\n * Extends MUI TextFieldProps with custom tel field props\r\n */\r\nexport interface ITelInputFieldProps extends Omit<\r\n TextFieldProps,\r\n \"value\" | \"onChange\" | \"name\" | \"type\" | \"error\" | \"inputRef\"\r\n> {\r\n /** Field name for form identification */\r\n name?: string;\r\n /** Label text for the tel field */\r\n label?: string;\r\n /** Current tel value (digits only, formatting is handled internally) */\r\n value: string;\r\n /** Error object with optional message */\r\n error?: FieldError;\r\n /** Helper text to display below field */\r\n helperText?: string;\r\n /** Whether the field is disabled */\r\n disabled?: boolean;\r\n /** Placeholder text (auto-generated from pattern if not provided) */\r\n placeholder?: string;\r\n /** TextField variant */\r\n variant?: TextFieldProps[\"variant\"];\r\n /** TextField size */\r\n size?: TextFieldProps[\"size\"];\r\n /** TextField color */\r\n color?: TextFieldProps[\"color\"];\r\n /** Full width of the field */\r\n fullWidth?: boolean;\r\n /** Required field indicator */\r\n required?: boolean;\r\n /** Pattern string (e.g., \"XXX-XXXX\" where X represents digits) */\r\n pattern?: string;\r\n /** Maximum length (defaults to pattern length if pattern provided) */\r\n maxLength?: number;\r\n /** Country code to display */\r\n countryCode?: string;\r\n /** Whether to show country code */\r\n showCountryCode?: boolean;\r\n /** Start adornment (icon or element before input) */\r\n startAdornment?: React.ReactNode;\r\n /** End adornment (icon or element after input) */\r\n endAdornment?: React.ReactNode;\r\n /** Callback fired when the value changes (returns digits only) */\r\n onChange?: (event: ChangeEvent<HTMLInputElement>) => void;\r\n /** Callback fired when field receives focus */\r\n onFocus?: (event: FocusEvent<HTMLInputElement>) => void;\r\n /** Callback fired when field loses focus */\r\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void;\r\n /** Callback fired on Enter key press */\r\n onEnterPress?: (value: string) => void;\r\n /** Custom styles for the TextField */\r\n inputStyles?: TextFieldProps[\"sx\"];\r\n /** Custom styles for FormControl */\r\n formControlStyles?: FormControlProps[\"sx\"];\r\n /** Custom styles for country code display */\r\n countryCodeStyles?: React.CSSProperties;\r\n /** Custom slot props for MUI v7 */\r\n slotProps?: TextFieldProps[\"slotProps\"];\r\n /** Custom slots for MUI v7 */\r\n slots?: TextFieldProps[\"slots\"];\r\n}\r\n\r\n/**\r\n * Telephone Input Field Component\r\n *\r\n * A specialized telephone number input field built on top of Material UI TextField with pattern formatting.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a telephone input with support for: automatic pattern-based formatting,\r\n * country code prefix, digits-only value management, error handling, helper text, and standard text field behaviors.\r\n * It integrates seamlessly with form management libraries like React Hook Form through the use of `forwardRef`.\r\n *\r\n * @param {string} [name] - {string} Field name for form identification\r\n * @param {string} [label] - {string} Label text for the tel field\r\n * @param {string} value - {string} Current tel value (digits only, controlled component)\r\n * @param {FieldError} [error] - {FieldError} Error object with optional message\r\n * @param {string} [helperText] - {string} Helper text to display below field\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {string} [placeholder] - {string} Placeholder text (auto-generated from pattern if not provided)\r\n * @param {TextFieldProps['variant']} [variant='outlined'] - {TextFieldProps['variant']} TextField variant\r\n * @param {TextFieldProps['size']} [size] - {TextFieldProps['size']} TextField size\r\n * @param {TextFieldProps['color']} [color='primary'] - {TextFieldProps['color']} TextField color\r\n * @param {boolean} [fullWidth=true] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {string} [pattern='XXXXXXXXXX'] - {string} Pattern string (e.g., 'XXX-XXXX' where X represents digits)\r\n * @param {number} [maxLength] - {number} Maximum digits allowed\r\n * @param {string} [countryCode='+1'] - {string} Country code prefix text\r\n * @param {boolean} [showCountryCode=false] - {boolean} Whether to show country code as start adornment\r\n * @param {React.ReactNode} [startAdornment] - {React.ReactNode} Adornment before input\r\n * @param {React.ReactNode} [endAdornment] - {React.ReactNode} Adornment after input\r\n * @param {Function} [onChange] - {Function} Callback fired when value changes (returns digits only)\r\n * @param {Function} [onFocus] - {Function} Callback when field receives focus\r\n * @param {Function} [onBlur] - {Function} Callback when field loses focus\r\n * @param {Function} [onEnterPress] - {Function} Callback fired on Enter key press\r\n * @param {TextFieldProps['sx']} [inputStyles] - {TextFieldProps['sx']} Custom styles for the TextField\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {React.CSSProperties} [countryCodeStyles] - {React.CSSProperties} Custom styles for country code display\r\n * @param {Object} [slotProps] - {Object} Custom slot props for MUI v7\r\n * @param {Object} [slots] - {Object} Custom slots for MUI v7\r\n *\r\n * @returns {JSX.Element} The Telephone Input Field component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import TeliField from \"@react-solutions/inputs\";\r\n * import { useState } from \"react\";\r\n *\r\n * function MyForm() {\r\n * const [phone, setPhone] = useState(\"\");\r\n *\r\n * return (\r\n * <TeliField\r\n * name=\"mobile\"\r\n * label=\"Mobile Number\"\r\n * value={phone}\r\n * pattern=\"XXX-XXX-XXXX\"\r\n * showCountryCode\r\n * countryCode=\"+91\"\r\n * onChange={(e) => setPhone(e.target.value)}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst TeliField = memo(\r\n forwardRef<HTMLDivElement, ITelInputFieldProps>(\r\n (\r\n {\r\n name,\r\n label,\r\n value,\r\n onChange,\r\n onFocus,\r\n onBlur,\r\n onEnterPress,\r\n error,\r\n helperText,\r\n disabled = false,\r\n placeholder,\r\n variant = \"outlined\",\r\n size,\r\n color = \"primary\",\r\n fullWidth = true,\r\n required,\r\n pattern = \"XXXXXXXXXX\",\r\n maxLength,\r\n countryCode = \"+1\",\r\n showCountryCode = false,\r\n startAdornment,\r\n endAdornment,\r\n inputStyles,\r\n formControlStyles,\r\n countryCodeStyles,\r\n slotProps,\r\n slots,\r\n ...textFieldProps\r\n },\r\n ref: ForwardedRef<HTMLDivElement>\r\n ) => {\r\n const [displayValue, setDisplayValue] = useState<string>(\"\");\r\n const inputRef = useRef<HTMLInputElement>(null);\r\n\r\n // Calculate max length from pattern if not provided\r\n const calculatedMaxLength = maxLength || (pattern ? pattern.length : 15);\r\n\r\n // Update display value when value prop changes\r\n useEffect(() => {\r\n const digits = extractDigits(value);\r\n const formatted = pattern ? formatByPattern(digits, pattern) : digits;\r\n setDisplayValue((prev) => {\r\n if (prev !== formatted) {\r\n return formatted;\r\n }\r\n return prev;\r\n });\r\n\r\n // Set cursor position to end when value changes externally\r\n if (inputRef.current) {\r\n setTimeout(() => {\r\n if (inputRef.current) {\r\n const cursorPosition = formatted.length;\r\n inputRef.current.setSelectionRange(cursorPosition, cursorPosition);\r\n }\r\n }, 0);\r\n }\r\n }, [value, pattern]);\r\n\r\n // Handle input change\r\n const handleChange = useCallback(\r\n (event: ChangeEvent<HTMLInputElement>) => {\r\n if (disabled) {\r\n return;\r\n }\r\n\r\n const inputValue = event.target.value;\r\n const digits = extractDigits(inputValue);\r\n\r\n // Enforce maxLength\r\n const limitedDigits = calculatedMaxLength ? digits.slice(0, calculatedMaxLength) : digits;\r\n\r\n // Format the value\r\n const formattedValue = pattern ? formatByPattern(limitedDigits, pattern) : limitedDigits;\r\n\r\n setDisplayValue(formattedValue);\r\n\r\n // Create synthetic event with digits only\r\n const syntheticEvent = {\r\n ...event,\r\n target: {\r\n ...event.target,\r\n value: limitedDigits\r\n },\r\n currentTarget: {\r\n ...event.currentTarget,\r\n value: limitedDigits\r\n }\r\n } as ChangeEvent<HTMLInputElement>;\r\n\r\n if (onChange) {\r\n onChange(syntheticEvent);\r\n }\r\n },\r\n [disabled, calculatedMaxLength, pattern, onChange]\r\n );\r\n\r\n // Handle paste event\r\n const handlePaste = useCallback(\r\n (event: React.ClipboardEvent<HTMLInputElement>) => {\r\n if (disabled) {\r\n return;\r\n }\r\n event.preventDefault();\r\n const pastedText = event.clipboardData.getData(\"text\");\r\n const digits = extractDigits(pastedText);\r\n const limitedDigits = calculatedMaxLength ? digits.slice(0, calculatedMaxLength) : digits;\r\n\r\n const formattedValue = pattern ? formatByPattern(limitedDigits, pattern) : limitedDigits;\r\n\r\n setDisplayValue(formattedValue);\r\n\r\n // Create synthetic event\r\n const syntheticEvent = {\r\n ...event,\r\n target: {\r\n ...event.target,\r\n value: limitedDigits\r\n },\r\n currentTarget: {\r\n ...event.currentTarget,\r\n value: limitedDigits\r\n }\r\n } as unknown as ChangeEvent<HTMLInputElement>;\r\n\r\n if (onChange) {\r\n onChange(syntheticEvent);\r\n }\r\n },\r\n [disabled, calculatedMaxLength, pattern, onChange]\r\n );\r\n\r\n // Handle key down to prevent non-numeric input\r\n const handleKeyDown = useCallback(\r\n (event: React.KeyboardEvent<HTMLDivElement>) => {\r\n if (disabled) {\r\n return;\r\n }\r\n\r\n const { key } = event;\r\n const isNumber = /[0-9]/.test(key);\r\n const isAllowedKey =\r\n key === \"Backspace\" ||\r\n key === \"Delete\" ||\r\n key === \"Tab\" ||\r\n key === \"Escape\" ||\r\n key === \"Enter\" ||\r\n key === \"ArrowLeft\" ||\r\n key === \"ArrowRight\" ||\r\n key === \"ArrowUp\" ||\r\n key === \"ArrowDown\" ||\r\n key === \"Home\" ||\r\n key === \"End\" ||\r\n ((event.ctrlKey || event.metaKey) && (key === \"a\" || key === \"c\" || key === \"v\" || key === \"x\"));\r\n\r\n if (!isNumber && !isAllowedKey) {\r\n event.preventDefault();\r\n return;\r\n }\r\n\r\n if (key === \"Enter\" && onEnterPress) {\r\n onEnterPress(extractDigits(displayValue));\r\n }\r\n\r\n if (textFieldProps.onKeyDown) {\r\n textFieldProps.onKeyDown(event);\r\n }\r\n },\r\n [disabled, onEnterPress, displayValue, textFieldProps.onKeyDown]\r\n );\r\n\r\n // Build input props\r\n const inputProps = useMemo(\r\n () => ({\r\n maxLength: calculatedMaxLength,\r\n inputMode: \"tel\",\r\n autoComplete: \"tel\",\r\n ...((textFieldProps as any).inputProps || {})\r\n }),\r\n [calculatedMaxLength, textFieldProps]\r\n );\r\n\r\n // Build start adornment with country code if needed\r\n const finalStartAdornment = useMemo(\r\n () =>\r\n showCountryCode ? (\r\n <InputAdornment position=\"start\" sx={countryCodeStyles}>\r\n {countryCode}\r\n </InputAdornment>\r\n ) : startAdornment ? (\r\n <InputAdornment position=\"start\">{startAdornment}</InputAdornment>\r\n ) : undefined,\r\n [showCountryCode, countryCodeStyles, countryCode, startAdornment]\r\n );\r\n\r\n // Memoize end adornment\r\n const endAdornmentElement = useMemo(\r\n () => (endAdornment ? <InputAdornment position=\"end\">{endAdornment}</InputAdornment> : undefined),\r\n [endAdornment]\r\n );\r\n\r\n // Build slotProps for MUI v7\r\n const finalSlotProps = useMemo(\r\n () => ({\r\n ...slotProps,\r\n input: {\r\n ...slotProps?.input,\r\n inputProps,\r\n ...(finalStartAdornment && {\r\n startAdornment: finalStartAdornment\r\n }),\r\n ...(endAdornmentElement && {\r\n endAdornment: endAdornmentElement\r\n })\r\n }\r\n }),\r\n [slotProps, inputProps, finalStartAdornment, endAdornmentElement]\r\n );\r\n\r\n // Generate placeholder from pattern if not provided\r\n const displayPlaceholder = useMemo(\r\n () => placeholder || (pattern ? generatePlaceholder(pattern) : \"\"),\r\n [placeholder, pattern]\r\n );\r\n\r\n // Memoize helper text\r\n const displayHelperText = useMemo(\r\n () => helperText ?? (error?.message ? error.message : undefined),\r\n [helperText, error?.message]\r\n );\r\n\r\n return (\r\n <FormControl\r\n error={!!error}\r\n disabled={disabled}\r\n required={required}\r\n fullWidth={fullWidth}\r\n sx={formControlStyles}\r\n >\r\n <TextField\r\n {...textFieldProps}\r\n name={name}\r\n label={label}\r\n value={displayValue}\r\n onChange={handleChange}\r\n onFocus={onFocus}\r\n onBlur={onBlur}\r\n onKeyDown={handleKeyDown}\r\n onPaste={handlePaste}\r\n placeholder={displayPlaceholder}\r\n variant={variant}\r\n size={size}\r\n color={color}\r\n fullWidth={fullWidth}\r\n required={required}\r\n error={!!error}\r\n disabled={disabled}\r\n type=\"tel\"\r\n autoComplete=\"tel\"\r\n slotProps={finalSlotProps}\r\n slots={slots}\r\n sx={inputStyles}\r\n ref={ref}\r\n inputRef={inputRef}\r\n helperText={displayHelperText}\r\n />\r\n </FormControl>\r\n );\r\n }\r\n )\r\n);\r\n\r\nTeliField.displayName = \"TeliField\";\r\n\r\nexport default TeliField;\r\n","\"use client\";\r\nimport { FormControl, InputAdornment, TextField, type TextFieldProps } from \"@mui/material\";\r\nimport React, {\r\n type ChangeEvent,\r\n type FocusEvent,\r\n type ForwardedRef,\r\n forwardRef,\r\n memo,\r\n useCallback,\r\n useMemo\r\n} from \"react\";\r\n\r\n/**\r\n * Error object type\r\n */\r\nexport type FieldError = {\r\n message?: string;\r\n} | null;\r\n\r\n/**\r\n * Resize options for textarea\r\n */\r\nexport type ResizeOption = \"none\" | \"both\" | \"horizontal\" | \"vertical\";\r\n\r\n/**\r\n * Text transformation options\r\n */\r\nexport type TextTransformOption = \"uppercase\" | \"lowercase\" | \"capitalize\";\r\n\r\n/**\r\n * Extended Text Input Field Props\r\n * Extends MUI TextFieldProps with custom text field props\r\n */\r\nexport interface ITextInputFieldProps extends Omit<\r\n TextFieldProps,\r\n \"value\" | \"onChange\" | \"name\" | \"type\" | \"error\" | \"inputRef\" | \"multiline\"\r\n> {\r\n /** Field name for form identification */\r\n name?: string;\r\n /** Label text for the text field */\r\n label?: string;\r\n /** Current text value */\r\n value: string;\r\n /** Error object with optional message */\r\n error?: FieldError;\r\n /** Helper text to display below field */\r\n helperText?: string;\r\n /** Whether the field is disabled */\r\n disabled?: boolean;\r\n /** Placeholder text */\r\n placeholder?: string;\r\n /** TextField variant */\r\n variant?: TextFieldProps[\"variant\"];\r\n /** TextField size */\r\n size?: TextFieldProps[\"size\"];\r\n /** TextField color */\r\n color?: TextFieldProps[\"color\"];\r\n /** Full width of the field */\r\n fullWidth?: boolean;\r\n /** Required field indicator */\r\n required?: boolean;\r\n /** Whether to enable multiline input (textarea) */\r\n multiline?: boolean;\r\n /** Number of rows for multiline input */\r\n rows?: number;\r\n /** Minimum number of rows for multiline input */\r\n minRows?: number;\r\n /** Maximum number of rows for multiline input */\r\n maxRows?: number;\r\n /** Resize option for textarea (none, both, horizontal, vertical) */\r\n resize?: ResizeOption;\r\n /** Maximum length of input */\r\n maxLength?: number;\r\n /** Minimum length of input */\r\n minLength?: number;\r\n /** Input type (text, email, number, tel, url, etc.) */\r\n type?: string;\r\n /** Auto complete attribute */\r\n autoComplete?: string;\r\n /** Start adornment (icon or element before input) */\r\n startAdornment?: React.ReactNode;\r\n /** End adornment (icon or element after input) */\r\n endAdornment?: React.ReactNode;\r\n /** Callback fired when the value changes */\r\n onChange?: (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;\r\n /** Callback fired when field receives focus */\r\n onFocus?: (event: FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;\r\n /** Callback fired when field loses focus */\r\n onBlur?: (event: FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;\r\n /** Callback fired on Enter key press */\r\n onEnterPress?: (value: string) => void;\r\n /** Custom styles for the TextField */\r\n inputStyles?: TextFieldProps[\"sx\"];\r\n /** Custom styles for FormControl */\r\n formControlStyles?: React.ComponentProps<typeof FormControl>[\"sx\"];\r\n /** Custom slot props for MUI v7 */\r\n slotProps?: TextFieldProps[\"slotProps\"];\r\n /** Custom slots for MUI v7 */\r\n slots?: TextFieldProps[\"slots\"];\r\n /** Text transformation option */\r\n textTransform?: TextTransformOption;\r\n}\r\n\r\n/**\r\n * Text Input Field Component\r\n *\r\n * A versatile text input field built on top of Material UI TextField with support for various text types and transformations.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a flexible text input with support for: single-line and multiline (textarea),\r\n * text transformations (uppercase, lowercase, capitalize), error handling, helper text, custom adornments,\r\n * and standard text field behaviors. It integrates seamlessly with form management libraries like React Hook Form\r\n * through the use of `forwardRef`.\r\n *\r\n * @param {string} [name] - {string} Field name for form identification\r\n * @param {string} [label] - {string} Label text for the text field\r\n * @param {string} value - {string} Current text value (controlled component)\r\n * @param {FieldError} [error] - {FieldError} Error object with optional message\r\n * @param {string} [helperText] - {string} Helper text to display below field\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {string} [placeholder] - {string} Placeholder text\r\n * @param {TextFieldProps['variant']} [variant='outlined'] - {TextFieldProps['variant']} TextField variant\r\n * @param {TextFieldProps['size']} [size] - {TextFieldProps['size']} TextField size\r\n * @param {TextFieldProps['color']} [color='primary'] - {TextFieldProps['color']} TextField color\r\n * @param {boolean} [fullWidth=true] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {boolean} [multiline=false] - {boolean} Whether to enable multiline input (textarea)\r\n * @param {number} [rows] - {number} Number of rows for multiline input\r\n * @param {number} [minRows] - {number} Minimum number of rows for multiline input\r\n * @param {number} [maxRows] - {number} Maximum number of rows for multiline input\r\n * @param {ResizeOption} [resize='both'] - {ResizeOption} Resize option for textarea\r\n * @param {number} [maxLength] - {number} Maximum length of input\r\n * @param {number} [minLength] - {number} Minimum length of input\r\n * @param {string} [type='text'] - {string} Input type (text, email, url, etc.)\r\n * @param {string} [autoComplete='off'] - {string} Auto complete attribute\r\n * @param {React.ReactNode} [startAdornment] - {React.ReactNode} Adornment before input\r\n * @param {React.ReactNode} [endAdornment] - {React.ReactNode} Adornment after input\r\n * @param {Function} [onChange] - {Function} Callback fired when value changes\r\n * @param {Function} [onFocus] - {Function} Callback when field receives focus\r\n * @param {Function} [onBlur] - {Function} Callback when field loses focus\r\n * @param {Function} [onEnterPress] - {Function} Callback fired on Enter key press\r\n * @param {TextFieldProps['sx']} [inputStyles] - {TextFieldProps['sx']} Custom styles for the TextField\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {Object} [slotProps] - {Object} Custom slot props for MUI v7\r\n * @param {Object} [slots] - {Object} Custom slots for MUI v7\r\n * @param {TextTransformOption} [textTransform] - {TextTransformOption} Text transformation option\r\n *\r\n * @returns {JSX.Element} The Text Input Field component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import TextInputField from \"@react-solutions/inputs\";\r\n * import { useState } from \"react\";\r\n *\r\n * function MyForm() {\r\n * const [name, setName] = useState(\"\");\r\n *\r\n * return (\r\n * <TextInputField\r\n * name=\"fullName\"\r\n * label=\"Full Name\"\r\n * value={name}\r\n * textTransform=\"capitalize\"\r\n * onChange={(e) => setName(e.target.value)}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst TextInputField = memo(\r\n forwardRef<HTMLDivElement, ITextInputFieldProps>(\r\n (\r\n {\r\n name,\r\n label,\r\n value,\r\n onChange,\r\n onFocus,\r\n onBlur,\r\n onEnterPress,\r\n error,\r\n helperText,\r\n disabled = false,\r\n placeholder,\r\n variant = \"outlined\",\r\n size,\r\n color = \"primary\",\r\n fullWidth = true,\r\n required,\r\n multiline = false,\r\n rows,\r\n minRows,\r\n maxRows,\r\n resize = \"both\",\r\n maxLength,\r\n minLength,\r\n type = \"text\",\r\n autoComplete = \"off\",\r\n startAdornment,\r\n endAdornment,\r\n inputStyles,\r\n formControlStyles,\r\n slotProps,\r\n slots,\r\n textTransform,\r\n ...textFieldProps\r\n },\r\n ref: ForwardedRef<HTMLDivElement>\r\n ) => {\r\n // Handle Enter key press\r\n const handleKeyDown = useCallback(\r\n (event: React.KeyboardEvent<HTMLDivElement>) => {\r\n if (event.key === \"Enter\" && !multiline && onEnterPress) {\r\n onEnterPress(value);\r\n }\r\n // Call original onKeyDown if provided\r\n if (textFieldProps.onKeyDown) {\r\n textFieldProps.onKeyDown(event);\r\n }\r\n },\r\n [multiline, onEnterPress, value, textFieldProps.onKeyDown]\r\n );\r\n\r\n // Handle text change with transformation\r\n const handleChange = useCallback(\r\n (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\r\n if (onChange) {\r\n if (textTransform) {\r\n const { value } = event.target;\r\n let transformedValue = value;\r\n\r\n switch (textTransform) {\r\n case \"uppercase\":\r\n transformedValue = value.toUpperCase();\r\n break;\r\n case \"lowercase\":\r\n transformedValue = value.toLowerCase();\r\n break;\r\n case \"capitalize\":\r\n transformedValue = value.replace(/\\b\\w/g, (char) => char.toUpperCase());\r\n break;\r\n }\r\n\r\n event.target.value = transformedValue;\r\n onChange(event);\r\n } else {\r\n onChange(event);\r\n }\r\n }\r\n },\r\n [onChange, textTransform]\r\n );\r\n\r\n // Build input props\r\n const inputProps = useMemo(\r\n () => ({\r\n maxLength,\r\n minLength,\r\n ...((textFieldProps as any).inputProps || {})\r\n }),\r\n [maxLength, minLength, textFieldProps]\r\n );\r\n\r\n // Memoize adornments\r\n const startAdornmentElement = useMemo(\r\n () => (startAdornment ? <InputAdornment position=\"start\">{startAdornment}</InputAdornment> : undefined),\r\n [startAdornment]\r\n );\r\n\r\n const endAdornmentElement = useMemo(\r\n () => (endAdornment ? <InputAdornment position=\"end\">{endAdornment}</InputAdornment> : undefined),\r\n [endAdornment]\r\n );\r\n\r\n // Build slotProps for MUI v7\r\n const finalSlotProps = useMemo(\r\n () => ({\r\n ...slotProps,\r\n input: {\r\n ...slotProps?.input,\r\n inputProps,\r\n ...(startAdornmentElement && {\r\n startAdornment: startAdornmentElement\r\n }),\r\n ...(endAdornmentElement && {\r\n endAdornment: endAdornmentElement\r\n })\r\n }\r\n }),\r\n [slotProps, inputProps, startAdornmentElement, endAdornmentElement]\r\n );\r\n\r\n // Build sx styles with resize for textarea\r\n const finalInputStyles = useMemo(\r\n () =>\r\n multiline\r\n ? {\r\n ...inputStyles,\r\n \"& textarea\": {\r\n resize\r\n }\r\n }\r\n : inputStyles,\r\n [multiline, inputStyles, resize]\r\n );\r\n\r\n // Memoize helper text\r\n const displayHelperText = useMemo(\r\n () => helperText ?? (error?.message ? error.message : undefined),\r\n [helperText, error?.message]\r\n );\r\n\r\n return (\r\n <FormControl\r\n error={!!error}\r\n disabled={disabled}\r\n required={required}\r\n fullWidth={fullWidth}\r\n sx={formControlStyles}\r\n >\r\n <TextField\r\n {...textFieldProps}\r\n name={name}\r\n label={label}\r\n value={value}\r\n onChange={handleChange}\r\n onFocus={onFocus}\r\n onBlur={onBlur}\r\n onKeyDown={handleKeyDown}\r\n placeholder={placeholder}\r\n variant={variant}\r\n size={size}\r\n color={color}\r\n fullWidth={fullWidth}\r\n required={required}\r\n error={!!error}\r\n disabled={disabled}\r\n multiline={multiline}\r\n rows={rows}\r\n minRows={minRows}\r\n maxRows={maxRows}\r\n type={multiline ? undefined : type}\r\n autoComplete={autoComplete}\r\n slotProps={finalSlotProps}\r\n slots={slots}\r\n sx={finalInputStyles}\r\n ref={ref}\r\n helperText={displayHelperText}\r\n />\r\n </FormControl>\r\n );\r\n }\r\n )\r\n);\r\n\r\nTextInputField.displayName = \"TextInputField\";\r\n\r\nexport default TextInputField;\r\n","\"use client\";\r\n/* eslint-disable @typescript-eslint/no-explicit-any */\r\n// import { zodResolver } from '@hookform/resolvers/zod';\r\nimport { Box, Button, Divider, Paper, Typography } from \"@mui/material\";\r\nimport { type Control, useForm } from \"react-hook-form\";\r\n\r\n// import * as z from 'zod';\r\nimport {\r\n FormInputAutoComplete,\r\n FormInputCalendar,\r\n FormInputCheckBox,\r\n FormInputCheckBoxGroup,\r\n FormInputColorPicker,\r\n FormInputDatePicker,\r\n FormInputFileUpload,\r\n FormInputMultiAutoComplete,\r\n FormInputMultiSelect,\r\n FormInputNumberField,\r\n FormInputOTPField,\r\n FormInputPasswordField,\r\n FormInputRadioButtonGroup,\r\n FormInputSearchField,\r\n FormInputSelect,\r\n FormInputSingleRadio,\r\n FormInputSlider,\r\n FormInputSwitch,\r\n FormInputTelField,\r\n FormInputTextArea,\r\n FormInputTextField,\r\n FormInputTimeClock,\r\n FormInputTimePicker,\r\n FormInputToggleButton\r\n} from \"../HookFormFields\";\r\n\r\ninterface FormData {\r\n text: string;\r\n textarea: string;\r\n password: string;\r\n number: string;\r\n tel: string;\r\n search: string;\r\n otp: string;\r\n select: string;\r\n multiselect: (string | number)[];\r\n autocomplete: any;\r\n multiautocomplete: any[];\r\n color: string;\r\n file: File | File[] | null;\r\n date: Date | null;\r\n time: Date | null;\r\n timeclock: Date | null;\r\n calendar: Date | null;\r\n checkbox: boolean;\r\n checkboxgroup: (string | number)[];\r\n switch: boolean;\r\n slider: number;\r\n singleradio: boolean;\r\n radiogroup: string;\r\n status: string;\r\n}\r\n\r\ntype FormControl = {\r\n control: Control<any>;\r\n handleSubmit: (e: (data: FormData) => void) => (e?: any) => Promise<void>;\r\n formState: {\r\n errors: Record<string, any>;\r\n };\r\n reset: () => void;\r\n};\r\nconst size = \"small\";\r\n\r\n// const schema = z.object({\r\n// text: z.string().min(3, { message: 'Text must be at least 3 characters' }),\r\n// textarea: z.string().min(10, { message: 'Description must be at least 10 characters' }),\r\n// password: z.string().min(6, { message: 'Password must be at least 6 characters' }),\r\n// number: z.string().min(1, { message: 'Number is required' }),\r\n// tel: z.string().min(10, { message: 'Phone number must be at least 10 characters' }),\r\n// search: z.string().min(3, { message: 'Search term must be at least 3 characters' }),\r\n// otp: z.string().min(4, { message: 'OTP must be at least 4 characters' }),\r\n// select: z.string().min(1, { message: 'Please select an option' }),\r\n// multiselect: z.array(z.union([z.string(), z.number()])).min(1, { message: 'Select at least one option' }),\r\n// autocomplete: z.any().refine((val) => val, { message: 'Please select an option' }),\r\n// multiautocomplete: z.array(z.any()).min(1, { message: 'Select at least one option' }),\r\n// color: z.string().min(1, { message: 'Color is required' }),\r\n// file: z.any().refine((val) => val, { message: 'File is required' }),\r\n// date: z\r\n// .date()\r\n// .nullable()\r\n// .refine((val) => val !== null, { message: 'Date is required' }),\r\n// time: z\r\n// .date()\r\n// .nullable()\r\n// .refine((val) => val !== null, { message: 'Time is required' }),\r\n// timeclock: z\r\n// .date()\r\n// .nullable()\r\n// .refine((val) => val !== null, { message: 'Time is required' }),\r\n// calendar: z\r\n// .date()\r\n// .nullable()\r\n// .refine((val) => val !== null, { message: 'Date is required' }),\r\n// checkbox: z.boolean().refine((val) => val === true, { message: 'Must be checked' }),\r\n// checkboxgroup: z.array(z.union([z.string(), z.number()])).min(1, { message: 'Select at least one option' }),\r\n// switch: z.boolean().refine((val) => val === true, { message: 'Must be switched on' }),\r\n// slider: z.number().min(1, { message: 'Value must be greater than 0' }),\r\n// singleradio: z.boolean().refine((val) => val === true, { message: 'Must be selected' }),\r\n// radiogroup: z.string().min(1, { message: 'Please select an option' }),\r\n// });\r\n\r\nconst ReactHookForm = () => {\r\n const { control, handleSubmit, reset }: FormControl = useForm<any>({\r\n defaultValues: {\r\n text: \"\",\r\n textarea: \"\",\r\n password: \"\",\r\n number: \"\",\r\n tel: \"\",\r\n search: \"\",\r\n otp: \"\",\r\n select: \"\",\r\n multiselect: [],\r\n autocomplete: null,\r\n multiautocomplete: [],\r\n color: \"\",\r\n file: null,\r\n date: null,\r\n time: null,\r\n timeclock: null,\r\n calendar: null,\r\n checkbox: false,\r\n checkboxgroup: [],\r\n switch: false,\r\n slider: 0,\r\n singleradio: false,\r\n radiogroup: \"\",\r\n status: \"ACTIVE\"\r\n }\r\n // resolver: zodResolver(schema),\r\n });\r\n\r\n // Options for dropdowns\r\n const selectOptions = [\r\n { name: \"Option 1\", value: \"opt1\" },\r\n { name: \"Option 2\", value: \"opt2\" },\r\n { name: \"Option 3\", value: \"opt3\" }\r\n ];\r\n\r\n const checkboxOptions = [\r\n { name: \"Checkbox 1\", value: \"check1\" },\r\n { name: \"Checkbox 2\", value: \"check2\" },\r\n { name: \"Checkbox 3\", value: \"check3\" }\r\n ];\r\n\r\n const radioOptions = [\r\n { name: \"Radio 1\", value: \"radio1\" },\r\n { name: \"Radio 2\", value: \"radio2\" },\r\n { name: \"Radio 3\", value: \"radio3\" }\r\n ];\r\n\r\n const onSubmit = (data: FormData) => {\r\n console.log(\"React Hook Form Data:\", data);\r\n };\r\n\r\n return (\r\n <Paper sx={{ padding: 3, maxWidth: \"100%\", margin: \"auto\" }}>\r\n <Typography variant=\"h4\" gutterBottom>\r\n React Hook Form (HookFormFields)\r\n </Typography>\r\n <Typography variant=\"body2\" color=\"text.secondary\" gutterBottom>\r\n Using HookFormFields with react-hook-form\r\n </Typography>\r\n <Divider sx={{ my: 2 }} />\r\n\r\n <form onSubmit={handleSubmit(onSubmit)}>\r\n <Box\r\n sx={{\r\n display: \"grid\",\r\n gridTemplateColumns: { xs: \"1fr\", md: \"1fr 1fr\" },\r\n gap: 2\r\n }}\r\n >\r\n <Box sx={{ display: \"flex\", flexDirection: \"column\", gap: 1.5 }}>\r\n {/* Text Inputs */}\r\n <FormInputTextField name=\"text\" label=\"Text Field\" control={control} size={size} />\r\n <FormInputPasswordField name=\"password\" label=\"Password\" control={control} size={size} />\r\n </Box>\r\n <FormInputTextArea name=\"textarea\" label=\"Text Area\" control={control} rows={4} size={size} />\r\n <Box sx={{ display: \"flex\", flexDirection: \"column\", gap: 1.5 }}>\r\n <FormInputNumberField name=\"number\" label=\"Number\" pattern=\"zip-code\" control={control} size={size} />\r\n\r\n <FormInputTelField\r\n name=\"tel\"\r\n label=\"Telephone\"\r\n pattern=\"XX-XXX-XXXXXX-X-XX\"\r\n control={control}\r\n size={size}\r\n />\r\n </Box>\r\n <FormInputSearchField name=\"search\" label=\"Search\" control={control} size={size} />\r\n\r\n <FormInputOTPField name=\"otp\" control={control} spacing={2} size={size} />\r\n\r\n {/* Dropdowns */}\r\n <FormInputSelect name=\"select\" label=\"Select\" control={control} options={selectOptions} size={size} />\r\n\r\n <FormInputMultiSelect\r\n name=\"multiselect\"\r\n label=\"Multi Select\"\r\n control={control}\r\n options={selectOptions}\r\n size={size}\r\n />\r\n\r\n <FormInputAutoComplete\r\n name=\"autocomplete\"\r\n label=\"Autocomplete\"\r\n control={control}\r\n options={selectOptions}\r\n size={size}\r\n />\r\n\r\n <FormInputMultiAutoComplete\r\n name=\"multiautocomplete\"\r\n label=\"Multi Autocomplete\"\r\n control={control}\r\n options={selectOptions}\r\n size={size}\r\n />\r\n\r\n <FormInputColorPicker name=\"color\" label=\"Color Picker\" control={control} size={size} />\r\n\r\n <FormInputFileUpload name=\"file\" label=\"File Upload\" control={control} size={size} />\r\n\r\n {/* Date/Time */}\r\n <FormInputDatePicker name=\"date\" control={control} size={size} />\r\n\r\n <Box>\r\n <FormInputTimePicker name=\"time\" control={control} size={size} />\r\n <Box\r\n sx={{\r\n display: \"grid\",\r\n gridTemplateColumns: { md: \"1fr 1fr\" },\r\n gap: 2,\r\n mt: 2\r\n }}\r\n >\r\n <FormInputCheckBoxGroup\r\n name=\"checkboxgroup\"\r\n label=\"Select Options\"\r\n control={control}\r\n options={checkboxOptions}\r\n size={size}\r\n />\r\n <FormInputRadioButtonGroup\r\n name=\"radiogroup\"\r\n label=\"Radio Group\"\r\n control={control}\r\n options={radioOptions}\r\n size={size}\r\n />\r\n </Box>\r\n <Box sx={{ display: \"flex\", gap: 2, mt: 2 }}>\r\n <FormInputCheckBox name=\"checkbox\" label=\"Checkbox\" control={control} size={size} />\r\n <FormInputSingleRadio name=\"singleradio\" label=\"Radio\" control={control} size={size} />\r\n <FormInputSwitch name=\"switch\" label=\"Switch\" control={control} size={size} />\r\n </Box>\r\n </Box>\r\n <Box sx={{ border: 1, borderColor: \"grey.300\", borderRadius: 1, p: 2 }}>\r\n <FormInputTimeClock name=\"timeclock\" label=\"Time Clock\" control={control} size={size} />\r\n </Box>\r\n <Box sx={{ border: 1, borderColor: \"grey.300\", borderRadius: 1, p: 2 }}>\r\n <FormInputCalendar name=\"calendar\" label=\"Calendar\" control={control} size={size} />\r\n </Box>\r\n {/* Box Inputs */}\r\n <Box>\r\n <FormInputSlider name=\"slider\" label=\"Slider\" control={control} size={size} />\r\n </Box>\r\n <Box>\r\n <FormInputToggleButton\r\n name=\"status\"\r\n label=\"Status\"\r\n control={control}\r\n options={[\r\n { name: \"Active\", value: \"ACTIVE\" },\r\n { name: \"Inactive\", value: \"INACTIVE\" },\r\n { name: \"Done\", value: \"DONE\" }\r\n ]}\r\n exclusive\r\n fullWidth\r\n size={size}\r\n />\r\n </Box>\r\n <Box\r\n sx={{\r\n gridColumn: { xs: \"1\", md: \"1 / -1\" },\r\n display: \"flex\",\r\n gap: 2,\r\n justifyContent: \"flex-end\"\r\n }}\r\n >\r\n <Button variant=\"outlined\" onClick={() => reset()}>\r\n Reset\r\n </Button>\r\n <Button type=\"submit\" variant=\"contained\">\r\n Submit\r\n </Button>\r\n </Box>\r\n </Box>\r\n </form>\r\n </Paper>\r\n );\r\n};\r\n\r\nexport default ReactHookForm;\r\n","\"use client\";\r\nimport React, { memo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\n\r\nimport NumberField from \"../FormFields/TextFields/NumberField\";\r\nimport type { IFormInputNumberFields } from \"./types\";\r\n\r\n/**\r\n * Form Input Number Component\r\n *\r\n * A highly customizable numeric input field built on top of Material UI TextField and FormControl,\r\n * integrated with React Hook Form.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a numeric input with advanced formatting support for: phone numbers,\r\n * credit cards, currency, SSN, ZIP codes, percentages, decimals, and custom patterns.\r\n * It integrates seamlessly with react-hook-form using the `Controller` component.\r\n *\r\n * @param {string} name - {string} Unique name for form identification\r\n * @param {Control<any>} control - {Control<any>} React Hook Form control object\r\n * @param {string} [label] - {string} Label text for the number field\r\n * @param {string} [defaultValue=''] - {string} Default number value\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {string} [placeholder] - {string} Placeholder text\r\n * @param {TextFieldProps['variant']} [variant='outlined'] - {TextFieldProps['variant']} TextField variant\r\n * @param {TextFieldProps['size']} [size] - {TextFieldProps['size']} TextField size\r\n * @param {TextFieldProps['color']} [color='primary'] - {TextFieldProps['color']} TextField color\r\n * @param {boolean} [fullWidth=true] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {string} [pattern='integer'] - {string} Number pattern type or custom pattern string\r\n * @param {RegExp} [customPattern] - {RegExp} Custom regex pattern (for pattern=\"custom\")\r\n * @param {(value: string) => string} [customFormatter] - {Function} Custom formatter function\r\n * @param {number} [min] - {number} Minimum value\r\n * @param {number} [max] - {number} Maximum value\r\n * @param {number} [step] - {number} Step value for number input\r\n * @param {boolean} [allowDecimals=true] - {boolean} Whether to allow decimal numbers\r\n * @param {number} [decimalPlaces=2] - {number} Number of decimal places allowed\r\n * @param {React.ReactNode} [startAdornment] - {React.ReactNode} Adornment before input\r\n * @param {React.ReactNode} [endAdornment] - {React.ReactNode} Adornment after input\r\n * @param {(value: string) => void} [onChange] - {Function} Optional additional callback fired when value changes\r\n * @param {Function} [onFocus] - {Function} Callback when field receives focus\r\n * @param {Function} [onBlur] - {Function} Callback when field loses focus\r\n * @param {Function} [onEnterPress] - {Function} Callback fired on Enter key press\r\n * @param {TextFieldProps['sx']} [inputStyles] - {TextFieldProps['sx']} Custom styles for the TextField\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {Object} [slotProps] - {Object} Custom slot props for MUI v7\r\n * @param {Object} [slots] - {Object} Custom slots for MUI v7\r\n *\r\n * @returns {JSX.Element} The Form Input Number component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import { FormInputNumberField } from \"@react-solutions/inputs\";\r\n * import { useForm } from \"react-hook-form\";\r\n *\r\n * function MyForm() {\r\n * const { control } = useForm();\r\n *\r\n * return (\r\n * <FormInputNumberField\r\n * name=\"phone\"\r\n * label=\"Phone Number\"\r\n * control={control}\r\n * pattern=\"phone\"\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\n\r\nconst FormInputNumberField = memo(\r\n ({\r\n name,\r\n label,\r\n control,\r\n pattern,\r\n min,\r\n max,\r\n step,\r\n allowDecimals,\r\n decimalPlaces,\r\n defaultValue = \"\",\r\n onChange,\r\n ...props\r\n }: IFormInputNumberFields) => {\r\n return (\r\n <Controller\r\n name={name}\r\n control={control}\r\n defaultValue={defaultValue}\r\n render={({ field, fieldState: { error } }) => {\r\n const { size, ...restProps } = props;\r\n return (\r\n <NumberField\r\n {...restProps}\r\n name={name}\r\n label={label}\r\n value={field.value ?? \"\"}\r\n onChange={(e) => {\r\n field.onChange(e);\r\n onChange?.(e.target.value);\r\n }}\r\n onBlur={field.onBlur}\r\n pattern={pattern}\r\n min={min}\r\n max={max}\r\n step={step}\r\n allowDecimals={allowDecimals}\r\n decimalPlaces={decimalPlaces}\r\n size={size as any}\r\n error={error}\r\n helperText={error?.message}\r\n />\r\n );\r\n }}\r\n />\r\n );\r\n }\r\n);\r\n\r\nFormInputNumberField.displayName = \"FormInputNumberField\";\r\n\r\nexport default FormInputNumberField;\r\n","\"use client\";\r\nimport React, { memo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\n\r\nimport OTPField from \"../FormFields/TextFields/OTPField\";\r\nimport type { IFormInputFields } from \"./types\";\r\n\r\n/**\r\n * Form Input OTP Component\r\n *\r\n * A specialized multi-box input field for One-Time Passwords (OTP) built on top of Material UI TextField,\r\n * integrated with React Hook Form.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a series of individual input boxes for OTP entry with support for:\r\n * automatic focus shifting, backspace handling, pasting multiple digits, error handling, and completion callbacks.\r\n * It integrates seamlessly with react-hook-form using the `Controller` component.\r\n *\r\n * @param {string} name - {string} Unique name for form identification\r\n * @param {Control<any>} control - {Control<any>} React Hook Form control object\r\n * @param {string} [label] - {string} Label text for the OTP field\r\n * @param {string} [defaultValue=''] - {string} Default OTP value\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {number} [length=6] - {number} Number of OTP input boxes\r\n * @param {TextFieldProps['variant']} [variant='outlined'] - {TextFieldProps['variant']} TextField variant\r\n * @param {TextFieldProps['size']} [size] - {TextFieldProps['size']} TextField size\r\n * @param {TextFieldProps['color']} [color='primary'] - {TextFieldProps['color']} TextField color\r\n * @param {boolean} [fullWidth=true] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {number} [spacing=1] - {number} Spacing between OTP boxes\r\n * @param {boolean} [autoFocus=false] - {boolean} Whether to auto-focus first input on mount\r\n * @param {boolean} [autoSubmit=false] - {boolean} Whether to auto-submit when all boxes are filled\r\n * @param {(value: string) => void} [onChange] - {Function} Optional additional callback fired when value changes\r\n * @param {(value: string) => void} [onComplete] - {Function} Callback fired when all boxes are filled\r\n * @param {Function} [onFocus] - {Function} Callback when field receives focus\r\n * @param {Function} [onBlur] - {Function} Callback when field loses focus\r\n * @param {Function} [onEnterPress] - {Function} Callback fired on Enter key press\r\n * @param {React.CSSProperties} [containerStyles] - {React.CSSProperties} Custom styles for the OTP container\r\n * @param {TextFieldProps['sx']} [inputStyles] - {TextFieldProps['sx']} Custom styles for individual OTP input boxes\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {Object} [slotProps] - {Object} Custom slot props for MUI v7\r\n * @param {Object} [slots] - {Object} Custom slots for MUI v7\r\n *\r\n * @returns {JSX.Element} The Form Input OTP component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import { FormInputOTPField } from \"@react-solutions/inputs\";\r\n * import { useForm } from \"react-hook-form\";\r\n *\r\n * function MyForm() {\r\n * const { control } = useForm();\r\n *\r\n * return (\r\n * <FormInputOTPField\r\n * name=\"otpCode\"\r\n * label=\"Enter Verification Code\"\r\n * control={control}\r\n * length={6}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\n\r\nconst FormInputOTPField = memo(({ name, label, control, defaultValue = \"\", onChange, ...props }: IFormInputFields) => {\r\n return (\r\n <Controller\r\n name={name}\r\n control={control}\r\n defaultValue={defaultValue}\r\n render={({ field, fieldState: { error } }) => {\r\n const { size, ...restProps } = props;\r\n return (\r\n <OTPField\r\n {...restProps}\r\n name={name}\r\n label={label}\r\n value={field.value ?? \"\"}\r\n onChange={(value) => {\r\n field.onChange(value);\r\n onChange?.(value);\r\n }}\r\n onBlur={field.onBlur}\r\n size={size as any}\r\n error={error}\r\n helperText={error?.message}\r\n />\r\n );\r\n }}\r\n />\r\n );\r\n});\r\n\r\nFormInputOTPField.displayName = \"FormInputOTPField\";\r\n\r\nexport default FormInputOTPField;\r\n","\"use client\";\r\nimport React, { memo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\n\r\nimport PasswordField from \"../FormFields/TextFields/PasswordField\";\r\nimport type { IFormInputFields } from \"./types\";\r\n\r\n/**\r\n * Form Input Password Component\r\n *\r\n * A specialized password input field built on top of Material UI TextField with visibility toggle,\r\n * integrated with React Hook Form.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a secure password input with support for: visibility toggling,\r\n * password strength indicator, error handling, helper text, and length validation.\r\n * It integrates seamlessly with react-hook-form using the `Controller` component.\r\n *\r\n * @param {string} name - {string} Unique name for form identification\r\n * @param {Control<any>} control - {Control<any>} React Hook Form control object\r\n * @param {string} [label] - {string} Label text for the password field\r\n * @param {string} [defaultValue=''] - {string} Default password value\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {string} [placeholder] - {string} Placeholder text\r\n * @param {TextFieldProps['variant']} [variant='outlined'] - {TextFieldProps['variant']} TextField variant\r\n * @param {TextFieldProps['size']} [size] - {TextFieldProps['size']} TextField size\r\n * @param {TextFieldProps['color']} [color] - {TextFieldProps['color']} TextField color\r\n * @param {boolean} [fullWidth=true] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {boolean} [showPasswordStrength=false] - {boolean} Whether to show password strength indicator\r\n * @param {number} [minLength] - {number} Minimum password length\r\n * @param {number} [maxLength] - {number} Maximum password length\r\n * @param {boolean} [defaultShowPassword=false] - {boolean} Whether to show password by default\r\n * @param {React.ReactNode} [visibilityIcon] - {React.ReactNode} Custom visibility icon\r\n * @param {React.ReactNode} [visibilityOffIcon] - {React.ReactNode} Custom visibility off icon\r\n * @param {IconButtonProps} [iconButtonProps] - {IconButtonProps} Custom icon button props\r\n * @param {(value: string) => void} [onChange] - {Function} Optional additional callback fired when value changes\r\n * @param {Function} [onFocus] - {Function} Callback when field receives focus\r\n * @param {Function} [onBlur] - {Function} Callback when field loses focus\r\n * @param {Function} [onVisibilityToggle] - {Function} Callback when visibility toggles\r\n * @param {Function} [getPasswordStrength] - {Function} Custom strength calculation function\r\n * @param {TextFieldProps['sx']} [inputStyles] - {TextFieldProps['sx']} Custom styles for the TextField\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {Object} [slotProps] - {Object} Custom slot props for MUI v7\r\n * @param {Object} [slots] - {Object} Custom slots for MUI v7\r\n *\r\n * @returns {JSX.Element} The Form Input Password component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import { FormInputPasswordField } from \"@react-solutions/inputs\";\r\n * import { useForm } from \"react-hook-form\";\r\n *\r\n * function MyForm() {\r\n * const { control } = useForm();\r\n *\r\n * return (\r\n * <FormInputPasswordField\r\n * name=\"userPassword\"\r\n * label=\"Password\"\r\n * control={control}\r\n * showPasswordStrength\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\n\r\nconst FormInputPasswordField = memo(\r\n ({ name, label, control, size, defaultValue = \"\", onChange, ...props }: IFormInputFields) => {\r\n return (\r\n <Controller\r\n name={name}\r\n control={control}\r\n defaultValue={defaultValue}\r\n render={({ field, fieldState: { error } }) => {\r\n const { size: sizeProp, ...restProps } = props;\r\n return (\r\n <PasswordField\r\n {...restProps}\r\n name={name}\r\n label={label}\r\n value={field.value ?? \"\"}\r\n onChange={(e) => {\r\n field.onChange(e);\r\n onChange?.(e.target.value);\r\n }}\r\n onBlur={field.onBlur}\r\n error={error}\r\n helperText={error?.message}\r\n size={(size ?? sizeProp) as any}\r\n />\r\n );\r\n }}\r\n />\r\n );\r\n }\r\n);\r\n\r\nFormInputPasswordField.displayName = \"FormInputPasswordField\";\r\n\r\nexport default FormInputPasswordField;\r\n","\"use client\";\r\nimport React, { memo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\n\r\nimport SearchInputField from \"../FormFields/TextFields/SearchInputField\";\r\nimport type { IFormInputFields } from \"./types\";\r\n\r\n/**\r\n * Form Input Search Component\r\n *\r\n * A specialized search input field built on top of Material UI TextField with search and clear functionality,\r\n * integrated with React Hook Form.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a robust search interface with support for: debounced/throttled search callbacks,\r\n * clear button, search button, Enter key handling, error handling, and helper text.\r\n * It integrates seamlessly with react-hook-form using the `Controller` component.\r\n *\r\n * @param {string} name - {string} Unique name for form identification\r\n * @param {Control<any>} control - {Control<any>} React Hook Form control object\r\n * @param {string} [label] - {string} Label text for the search field\r\n * @param {string} [defaultValue=''] - {string} Default search value\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {string} [placeholder] - {string} Placeholder text\r\n * @param {TextFieldProps['variant']} [variant='outlined'] - {TextFieldProps['variant']} TextField variant\r\n * @param {TextFieldProps['size']} [size] - {TextFieldProps['size']} TextField size\r\n * @param {TextFieldProps['color']} [color='primary'] - {TextFieldProps['color']} TextField color\r\n * @param {boolean} [fullWidth=true] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {boolean} [showClearButton=true] - {boolean} Whether to show clear button when input has value\r\n * @param {boolean} [showSearchButton=true] - {boolean} Whether to show search button icon\r\n * @param {React.ReactNode} [clearIcon] - {React.ReactNode} Custom clear icon\r\n * @param {React.ReactNode} [searchIcon] - {React.ReactNode} Custom search icon\r\n * @param {IconButtonProps} [clearButtonProps] - {IconButtonProps} Custom props for clear button\r\n * @param {IconButtonProps} [searchButtonProps] - {IconButtonProps} Custom props for search button\r\n * @param {(value: string) => void} [onChange] - {Function} Optional additional callback fired when value changes\r\n * @param {Function} [onFocus] - {Function} Callback when field receives focus\r\n * @param {Function} [onBlur] - {Function} Callback when field loses focus\r\n * @param {(value: string) => void} [onSearch] - {Function} Callback fired for search (can be debounced/throttled)\r\n * @param {Function} [onClear] - {Function} Callback fired when clear button is clicked\r\n * @param {Function} [onEnterPress] - {Function} Callback fired on Enter key press\r\n * @param {boolean} [enableDebounce=true] - {boolean} Enable debounce for search callback\r\n * @param {number} [debounceDelay=300] - {number} Debounce delay in milliseconds\r\n * @param {boolean} [enableThrottle=false] - {boolean} Enable throttle for search callback\r\n * @param {number} [throttleDelay=300] - {number} Throttle delay in milliseconds\r\n * @param {TextFieldProps['sx']} [inputStyles] - {TextFieldProps['sx']} Custom styles for the TextField\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {Object} [slotProps] - {Object} Custom slot props for MUI v7\r\n * @param {Object} [slots] - {Object} Custom slots for MUI v7\r\n *\r\n * @returns {JSX.Element} The Form Input Search component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import { FormInputSearchField } from \"@react-solutions/inputs\";\r\n * import { useForm } from \"react-hook-form\";\r\n *\r\n * function MyForm() {\r\n * const { control } = useForm();\r\n *\r\n * return (\r\n * <FormInputSearchField\r\n * name=\"userSearch\"\r\n * label=\"Search Users\"\r\n * control={control}\r\n * onSearch={(val) => console.log(\"Searching for:\", val)}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst FormInputSearchField = memo(\r\n ({ name, label, control, defaultValue = \"\", onChange, ...props }: IFormInputFields) => {\r\n return (\r\n <Controller\r\n name={name}\r\n control={control}\r\n defaultValue={defaultValue}\r\n render={({ field, fieldState: { error } }) => {\r\n const { size, ...restProps } = props;\r\n return (\r\n <SearchInputField\r\n {...restProps}\r\n name={name}\r\n label={label}\r\n value={field.value ?? \"\"}\r\n onChange={(e) => {\r\n field.onChange(e);\r\n onChange?.(e.target.value);\r\n }}\r\n onBlur={field.onBlur}\r\n size={size as any}\r\n error={error}\r\n helperText={error?.message}\r\n />\r\n );\r\n }}\r\n />\r\n );\r\n }\r\n);\r\n\r\nFormInputSearchField.displayName = \"FormInputSearchField\";\r\n\r\nexport default FormInputSearchField;\r\n","\"use client\";\r\nimport React, { memo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\n\r\nimport TelInputField from \"../FormFields/TextFields/TelInputField\";\r\nimport type { IFormInputFields } from \"./types\";\r\n\r\n/**\r\n * Form Input Tel Component\r\n *\r\n * A specialized telephone number input field built on top of Material UI TextField with pattern formatting,\r\n * integrated with React Hook Form.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a telephone input with support for: automatic pattern-based formatting,\r\n * country code prefix, digits-only value management, error handling, helper text, and standard text field behaviors.\r\n * It integrates seamlessly with react-hook-form using the `Controller` component.\r\n *\r\n * @param {string} name - {string} Unique name for form identification\r\n * @param {Control<any>} control - {Control<any>} React Hook Form control object\r\n * @param {string} [label] - {string} Label text for the tel field\r\n * @param {string} [defaultValue=''] - {string} Default tel value (digits only)\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {string} [placeholder] - {string} Placeholder text (auto-generated from pattern if not provided)\r\n * @param {TextFieldProps['variant']} [variant='outlined'] - {TextFieldProps['variant']} TextField variant\r\n * @param {TextFieldProps['size']} [size] - {TextFieldProps['size']} TextField size\r\n * @param {TextFieldProps['color']} [color='primary'] - {TextFieldProps['color']} TextField color\r\n * @param {boolean} [fullWidth=true] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {string} [pattern='XXXXXXXXXX'] - {string} Pattern string (e.g., 'XXX-XXXX' where X represents digits)\r\n * @param {number} [maxLength] - {number} Maximum digits allowed\r\n * @param {string} [countryCode='+1'] - {string} Country code prefix text\r\n * @param {boolean} [showCountryCode=false] - {boolean} Whether to show country code as start adornment\r\n * @param {React.ReactNode} [startAdornment] - {React.ReactNode} Adornment before input\r\n * @param {React.ReactNode} [endAdornment] - {React.ReactNode} Adornment after input\r\n * @param {(value: string) => void} [onChange] - {Function} Optional additional callback fired when value changes (returns digits only)\r\n * @param {Function} [onFocus] - {Function} Callback when field receives focus\r\n * @param {Function} [onBlur] - {Function} Callback when field loses focus\r\n * @param {Function} [onEnterPress] - {Function} Callback fired on Enter key press\r\n * @param {TextFieldProps['sx']} [inputStyles] - {TextFieldProps['sx']} Custom styles for the TextField\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {React.CSSProperties} [countryCodeStyles] - {React.CSSProperties} Custom styles for country code display\r\n * @param {Object} [slotProps] - {Object} Custom slot props for MUI v7\r\n * @param {Object} [slots] - {Object} Custom slots for MUI v7\r\n *\r\n * @returns {JSX.Element} The Form Input Tel component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import { FormInputTelField } from \"@react-solutions/inputs\";\r\n * import { useForm } from \"react-hook-form\";\r\n *\r\n * function MyForm() {\r\n * const { control } = useForm();\r\n *\r\n * return (\r\n * <FormInputTelField\r\n * name=\"phoneNumber\"\r\n * label=\"Phone Number\"\r\n * control={control}\r\n * pattern=\"XXX-XXX-XXXX\"\r\n * showCountryCode\r\n * countryCode=\"+91\"\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst FormInputTelField = memo(({ name, label, control, defaultValue = \"\", onChange, ...props }: IFormInputFields) => {\r\n return (\r\n <Controller\r\n name={name}\r\n control={control}\r\n defaultValue={defaultValue}\r\n render={({ field, fieldState: { error } }) => {\r\n const { size, ...restProps } = props;\r\n return (\r\n <TelInputField\r\n {...restProps}\r\n name={name}\r\n label={label}\r\n value={field.value ?? \"\"}\r\n onChange={(e) => {\r\n field.onChange(e);\r\n onChange?.(e.target.value);\r\n }}\r\n onBlur={field.onBlur}\r\n size={size as any}\r\n error={error}\r\n helperText={error?.message}\r\n />\r\n );\r\n }}\r\n />\r\n );\r\n});\r\n\r\nFormInputTelField.displayName = \"FormInputTelField\";\r\n\r\nexport default FormInputTelField;\r\n","\"use client\";\r\nimport { memo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\n\r\nimport TextInputField from \"../FormFields/TextFields/TextInputField\";\r\nimport type { IFormInputTextAreaFields } from \"./types\";\r\n/**\r\n * Form Input Text Area Component\r\n *\r\n * A specialized multi-line text input field built on top of Material UI TextField,\r\n * integrated with React Hook Form.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a dedicated textarea interface with support for:\r\n * adjustable rows, dynamic resizing, error handling, helper text, and standard text field behaviors.\r\n * It integrates seamlessly with react-hook-form using the `Controller` component.\r\n *\r\n * @param {string} name - {string} Unique name for form identification\r\n * @param {Control<any>} control - {Control<any>} React Hook Form control object\r\n * @param {string} [label] - {string} Label text for the textarea\r\n * @param {string} [defaultValue=''] - {string} Default text value\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {string} [placeholder] - {string} Placeholder text\r\n * @param {number} [rows] - {number} Fixed number of rows\r\n * @param {number} [minRows] - {number} Minimum number of rows\r\n * @param {number} [maxRows] - {number} Maximum number of rows\r\n * @param {ResizeOption} [resize='both'] - {ResizeOption} CSS resize property for the textarea\r\n * @param {TextFieldProps['variant']} [variant='outlined'] - {TextFieldProps['variant']} TextField variant\r\n * @param {TextFieldProps['size']} [size] - {TextFieldProps['size']} TextField size\r\n * @param {TextFieldProps['color']} [color='primary'] - {TextFieldProps['color']} TextField color\r\n * @param {boolean} [fullWidth=true] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {(value: string) => void} [onChange] - {Function} Optional additional callback fired when value changes\r\n * @param {Function} [onFocus] - {Function} Callback when field receives focus\r\n * @param {Function} [onBlur] - {Function} Callback when field loses focus\r\n * @param {TextFieldProps['sx']} [inputStyles] - {TextFieldProps['sx']} Custom styles for the TextField\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n *\r\n * @returns {JSX.Element} The Form Input Text Area component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import { FormInputTextArea } from \"@react-solutions/inputs\";\r\n * import { useForm } from \"react-hook-form\";\r\n *\r\n * function MyForm() {\r\n * const { control } = useForm();\r\n *\r\n * return (\r\n * <FormInputTextArea\r\n * name=\"description\"\r\n * label=\"Project Description\"\r\n * control={control}\r\n * minRows={3}\r\n * maxRows={10}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst FormInputTextArea = memo(\r\n ({\r\n name,\r\n label,\r\n control,\r\n rows,\r\n minRows,\r\n maxRows,\r\n resize,\r\n defaultValue = \"\",\r\n onChange,\r\n ...props\r\n }: IFormInputTextAreaFields) => {\r\n return (\r\n <Controller\r\n name={name}\r\n control={control}\r\n defaultValue={defaultValue}\r\n render={({ field, fieldState: { error } }) => {\r\n const { size, ...restProps } = props;\r\n return (\r\n <TextInputField\r\n {...restProps}\r\n name={name}\r\n label={label}\r\n value={field.value ?? \"\"}\r\n onChange={(e) => {\r\n field.onChange(e);\r\n onChange?.(e.target.value);\r\n }}\r\n onBlur={field.onBlur}\r\n multiline\r\n rows={rows}\r\n minRows={minRows}\r\n maxRows={maxRows}\r\n resize={resize}\r\n size={size as any}\r\n error={error}\r\n helperText={error?.message}\r\n />\r\n );\r\n }}\r\n />\r\n );\r\n }\r\n);\r\n\r\nFormInputTextArea.displayName = \"FormInputTextArea\";\r\n\r\nexport default FormInputTextArea;\r\n","\"use client\";\r\nimport { memo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\n\r\nimport TextInputField from \"../FormFields/TextFields/TextInputField\";\r\nimport type { IFormInputFields } from \"./types\";\r\n\r\n/**\r\n * Form Input Text Component\r\n *\r\n * A versatile text input field built on top of Material UI TextField with support for various text types and transformations,\r\n * integrated with React Hook Form.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a flexible text input with support for: single-line and multiline (textarea),\r\n * text transformations (uppercase, lowercase, capitalize), error handling, helper text, custom adornments,\r\n * and standard text field behaviors. It integrates seamlessly with react-hook-form using the `Controller` component.\r\n *\r\n * @param {string} name - {string} Unique name for form identification\r\n * @param {Control<any>} control - {Control<any>} React Hook Form control object\r\n * @param {string} [label] - {string} Label text for the text field\r\n * @param {string} [defaultValue=''] - {string} Default text value\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {string} [placeholder] - {string} Placeholder text\r\n * @param {TextFieldProps['variant']} [variant='outlined'] - {TextFieldProps['variant']} TextField variant\r\n * @param {TextFieldProps['size']} [size] - {TextFieldProps['size']} TextField size\r\n * @param {TextFieldProps['color']} [color='primary'] - {TextFieldProps['color']} TextField color\r\n * @param {boolean} [fullWidth=true] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {boolean} [multiline=false] - {boolean} Whether to enable multiline input (textarea)\r\n * @param {number} [rows] - {number} Number of rows for multiline input\r\n * @param {number} [minRows] - {number} Minimum number of rows for multiline input\r\n * @param {number} [maxRows] - {number} Maximum number of rows for multiline input\r\n * @param {ResizeOption} [resize='both'] - {ResizeOption} Resize option for textarea\r\n * @param {number} [maxLength] - {number} Maximum length of input\r\n * @param {number} [minLength] - {number} Minimum length of input\r\n * @param {string} [type='text'] - {string} Input type (text, email, url, etc.)\r\n * @param {string} [autoComplete='off'] - {string} Auto complete attribute\r\n * @param {React.ReactNode} [startAdornment] - {React.ReactNode} Adornment before input\r\n * @param {React.ReactNode} [endAdornment] - {React.ReactNode} Adornment after input\r\n * @param {(value: string) => void} [onChange] - {Function} Optional additional callback fired when value changes\r\n * @param {Function} [onFocus] - {Function} Callback when field receives focus\r\n * @param {Function} [onBlur] - {Function} Callback when field loses focus\r\n * @param {Function} [onEnterPress] - {Function} Callback fired on Enter key press\r\n * @param {TextFieldProps['sx']} [inputStyles] - {TextFieldProps['sx']} Custom styles for the TextField\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {Object} [slotProps] - {Object} Custom slot props for MUI v7\r\n * @param {Object} [slots] - {Object} Custom slots for MUI v7\r\n * @param {TextTransformOption} [textTransform] - {TextTransformOption} Text transformation option\r\n *\r\n * @returns {JSX.Element} The Form Input Text component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import { FormInputTextField } from \"@react-solutions/inputs\";\r\n * import { useForm } from \"react-hook-form\";\r\n *\r\n * function MyForm() {\r\n * const { control } = useForm();\r\n *\r\n * return (\r\n * <FormInputTextField\r\n * name=\"fullName\"\r\n * label=\"Full Name\"\r\n * control={control}\r\n * textTransform=\"capitalize\"\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst FormInputTextField = memo(({ name, label, control, defaultValue = \"\", onChange, ...props }: IFormInputFields) => {\r\n return (\r\n <Controller\r\n name={name}\r\n control={control}\r\n defaultValue={defaultValue}\r\n render={({ field, fieldState: { error } }) => {\r\n const { size, ...restProps } = props;\r\n return (\r\n <TextInputField\r\n {...restProps}\r\n name={name}\r\n label={label}\r\n value={field.value ?? \"\"}\r\n onChange={(e) => {\r\n field.onChange(e);\r\n onChange?.(e.target.value);\r\n }}\r\n onBlur={field.onBlur}\r\n size={size as any}\r\n error={error}\r\n helperText={error?.message}\r\n />\r\n );\r\n }}\r\n />\r\n );\r\n});\r\n\r\nFormInputTextField.displayName = \"FormInputTextField\";\r\n\r\nexport default FormInputTextField;\r\n","\"use client\";\r\nimport { memo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\n\r\nimport AutoCompleteField from \"../FormFields/DropdownFields/AutoCompleteField\";\r\nimport type { IFormInputFieldsWithOptions } from \"./types\";\r\n\r\n/**\r\n * Form Input AutoComplete Component\r\n *\r\n * A highly customizable autocomplete search and dropdown field built on top of Material UI Autocomplete and TextField,\r\n * integrated with React Hook Form.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a searchable dropdown with support for: single/multiple selection, remote/local options,\r\n * error handling, helper text, custom option rendering, and standard autocomplete behaviors.\r\n * It integrates seamlessly with react-hook-form using the `Controller` component.\r\n *\r\n * @param {string} name - {string} Unique name for form identification\r\n * @param {Control<any>} control - {Control<any>} React Hook Form control object\r\n * @param {string} [label] - {string} Label text for the input field\r\n * @param {any} [defaultValue=null] - {any} Default selected value(s)\r\n * @param {any[]} options - {any[]} Array of options to display in dropdown\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {string} [placeholder] - {string} Placeholder text\r\n * @param {TextFieldProps['variant']} [variant='outlined'] - {TextFieldProps['variant']} TextField variant\r\n * @param {TextFieldProps['size']} [size] - {TextFieldProps['size']} TextField size\r\n * @param {TextFieldProps['color']} [color] - {TextFieldProps['color']} TextField color\r\n * @param {boolean} [fullWidth=true] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {Function} [getOptionLabel] - {Function} Custom function to get option label\r\n * @param {Function} [isOptionEqualToValue] - {Function} Custom function to check option equality\r\n * @param {Function} [renderOption] - {Function} Custom render function for options\r\n * @param {(value: any) => void} [onChange] - {Function} Optional additional callback fired when value changes\r\n * @param {Function} [onInputChange] - {Function} Callback fired when input value changes\r\n * @param {Function} [onOpen] - {Function} Callback fired when popup opens\r\n * @param {Function} [onClose] - {Function} Callback fired when popup closes\r\n * @param {React.ReactNode} [popupIcon] - {React.ReactNode} Custom icon for popup indicator\r\n * @param {TextFieldProps['sx']} [inputStyles] - {TextFieldProps['sx']} Custom styles for the internal TextField\r\n * @param {AutocompleteProps['sx']} [autocompleteStyles] - {AutocompleteProps['sx']} Custom styles for the Autocomplete component\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {boolean} [loading=false] - {boolean} Whether to show loading state\r\n * @param {React.ReactNode} [loadingText='Loading...'] - {React.ReactNode} Text to show when loading\r\n * @param {React.ReactNode} [noOptionsText='No options'] - {React.ReactNode} Text to show when no options available\r\n * @param {Function} [filterOptions] - {Function} Custom filter options function\r\n * @param {boolean} [autoHighlight=true] - {boolean} Whether to highlight the first option\r\n * @param {boolean} [autoSelect=false] - {boolean} Whether to select the first option on highlight\r\n * @param {boolean} [disablePortal=false] - {boolean} Whether to disable portal rendering\r\n * @param {Object} [slotProps] - {Object} Custom slot props for MUI v7\r\n * @param {Object} [slots] - {Object} Custom slots for MUI v7\r\n *\r\n * @returns {JSX.Element} The Form Input AutoComplete component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import { FormInputAutoComplete } from \"@react-solutions/inputs\";\r\n * import { useForm } from \"react-hook-form\";\r\n *\r\n * function MyForm() {\r\n * const { control } = useForm();\r\n * const options = [{ name: \"Option 1\", value: 1 }, { name: \"Option 2\", value: 2 }];\r\n *\r\n * return (\r\n * <FormInputAutoComplete\r\n * name=\"myAutocomplete\"\r\n * label=\"Select Option\"\r\n * control={control}\r\n * options={options}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst FormInputAutoComplete = memo(\r\n ({\r\n name,\r\n label,\r\n control,\r\n options = [],\r\n disabled,\r\n placeholder,\r\n defaultValue = null,\r\n onChange,\r\n ...props\r\n }: IFormInputFieldsWithOptions) => {\r\n return (\r\n <Controller\r\n name={name}\r\n control={control}\r\n defaultValue={defaultValue}\r\n render={({ field, fieldState: { error } }) => {\r\n const { value, onBlur } = field;\r\n const { size, ...restProps } = props;\r\n return (\r\n <AutoCompleteField\r\n name={name}\r\n label={label}\r\n placeholder={placeholder}\r\n disabled={disabled}\r\n options={options}\r\n value={value ?? null}\r\n size={size as any}\r\n error={error}\r\n helperText={error?.message}\r\n {...restProps}\r\n onChange={(_, newValue) => {\r\n field.onChange(newValue);\r\n onChange?.(newValue);\r\n }}\r\n onBlur={onBlur}\r\n />\r\n );\r\n }}\r\n />\r\n );\r\n }\r\n);\r\n\r\nFormInputAutoComplete.displayName = \"FormInputAutoComplete\";\r\n\r\nexport default FormInputAutoComplete;\r\n","\"use client\";\r\nimport React, { memo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\n\r\nimport ColorPickerField from \"../FormFields/DropdownFields/ColorPickerField\";\r\nimport type { IFormInputFields } from \"./types\";\r\n\r\n/**\r\n * Form Input Color Picker Component\r\n *\r\n * A customizable color picker field built on top of Material UI TextField and native color input,\r\n * integrated with React Hook Form.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a color selection input with support for: hex values, color preview swatch,\r\n * native color picker integration, error handling, helper text, and standard text field behaviors.\r\n * It integrates seamlessly with react-hook-form using the `Controller` component.\r\n *\r\n * @param {string} name - {string} Unique name for form identification\r\n * @param {Control<any>} control - {Control<any>} React Hook Form control object\r\n * @param {string} [label] - {string} Label text for the color picker field\r\n * @param {string} [defaultValue='#000000'] - {string} Default color value (hex string)\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {string} [placeholder='#000000'] - {string} Placeholder text\r\n * @param {TextFieldProps['variant']} [variant='outlined'] - {TextFieldProps['variant']} TextField variant\r\n * @param {TextFieldProps['size']} [size] - {TextFieldProps['size']} TextField size\r\n * @param {TextFieldProps['color']|'primary'} [color='primary'] - {TextFieldProps['color']} TextField color\r\n * @param {boolean} [fullWidth=true] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {string} [format='hex'] - {string} Color format (currently hex supported)\r\n * @param {boolean} [showPreview=true] - {boolean} Whether to show color preview swatch\r\n * @param {(value: string) => void} [onChange] - {Function} Optional additional callback fired when value changes\r\n * @param {Function} [onFocus] - {Function} Callback when field receives focus\r\n * @param {Function} [onBlur] - {Function} Callback when field loses focus\r\n * @param {Function} [onEnterPress] - {Function} Callback fired on Enter key press\r\n * @param {React.CSSProperties} [previewStyles] - {React.CSSProperties} Custom styles for the color preview swatch\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {TextFieldProps['sx']} [inputStyles] - {TextFieldProps['sx']} Custom styles for TextField\r\n * @param {Object} [slotProps] - {Object} Custom slot props for MUI v7\r\n * @param {Object} [slots] - {Object} Custom slots for MUI v7\r\n *\r\n * @returns {JSX.Element} The Form Input Color Picker component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import { FormInputColorPicker } from \"@react-solutions/inputs\";\r\n * import { useForm } from \"react-hook-form\";\r\n *\r\n * function MyForm() {\r\n * const { control } = useForm();\r\n *\r\n * return (\r\n * <FormInputColorPicker\r\n * name=\"themeColor\"\r\n * label=\"Theme Color\"\r\n * control={control}\r\n * defaultValue=\"#3f51b5\"\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\n\r\nconst FormInputColorPicker = memo(\r\n ({ name, label, control, defaultValue = \"#000000\", onChange, ...props }: IFormInputFields) => {\r\n return (\r\n <Controller\r\n name={name}\r\n control={control}\r\n defaultValue={defaultValue}\r\n render={({ field, fieldState: { error } }) => {\r\n const { size, ...restProps } = props;\r\n return (\r\n <ColorPickerField\r\n {...restProps}\r\n name={name}\r\n label={label}\r\n value={field.value ?? defaultValue}\r\n onChange={(color) => {\r\n field.onChange(color);\r\n onChange?.(color);\r\n }}\r\n onBlur={field.onBlur}\r\n size={size as any}\r\n error={error}\r\n helperText={error?.message}\r\n />\r\n );\r\n }}\r\n />\r\n );\r\n }\r\n);\r\n\r\nFormInputColorPicker.displayName = \"FormInputColorPicker\";\r\n\r\nexport default FormInputColorPicker;\r\n","\"use client\";\r\nimport React, { memo, useRef } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\n\r\nimport FileUploadField from \"../FormFields/DropdownFields/FileUploadField\";\r\nimport type { IFormInputFields } from \"./types\";\r\n\r\n/**\r\n * Form Input File Upload Component\r\n *\r\n * A versatile file upload field built on top of Material UI TextField and native file input,\r\n * integrated with React Hook Form.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a file selection interface with support for: single/multiple files,\r\n * drag and drop, file validation (size, type), file preview, clear functionality, and standard form field behaviors.\r\n * It integrates seamlessly with react-hook-form using the `Controller` component.\r\n *\r\n * @param {string} name - {string} Unique name for form identification\r\n * @param {Control<any>} control - {Control<any>} React Hook Form control object\r\n * @param {string} [label] - {string} Label text for the file upload field\r\n * @param {any} [defaultValue=null] - {any} Default selected file(s)\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {string} [accept] - {string} File types to accept (e.g., \"image/*\", \".pdf\")\r\n * @param {boolean} [multiple=false] - {boolean} Whether to allow multiple file selection\r\n * @param {number} [maxSize] - {number} Maximum file size in bytes\r\n * @param {number} [minSize] - {number} Minimum file size in bytes\r\n * @param {string[]} [allowedTypes] - {string[]} Allowed file types (MIME types or extensions)\r\n * @param {boolean} [showPreview=true] - {boolean} Whether to show file name preview\r\n * @param {boolean} [enableDragDrop=false] - {boolean} Whether to enable drag and drop\r\n * @param {string} [placeholder='No file chosen'] - {string} Placeholder text\r\n * @param {TextFieldProps['variant']} [variant='outlined'] - {TextFieldProps['variant']} TextField variant\r\n * @param {TextFieldProps['size']} [size] - {TextFieldProps['size']} TextField size\r\n * @param {TextFieldProps['color']} [color] - {TextFieldProps['color']} TextField color\r\n * @param {boolean} [fullWidth=true] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {string} [buttonText='Upload'] - {string} Upload button text\r\n * @param {ButtonProps['variant']} [buttonVariant='contained'] - {ButtonProps['variant']} Upload button variant\r\n * @param {ButtonProps['color']} [buttonColor='primary'] - {ButtonProps['color']} Upload button color\r\n * @param {ButtonProps['size']} [buttonSize] - {ButtonProps['size']} Upload button size\r\n * @param {React.ReactNode} [uploadIcon] - {React.ReactNode} Custom upload icon\r\n * @param {(file: File | File[] | undefined) => void} [onChange] - {Function} Optional additional callback fired when files change\r\n * @param {Function} [onFileSelect] - {Function} Callback fired when file is selected\r\n * @param {Function} [onFileRemove] - {Function} Callback fired when file is removed\r\n * @param {(error: string) => void} [onValidationError] - {Function} Callback fired on validation error\r\n * @param {(files: FileList) => void} [onDrop] - {Function} Callback fired when file is dropped\r\n * @param {TextFieldProps['sx']} [inputStyles] - {TextFieldProps['sx']} Custom styles for the internal TextField\r\n * @param {ButtonProps['sx']} [buttonStyles] - {ButtonProps['sx']} Custom styles for the Upload button\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {React.CSSProperties} [containerStyles] - {React.CSSProperties} Custom styles for the container\r\n * @param {Object} [slotProps] - {Object} Custom slot props for MUI v7\r\n * @param {Object} [slots] - {Object} Custom slots for MUI v7\r\n *\r\n * @returns {JSX.Element} The Form Input File Upload component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import { FormInputFileUpload } from \"@react-solutions/inputs\";\r\n * import { useForm } from \"react-hook-form\";\r\n *\r\n * function MyForm() {\r\n * const { control } = useForm();\r\n *\r\n * return (\r\n * <FormInputFileUpload\r\n * name=\"resume\"\r\n * label=\"Upload Resume\"\r\n * control={control}\r\n * accept=\".pdf,.doc,.docx\"\r\n * enableDragDrop\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\n\r\nconst FormInputFileUpload = memo(\r\n ({ name, label, control, size, defaultValue = null, onChange, ...props }: IFormInputFields) => {\r\n const fileRef = useRef(null);\r\n\r\n return (\r\n <Controller\r\n name={name}\r\n control={control}\r\n defaultValue={defaultValue}\r\n render={({ field, fieldState: { error } }) => (\r\n <FileUploadField\r\n {...props}\r\n name={name}\r\n label={label}\r\n value={field.value ?? null}\r\n size={size as any}\r\n ref={fileRef}\r\n onChange={(files) => {\r\n field.onChange(files);\r\n onChange?.(files);\r\n }}\r\n onBlur={field.onBlur}\r\n error={error}\r\n helperText={error?.message}\r\n />\r\n )}\r\n />\r\n );\r\n }\r\n);\r\n\r\nFormInputFileUpload.displayName = \"FormInputFileUpload\";\r\n\r\nexport default FormInputFileUpload;\r\n","\"use client\";\r\nimport React, { memo, useMemo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\n\r\nimport AutoCompleteField from \"../FormFields/DropdownFields/AutoCompleteField\";\r\nimport type { IFormInputFieldsWithOptions } from \"./types\";\r\n\r\n/**\r\n * Form Input Multi AutoComplete Component\r\n *\r\n * A highly customizable multi-select autocomplete field built on top of Material UI Autocomplete and TextField,\r\n * integrated with React Hook Form.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a searchable multi-select dropdown with support for: remote/local options,\r\n * error handling, helper text, custom option rendering, and standard autocomplete behaviors.\r\n * It integrates seamlessly with react-hook-form using the `Controller` component.\r\n *\r\n * @param {string} name - {string} Unique name for form identification\r\n * @param {Control<any>} control - {Control<any>} React Hook Form control object\r\n * @param {string} [label] - {string} Label text for the input field\r\n * @param {any[]} [defaultValue=[]] - {any[]} Default selected values\r\n * @param {any[]} options - {any[]} Array of options to display in dropdown\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {string} [placeholder] - {string} Placeholder text\r\n * @param {TextFieldProps['variant']} [variant='outlined'] - {TextFieldProps['variant']} TextField variant\r\n * @param {TextFieldProps['size']} [size] - {TextFieldProps['size']} TextField size\r\n * @param {TextFieldProps['color']} [color] - {TextFieldProps['color']} TextField color\r\n * @param {boolean} [fullWidth=true] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {Function} [getOptionLabel] - {Function} Custom function to get option label\r\n * @param {Function} [isOptionEqualToValue] - {Function} Custom function to check option equality\r\n * @param {Function} [renderOption] - {Function} Custom render function for options\r\n * @param {(value: any[]) => void} [onChange] - {Function} Optional additional callback fired when value changes\r\n * @param {Function} [onInputChange] - {Function} Callback fired when input value changes\r\n * @param {Function} [onOpen] - {Function} Callback fired when popup opens\r\n * @param {Function} [onClose] - {Function} Callback fired when popup closes\r\n * @param {React.ReactNode} [popupIcon] - {React.ReactNode} Custom icon for popup indicator\r\n * @param {TextFieldProps['sx']} [inputStyles] - {TextFieldProps['sx']} Custom styles for the internal TextField\r\n * @param {AutocompleteProps['sx']} [autocompleteStyles] - {AutocompleteProps['sx']} Custom styles for the Autocomplete component\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {boolean} [loading=false] - {boolean} Whether to show loading state\r\n * @param {React.ReactNode} [loadingText='Loading...'] - {React.ReactNode} Text to show when loading\r\n * @param {React.ReactNode} [noOptionsText='No options'] - {React.ReactNode} Text to show when no options available\r\n * @param {Function} [filterOptions] - {Function} Custom filter options function\r\n * @param {boolean} [autoHighlight=true] - {boolean} Whether to highlight the first option\r\n * @param {boolean} [autoSelect=false] - {boolean} Whether to select the first option on highlight\r\n * @param {boolean} [disablePortal=false] - {boolean} Whether to disable portal rendering\r\n * @param {Object} [slotProps] - {Object} Custom slot props for MUI v7\r\n * @param {Object} [slots] - {Object} Custom slots for MUI v7\r\n *\r\n * @returns {JSX.Element} The Form Input Multi AutoComplete component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import { FormInputMultiAutoComplete } from \"@react-solutions/inputs\";\r\n * import { useForm } from \"react-hook-form\";\r\n *\r\n * function MyForm() {\r\n * const { control } = useForm();\r\n * const options = [{ name: \"Red\", value: \"red\" }, { name: \"Blue\", value: \"blue\" }];\r\n *\r\n * return (\r\n * <FormInputMultiAutoComplete\r\n * name=\"colors\"\r\n * label=\"Select Colors\"\r\n * control={control}\r\n * options={options}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\n\r\nconst FormInputMultiAutoComplete = memo(\r\n ({\r\n name,\r\n label,\r\n control,\r\n options = [],\r\n disabled,\r\n placeholder,\r\n defaultValue = [],\r\n onChange,\r\n ...props\r\n }: IFormInputFieldsWithOptions) => {\r\n const memoizedOptions = useMemo(() => options, [options]);\r\n\r\n return (\r\n <Controller\r\n name={name}\r\n control={control}\r\n defaultValue={defaultValue}\r\n render={({ field, fieldState: { error } }) => {\r\n const { value, onBlur } = field;\r\n const { size, ...restProps } = props;\r\n const fieldValue = Array.isArray(value) ? value : [];\r\n return (\r\n <AutoCompleteField\r\n {...restProps}\r\n name={name}\r\n label={label}\r\n placeholder={placeholder}\r\n disabled={disabled}\r\n options={memoizedOptions}\r\n multiple\r\n value={fieldValue}\r\n onChange={(_, newValue) => {\r\n field.onChange(newValue);\r\n onChange?.(newValue);\r\n }}\r\n onBlur={onBlur}\r\n size={size as any}\r\n error={error}\r\n helperText={error?.message}\r\n />\r\n );\r\n }}\r\n />\r\n );\r\n }\r\n);\r\n\r\nFormInputMultiAutoComplete.displayName = \"FormInputMultiAutoComplete\";\r\n\r\nexport default FormInputMultiAutoComplete;\r\n","\"use client\";\r\nimport React, { memo, useMemo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\n\r\nimport SelectInputField from \"../FormFields/DropdownFields/SelectInputField\";\r\nimport type { IFormInputFieldsWithOptions } from \"./types\";\r\n\r\n/**\r\n * Form Input Multi Select Component\r\n *\r\n * A customizable multi-select dropdown field built on top of Material UI Select and FormControl,\r\n * integrated with React Hook Form.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a flexible multi-select dropdown with support for:\r\n * error handling, helper text, custom menu item rendering, and standard select behaviors.\r\n * It integrates seamlessly with react-hook-form using the `Controller` component.\r\n *\r\n * @param {string} name - {string} Unique name for form identification\r\n * @param {Control<any>} control - {Control<any>} React Hook Form control object\r\n * @param {string} [label] - {string} Label text for the select field\r\n * @param {any[]} [defaultValue=[]] - {any[]} Default selected values\r\n * @param {Option[]} options - {Option[]} Array of options to display in dropdown\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {SelectProps['variant']} [variant='outlined'] - {SelectProps['variant']} Select variant\r\n * @param {SelectProps['size']} [size] - {SelectProps['size']} Select size\r\n * @param {SelectProps['color']} [color] - {SelectProps['color']} Select color\r\n * @param {boolean} [fullWidth=true] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {boolean} [multiple=true] - {boolean} Whether to allow multiple selections\r\n * @param {React.ReactNode} [icon] - {React.ReactNode} Custom icon for dropdown indicator\r\n * @param {SelectProps['renderValue']} [renderValue] - {Function} Custom render function for selected value(s)\r\n * @param {Function} [renderMenuItem] - {Function} Custom render function for menu items\r\n * @param {MenuItemProps['sx'] | Function} [menuItemStyles] - {Object|Function} Custom styles for MenuItem\r\n * @param {SelectProps['sx']} [selectStyles] - {SelectProps['sx']} Custom styles for the Select component\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {InputLabelProps['sx']} [labelStyles] - {InputLabelProps['sx']} Custom styles for InputLabel\r\n * @param {(value: any) => void} [onChange] - {Function} Optional additional callback fired when value changes\r\n * @param {Function} [onOpen] - {Function} Callback fired when menu opens\r\n * @param {Function} [onClose] - {Function} Callback fired when menu closes\r\n * @param {Object} [slotProps] - {Object} Custom slot props for MUI v7\r\n * @param {Object} [slots] - {Object} Custom slots for MUI v7\r\n * @param {boolean} [displayEmpty=false] - {boolean} Whether to display empty value\r\n * @param {boolean} [autoWidth=false] - {boolean} Whether the menu should have auto width\r\n * @param {boolean} [native=false] - {boolean} Whether to use native select element\r\n * @param {SelectProps['MenuProps']} [MenuProps] - {Object} Custom Menu props\r\n *\r\n * @returns {JSX.Element} The Form Input Multi Select component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import { FormInputMultiSelect } from \"@react-solutions/inputs\";\r\n * import { useForm } from \"react-hook-form\";\r\n *\r\n * function MyForm() {\r\n * const { control } = useForm();\r\n * const options = [\r\n * { value: \"1\", name: \"Option 1\" },\r\n * { value: \"2\", name: \"Option 2\" }\r\n * ];\r\n *\r\n * return (\r\n * <FormInputMultiSelect\r\n * name=\"mySelect\"\r\n * label=\"Select Options\"\r\n * control={control}\r\n * options={options}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\n\r\nconst FormInputMultiSelect = memo(\r\n ({ name, label, control, options = [], defaultValue = [], onChange, ...props }: IFormInputFieldsWithOptions) => {\r\n const memoizedOptions = useMemo(() => options, [options]);\r\n\r\n return (\r\n <Controller\r\n name={name}\r\n control={control}\r\n defaultValue={defaultValue}\r\n render={({ field, fieldState: { error } }) => {\r\n const { size, ...restProps } = props;\r\n const fieldValue = Array.isArray(field.value) ? field.value : [];\r\n return (\r\n <SelectInputField\r\n {...restProps}\r\n name={name}\r\n label={label}\r\n options={memoizedOptions}\r\n multiple\r\n value={fieldValue}\r\n onChange={(e) => {\r\n field.onChange(e);\r\n onChange?.(e.target.value);\r\n }}\r\n onBlur={field.onBlur}\r\n size={size as any}\r\n error={error}\r\n helperText={error?.message}\r\n />\r\n );\r\n }}\r\n />\r\n );\r\n }\r\n);\r\n\r\nFormInputMultiSelect.displayName = \"FormInputMultiSelect\";\r\n\r\nexport default FormInputMultiSelect;\r\n","\"use client\";\r\nimport React, { memo, useMemo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\n\r\nimport SelectInputField from \"../FormFields/DropdownFields/SelectInputField\";\r\nimport type { IFormInputFieldsWithOptions } from \"./types\";\r\n\r\n/**\r\n * Form Input Select Component\r\n *\r\n * A customizable dropdown selection field built on top of Material UI Select and FormControl,\r\n * integrated with React Hook Form.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a flexible dropdown with support for: single selection,\r\n * error handling, helper text, custom menu item rendering, and standard select behaviors.\r\n * It integrates seamlessly with react-hook-form using the `Controller` component.\r\n *\r\n * @param {string} name - {string} Unique name for form identification\r\n * @param {Control<any>} control - {Control<any>} React Hook Form control object\r\n * @param {string} [label] - {string} Label text for the select field\r\n * @param {any} [defaultValue=''] - {any} Default selected value\r\n * @param {Option[]} options - {Option[]} Array of options to display in dropdown\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {SelectProps['variant']} [variant='outlined'] - {SelectProps['variant']} Select variant\r\n * @param {SelectProps['size']} [size] - {SelectProps['size']} Select size\r\n * @param {SelectProps['color']} [color] - {SelectProps['color']} Select color\r\n * @param {boolean} [fullWidth=true] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {boolean} [multiple=false] - {boolean} Whether to allow multiple selections\r\n * @param {React.ReactNode} [icon] - {React.ReactNode} Custom icon for dropdown indicator\r\n * @param {SelectProps['renderValue']} [renderValue] - {Function} Custom render function for selected value(s)\r\n * @param {Function} [renderMenuItem] - {Function} Custom render function for menu items\r\n * @param {MenuItemProps['sx'] | Function} [menuItemStyles] - {Object|Function} Custom styles for MenuItem\r\n * @param {SelectProps['sx']} [selectStyles] - {SelectProps['sx']} Custom styles for the Select component\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {InputLabelProps['sx']} [labelStyles] - {InputLabelProps['sx']} Custom styles for InputLabel\r\n * @param {(value: any) => void} [onChange] - {Function} Optional additional callback fired when value changes\r\n * @param {Function} [onOpen] - {Function} Callback fired when menu opens\r\n * @param {Function} [onClose] - {Function} Callback fired when menu closes\r\n * @param {Object} [slotProps] - {Object} Custom slot props for MUI v7\r\n * @param {Object} [slots] - {Object} Custom slots for MUI v7\r\n * @param {boolean} [displayEmpty=false] - {boolean} Whether to display empty value\r\n * @param {boolean} [autoWidth=false] - {boolean} Whether the menu should have auto width\r\n * @param {boolean} [native=false] - {boolean} Whether to use native select element\r\n * @param {SelectProps['MenuProps']} [MenuProps] - {Object} Custom Menu props\r\n *\r\n * @returns {JSX.Element} The Form Input Select component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import { FormInputSelect } from \"@react-solutions/inputs\";\r\n * import { useForm } from \"react-hook-form\";\r\n *\r\n * function MyForm() {\r\n * const { control } = useForm();\r\n * const options = [\r\n * { value: \"1\", name: \"Option 1\" },\r\n * { value: \"2\", name: \"Option 2\" }\r\n * ];\r\n *\r\n * return (\r\n * <FormInputSelect\r\n * name=\"category\"\r\n * label=\"Select Category\"\r\n * control={control}\r\n * options={options}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst FormInputSelect = memo(\r\n ({ name, label, control, options = [], defaultValue = \"\", onChange, ...props }: IFormInputFieldsWithOptions) => {\r\n const memoizedOptions = useMemo(() => options, [options]);\r\n\r\n return (\r\n <Controller\r\n name={name}\r\n control={control}\r\n defaultValue={defaultValue}\r\n render={({ field, fieldState: { error } }) => {\r\n const { size, ...restProps } = props;\r\n return (\r\n <SelectInputField\r\n {...restProps}\r\n name={name}\r\n label={label}\r\n options={memoizedOptions}\r\n value={field.value ?? \"\"}\r\n onChange={(e) => {\r\n field.onChange(e);\r\n onChange?.(e.target.value);\r\n }}\r\n onBlur={field.onBlur}\r\n size={size as any}\r\n error={error}\r\n helperText={error?.message}\r\n />\r\n );\r\n }}\r\n />\r\n );\r\n }\r\n);\r\n\r\nFormInputSelect.displayName = \"FormInputSelect\";\r\n\r\nexport default FormInputSelect;\r\n","\"use client\";\r\nimport { Box, FormLabel } from \"@mui/material\";\r\nimport React, { memo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\n\r\nimport DateCalendarField from \"../FormFields/DateFields/DateCalendarField\";\r\nimport type { IFormInputDateFields } from \"./types\";\r\n\r\n/**\r\n * Form Input Date Calendar Component\r\n *\r\n * A customizable inline date calendar field built on top of Material UI X DateCalendar and FormControl,\r\n * integrated with React Hook Form.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides an inline calendar for date selection with support for: error handling, helper text,\r\n * date constraints (min/max), disabling specific dates/months/years, and standard calendar behaviors.\r\n * It integrates seamlessly with react-hook-form using the `Controller` component.\r\n *\r\n * @param {string} name - {string} Unique name for form identification\r\n * @param {Control<any>} control - {Control<any>} React Hook Form control object\r\n * @param {string | React.ReactNode} [label] - {string | React.ReactNode} Label text for the calendar\r\n * @param {Date | null} [defaultValue=null] - {Date | null} Default date value\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {boolean} [fullWidth=false] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {Date} [minDate] - {Date} Minimum selectable date\r\n * @param {Date} [maxDate] - {Date} Maximum selectable date\r\n * @param {(date: Date) => boolean} [shouldDisableDate] - {Function} Function to disable specific dates\r\n * @param {(month: Date) => boolean} [shouldDisableMonth] - {Function} Function to disable specific months\r\n * @param {(year: Date) => boolean} [shouldDisableYear] - {Function} Function to disable specific years\r\n * @param {DateCalendarProps['sx']} [calendarStyles] - {DateCalendarProps['sx']} Custom styles for the DateCalendar component\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {FormLabelProps['sx']} [formLabelStyles] - {FormLabelProps['sx']} Custom styles for FormLabel\r\n * @param {BoxProps['sx']} [containerStyles] - {BoxProps['sx']} Custom styles for the container Box\r\n * @param {(value: Date | null) => void} [onChange] - {Function} Optional additional callback fired when the date changes\r\n * @param {(view: 'day' | 'month' | 'year') => void} [onViewChange] - {Function} Callback fired when a view change is requested\r\n * @param {(month: Date) => void} [onMonthChange] - {Function} Callback fired when a month change is requested\r\n * @param {(year: Date) => void} [onYearChange] - {Function} Callback fired when a year change is requested\r\n * @param {Object} [slotProps] - {Object} Custom slot props for MUI X v7\r\n * @param {Object} [slots] - {Object} Custom slots for MUI X v7\r\n * @param {typeof AdapterDateFns} [dateAdapter=AdapterDateFns] - {Type} Date adapter to use\r\n * @param {boolean} [showDaysOutsideCurrentMonth=false] - {boolean} Whether to show days outside current month\r\n * @param {boolean} [disablePast=false] - {boolean} Whether to disable past dates\r\n * @param {boolean} [disableFuture=false] - {boolean} Whether to disable future dates\r\n * @param {Date} [referenceDate] - {Date} Reference date for the calendar\r\n * @param {'day' | 'month' | 'year'} [view] - {'day' | 'month' | 'year'} Controlled view state\r\n *\r\n * @returns {JSX.Element} The Form Input Date Calendar component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import { FormInputCalendar } from \"@react-solutions/inputs\";\r\n * import { useForm } from \"react-hook-form\";\r\n *\r\n * function MyForm() {\r\n * const { control } = useForm();\r\n *\r\n * return (\r\n * <FormInputCalendar\r\n * name=\"myCalendar\"\r\n * label=\"Select Date\"\r\n * control={control}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\n\r\nconst FormInputCalendar = memo(\r\n ({ name, label, control, readOnly, disabled, defaultValue = null, onChange, ...props }: IFormInputDateFields) => {\r\n return (\r\n <Box\r\n sx={{\r\n border: (t) => `1px solid ${t.palette.grey[600]}`,\r\n borderRadius: (t) => t.spacing(0.5),\r\n display: \"flex\",\r\n flexDirection: \"column\"\r\n }}\r\n >\r\n <FormLabel\r\n sx={(t) => ({\r\n borderBottom: `1px solid ${t.palette.grey[600]}`,\r\n padding: \"4px\"\r\n })}\r\n >\r\n {label}\r\n </FormLabel>\r\n <Controller\r\n name={name}\r\n control={control}\r\n defaultValue={defaultValue}\r\n render={({ field, fieldState: { error } }) => {\r\n const { ...restProps } = props;\r\n return (\r\n <DateCalendarField\r\n {...restProps}\r\n name={name}\r\n value={field.value ?? null}\r\n onChange={(newValue) => {\r\n field.onChange(newValue);\r\n onChange?.(newValue);\r\n }}\r\n disabled={disabled}\r\n readOnly={readOnly}\r\n error={error}\r\n helperText={error?.message}\r\n sx={{\r\n height: \"300px\",\r\n ...restProps.sx\r\n }}\r\n />\r\n );\r\n }}\r\n />\r\n </Box>\r\n );\r\n }\r\n);\r\n\r\nFormInputCalendar.displayName = \"FormInputCalendar\";\r\n\r\nexport default FormInputCalendar;\r\n","\"use client\";\r\nimport type { TextFieldProps } from \"@mui/material\";\r\nimport React, { memo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\n\r\nimport DatePickerField from \"../FormFields/DateFields/DatePickerField\";\r\nimport type { IFormInputDateFields } from \"./types\";\r\n\r\n/**\r\n * Form Input Date Picker Component\r\n *\r\n * A customizable date picker field built on top of Material UI X DatePicker and FormControl,\r\n * integrated with React Hook Form.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a flexible date picker with support for: error handling, helper text, clear button,\r\n * custom formatting, date constraints (min/max), and standard date picker behaviors.\r\n * It integrates seamlessly with react-hook-form using the `Controller` component.\r\n *\r\n * @param {string} name - {string} Unique name for form identification\r\n * @param {Control<any>} control - {Control<any>} React Hook Form control object\r\n * @param {string | React.ReactNode} [label] - {string | React.ReactNode} Label text for the date picker\r\n * @param {boolean} [title=false] - {boolean} Whether to show label as a separate title above the picker\r\n * @param {Date | null} [defaultValue=null] - {Date | null} Default date value\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {boolean} [fullWidth=true] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {Date} [minDate] - {Date} Minimum selectable date\r\n * @param {Date} [maxDate] - {Date} Maximum selectable date\r\n * @param {(date: Date) => boolean} [shouldDisableDate] - {Function} Function to disable specific dates\r\n * @param {(month: Date) => boolean} [shouldDisableMonth] - {Function} Function to disable specific months\r\n * @param {(year: Date) => boolean} [shouldDisableYear] - {Function} Function to disable specific years\r\n * @param {TextFieldProps['size']} [size='medium'] - {TextFieldProps['size']} TextField size\r\n * @param {TextFieldProps['variant']} [variant='outlined'] - {TextFieldProps['variant']} TextField variant\r\n * @param {TextFieldProps['color']} [color='primary'] - {TextFieldProps['color']} TextField color\r\n * @param {string} [placeholder] - {string} Placeholder text\r\n * @param {boolean} [readOnly=false] - {boolean} Whether the field is read-only\r\n * @param {boolean} [showClearButton=true] - {boolean} Whether to show clear button\r\n * @param {boolean} [disablePast=false] - {boolean} Whether to disable past dates\r\n * @param {boolean} [disableFuture=false] - {boolean} Whether to disable future dates\r\n * @param {Date} [referenceDate] - {Date} Reference date for the calendar\r\n * @param {'day' | 'month' | 'year'} [view] - {'day' | 'month' | 'year'} Controlled view state\r\n * @param {string} [format] - {string} Format for displaying the date\r\n * @param {'day' | 'month' | 'year'} [openTo='day'] - {string} Whether to open the calendar on focus\r\n * @param {DatePickerProps['sx']} [pickerStyles] - {DatePickerProps['sx']} Custom styles for the DatePicker component\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {FormLabelProps['sx']} [formLabelStyles] - {FormLabelProps['sx']} Custom styles for FormLabel\r\n * @param {BoxProps['sx']} [containerStyles] - {BoxProps['sx']} Custom styles for the container Box\r\n * @param {TextFieldProps['sx']} [textFieldStyles] - {TextFieldProps['sx']} Custom styles for the internal TextField\r\n * @param {(value: Date | null) => void} [onChange] - {Function} Optional additional callback fired when value changes\r\n * @param {(event: React.FocusEvent<HTMLInputElement>) => void} [onFocus] - {Function} Callback when field receives focus\r\n * @param {(event: React.FocusEvent<HTMLInputElement>) => void} [onBlur] - {Function} Callback when field loses focus\r\n * @param {Function} [onViewChange] - {Function} Callback fired when a view change is requested\r\n * @param {Function} [onMonthChange] - {Function} Callback fired when a month change is requested\r\n * @param {Function} [onYearChange] - {Function} Callback fired when a year change is requested\r\n * @param {Function} [onOpen] - {Function} Callback fired when the calendar opens\r\n * @param {Function} [onClose] - {Function} Callback fired when the calendar closes\r\n * @param {Object} [slotProps] - {Object} Custom slot props for MUI X v7\r\n * @param {Object} [slots] - {Object} Custom slots for MUI X v7\r\n * @param {typeof AdapterDateFns} [dateAdapter=AdapterDateFns] - {Type} Date adapter to use\r\n * @param {boolean} [reduceAnimations=false] - {boolean} Whether to reduce animations\r\n * @param {boolean} [autoFocus=false] - {boolean} Auto focus the input\r\n *\r\n * @returns {JSX.Element} The Form Input Date Picker component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import { FormInputDatePicker } from \"@react-solutions/inputs\";\r\n * import { useForm } from \"react-hook-form\";\r\n *\r\n * function MyForm() {\r\n * const { control } = useForm();\r\n *\r\n * return (\r\n * <FormInputDatePicker\r\n * name=\"birthday\"\r\n * label=\"Birthday\"\r\n * control={control}\r\n * showClearButton\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst FormInputDatePicker = memo(\r\n ({\r\n name,\r\n label,\r\n control,\r\n size,\r\n readOnly,\r\n shouldDisableDate,\r\n disabled,\r\n placeholder,\r\n defaultValue = null,\r\n onChange,\r\n ...props\r\n }: IFormInputDateFields) => {\r\n return (\r\n <Controller\r\n name={name}\r\n control={control}\r\n defaultValue={defaultValue}\r\n render={({ field, fieldState: { error } }) => {\r\n // Exclude views prop as DatePicker uses DateView[], not TimeView[]\r\n const { views: _views, ...restProps } = props;\r\n return (\r\n <DatePickerField\r\n {...restProps}\r\n name={name}\r\n label={label}\r\n placeholder={placeholder}\r\n disabled={disabled}\r\n value={field.value ?? null}\r\n onChange={(newValue) => {\r\n field.onChange(newValue);\r\n onChange?.(newValue);\r\n }}\r\n onBlur={field.onBlur}\r\n shouldDisableDate={shouldDisableDate}\r\n size={size as TextFieldProps[\"size\"]}\r\n error={error}\r\n helperText={error?.message}\r\n readOnly={readOnly}\r\n />\r\n );\r\n }}\r\n />\r\n );\r\n }\r\n);\r\n\r\nFormInputDatePicker.displayName = \"FormInputDatePicker\";\r\n\r\nexport default FormInputDatePicker;\r\n","\"use client\";\r\nimport { Box, FormLabel } from \"@mui/material\";\r\nimport React, { memo, useMemo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\n\r\nimport TimeClockField from \"../FormFields/DateFields/TimeClockField\";\r\nimport type { IFormInputDateFields } from \"./types\";\r\n\r\n/**\r\n * Form Input Time Clock Component\r\n *\r\n * A customizable inline time clock field built on top of Material UI X TimeClock and FormControl,\r\n * integrated with React Hook Form.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides an inline clock for time selection with support for: error handling, helper text,\r\n * AM/PM support, time constraints (min/max), and standard clock behaviors.\r\n * It integrates seamlessly with react-hook-form using the `Controller` component.\r\n *\r\n * @param {string} name - {string} Unique name for form identification\r\n * @param {Control<any>} control - {Control<any>} React Hook Form control object\r\n * @param {string | React.ReactNode} [label] - {string | React.ReactNode} Label text for the time clock\r\n * @param {Date | null} [defaultValue=null] - {Date | null} Default time value\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {boolean} [fullWidth=false] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {string[]} [views=['hours', 'minutes']] - {string[]} Available views (hours, minutes, seconds)\r\n * @param {boolean} [ampmInClock=false] - {boolean} Whether to show AM/PM in the clock\r\n * @param {boolean} [ampm=true] - {boolean} Whether to use 12-hour format\r\n * @param {boolean} [disablePast=false] - {boolean} Whether to disable past times\r\n * @param {boolean} [disableFuture=false] - {boolean} Whether to disable future times\r\n * @param {Date} [minTime] - {Date} Minimum selectable time\r\n * @param {Date} [maxTime] - {Date} Maximum selectable time\r\n * @param {Function} [shouldDisableTime] - {Function} Function to disable specific times\r\n * @param {TimeClockProps['sx']} [clockStyles] - {TimeClockProps['sx']} Custom styles for the TimeClock component\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {FormLabelProps['sx']} [formLabelStyles] - {FormLabelProps['sx']} Custom styles for FormLabel\r\n * @param {BoxProps['sx']} [containerStyles] - {BoxProps['sx']} Custom styles for the container Box\r\n * @param {StackProps['sx']} [buttonsStackStyles] - {StackProps['sx']} Custom styles for the view buttons Stack\r\n * @param {ButtonProps['sx']} [buttonStyles] - {ButtonProps['sx']} Custom styles for view buttons\r\n * @param {ButtonProps['sx']} [activeButtonStyles] - {ButtonProps['sx']} Custom styles for active view button\r\n * @param {boolean} [showViewButtons=true] - {boolean} Whether to show view selector buttons\r\n * @param {string} [initialView='hours'] - {string} Initial view\r\n * @param {string} [view] - {string} Controlled view state\r\n * @param {(value: Date | null) => void} [onChange] - {Function} Optional additional callback fired when value changes\r\n * @param {Function} [onViewChange] - {Function} Callback fired when a view change is requested\r\n * @param {Object} [slotProps] - {Object} Custom slot props for MUI X v7\r\n * @param {Object} [slots] - {Object} Custom slots for MUI X v7\r\n * @param {any} [dateAdapter] - {any} Date adapter to use\r\n * @param {boolean} [autoFocus=false] - {boolean} Auto focus\r\n *\r\n * @returns {JSX.Element} The Form Input Time Clock component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import { FormInputTimeClock } from \"@react-solutions/inputs\";\r\n * import { useForm } from \"react-hook-form\";\r\n *\r\n * function MyForm() {\r\n * const { control } = useForm();\r\n *\r\n * return (\r\n * <FormInputTimeClock\r\n * name=\"shiftStart\"\r\n * label=\"Shift Start Time\"\r\n * control={control}\r\n * ampm={true}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\n\r\nconst FormInputTimeClock = memo(\r\n ({\r\n name,\r\n label,\r\n control,\r\n readOnly,\r\n disabled,\r\n ampm = true,\r\n views,\r\n ampmInClock = true,\r\n disablePast = false,\r\n defaultValue = null,\r\n onChange,\r\n ...props\r\n }: IFormInputDateFields) => {\r\n const ampmValue = useMemo(() => (typeof ampm === \"boolean\" ? ampm : undefined), [ampm]);\r\n\r\n return (\r\n <Box\r\n sx={{\r\n border: (t) => `1px solid ${t.palette.grey[600]}`,\r\n borderRadius: (t) => t.spacing(0.5),\r\n display: \"flex\",\r\n flexDirection: \"column\"\r\n }}\r\n >\r\n <FormLabel\r\n sx={(t) => ({\r\n borderBottom: `1px solid ${t.palette.grey[600]}`,\r\n padding: (t) => t.spacing(1)\r\n })}\r\n >\r\n {label}\r\n </FormLabel>\r\n <Controller\r\n name={name}\r\n control={control}\r\n defaultValue={defaultValue}\r\n render={({ field, fieldState: { error } }) => (\r\n <TimeClockField\r\n {...props}\r\n name={name}\r\n value={field.value ?? null}\r\n onChange={(newValue) => {\r\n field.onChange(newValue);\r\n onChange?.(newValue);\r\n }}\r\n ampm={ampmValue}\r\n disabled={disabled}\r\n readOnly={readOnly}\r\n ampmInClock={ampmInClock}\r\n disablePast={disablePast}\r\n views={views}\r\n error={error}\r\n helperText={error?.message}\r\n />\r\n )}\r\n />\r\n </Box>\r\n );\r\n }\r\n);\r\n\r\nFormInputTimeClock.displayName = \"FormInputTimeClock\";\r\n\r\nexport default FormInputTimeClock;\r\n","\"use client\";\r\nimport React, { memo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\n\r\nimport TimePickerField from \"../FormFields/DateFields/TimePickerField\";\r\nimport type { IFormInputDateFields } from \"./types\";\r\n\r\n/**\r\n * Form Input Time Picker Component\r\n *\r\n * A customizable time picker field built on top of Material UI X TimePicker and FormControl,\r\n * integrated with React Hook Form.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a flexible time picker with support for: error handling, helper text, clear button,\r\n * AM/PM support, time constraints (min/max), and standard time picker behaviors.\r\n * It integrates seamlessly with react-hook-form using the `Controller` component.\r\n *\r\n * @param {string} name - {string} Unique name for form identification\r\n * @param {Control<any>} control - {Control<any>} React Hook Form control object\r\n * @param {string | React.ReactNode} [label] - {string | React.ReactNode} Label text for the time picker\r\n * @param {Date | null} [defaultValue=null] - {Date | null} Default time value\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {boolean} [fullWidth=true] - {boolean} Whether the field should take full width\r\n * @param {boolean} [title=false] - {boolean} Whether to show label as a separate title above the picker\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {Date} [minTime] - {Date} Minimum selectable time\r\n * @param {Date} [maxTime] - {Date} Maximum selectable time\r\n * @param {(time: Date, view: string) => boolean} [shouldDisableTime] - {Function} Function to disable specific times\r\n * @param {TextFieldProps['size']} [size='medium'] - {TextFieldProps['size']} TextField size\r\n * @param {TextFieldProps['variant']} [variant='outlined'] - {TextFieldProps['variant']} TextField variant\r\n * @param {TextFieldProps['color']} [color='primary'] - {TextFieldProps['color']} TextField color\r\n * @param {string} [placeholder] - {string} Placeholder text\r\n * @param {boolean} [readOnly=false] - {boolean} Whether the field is read-only\r\n * @param {boolean} [showClearButton=true] - {boolean} Whether to show clear button\r\n * @param {boolean} [disablePast=false] - {boolean} Whether to disable past times\r\n * @param {boolean} [disableFuture=false] - {boolean} Whether to disable future times\r\n * @param {boolean} [ampm=true] - {boolean} Whether to use 12-hour format\r\n * @param {string[]} [views] - {string[]} Available views (hours, minutes, seconds)\r\n * @param {string} [view] - {string} Controlled view state\r\n * @param {string} [openTo='hours'] - {string} Default view to open\r\n * @param {string} [format] - {string} Format for displaying the time\r\n * @param {TimePickerProps['sx']} [pickerStyles] - {TimePickerProps['sx']} Custom styles for the TimePicker component\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {FormLabelProps['sx']} [formLabelStyles] - {FormLabelProps['sx']} Custom styles for FormLabel\r\n * @param {BoxProps['sx']} [containerStyles] - {BoxProps['sx']} Custom styles for the container Box\r\n * @param {TextFieldProps['sx']} [textFieldStyles] - {TextFieldProps['sx']} Custom styles for the internal TextField\r\n * @param {(value: Date | null) => void} [onChange] - {Function} Optional additional callback fired when value changes\r\n * @param {(event: React.FocusEvent<HTMLInputElement>) => void} [onFocus] - {Function} Callback when field receives focus\r\n * @param {(event: React.FocusEvent<HTMLInputElement>) => void} [onBlur] - {Function} Callback when field loses focus\r\n * @param {Function} [onViewChange] - {Function} Callback fired when a view change is requested\r\n * @param {Function} [onOpen] - {Function} Callback fired when the picker opens\r\n * @param {Function} [onClose] - {Function} Callback fired when the picker closes\r\n * @param {Object} [slotProps] - {Object} Custom slot props for MUI X v7\r\n * @param {Object} [slots] - {Object} Custom slots for MUI X v7\r\n * @param {any} [dateAdapter] - {any} Date adapter to use\r\n * @param {boolean} [autoFocus=false] - {boolean} Auto focus the input\r\n * @param {string} [timezone] - {string} Timezone for the picker\r\n *\r\n * @returns {JSX.Element} The Form Input Time Picker component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import { FormInputTimePicker } from \"@react-solutions/inputs\";\r\n * import { useForm } from \"react-hook-form\";\r\n *\r\n * function MyForm() {\r\n * const { control } = useForm();\r\n *\r\n * return (\r\n * <FormInputTimePicker\r\n * name=\"appointmentTime\"\r\n * label=\"Select Time\"\r\n * control={control}\r\n * ampm={true}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst FormInputTimePicker = memo(\r\n ({ name, label, control, ampm = true, timezone, defaultValue = null, onChange, ...props }: IFormInputDateFields) => {\r\n return (\r\n <Controller\r\n name={name}\r\n control={control}\r\n defaultValue={defaultValue}\r\n render={({ field, fieldState: { error } }) => {\r\n const { size, ...restProps } = props;\r\n return (\r\n <TimePickerField\r\n {...restProps}\r\n name={name}\r\n label={label}\r\n value={field.value ?? null}\r\n onChange={(newValue) => {\r\n field.onChange(newValue);\r\n onChange?.(newValue);\r\n }}\r\n onBlur={field.onBlur}\r\n ampm={ampm}\r\n timezone={timezone}\r\n size={size as any}\r\n error={error}\r\n helperText={error?.message}\r\n />\r\n );\r\n }}\r\n />\r\n );\r\n }\r\n);\r\n\r\nFormInputTimePicker.displayName = \"FormInputTimePicker\";\r\n\r\nexport default FormInputTimePicker;\r\n","\"use client\";\r\nimport React, { memo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\n\r\nimport CheckBoxField from \"../FormFields/BoxFields/CheckBoxField\";\r\nimport type { IFormInputFields } from \"./types\";\r\n\r\n/**\r\n * Form Input CheckBox Component\r\n *\r\n * A customizable checkbox field built on top of Material UI Checkbox and FormControl,\r\n * integrated with React Hook Form.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a flexible checkbox with support for: error handling, helper text, custom icons,\r\n * styling overrides, label placement, and standard checkbox behaviors.\r\n * It integrates seamlessly with react-hook-form using the `Controller` component.\r\n *\r\n * @param {string} name - {string} Unique name for form identification\r\n * @param {Control<any>} control - {Control<any>} React Hook Form control object\r\n * @param {string | React.ReactNode} [label] - {string | React.ReactNode} Label text for the checkbox\r\n * @param {boolean} [defaultValue=false] - {boolean} Default checked state\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {'primary'|'secondary'|'success'|'error'|'info'|'warning'} [color='primary'] - {'primary'|'secondary'|'success'|'error'|'info'|'warning'} Checkbox color\r\n * @param {'small'|'medium'|'large'} [size] - {'small'|'medium'|'large'} Checkbox size\r\n * @param {boolean} [fullWidth=false] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {'start'|'end'} [labelPlacement='end'] - {'start'|'end'} Label placement relative to checkbox\r\n * @param {(checked: boolean) => void} [onChange] - {Function} Optional additional callback fired when value changes\r\n * @param {(event: React.MouseEvent<HTMLButtonElement>) => void} [onClick] - {Function} Callback fired when clicked\r\n * @param {React.FocusEventHandler<HTMLButtonElement>} [onFocus] - {Function} Callback when focused\r\n * @param {React.FocusEventHandler<HTMLButtonElement>} [onBlur] - {Function} Callback when blurred\r\n * @param {React.ReactNode} [checkedIcon] - {React.ReactNode} Custom icon for checked state\r\n * @param {React.ReactNode} [icon] - {React.ReactNode} Custom icon for unchecked state\r\n * @param {React.CSSProperties} [checkboxStyles] - {React.CSSProperties} Custom styles for Checkbox component\r\n * @param {React.CSSProperties} [labelStyles] - {React.CSSProperties} Custom styles for FormControlLabel\r\n * @param {React.CSSProperties} [formControlStyles] - {React.CSSProperties} Custom styles for FormControl container\r\n * @param {boolean} [indeterminate=false] - {boolean} Indeterminate state\r\n * @param {Object} [slotProps] - {Object} Custom slot props\r\n * @param {Object} [slots] - {Object} Custom slots\r\n *\r\n * @returns {JSX.Element} The Form Input CheckBox component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import { FormInputCheckBox } from \"@react-solutions/inputs\";\r\n * import { useForm } from \"react-hook-form\";\r\n *\r\n * function MyForm() {\r\n * const { control } = useForm();\r\n *\r\n * return (\r\n * <FormInputCheckBox\r\n * name=\"agreeTerms\"\r\n * label=\"I agree to terms\"\r\n * control={control}\r\n * required\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\n\r\nconst FormInputCheckBox = memo(\r\n ({ name, label, control, defaultValue = false, onChange, ...props }: IFormInputFields) => {\r\n return (\r\n <Controller\r\n name={name}\r\n control={control}\r\n defaultValue={defaultValue}\r\n render={({ field, fieldState: { error } }) => {\r\n const { size, ...restProps } = props;\r\n return (\r\n <CheckBoxField\r\n {...restProps}\r\n name={name}\r\n label={label}\r\n value={field.value ?? false}\r\n onChange={(checked) => {\r\n field.onChange(checked);\r\n onChange?.(checked);\r\n }}\r\n onBlur={field.onBlur}\r\n size={size as any}\r\n error={error}\r\n helperText={error?.message}\r\n />\r\n );\r\n }}\r\n />\r\n );\r\n }\r\n);\r\n\r\nFormInputCheckBox.displayName = \"FormInputCheckBox\";\r\n\r\nexport default FormInputCheckBox;\r\n","\"use client\";\r\nimport React, { memo, useMemo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\n\r\nimport CheckBoxFieldGroup from \"../FormFields/BoxFields/CheckBoxFieldGroup\";\r\nimport type { IFormInputCheckBoxGroupFields } from \"./types\";\r\n\r\n/**\r\n * Form Input CheckBox Group Component\r\n *\r\n * A customizable group of checkboxes built on top of Material UI Checkbox and FormControl,\r\n * integrated with React Hook Form.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a group of flexible checkboxes with support for: error handling, helper text, custom icons,\r\n * styling overrides, label placement, row/column layout, and standard checkbox behaviors.\r\n * It integrates seamlessly with react-hook-form using the `Controller` component.\r\n *\r\n * @param {string} name - {string} Unique name for form identification\r\n * @param {Control<any>} control - {Control<any>} React Hook Form control object\r\n * @param {string | React.ReactNode} [label] - {string | React.ReactNode} Label text for the checkbox group\r\n * @param {any[]} [defaultValue=[]] - {any[]} Default selected values\r\n * @param {Option[]} options - {Option[]} Array of checkbox options\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {boolean} [fullWidth=true] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {'primary'|'secondary'|'success'|'error'|'info'|'warning'} [color='primary'] - {'primary'|'secondary'|'success'|'error'|'info'|'warning'} Checkbox color\r\n * @param {'small'|'medium'|'large'} [size] - {'small'|'medium'|'large'} Checkbox size\r\n * @param {'start'|'end'} [labelPlacement='end'] - {'start'|'end'} Label placement relative to checkbox\r\n * @param {boolean} [row=false] - {boolean} Whether to display checkboxes in a row\r\n * @param {React.ReactNode} [checkedIcon] - {React.ReactNode} Custom icon for checked state\r\n * @param {React.ReactNode} [icon] - {React.ReactNode} Custom icon for unchecked state\r\n * @param {SxProps<Theme>} [checkboxStyles] - {SxProps<Theme>} Custom styles for individual checkboxes\r\n * @param {SxProps<Theme>} [labelStyles] - {SxProps<Theme>} Custom styles for checkbox labels\r\n * @param {SxProps<Theme>} [formControlStyles] - {SxProps<Theme>} Custom styles for FormControl container\r\n * @param {SxProps<Theme>} [formLabelStyles] - {SxProps<Theme>} Custom styles for FormLabel\r\n * @param {(value: any[]) => void} [onChange] - {Function} Optional additional callback fired when value changes\r\n * @param {Function} [onFocus] - {Function} Callback when focused\r\n * @param {Function} [onBlur] - {Function} Callback when blurred\r\n * @param {Function} [onClick] - {Function} Callback when clicked\r\n * @param {Function} [renderCheckbox] - {Function} Custom render function for checkboxes\r\n * @param {Object} [slotProps] - {Object} Custom slot props\r\n * @param {Object} [slots] - {Object} Custom slots\r\n * @param {SxProps<Theme>} [sxProps] - {SxProps<Theme>} Custom styles for the Box container\r\n *\r\n * @returns {JSX.Element} The Form Input CheckBox Group component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import { FormInputCheckBoxGroup } from \"@react-solutions/inputs\";\r\n * import { useForm } from \"react-hook-form\";\r\n *\r\n * function MyForm() {\r\n * const { control } = useForm();\r\n * const options = [\r\n * { value: \"opt1\", name: \"Option 1\" },\r\n * { value: \"opt2\", name: \"Option 2\" }\r\n * ];\r\n *\r\n * return (\r\n * <FormInputCheckBoxGroup\r\n * name=\"myCheckGroup\"\r\n * label=\"Select options\"\r\n * control={control}\r\n * options={options}\r\n * row\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\n\r\nconst FormInputCheckBoxGroup = memo(\r\n ({\r\n name,\r\n label,\r\n control,\r\n options = [],\r\n defaultValue = [],\r\n onChange,\r\n row,\r\n color,\r\n labelPlacement,\r\n ...props\r\n }: IFormInputCheckBoxGroupFields) => {\r\n // Convert options to CheckboxOption format - memoized\r\n const checkboxOptions = useMemo(\r\n () =>\r\n options.map((option) => ({\r\n value: option.value,\r\n label: option.name,\r\n disabled: option.disabled\r\n })),\r\n [options]\r\n );\r\n\r\n return (\r\n <Controller\r\n name={name}\r\n control={control}\r\n defaultValue={defaultValue}\r\n render={({ field, fieldState: { error } }) => {\r\n const { size, ...restProps } = props;\r\n const fieldValue = Array.isArray(field.value) ? field.value : [];\r\n return (\r\n <CheckBoxFieldGroup\r\n {...restProps}\r\n name={name}\r\n label={label}\r\n value={fieldValue}\r\n options={checkboxOptions}\r\n onChange={(value) => {\r\n field.onChange(value);\r\n onChange?.(value);\r\n }}\r\n onBlur={field.onBlur}\r\n row={row}\r\n color={color}\r\n labelPlacement={labelPlacement}\r\n size={size as any}\r\n error={error}\r\n helperText={error?.message}\r\n />\r\n );\r\n }}\r\n />\r\n );\r\n }\r\n);\r\n\r\nFormInputCheckBoxGroup.displayName = \"FormInputCheckBoxGroup\";\r\n\r\nexport default FormInputCheckBoxGroup;\r\n","\"use client\";\r\nimport React, { memo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\n\r\nimport RadioButtonField from \"../FormFields/BoxFields/RadioButtonField\";\r\nimport type { IFormInputRadioFields } from \"./types\";\r\n\r\n/**\r\n * Form Input Radio Button Component\r\n *\r\n * A customizable radio button field built on top of Material UI Radio and FormControl,\r\n * integrated with React Hook Form.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a flexible radio button with support for: error handling, helper text, custom icons,\r\n * styling overrides, label placement, and standard radio behaviors.\r\n * It integrates seamlessly with react-hook-form using the `Controller` component.\r\n *\r\n * @param {string} name - {string} Unique name for form identification\r\n * @param {Control<any>} control - {Control<any>} React Hook Form control object\r\n * @param {string | React.ReactNode} [label] - {string | React.ReactNode} Label text for the radio button\r\n * @param {boolean} [defaultValue=false] - {boolean} Default checked state\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {'primary'|'secondary'|'success'|'error'|'info'|'warning'} [color='primary'] - {'primary'|'secondary'|'success'|'error'|'info'|'warning'} Radio color\r\n * @param {'small'|'medium'|'large'} [size] - {'small'|'medium'|'large'} Radio size\r\n * @param {boolean} [fullWidth=false] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {'start'|'end'} [labelPlacement='end'] - {'start'|'end'} Label placement relative to radio button\r\n * @param {(checked: boolean) => void} [onChange] - {Function} Optional additional callback fired when value changes\r\n * @param {(event: React.MouseEvent<HTMLButtonElement>) => void} [onClick] - {Function} Callback fired when clicked\r\n * @param {React.FocusEventHandler<HTMLButtonElement>} [onFocus] - {Function} Callback when focused\r\n * @param {React.FocusEventHandler<HTMLButtonElement>} [onBlur] - {Function} Callback when blurred\r\n * @param {React.ReactNode} [checkedIcon] - {React.ReactNode} Custom icon for checked state\r\n * @param {React.ReactNode} [icon] - {React.ReactNode} Custom icon for unchecked state\r\n * @param {React.CSSProperties} [radioStyles] - {React.CSSProperties} Custom styles for Radio component\r\n * @param {React.CSSProperties} [labelStyles] - {React.CSSProperties} Custom styles for FormControlLabel\r\n * @param {React.CSSProperties} [formControlStyles] - {React.CSSProperties} Custom styles for FormControl container\r\n * @param {Object} [slotProps] - {Object} Custom slot props\r\n * @param {Object} [slots] - {Object} Custom slots\r\n *\r\n * @returns {JSX.Element} The Form Input Radio Button component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import { FormInputRadioButton } from \"@react-solutions/inputs\";\r\n * import { useForm } from \"react-hook-form\";\r\n *\r\n * function MyForm() {\r\n * const { control } = useForm();\r\n *\r\n * return (\r\n * <FormInputRadioButton\r\n * name=\"option1\"\r\n * label=\"Option 1\"\r\n * control={control}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\n\r\nconst FormInputRadioButton = memo(\r\n ({\r\n name,\r\n label,\r\n control,\r\n // checked = false,\r\n defaultValue = false,\r\n onChange,\r\n color,\r\n labelPlacement,\r\n ...props\r\n }: IFormInputRadioFields) => {\r\n return (\r\n <Controller\r\n name={name}\r\n control={control}\r\n defaultValue={defaultValue}\r\n render={({ field, fieldState: { error } }) => {\r\n const { size, ...restProps } = props;\r\n return (\r\n <RadioButtonField\r\n {...restProps}\r\n name={name}\r\n label={label}\r\n value={field.value ?? false}\r\n onChange={(checkedValue) => {\r\n field.onChange(checkedValue);\r\n onChange?.(checkedValue);\r\n }}\r\n onBlur={field.onBlur}\r\n color={color}\r\n labelPlacement={labelPlacement}\r\n size={size as any}\r\n error={error}\r\n helperText={error?.message}\r\n />\r\n );\r\n }}\r\n />\r\n );\r\n }\r\n);\r\n\r\nFormInputRadioButton.displayName = \"FormInputRadioButton\";\r\n\r\nexport default FormInputRadioButton;\r\n","\"use client\";\r\nimport React, { memo, useMemo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\n\r\nimport RadioButtonFieldGroup from \"../FormFields/BoxFields/RadioButtonFieldGroup\";\r\nimport type { IFormInputFieldsWithOptions } from \"./types\";\r\n\r\n/**\r\n * Form Input Radio Button Group Component\r\n *\r\n * A customizable group of radio buttons built on top of Material UI RadioGroup and FormControl,\r\n * integrated with React Hook Form.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a group of flexible radio buttons with support for: error handling, helper text, custom icons,\r\n * styling overrides, label placement, row/column layout, and standard radio behaviors.\r\n * It integrates seamlessly with react-hook-form using the `Controller` component.\r\n *\r\n * @param {string} name - {string} Unique name for form identification\r\n * @param {Control<any>} control - {Control<any>} React Hook Form control object\r\n * @param {string | React.ReactNode} [label] - {string | React.ReactNode} Label text for the radio group\r\n * @param {any} [defaultValue=\"\"] - {any} Default selected value\r\n * @param {Option[]} options - {Option[]} Array of radio options\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {'primary'|'secondary'|'success'|'error'|'info'|'warning'} [color='primary'] - {'primary'|'secondary'|'success'|'error'|'info'|'warning'} Radio color\r\n * @param {'small'|'medium'|'large'} [size] - {'small'|'medium'|'large'} Radio size\r\n * @param {boolean} [fullWidth=false] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {'start'|'end'} [labelPlacement='end'] - {'start'|'end'} Label placement relative to each radio button\r\n * @param {boolean} [row=false] - {boolean} Row layout (horizontal) or column layout (vertical)\r\n * @param {React.ReactNode} [checkedIcon] - {React.ReactNode} Custom icon for checked state\r\n * @param {React.ReactNode} [icon] - {React.ReactNode} Custom icon for unchecked state\r\n * @param {RadioProps[\"sx\"]} [radioStyles] - {RadioProps[\"sx\"]} Custom styles for individual Radio components\r\n * @param {FormControlLabelProps[\"sx\"]} [labelStyles] - {FormControlLabelProps[\"sx\"]} Custom styles for FormControlLabel components\r\n * @param {FormControlProps[\"sx\"]} [formControlStyles] - {FormControlProps[\"sx\"]} Custom styles for FormControl\r\n * @param {FormLabelProps[\"sx\"]} [formLabelStyles] - {FormLabelProps[\"sx\"]} Custom styles for FormLabel\r\n * @param {RadioGroupProps[\"sx\"]} [radioGroupStyles] - {RadioGroupProps[\"sx\"]} Custom styles for RadioGroup\r\n * @param {(value: any) => void} [onChange] - {Function} Optional additional callback fired when value changes\r\n * @param {(event: React.MouseEvent<HTMLButtonElement>) => void} [onClick] - {Function} Callback fired when a radio button is clicked\r\n * @param {RadioProps[\"onFocus\"]} [onFocus] - {RadioProps[\"onFocus\"]} Callback when focused\r\n * @param {RadioProps[\"onBlur\"]} [onBlur] - {RadioProps[\"onBlur\"]} Callback when blurred\r\n * @param {(option: Option, index: number) => React.ReactNode} [renderRadio] - {Function} Custom render function for radio buttons\r\n * @param {Object} [slotProps] - {Object} Custom slot props\r\n * @param {Object} [slots] - {Object} Custom slots\r\n * @param {SxProps<Theme>} [sxProps] - {SxProps<Theme>} Custom styles for RadioGroup container\r\n *\r\n * @returns {JSX.Element} The Form Input Radio Button Group component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import { FormInputRadioButtonGroup } from \"@react-solutions/inputs\";\r\n * import { useForm } from \"react-hook-form\";\r\n *\r\n * function MyForm() {\r\n * const { control } = useForm();\r\n * const options = [\r\n * { name: \"Option 1\", value: \"opt1\" },\r\n * { name: \"Option 2\", value: \"opt2\" }\r\n * ];\r\n *\r\n * return (\r\n * <FormInputRadioButtonGroup\r\n * name=\"choice\"\r\n * label=\"Select an option\"\r\n * control={control}\r\n * options={options}\r\n * row\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst FormInputRadioButtonGroup = memo(\r\n ({ name, label, control, options = [], defaultValue = \"\", onChange, ...props }: IFormInputFieldsWithOptions) => {\r\n const memoizedOptions = useMemo(() => (Array.isArray(options) ? options : []), [options]);\r\n\r\n return (\r\n <Controller\r\n name={name}\r\n control={control}\r\n defaultValue={defaultValue}\r\n render={({ field, fieldState: { error } }) => {\r\n const { size, ...restProps } = props;\r\n return (\r\n <RadioButtonFieldGroup\r\n {...restProps}\r\n name={name}\r\n label={label}\r\n value={field.value ?? \"\"}\r\n onChange={(value) => {\r\n field.onChange(value);\r\n onChange?.(value);\r\n }}\r\n onBlur={field.onBlur}\r\n options={memoizedOptions}\r\n size={size as any}\r\n error={error}\r\n helperText={error?.message}\r\n />\r\n );\r\n }}\r\n />\r\n );\r\n }\r\n);\r\n\r\nFormInputRadioButtonGroup.displayName = \"FormInputRadioButtonGroup\";\r\n\r\nexport default FormInputRadioButtonGroup;\r\n","\"use client\";\r\nimport React, { memo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\n\r\nimport SliderField from \"../FormFields/BoxFields/SliderField\";\r\nimport type { IFormInputFields } from \"./types\";\r\n\r\n/**\r\n * Form Input Slider Component\r\n *\r\n * A customizable slider field built on top of Material UI Slider and FormControl,\r\n * integrated with React Hook Form.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a flexible slider for range selections with support for: error handling, helper text, custom marks,\r\n * styling overrides, orientation (horizontal/vertical), and standard slider behaviors.\r\n * It integrates seamlessly with react-hook-form using the `Controller` component.\r\n *\r\n * @param {string} name - {string} Unique name for form identification\r\n * @param {Control<any>} control - {Control<any>} React Hook Form control object\r\n * @param {string | React.ReactNode} [label] - {string | React.ReactNode} Label text for the slider\r\n * @param {number | number[]} [defaultValue=0] - {number | number[]} Default slider value(s)\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {boolean} [fullWidth=true] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {'horizontal'|'vertical'} [orientation='horizontal'] - {'horizontal'|'vertical'} Slider orientation\r\n * @param {number} [min=0] - {number} Minimum value\r\n * @param {number} [max=100] - {number} Maximum value\r\n * @param {number|null} [step=1] - {number|null} Step value\r\n * @param {'on'|'auto'|'off'} [valueLabelDisplay='auto'] - {'on'|'auto'|'off'} Whether to show value label\r\n * @param {React.ReactNode | ((value: number, index: number) => React.ReactNode)} [valueLabelFormat] - {React.ReactNode} Custom format for value label\r\n * @param {'primary'|'secondary'|'success'|'error'|'info'|'warning'} [color='primary'] - {'primary'|'secondary'|'success'|'error'|'info'|'warning'} Slider color\r\n * @param {'small'|'medium'} [size] - {'small'|'medium'} Slider size\r\n * @param {boolean | SliderProps['marks']} [marks] - {boolean | SliderProps['marks']} Marks on the slider\r\n * @param {'normal'|'inverted'|false} [track='normal'] - {'normal'|'inverted'|false} Track display mode\r\n * @param {SliderProps['sx']} [sliderStyles] - {SliderProps['sx']} Custom styles for the Slider component\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {FormLabelProps['sx']} [formLabelStyles] - {FormLabelProps['sx']} Custom styles for FormLabel\r\n * @param {(value: number | number[]) => void} [onChange] - {Function} Optional additional callback fired when value changes\r\n * @param {(value: number | number[]) => void} [onChangeCommitted] - {Function} Callback fired when value change is committed\r\n * @param {(event: SyntheticEvent) => void} [onFocus] - {Function} Callback when focused\r\n * @param {(event: SyntheticEvent) => void} [onBlur] - {Function} Callback when blurred\r\n * @param {Object} [slotProps] - {Object} Custom slot props\r\n * @param {Object} [slots] - {Object} Custom slots\r\n *\r\n * @returns {JSX.Element} The Form Input Slider component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import { FormInputSlider } from \"@react-solutions/inputs\";\r\n * import { useForm } from \"react-hook-form\";\r\n *\r\n * function MyForm() {\r\n * const { control } = useForm();\r\n *\r\n * return (\r\n * <FormInputSlider\r\n * name=\"volume\"\r\n * label=\"Volume\"\r\n * control={control}\r\n * min={0}\r\n * max={100}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst FormInputSlider = memo(({ name, label, control, defaultValue = 0, onChange, ...props }: IFormInputFields) => {\r\n return (\r\n <Controller\r\n name={name}\r\n control={control}\r\n defaultValue={defaultValue}\r\n render={({ field, fieldState: { error } }) => {\r\n const { size, ...restProps } = props;\r\n return (\r\n <SliderField\r\n {...restProps}\r\n name={name}\r\n label={label}\r\n value={field.value ?? defaultValue}\r\n onChange={(value) => {\r\n field.onChange(value);\r\n onChange?.(value);\r\n }}\r\n onBlur={field.onBlur}\r\n size={size as any}\r\n error={error}\r\n helperText={error?.message}\r\n />\r\n );\r\n }}\r\n />\r\n );\r\n});\r\n\r\nFormInputSlider.displayName = \"FormInputSlider\";\r\n\r\nexport default FormInputSlider;\r\n","\"use client\";\r\nimport React, { memo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\n\r\nimport SwitchField from \"../FormFields/BoxFields/SwitchField\";\r\nimport type { IFormInputFields } from \"./types\";\r\n\r\n/**\r\n * Form Input Switch Component\r\n *\r\n * A customizable switch field built on top of Material UI Switch and FormControl,\r\n * integrated with React Hook Form.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a flexible switch for binary choices with support for: error handling, helper text, custom icons,\r\n * styling overrides, label placement, and standard switch behaviors.\r\n * It integrates seamlessly with react-hook-form using the `Controller` component.\r\n *\r\n * @param {string} name - {string} Unique name for form identification\r\n * @param {Control<any>} control - {Control<any>} React Hook Form control object\r\n * @param {string | React.ReactNode} [label] - {string | React.ReactNode} Label text for the switch\r\n * @param {boolean} [defaultValue=false] - {boolean} Default checked state\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {'primary'|'secondary'|'success'|'error'|'info'|'warning'} [color='primary'] - {'primary'|'secondary'|'success'|'error'|'info'|'warning'} Switch color\r\n * @param {'small'|'medium'} [size] - {'small'|'medium'} Switch size\r\n * @param {boolean} [fullWidth=false] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {'start'|'end'|'top'|'bottom'} [labelPlacement='end'] - {'start'|'end'|'top'|'bottom'} Label placement relative to switch\r\n * @param {'start'|'end'|false} [edge] - {'start'|'end'|false} Edge placement for the switch\r\n * @param {React.ReactNode} [checkedIcon] - {React.ReactNode} Custom icon for checked state\r\n * @param {React.ReactNode} [icon] - {React.ReactNode} Custom icon for unchecked state\r\n * @param {SwitchProps['sx']} [switchStyles] - {SwitchProps['sx']} Custom styles for the Switch component\r\n * @param {FormControlLabelProps['sx']} [labelStyles] - {FormControlLabelProps['sx']} Custom styles for FormControlLabel\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {(checked: boolean) => void} [onChange] - {Function} Optional additional callback fired when value changes\r\n * @param {(event: React.MouseEvent<HTMLButtonElement>) => void} [onClick] - {Function} Callback fired when clicked\r\n * @param {SwitchProps['onFocus']} [onFocus] - {Function} Callback when focused\r\n * @param {SwitchProps['onBlur']} [onBlur] - {Function} Callback when blurred\r\n * @param {Object} [slotProps] - {Object} Custom slot props\r\n * @param {Object} [slots] - {Object} Custom slots\r\n *\r\n * @returns {JSX.Element} The Form Input Switch component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import { FormInputSwitch } from \"@react-solutions/inputs\";\r\n * import { useForm } from \"react-hook-form\";\r\n *\r\n * function MyForm() {\r\n * const { control } = useForm();\r\n *\r\n * return (\r\n * <FormInputSwitch\r\n * name=\"notifications\"\r\n * label=\"Enable Notifications\"\r\n * control={control}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst FormInputSwitch = memo(({ name, label, control, defaultValue = false, onChange, ...props }: IFormInputFields) => {\r\n return (\r\n <Controller\r\n name={name}\r\n control={control}\r\n defaultValue={defaultValue}\r\n render={({ field, fieldState: { error } }) => {\r\n const { size, ...restProps } = props;\r\n return (\r\n <SwitchField\r\n {...restProps}\r\n name={name}\r\n label={label}\r\n value={field.value ?? false}\r\n onChange={(checked) => {\r\n field.onChange(checked);\r\n onChange?.(checked);\r\n }}\r\n onBlur={field.onBlur}\r\n size={size as any}\r\n error={error}\r\n helperText={error?.message}\r\n />\r\n );\r\n }}\r\n />\r\n );\r\n});\r\n\r\nFormInputSwitch.displayName = \"FormInputSwitch\";\r\n\r\nexport default FormInputSwitch;\r\n","\"use client\";\r\nimport React, { memo, useMemo } from \"react\";\r\nimport { Controller } from \"react-hook-form\";\r\n\r\nimport ToggleButtonField from \"../FormFields/BoxFields/ToggleButtonField\";\r\nimport type { IFormInputFieldsWithOptions } from \"./types\";\r\n\r\n/**\r\n * Form Input Toggle Button Component\r\n *\r\n * A customizable toggle button group field built on top of Material UI ToggleButtonGroup and FormControl,\r\n * integrated with React Hook Form.\r\n *\r\n * @component\r\n * @version 2.x.x\r\n * @author call-max\r\n *\r\n * @description This component provides a group of flexible toggle buttons for single or multiple selections with support for:\r\n * error handling, helper text, custom colors per button, styling overrides, and standard toggle behaviors.\r\n * It integrates seamlessly with react-hook-form using the `Controller` component.\r\n *\r\n * @param {string} name - {string} Unique name for form identification\r\n * @param {Control<any>} control - {Control<any>} React Hook Form control object\r\n * @param {string | React.ReactNode} [label] - {string | React.ReactNode} Label text for the group\r\n * @param {any} [defaultValue=\"\"] - {any} Default selected value(s)\r\n * @param {ToggleOption[]} options - {ToggleOption[]} Array of toggle options\r\n * @param {boolean} [title=false] - {boolean} Whether to show label as title\r\n * @param {boolean} [disabled=false] - {boolean} Whether the field is disabled\r\n * @param {boolean} [fullWidth=false] - {boolean} Whether the field should take full width\r\n * @param {boolean} [required] - {boolean} Required field indicator\r\n * @param {'small'|'medium'|'large'} [size='medium'] - {'small'|'medium'|'large'} Toggle size\r\n * @param {'horizontal'|'vertical'} [orientation='horizontal'] - {'horizontal'|'vertical'} Toggle orientation\r\n * @param {boolean} [exclusive=true] - {boolean} Whether to allow only single selection\r\n * @param {ToggleButtonProps['sx']} [buttonStyles] - {ToggleButtonProps['sx']} Custom styles for individual ToggleButton components\r\n * @param {FormControlProps['sx']} [formControlStyles] - {FormControlProps['sx']} Custom styles for FormControl container\r\n * @param {FormLabelProps['sx']} [formLabelStyles] - {FormLabelProps['sx']} Custom styles for FormLabel\r\n * @param {ToggleButtonGroupProps['sx']} [groupStyles] - {ToggleButtonGroupProps['sx']} Custom styles for ToggleButtonGroup\r\n * @param {(value: any) => void} [onChange] - {(value: any) => void} Optional additional callback fired when value changes\r\n * @param {(option: ToggleOption, index: number) => React.ReactNode} [renderButton] - {Function} Custom render function for toggle buttons\r\n *\r\n * @returns {JSX.Element} The Form Input Toggle Button component\r\n *\r\n * @usage\r\n * ```tsx\r\n * import { FormInputToggleButton } from \"@react-solutions/inputs\";\r\n * import { useForm } from \"react-hook-form\";\r\n *\r\n * function MyForm() {\r\n * const { control } = useForm({\r\n * defaultValues: { status: \"ACTIVE\" }\r\n * });\r\n *\r\n * return (\r\n * <FormInputToggleButton\r\n * name=\"status\"\r\n * label=\"Status\"\r\n * control={control}\r\n * options={[\r\n * { name: \"Active\", value: \"ACTIVE\", color: \"success\" },\r\n * { name: \"Inactive\", value: \"INACTIVE\", color: \"error\" }\r\n * ]}\r\n * exclusive\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n */\r\nconst FormInputToggleButton = memo(\r\n ({ name, label, control, options = [], defaultValue = \"\", onChange, ...props }: IFormInputFieldsWithOptions) => {\r\n const memoizedOptions = useMemo(() => (Array.isArray(options) ? options : []), [options]);\r\n\r\n return (\r\n <Controller\r\n name={name}\r\n control={control}\r\n defaultValue={defaultValue}\r\n render={({ field, fieldState: { error } }) => {\r\n const { size, ...restProps } = props;\r\n return (\r\n <ToggleButtonField\r\n {...restProps}\r\n name={name}\r\n label={label}\r\n value={field.value ?? defaultValue}\r\n onChange={(value) => {\r\n field.onChange(value);\r\n onChange?.(value);\r\n }}\r\n onBlur={field.onBlur}\r\n options={memoizedOptions}\r\n size={size as any}\r\n error={error}\r\n helperText={error?.message}\r\n />\r\n );\r\n }}\r\n />\r\n );\r\n }\r\n);\r\n\r\nFormInputToggleButton.displayName = \"FormInputToggleButton\";\r\n\r\nexport default FormInputToggleButton;\r\n","\"use client\";\r\n// HookFormFields Imports\r\nimport NormalForm from \"./pkg/FormBuild/Form\";\r\nimport ReactHookForm from \"./pkg/FormBuild/HookForm\";\r\nimport CheckBoxField from \"./pkg/FormFields/BoxFields/CheckBoxField\";\r\nimport CheckBoxFieldGroup from \"./pkg/FormFields/BoxFields/CheckBoxFieldGroup\";\r\nimport RadioButtonField from \"./pkg/FormFields/BoxFields/RadioButtonField\";\r\nimport RadioButtonFieldGroup from \"./pkg/FormFields/BoxFields/RadioButtonFieldGroup\";\r\nimport SliderField from \"./pkg/FormFields/BoxFields/SliderField\";\r\nimport SwitchField from \"./pkg/FormFields/BoxFields/SwitchField\";\r\nimport ToggleButtonField from \"./pkg/FormFields/BoxFields/ToggleButtonField\";\r\nimport DateCalendarField from \"./pkg/FormFields/DateFields/DateCalendarField\";\r\nimport DatePickerField from \"./pkg/FormFields/DateFields/DatePickerField\";\r\nimport TimeClockField from \"./pkg/FormFields/DateFields/TimeClockField\";\r\nimport TimePickerField from \"./pkg/FormFields/DateFields/TimePickerField\";\r\nimport AutoCompleteField from \"./pkg/FormFields/DropdownFields/AutoCompleteField\";\r\nimport ColorPickerField from \"./pkg/FormFields/DropdownFields/ColorPickerField\";\r\nimport FileUploadField from \"./pkg/FormFields/DropdownFields/FileUploadField\";\r\nimport SelectInputField from \"./pkg/FormFields/DropdownFields/SelectInputField\";\r\nimport NumberField from \"./pkg/FormFields/TextFields/NumberField\";\r\nimport OTPField from \"./pkg/FormFields/TextFields/OTPField\";\r\nimport PasswordField from \"./pkg/FormFields/TextFields/PasswordField\";\r\nimport SearchInputField from \"./pkg/FormFields/TextFields/SearchInputField\";\r\nimport TelInputField from \"./pkg/FormFields/TextFields/TelInputField\";\r\n// FormFields Imports\r\nimport TextInputField from \"./pkg/FormFields/TextFields/TextInputField\";\r\nimport {\r\n FormInputAutoComplete,\r\n FormInputCalendar,\r\n FormInputCheckBox,\r\n FormInputCheckBoxGroup,\r\n FormInputColorPicker,\r\n FormInputDatePicker,\r\n FormInputFileUpload,\r\n FormInputMultiAutoComplete,\r\n FormInputMultiSelect,\r\n FormInputNumberField,\r\n FormInputOTPField,\r\n FormInputPasswordField,\r\n FormInputRadioButtonGroup,\r\n FormInputSearchField,\r\n FormInputSelect,\r\n FormInputSingleRadio,\r\n FormInputSlider,\r\n FormInputSwitch,\r\n FormInputTelField,\r\n FormInputTextArea,\r\n FormInputTextField,\r\n FormInputTimeClock,\r\n FormInputTimePicker,\r\n FormInputToggleButton,\r\n type IFormInputCheckBoxGroupFields,\r\n type IFormInputDateFields,\r\n type IFormInputFields,\r\n type IFormInputFieldsWithOptions,\r\n type IFormInputNumberFields,\r\n type IFormInputRadioFields,\r\n type IFormInputTextAreaFields,\r\n type Option\r\n} from \"./pkg/HookFormFields\";\r\n\r\nexport { NormalForm as DemoForm, ReactHookForm as DemoHookForm };\r\n// Named Exports\r\nexport {\r\n AutoCompleteField,\r\n CheckBoxField,\r\n CheckBoxFieldGroup,\r\n ColorPickerField,\r\n DateCalendarField,\r\n DatePickerField,\r\n FileUploadField,\r\n FormInputAutoComplete,\r\n FormInputCalendar,\r\n FormInputCheckBox,\r\n FormInputCheckBoxGroup,\r\n FormInputColorPicker,\r\n FormInputDatePicker,\r\n FormInputFileUpload,\r\n FormInputMultiAutoComplete,\r\n FormInputMultiSelect,\r\n FormInputNumberField,\r\n FormInputOTPField,\r\n FormInputPasswordField,\r\n FormInputRadioButtonGroup,\r\n FormInputSearchField,\r\n FormInputSelect,\r\n FormInputSingleRadio,\r\n FormInputSlider,\r\n FormInputSwitch,\r\n FormInputTelField,\r\n FormInputTextArea,\r\n // HookFormFields\r\n FormInputTextField,\r\n FormInputTimeClock,\r\n FormInputTimePicker,\r\n FormInputToggleButton,\r\n NumberField,\r\n OTPField,\r\n PasswordField,\r\n RadioButtonField,\r\n RadioButtonFieldGroup,\r\n SearchInputField,\r\n SelectInputField,\r\n SliderField,\r\n SwitchField,\r\n TelInputField,\r\n // FormFields\r\n TextInputField,\r\n TimeClockField,\r\n TimePickerField,\r\n ToggleButtonField\r\n};\r\n\r\n// Type Exports\r\nexport type {\r\n IFormInputCheckBoxGroupFields,\r\n IFormInputDateFields,\r\n IFormInputFields,\r\n IFormInputFieldsWithOptions,\r\n IFormInputNumberFields,\r\n IFormInputRadioFields,\r\n IFormInputTextAreaFields,\r\n Option\r\n};\r\n\r\n// Default Export\r\nconst FormFields = {\r\n // HookFormFields\r\n FormInputTextField,\r\n FormInputTextArea,\r\n FormInputPasswordField,\r\n FormInputNumberField,\r\n FormInputTelField,\r\n FormInputSearchField,\r\n FormInputOTPField,\r\n FormInputSelect,\r\n FormInputMultiSelect,\r\n FormInputAutoComplete,\r\n FormInputMultiAutoComplete,\r\n FormInputColorPicker,\r\n FormInputFileUpload,\r\n FormInputDatePicker,\r\n FormInputTimePicker,\r\n FormInputTimeClock,\r\n FormInputCalendar,\r\n FormInputCheckBox,\r\n FormInputCheckBoxGroup,\r\n FormInputSwitch,\r\n FormInputSlider,\r\n FormInputSingleRadio,\r\n FormInputRadioButtonGroup,\r\n FormInputToggleButton,\r\n // FormFields\r\n TextInputField,\r\n PasswordField,\r\n NumberField,\r\n TelInputField,\r\n SearchInputField,\r\n OTPField,\r\n SelectInputField,\r\n AutoCompleteField,\r\n ColorPickerField,\r\n FileUploadField,\r\n DatePickerField,\r\n TimePickerField,\r\n TimeClockField,\r\n DateCalendarField,\r\n CheckBoxField,\r\n CheckBoxFieldGroup,\r\n RadioButtonField,\r\n RadioButtonFieldGroup,\r\n SwitchField,\r\n SliderField,\r\n ToggleButtonField\r\n};\r\n\r\nexport default FormFields;\r\n"],"mappings":"gnBAEA,OAAS,OAAAA,GAAK,UAAAC,GAAQ,WAAAC,GAAS,SAAAC,GAAO,cAAAC,OAAkB,gBACxD,OAAgB,YAAAC,OAAgB,QCFhC,OACE,YAAAC,GAEA,eAAAC,GACA,oBAAAC,GAEA,kBAAAC,OACK,gBACP,OAAqD,cAAAC,OAAkB,QAyKjE,OAUM,OAAAC,GAVN,QAAAC,OAAA,oBA7CN,IAAMC,GAAgBC,GACpB,CACEC,EA0BAC,IACG,CA3BH,IAAAC,EAAAF,EACE,MAAAG,EACA,MAAAC,EACA,MAAAC,EACA,SAAAC,EACA,QAAAC,EACA,QAAAC,EACA,OAAAC,EACA,MAAAC,EACA,WAAAC,EACA,SAAAC,EAAW,GACX,MAAAC,EAAQ,UACR,KAAAC,EACA,UAAAC,EAAY,GACZ,SAAAC,EACA,eAAAC,EAAiB,MACjB,YAAAC,EACA,KAAAC,EACA,cAAAC,EAAgB,GAChB,eAAAC,EACA,YAAAC,EACA,kBAAAC,EACA,UAAAC,EACA,MAAAC,CA9JN,EAuIIvB,EAwBKwB,EAAAC,EAxBLzB,EAwBK,CAvBH,OACA,QACA,QACA,WACA,UACA,UACA,SACA,QACA,aACA,WACA,QACA,OACA,YACA,WACA,iBACA,cACA,OACA,gBACA,iBACA,cACA,oBACA,YACA,UAMF,IAAM0B,EAAe,CAACC,EAAuCC,IAAqB,CAC5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,gBAAAC,GACA,gBAAAC,GACA,gBAAAC,GACA,eAAAC,GACA,kBAAAC,GACA,cAAAC,GACA,mBAAAC,GACA,iBAAAC,GACA,sBAAAC,GACA,YAAAC,GACA,YAAAC,GACA,kBAAAC,EACF,EAEOC,GAAQ9C","names":["Box","Button","Divider","Paper","Typography","useState","Checkbox","FormControl","FormControlLabel","FormHelperText","forwardRef","jsx","jsxs","CheckboxField","forwardRef","_a","ref","_b","name","label","value","onChange","onClick","onFocus","onBlur","error","helperText","disabled","color","size","fullWidth","required","labelPlacement","checkedIcon","icon","indeterminate","checkboxStyles","labelStyles","formControlStyles","slotProps","slots","checkboxProps","__objRest","handleChange","_event","checked","handleClick","event","FormControl","FormControlLabel","Checkbox","__spreadProps","__spreadValues","FormHelperText","CheckBoxField_default","Box","Checkbox","FormControl","FormControlLabel","FormHelperText","FormLabel","forwardRef","jsx","jsxs","CheckboxFieldGroup","forwardRef","_a","ref","_b","name","label","value","options","onChange","onFocus","onBlur","onClick","error","helperText","disabled","fullWidth","required","color","size","labelPlacement","row","checkedIcon","icon","checkboxStyles","labelStyles","formControlStyles","renderCheckbox","slotProps","sxProps","slots","formLabelStyles","formLabelProps","formControlLabelProps","formControlProps","__objRest","handleChange","optionValue","event","isChecked","newValue","val","handleFocus","handleBlur","handleClick","defaultRenderCheckbox","option","index","handleChangeFn","FormControlLabel","__spreadValues","Checkbox","FormControl","__spreadProps","FormLabel","Box","changeHandler","FormHelperText","CheckBoxFieldGroup_default","FormControl","FormControlLabel","FormHelperText","Radio","forwardRef","jsx","jsxs","RadioButtonField","forwardRef","_a","ref","_b","name","label","value","onChange","onClick","onFocus","onBlur","error","helperText","disabled","color","size","fullWidth","required","labelPlacement","checkedIcon","icon","radioStyles","labelStyles","formControlStyles","slotProps","slots","formControlLabelProps","radioProps","__objRest","handleChange","_event","checked","handleClick","event","FormControl","FormControlLabel","__spreadValues","Radio","__spreadProps","FormHelperText","RadioButtonField_default","FormControl","FormControlLabel","FormHelperText","FormLabel","Radio","RadioGroup","forwardRef","jsx","jsxs","RadioButtonFieldGroup","forwardRef","_a","ref","_b","name","label","value","onChange","onClick","onFocus","onBlur","options","error","helperText","disabled","color","size","fullWidth","required","labelPlacement","row","checkedIcon","icon","radioStyles","labelStyles","formControlStyles","formLabelStyles","renderRadio","sxProps","slotProps","slots","formLabelProps","formControlLabelProps","radioGroupProps","__objRest","handleChange","event","newValue","numericValue","opt","handleClick","defaultRenderRadio","option","FormControlLabel","__spreadProps","__spreadValues","Radio","FormControl","FormLabel","RadioGroup","index","FormHelperText","RadioButtonFieldGroup_default","FormControl","FormHelperText","FormLabel","Slider","forwardRef","jsx","jsxs","SliderField","forwardRef","_a","ref","_b","name","label","value","onChange","onChangeCommitted","onFocus","onBlur","error","helperText","disabled","fullWidth","required","orientation","min","max","step","valueLabelDisplay","valueLabelFormat","color","size","marks","track","sliderStyles","formControlStyles","formLabelStyles","slotProps","slots","formLabelProps","sliderProps","__objRest","handleChange","_event","newValue","_activeThumb","handleChangeCommitted","isVertical","FormControl","__spreadValues","FormLabel","__spreadProps","Slider","FormHelperText","SliderField_default","FormControl","FormControlLabel","FormHelperText","Switch","forwardRef","jsx","jsxs","SwitchField","forwardRef","_a","ref","_b","name","label","value","onChange","onClick","onFocus","onBlur","error","helperText","disabled","color","size","fullWidth","required","labelPlacement","edge","switchStyles","labelStyles","formControlStyles","slotProps","slots","formControlLabelProps","switchProps","__objRest","handleChange","_event","checked","handleClick","event","switchComponent","Switch","__spreadProps","__spreadValues","FormControl","FormControlLabel","FormHelperText","SwitchField_default","FormControl","FormHelperText","FormLabel","ToggleButton","ToggleButtonGroup","forwardRef","jsx","jsxs","ToggleButtonField","forwardRef","_a","ref","_b","name","label","title","value","onChange","options","error","helperText","disabled","fullWidth","required","size","orientation","exclusive","buttonStyles","formControlStyles","formLabelStyles","groupStyles","renderButton","groupProps","__objRest","handleChange","event","newValue","defaultRenderButton","option","ToggleButton","__spreadValues","FormControl","FormLabel","ToggleButtonGroup","__spreadProps","index","FormHelperText","ToggleButtonField_default","Box","FormControl","FormHelperText","DateCalendar","LocalizationProvider","AdapterDateFns","forwardRef","jsx","jsxs","DateCalendarField","forwardRef","_a","ref","_b","name","label","value","defaultValue","onChange","onViewChange","onMonthChange","onYearChange","error","helperText","disabled","fullWidth","required","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear","calendarStyles","formControlStyles","formLabelStyles","containerStyles","slotProps","slots","dateAdapter","AdapterDateFns","showDaysOutsideCurrentMonth","disablePast","disableFuture","referenceDate","view","dateCalendarProps","__objRest","handleChange","newValue","FormControl","Box","__spreadValues","LocalizationProvider","DateCalendar","__spreadProps","FormHelperText","DateCalendarField_default","ClearIcon","Box","FormControl","FormHelperText","FormLabel","IconButton","InputAdornment","DatePicker","LocalizationProvider","AdapterDateFns","React","forwardRef","useRef","jsx","jsxs","DatePickerField","forwardRef","_a","ref","_b","name","label","value","defaultValue","onChange","onFocus","onBlur","onViewChange","onMonthChange","onYearChange","onOpen","onClose","error","helperText","disabled","fullWidth","required","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear","size","variant","color","placeholder","readOnly","showClearButton","disablePast","disableFuture","referenceDate","view","format","openTo","pickerStyles","formControlStyles","formLabelStyles","containerStyles","textFieldStyles","slotProps","slots","title","dateAdapter","AdapterDateFns","reduceAnimations","autoFocus","datePickerProps","__objRest","inputRef","useRef","handleChange","newValue","handleClear","defaultPlaceholder","mergedSlotProps","__spreadProps","__spreadValues","React","InputAdornment","IconButton","ClearIcon","FormControl","FormLabel","Box","LocalizationProvider","DatePicker","FormHelperText","DatePickerField_default","Box","Button","FormControl","FormHelperText","Stack","LocalizationProvider","TimeClock","AdapterDateFns","forwardRef","useState","jsx","jsxs","TimeClockField","forwardRef","_a","ref","_b","name","label","value","defaultValue","onChange","error","helperText","disabled","fullWidth","required","views","ampmInClock","ampm","disablePast","disableFuture","minTime","maxTime","shouldDisableTime","clockStyles","formControlStyles","formLabelStyles","containerStyles","buttonsStackStyles","buttonStyles","activeButtonStyles","showViewButtons","initialView","controlledView","controlledOnViewChange","slotProps","slots","dateAdapter","AdapterDateFns","autoFocus","timeClockProps","__objRest","internalView","setInternalView","useState","view","setView","handleChange","newValue","handleViewChange","newView","FormControl","Box","__spreadValues","Stack","v","Button","LocalizationProvider","TimeClock","__spreadProps","FormHelperText","TimeClockField_default","ClearIcon","Box","FormControl","FormHelperText","FormLabel","IconButton","InputAdornment","LocalizationProvider","TimePicker","AdapterDateFns","React","forwardRef","useRef","jsx","jsxs","TimePickerField","forwardRef","_a","ref","_b","name","label","title","value","defaultValue","onChange","onFocus","onBlur","onViewChange","onOpen","onClose","error","helperText","disabled","fullWidth","required","minTime","maxTime","shouldDisableTime","size","variant","color","placeholder","readOnly","showClearButton","disablePast","disableFuture","ampm","views","view","openTo","format","pickerStyles","formControlStyles","formLabelStyles","containerStyles","textFieldStyles","slotProps","slots","dateAdapter","AdapterDateFns","autoFocus","timePickerProps","__objRest","inputRef","useRef","handleChange","newValue","handleClear","defaultPlaceholder","mergedSlotProps","__spreadProps","__spreadValues","React","InputAdornment","IconButton","ClearIcon","FormControl","FormLabel","Box","LocalizationProvider","TimePicker","FormHelperText","TimePickerField_default","Autocomplete","FormControl","FormHelperText","TextField","forwardRef","memo","useCallback","jsx","jsxs","AutoCompleteField","memo","forwardRef","_a","ref","_b","name","label","value","onChange","onInputChange","onOpen","onClose","options","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","getOptionLabel","isOptionEqualToValue","renderOption","popupIcon","inputStyles","autocompleteStyles","formControlStyles","loading","loadingText","noOptionsText","filterOptions","autoHighlight","autoSelect","disablePortal","disableListWrap","slotProps","slots","autocompleteProps","__objRest","defaultGetOptionLabel","useCallback","option","defaultIsOptionEqualToValue","handleChange","event","newValue","reason","FormControl","Autocomplete","__spreadProps","__spreadValues","params","TextField","FormHelperText","AutoCompleteField_default","Box","FormControl","InputAdornment","TextField","forwardRef","memo","useCallback","useEffect","useMemo","useRef","useState","jsx","jsxs","isValidHex","color","normalizeHex","hex","char","ColorPickerField","memo","forwardRef","_a","ref","_b","name","label","value","onChange","onFocus","onBlur","onEnterPress","error","helperText","disabled","placeholder","variant","size","fullWidth","required","format","showPreview","showNativeInput","showPopoverPicker","presetColors","showPresetColors","previewStyles","formControlStyles","inputStyles","slotProps","slots","textFieldProps","__objRest","internalValue","setInternalValue","useState","colorInputRef","useRef","popoverAnchorRef","useEffect","normalizedValue","handleChange","useCallback","event","newValue","handleColorInputChange","handlePreviewClick","handleKeyDown","previewSwatch","useMemo","jsx","InputAdornment","Box","__spreadValues","finalSlotProps","__spreadProps","displayHelperText","jsxs","FormControl","TextField","ColorPickerField_default","Clear","CloudUploadIcon","FormControl","FormHelperText","IconButton","InputAdornment","TextField","forwardRef","useRef","useState","jsx","jsxs","FileUploadField","forwardRef","_a","ref","_b","name","label","value","onChange","onFileSelect","onFileRemove","onValidationError","onDrop","error","helperText","disabled","accept","multiple","maxSize","minSize","allowedTypes","showPreview","enableDragDrop","placeholder","variant","size","color","fullWidth","required","buttonText","buttonVariant","buttonColor","buttonSize","uploadIcon","CloudUploadIcon","inputStyles","buttonStyles","formControlStyles","containerStyles","slotProps","slots","textFieldProps","__objRest","internalRef","useRef","isDragging","setIsDragging","useState","setDragCounter","fileInputRef","getFileName","validateFile","file","formatFileSize","fileType","getFileExtension","type","bytes","k","sizes","i","filename","handleFileChange","event","files","fileArray","validFiles","hasError","validationError","result","handleButtonClick","handleFileRemove","handleDragEnter","e","prev","handleDragLeave","newCounter","handleDragOver","handleDrop","fileName","displayValue","FormControl","TextField","__spreadProps","__spreadValues","InputAdornment","IconButton","Clear","FormHelperText","FileUploadField_default","FormControl","FormHelperText","InputLabel","MenuItem","Select","forwardRef","jsx","jsxs","SelectInputField","forwardRef","_a","ref","_b","name","label","value","onChange","onOpen","onClose","options","error","helperText","disabled","variant","size","color","fullWidth","required","multiple","icon","renderValue","renderMenuItem","menuItemStyles","selectStyles","formControlStyles","labelStyles","slotProps","slots","displayEmpty","autoWidth","native","MenuProps","selectProps","__objRest","defaultRenderValue","selected","val","option","opt","defaultRenderMenuItem","index","menuItemSx","MenuItem","handleChange","event","child","labelId","selectId","FormControl","InputLabel","Select","__spreadProps","__spreadValues","FormHelperText","SelectInputField_default","FormControl","InputAdornment","TextField","forwardRef","memo","useCallback","useEffect","useMemo","useState","jsx","extractDigits","value","formatByPattern","digits","pattern","formatted","digitIndex","i","generatePlaceholderFromPattern","formatPhoneNumber","numbers","formatCreditCard","_a","formatCurrency","allowDecimals","parts","formatSSN","formatZipCode","formatPercentage","NumberField","memo","forwardRef","ref","_b","name","label","onChange","onFocus","onBlur","onEnterPress","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","customPattern","customFormatter","min","max","step","decimalPlaces","startAdornment","endAdornment","inputStyles","formControlStyles","slotProps","slots","textFieldProps","__objRest","displayValue","setDisplayValue","useState","isPatternString","activePatternString","activePatternType","formatValue","useCallback","inputValue","useEffect","prev","isValidInput","key","maxDigits","testValue","handleChange","event","formattedValue","digitsOnly","syntheticEvent","__spreadProps","__spreadValues","handlePaste","pastedText","limitedDigits","handleKeyDown","input","currentValue","inputProps","useMemo","startAdornmentElement","InputAdornment","endAdornmentElement","finalSlotProps","inputType","displayPlaceholder","displayHelperText","FormControl","TextField","NumberField_default","Box","FormControl","FormHelperText","TextField","forwardRef","useEffect","useRef","useState","jsx","jsxs","OTPField","forwardRef","_a","ref","_b","name","label","value","onChange","onComplete","onFocus","onBlur","onEnterPress","error","helperText","disabled","variant","size","color","fullWidth","required","length","spacing","autoFocus","autoSubmit","containerStyles","inputStyles","formControlStyles","slotProps","slots","textFieldProps","__objRest","otpValues","setOtpValues","useState","inputRefs","useRef","lastSentValueRef","isInternalUpdateRef","otpValuesRef","inputSessionActiveRef","inputSessionTimeoutRef","useEffect","currentOtpString","currentDigits","incomingDigits","values","paddedValues","handleChange","index","event","inputValue","updateValue","lastChar","newValue","shouldAutoFocusNext","newOtpValues","otpString","val","handleKeyDown","_c","key","handlePaste","digits","startIndex","i","nextEmptyIndex","focusIndex","handleFocus","_index","handleBlur","FormControl","Box","__spreadValues","otpValue","TextField","el","e","__spreadProps","FormHelperText","OTPField_default","Visibility","VisibilityOff","FormControl","FormHelperText","IconButton","InputAdornment","TextField","forwardRef","memo","useCallback","useMemo","useState","jsx","jsxs","calculatePasswordStrength","password","strength","getPasswordStrengthColor","PasswordField","memo","forwardRef","_a","ref","_b","name","label","value","onChange","onFocus","onBlur","onVisibilityToggle","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","showPasswordStrength","minLength","maxLength","defaultShowPassword","visibilityIcon","Visibility","visibilityOffIcon","VisibilityOff","iconButtonProps","getPasswordStrength","inputStyles","formControlStyles","slotProps","slots","textFieldProps","__objRest","showPassword","setShowPassword","useState","togglePasswordVisibility","useCallback","prev","newVisibility","passwordStrength","useMemo","getStrengthIndicator","strengthColor","strengthText","handleChange","event","newValue","endAdornmentElement","InputAdornment","IconButton","__spreadProps","__spreadValues","e","finalSlotProps","displayHelperText","FormControl","TextField","FormHelperText","PasswordField_default","Close","Search","FormControl","IconButton","InputAdornment","TextField","forwardRef","memo","useCallback","useEffect","useMemo","useRef","jsx","jsxs","SearchField","memo","forwardRef","_a","ref","_b","name","label","value","onChange","onFocus","onBlur","onSearch","onClear","onEnterPress","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","showClearButton","showSearchButton","clearIcon","searchIcon","clearButtonProps","searchButtonProps","enableDebounce","debounceDelay","enableThrottle","throttleDelay","inputStyles","formControlStyles","slotProps","slots","textFieldProps","__objRest","debounceTimerRef","useRef","throttleTimerRef","lastThrottleCallRef","useEffect","debouncedSearch","useCallback","searchVal","throttledSearch","now","timeSinceLastCall","handleChange","event","newValue","handleClear","handleSearch","handleKeyDown","endAdornment","useMemo","InputAdornment","IconButton","__spreadProps","__spreadValues","Close","Search","displayHelperText","FormControl","TextField","SearchInputField_default","FormControl","InputAdornment","TextField","forwardRef","memo","useCallback","useEffect","useMemo","useRef","useState","jsx","extractDigits","value","formatByPattern","digits","pattern","formatted","digitIndex","i","generatePlaceholder","TeliField","memo","forwardRef","_a","ref","_b","name","label","onChange","onFocus","onBlur","onEnterPress","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","maxLength","countryCode","showCountryCode","startAdornment","endAdornment","inputStyles","formControlStyles","countryCodeStyles","slotProps","slots","textFieldProps","__objRest","displayValue","setDisplayValue","useState","inputRef","useRef","calculatedMaxLength","useEffect","prev","cursorPosition","handleChange","useCallback","event","inputValue","limitedDigits","formattedValue","syntheticEvent","__spreadProps","__spreadValues","handlePaste","pastedText","handleKeyDown","key","isNumber","isAllowedKey","inputProps","useMemo","finalStartAdornment","InputAdornment","endAdornmentElement","finalSlotProps","displayPlaceholder","displayHelperText","FormControl","TextField","TelInputField_default","FormControl","InputAdornment","TextField","forwardRef","memo","useCallback","useMemo","jsx","TextInputField","memo","forwardRef","_a","ref","_b","name","label","value","onChange","onFocus","onBlur","onEnterPress","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","multiline","rows","minRows","maxRows","resize","maxLength","minLength","type","autoComplete","startAdornment","endAdornment","inputStyles","formControlStyles","slotProps","slots","textTransform","textFieldProps","__objRest","handleKeyDown","useCallback","event","handleChange","transformedValue","char","inputProps","useMemo","__spreadValues","startAdornmentElement","InputAdornment","endAdornmentElement","finalSlotProps","__spreadProps","finalInputStyles","displayHelperText","FormControl","TextField","TextInputField_default","jsx","jsxs","NormalForm","formData","setFormData","useState","errors","setErrors","selectOptions","checkboxOptions","radioOptions","handleChange","field","value","prev","__spreadProps","__spreadValues","newErrors","Paper","Typography","Divider","e","Box","TextInputField_default","PasswordField_default","NumberField_default","TelInputField_default","SearchInputField_default","OTPField_default","SelectInputField_default","AutoCompleteField_default","_","newValue","ColorPickerField_default","FileUploadField_default","DatePickerField_default","TimePickerField_default","CheckBoxFieldGroup_default","RadioButtonFieldGroup_default","CheckBoxField_default","RadioButtonField_default","SwitchField_default","TimeClockField_default","DateCalendarField_default","SliderField_default","ToggleButtonField_default","Button","Form_default","Box","Button","Divider","Paper","Typography","useForm","memo","Controller","jsx","FormInputNumberField","memo","_a","_b","name","label","control","pattern","min","max","step","allowDecimals","decimalPlaces","defaultValue","onChange","props","__objRest","Controller","field","error","size","restProps","NumberField_default","__spreadProps","__spreadValues","e","FormInputNumberField_default","memo","Controller","jsx","FormInputOTPField","memo","_a","_b","name","label","control","defaultValue","onChange","props","__objRest","Controller","field","error","size","restProps","OTPField_default","__spreadProps","__spreadValues","value","FormInputOTPField_default","memo","Controller","jsx","FormInputPasswordField","memo","_a","_b","name","label","control","size","defaultValue","onChange","props","__objRest","Controller","field","error","sizeProp","restProps","PasswordField_default","__spreadProps","__spreadValues","e","FormInputPasswordField_default","memo","Controller","jsx","FormInputSearchField","memo","_a","_b","name","label","control","defaultValue","onChange","props","__objRest","Controller","field","error","size","restProps","SearchInputField_default","__spreadProps","__spreadValues","e","FormInputSearchField_default","memo","Controller","jsx","FormInputTelField","memo","_a","_b","name","label","control","defaultValue","onChange","props","__objRest","Controller","field","error","size","restProps","TelInputField_default","__spreadProps","__spreadValues","e","FormInputTelField_default","memo","Controller","jsx","FormInputTextArea","memo","_a","_b","name","label","control","rows","minRows","maxRows","resize","defaultValue","onChange","props","__objRest","Controller","field","error","size","restProps","TextInputField_default","__spreadProps","__spreadValues","e","FormInputTextArea_default","memo","Controller","jsx","FormInputTextField","memo","_a","_b","name","label","control","defaultValue","onChange","props","__objRest","Controller","field","error","size","restProps","TextInputField_default","__spreadProps","__spreadValues","e","FormInputTextField_default","memo","Controller","jsx","FormInputAutoComplete","memo","_a","_b","name","label","control","options","disabled","placeholder","defaultValue","onChange","props","__objRest","Controller","field","error","value","onBlur","size","restProps","AutoCompleteField_default","__spreadProps","__spreadValues","_","newValue","FormInputAutoComplete_default","memo","Controller","jsx","FormInputColorPicker","memo","_a","_b","name","label","control","defaultValue","onChange","props","__objRest","Controller","field","error","size","restProps","ColorPickerField_default","__spreadProps","__spreadValues","color","FormInputColorPicker_default","memo","useRef","Controller","jsx","FormInputFileUpload","memo","_a","_b","name","label","control","size","defaultValue","onChange","props","__objRest","fileRef","useRef","Controller","field","error","FileUploadField_default","__spreadProps","__spreadValues","files","FormInputFileUpload_default","memo","useMemo","Controller","jsx","FormInputMultiAutoComplete","memo","_a","_b","name","label","control","options","disabled","placeholder","defaultValue","onChange","props","__objRest","memoizedOptions","useMemo","Controller","field","error","value","onBlur","size","restProps","fieldValue","AutoCompleteField_default","__spreadProps","__spreadValues","_","newValue","FormInputMultiAutoComplete_default","memo","useMemo","Controller","jsx","FormInputMultiSelect","memo","_a","_b","name","label","control","options","defaultValue","onChange","props","__objRest","memoizedOptions","useMemo","Controller","field","error","size","restProps","fieldValue","SelectInputField_default","__spreadProps","__spreadValues","e","FormInputMultiSelect_default","memo","useMemo","Controller","jsx","FormInputSelect","memo","_a","_b","name","label","control","options","defaultValue","onChange","props","__objRest","memoizedOptions","useMemo","Controller","field","error","size","restProps","SelectInputField_default","__spreadProps","__spreadValues","e","FormInputSelect_default","Box","FormLabel","memo","Controller","jsx","jsxs","FormInputCalendar","memo","_a","_b","name","label","control","readOnly","disabled","defaultValue","onChange","props","__objRest","Box","t","FormLabel","Controller","field","error","restProps","DateCalendarField_default","__spreadProps","__spreadValues","newValue","FormInputCalendar_default","memo","Controller","jsx","FormInputDatePicker","memo","_a","_b","name","label","control","size","readOnly","shouldDisableDate","disabled","placeholder","defaultValue","onChange","props","__objRest","Controller","field","error","_views","restProps","DatePickerField_default","__spreadProps","__spreadValues","newValue","FormInputDatePicker_default","Box","FormLabel","memo","useMemo","Controller","jsx","jsxs","FormInputTimeClock","memo","_a","_b","name","label","control","readOnly","disabled","ampm","views","ampmInClock","disablePast","defaultValue","onChange","props","__objRest","ampmValue","useMemo","Box","t","FormLabel","Controller","field","error","TimeClockField_default","__spreadProps","__spreadValues","newValue","FormInputTimeClock_default","memo","Controller","jsx","FormInputTimePicker","memo","_a","_b","name","label","control","ampm","timezone","defaultValue","onChange","props","__objRest","Controller","field","error","size","restProps","TimePickerField_default","__spreadProps","__spreadValues","newValue","FormInputTimePicker_default","memo","Controller","jsx","FormInputCheckBox","memo","_a","_b","name","label","control","defaultValue","onChange","props","__objRest","Controller","field","error","size","restProps","CheckBoxField_default","__spreadProps","__spreadValues","checked","FormInputCheckBox_default","memo","useMemo","Controller","jsx","FormInputCheckBoxGroup","memo","_a","_b","name","label","control","options","defaultValue","onChange","row","color","labelPlacement","props","__objRest","checkboxOptions","useMemo","option","Controller","field","error","size","restProps","fieldValue","CheckBoxFieldGroup_default","__spreadProps","__spreadValues","value","FormInputCheckBoxGroup_default","memo","Controller","jsx","FormInputRadioButton","memo","_a","_b","name","label","control","defaultValue","onChange","color","labelPlacement","props","__objRest","Controller","field","error","size","restProps","RadioButtonField_default","__spreadProps","__spreadValues","checkedValue","FormInputRadioButton_default","memo","useMemo","Controller","jsx","FormInputRadioButtonGroup","memo","_a","_b","name","label","control","options","defaultValue","onChange","props","__objRest","memoizedOptions","useMemo","Controller","field","error","size","restProps","RadioButtonFieldGroup_default","__spreadProps","__spreadValues","value","FormInputRadioButtonGroup_default","memo","Controller","jsx","FormInputSlider","memo","_a","_b","name","label","control","defaultValue","onChange","props","__objRest","Controller","field","error","size","restProps","SliderField_default","__spreadProps","__spreadValues","value","FormInputSlider_default","memo","Controller","jsx","FormInputSwitch","memo","_a","_b","name","label","control","defaultValue","onChange","props","__objRest","Controller","field","error","size","restProps","SwitchField_default","__spreadProps","__spreadValues","checked","FormInputSwitch_default","memo","useMemo","Controller","jsx","FormInputToggleButton","memo","_a","_b","name","label","control","options","defaultValue","onChange","props","__objRest","memoizedOptions","useMemo","Controller","field","error","size","restProps","ToggleButtonField_default","__spreadProps","__spreadValues","value","FormInputToggleButton_default","jsx","jsxs","size","ReactHookForm","control","handleSubmit","reset","useForm","selectOptions","checkboxOptions","radioOptions","Paper","Typography","Divider","data","Box","FormInputTextField_default","FormInputPasswordField_default","FormInputTextArea_default","FormInputNumberField_default","FormInputTelField_default","FormInputSearchField_default","FormInputOTPField_default","FormInputSelect_default","FormInputMultiSelect_default","FormInputAutoComplete_default","FormInputMultiAutoComplete_default","FormInputColorPicker_default","FormInputFileUpload_default","FormInputDatePicker_default","FormInputTimePicker_default","FormInputCheckBoxGroup_default","FormInputRadioButtonGroup_default","FormInputCheckBox_default","FormInputRadioButton_default","FormInputSwitch_default","FormInputTimeClock_default","FormInputCalendar_default","FormInputSlider_default","FormInputToggleButton_default","Button","HookForm_default","FormFields","FormInputTextField_default","FormInputTextArea_default","FormInputPasswordField_default","FormInputNumberField_default","FormInputTelField_default","FormInputSearchField_default","FormInputOTPField_default","FormInputSelect_default","FormInputMultiSelect_default","FormInputAutoComplete_default","FormInputMultiAutoComplete_default","FormInputColorPicker_default","FormInputFileUpload_default","FormInputDatePicker_default","FormInputTimePicker_default","FormInputTimeClock_default","FormInputCalendar_default","FormInputCheckBox_default","FormInputCheckBoxGroup_default","FormInputSwitch_default","FormInputSlider_default","FormInputRadioButton_default","FormInputRadioButtonGroup_default","FormInputToggleButton_default","TextInputField_default","PasswordField_default","NumberField_default","TelInputField_default","SearchInputField_default","OTPField_default","SelectInputField_default","AutoCompleteField_default","ColorPickerField_default","FileUploadField_default","DatePickerField_default","TimePickerField_default","TimeClockField_default","DateCalendarField_default","CheckBoxField_default","CheckBoxFieldGroup_default","RadioButtonField_default","RadioButtonFieldGroup_default","SwitchField_default","SliderField_default","ToggleButtonField_default","index_default"]}
|