@codezee/sixtify-brahma 0.2.6 → 0.2.7

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 (279) hide show
  1. package/package.json +7 -2
  2. package/.github/workflows/deploy-storybook.yml +0 -40
  3. package/.husky/commit-msg +0 -4
  4. package/.husky/pre-commit +0 -4
  5. package/.husky/pre-push +0 -4
  6. package/.lintstagedrc +0 -5
  7. package/.prettierignore +0 -11
  8. package/.prettierrc +0 -22
  9. package/.vscode/extensions.json +0 -22
  10. package/.vscode/settings.json +0 -17
  11. package/apps/docs/.eslintrc.cjs +0 -4
  12. package/apps/docs/.eslintrc.js +0 -9
  13. package/apps/docs/.storybook/main.ts +0 -23
  14. package/apps/docs/.storybook/preview.tsx +0 -27
  15. package/apps/docs/next-env.d.ts +0 -5
  16. package/apps/docs/next.config.mjs +0 -4
  17. package/apps/docs/package.json +0 -38
  18. package/apps/docs/public/globals.css +0 -25
  19. package/apps/docs/stories/AgGrid/AgGrid.stories.tsx +0 -69
  20. package/apps/docs/stories/AppBar/AppBar.stories.tsx +0 -39
  21. package/apps/docs/stories/Breadcrumbs/Breadcrumbs.stories.tsx +0 -37
  22. package/apps/docs/stories/Button/ButtonGroup.stories.tsx +0 -99
  23. package/apps/docs/stories/Button/button.stories.tsx +0 -99
  24. package/apps/docs/stories/Card/AttendanceCard.stories.tsx +0 -37
  25. package/apps/docs/stories/Card/Card.stories.tsx +0 -39
  26. package/apps/docs/stories/Charts/PieChart.stories.tsx +0 -264
  27. package/apps/docs/stories/Chips/Chip.stories.tsx +0 -141
  28. package/apps/docs/stories/Chips/ChipWithBorder.stories.tsx +0 -18
  29. package/apps/docs/stories/Chips/FilterPill.stories.tsx +0 -24
  30. package/apps/docs/stories/Color/Color.stories.tsx +0 -14
  31. package/apps/docs/stories/Dialog/ButtomDialog.stories.tsx +0 -47
  32. package/apps/docs/stories/Dialog/DeleteDialog.stories.tsx +0 -31
  33. package/apps/docs/stories/Dialog/Dialog.stories.tsx +0 -47
  34. package/apps/docs/stories/Drawer/Drawer.stories.tsx +0 -94
  35. package/apps/docs/stories/FilterList/FilterList.stories.tsx +0 -88
  36. package/apps/docs/stories/FilterList/FilterListV2.stories.tsx +0 -92
  37. package/apps/docs/stories/FormFields/AutoComplete.stories.tsx +0 -87
  38. package/apps/docs/stories/FormFields/CheckBox.stories.tsx +0 -61
  39. package/apps/docs/stories/FormFields/DatePicker.stories.tsx +0 -98
  40. package/apps/docs/stories/FormFields/DateRangePicker.stories.tsx +0 -37
  41. package/apps/docs/stories/FormFields/FileUpload.stories.tsx +0 -83
  42. package/apps/docs/stories/FormFields/ImageUpload.stories.tsx +0 -69
  43. package/apps/docs/stories/FormFields/ListItemButton.stories.tsx +0 -59
  44. package/apps/docs/stories/FormFields/RadioGroupField.stories.tsx +0 -170
  45. package/apps/docs/stories/FormFields/SearchField.stories.tsx +0 -72
  46. package/apps/docs/stories/FormFields/TextField.stories.tsx +0 -111
  47. package/apps/docs/stories/FormFields/TimeField.stories.tsx +0 -82
  48. package/apps/docs/stories/FormFields/TimePicker.stories.tsx +0 -82
  49. package/apps/docs/stories/Indicator/Indicator.stories.tsx +0 -33
  50. package/apps/docs/stories/Indicator/SeverityIndicator.stories.tsx +0 -27
  51. package/apps/docs/stories/Layouts/FormRow.stories.tsx +0 -45
  52. package/apps/docs/stories/PadBox/PadBox.stories.tsx +0 -49
  53. package/apps/docs/stories/Stepper/Stepper.stories.tsx +0 -75
  54. package/apps/docs/stories/Stepper/StepperV2.stories.tsx +0 -44
  55. package/apps/docs/stories/Timeline/AttendanceStatus.stories.tsx +0 -29
  56. package/apps/docs/stories/Timeline/Timeline.stories.tsx +0 -38
  57. package/apps/docs/stories/Tooltip/Tooltip.stories.tsx +0 -30
  58. package/apps/docs/stories/UserProfileMenu/UserProfileMenu.stories.tsx +0 -112
  59. package/apps/docs/tsconfig.json +0 -19
  60. package/commitlint.config.cjs +0 -6
  61. package/index.ts +0 -1
  62. package/packages/eslint-config/README.md +0 -3
  63. package/packages/eslint-config/library.js +0 -88
  64. package/packages/eslint-config/next.js +0 -85
  65. package/packages/eslint-config/package.json +0 -19
  66. package/packages/eslint-config/react-internal.js +0 -89
  67. package/packages/shared-components/.eslintrc.js +0 -10
  68. package/packages/shared-components/package.json +0 -22
  69. package/packages/shared-components/src/Actions/AddAction.tsx +0 -13
  70. package/packages/shared-components/src/Actions/CalendarAction.tsx +0 -13
  71. package/packages/shared-components/src/Actions/ConfigureAction.tsx +0 -13
  72. package/packages/shared-components/src/Actions/DeleteAction.tsx +0 -13
  73. package/packages/shared-components/src/Actions/DownloadAction.tsx +0 -13
  74. package/packages/shared-components/src/Actions/EditAction.tsx +0 -13
  75. package/packages/shared-components/src/Actions/HistoryAction.tsx +0 -13
  76. package/packages/shared-components/src/Actions/index.ts +0 -7
  77. package/packages/shared-components/src/AgGrid/ActionCell/ActionCell.tsx +0 -57
  78. package/packages/shared-components/src/AgGrid/ActionCell/Popover.tsx +0 -32
  79. package/packages/shared-components/src/AgGrid/AgGrid.tsx +0 -93
  80. package/packages/shared-components/src/AgGrid/LoadingCell.tsx +0 -5
  81. package/packages/shared-components/src/AgGrid/index.ts +0 -3
  82. package/packages/shared-components/src/AppBar/AppBar.styled.tsx +0 -25
  83. package/packages/shared-components/src/AppBar/AppBar.tsx +0 -20
  84. package/packages/shared-components/src/AppBar/index.ts +0 -1
  85. package/packages/shared-components/src/Breadcrumbs/Breadcrumbs.tsx +0 -76
  86. package/packages/shared-components/src/Breadcrumbs/index.ts +0 -1
  87. package/packages/shared-components/src/Button/ActionButton.tsx +0 -38
  88. package/packages/shared-components/src/Button/Button.tsx +0 -19
  89. package/packages/shared-components/src/Button/ButtonGroup.tsx +0 -37
  90. package/packages/shared-components/src/Button/index.ts +0 -3
  91. package/packages/shared-components/src/Card/AttendanceCard.tsx +0 -51
  92. package/packages/shared-components/src/Card/Card.tsx +0 -34
  93. package/packages/shared-components/src/Card/CardItem/CardItem.tsx +0 -33
  94. package/packages/shared-components/src/Card/CardItem/CardItemValue.tsx +0 -98
  95. package/packages/shared-components/src/Card/CardItem/index.ts +0 -2
  96. package/packages/shared-components/src/Card/ProfileCard/ProfileCard.tsx +0 -40
  97. package/packages/shared-components/src/Card/ProfileCard/ProfileCardItem/ProfileCardBody.tsx +0 -53
  98. package/packages/shared-components/src/Card/ProfileCard/ProfileCardItem/ProfileCardHeader.tsx +0 -96
  99. package/packages/shared-components/src/Card/index.ts +0 -6
  100. package/packages/shared-components/src/Charts/PieChart.tsx +0 -81
  101. package/packages/shared-components/src/Charts/Skeleton.tsx +0 -36
  102. package/packages/shared-components/src/Charts/index.ts +0 -1
  103. package/packages/shared-components/src/Chips/Chip.tsx +0 -26
  104. package/packages/shared-components/src/Chips/ChipWithBorder.tsx +0 -39
  105. package/packages/shared-components/src/Chips/FilterPill.tsx +0 -47
  106. package/packages/shared-components/src/Chips/index.ts +0 -3
  107. package/packages/shared-components/src/Dialog/BottomDialog.styled.tsx +0 -28
  108. package/packages/shared-components/src/Dialog/BottomDialog.tsx +0 -37
  109. package/packages/shared-components/src/Dialog/DeleteDialog.tsx +0 -48
  110. package/packages/shared-components/src/Dialog/Dialog.tsx +0 -61
  111. package/packages/shared-components/src/Dialog/index.ts +0 -3
  112. package/packages/shared-components/src/Drawer/Bullet.tsx +0 -12
  113. package/packages/shared-components/src/Drawer/CloseDrawer/CloseDrawerMenuItem.tsx +0 -57
  114. package/packages/shared-components/src/Drawer/CloseDrawer/CloseDrawerMenuItemList.tsx +0 -109
  115. package/packages/shared-components/src/Drawer/CloseDrawer/CloseDrawerSubMenuItemList.tsx +0 -124
  116. package/packages/shared-components/src/Drawer/CloseDrawer/MenuItem.tsx +0 -0
  117. package/packages/shared-components/src/Drawer/CloseDrawer/Popover.tsx +0 -45
  118. package/packages/shared-components/src/Drawer/CloseDrawer/Popper.tsx +0 -43
  119. package/packages/shared-components/src/Drawer/Drawer.styled.tsx +0 -51
  120. package/packages/shared-components/src/Drawer/Drawer.tsx +0 -55
  121. package/packages/shared-components/src/Drawer/MenuItem.tsx +0 -75
  122. package/packages/shared-components/src/Drawer/OpenDrawer/OpenDrawerCollapse.tsx +0 -13
  123. package/packages/shared-components/src/Drawer/OpenDrawer/OpenDrawerMenuItem.tsx +0 -46
  124. package/packages/shared-components/src/Drawer/OpenDrawer/OpenDrawerMenuItemList.tsx +0 -197
  125. package/packages/shared-components/src/Drawer/index.ts +0 -1
  126. package/packages/shared-components/src/FilterList/FilterList.tsx +0 -172
  127. package/packages/shared-components/src/FilterList/FilterListV2.tsx +0 -515
  128. package/packages/shared-components/src/FilterList/FilterPopup.tsx +0 -148
  129. package/packages/shared-components/src/FilterList/FilterPopupWrapper.tsx +0 -113
  130. package/packages/shared-components/src/FilterList/FilterTypeWrapper.tsx +0 -58
  131. package/packages/shared-components/src/FilterList/getFormData.ts +0 -29
  132. package/packages/shared-components/src/FilterList/index.ts +0 -5
  133. package/packages/shared-components/src/FormFields/Autocomplete/Autocomplete.tsx +0 -510
  134. package/packages/shared-components/src/FormFields/Autocomplete/Skeleton.tsx +0 -26
  135. package/packages/shared-components/src/FormFields/Autocomplete/index.ts +0 -1
  136. package/packages/shared-components/src/FormFields/CheckBox/CheckBox.styled.tsx +0 -67
  137. package/packages/shared-components/src/FormFields/CheckBox/CheckBox.tsx +0 -44
  138. package/packages/shared-components/src/FormFields/CheckBox/Skeleton.tsx +0 -12
  139. package/packages/shared-components/src/FormFields/CheckBox/index.ts +0 -1
  140. package/packages/shared-components/src/FormFields/DatePicker/DatePicker.tsx +0 -217
  141. package/packages/shared-components/src/FormFields/DatePicker/Skeleton.tsx +0 -28
  142. package/packages/shared-components/src/FormFields/DatePicker/index.ts +0 -1
  143. package/packages/shared-components/src/FormFields/DateRangePicker/DateRangePicker.tsx +0 -96
  144. package/packages/shared-components/src/FormFields/DateRangePicker/Skeleton.tsx +0 -38
  145. package/packages/shared-components/src/FormFields/DateRangePicker/index.ts +0 -1
  146. package/packages/shared-components/src/FormFields/DateTimePicker/DateTimePicker.tsx +0 -250
  147. package/packages/shared-components/src/FormFields/DateTimePicker/Skeleton.tsx +0 -24
  148. package/packages/shared-components/src/FormFields/DateTimePicker/index.ts +0 -1
  149. package/packages/shared-components/src/FormFields/FileUpload/FileNames.tsx +0 -32
  150. package/packages/shared-components/src/FormFields/FileUpload/FileUpload.styled.tsx +0 -22
  151. package/packages/shared-components/src/FormFields/FileUpload/FileUpload.tsx +0 -157
  152. package/packages/shared-components/src/FormFields/FileUpload/Skeleton.tsx +0 -21
  153. package/packages/shared-components/src/FormFields/FileUpload/UploadedFileName.tsx +0 -27
  154. package/packages/shared-components/src/FormFields/FileUpload/index.ts +0 -2
  155. package/packages/shared-components/src/FormFields/ImageUpload/ImageUpload.styled.tsx +0 -16
  156. package/packages/shared-components/src/FormFields/ImageUpload/ImageUpload.tsx +0 -181
  157. package/packages/shared-components/src/FormFields/ImageUpload/ImageUploadView.tsx +0 -65
  158. package/packages/shared-components/src/FormFields/ImageUpload/PhotoCaptureDialog.tsx +0 -74
  159. package/packages/shared-components/src/FormFields/ImageUpload/Skeleton.tsx +0 -31
  160. package/packages/shared-components/src/FormFields/ImageUpload/index.ts +0 -2
  161. package/packages/shared-components/src/FormFields/ListItemButton/ListItemButton.styled.tsx +0 -22
  162. package/packages/shared-components/src/FormFields/ListItemButton/ListItemButton.tsx +0 -52
  163. package/packages/shared-components/src/FormFields/ListItemButton/index.ts +0 -1
  164. package/packages/shared-components/src/FormFields/PasswordField/PasswordField.tsx +0 -50
  165. package/packages/shared-components/src/FormFields/PasswordField/index.ts +0 -1
  166. package/packages/shared-components/src/FormFields/RadioGroupField/RadioGroupField.tsx +0 -105
  167. package/packages/shared-components/src/FormFields/RadioGroupField/Skeleton.tsx +0 -26
  168. package/packages/shared-components/src/FormFields/RadioGroupField/index.ts +0 -1
  169. package/packages/shared-components/src/FormFields/SearchField/SearchField.tsx +0 -21
  170. package/packages/shared-components/src/FormFields/SearchField/index.ts +0 -1
  171. package/packages/shared-components/src/FormFields/Switch/Skeleton.tsx +0 -12
  172. package/packages/shared-components/src/FormFields/Switch/Switch.tsx +0 -33
  173. package/packages/shared-components/src/FormFields/Switch/index.ts +0 -1
  174. package/packages/shared-components/src/FormFields/TextField/Skeleton.tsx +0 -31
  175. package/packages/shared-components/src/FormFields/TextField/TextField.tsx +0 -92
  176. package/packages/shared-components/src/FormFields/TextField/index.ts +0 -1
  177. package/packages/shared-components/src/FormFields/TimeField/Skeleton.tsx +0 -24
  178. package/packages/shared-components/src/FormFields/TimeField/TimeField.tsx +0 -120
  179. package/packages/shared-components/src/FormFields/TimeField/index.ts +0 -1
  180. package/packages/shared-components/src/FormFields/TimePicker/Skeleton.tsx +0 -24
  181. package/packages/shared-components/src/FormFields/TimePicker/TimePicker.tsx +0 -168
  182. package/packages/shared-components/src/FormFields/TimePicker/index.ts +0 -1
  183. package/packages/shared-components/src/FormFields/index.ts +0 -13
  184. package/packages/shared-components/src/Indicator/Indicator.tsx +0 -18
  185. package/packages/shared-components/src/Indicator/SeverityIndicator.tsx +0 -34
  186. package/packages/shared-components/src/Indicator/index.ts +0 -2
  187. package/packages/shared-components/src/Layouts/FormContainer.tsx +0 -6
  188. package/packages/shared-components/src/Layouts/FormGridLayout.tsx +0 -27
  189. package/packages/shared-components/src/Layouts/FormRow/FormRow.styled.tsx +0 -39
  190. package/packages/shared-components/src/Layouts/FormRow/FormRow.tsx +0 -20
  191. package/packages/shared-components/src/Layouts/FormRow/index.ts +0 -1
  192. package/packages/shared-components/src/Layouts/FormSection.tsx +0 -22
  193. package/packages/shared-components/src/Layouts/index.ts +0 -4
  194. package/packages/shared-components/src/Loader/FacebookCircularProgress.tsx +0 -41
  195. package/packages/shared-components/src/Loader/index.ts +0 -1
  196. package/packages/shared-components/src/PadBox/PadBox.tsx +0 -21
  197. package/packages/shared-components/src/PadBox/index.ts +0 -1
  198. package/packages/shared-components/src/Pagination/Pagination.tsx +0 -42
  199. package/packages/shared-components/src/Pagination/index.ts +0 -1
  200. package/packages/shared-components/src/Stepper/Stepper.tsx +0 -54
  201. package/packages/shared-components/src/Stepper/StepperV2.tsx +0 -115
  202. package/packages/shared-components/src/Stepper/StepperV3.tsx +0 -72
  203. package/packages/shared-components/src/Stepper/index.ts +0 -3
  204. package/packages/shared-components/src/Svgs/AppLogo/AppLogoMedium.tsx +0 -65
  205. package/packages/shared-components/src/Svgs/AppLogo/AppLogoSmall.tsx +0 -48
  206. package/packages/shared-components/src/Svgs/ArrowUp.tsx +0 -11
  207. package/packages/shared-components/src/Svgs/Company/CompanyBanner.tsx +0 -480
  208. package/packages/shared-components/src/Svgs/Company/index.ts +0 -1
  209. package/packages/shared-components/src/Svgs/Drawer/SettingIcon.tsx +0 -31
  210. package/packages/shared-components/src/Svgs/Drawer/SvgBankConfig.tsx +0 -36
  211. package/packages/shared-components/src/Svgs/Drawer/SvgConfiguration.tsx +0 -16
  212. package/packages/shared-components/src/Svgs/Drawer/SvgPayroll.tsx +0 -32
  213. package/packages/shared-components/src/Svgs/Drawer/SvgsEmployees.tsx +0 -25
  214. package/packages/shared-components/src/Svgs/Drawer/SvgsOrganization.tsx +0 -36
  215. package/packages/shared-components/src/Svgs/Drawer/SvgsTransaction.tsx +0 -81
  216. package/packages/shared-components/src/Svgs/Drawer/index.ts +0 -7
  217. package/packages/shared-components/src/Svgs/FormAction.tsx +0 -118
  218. package/packages/shared-components/src/Svgs/ImportExcelSuccessIcon.tsx +0 -54
  219. package/packages/shared-components/src/Svgs/LogoIcon.tsx +0 -74
  220. package/packages/shared-components/src/Svgs/SvgAdd.tsx +0 -28
  221. package/packages/shared-components/src/Svgs/SvgCalendar.tsx +0 -89
  222. package/packages/shared-components/src/Svgs/SvgConfigure.tsx +0 -51
  223. package/packages/shared-components/src/Svgs/SvgDelete.tsx +0 -55
  224. package/packages/shared-components/src/Svgs/SvgDownload.tsx +0 -20
  225. package/packages/shared-components/src/Svgs/SvgEmail.tsx +0 -24
  226. package/packages/shared-components/src/Svgs/SvgFilterList.tsx +0 -19
  227. package/packages/shared-components/src/Svgs/SvgNoLogo.tsx +0 -66
  228. package/packages/shared-components/src/Svgs/SvgNoSign.tsx +0 -28
  229. package/packages/shared-components/src/Svgs/SvgPhone.tsx +0 -16
  230. package/packages/shared-components/src/Svgs/SvgsDrop.tsx +0 -44
  231. package/packages/shared-components/src/Svgs/SvgsEdit.tsx +0 -42
  232. package/packages/shared-components/src/Svgs/SvgsHistory.tsx +0 -40
  233. package/packages/shared-components/src/Svgs/SvgsHome.tsx +0 -18
  234. package/packages/shared-components/src/Svgs/SvgsIndicator.tsx +0 -24
  235. package/packages/shared-components/src/Svgs/index.ts +0 -14
  236. package/packages/shared-components/src/Tab/Skeleton.tsx +0 -15
  237. package/packages/shared-components/src/Tab/Tabs.tsx +0 -64
  238. package/packages/shared-components/src/Tab/index.ts +0 -1
  239. package/packages/shared-components/src/Timeline/AttendanceStatus.tsx +0 -56
  240. package/packages/shared-components/src/Timeline/Timeline.tsx +0 -171
  241. package/packages/shared-components/src/Timeline/TimelineTrackSegments.tsx +0 -130
  242. package/packages/shared-components/src/Timeline/index.ts +0 -2
  243. package/packages/shared-components/src/Toast/Toast.tsx +0 -59
  244. package/packages/shared-components/src/Toast/ToastBody.tsx +0 -26
  245. package/packages/shared-components/src/Toast/ToastFooterLink.tsx +0 -19
  246. package/packages/shared-components/src/Toast/Toaster.styled.tsx +0 -76
  247. package/packages/shared-components/src/Toast/Toaster.tsx +0 -21
  248. package/packages/shared-components/src/Toast/index.ts +0 -3
  249. package/packages/shared-components/src/Toast/toasts.tsx +0 -28
  250. package/packages/shared-components/src/Toast/types.ts +0 -13
  251. package/packages/shared-components/src/Tooltip/Tooltip.tsx +0 -36
  252. package/packages/shared-components/src/Tooltip/index.ts +0 -1
  253. package/packages/shared-components/src/UserProfileMenu/UserProfileMenu.styled.tsx +0 -33
  254. package/packages/shared-components/src/UserProfileMenu/UserProfileMenu.tsx +0 -168
  255. package/packages/shared-components/src/UserProfileMenu/index.ts +0 -1
  256. package/packages/shared-components/src/index.ts +0 -25
  257. package/packages/shared-components/src/utils/colorVariant.ts +0 -162
  258. package/packages/shared-components/src/utils/date.ts +0 -25
  259. package/packages/shared-components/src/utils/file.ts +0 -20
  260. package/packages/shared-components/src/utils/fileSizeValidate.ts +0 -5
  261. package/packages/shared-components/src/utils/index.ts +0 -9
  262. package/packages/shared-components/src/utils/theme/colorPalette.ts +0 -112
  263. package/packages/shared-components/src/utils/theme/colorPaletteUI.tsx +0 -44
  264. package/packages/shared-components/src/utils/theme/paletteDark.ts +0 -10
  265. package/packages/shared-components/src/utils/theme/paletteLight.ts +0 -31
  266. package/packages/shared-components/src/utils/theme/theme.ts +0 -297
  267. package/packages/shared-components/src/utils/theme/types.ts +0 -18
  268. package/packages/shared-components/src/utils/theme/typography.ts +0 -52
  269. package/packages/shared-components/src/utils/urlToNestedObject.ts +0 -9
  270. package/packages/shared-components/tsconfig.json +0 -8
  271. package/packages/shared-components/tsconfig.lint.json +0 -8
  272. package/packages/shared-components/turbo/generators/config.ts +0 -33
  273. package/packages/shared-components/turbo/generators/templates/component.hbs +0 -8
  274. package/packages/typescript-config/base.json +0 -20
  275. package/packages/typescript-config/nextjs.json +0 -13
  276. package/packages/typescript-config/package.json +0 -9
  277. package/packages/typescript-config/react-library.json +0 -8
  278. package/pnpm-workspace.yaml +0 -3
  279. package/turbo.json +0 -44
