mui-design-system 0.0.21 → 0.0.22

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.
Files changed (243) hide show
  1. package/package.json +1 -1
  2. package/dist/colors/index.d.ts +0 -4
  3. package/dist/colors/index.js +0 -93
  4. package/dist/colors/type.d.ts +0 -5
  5. package/dist/colors/type.js +0 -1
  6. package/dist/components/checkbox-list/CheckboxList.d.ts +0 -21
  7. package/dist/components/checkbox-list/CheckboxList.js +0 -31
  8. package/dist/components/custom-auto-complete/CustomAutoComplete.d.ts +0 -27
  9. package/dist/components/custom-auto-complete/CustomAutoComplete.js +0 -75
  10. package/dist/components/custom-auto-complete/components/AutoCompleteInput.d.ts +0 -21
  11. package/dist/components/custom-auto-complete/components/AutoCompleteInput.js +0 -29
  12. package/dist/components/custom-auto-complete/components/ListBox.d.ts +0 -5
  13. package/dist/components/custom-auto-complete/components/ListBox.js +0 -62
  14. package/dist/components/custom-auto-complete/components/ListRow.d.ts +0 -2
  15. package/dist/components/custom-auto-complete/components/ListRow.js +0 -21
  16. package/dist/components/custom-auto-complete-advanced/CustomAutoComplete.d.ts +0 -28
  17. package/dist/components/custom-auto-complete-advanced/CustomAutoComplete.js +0 -92
  18. package/dist/components/custom-auto-complete-advanced/components/ListBox.d.ts +0 -6
  19. package/dist/components/custom-auto-complete-advanced/components/ListBox.js +0 -76
  20. package/dist/components/custom-auto-complete-advanced/components/ListRow.d.ts +0 -2
  21. package/dist/components/custom-auto-complete-advanced/components/ListRow.js +0 -17
  22. package/dist/components/custom-auto-complete-advanced/components/RenderInput.d.ts +0 -23
  23. package/dist/components/custom-auto-complete-advanced/components/RenderInput.js +0 -51
  24. package/dist/components/custom-auto-complete-advanced/components/RenderTags.d.ts +0 -9
  25. package/dist/components/custom-auto-complete-advanced/components/RenderTags.js +0 -22
  26. package/dist/components/custom-breadcrumbs/CustomBreadcrumbs.d.ts +0 -17
  27. package/dist/components/custom-breadcrumbs/CustomBreadcrumbs.js +0 -11
  28. package/dist/components/custom-card/CustomHorizontalCard.d.ts +0 -3
  29. package/dist/components/custom-card/CustomHorizontalCard.js +0 -9
  30. package/dist/components/custom-card/CustomVerticalCard.d.ts +0 -3
  31. package/dist/components/custom-card/CustomVerticalCard.js +0 -9
  32. package/dist/components/custom-chip/CustomChip.d.ts +0 -12
  33. package/dist/components/custom-chip/CustomChip.js +0 -10
  34. package/dist/components/custom-date-picker/CustomComponent.d.ts +0 -17
  35. package/dist/components/custom-date-picker/CustomComponent.js +0 -36
  36. package/dist/components/custom-date-picker/CustomDatePicker.d.ts +0 -14
  37. package/dist/components/custom-date-picker/CustomDatePicker.js +0 -55
  38. package/dist/components/custom-dialog/CustomDialog.d.ts +0 -41
  39. package/dist/components/custom-dialog/CustomDialog.js +0 -38
  40. package/dist/components/custom-input/CustomNumericInput.d.ts +0 -9
  41. package/dist/components/custom-input/CustomNumericInput.js +0 -32
  42. package/dist/components/custom-mobile-date-picker/CustomBottomSheet.d.ts +0 -9
  43. package/dist/components/custom-mobile-date-picker/CustomBottomSheet.js +0 -29
  44. package/dist/components/custom-mobile-date-picker/CustomMobileDatePicker.d.ts +0 -19
  45. package/dist/components/custom-mobile-date-picker/CustomMobileDatePicker.js +0 -98
  46. package/dist/components/custom-mobile-date-picker/DatePickerBottomSheet.d.ts +0 -19
  47. package/dist/components/custom-mobile-date-picker/DatePickerBottomSheet.js +0 -40
  48. package/dist/components/custom-mobile-date-picker/ItemPicker.d.ts +0 -10
  49. package/dist/components/custom-mobile-date-picker/ItemPicker.js +0 -72
  50. package/dist/components/custom-modal/CustomModal.d.ts +0 -21
  51. package/dist/components/custom-modal/CustomModal.js +0 -38
  52. package/dist/components/custom-pagination/custom-pagination-1/CustomPagination1.d.ts +0 -9
  53. package/dist/components/custom-pagination/custom-pagination-1/CustomPagination1.js +0 -13
  54. package/dist/components/custom-pagination/custom-pagination-2/CustomPagination2.d.ts +0 -20
  55. package/dist/components/custom-pagination/custom-pagination-2/CustomPagination2.js +0 -33
  56. package/dist/components/custom-progress/LinearBufferProgress.d.ts +0 -6
  57. package/dist/components/custom-progress/LinearBufferProgress.js +0 -14
  58. package/dist/components/custom-stepper/CustomStepper.d.ts +0 -31
  59. package/dist/components/custom-stepper/CustomStepper.js +0 -170
  60. package/dist/components/custom-table/CustomTable.d.ts +0 -55
  61. package/dist/components/custom-table/CustomTable.js +0 -50
  62. package/dist/components/custom-table/components/CustomTableBody.d.ts +0 -21
  63. package/dist/components/custom-table/components/CustomTableBody.js +0 -11
  64. package/dist/components/custom-table/components/CustomTableCell.d.ts +0 -8
  65. package/dist/components/custom-table/components/CustomTableCell.js +0 -23
  66. package/dist/components/custom-table/components/CustomTableHead.d.ts +0 -17
  67. package/dist/components/custom-table/components/CustomTableHead.js +0 -63
  68. package/dist/components/custom-table/components/CustomTableRow.d.ts +0 -26
  69. package/dist/components/custom-table/components/CustomTableRow.js +0 -102
  70. package/dist/components/custom-table/components/useTable.d.ts +0 -24
  71. package/dist/components/custom-table/components/useTable.js +0 -77
  72. package/dist/components/custom-tabs/CustomTabs.d.ts +0 -22
  73. package/dist/components/custom-tabs/CustomTabs.js +0 -70
  74. package/dist/components/custom-uploader/CustomUploader.d.ts +0 -23
  75. package/dist/components/custom-uploader/CustomUploader.js +0 -68
  76. package/dist/components/error boundary/ErrorComponent.d.ts +0 -7
  77. package/dist/components/error boundary/ErrorComponent.js +0 -6
  78. package/dist/components/error boundary/withErrorBoundary.d.ts +0 -7
  79. package/dist/components/error boundary/withErrorBoundary.js +0 -10
  80. package/dist/components/index.d.ts +0 -183
  81. package/dist/components/index.js +0 -70
  82. package/dist/components/input-list/Form.d.ts +0 -21
  83. package/dist/components/input-list/Form.js +0 -19
  84. package/dist/components/input-list/InputListWithUseForm.d.ts +0 -22
  85. package/dist/components/input-list/InputListWithUseForm.js +0 -22
  86. package/dist/components/input-list/UseFormInput.d.ts +0 -11
  87. package/dist/components/input-list/UseFormInput.js +0 -50
  88. package/dist/components/input-list/checkbox-list/CheckboxList.d.ts +0 -19
  89. package/dist/components/input-list/checkbox-list/CheckboxList.js +0 -30
  90. package/dist/components/input-list/components/UFAutoComplete.d.ts +0 -9
  91. package/dist/components/input-list/components/UFAutoComplete.js +0 -41
  92. package/dist/components/input-list/components/UFCheckbox.d.ts +0 -19
  93. package/dist/components/input-list/components/UFCheckbox.js +0 -21
  94. package/dist/components/input-list/components/UFCurrency.d.ts +0 -9
  95. package/dist/components/input-list/components/UFCurrency.js +0 -47
  96. package/dist/components/input-list/components/UFDatePicker.d.ts +0 -9
  97. package/dist/components/input-list/components/UFDatePicker.js +0 -17
  98. package/dist/components/input-list/components/UFDatePickerMobile.d.ts +0 -9
  99. package/dist/components/input-list/components/UFDatePickerMobile.js +0 -6
  100. package/dist/components/input-list/components/UFMultiCheckbox.d.ts +0 -9
  101. package/dist/components/input-list/components/UFMultiCheckbox.js +0 -17
  102. package/dist/components/input-list/components/UFMultiSelect.d.ts +0 -9
  103. package/dist/components/input-list/components/UFMultiSelect.js +0 -56
  104. package/dist/components/input-list/components/UFRadio.d.ts +0 -9
  105. package/dist/components/input-list/components/UFRadio.js +0 -19
  106. package/dist/components/input-list/components/UFSelect.d.ts +0 -9
  107. package/dist/components/input-list/components/UFSelect.js +0 -19
  108. package/dist/components/input-list/components/UFSwitch.d.ts +0 -19
  109. package/dist/components/input-list/components/UFSwitch.js +0 -99
  110. package/dist/components/input-list/components/UFTextArea.d.ts +0 -9
  111. package/dist/components/input-list/components/UFTextArea.js +0 -12
  112. package/dist/components/input-list/components/UFTextField.d.ts +0 -11
  113. package/dist/components/input-list/components/UFTextField.js +0 -29
  114. package/dist/components/input-list/components/UFTime.d.ts +0 -10
  115. package/dist/components/input-list/components/UFTime.js +0 -93
  116. package/dist/components/input-list/components/UFUploader.d.ts +0 -9
  117. package/dist/components/input-list/components/UFUploader.js +0 -41
  118. package/dist/components/input-list/type.d.ts +0 -165
  119. package/dist/components/input-list/type.js +0 -1
  120. package/dist/components/otp-input/OTPInput.d.ts +0 -19
  121. package/dist/components/otp-input/OTPInput.js +0 -161
  122. package/dist/components/rich-tooltip/RichTooltip.d.ts +0 -18
  123. package/dist/components/rich-tooltip/RichTooltip.js +0 -32
  124. package/dist/context/FormContext.d.ts +0 -16
  125. package/dist/context/FormContext.js +0 -8
  126. package/dist/icons/Add.d.ts +0 -7
  127. package/dist/icons/Add.js +0 -3
  128. package/dist/icons/ArrowDown.d.ts +0 -7
  129. package/dist/icons/ArrowDown.js +0 -3
  130. package/dist/icons/ArrowLeft1.d.ts +0 -7
  131. package/dist/icons/ArrowLeft1.js +0 -3
  132. package/dist/icons/ArrowRight1.d.ts +0 -7
  133. package/dist/icons/ArrowRight1.js +0 -3
  134. package/dist/icons/Calendar.d.ts +0 -7
  135. package/dist/icons/Calendar.js +0 -3
  136. package/dist/icons/CloseCircle.d.ts +0 -7
  137. package/dist/icons/CloseCircle.js +0 -3
  138. package/dist/icons/DocumentDownload.d.ts +0 -7
  139. package/dist/icons/DocumentDownload.js +0 -3
  140. package/dist/icons/Eye.d.ts +0 -7
  141. package/dist/icons/Eye.js +0 -3
  142. package/dist/icons/EyeSlash.d.ts +0 -7
  143. package/dist/icons/EyeSlash.js +0 -3
  144. package/dist/icons/FolderAdd.d.ts +0 -7
  145. package/dist/icons/FolderAdd.js +0 -3
  146. package/dist/icons/InfoCircle.d.ts +0 -7
  147. package/dist/icons/InfoCircle.js +0 -3
  148. package/dist/icons/Tick.d.ts +0 -7
  149. package/dist/icons/Tick.js +0 -3
  150. package/dist/icons/Trash.d.ts +0 -7
  151. package/dist/icons/Trash.js +0 -3
  152. package/dist/icons/Union.d.ts +0 -7
  153. package/dist/icons/Union.js +0 -3
  154. package/dist/icons/Warning2.d.ts +0 -7
  155. package/dist/icons/Warning2.js +0 -3
  156. package/dist/index.d.ts +0 -8
  157. package/dist/index.js +0 -8
  158. package/dist/methods/debounce.d.ts +0 -3
  159. package/dist/methods/debounce.js +0 -20
  160. package/dist/methods/general.d.ts +0 -2
  161. package/dist/methods/general.js +0 -32
  162. package/dist/mui/Alert/Alert.d.ts +0 -2
  163. package/dist/mui/Alert/Alert.js +0 -13
  164. package/dist/mui/AutoComplete/MuiAutoComplete.d.ts +0 -2
  165. package/dist/mui/AutoComplete/MuiAutoComplete.js +0 -27
  166. package/dist/mui/BreadCrumbs/MuiBreadCrumbs.d.ts +0 -2
  167. package/dist/mui/BreadCrumbs/MuiBreadCrumbs.js +0 -31
  168. package/dist/mui/Button/MuiButton.d.ts +0 -7
  169. package/dist/mui/Button/MuiButton.js +0 -185
  170. package/dist/mui/Card/MuiCard.d.ts +0 -2
  171. package/dist/mui/Card/MuiCard.js +0 -7
  172. package/dist/mui/Checkbox/Checkbox.d.ts +0 -2
  173. package/dist/mui/Checkbox/Checkbox.js +0 -31
  174. package/dist/mui/Checkbox/assets/CheckedIcon.d.ts +0 -8
  175. package/dist/mui/Checkbox/assets/CheckedIcon.js +0 -12
  176. package/dist/mui/Checkbox/assets/IntermediateIcon.d.ts +0 -8
  177. package/dist/mui/Checkbox/assets/IntermediateIcon.js +0 -10
  178. package/dist/mui/Checkbox/assets/UnChekedIcon.d.ts +0 -7
  179. package/dist/mui/Checkbox/assets/UnChekedIcon.js +0 -9
  180. package/dist/mui/Chip/MuiChip.d.ts +0 -10
  181. package/dist/mui/Chip/MuiChip.js +0 -35
  182. package/dist/mui/Dialog/MuiDialog.d.ts +0 -7
  183. package/dist/mui/Dialog/MuiDialog.js +0 -22
  184. package/dist/mui/FormControl/MuiFormControlLabel.d.ts +0 -2
  185. package/dist/mui/FormControl/MuiFormControlLabel.js +0 -13
  186. package/dist/mui/IconButton/MuiIconButon.d.ts +0 -2
  187. package/dist/mui/IconButton/MuiIconButon.js +0 -7
  188. package/dist/mui/InputAdornment/MuiInputAdornment.d.ts +0 -2
  189. package/dist/mui/InputAdornment/MuiInputAdornment.js +0 -6
  190. package/dist/mui/InputLabel/MuiInputLabel.d.ts +0 -2
  191. package/dist/mui/InputLabel/MuiInputLabel.js +0 -43
  192. package/dist/mui/Pagination/MuiPagination.d.ts +0 -2
  193. package/dist/mui/Pagination/MuiPagination.js +0 -15
  194. package/dist/mui/Pagination/MuiPaginationItem.d.ts +0 -2
  195. package/dist/mui/Pagination/MuiPaginationItem.js +0 -15
  196. package/dist/mui/Radio/MuiRadio.d.ts +0 -2
  197. package/dist/mui/Radio/MuiRadio.js +0 -17
  198. package/dist/mui/Select/MuiSelect.d.ts +0 -2
  199. package/dist/mui/Select/MuiSelect.js +0 -47
  200. package/dist/mui/Switch/MuiSwitch.d.ts +0 -2
  201. package/dist/mui/Switch/MuiSwitch.js +0 -83
  202. package/dist/mui/Tabs/MuiTabs.d.ts +0 -2
  203. package/dist/mui/Tabs/MuiTabs.js +0 -21
  204. package/dist/mui/Tabs/Tab/MuiTab.d.ts +0 -2
  205. package/dist/mui/Tabs/Tab/MuiTab.js +0 -26
  206. package/dist/mui/TextField/MuiFilledInput.d.ts +0 -2
  207. package/dist/mui/TextField/MuiFilledInput.js +0 -91
  208. package/dist/mui/TextField/MuiOutlinedInput.d.ts +0 -2
  209. package/dist/mui/TextField/MuiOutlinedInput.js +0 -66
  210. package/dist/mui/TextField/TextField.d.ts +0 -2
  211. package/dist/mui/TextField/TextField.js +0 -78
  212. package/dist/mui/Tooltip/MuiTooltip.d.ts +0 -2
  213. package/dist/mui/Tooltip/MuiTooltip.js +0 -26
  214. package/dist/mui/Typography/MuiTypography.d.ts +0 -2
  215. package/dist/mui/Typography/MuiTypography.js +0 -9
  216. package/dist/mui/Typography/index.d.ts +0 -2
  217. package/dist/mui/Typography/index.js +0 -138
  218. package/dist/mui/accordion/MuiAccodrion.d.ts +0 -2
  219. package/dist/mui/accordion/MuiAccodrion.js +0 -13
  220. package/dist/mui/breakpoints/index.d.ts +0 -9
  221. package/dist/mui/breakpoints/index.js +0 -9
  222. package/dist/mui/menu/MuiMenu.d.ts +0 -2
  223. package/dist/mui/menu/MuiMenu.js +0 -8
  224. package/dist/mui/menu/MuiMenuItem.d.ts +0 -2
  225. package/dist/mui/menu/MuiMenuItem.js +0 -14
  226. package/dist/mui/mui-css-baseline/index.d.ts +0 -3
  227. package/dist/mui/mui-css-baseline/index.js +0 -37
  228. package/dist/mui/palette/dark/darkPalette.d.ts +0 -2
  229. package/dist/mui/palette/dark/darkPalette.js +0 -135
  230. package/dist/mui/palette/light/lightPalette.d.ts +0 -2
  231. package/dist/mui/palette/light/lightPalette.js +0 -135
  232. package/dist/nextjs/NextCacheProvider.d.ts +0 -7
  233. package/dist/nextjs/NextCacheProvider.js +0 -13
  234. package/dist/react/ReactCacheProvider.d.ts +0 -7
  235. package/dist/react/ReactCacheProvider.js +0 -15
  236. package/dist/theme/theme.d.ts +0 -3
  237. package/dist/theme/theme.js +0 -75
  238. package/dist/types/palette.d.ts +0 -60
  239. package/dist/types/palette.js +0 -1
  240. package/dist/types/types.d.ts +0 -102
  241. package/dist/types/types.js +0 -4
  242. package/dist/types/typography.d.ts +0 -71
  243. package/dist/types/typography.js +0 -1
