mui-design-system 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/dist/assets/icons/AlertCircle.d.ts +7 -0
  2. package/dist/assets/icons/AlertCircle.js +3 -0
  3. package/dist/assets/icons/Calendar.d.ts +7 -0
  4. package/dist/assets/icons/Calendar.js +3 -0
  5. package/dist/assets/icons/ChevronDown.d.ts +7 -0
  6. package/dist/assets/icons/ChevronDown.js +3 -0
  7. package/dist/assets/icons/DocumentDownload.d.ts +7 -0
  8. package/dist/assets/icons/DocumentDownload.js +3 -0
  9. package/dist/assets/icons/FolderAdd.d.ts +7 -0
  10. package/dist/assets/icons/FolderAdd.js +3 -0
  11. package/dist/assets/icons/InfoCircle.d.ts +7 -0
  12. package/dist/assets/icons/InfoCircle.js +3 -0
  13. package/dist/assets/icons/InfoSquare.d.ts +7 -0
  14. package/dist/assets/icons/InfoSquare.js +3 -0
  15. package/dist/assets/icons/SuccessSquare.d.ts +7 -0
  16. package/dist/assets/icons/SuccessSquare.js +3 -0
  17. package/dist/assets/icons/Trash.d.ts +7 -0
  18. package/dist/assets/icons/Trash.js +3 -0
  19. package/dist/assets/icons/Union.d.ts +7 -0
  20. package/dist/assets/icons/Union.js +3 -0
  21. package/dist/assets/icons/Warning.d.ts +7 -0
  22. package/dist/assets/icons/Warning.js +3 -0
  23. package/dist/colors/index.d.ts +4 -0
  24. package/dist/colors/index.js +93 -0
  25. package/dist/colors/type.d.ts +5 -0
  26. package/dist/colors/type.js +1 -0
  27. package/dist/components/custom-auto-complete/CustomAutoComplete.d.ts +27 -0
  28. package/dist/components/custom-auto-complete/CustomAutoComplete.js +61 -0
  29. package/dist/components/custom-auto-complete/components/AutoCompleteInput.d.ts +21 -0
  30. package/dist/components/custom-auto-complete/components/AutoCompleteInput.js +29 -0
  31. package/dist/components/custom-auto-complete/components/ListBox.d.ts +5 -0
  32. package/dist/components/custom-auto-complete/components/ListBox.js +62 -0
  33. package/dist/components/custom-auto-complete/components/ListRow.d.ts +2 -0
  34. package/dist/components/custom-auto-complete/components/ListRow.js +21 -0
  35. package/dist/components/custom-date-picker/CustomComponent.d.ts +17 -0
  36. package/dist/components/custom-date-picker/CustomComponent.js +26 -0
  37. package/dist/components/custom-date-picker/CustomDatePicker.d.ts +13 -0
  38. package/dist/components/custom-date-picker/CustomDatePicker.js +40 -0
  39. package/dist/components/custom-numeric-input/CustomNumericInput.d.ts +9 -0
  40. package/dist/components/custom-numeric-input/CustomNumericInput.js +32 -0
  41. package/dist/components/custom-pagination/custom-pagination-1/CustomPagination1.d.ts +4 -0
  42. package/dist/components/custom-pagination/custom-pagination-1/CustomPagination1.js +31 -0
  43. package/dist/components/custom-pagination/custom-pagination-1/types.d.ts +6 -0
  44. package/dist/components/custom-pagination/custom-pagination-1/types.js +1 -0
  45. package/dist/components/custom-pagination/custom-pagination-2/CustomPagination2.d.ts +20 -0
  46. package/dist/components/custom-pagination/custom-pagination-2/CustomPagination2.js +31 -0
  47. package/dist/components/custom-progress/LinearBufferProgress.d.ts +6 -0
  48. package/dist/components/custom-progress/LinearBufferProgress.js +14 -0
  49. package/dist/components/custom-table/CustomTable.d.ts +4 -0
  50. package/dist/components/custom-table/CustomTable.js +44 -0
  51. package/dist/components/custom-table/components/CustomTableBody.d.ts +22 -0
  52. package/dist/components/custom-table/components/CustomTableBody.js +29 -0
  53. package/dist/components/custom-table/components/CustomTableCell.d.ts +8 -0
  54. package/dist/components/custom-table/components/CustomTableCell.js +25 -0
  55. package/dist/components/custom-table/components/CustomTableHead.d.ts +19 -0
  56. package/dist/components/custom-table/components/CustomTableHead.js +64 -0
  57. package/dist/components/custom-table/components/CustomTableRow.d.ts +22 -0
  58. package/dist/components/custom-table/components/CustomTableRow.js +105 -0
  59. package/dist/components/custom-table/components/useTable.d.ts +12 -0
  60. package/dist/components/custom-table/components/useTable.js +77 -0
  61. package/dist/components/custom-table/types.d.ts +77 -0
  62. package/dist/components/custom-table/types.js +1 -0
  63. package/dist/components/custom-uploader/CustomUploader.d.ts +23 -0
  64. package/dist/components/custom-uploader/CustomUploader.js +75 -0
  65. package/dist/components/error boundary/ErrorComponent.d.ts +7 -0
  66. package/dist/components/error boundary/ErrorComponent.js +6 -0
  67. package/dist/components/error boundary/withErrorBoundary.d.ts +7 -0
  68. package/dist/components/error boundary/withErrorBoundary.js +10 -0
  69. package/dist/components/form/Form.d.ts +21 -0
  70. package/dist/components/form/Form.js +18 -0
  71. package/dist/components/form/UseFormInput.d.ts +11 -0
  72. package/dist/components/form/UseFormInput.js +41 -0
  73. package/dist/components/form/checkbox-list/CheckboxList.d.ts +19 -0
  74. package/dist/components/form/checkbox-list/CheckboxList.js +30 -0
  75. package/dist/components/form/components/UFAutoComplete.d.ts +9 -0
  76. package/dist/components/form/components/UFAutoComplete.js +41 -0
  77. package/dist/components/form/components/UFCheckbox.d.ts +19 -0
  78. package/dist/components/form/components/UFCheckbox.js +21 -0
  79. package/dist/components/form/components/UFCurrency.d.ts +9 -0
  80. package/dist/components/form/components/UFCurrency.js +47 -0
  81. package/dist/components/form/components/UFDatePicker.d.ts +9 -0
  82. package/dist/components/form/components/UFDatePicker.js +17 -0
  83. package/dist/components/form/components/UFMultiCheckbox.d.ts +9 -0
  84. package/dist/components/form/components/UFMultiCheckbox.js +17 -0
  85. package/dist/components/form/components/UFMultiSelect.d.ts +9 -0
  86. package/dist/components/form/components/UFMultiSelect.js +56 -0
  87. package/dist/components/form/components/UFRadio.d.ts +9 -0
  88. package/dist/components/form/components/UFRadio.js +19 -0
  89. package/dist/components/form/components/UFSelect.d.ts +9 -0
  90. package/dist/components/form/components/UFSelect.js +23 -0
  91. package/dist/components/form/components/UFTextArea.d.ts +9 -0
  92. package/dist/components/form/components/UFTextArea.js +12 -0
  93. package/dist/components/form/components/UFTextField.d.ts +11 -0
  94. package/dist/components/form/components/UFTextField.js +37 -0
  95. package/dist/components/form/components/UFUploader.d.ts +9 -0
  96. package/dist/components/form/components/UFUploader.js +41 -0
  97. package/dist/components/form/type.d.ts +150 -0
  98. package/dist/components/form/type.js +1 -0
  99. package/dist/components/index.d.ts +103 -0
  100. package/dist/components/index.js +47 -0
  101. package/dist/context/FormContext.d.ts +16 -0
  102. package/dist/context/FormContext.js +8 -0
  103. package/dist/index.d.ts +8 -0
  104. package/dist/index.js +7 -0
  105. package/dist/methods/debounce.d.ts +3 -0
  106. package/dist/methods/debounce.js +20 -0
  107. package/dist/methods/general.d.ts +2 -0
  108. package/dist/methods/general.js +32 -0
  109. package/dist/mui/Alert/Alert.d.ts +2 -0
  110. package/dist/mui/Alert/Alert.js +46 -0
  111. package/dist/mui/AutoComplete/MuiAutoComplete.d.ts +2 -0
  112. package/dist/mui/AutoComplete/MuiAutoComplete.js +42 -0
  113. package/dist/mui/Badge/MuiBadge.d.ts +2 -0
  114. package/dist/mui/Badge/MuiBadge.js +68 -0
  115. package/dist/mui/BottomNavigation/MuiBottomNavigation.d.ts +2 -0
  116. package/dist/mui/BottomNavigation/MuiBottomNavigation.js +12 -0
  117. package/dist/mui/BottomNavigation/MuiBottomNavigationAction.d.ts +2 -0
  118. package/dist/mui/BottomNavigation/MuiBottomNavigationAction.js +35 -0
  119. package/dist/mui/BreadCrumbs/MuiBreadCrumbs.d.ts +2 -0
  120. package/dist/mui/BreadCrumbs/MuiBreadCrumbs.js +31 -0
  121. package/dist/mui/Button/MuiButton.d.ts +2 -0
  122. package/dist/mui/Button/MuiButton.js +77 -0
  123. package/dist/mui/Button/containedButton.d.ts +2 -0
  124. package/dist/mui/Button/containedButton.js +32 -0
  125. package/dist/mui/Button/elevatedButton.d.ts +2 -0
  126. package/dist/mui/Button/elevatedButton.js +25 -0
  127. package/dist/mui/Button/outlinedButton.d.ts +2 -0
  128. package/dist/mui/Button/outlinedButton.js +36 -0
  129. package/dist/mui/Button/textButton.d.ts +2 -0
  130. package/dist/mui/Button/textButton.js +32 -0
  131. package/dist/mui/Button/utils.d.ts +23 -0
  132. package/dist/mui/Button/utils.js +42 -0
  133. package/dist/mui/ButtonGroup/ButtonGroup.d.ts +2 -0
  134. package/dist/mui/ButtonGroup/ButtonGroup.js +47 -0
  135. package/dist/mui/Card/MuiCard.d.ts +2 -0
  136. package/dist/mui/Card/MuiCard.js +7 -0
  137. package/dist/mui/Checkbox/Checkbox.d.ts +2 -0
  138. package/dist/mui/Checkbox/Checkbox.js +36 -0
  139. package/dist/mui/Checkbox/assets/CheckedIcon.d.ts +8 -0
  140. package/dist/mui/Checkbox/assets/CheckedIcon.js +6 -0
  141. package/dist/mui/Checkbox/assets/IntermediateIcon.d.ts +9 -0
  142. package/dist/mui/Checkbox/assets/IntermediateIcon.js +5 -0
  143. package/dist/mui/Checkbox/assets/UnChekedIcon.d.ts +7 -0
  144. package/dist/mui/Checkbox/assets/UnChekedIcon.js +8 -0
  145. package/dist/mui/Chip/MuiChip.d.ts +2 -0
  146. package/dist/mui/Chip/MuiChip.js +116 -0
  147. package/dist/mui/Container/MuiContainer.d.ts +2 -0
  148. package/dist/mui/Container/MuiContainer.js +19 -0
  149. package/dist/mui/Dialog/MuiActions.d.ts +2 -0
  150. package/dist/mui/Dialog/MuiActions.js +8 -0
  151. package/dist/mui/Dialog/MuiDialog.d.ts +2 -0
  152. package/dist/mui/Dialog/MuiDialog.js +26 -0
  153. package/dist/mui/Dialog/MuiTitle.d.ts +2 -0
  154. package/dist/mui/Dialog/MuiTitle.js +16 -0
  155. package/dist/mui/FormControl/MuiFormControlLabel.d.ts +2 -0
  156. package/dist/mui/FormControl/MuiFormControlLabel.js +13 -0
  157. package/dist/mui/IconButton/MuiIconButon.d.ts +2 -0
  158. package/dist/mui/IconButton/MuiIconButon.js +170 -0
  159. package/dist/mui/InputAdornment/MuiInputAdornment.d.ts +2 -0
  160. package/dist/mui/InputAdornment/MuiInputAdornment.js +6 -0
  161. package/dist/mui/InputLabel/MuiInputLabel.d.ts +2 -0
  162. package/dist/mui/InputLabel/MuiInputLabel.js +10 -0
  163. package/dist/mui/Pagination/MuiPagination.d.ts +2 -0
  164. package/dist/mui/Pagination/MuiPagination.js +15 -0
  165. package/dist/mui/Pagination/MuiPaginationItem.d.ts +2 -0
  166. package/dist/mui/Pagination/MuiPaginationItem.js +17 -0
  167. package/dist/mui/Radio/MuiRadio.d.ts +2 -0
  168. package/dist/mui/Radio/MuiRadio.js +18 -0
  169. package/dist/mui/Select/MuiSelect.d.ts +2 -0
  170. package/dist/mui/Select/MuiSelect.js +46 -0
  171. package/dist/mui/Switch/MuiSwitch.d.ts +2 -0
  172. package/dist/mui/Switch/MuiSwitch.js +54 -0
  173. package/dist/mui/Tabs/MuiTabs.d.ts +2 -0
  174. package/dist/mui/Tabs/MuiTabs.js +96 -0
  175. package/dist/mui/Tabs/Tab/MuiTab.d.ts +2 -0
  176. package/dist/mui/Tabs/Tab/MuiTab.js +51 -0
  177. package/dist/mui/TextField/MuiFilledInput.d.ts +2 -0
  178. package/dist/mui/TextField/MuiFilledInput.js +96 -0
  179. package/dist/mui/TextField/MuiOutlinedInput.d.ts +2 -0
  180. package/dist/mui/TextField/MuiOutlinedInput.js +70 -0
  181. package/dist/mui/TextField/TextField.d.ts +2 -0
  182. package/dist/mui/TextField/TextField.js +58 -0
  183. package/dist/mui/Tooltip/MuiTooltip.d.ts +2 -0
  184. package/dist/mui/Tooltip/MuiTooltip.js +26 -0
  185. package/dist/mui/Typography/MuiTypography.d.ts +2 -0
  186. package/dist/mui/Typography/MuiTypography.js +9 -0
  187. package/dist/mui/Typography/index.d.ts +2 -0
  188. package/dist/mui/Typography/index.js +66 -0
  189. package/dist/mui/accordion/MuiAccodrion.d.ts +2 -0
  190. package/dist/mui/accordion/MuiAccodrion.js +13 -0
  191. package/dist/mui/breakpoints/index.d.ts +2 -0
  192. package/dist/mui/breakpoints/index.js +9 -0
  193. package/dist/mui/menu/MuiMenu.d.ts +2 -0
  194. package/dist/mui/menu/MuiMenu.js +8 -0
  195. package/dist/mui/menu/MuiMenuItem.d.ts +2 -0
  196. package/dist/mui/menu/MuiMenuItem.js +14 -0
  197. package/dist/mui/mui-css-baseline/index.d.ts +3 -0
  198. package/dist/mui/mui-css-baseline/index.js +37 -0
  199. package/dist/mui/palette/dark/darkPalette.d.ts +2 -0
  200. package/dist/mui/palette/dark/darkPalette.js +72 -0
  201. package/dist/mui/palette/light/lightPalette.d.ts +2 -0
  202. package/dist/mui/palette/light/lightPalette.js +64 -0
  203. package/dist/nextjs/NextCacheProvider.d.ts +7 -0
  204. package/dist/nextjs/NextCacheProvider.js +13 -0
  205. package/dist/react/ReactCacheProvider.d.ts +7 -0
  206. package/dist/react/ReactCacheProvider.js +15 -0
  207. package/dist/theme/theme.d.ts +3 -0
  208. package/dist/theme/theme.js +89 -0
  209. package/dist/types/palette.d.ts +54 -0
  210. package/dist/types/palette.js +1 -0
  211. package/dist/types/types.d.ts +101 -0
  212. package/dist/types/types.js +2 -0
  213. package/dist/types/typography.d.ts +22 -0
  214. package/dist/types/typography.js +1 -0
  215. package/package.json +47 -0