@@ -1,33 +0,0 @@
1
- import {
2
- useController,
3
- type ControllerRenderProps,
4
- type FieldValues,
5
- type UseControllerProps,
6
- } from "react-hook-form";
7
- import type { SwitchProps } from "@mui/material";
8
- import { Switch as MuiSwitch } from "@mui/material";
9
- import { Skeleton } from "./Skeleton";
10
-
11
- export type SwitchFieldProps<P extends FieldValues> = UseControllerProps<P> &
12
- Omit<Omit<SwitchProps, "checked">, keyof ControllerRenderProps<P>> & {
13
- loading?: boolean;
14
- };
15
-
16
- export function Switch<P extends FieldValues>({
17
- name,
18
- rules,
19
- control,
20
- defaultValue,
21
- loading = false,
22
- ...restSwitchProps
23
- }: SwitchFieldProps<P>) {
24
- const {
25
- field: { value = false, ...restField },
26
- } = useController({ name, control, defaultValue, rules });
27
-
28
- if (loading) {
29
- return <Skeleton />;
30
- }
31
-
32
- return <MuiSwitch checked={value} {...restField} {...restSwitchProps} />;
33
- }
@@ -1 +0,0 @@
1
- export * from "./Switch";
@@ -1,31 +0,0 @@
1
- import { Skeleton as MuiSkeleton, Stack } from "@mui/material";
2
-
3
- type SkeletonProps = {
4
- rows?: number;
5
- label?: string;
6
- };
7
-
8
- export const Skeleton = ({ rows, label }: SkeletonProps) => {
9
- const height: number = rows === undefined ? 40 : rows * 23;
10
-
11
- return (
12
- <Stack gap="10px">
13
- {label && (
14
- <MuiSkeleton
15
- width={120}
16
- height="23px"
17
- sx={{
18
- transform: "scale(1)",
19
- }}
20
- />
21
- )}
22
-
23
- <MuiSkeleton
24
- height={`${height}px`}
25
- sx={{
26
- transform: "scale(1)",
27
- }}
28
- />
29
- </Stack>
30
- );
31
- };
@@ -1,92 +0,0 @@
1
- import {
2
- InputLabel,
3
- TextField as MuiTextField,
4
- Stack,
5
- type TextFieldProps as MuiTextFieldProps,
6
- } from "@mui/material";
7
- import type { KeyboardEvent } from "react";
8
- import {
9
- useController,
10
- type ControllerRenderProps,
11
- type FieldValues,
12
- type UseControllerProps,
13
- } from "react-hook-form";
14
- import { Skeleton } from "./Skeleton";
15
-
16
- export type TextFieldProps<P extends FieldValues> = UseControllerProps<P> &
17
- Omit<MuiTextFieldProps, keyof ControllerRenderProps<P>> & {
18
- label?: string;
19
- loading?: boolean;
20
- rows?: number;
21
- isCapitalize?: boolean;
22
- isTrimStartDisabled?: boolean;
23
- };
24
-
25
- export function TextField<P extends FieldValues>({
26
- control,
27
- name,
28
- defaultValue,
29
- label = "",
30
- rules,
31
- type,
32
- required,
33
- disabled,
34
- loading = false,
35
- placeholder = "",
36
- isCapitalize = false,
37
- isTrimStartDisabled = false,
38
- rows,
39
- ...inputFieldProps
40
- }: TextFieldProps<P>) {
41
- const {
42
- field: { value, onChange, ...restField },
43
- } = useController({ name, control, defaultValue, rules });
44
-
45
- const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {
46
- if (event.key === "-" && type === "number") {
47
- event.preventDefault();
48
- }
49
- };
50
-
51
- if (loading) {
52
- return <Skeleton label={label} rows={rows} />;
53
- }
54
-
55
- return (
56
- <Stack gap="10px">
57
- {label && <InputLabel required={required}>{label}</InputLabel>}
58
-
59
- <MuiTextField
60
- disabled={disabled}
61
- required={required}
62
- fullWidth
63
- onKeyDown={handleKeyDown}
64
- placeholder={placeholder || label}
65
- type={type}
66
- inputProps={{
67
- min: 0,
68
- }}
69
- onChange={(event) => {
70
- let value = event.target.value || null;
71
-
72
- if (typeof value === "string" && value.trim() === "") {
73
- value = null;
74
- } else if (!isTrimStartDisabled && typeof value === "string") {
75
- value = value.trimStart();
76
- }
77
-
78
- if (value && type === "number") {
79
- onChange(Number(value));
80
- } else if (isCapitalize) {
81
- onChange(value ? value?.toUpperCase() : null);
82
- } else {
83
- onChange(value);
84
- }
85
- }}
86
- value={typeof value === "string" ? value.trimStart() : (value ?? "")}
87
- {...restField}
88
- {...inputFieldProps}
89
- />
90
- </Stack>
91
- );
92
- }
@@ -1 +0,0 @@
1
- export * from "./TextField";
@@ -1,24 +0,0 @@
1
- import { Skeleton as MuiSkeleton, Stack } from "@mui/material";
2
-
3
- export const Skeleton = ({ label }: { label?: string }) => {
4
- return (
5
- <Stack gap="10px" flex={1}>
6
- {label && (
7
- <MuiSkeleton
8
- width={120}
9
- height="23px"
10
- sx={{
11
- transform: "scale(1)",
12
- }}
13
- />
14
- )}
15
- <MuiSkeleton
16
- height="40px"
17
- width="100%"
18
- sx={{
19
- transform: "scale(1)",
20
- }}
21
- />
22
- </Stack>
23
- );
24
- };
@@ -1,120 +0,0 @@
1
- import { InputLabel, Stack, useTheme } from "@mui/material";
2
- import {
3
- TimeField as MuiTimeField,
4
- type TimeFieldProps as MuiTimeFieldProps,
5
- } from "@mui/x-date-pickers/TimeField";
6
- import { DateTime } from "luxon";
7
- import type {
8
- FieldValues,
9
- Path,
10
- PathValue,
11
- UseControllerProps,
12
- } from "react-hook-form";
13
- import { useController } from "react-hook-form";
14
- import type { PickerValidDate } from "@mui/x-date-pickers/models";
15
- import { Skeleton } from "./Skeleton";
16
-
17
- export type TimeFieldProps<P extends FieldValues> = UseControllerProps<P> &
18
- MuiTimeFieldProps<PickerValidDate> &
19
- Partial<{
20
- label: string;
21
- required: boolean;
22
- disabled: boolean;
23
- error: boolean;
24
- helperText: string;
25
- loading: boolean;
26
- format: string;
27
- isReturnLocalTime: boolean;
28
- isReturnDateWithTime: boolean;
29
- }>;
30
-
31
- export function TimeField<P extends FieldValues>({
32
- control,
33
- defaultValue,
34
- disabled = false,
35
- label,
36
- name,
37
- error,
38
- helperText,
39
- loading = false,
40
- required = false,
41
- rules,
42
- format = "HH:mm",
43
- isReturnLocalTime = false,
44
- isReturnDateWithTime = false,
45
- ...restProps
46
- }: TimeFieldProps<P>) {
47
- const {
48
- field: { value, onChange, ...restField },
49
- } = useController({ name, control, defaultValue, rules });
50
-
51
- const theme = useTheme();
52
-
53
- const { butterflyBlue } = theme.palette.app.color;
54
-
55
- if (error && value && typeof value === "object") {
56
- helperText = "Invalid time";
57
- }
58
-
59
- const pickerValue = value
60
- ? (DateTime.fromISO(value) as PathValue<P, Path<P> & (string | undefined)>)
61
- : null;
62
-
63
- if (loading) {
64
- return <Skeleton label={label} />;
65
- }
66
-
67
- return (
68
- <Stack gap="10px">
69
- {label && (
70
- <InputLabel required={required} disabled={disabled}>
71
- {label}
72
- </InputLabel>
73
- )}
74
- <MuiTimeField<DateTime>
75
- {...restField}
76
- {...restProps}
77
- disabled={disabled}
78
- value={pickerValue}
79
- onChange={(value) => {
80
- if (value?.isValid) {
81
- if (isReturnLocalTime) {
82
- return onChange(value.toFormat(format));
83
- }
84
-
85
- if (isReturnDateWithTime) {
86
- return onChange(value.toUTC().toISO());
87
- }
88
-
89
- onChange(value.toUTC().toISOTime());
90
- } else {
91
- onChange(value);
92
- }
93
- }}
94
- slotProps={{
95
- textField: {
96
- disabled,
97
- helperText,
98
- error,
99
- sx: {
100
- backgroundColor: "white",
101
- "& .Mui-selected": {
102
- backgroundColor: butterflyBlue[900],
103
- borderRadius: "5px",
104
- },
105
- },
106
- },
107
- }}
108
- format={format}
109
- helperText={helperText}
110
- sx={{
111
- backgroundColor: "white",
112
- "& .Mui-selected": {
113
- backgroundColor: butterflyBlue[900],
114
- borderRadius: "5px",
115
- },
116
- }}
117
- />
118
- </Stack>
119
- );
120
- }
@@ -1 +0,0 @@
1
- export * from "./TimeField";
@@ -1,24 +0,0 @@
1
- import { Skeleton as MuiSkeleton, Stack } from "@mui/material";
2
-
3
- export const Skeleton = ({ label }: { label?: string }) => {
4
- return (
5
- <Stack gap="10px" flex={1}>
6
- {label && (
7
- <MuiSkeleton
8
- width={120}
9
- height="23px"
10
- sx={{
11
- transform: "scale(1)",
12
- }}
13
- />
14
- )}
15
- <MuiSkeleton
16
- height="40px"
17
- width="100%"
18
- sx={{
19
- transform: "scale(1)",
20
- }}
21
- />
22
- </Stack>
23
- );
24
- };
@@ -1,168 +0,0 @@
1
- import { InputLabel, Stack, Tooltip, useTheme } from "@mui/material";
2
- import type { TimePickerProps as MuiTimePickerProps } from "@mui/x-date-pickers/TimePicker";
3
- import { TimePicker as MuiTimePicker } from "@mui/x-date-pickers/TimePicker";
4
- import type { PickerValidDate } from "@mui/x-date-pickers/models";
5
- import { DateTime } from "luxon";
6
- import { type ReactElement, useState } from "react";
7
- import type {
8
- FieldValues,
9
- Path,
10
- PathValue,
11
- UseControllerProps,
12
- } from "react-hook-form";
13
- import { useController } from "react-hook-form";
14
- import { Skeleton } from "./Skeleton";
15
-
16
- export type TimePickerProps<P extends FieldValues> = UseControllerProps<P> &
17
- MuiTimePickerProps<PickerValidDate> &
18
- Partial<{
19
- label: string;
20
- required: boolean;
21
- disabled: boolean;
22
- format: string;
23
- error: boolean;
24
- helperText: string;
25
- loading: boolean;
26
- isReturnLocalTime: boolean;
27
- isReturnDateWithTime: boolean;
28
- helperIcon?: ReactElement;
29
- toolTipText?: string;
30
- timeStepsMinutes?: number;
31
- }>;
32
-
33
- export function TimePicker<P extends FieldValues>({
34
- control,
35
- defaultValue,
36
- disabled = false,
37
- label,
38
- readOnly = false,
39
- name,
40
- error = false,
41
- helperText,
42
- loading = false,
43
- required = false,
44
- rules,
45
- format = "HH:mm",
46
- isReturnLocalTime = false,
47
- isReturnDateWithTime = false,
48
- timeStepsMinutes = 1,
49
- helperIcon,
50
- toolTipText,
51
- ...restProps
52
- }: TimePickerProps<P>) {
53
- const {
54
- field: { value, onChange, ...restField },
55
- } = useController({ name, control, defaultValue, rules });
56
-
57
- const [open, setOpen] = useState(false);
58
-
59
- if (error && value && typeof value === "object") {
60
- helperText = "Invalid time";
61
- }
62
-
63
- const theme = useTheme();
64
-
65
- const { butterflyBlue } = theme.palette.app.color;
66
-
67
- const pickerValue = value
68
- ? (DateTime.fromISO(value) as PathValue<P, Path<P> & (string | undefined)>)
69
- : null;
70
-
71
- if (loading) {
72
- return <Skeleton label={label} />;
73
- }
74
-
75
- return (
76
- <Stack gap="10px">
77
- {label && (
78
- <Stack alignItems="center" flexDirection="row" gap="5px">
79
- <InputLabel required={required} disabled={disabled}>
80
- {label}
81
- </InputLabel>
82
- {helperIcon && toolTipText && (
83
- <Tooltip title={toolTipText} placement="bottom">
84
- {helperIcon}
85
- </Tooltip>
86
- )}
87
- </Stack>
88
- )}
89
-
90
- <MuiTimePicker<DateTime>
91
- {...restField}
92
- {...restProps}
93
- disabled={disabled}
94
- readOnly={readOnly}
95
- open={open}
96
- ampm={false}
97
- value={pickerValue}
98
- format={format}
99
- onOpen={() => setOpen(true)}
100
- onClose={() => setOpen(false)}
101
- timeSteps={{ minutes: timeStepsMinutes }}
102
- slotProps={{
103
- textField: {
104
- disabled,
105
- helperText,
106
- error,
107
- sx: {
108
- backgroundColor: "white",
109
- "& .Mui-selected": {
110
- backgroundColor: butterflyBlue[900],
111
- borderRadius: "5px",
112
- },
113
- },
114
- },
115
- popper: {
116
- sx: {
117
- "& .MuiMultiSectionDigitalClockSection-root::after": {
118
- display: "unset",
119
- },
120
- "& .MuiList-padding": {
121
- padding: "10px",
122
- },
123
- "& .MuiMultiSectionDigitalClockSection-item": {
124
- padding: "4px",
125
- },
126
- "& .MuiMultiSectionDigitalClockSection-item.Mui-selected": {
127
- backgroundColor: butterflyBlue[900],
128
- borderRadius: "5px",
129
- },
130
- "& .MuiMultiSectionDigitalClockSection-item.Mui-selected:hover": {
131
- backgroundColor: butterflyBlue[900],
132
- borderRadius: "5px",
133
- },
134
- "& .Mui-selected:hover": {
135
- backgroundColor: butterflyBlue[900],
136
- borderRadius: "5px",
137
- },
138
- "& .MuiMultiSectionDigitalClockSection-item.Mui-selected:focus-visible":
139
- {
140
- backgroundColor: butterflyBlue[900],
141
- borderRadius: "5px",
142
- },
143
- "& .Mui-selected:focus-visible": {
144
- backgroundColor: butterflyBlue[900],
145
- borderRadius: "5px",
146
- },
147
- },
148
- },
149
- }}
150
- onChange={(value) => {
151
- if (value?.isValid) {
152
- if (isReturnLocalTime) {
153
- return onChange(value.toFormat(format));
154
- }
155
-
156
- if (isReturnDateWithTime) {
157
- return onChange(value.toUTC().toISO());
158
- }
159
-
160
- onChange(value.toUTC().toISOTime());
161
- } else {
162
- onChange(value);
163
- }
164
- }}
165
- />
166
- </Stack>
167
- );
168
- }
@@ -1 +0,0 @@
1
- export * from "./TimePicker";
@@ -1,13 +0,0 @@
1
- export * from "./Autocomplete";
2
- export * from "./CheckBox";
3
- export * from "./DatePicker";
4
- export * from "./FileUpload";
5
- export * from "./ImageUpload";
6
- export * from "./ListItemButton";
7
- export * from "./PasswordField";
8
- export * from "./RadioGroupField";
9
- export * from "./SearchField";
10
- export * from "./TextField";
11
- export * from "./TimePicker";
12
- export * from "./TimeField";
13
- export * from "./DateRangePicker";
@@ -1,18 +0,0 @@
1
- import { Stack } from "@mui/material";
2
- import { SvgsIndicator } from "../Svgs/SvgsIndicator";
3
- import { type WorkDayType } from "../utils/colorVariant";
4
-
5
- type IndicatorProps = {
6
- label?: string;
7
- variant?: WorkDayType;
8
- colourCode?: string;
9
- };
10
-
11
- export const Indicator = ({ label, variant, colourCode }: IndicatorProps) => {
12
- return (
13
- <Stack gap="10px" direction="row" alignItems="center">
14
- <SvgsIndicator variant={variant} colourCode={colourCode} />
15
- {label}
16
- </Stack>
17
- );
18
- };
@@ -1,34 +0,0 @@
1
- import { alpha, Box, Stack, Typography } from "@mui/material";
2
- import { PadBox } from "../PadBox";
3
- import CircleIcon from "@mui/icons-material/Circle";
4
-
5
- type SeverityIndicatorProps = {
6
- label: string;
7
- color: string;
8
- isBackground: boolean;
9
- };
10
-
11
- export const SeverityIndicator = ({
12
- color,
13
- label,
14
- isBackground = false,
15
- }: SeverityIndicatorProps) => {
16
- return (
17
- <Box
18
- sx={{
19
- backgroundColor: `${isBackground ? alpha(color, 0.2) : ""}`,
20
- width: "max-content",
21
- borderRadius: "6px",
22
- }}
23
- >
24
- <PadBox padding={{ padding: "5px", paddingX: "8px" }}>
25
- <Stack flexDirection="row" alignItems="center" gap="8px">
26
- <CircleIcon sx={{ color, fontSize: "12px" }} />
27
- <Typography variant="body2" sx={{ fontWeight: 500 }}>
28
- {label}
29
- </Typography>
30
- </Stack>
31
- </PadBox>
32
- </Box>
33
- );
34
- };
@@ -1,2 +0,0 @@
1
- export * from "./Indicator";
2
- export * from "./SeverityIndicator";
@@ -1,6 +0,0 @@
1
- import { Stack } from "@mui/material";
2
- import type { PropsWithChildren } from "react";
3
-
4
- export const FormContainer = ({ children }: PropsWithChildren) => {
5
- return <Stack gap="30px">{children}</Stack>;
6
- };
@@ -1,27 +0,0 @@
1
- import { Grid } from "@mui/material";
2
- import { Children, type ReactNode } from "react";
3
-
4
- type FormGridLayoutProps = {
5
- children: ReactNode;
6
- columns?: number;
7
- };
8
-
9
- export const FormGridLayout = ({
10
- children,
11
- columns = 3,
12
- }: FormGridLayoutProps) => {
13
- return (
14
- <Grid container spacing={2}>
15
- {Children.map(
16
- children,
17
- (child, index) =>
18
- child && (
19
- // eslint-disable-next-line sonarjs/no-array-index-key
20
- <Grid item xs={12 / columns} key={index}>
21
- {child}
22
- </Grid>
23
- )
24
- )}
25
- </Grid>
26
- );
27
- };
@@ -1,39 +0,0 @@
1
- import { Stack } from "@mui/material";
2
- import { styled } from "@mui/material/styles";
3
- import { Children } from "react";
4
-
5
- function calculateWidth(
6
- childrenCount: number,
7
- fullWidth: boolean,
8
- maxColumn: number
9
- ) {
10
- if (maxColumn <= 2 && childrenCount <= 2 && !fullWidth) {
11
- return "calc(50% - 10px)";
12
- }
13
-
14
- if (childrenCount <= 3 && !fullWidth) {
15
- return "calc(33% - 20px)";
16
- }
17
-
18
- return "100%";
19
- }
20
-
21
- export const RowContainerStyled = styled(Stack, {
22
- shouldForwardProp(prop) {
23
- return prop !== "fullWidth";
24
- },
25
- })<{ fullWidth: boolean; maxColumn: number }>(({
26
- children,
27
- fullWidth,
28
- maxColumn,
29
- }) => {
30
- const childrenCount = Children.toArray(children).length;
31
-
32
- const flexBasis = calculateWidth(childrenCount, fullWidth, maxColumn);
33
-
34
- return {
35
- "& > *": {
36
- flexBasis,
37
- },
38
- };
39
- });
@@ -1,20 +0,0 @@
1
- import type { PropsWithChildren } from "react";
2
- import { RowContainerStyled } from "./FormRow.styled";
3
-
4
- export const FormRow = ({
5
- children,
6
- fullWidth = false,
7
- maxColumn = 3,
8
- }: PropsWithChildren<{ fullWidth?: boolean; maxColumn?: number }>) => {
9
- return (
10
- <RowContainerStyled
11
- direction="row"
12
- flexWrap="wrap"
13
- gap="20px"
14
- fullWidth={fullWidth}
15
- maxColumn={maxColumn}
16
- >
17
- {children}
18
- </RowContainerStyled>
19
- );
20
- };
@@ -1 +0,0 @@
1
- export { FormRow } from "./FormRow";