@@ -1,17 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { Controller } from 'react-hook-form';
3
- import CustomDatePicker from "../../custom-date-picker/CustomDatePicker";
4
- import { useFormContext } from "../../../context/FormContext";
5
- import { deepMerge } from "../../../methods/general";
6
- const UFDatePicker = ({ form, rules, disabled, defaultValue, name, label, error, withoutHelperText, variant, inputLabelMode = 'static', props, itemProps, readonly }) => {
7
- const { theme } = useFormContext();
8
- return (
9
- //ToDo date picker issue on grid should be resolved
10
- _jsx(Controller, { control: form?.control, name: name, rules: { ...rules }, defaultValue: defaultValue, render: ({ field: { onChange, name, value } }) => (_jsx(_Fragment, { children: _jsx(CustomDatePicker, { readOnly: readonly, textFieldProps: {
11
- id: name,
12
- variant: variant,
13
- ...itemProps,
14
- sx: { width: '100%' },
15
- }, error: error, disabled: disabled, value: value, onChange: onChange, inputLabelMode: inputLabelMode, withoutHelperText: withoutHelperText, label: label, ...deepMerge(theme?.datePicker?.datePickerProps, props) }) })) }));
16
- };
17
- export default UFDatePicker;
@@ -1,9 +0,0 @@
1
- import { FC } from 'react';
2
- import { IDatePickerMobileForm } from '../type';
3
- import { UseFormReturn } from 'react-hook-form';
4
- type Props = IDatePickerMobileForm & {
5
- form: UseFormReturn<any>;
6
- error: any;
7
- };
8
- declare const UFDatePickerMobile: FC<Props>;
9
- export default UFDatePickerMobile;
@@ -1,6 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { CustomDatePickerMobile } from '../../index';
3
- const UFDatePickerMobile = (props) => {
4
- return (_jsx(CustomDatePickerMobile, { ...props, defaultValue: props.form.getValues(props.name) || props.defaultValue }));
5
- };
6
- export default UFDatePickerMobile;
@@ -1,9 +0,0 @@
1
- import { FC } from "react";
2
- import { UseFormReturn } from "react-hook-form";
3
- import { IMultiCheckboxForm } from "../type";
4
- type UFMultiCheckboxProps = IMultiCheckboxForm & {
5
- form: UseFormReturn<any>;
6
- error: any;
7
- };
8
- declare const UFMultiCheckbox: FC<UFMultiCheckboxProps>;
9
- export default UFMultiCheckbox;
@@ -1,17 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import FormControl from "@mui/material/FormControl";
3
- import Typography from "@mui/material/Typography";
4
- import { Controller } from "react-hook-form";
5
- import CheckboxList from "../checkbox-list/CheckboxList";
6
- import { useFormContext } from "../../../context/FormContext";
7
- import { deepMerge } from "../../../methods/general";
8
- const UFMultiCheckbox = ({ form, error, rules, disabled, withoutHelperText, helperText, name, options, multiple, props, itemProps, }) => {
9
- const { theme } = useFormContext();
10
- const multiCheckboxMergedProps = deepMerge(theme?.multiCheckbox?.multiCheckboxProps, itemProps, props);
11
- return (_jsx(Controller, { control: form?.control, name: name, rules: { ...rules }, render: ({ field }) => (_jsxs(FormControl, { sx: { display: "flex", ...(disabled && { filter: "contrast(0.3)" }) }, children: [_jsx(CheckboxList, { multiple: multiple, options: options, ...field, ...multiCheckboxMergedProps }), !withoutHelperText && (_jsx(Typography, { sx: {
12
- height: 23,
13
- width: "max-content",
14
- color: error ? "error.4" : "text.primary",
15
- }, children: error?.message ?? helperText ?? " " }))] })) }));
16
- };
17
- export default UFMultiCheckbox;
@@ -1,9 +0,0 @@
1
- import { FC } from "react";
2
- import { UseFormReturn } from "react-hook-form";
3
- import { IMultiSelectForm } from "../type";
4
- type Props = IMultiSelectForm & {
5
- form: UseFormReturn<any>;
6
- error: any;
7
- };
8
- declare const UFMultiSelect: FC<Props>;
9
- export default UFMultiSelect;
@@ -1,56 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useState } from "react";
3
- //@3rd Party
4
- import { Controller } from "react-hook-form";
5
- //----------------------------------------------------------------------------------
6
- //@Mui
7
- import Stack from "@mui/material/Stack";
8
- import MenuItem from "@mui/material/MenuItem";
9
- import InputLabel from "@mui/material/InputLabel";
10
- import ListItemText from "@mui/material/ListItemText";
11
- import FormControl from "@mui/material/FormControl";
12
- import Typography from "@mui/material/Typography";
13
- import TextField from "@mui/material/TextField";
14
- import { useFormContext } from "../../../context/FormContext";
15
- import { deepMerge } from "../../../methods/general";
16
- const UFMultiSelect = ({ form, error, placeholder, rules, disabled, name, options, defaultValue, readonly, props, itemProps, helperText, variant = "outlined", withoutHelperText, inputLabelMode, label, }) => {
17
- const { theme } = useFormContext();
18
- const [optionValues, setOptionValues] = useState([]);
19
- const selectedItems = (value) => options?.find((option) => option?.value === value)?.label;
20
- return (_jsx(Controller, { control: form?.control, name: name, rules: { ...rules }, defaultValue: defaultValue, render: ({ field }) => (_jsx(_Fragment, { children: _jsxs(FormControl, { fullWidth: true, children: [placeholder && (_jsx(InputLabel, { id: "simple-select-label", sx: {
21
- "&.MuiInputLabel-root[data-shrink=true]": { opacity: "0%" },
22
- "&.MuiInputLabel-root[data-shrink=false]": {
23
- opacity: "100%",
24
- },
25
- }, children: placeholder })), _jsx(TextField, { select: true, ...(inputLabelMode === "static" && { hiddenLabel: true }), ...(inputLabelMode === "relative" && { label: label }), ...field, fullWidth: true, value: optionValues, id: name, disabled: disabled, defaultValue: defaultValue, variant: variant, error: !!error, SelectProps: {
26
- multiple: true,
27
- value: optionValues,
28
- renderValue: (selected) => (_jsx(Stack, { gap: 1, height: "100%", alignItems: "center", direction: "row", flexWrap: "wrap", sx: {
29
- ...(optionValues.includes(selected) && {
30
- backgroundColor: "background.main",
31
- }),
32
- }, children: _jsx(Typography, { children: selected
33
- .map((value) => selectedItems(value))
34
- .join(",") }) })),
35
- }, inputProps: { readOnly: readonly }, helperText: withoutHelperText
36
- ? undefined
37
- : error?.message ?? helperText ?? " ", sx: {
38
- ".MuiInputBase-root": {
39
- paddingRight: (theme) => theme.spacing(2),
40
- },
41
- // ...sx,
42
- // pointerEvents: readonly ? "none" : "unset",
43
- // backgroundColor: readonly ? "background.paper" : "unset",
44
- // "& .MuiOutlinedInput-input.MuiSelect-select": {
45
- // backgroundColor: readonly ? "background.paper" : "unset",
46
- // color: readonly ? "text.5" : "unset",
47
- // },
48
- }, ...deepMerge(theme?.multiSelect?.multiSelectProps, itemProps, props), children: options?.map(({ label, value }) => {
49
- return (_jsx(MenuItem, { value: value, id: label, sx: { transition: "all 0.2s" }, onClick: () => {
50
- !optionValues.includes(value)
51
- ? setOptionValues([value, ...optionValues])
52
- : setOptionValues(optionValues.filter((optionValue) => optionValue !== value));
53
- }, children: _jsx(ListItemText, { primary: label, color: "red", sx: { flex: "none", mx: "4px" }, disableTypography: true }) }, value));
54
- }) })] }) })) }));
55
- };
56
- export default UFMultiSelect;
@@ -1,9 +0,0 @@
1
- import { FC } from "react";
2
- import { IRadioForm } from "../type";
3
- import { UseFormReturn } from "react-hook-form";
4
- type TRadioProps = IRadioForm & {
5
- form: UseFormReturn<any>;
6
- error: any;
7
- };
8
- declare const UFRadio: FC<TRadioProps>;
9
- export default UFRadio;
@@ -1,19 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Controller } from "react-hook-form";
3
- import FormControlLabel from "@mui/material/FormControlLabel";
4
- import FormControl from "@mui/material/FormControl";
5
- import Typography from "@mui/material/Typography";
6
- import RadioGroup from "@mui/material/RadioGroup";
7
- import Radio from "@mui/material/Radio";
8
- import { useFormContext } from "../../../context/FormContext";
9
- import { deepMerge } from "../../../methods/general";
10
- const UFRadio = ({ form, name, rules, disabled, defaultValue, options, error, helperText, withoutHelperText, label, labelProps, inputLabelMode, formControlLabelProps, radioProps, itemProps, radioGroupProps }) => {
11
- const { theme } = useFormContext();
12
- return (_jsx(Controller, { control: form?.control, name: name, rules: { ...rules }, defaultValue: defaultValue, render: ({ field: { onChange, value } }) => (_jsxs(FormControl, { sx: { display: "block" }, children: [inputLabelMode === "relative" && (_jsx(Typography, { ...labelProps, children: label })), _jsx(RadioGroup, { row: true, "aria-labelledby": "demo-row-radio-buttons-group-label", name: "row-radio-buttons-group", onChange: onChange, value: value, sx: { gap: 5 }, ...deepMerge(theme?.radio?.radioGroupProps, radioGroupProps), children: options?.map((option) => (_jsx(FormControlLabel, { disabled: disabled, value: option.value, control: _jsx(Radio, { ...deepMerge(theme?.radio?.radioProps, itemProps, radioProps), checked: value === option.value }), label: _jsx(Typography, { fontWeight: 400, fontSize: 12, ...option.labelProp, children: option.label }), ...deepMerge(theme?.radio?.formControlLabelProps, formControlLabelProps) }, option.value))) }), !withoutHelperText && (_jsx(Typography, { sx: {
13
- display: "block",
14
- height: 23,
15
- width: "max-content",
16
- color: error ? "error.4" : "text.primary",
17
- }, children: error?.message ?? helperText ?? " " }))] })) }));
18
- };
19
- export default UFRadio;
@@ -1,9 +0,0 @@
1
- import { FC } from "react";
2
- import { UseFormReturn } from "react-hook-form";
3
- import { ISelectForm } from "../type";
4
- type TSelectProps = ISelectForm & {
5
- form: UseFormReturn<any>;
6
- error: any;
7
- };
8
- declare const UFSelect: FC<TSelectProps>;
9
- export default UFSelect;
@@ -1,19 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
- import FormControl from "@mui/material/FormControl";
3
- import { TextField } from "@mui/material";
4
- import MenuItem from "@mui/material/MenuItem";
5
- import { Controller } from "react-hook-form";
6
- import { useFormContext } from "../../../context/FormContext";
7
- import { deepMerge } from "../../../methods/general";
8
- const UFSelect = ({ form, error, rules, disabled, name, options, defaultValue = "", readonly, props, itemProps, helperText, variant = "outlined", withoutHelperText, inputLabelMode, label, }) => {
9
- const { theme } = useFormContext() || {};
10
- return (_jsx(Controller, { control: form?.control, name: name, rules: { ...rules }, defaultValue: defaultValue, render: ({ field }) => (_jsx(_Fragment, { children: _jsx(FormControl, { fullWidth: true, variant: variant, children: _jsx(TextField, { select: true, ...field, error: !!error, value: field.value, id: name, fullWidth: true, ...inputLabelMode === "static" && { hiddenLabel: true }, ...inputLabelMode === "relative" && { label: label }, disabled: disabled, defaultValue: defaultValue, variant: variant, helperText: withoutHelperText
11
- ? undefined
12
- : error?.message ?? helperText ?? " ", InputProps: { readOnly: readonly
13
- }, sx: {
14
- ".MuiInputBase-root": {
15
- paddingRight: (theme) => theme.spacing(2),
16
- },
17
- }, ...deepMerge(theme?.select?.selectProps, itemProps, props), children: options?.map((option) => (_jsx(MenuItem, { value: option.value, id: option.value, children: option.label }, option.value))) }) }) })) }));
18
- };
19
- export default UFSelect;
@@ -1,19 +0,0 @@
1
- import { FC } from 'react';
2
- import { TypographyProps, SwitchProps } from '@mui/material';
3
- import { UseFormReturn } from 'react-hook-form';
4
- import { ISwitchForm } from '../type';
5
- export interface ICustomSwitchProps {
6
- inputProps?: SwitchProps['inputProps'];
7
- slotProps?: {
8
- typography?: TypographyProps;
9
- };
10
- switchProps?: SwitchProps;
11
- checkedSvgIcon: string;
12
- unCheckedSvgIcon: string;
13
- }
14
- type Props = ISwitchForm & {
15
- form: UseFormReturn<any>;
16
- error?: any;
17
- };
18
- declare const UFSwitch: FC<Props>;
19
- export default UFSwitch;
@@ -1,99 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Switch } from '@mui/material';
3
- import { Controller } from 'react-hook-form';
4
- import FormControl from '@mui/material/FormControl';
5
- import FormControlLabel from '@mui/material/FormControlLabel';
6
- import Typography from '@mui/material/Typography';
7
- const UFSwitch = ({ form, name, label, rules, disabled, error, defaultValue, helperText, withoutHelperText, props, }) => {
8
- return (_jsx(Controller, { control: form?.control, name: name, rules: { ...rules }, defaultValue: defaultValue, render: ({ field: { onChange, name, value = false } }) => (_jsxs(FormControl, { sx: {
9
- display: 'flex',
10
- ...(disabled && { filter: 'contrast(0.3)' }),
11
- }, children: [_jsx(FormControlLabel, { slotProps: {
12
- typography: {
13
- variant: 'caption3',
14
- ...props?.slotProps?.typography,
15
- },
16
- }, control: _jsx(Switch, { disableRipple: true, checked: value, onChange: (e) => {
17
- return onChange(e.target.checked);
18
- }, disabled: disabled, name: name, sx: {
19
- width: 48,
20
- height: 24,
21
- padding: 0,
22
- margin: 0,
23
- overflow: 'hidden',
24
- '& .MuiSwitch-switchBase': {
25
- padding: 0,
26
- margin: 0.5,
27
- '&:hover': {
28
- boxShadow: 'none',
29
- },
30
- '&.Mui-checked': {
31
- transform: 'translateX(24px)',
32
- '& .MuiSwitch-thumb': {
33
- backgroundColor: 'primary.6',
34
- // borderColor: '#005BD3',
35
- width: 20,
36
- height: 20,
37
- '&::before': {
38
- content: "''",
39
- position: 'absolute',
40
- width: 20,
41
- height: 20,
42
- borderRadius: '100%',
43
- left: '50%',
44
- top: '50%',
45
- transform: 'translate(-50%,-50%)',
46
- backgroundRepeat: 'no-repeat',
47
- backgroundPosition: 'center',
48
- backgroundImage: `url(${props?.checkedSvgIcon})`,
49
- backgroundSize: 'auto',
50
- },
51
- },
52
- '& + .MuiSwitch-track': {
53
- opacity: 1,
54
- border: '1px solid',
55
- borderColor: 'primary.6',
56
- padding: 0.5,
57
- backgroundColor: 'primary.3',
58
- height: 'auto',
59
- borderRadius: 20 / 2,
60
- },
61
- },
62
- },
63
- '& .MuiSwitch-thumb': {
64
- border: 0,
65
- // borderColor: 'grey.11',
66
- backgroundColor: 'grey.11',
67
- width: 20,
68
- height: 20,
69
- '&::before': {
70
- content: "''",
71
- position: 'absolute',
72
- backgroundRepeat: 'no-repeat',
73
- backgroundPosition: 'center',
74
- backgroundImage: `url(${props?.unCheckedSvgIcon})`,
75
- backgroundSize: 'auto',
76
- width: 20,
77
- height: 20,
78
- borderRadius: '100%',
79
- top: '50%',
80
- left: '50%',
81
- right: 'unset',
82
- transform: 'translate(-50%,-50%)',
83
- },
84
- },
85
- '& .MuiSwitch-track': {
86
- opacity: 1,
87
- border: '1px solid',
88
- borderColor: 'grey.11',
89
- padding: 0.5,
90
- backgroundColor: 'grey.7',
91
- height: 'auto',
92
- },
93
- }, inputProps: props?.inputProps, ...props?.switchProps }), label: label }), !withoutHelperText && (_jsx(Typography, { variant: 'caption3', sx: {
94
- height: 23,
95
- width: 'max-content',
96
- color: error ? 'error.4' : 'text.primary',
97
- }, children: error?.message ?? helperText ?? ' ' }))] })) }));
98
- };
99
- export default UFSwitch;
@@ -1,9 +0,0 @@
1
- import { FC } from 'react';
2
- import { ITextAreaForm } from '../type';
3
- import { UseFormReturn } from 'react-hook-form';
4
- type Props = ITextAreaForm & {
5
- form: UseFormReturn<any>;
6
- error: any;
7
- };
8
- declare const UFTextArea: FC<Props>;
9
- export default UFTextArea;
@@ -1,12 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Controller } from 'react-hook-form';
3
- import TextField from '@mui/material/TextField';
4
- import { useFormContext } from "../../../context/FormContext";
5
- import { deepMerge } from "../../../methods/general";
6
- const UFTextArea = ({ form, name, type, defaultValue, rules, readonly, disabled, placeholder, error, props, helperText, variant = 'outlined', withoutHelperText, inputLabelMode, label, }) => {
7
- const { theme } = useFormContext() || {};
8
- return (_jsx(Controller, { control: form?.control, name: name, rules: { ...rules }, defaultValue: defaultValue || '', render: ({ field: { name, value } }) => (_jsx(TextField, { ...form?.register(name, {
9
- ...rules,
10
- }), type: type, value: value, ...(inputLabelMode === 'static' && { hiddenLabel: true }), ...(inputLabelMode === 'relative' && { label: label }), fullWidth: true, multiline: true, rows: 3, id: name, error: !!error, placeholder: placeholder, helperText: withoutHelperText ? undefined : error?.message ?? helperText ?? ' ', "aria-readonly": readonly, disabled: disabled, variant: variant, inputProps: { readOnly: readonly }, ...deepMerge(theme?.textArea?.textAreaProps, props) })) }));
11
- };
12
- export default UFTextArea;
@@ -1,11 +0,0 @@
1
- import { FC } from "react";
2
- import { UseFormReturn } from "react-hook-form";
3
- import { ITextFieldForm } from "../type";
4
- type Props = ITextFieldForm & {
5
- form: UseFormReturn<any>;
6
- error: any;
7
- };
8
- export declare const p2e: (s: string) => boolean;
9
- export declare const checkIfNumber: (value: string) => boolean;
10
- declare const UFTextField: FC<Props>;
11
- export default UFTextField;
@@ -1,29 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Controller } from "react-hook-form";
3
- import TextField from "@mui/material/TextField";
4
- import { useFormContext } from '../../../context/FormContext';
5
- import { deepMerge } from '../../../methods/general';
6
- export const p2e = (s) => /^[0-9 | \u06F0-\u06F9\s][.\d | \u06F0-\u06F9\s]*(,\d+)?$/g.test(s);
7
- export const checkIfNumber = (value) => {
8
- const charLength = value.length;
9
- return !charLength || p2e(value);
10
- };
11
- const UFTextField = ({ form, name, type = 'text', defaultValue, label, rules, readonly, disabled, placeholder, error, itemProps, props, helperText, variant = "outlined", withoutHelperText, inputLabelMode, }) => {
12
- const { theme } = useFormContext();
13
- const themeProp = theme?.[type];
14
- const textFieldMergedProps = deepMerge(themeProp, itemProps, props);
15
- const handleKeyDown = (e, onChange) => {
16
- const value = e?.target?.value;
17
- if (type === "number" &&
18
- !checkIfNumber(value)) {
19
- e.preventDefault();
20
- }
21
- else {
22
- onChange(value);
23
- }
24
- };
25
- return (_jsx(Controller, { control: form?.control, name: name, rules: { ...rules }, defaultValue: defaultValue || "", render: ({ field }) => (_jsx(TextField, { ...form?.register(name, {
26
- ...rules,
27
- }), ...(inputLabelMode === "static" && { hiddenLabel: true }), ...(inputLabelMode === "relative" && { label: label }), value: field.value, variant: variant, type: type === "number" ? "text" : type, fullWidth: true, id: name, error: !!error, placeholder: placeholder, onChange: (e) => handleKeyDown(e, field.onChange), helperText: withoutHelperText ? undefined : error?.message ?? helperText ?? " ", "aria-readonly": readonly, disabled: disabled, inputProps: { readOnly: readonly }, ...textFieldMergedProps })) }));
28
- };
29
- export default UFTextField;
@@ -1,10 +0,0 @@
1
- import { FC } from 'react';
2
- import { UseFormReturn } from 'react-hook-form';
3
- import { ITimeForm } from '../type';
4
- type Props = ITimeForm & {
5
- form: UseFormReturn<any>;
6
- error: any;
7
- };
8
- export declare const convertTimeToDate: (time: string, defaultDate?: Date) => Date;
9
- declare const UFTime: FC<Props>;
10
- export default UFTime;
@@ -1,93 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Controller, } from 'react-hook-form';
3
- import Box from '@mui/material/Box';
4
- import { Stack, TextField, Typography } from '@mui/material';
5
- import { deepMerge } from "../../../methods/general";
6
- export const convertTimeToDate = (time, defaultDate = new Date()) => {
7
- // Split the time string into hours and minutes
8
- const [hours = 0, minutes = 0] = time ? time?.split(':').map(Number) : [];
9
- // Clone the defaultDate to avoid modifying it
10
- const resultDate = new Date(defaultDate);
11
- // Set the time on the cloned date
12
- resultDate.setHours(hours, minutes, 0, 0);
13
- return resultDate;
14
- };
15
- const UFTime = ({ form, name, defaultValue, label, rules, readonly, disabled, placeholder, error, helperText, variant = 'outlined', withoutHelperText, inputLabelMode, props, hourProp, minuteProp, itemProps }) => {
16
- const validateTime = (value) => {
17
- if (!value)
18
- return true;
19
- const [hours, minutes] = value ? value.split(':') : [];
20
- return (/^\d{1,2}$/.test(hours) &&
21
- +hours >= 0 &&
22
- +hours <= 23 &&
23
- /^\d{1,2}$/.test(minutes) &&
24
- +minutes >= 0 &&
25
- +minutes <= 59);
26
- };
27
- return (_jsx(Controller, { name: name, control: form.control, defaultValue: defaultValue, rules: { validate: validateTime, ...rules }, render: ({ field, fieldState }) => {
28
- const { value, onChange } = field;
29
- const [hours, minutes] = value ? value?.split(':') : [];
30
- const handleSelectAll = (e) => {
31
- e?.target?.select();
32
- };
33
- const handleHoursChange = (e) => {
34
- const newHours = e.target.value;
35
- if (/^\d{1,2}$/.test(newHours)) {
36
- const clampedHours = Math.min(23, Math.max(0, +newHours)); // Ensure 0–23 range
37
- onChange(`${clampedHours}:${minutes?.padStart(2, '0') || "00"}`);
38
- }
39
- };
40
- const handleMinutesChange = (e) => {
41
- const newMinutes = e.target.value;
42
- if (/^\d{1,2}$/.test(newMinutes)) {
43
- const clampedMinutes = Math.min(59, Math.max(0, +newMinutes)); // Ensure 0–59 range
44
- onChange(`${hours?.padStart(2, '0') || "00"}:${clampedMinutes}`);
45
- }
46
- };
47
- const handleBlur = (value) => {
48
- const numericValue = parseInt(value, 10);
49
- if (!value)
50
- return '00';
51
- if (!isNaN(numericValue) && numericValue < 10) {
52
- return `0${numericValue}`;
53
- }
54
- return value;
55
- };
56
- const mergedHourProps = deepMerge(itemProps, props, hourProp);
57
- const mergedMinuteProps = deepMerge(itemProps, props, minuteProp);
58
- return (_jsxs(Stack, { children: [_jsxs(Box, { display: 'flex', alignItems: 'center', gap: 1, style: { direction: "ltr" }, justifyContent: 'end', children: [_jsx(TextField, { defaultValue: '00', value: hours, onClick: handleSelectAll, onChange: handleHoursChange, onBlur: () => {
59
- const updatedHours = handleBlur(hours);
60
- onChange(`${updatedHours}:${minutes || "00"}`);
61
- }, ...(inputLabelMode === 'static' && { hiddenLabel: true }), ...(inputLabelMode === 'relative' && { label: label }), variant: variant, fullWidth: true, id: name, error: !!error, placeholder: placeholder, "aria-readonly": readonly, disabled: disabled, ...mergedHourProps, sx: {
62
- width: mergedHourProps.size === "small" ? 40 : 50,
63
- '& .MuiInputBase-root.MuiOutlinedInput-root': {
64
- minWidth: 'auto',
65
- padding: 2.5,
66
- justifyContent: 'center',
67
- },
68
- ...mergedHourProps.sx
69
- }, inputProps: {
70
- readOnly: readonly,
71
- inputMode: 'numeric',
72
- style: { padding: 0, textAlign: 'center' },
73
- ...mergedHourProps.inputProps,
74
- } }), _jsx("span", { children: ":" }), _jsx(TextField, { defaultValue: '00', value: minutes, onClick: handleSelectAll, onChange: handleMinutesChange, onBlur: () => {
75
- const updatedMinutes = handleBlur(minutes);
76
- onChange(`${hours || '00'}:${updatedMinutes}`);
77
- }, ...(inputLabelMode === 'static' && { hiddenLabel: true }), ...(inputLabelMode === 'relative' && { label: label }), variant: variant, fullWidth: true, id: name, error: !!error, placeholder: placeholder, "aria-readonly": readonly, disabled: disabled, ...mergedMinuteProps, sx: {
78
- width: mergedMinuteProps.size === "small" ? 40 : 50,
79
- '& .MuiInputBase-root.MuiOutlinedInput-root': {
80
- minWidth: 'auto',
81
- padding: 2.5,
82
- justifyContent: 'center',
83
- },
84
- ...mergedMinuteProps.sx
85
- }, inputProps: {
86
- readOnly: readonly,
87
- inputMode: 'numeric',
88
- style: { padding: 0, textAlign: 'center' },
89
- ...mergedMinuteProps.inputProps,
90
- } })] }), !withoutHelperText && (_jsx(Typography, { variant: 'caption3', color: 'error.4', height: 21, children: error?.message || helperText }))] }));
91
- } }));
92
- };
93
- export default UFTime;
@@ -1,9 +0,0 @@
1
- import { FC } from "react";
2
- import { IUploaderForm } from "../type";
3
- import { UseFormReturn } from "react-hook-form";
4
- type UFUploaderProps = IUploaderForm & {
5
- form: UseFormReturn<any>;
6
- error: any;
7
- };
8
- declare const UFUploader: FC<UFUploaderProps>;
9
- export default UFUploader;
@@ -1,41 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Controller } from "react-hook-form";
3
- import FormControl from "@mui/material/FormControl";
4
- import Typography from "@mui/material/Typography";
5
- import CustomUploader from "../../custom-uploader/CustomUploader";
6
- import Box from "@mui/material/Box";
7
- import { useFormContext } from '../../../context/FormContext';
8
- import { deepMerge } from '../../../methods/general';
9
- const UFUploader = ({ form, error, itemProps, props, rules, disabled, multiple, name, withoutHelperText, helperText, onDelete, }) => {
10
- const { theme } = useFormContext();
11
- const uploaderMergedProps = deepMerge(theme?.uploader?.uploaderProps, itemProps, props);
12
- const handleChange = (addedFiles) => {
13
- const files = form.getValues(name)?.files || [];
14
- const previews = form.getValues(name)?.preview || [];
15
- for (let i = 0; i < addedFiles.length; i++) {
16
- const file = addedFiles[i];
17
- if (!files || files?.findIndex(f => f.name === file.name) < 0) {
18
- files?.push(file);
19
- previews.push(URL.createObjectURL(file));
20
- }
21
- }
22
- form.setValue(name, {
23
- files: Array.from(files),
24
- preview: previews,
25
- });
26
- };
27
- const handleDelete = (index) => {
28
- console.log('index', index);
29
- const files = form.getValues(name)?.files;
30
- const preview = form.getValues(name)?.preview;
31
- const newFiles = files?.filter((_, i) => i !== index);
32
- const newPreview = preview?.filter((_, i) => i !== index);
33
- form.setValue(name, { files: newFiles, preview: newPreview });
34
- };
35
- return (_jsx(Controller, { control: form?.control, name: name, rules: { ...rules }, render: ({ field: { name, value, onBlur } }) => (_jsxs(FormControl, { sx: { display: "flex", ...(disabled && { filter: "contrast(0.3)" }) }, children: [_jsxs(Box, { display: "flex", gap: 2, children: [(multiple || !value?.files?.length) && (_jsx(CustomUploader, { multiple: multiple, ...uploaderMergedProps, inputProps: { name, disabled, onBlur }, onChange: handleChange })), value?.preview?.map((preview, i) => (_jsx(CustomUploader, { multiple: multiple, ...uploaderMergedProps, link: preview, inputProps: { name, disabled, onBlur }, onChange: handleChange, onDeleteDocument: onDelete ? () => onDelete(i) : () => handleDelete(i) })))] }), !withoutHelperText && (_jsx(Typography, { sx: {
36
- height: 23,
37
- width: "max-content",
38
- color: error ? "error.4" : "text.primary",
39
- }, children: error?.message ?? helperText ?? " " }))] })) }));
40
- };
41
- export default UFUploader;