@@ -0,0 +1,7 @@
1
+ import type { SVGProps } from 'react';
2
+ interface Props extends SVGProps<SVGSVGElement> {
3
+ primarycolor?: string;
4
+ secondarycolor?: string;
5
+ }
6
+ declare const SvgAlertCircle: ({ primarycolor, secondarycolor, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export default SvgAlertCircle;
@@ -0,0 +1,3 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ const SvgAlertCircle = ({ primarycolor, secondarycolor, ...props }) => (_jsx("svg", { xmlns: 'http://www.w3.org/2000/svg', viewBox: '0 0 24 24', fill: 'none', ...props, children: _jsx("path", { fill: primarycolor || '#D03430', fillRule: 'evenodd', d: 'M2 12C2 6.48 6.48 2 12 2c5.53 0 10 4.48 10 10s-4.47 10-10 10C6.48 22 2 17.52 2 12Zm9.12-3.79c0-.48.4-.88.88-.88s.87.4.87.88v4.42a.87.87 0 0 1-.87.87.879.879 0 0 1-.88-.87V8.21Zm.89 8.47c-.49 0-.88-.4-.88-.88s.39-.87.87-.87c.49 0 .88.39.88.87s-.39.88-.87.88Z', clipRule: 'evenodd' }) }));
3
+ export default SvgAlertCircle;
@@ -0,0 +1,7 @@
1
+ import type { SVGProps } from "react";
2
+ interface Props extends SVGProps<any> {
3
+ primarycolor?: string;
4
+ secondarycolor?: string;
5
+ }
6
+ declare const SvgCalendar: ({ primarycolor, secondarycolor, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export default SvgCalendar;
@@ -0,0 +1,3 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ const SvgCalendar = ({ primarycolor, secondarycolor, ...props }) => (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, fill: secondarycolor || "none", viewBox: "0 0 24 24", ...props, children: [_jsx("path", { stroke: primarycolor || "#1A1A1A", strokeLinecap: "round", strokeLinejoin: "round", strokeMiterlimit: 10, strokeWidth: 1.5, d: "M8 2v3M16 2v3M3.5 9.09h17M21 8.5V17c0 3-1.5 5-5 5H8c-3.5 0-5-2-5-5V8.5c0-3 1.5-5 5-5h8c3.5 0 5 2 5 5" }), _jsx("path", { stroke: primarycolor || "#1A1A1A", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15.695 13.7h.009M15.695 16.7h.009M11.996 13.7h.008M11.996 16.7h.008M8.294 13.7h.01M8.294 16.7h.01" })] }));
3
+ export default SvgCalendar;
@@ -0,0 +1,7 @@
1
+ import type { SVGProps } from 'react';
2
+ interface Props extends SVGProps<any> {
3
+ primarycolor?: string;
4
+ secondarycolor?: string;
5
+ }
6
+ declare const SvgChevronDown: ({ primarycolor, secondarycolor, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export default SvgChevronDown;
@@ -0,0 +1,3 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ const SvgChevronDown = ({ primarycolor, secondarycolor, ...props }) => (_jsx("svg", { xmlns: 'http://www.w3.org/2000/svg', width: 18, height: 18, fill: secondarycolor || 'none', viewBox: '0 0 24 24', ...props, children: _jsx("path", { fill: '#6A6A6A', d: 'M2.92 5.878a.586.586 0 0 1 .756-.056l.065.056 5.01 4.947 5.008-4.947a.586.586 0 0 1 .756-.056l.065.056a.569.569 0 0 1 .056.746l-.056.065-5.42 5.353a.586.586 0 0 1-.755.055l-.065-.055-5.42-5.353a.569.569 0 0 1 0-.811Z' }) }));
3
+ export default SvgChevronDown;
@@ -0,0 +1,7 @@
1
+ import type { SVGProps } from "react";
2
+ interface Props extends SVGProps<any> {
3
+ primarycolor?: string;
4
+ secondarycolor?: string;
5
+ }
6
+ declare const SvgDocumentDownload: ({ primarycolor, secondarycolor, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export default SvgDocumentDownload;
@@ -0,0 +1,3 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ const SvgDocumentDownload = ({ primarycolor, secondarycolor, ...props }) => (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, fill: secondarycolor || "none", viewBox: "0 0 24 24", ...props, children: [_jsx("path", { stroke: primarycolor || "#1A1A1A", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M9 11v6l2-2M9 17l-2-2" }), _jsx("path", { stroke: primarycolor || "#1A1A1A", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M22 10v5c0 5-2 7-7 7H9c-5 0-7-2-7-7V9c0-5 2-7 7-7h5" }), _jsx("path", { stroke: primarycolor || "#1A1A1A", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M22 10h-4c-3 0-4-1-4-4V2z" })] }));
3
+ export default SvgDocumentDownload;
@@ -0,0 +1,7 @@
1
+ import type { SVGProps } from "react";
2
+ interface Props extends SVGProps<any> {
3
+ primarycolor?: string;
4
+ secondarycolor?: string;
5
+ }
6
+ declare const SvgFolderAdd: ({ primarycolor, secondarycolor, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export default SvgFolderAdd;
@@ -0,0 +1,3 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ const SvgFolderAdd = ({ primarycolor, secondarycolor, ...props }) => (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, fill: secondarycolor || "none", viewBox: "0 0 24 24", ...props, children: [_jsx("path", { stroke: primarycolor || "#1A1A1A", strokeLinecap: "round", strokeLinejoin: "round", strokeMiterlimit: 10, strokeWidth: 1.5, d: "M12.06 16.5v-5M14.5 14h-5" }), _jsx("path", { stroke: primarycolor || "#1A1A1A", strokeMiterlimit: 10, strokeWidth: 1.5, d: "M22 11v6c0 4-1 5-5 5H7c-4 0-5-1-5-5V7c0-4 1-5 5-5h1.5c1.5 0 1.83.44 2.4 1.2l1.5 2c.38.5.6.8 1.6.8h3c4 0 5 1 5 5Z" })] }));
3
+ export default SvgFolderAdd;
@@ -0,0 +1,7 @@
1
+ import type { SVGProps } from "react";
2
+ interface Props extends SVGProps<any> {
3
+ primarycolor?: string;
4
+ secondarycolor?: string;
5
+ }
6
+ declare const SvgInfoCircle: ({ primarycolor, secondarycolor, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export default SvgInfoCircle;
@@ -0,0 +1,3 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ const SvgInfoCircle = ({ primarycolor, secondarycolor, ...props }) => (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, fill: secondarycolor || "none", viewBox: "0 0 24 24", ...props, children: [_jsx("path", { stroke: primarycolor || "#1A1A1A", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M12 22c5.5 0 10-4.5 10-10S17.5 2 12 2 2 6.5 2 12s4.5 10 10 10M12 8v5" }), _jsx("path", { stroke: primarycolor || "#1A1A1A", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M11.995 16h.009" })] }));
3
+ export default SvgInfoCircle;
@@ -0,0 +1,7 @@
1
+ import type { SVGProps } from 'react';
2
+ interface Props extends SVGProps<SVGSVGElement> {
3
+ primarycolor?: string;
4
+ secondarycolor?: string;
5
+ }
6
+ declare const SvgInfoSquare: ({ primarycolor, secondarycolor, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export default SvgInfoSquare;
@@ -0,0 +1,3 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ const SvgInfoSquare = ({ primarycolor, secondarycolor, ...props }) => (_jsx("svg", { xmlns: 'http://www.w3.org/2000/svg', viewBox: '0 0 24 24', fill: 'none', ...props, children: _jsx("path", { fill: '#1B7CD0', fillRule: 'evenodd', d: 'M7.67 2h8.67C19.73 2 22 4.38 22 7.92v8.17c0 3.53-2.27 5.91-5.66 5.91H7.67C4.28 22 2 19.62 2 16.09V7.92C2 4.38 4.28 2 7.67 2Zm4.32 7.06a.87.87 0 0 1-.86-.87.875.875 0 1 1 .86.87Zm.88 6.72c0 .48-.39.87-.88.87a.87.87 0 0 1-.87-.87v-4.42c0-.48.39-.88.87-.88.49 0 .88.4.88.88v4.42Z', clipRule: 'evenodd' }) }));
3
+ export default SvgInfoSquare;
@@ -0,0 +1,7 @@
1
+ import type { SVGProps } from 'react';
2
+ interface Props extends SVGProps<SVGSVGElement> {
3
+ primarycolor?: string;
4
+ secondarycolor?: string;
5
+ }
6
+ declare const SvgSuccessSquare: ({ primarycolor, secondarycolor, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export default SvgSuccessSquare;
@@ -0,0 +1,3 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ const SvgSuccessSquare = ({ primarycolor, secondarycolor, ...props }) => (_jsx("svg", { xmlns: 'http://www.w3.org/2000/svg', viewBox: '0 0 24 24', fill: secondarycolor || 'none', ...props, children: _jsx("path", { fill: primarycolor || '#307232', fillRule: 'evenodd', d: 'M7.67 2h8.67C19.73 2 22 4.38 22 7.92v8.171C22 19.62 19.73 22 16.34 22H7.67C4.28 22 2 19.62 2 16.091V7.92C2 4.38 4.28 2 7.67 2Zm3.76 12.99 4.75-4.75c.34-.34.34-.89 0-1.24a.881.881 0 0 0-1.24 0l-4.13 4.13-1.75-1.75a.881.881 0 0 0-1.24 0c-.34.34-.34.89 0 1.24l2.38 2.37c.17.17.39.25.61.25.23 0 .45-.08.62-.25Z', clipRule: 'evenodd' }) }));
3
+ export default SvgSuccessSquare;
@@ -0,0 +1,7 @@
1
+ import type { SVGProps } from "react";
2
+ interface Props extends SVGProps<any> {
3
+ primarycolor?: string;
4
+ secondarycolor?: string;
5
+ }
6
+ declare const SvgTrash: ({ primarycolor, secondarycolor, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export default SvgTrash;
@@ -0,0 +1,3 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ const SvgTrash = ({ primarycolor, secondarycolor, ...props }) => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, fill: secondarycolor || "none", viewBox: "0 0 24 24", ...props, children: _jsx("path", { stroke: primarycolor || "#1A1A1A", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M21 5.98c-3.33-.33-6.68-.5-10.02-.5-1.98 0-3.96.1-5.94.3L3 5.98M8.5 4.97l.22-1.31C8.88 2.71 9 2 10.69 2h2.62c1.69 0 1.82.75 1.97 1.67l.22 1.3M18.85 9.14l-.65 10.07C18.09 20.78 18 22 15.21 22H8.79C6 22 5.91 20.78 5.8 19.21L5.15 9.14M10.33 16.5h3.33M9.5 12.5h5" }) }));
3
+ export default SvgTrash;
@@ -0,0 +1,7 @@
1
+ import type { SVGProps } from "react";
2
+ interface Props extends SVGProps<any> {
3
+ primarycolor?: string;
4
+ secondarycolor?: string;
5
+ }
6
+ declare const SvgUnion: ({ primarycolor, secondarycolor, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export default SvgUnion;
@@ -0,0 +1,3 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ const SvgUnion = ({ primarycolor, secondarycolor, ...props }) => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: 14, height: 19, fill: secondarycolor || "none", viewBox: "0 0 16 24", ...props, children: _jsx("path", { fill: primarycolor || "#1A1A1A", fillRule: "evenodd", d: "M8.534 2.106a.75.75 0 0 0-1.07-1.052l-6.407 6.52a2.76 2.76 0 0 0 0 3.852l6.407 6.52a.75.75 0 0 0 1.07-1.052l-6.407-6.52a1.26 1.26 0 0 1 0-1.748zm4.977 0a.75.75 0 1 0-1.07-1.052l-6.408 6.52a2.76 2.76 0 0 0 0 3.852l6.408 6.52a.75.75 0 0 0 1.07-1.052l-6.408-6.52a1.26 1.26 0 0 1 0-1.748z", clipRule: "evenodd" }) }));
3
+ export default SvgUnion;
@@ -0,0 +1,7 @@
1
+ import type { SVGProps } from 'react';
2
+ interface Props extends SVGProps<SVGSVGElement> {
3
+ primarycolor?: string;
4
+ secondarycolor?: string;
5
+ }
6
+ declare const SvgWarning: ({ primarycolor, secondarycolor, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export default SvgWarning;
@@ -0,0 +1,3 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ const SvgWarning = ({ primarycolor, secondarycolor, ...props }) => (_jsx("svg", { xmlns: 'http://www.w3.org/2000/svg', fill: 'none', viewBox: '0 0 24 24', ...props, children: _jsx("path", { fill: '#E6C530', fillRule: 'evenodd', d: 'm14.477 4.442 7.269 12.615c.16.377.23.683.25 1.001a2.76 2.76 0 0 1-.73 2.022c-.51.554-1.2.88-1.95.92H4.68c-.31-.019-.62-.09-.91-.198-1.45-.585-2.15-2.23-1.56-3.655L9.53 4.432a2.73 2.73 0 0 1 1.099-1.08 2.85 2.85 0 0 1 3.85 1.09Zm-1.61 8.314c0 .476-.39.873-.87.873a.885.885 0 0 1-.88-.873V9.953c0-.477.4-.862.88-.862s.87.385.87.862v2.803Zm-.87 4.262a.884.884 0 0 1-.88-.872c0-.477.4-.873.88-.873s.87.387.87.862c0 .485-.39.883-.87.883Z', clipRule: 'evenodd' }) }));
3
+ export default SvgWarning;
@@ -0,0 +1,4 @@
1
+ import { IColor, TColors } from './type';
2
+ export declare const colors: {
3
+ [key in TColors]: IColor;
4
+ };
@@ -0,0 +1,93 @@
1
+ const yellow = {
2
+ 50: "#fffbeb",
3
+ 100: "#fef3c0",
4
+ 200: "#feeda2",
5
+ 300: "#fee578",
6
+ 400: "#fde05d",
7
+ 500: "#fdd835",
8
+ 600: "#e6c530",
9
+ 700: "#b49926",
10
+ 800: "#8b771d",
11
+ 900: "#6a5b16"
12
+ };
13
+ const blue = {
14
+ 50: "#e9f3fc",
15
+ 100: "#b9daf7",
16
+ 200: "#98c8f3",
17
+ 300: "#68afee",
18
+ 400: "#4ba0ea",
19
+ 500: "#1e88e5",
20
+ 600: "#1b7cd0",
21
+ 700: "#1561a3",
22
+ 800: "#114b7e",
23
+ 900: "#0d3960"
24
+ };
25
+ const green = {
26
+ 50: "#ecf6ed",
27
+ 100: "#c5e2c6",
28
+ 200: "#a9d3aa",
29
+ 300: "#81bf84",
30
+ 400: "#69b36c",
31
+ 500: "#43a047",
32
+ 600: "#3d9241",
33
+ 700: "#307232",
34
+ 800: "#255827",
35
+ 900: "#1c431e"
36
+ };
37
+ const orange = {
38
+ 50: "#fff4e6",
39
+ 100: "#fedbb0",
40
+ 200: "#fdca8a",
41
+ 300: "#fcb254",
42
+ 400: "#fca333",
43
+ 500: "#fb8c00",
44
+ 600: "#e47f00",
45
+ 700: "#b26300",
46
+ 800: "#8a4d00",
47
+ 900: "#693b00"
48
+ };
49
+ const red = {
50
+ 50: "#fcebeb",
51
+ 100: "#f7c2c0",
52
+ 200: "#f3a4a2",
53
+ 300: "#ee7a78",
54
+ 400: "#ea615d",
55
+ 500: "#e53935",
56
+ 600: "#d03430",
57
+ 700: "#a32826",
58
+ 800: "#7e1f1d",
59
+ 900: "#601816"
60
+ };
61
+ const purple = {
62
+ 50: "#f4e9f7",
63
+ 100: "#dcbbe5",
64
+ 200: "#cb9ad8",
65
+ 300: "#b36cc6",
66
+ 400: "#a550bb",
67
+ 500: "#8e24aa",
68
+ 600: "#81219b",
69
+ 700: "#651a79",
70
+ 800: "#4e145e",
71
+ 900: "#3c0f47"
72
+ };
73
+ const grey = {
74
+ 50: "#f1f1f1",
75
+ 100: "#d4d4d4",
76
+ 200: "#c0c0c0",
77
+ 300: "#a3a3a3",
78
+ 400: "#919191",
79
+ 500: "#757575",
80
+ 600: "#6a6a6a",
81
+ 700: "#535353",
82
+ 800: "#404040",
83
+ 900: "#313131"
84
+ };
85
+ export const colors = {
86
+ yellow,
87
+ blue,
88
+ green,
89
+ orange,
90
+ red,
91
+ purple,
92
+ grey
93
+ };
@@ -0,0 +1,5 @@
1
+ export type ColorScale = "50" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900";
2
+ export type TColors = "yellow" | "blue" | "green" | "orange" | "red" | "purple" | "grey";
3
+ export type IColor = {
4
+ [key in ColorScale]: string;
5
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,27 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { AutocompleteProps } from '@mui/material/Autocomplete';
3
+ import { TextFieldProps } from '@mui/material/TextField';
4
+ import { TextFieldVariants } from '@mui/material';
5
+ import { TInputLabelMode } from '../form/type';
6
+ export interface CustomAutocompleteProps extends Omit<AutocompleteProps<any, boolean, boolean, undefined>, 'renderInput'> {
7
+ label?: string | ReactNode;
8
+ width?: number | string;
9
+ renderInput?: (params: TextFieldProps) => ReactNode;
10
+ isLoading?: boolean;
11
+ variant?: TextFieldVariants;
12
+ showSelectedCount?: boolean;
13
+ selectedOptions?: any[];
14
+ helperText?: string;
15
+ inputMaxHeight?: string;
16
+ placeholder?: string;
17
+ inputLabelMode?: TInputLabelMode;
18
+ hideLabel?: boolean;
19
+ textFieldProps?: TextFieldProps;
20
+ validation?: {
21
+ isInvalid: boolean;
22
+ message: string;
23
+ };
24
+ onReachEnd?: () => void;
25
+ }
26
+ declare const CustomAutoComplete: FC<CustomAutocompleteProps>;
27
+ export default CustomAutoComplete;
@@ -0,0 +1,61 @@
1
+ import { createElement as _createElement } from "react";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import Box from '@mui/material/Box';
4
+ import InputLabel from '@mui/material/InputLabel';
5
+ import Typography from '@mui/material/Typography';
6
+ import Paper from '@mui/material/Paper';
7
+ import Autocomplete from '@mui/material/Autocomplete';
8
+ import { styled } from '@mui/material/styles';
9
+ import { Chip } from '@mui/material';
10
+ import { ListBox } from './components/ListBox';
11
+ import AutoCompleteInput from './components/AutoCompleteInput';
12
+ const AutoCompletePaper = styled(Paper)(({ theme }) => ({
13
+ direction: 'ltr',
14
+ backgroundColor: theme.palette.background.paper,
15
+ '.MuiAutocomplete-option': {
16
+ borderBottom: '1px solid',
17
+ borderColor: theme.palette.divider,
18
+ '&:last-child': {
19
+ borderBottom: 'none',
20
+ },
21
+ },
22
+ }));
23
+ const CustomAutoComplete = ({ label, helperText, options, multiple, disabled, validation, selectedOptions, showSelectedCount, isLoading, inputMaxHeight, width, placeholder, variant, hideLabel = false, inputLabelMode, textFieldProps, onReachEnd, ...rest }) => {
24
+ const loading = isLoading;
25
+ return (_jsxs(Box, { sx: { width }, children: [_jsx(InputLabel, { sx: {
26
+ fontSize: 12,
27
+ color: disabled ? 'text.1' : 'text.primary',
28
+ }, children: inputLabelMode === 'static' && !hideLabel && (_jsx(Typography, { children: label })) }), _jsx(Autocomplete, { loading: loading, limitTags: 2, multiple: multiple, disabled: disabled, options: options || [], disableCloseOnSelect: multiple, disablePortal: Boolean(rest.limitTags), value: rest.value,
29
+ // defaultValue={rest?.defaultValue}
30
+ id: 'virtualize-demo', disableListWrap: true, isOptionEqualToValue: (option, value) => {
31
+ return option?.value === value?.value;
32
+ }, renderOption: (props, option, state) => ({
33
+ props,
34
+ option,
35
+ index: state.index,
36
+ multiple,
37
+ selected: state.selected,
38
+ }), ListboxProps: { onReachEnd }, ListboxComponent: ListBox, renderGroup: (params) => params, noOptionsText: _jsx(Typography, { sx: { color: 'text.primary' }, children: "\u0646\u062A\u06CC\u062C\u0647 \u0627\u06CC \u06CC\u0627\u0641\u062A \u0646\u0634\u062F" }), loadingText: _jsx(Typography, { sx: { color: 'text.primary' }, children: "\u062F\u0631 \u062D\u0627\u0644 \u0628\u0627\u0631\u06AF\u0632\u0627\u0631\u06CC..." }), sx: {
39
+ padding: 0,
40
+ width: '100%',
41
+ ...(disabled && { opacity: 0.7, cursor: 'not-allowed' }),
42
+ }, renderTags: (tagValue, getTagProps) => {
43
+ return tagValue.map((option, index) => {
44
+ // Ensure that the option is an object with both label and value properties
45
+ if (typeof option === 'object' && option.label && option.value) {
46
+ return (_createElement(Chip, { ...getTagProps({ index }), key: index, label: option.label, sx: { height: 26 }, size: 'small', rounded: true }));
47
+ }
48
+ else {
49
+ return null; // Handle invalid cases gracefully
50
+ }
51
+ });
52
+ }, getOptionDisabled: (option) => !!option?.disabled, renderInput: (params) => (_jsx(AutoCompleteInput, { params: params, helperText: helperText, variant: variant, placeholder: placeholder, label: label, isLoading: loading, inputLabelMode: inputLabelMode, inputMaxHeight: inputMaxHeight, textFieldProps: textFieldProps, validation: validation })), PaperComponent: (props) => (_jsx(AutoCompletePaper, { elevation: 1, ...props })), ...rest }), _jsx(Box, { sx: {
53
+ display: 'flex',
54
+ alignItems: 'center',
55
+ justifyContent: 'space-between',
56
+ }, children: multiple &&
57
+ selectedOptions &&
58
+ selectedOptions.length > 0 &&
59
+ showSelectedCount && (_jsxs(Typography, { sx: { mt: 1 }, children: [selectedOptions?.length, " item", selectedOptions?.length > 1 && "'s", " selected"] })) })] }));
60
+ };
61
+ export default CustomAutoComplete;
@@ -0,0 +1,21 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { AutocompleteRenderInputParams, TextFieldVariants } from '@mui/material';
3
+ import { TextFieldProps } from '@mui/material/TextField';
4
+ import { TInputLabelMode } from '../../form/type';
5
+ interface Props {
6
+ params: AutocompleteRenderInputParams;
7
+ variant?: TextFieldVariants;
8
+ placeholder?: string;
9
+ validation?: {
10
+ isInvalid: boolean;
11
+ message: string;
12
+ };
13
+ inputLabelMode?: TInputLabelMode;
14
+ label?: string | ReactNode;
15
+ helperText?: string;
16
+ isLoading?: boolean;
17
+ textFieldProps?: TextFieldProps;
18
+ inputMaxHeight?: string;
19
+ }
20
+ declare const AutoCompleteInput: FC<Props>;
21
+ export default AutoCompleteInput;
@@ -0,0 +1,29 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { InputAdornment, useTheme, } from '@mui/material';
3
+ import CircularProgress from '@mui/material/CircularProgress';
4
+ import TextField from '@mui/material/TextField';
5
+ import InfoCircle from "../../../assets/icons/InfoCircle";
6
+ const AutoCompleteInput = ({ params, variant, validation, placeholder, label, helperText, isLoading, inputLabelMode, textFieldProps, inputMaxHeight }) => {
7
+ const theme = useTheme();
8
+ return (_jsx(TextField, { variant: variant, placeholder: placeholder, error: validation?.isInvalid, ...(inputLabelMode === 'relative' && { label: label }), ...params, helperText: validation?.message
9
+ ? validation?.message ?? helperText ?? ' '
10
+ : undefined, InputProps: {
11
+ ...params.InputProps,
12
+ ...(validation?.isInvalid && {
13
+ startAdornment: (_jsx(InputAdornment, { sx: { pl: 2 }, position: 'start', children: _jsx(InfoCircle, { primarycolor: theme.palette.error.main }) })),
14
+ }),
15
+ endAdornment: (_jsxs(InputAdornment, { position: 'end', children: [isLoading && _jsx(CircularProgress, { color: 'inherit', size: 20 }), params.InputProps.endAdornment] })),
16
+ }, ...textFieldProps, sx: {
17
+ minWidth: 0,
18
+ height: '100%',
19
+ overflow: 'auto',
20
+ '& .MuiFilledInput-root': {
21
+ ...(inputLabelMode === 'relative' && {
22
+ alignItems: 'flex-end',
23
+ }),
24
+ },
25
+ maxHeight: inputMaxHeight ?? 'unset',
26
+ ...textFieldProps?.sx,
27
+ } }));
28
+ };
29
+ export default AutoCompleteInput;
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export declare const LISTBOX_PADDING = 8;
3
+ export declare const ListBox: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
4
+ onReachEnd?: (() => void) | undefined;
5
+ } & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,62 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ // Adapter for react-window
3
+ import { useTheme } from '@mui/material';
4
+ import useMediaQuery from '@mui/material/useMediaQuery';
5
+ import * as React from 'react';
6
+ import { VariableSizeList } from 'react-window';
7
+ import { ListRow } from './ListRow';
8
+ import debounce from "../../../methods/debounce";
9
+ export const LISTBOX_PADDING = 8; // px
10
+ export const ListBox = React.forwardRef(function ListBox(props, ref) {
11
+ const { children, onReachEnd, ...other } = props;
12
+ const itemData = [];
13
+ children.forEach((item) => {
14
+ itemData.push(item);
15
+ itemData.push(...(item.children || []));
16
+ });
17
+ const theme = useTheme();
18
+ const smUp = useMediaQuery(theme.breakpoints.up('sm'), {
19
+ noSsr: true,
20
+ });
21
+ const itemCount = itemData.length;
22
+ const itemSize = smUp ? 36 : 48;
23
+ const getHeight = () => {
24
+ if (itemCount > 8) {
25
+ return 8 * itemSize;
26
+ }
27
+ return itemData.map(() => itemSize).reduce((a, b) => a + b, 0);
28
+ };
29
+ const OuterElementContext = React.createContext({});
30
+ const OuterElementType = React.forwardRef((props, ref) => {
31
+ const outerProps = React.useContext(OuterElementContext);
32
+ return _jsx("div", { ref: ref, ...props, ...outerProps });
33
+ });
34
+ function useResetCache(data) {
35
+ const ref = React.useRef(null);
36
+ React.useEffect(() => {
37
+ if (ref.current != null) {
38
+ ref.current.resetAfterIndex(0, true);
39
+ }
40
+ }, [data]);
41
+ return ref;
42
+ }
43
+ const gridRef = useResetCache(itemCount);
44
+ const handleReachEnd = () => {
45
+ if (onReachEnd) {
46
+ onReachEnd();
47
+ }
48
+ };
49
+ const debouncedReachEnd = debounce(handleReachEnd, 100);
50
+ const handleScroll = ({ scrollDirection, scrollOffset, scrollUpdateWasRequested, }) => {
51
+ if (!scrollUpdateWasRequested &&
52
+ scrollDirection === 'forward' &&
53
+ gridRef?.current) {
54
+ const listHeight = +gridRef.current.props.height;
55
+ const totalHeight = gridRef.current.props?.itemSize(1) * itemCount;
56
+ if (scrollOffset + listHeight >= totalHeight) {
57
+ debouncedReachEnd();
58
+ }
59
+ }
60
+ };
61
+ return (_jsx("div", { ref: ref, children: _jsx(OuterElementContext.Provider, { value: other, children: _jsx(VariableSizeList, { itemData: itemData, height: getHeight() + 2 * LISTBOX_PADDING, width: '100%', ref: gridRef, outerElementType: OuterElementType, innerElementType: 'ul', itemSize: () => itemSize, overscanCount: 5, itemCount: itemCount, style: { direction: 'inherit' }, onScroll: handleScroll, children: ListRow }) }) }));
62
+ });
@@ -0,0 +1,2 @@
1
+ import { ListChildComponentProps } from 'react-window';
2
+ export declare function ListRow(props: ListChildComponentProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createElement as _createElement } from "react";
3
+ import Typography from '@mui/material/Typography';
4
+ import { LISTBOX_PADDING } from './ListBox';
5
+ import { Checkbox } from '@mui/material';
6
+ export function ListRow(props) {
7
+ const { data, index, style } = props;
8
+ const dataSet = data[index];
9
+ const inlineStyle = {
10
+ ...style,
11
+ top: style.top + LISTBOX_PADDING,
12
+ };
13
+ const { props: optionProps, option, multiple, selected } = dataSet || {};
14
+ return (_createElement("li", { ...optionProps, key: option.value, style: inlineStyle },
15
+ multiple && _jsx(Checkbox, { checked: selected, sx: { opacity: 'inherit' } }),
16
+ _jsx(Typography, { children: option?.label }))
17
+ // <Typography key={key} component="li" {...optionProps} noWrap style={inlineStyle}>
18
+ // {option?.label}
19
+ // </Typography>
20
+ );
21
+ }
@@ -0,0 +1,17 @@
1
+ import { FC } from "react";
2
+ import { TextFieldVariants } from "@mui/material";
3
+ import { BaseTextFieldProps } from "@mui/material/TextField/TextField";
4
+ import { TInputLabelMode } from "../form/type";
5
+ interface Props extends BaseTextFieldProps {
6
+ openCalendar: any;
7
+ value?: any;
8
+ handleValueChange?: () => void;
9
+ disabled?: boolean;
10
+ error?: any;
11
+ readonly?: boolean;
12
+ variant?: TextFieldVariants;
13
+ inputLabelMode: TInputLabelMode;
14
+ withoutHelperText?: boolean;
15
+ }
16
+ declare const CustomComponent: FC<Props>;
17
+ export default CustomComponent;
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { InputAdornment, TextField } from "@mui/material";
3
+ import SvgCalendar from "../../assets/icons/Calendar";
4
+ const CustomComponent = ({ openCalendar, value, handleValueChange, disabled, error, readonly, variant, lang, placeholder, inputLabelMode, label, withoutHelperText, ...rest }) => {
5
+ const { sx, helperText, ...props } = rest;
6
+ return (_jsx(TextField, { placeholder: placeholder ?? lang === "fa" ? "انتخاب کنید" : "Pick a date", error: Boolean(error), ...(inputLabelMode === "static" && { hiddenLabel: true }), ...(inputLabelMode === "relative" && { label: label }), fullWidth: true, variant: variant, sx: {
7
+ borderRadius: "8px",
8
+ pointerEvents: readonly ? "none" : "unset",
9
+ "& .MuiOutlinedInput-input ,& .MuiOutlinedInput-root": {
10
+ borderRadius: "8px",
11
+ },
12
+ "& .MuiFormHelperText-root": {
13
+ position: "absolute",
14
+ top: 55,
15
+ left: 0,
16
+ },
17
+ ...sx,
18
+ }, InputProps: {
19
+ endAdornment: (_jsx(InputAdornment, { position: "end", sx: {
20
+ stroke: (theme) => readonly
21
+ ? `${theme.palette.text.disabled} !important`
22
+ : "text.primary",
23
+ }, children: _jsx(SvgCalendar, { primarycolor: "inherit" }) })),
24
+ }, disabled: disabled, value: value, onFocus: openCalendar, onClick: openCalendar, onChange: handleValueChange, helperText: withoutHelperText ? undefined : error?.message ?? helperText ?? " ", ...props }));
25
+ };
26
+ export default CustomComponent;
@@ -0,0 +1,13 @@
1
+ import { FC } from "react";
2
+ import { CalendarProps } from "react-multi-date-picker";
3
+ import { BaseTextFieldProps } from "@mui/material/TextField/TextField";
4
+ import { TInputLabelMode } from "../form/type";
5
+ export interface ICustomDatePickerProps extends CalendarProps {
6
+ error: any;
7
+ textFieldProps?: BaseTextFieldProps;
8
+ inputLabelMode: TInputLabelMode;
9
+ label: string;
10
+ withoutHelperText?: boolean;
11
+ }
12
+ declare const CustomDatePicker: FC<ICustomDatePickerProps>;
13
+ export default CustomDatePicker;
@@ -0,0 +1,40 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useEffect, useState } from "react";
3
+ import DatePicker from "react-multi-date-picker";
4
+ import CustomComponent from "./CustomComponent";
5
+ import persian from "react-date-object/calendars/persian";
6
+ import persian_fa from "react-date-object/locales/persian_fa";
7
+ const CustomDatePicker = ({ onChange, value, disabled, error, readOnly, textFieldProps, label, inputLabelMode, withoutHelperText, ...rest }) => {
8
+ const handleChange = (selectedDates) => {
9
+ if (onChange && selectedDates) {
10
+ const convertDate = new Date(selectedDates.toDate());
11
+ onChange(convertDate);
12
+ }
13
+ };
14
+ // let lang: string = document.documentElement.lang;
15
+ let lang = 'fa';
16
+ // const { palette } = useTheme();
17
+ const [portalTarget, setPortalTaget] = useState();
18
+ // useEffect(() => {
19
+ // setColors(palette);
20
+ // lang = document.documentElement.lang;
21
+ // }, [palette.mode, document.documentElement.lang]);
22
+ useEffect(() => {
23
+ const portalDiv = document.createElement("div");
24
+ portalDiv.id = "myPortalDiv";
25
+ portalDiv.style.zIndex = "1500";
26
+ portalDiv.style.position = "relative";
27
+ document.body.appendChild(portalDiv);
28
+ setPortalTaget(portalDiv);
29
+ return () => {
30
+ document.body.removeChild(portalDiv);
31
+ };
32
+ }, []);
33
+ const defaultWeekDays = ["ش", "ی", "د", "س", "چ", "پ", "ج"];
34
+ return (_jsx(DatePicker, { className: "custom-calender", value: value ? new Date(value) : null, portal: true, portalTarget: portalTarget, hideOnScroll: true, onChange: handleChange, ...(lang === "fa" && {
35
+ weekDays: defaultWeekDays,
36
+ calendar: persian,
37
+ locale: persian_fa,
38
+ }), calendarPosition: "bottom-left", editable: false, disabled: disabled, containerStyle: { width: "100%" }, ...rest, render: _jsx(CustomComponent, { lang: lang, error: error, disabled: disabled, readonly: readOnly, label: label, inputLabelMode: inputLabelMode, openCalendar: undefined, value: value, handleValueChange: undefined, withoutHelperText: withoutHelperText, ...textFieldProps }) }));
39
+ };
40
+ export default CustomDatePicker;
@@ -0,0 +1,9 @@
1
+ import { FC, ReactNode } from "react";
2
+ import { TextFieldProps } from "@mui/material/TextField";
3
+ export interface ICustomNumericInputProps extends Omit<TextFieldProps, "onChange" | "value"> {
4
+ onChange?: (value: string | number) => void;
5
+ value?: string | number;
6
+ currencyIcon?: ReactNode;
7
+ }
8
+ declare const CustomNumericInput: FC<ICustomNumericInputProps>;
9
+ export default CustomNumericInput;