@lunit/oui 1.0.0-alpha.9 → 1.0.1-alpha.10

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 (270) hide show
  1. package/dist/components/Alert/Alert.js +1 -1
  2. package/dist/components/Alert/Alert.utils.js +1 -1
  3. package/dist/components/Chip/Chip.js +1 -1
  4. package/dist/components/Chip/Chip.utils.js +1 -1
  5. package/dist/components/DatePicker/DatePicker.js +1 -1
  6. package/dist/components/Dialog/Dialog.js +1 -1
  7. package/dist/components/Dropdown/Dropdown.js +1 -1
  8. package/dist/components/Dropdown/DropdownItem.js +1 -1
  9. package/dist/components/Dropdown/IconDropdown.js +1 -1
  10. package/dist/components/List/List.js +1 -1
  11. package/dist/components/List/ListItem.styled.js +1 -1
  12. package/dist/components/Pagination/Pagination.js +65 -0
  13. package/dist/components/Pagination/Pagination.styled.js +64 -0
  14. package/dist/components/Pagination/Pagination.types.js +2 -0
  15. package/dist/components/Pagination/index.js +2 -0
  16. package/dist/components/ProductLabel/ProductLabel.js +1 -1
  17. package/dist/components/TextField/components/Buttons.js +1 -1
  18. package/dist/components/UploadManager/UploadManager.js +1 -1
  19. package/dist/components/index.js +1 -1
  20. package/dist/foundations/index.js +1 -0
  21. package/dist/foundations/palette.js +4 -0
  22. package/dist/foundations/styles.js +7 -0
  23. package/dist/types/components/Pagination/Pagination.d.ts +3 -0
  24. package/dist/types/components/Pagination/Pagination.styled.d.ts +24 -0
  25. package/dist/types/components/Pagination/Pagination.types.d.ts +35 -0
  26. package/dist/types/components/Pagination/index.d.ts +2 -0
  27. package/dist/types/components/index.d.ts +1 -1
  28. package/dist/types/foundations/index.d.ts +1 -0
  29. package/dist/types/foundations/palette.d.ts +8 -1
  30. package/dist/types/foundations/styles.d.ts +2 -0
  31. package/package.json +7 -11
  32. package/.git-ftp-include +0 -1
  33. package/dist/components/Icons/BellNoti/index.js +0 -14
  34. package/dist/components/Icons/CloseLarge/index.js +0 -14
  35. package/dist/components/Icons/CloseSmall/index.js +0 -14
  36. package/dist/components/Icons/DownloadPdf/index.js +0 -14
  37. package/dist/components/Icons/Ellipse/index.js +0 -14
  38. package/dist/components/Icons/FilterNoti/index.js +0 -14
  39. package/dist/components/Icons/HideLarge/index.js +0 -14
  40. package/dist/components/Icons/HideSmall/index.js +0 -14
  41. package/dist/components/Icons/InformationLarge/index.js +0 -14
  42. package/dist/components/Icons/InformationSmall/index.js +0 -14
  43. package/dist/components/Icons/Manufacturer/index.js +0 -14
  44. package/dist/components/Icons/Rectangle/index.js +0 -14
  45. package/dist/components/Icons/RefreshLeft/index.js +0 -14
  46. package/dist/components/Icons/RefreshRight/index.js +0 -14
  47. package/dist/components/Icons/ShowLarge/index.js +0 -14
  48. package/dist/components/Icons/ShowSmall/index.js +0 -14
  49. package/dist/components/Icons/index.js +0 -180
  50. package/dist/types/components/Icons/BellNoti/index.d.ts +0 -12
  51. package/dist/types/components/Icons/CloseLarge/index.d.ts +0 -12
  52. package/dist/types/components/Icons/CloseSmall/index.d.ts +0 -12
  53. package/dist/types/components/Icons/DownloadPdf/index.d.ts +0 -12
  54. package/dist/types/components/Icons/Ellipse/index.d.ts +0 -12
  55. package/dist/types/components/Icons/FilterNoti/index.d.ts +0 -12
  56. package/dist/types/components/Icons/HideLarge/index.d.ts +0 -12
  57. package/dist/types/components/Icons/HideSmall/index.d.ts +0 -12
  58. package/dist/types/components/Icons/InformationLarge/index.d.ts +0 -12
  59. package/dist/types/components/Icons/InformationSmall/index.d.ts +0 -12
  60. package/dist/types/components/Icons/Manufacturer/index.d.ts +0 -12
  61. package/dist/types/components/Icons/Rectangle/index.d.ts +0 -12
  62. package/dist/types/components/Icons/RefreshLeft/index.d.ts +0 -12
  63. package/dist/types/components/Icons/RefreshRight/index.d.ts +0 -12
  64. package/dist/types/components/Icons/ShowLarge/index.d.ts +0 -12
  65. package/dist/types/components/Icons/ShowSmall/index.d.ts +0 -12
  66. package/dist/types/components/Icons/index.d.ts +0 -179
  67. package/src/assets/ic-bell-noti-outlined-20px.tsx +0 -21
  68. package/src/assets/ic-close-large-outlined-20px.tsx +0 -17
  69. package/src/assets/ic-close-small-outlined-20px.tsx +0 -17
  70. package/src/assets/ic-download-pdf-outlined-20px.tsx +0 -18
  71. package/src/assets/ic-ellipse-outlined-20px.tsx +0 -17
  72. package/src/assets/ic-filter-noti-outlined-20px.tsx +0 -21
  73. package/src/assets/ic-hide-large-outlined-20px.tsx +0 -13
  74. package/src/assets/ic-hide-small-outlined-20px.tsx +0 -17
  75. package/src/assets/ic-information-large-outlined-20px.tsx +0 -17
  76. package/src/assets/ic-information-small-outlined-20px.tsx +0 -17
  77. package/src/assets/ic-manufacturer-outlined-20px.tsx +0 -19
  78. package/src/assets/ic-rectangle-outlined-20px.tsx +0 -17
  79. package/src/assets/ic-refresh-left-outlined-20px.tsx +0 -17
  80. package/src/assets/ic-refresh-right-outlined-20px.tsx +0 -13
  81. package/src/assets/ic-show-large-outlined-20px.tsx +0 -17
  82. package/src/assets/ic-show-small-outlined-20px.tsx +0 -17
  83. package/src/assets/ic_bell_noti=outlined_20px.svg +0 -5
  84. package/src/assets/ic_close_large=outlined_20px.svg +0 -4
  85. package/src/assets/ic_close_small=outlined_20px.svg +0 -4
  86. package/src/assets/ic_download_pdf=outlined_20px.svg +0 -7
  87. package/src/assets/ic_ellipse=outlined_20px.svg +0 -4
  88. package/src/assets/ic_filter_noti=outlined_20px.svg +0 -5
  89. package/src/assets/ic_hide_large=outlined_20px.svg +0 -4
  90. package/src/assets/ic_hide_small=outlined_20px.svg +0 -4
  91. package/src/assets/ic_information_large=outlined_20px.svg +0 -4
  92. package/src/assets/ic_information_small=outlined_20px.svg +0 -4
  93. package/src/assets/ic_manufacturer=outlined_20px.svg +0 -3
  94. package/src/assets/ic_rectangle=outlined_20px.svg +0 -4
  95. package/src/assets/ic_refresh_left=outlined_20px.svg +0 -4
  96. package/src/assets/ic_refresh_right=outlined_20px.svg +0 -4
  97. package/src/assets/ic_show_large=outlined_20px.svg +0 -4
  98. package/src/assets/ic_show_small=outlined_20px.svg +0 -4
  99. package/src/assets/index.ts +0 -16
  100. package/src/components/Alert/Alert.styled.ts +0 -44
  101. package/src/components/Alert/Alert.tsx +0 -39
  102. package/src/components/Alert/Alert.types.ts +0 -5
  103. package/src/components/Alert/Alert.utils.tsx +0 -43
  104. package/src/components/Alert/index.ts +0 -5
  105. package/src/components/BaseTextField/BaseTextField.styled.ts +0 -110
  106. package/src/components/BaseTextField/BaseTextField.types.ts +0 -25
  107. package/src/components/BaseTextField/BaseTextField.utils.ts +0 -10
  108. package/src/components/Button/BaseButton.tsx +0 -19
  109. package/src/components/Button/Button.tsx +0 -117
  110. package/src/components/Button/Button.types.ts +0 -36
  111. package/src/components/Button/Button.utils.ts +0 -13
  112. package/src/components/Button/index.ts +0 -6
  113. package/src/components/Button/styleds/BaseButton.styled.ts +0 -57
  114. package/src/components/Button/styleds/ContainedButton.styled.ts +0 -123
  115. package/src/components/Button/styleds/GhostButton.styled.ts +0 -139
  116. package/src/components/Button/styleds/IconButton.styled.ts +0 -25
  117. package/src/components/Button/styleds/OutlinedButton.styled.ts +0 -144
  118. package/src/components/Card/Card.styled.tsx +0 -18
  119. package/src/components/Card/Card.tsx +0 -18
  120. package/src/components/Card/Card.types.ts +0 -10
  121. package/src/components/Card/index.ts +0 -5
  122. package/src/components/Checkbox/Checkbox.styled.tsx +0 -27
  123. package/src/components/Checkbox/Checkbox.tsx +0 -64
  124. package/src/components/Checkbox/Checkbox.types.ts +0 -16
  125. package/src/components/Checkbox/Checkbox.utils.tsx +0 -42
  126. package/src/components/Checkbox/index.ts +0 -5
  127. package/src/components/Chip/Chip.styled.ts +0 -120
  128. package/src/components/Chip/Chip.tsx +0 -33
  129. package/src/components/Chip/Chip.types.ts +0 -18
  130. package/src/components/Chip/Chip.utils.tsx +0 -50
  131. package/src/components/Chip/index.ts +0 -4
  132. package/src/components/DataTable/DataTable.styled.ts +0 -66
  133. package/src/components/DataTable/DataTable.tsx +0 -29
  134. package/src/components/DataTable/index.ts +0 -1
  135. package/src/components/DatePicker/DatePicker.styled.ts +0 -19
  136. package/src/components/DatePicker/DatePicker.tsx +0 -194
  137. package/src/components/DatePicker/DatePicker.types.ts +0 -8
  138. package/src/components/DatePicker/index.ts +0 -4
  139. package/src/components/Dialog/Dialog.styled.ts +0 -87
  140. package/src/components/Dialog/Dialog.tsx +0 -111
  141. package/src/components/Dialog/Dialog.types.ts +0 -19
  142. package/src/components/Dialog/index.ts +0 -5
  143. package/src/components/Divider/Divider.styled.ts +0 -24
  144. package/src/components/Divider/Divider.tsx +0 -13
  145. package/src/components/Divider/Divider.types.ts +0 -7
  146. package/src/components/Divider/index.ts +0 -5
  147. package/src/components/Dropdown/Dropdown.styled.tsx +0 -127
  148. package/src/components/Dropdown/Dropdown.tsx +0 -116
  149. package/src/components/Dropdown/Dropdown.types.ts +0 -31
  150. package/src/components/Dropdown/Dropdown.utils.ts +0 -13
  151. package/src/components/Dropdown/DropdownItem.styled.tsx +0 -66
  152. package/src/components/Dropdown/DropdownItem.tsx +0 -45
  153. package/src/components/Dropdown/DropdownItem.types.ts +0 -14
  154. package/src/components/Dropdown/DropdownItem.utils.ts +0 -14
  155. package/src/components/Dropdown/DropdownSubtitle.styled.ts +0 -13
  156. package/src/components/Dropdown/DropdownSubtitle.tsx +0 -9
  157. package/src/components/Dropdown/DropdownSubtitle.types.ts +0 -6
  158. package/src/components/Dropdown/IconDropdown.styled.tsx +0 -82
  159. package/src/components/Dropdown/IconDropdown.tsx +0 -56
  160. package/src/components/Dropdown/IconDropdown.types.ts +0 -22
  161. package/src/components/Dropdown/index.ts +0 -22
  162. package/src/components/FileDnDZone/FileDnDZone.styled.ts +0 -43
  163. package/src/components/FileDnDZone/FileDnDZone.tsx +0 -81
  164. package/src/components/FileDnDZone/FileDnDZone.types.ts +0 -14
  165. package/src/components/FileDnDZone/FileDnDZone.utils.ts +0 -3
  166. package/src/components/FileDnDZone/index.ts +0 -5
  167. package/src/components/Icons/BellNoti/index.tsx +0 -22
  168. package/src/components/Icons/CloseLarge/index.tsx +0 -22
  169. package/src/components/Icons/CloseSmall/index.tsx +0 -22
  170. package/src/components/Icons/DownloadPdf/index.tsx +0 -22
  171. package/src/components/Icons/Ellipse/index.tsx +0 -22
  172. package/src/components/Icons/FilterNoti/index.tsx +0 -22
  173. package/src/components/Icons/HideLarge/index.tsx +0 -22
  174. package/src/components/Icons/HideSmall/index.tsx +0 -22
  175. package/src/components/Icons/InformationLarge/index.tsx +0 -22
  176. package/src/components/Icons/InformationSmall/index.tsx +0 -22
  177. package/src/components/Icons/Manufacturer/index.tsx +0 -22
  178. package/src/components/Icons/Rectangle/index.tsx +0 -22
  179. package/src/components/Icons/RefreshLeft/index.tsx +0 -22
  180. package/src/components/Icons/RefreshRight/index.tsx +0 -22
  181. package/src/components/Icons/ShowLarge/index.tsx +0 -22
  182. package/src/components/Icons/ShowSmall/index.tsx +0 -22
  183. package/src/components/Icons/index.ts +0 -180
  184. package/src/components/List/List.styled.ts +0 -31
  185. package/src/components/List/List.tsx +0 -71
  186. package/src/components/List/List.types.ts +0 -24
  187. package/src/components/List/List.utils.ts +0 -14
  188. package/src/components/List/ListItem.styled.tsx +0 -61
  189. package/src/components/List/ListItem.tsx +0 -66
  190. package/src/components/List/ListItem.types.ts +0 -40
  191. package/src/components/List/ListItemCaption.styled.tsx +0 -7
  192. package/src/components/List/ListItemCaption.tsx +0 -18
  193. package/src/components/List/ListItemCaption.types.ts +0 -2
  194. package/src/components/List/index.ts +0 -8
  195. package/src/components/LoadingIndicator/LoadingIndicator.styled.tsx +0 -40
  196. package/src/components/LoadingIndicator/LoadingIndicator.tsx +0 -44
  197. package/src/components/LoadingIndicator/LoadingIndicator.types.ts +0 -7
  198. package/src/components/LoadingIndicator/assets/DnaLoadingAnimation.json +0 -769
  199. package/src/components/LoadingIndicator/assets/DotLoadingAnimation.json +0 -426
  200. package/src/components/LoadingIndicator/index.ts +0 -5
  201. package/src/components/Menu/Menu.styled.tsx +0 -42
  202. package/src/components/Menu/Menu.tsx +0 -28
  203. package/src/components/Menu/Menu.types.ts +0 -18
  204. package/src/components/Menu/MenuItem.styled.ts +0 -62
  205. package/src/components/Menu/MenuItem.tsx +0 -45
  206. package/src/components/Menu/MenuItem.types.ts +0 -14
  207. package/src/components/Menu/index.ts +0 -5
  208. package/src/components/MuiCssBaseline.ts +0 -78
  209. package/src/components/MuiInputBase.ts +0 -25
  210. package/src/components/MuiOutlinedInput.ts +0 -57
  211. package/src/components/MuiTextField.ts +0 -17
  212. package/src/components/ProductLabel/ProductLabel.styled.ts +0 -61
  213. package/src/components/ProductLabel/ProductLabel.tsx +0 -57
  214. package/src/components/ProductLabel/ProductLabel.types.ts +0 -10
  215. package/src/components/ProductLabel/index.ts +0 -5
  216. package/src/components/Progress/CircularProgress.styled.ts +0 -10
  217. package/src/components/Progress/CircularProgress.tsx +0 -15
  218. package/src/components/Progress/CircularProgress.types.ts +0 -6
  219. package/src/components/Progress/LinearProgress.styled.ts +0 -15
  220. package/src/components/Progress/LinearProgress.tsx +0 -16
  221. package/src/components/Progress/LinearProgress.types.ts +0 -7
  222. package/src/components/Progress/index.ts +0 -4
  223. package/src/components/Radio/Radio.styled.ts +0 -35
  224. package/src/components/Radio/Radio.tsx +0 -60
  225. package/src/components/Radio/Radio.types.ts +0 -15
  226. package/src/components/Radio/RadioGroup.styled.ts +0 -6
  227. package/src/components/Radio/RadioGroup.tsx +0 -23
  228. package/src/components/Radio/RadioGroup.types.ts +0 -10
  229. package/src/components/Radio/index.ts +0 -7
  230. package/src/components/Stepper/Stepper.styled.ts +0 -38
  231. package/src/components/Stepper/Stepper.tsx +0 -24
  232. package/src/components/Stepper/Stepper.types.ts +0 -13
  233. package/src/components/Stepper/index.ts +0 -5
  234. package/src/components/TabbedPanel/TabbedPanel.styled.ts +0 -129
  235. package/src/components/TabbedPanel/TabbedPanel.tsx +0 -70
  236. package/src/components/TabbedPanel/TabbedPanel.types.ts +0 -36
  237. package/src/components/TabbedPanel/TabbedPanel.utils.ts +0 -21
  238. package/src/components/TabbedPanel/index.ts +0 -5
  239. package/src/components/TextField/TextArea.styled.tsx +0 -36
  240. package/src/components/TextField/TextArea.tsx +0 -35
  241. package/src/components/TextField/TextArea.types.ts +0 -28
  242. package/src/components/TextField/TextInput.styled.tsx +0 -115
  243. package/src/components/TextField/TextInput.tsx +0 -27
  244. package/src/components/TextField/TextInput.types.ts +0 -46
  245. package/src/components/TextField/TextInput.utils.ts +0 -7
  246. package/src/components/TextField/components/Buttons.tsx +0 -26
  247. package/src/components/TextField/components/NormalTextInput.tsx +0 -95
  248. package/src/components/TextField/components/PasswordInput.tsx +0 -92
  249. package/src/components/TextField/index.ts +0 -7
  250. package/src/components/Tooltip/Tooltip.styled.tsx +0 -36
  251. package/src/components/Tooltip/Tooltip.tsx +0 -58
  252. package/src/components/Tooltip/Tooltip.types.ts +0 -24
  253. package/src/components/Tooltip/Tooltip.utils.ts +0 -46
  254. package/src/components/Tooltip/index.ts +0 -5
  255. package/src/components/UploadManager/UploadManager.styled.ts +0 -49
  256. package/src/components/UploadManager/UploadManager.tsx +0 -271
  257. package/src/components/UploadManager/UploadManager.types.ts +0 -16
  258. package/src/components/UploadManager/index.ts +0 -5
  259. package/src/components/index.ts +0 -23
  260. package/src/foundations/index.ts +0 -3
  261. package/src/foundations/palette.ts +0 -407
  262. package/src/foundations/spacing.ts +0 -5
  263. package/src/foundations/typography.ts +0 -492
  264. package/src/index.ts +0 -4
  265. package/src/react-app-env.d.ts +0 -71
  266. package/src/reportWebVitals.ts +0 -15
  267. package/src/setupTests.ts +0 -5
  268. package/src/systems/drawer.ts +0 -27
  269. package/src/systems/index.ts +0 -7
  270. package/src/theme.ts +0 -22
@@ -1,129 +0,0 @@
1
- import TabPanel from '@mui/lab/TabPanel/TabPanel';
2
- import { Tab, Tabs, styled } from '@mui/material';
3
- import type { Theme } from '@mui/material';
4
- import type { BaseTabProps, BaseTabsProps, TabSize } from './TabbedPanel.types';
5
-
6
- const tabSizeStyle = (size: TabSize) => {
7
- return {
8
- minHeight: `${size === 'small' ? '28px' : '44px'} !important`,
9
- };
10
- };
11
-
12
- // Style for Tabs (Tab Group)
13
- const baseTabMenuStyle = (theme: Theme) => {
14
- return {
15
- padding: 0,
16
- borderBottom: `1px solid ${theme.palette.neutralGrey[65]}`,
17
- };
18
- };
19
-
20
- const toggleTabMenuStyle = {
21
- borderRadius: '8px',
22
- outline: 'none',
23
- boxShadow: 'none',
24
- borderBottom: 'none',
25
- };
26
-
27
- // Style for Tab (Tab Button)
28
- const baseTabStyle = (theme: Theme, size: TabSize) => {
29
- return {
30
- background: theme.palette.neutralGrey[90],
31
- borderRadius: 'inherit',
32
- color: theme.palette.neutralGrey[45],
33
- minWidth: '100px',
34
- padding: `${size === 'small' ? '4px 8px' : '12px 16px'}`,
35
- textTransform: 'none' as const,
36
- '&:hover': {
37
- opacity: 0.8,
38
- },
39
- '&:active': {
40
- background: theme.palette.neutralGrey[60],
41
- color: theme.palette.neutralGrey[0],
42
- },
43
- '&.Mui-selected': {
44
- background: theme.palette.neutralGrey[90],
45
- color: theme.palette.neutralGrey[0],
46
- },
47
- };
48
- };
49
-
50
- const toggleTabStyle = (theme: Theme) => {
51
- return {
52
- outline: 'none',
53
- borderRadius: 'inherit',
54
- border: `1px solid ${theme.palette.neutralGrey[75]}`,
55
- boxShadow: 'none',
56
- background: theme.palette.neutralGrey[90],
57
- color: theme.palette.neutralGrey[45],
58
- '&:hover': {
59
- opacity: 0.8,
60
- },
61
- '&:active': {
62
- borderRadius: 'inherit',
63
- boxShadow: 'none',
64
- outline: 'none',
65
- borderColor: theme.palette.neutralGrey[60],
66
- background: theme.palette.neutralGrey[60],
67
- color: theme.palette.neutralGrey[0],
68
- },
69
- '&.Mui-selected': {
70
- borderRadius: 'inherit',
71
- boxShadow: 'none',
72
- outline: 'none',
73
- borderColor: 'transparent',
74
- background: theme.palette.neutralGrey[75],
75
- color: theme.palette.neutralGrey[0],
76
- '&:hover': { opacity: 1 },
77
- },
78
- '&:first-of-type': {
79
- borderRadius: '8px 0 0 8px',
80
- },
81
- '&:last-of-type': {
82
- borderRadius: '0 8px 8px 0',
83
- },
84
- };
85
- };
86
-
87
- const baseTabbedPanelStyle = {
88
- padding: '0',
89
- };
90
-
91
- const BaseTabMenu = styled(Tabs, {
92
- shouldForwardProp: (prop) => !['size', 'buttonVariant'].includes(prop.toString()),
93
- })<BaseTabsProps>(({ theme, size, buttonVariant }) => {
94
- let style = {
95
- ...baseTabMenuStyle(theme),
96
- ...tabSizeStyle(size ?? 'medium'),
97
- };
98
- if (buttonVariant === 'toggle') {
99
- style = {
100
- ...style,
101
- ...toggleTabMenuStyle,
102
- };
103
- }
104
- return style;
105
- });
106
-
107
- const BaseTab = styled(Tab, {
108
- shouldForwardProp: (prop) => !['size', 'buttonVariant'].includes(prop.toString()),
109
- })<BaseTabProps>(({ theme, size, buttonVariant }) => {
110
- let style = {
111
- ...baseTabStyle(theme, size ?? 'medium'),
112
- ...tabSizeStyle(size ?? 'medium'),
113
- };
114
-
115
- if (buttonVariant === 'toggle') {
116
- style = {
117
- ...style,
118
- ...toggleTabStyle(theme),
119
- };
120
- }
121
-
122
- return style;
123
- });
124
-
125
- const BaseTabPanel = styled(TabPanel)(() => {
126
- return baseTabbedPanelStyle;
127
- });
128
-
129
- export { BaseTabMenu, BaseTab, BaseTabPanel };
@@ -1,70 +0,0 @@
1
- import React from 'react';
2
- import { Box, Typography } from '@mui/material';
3
- import TabContext from '@mui/lab/TabContext';
4
- import { BaseTab, BaseTabMenu, BaseTabPanel } from './TabbedPanel.styled';
5
- import type { TabbedPanelProps } from './TabbedPanel.types';
6
-
7
- const TabbedPanel = ({
8
- tabs,
9
- size = 'medium',
10
- buttonVariant = 'normal',
11
- activatedTab,
12
- TabPanelProps,
13
- TabProps,
14
- TabsProps,
15
- menuVariant,
16
- onActivatedTab,
17
- onTabChangeListener,
18
- }: TabbedPanelProps) => {
19
- const handleChange = (_: React.SyntheticEvent, newValue: string) => {
20
- if (onTabChangeListener) {
21
- onTabChangeListener(newValue);
22
- }
23
- onActivatedTab(newValue);
24
- };
25
-
26
- // If prop is not explicitly set, use standard when there is only one tab
27
- // This means by default, it will left-align when there is only one tab.
28
- const menuVariantSetting = !menuVariant || tabs.length < 2 ? 'standard' : menuVariant;
29
-
30
- return (
31
- <Box>
32
- <TabContext value={activatedTab}>
33
- <BaseTabMenu
34
- size={size}
35
- value={activatedTab}
36
- onChange={handleChange}
37
- variant={menuVariantSetting}
38
- buttonVariant={buttonVariant}
39
- TabIndicatorProps={{ sx: { display: 'none' } }}
40
- {...TabsProps}
41
- >
42
- {tabs.map((t) => (
43
- <BaseTab
44
- buttonVariant={buttonVariant}
45
- size={size}
46
- disabled={t.disabled}
47
- disableTouchRipple
48
- disableRipple
49
- key={t.value}
50
- label={<Typography variant="body_sb1">{t.value}</Typography>}
51
- value={t.value}
52
- {...TabProps}
53
- />
54
- ))}
55
- </BaseTabMenu>
56
- {tabs.map((t) => (
57
- <BaseTabPanel
58
- key={t.value}
59
- value={t.value}
60
- {...TabPanelProps}
61
- >
62
- {t.element}
63
- </BaseTabPanel>
64
- ))}
65
- </TabContext>
66
- </Box>
67
- );
68
- };
69
-
70
- export default TabbedPanel;
@@ -1,36 +0,0 @@
1
- import type { TabPanelProps } from '@mui/lab/TabPanel';
2
- import type { TabProps, TabsProps } from '@mui/material';
3
-
4
- type TabSize = 'small' | 'medium';
5
- type ButtonVariant = 'normal' | 'toggle';
6
-
7
- interface TabConfig {
8
- value: string;
9
- element: React.ReactNode;
10
- disabled?: boolean;
11
- }
12
-
13
- interface BaseTabProps extends TabProps {
14
- size?: TabSize;
15
- buttonVariant?: ButtonVariant;
16
- }
17
-
18
- interface BaseTabsProps extends TabsProps {
19
- size?: TabSize;
20
- buttonVariant?: ButtonVariant;
21
- }
22
-
23
- interface TabbedPanelProps {
24
- tabs: TabConfig[];
25
- activatedTab: string;
26
- size?: TabSize;
27
- buttonVariant?: ButtonVariant;
28
- menuVariant?: TabsProps['variant'];
29
- TabsProps?: Partial<TabsProps>;
30
- TabProps?: Partial<TabProps>;
31
- TabPanelProps?: Partial<TabPanelProps>;
32
- onActivatedTab: (tab: string) => void;
33
- onTabChangeListener?: (newTabValue: string) => void;
34
- }
35
-
36
- export type { TabbedPanelProps, TabConfig, TabSize, BaseTabProps, BaseTabsProps };
@@ -1,21 +0,0 @@
1
- import type { TabConfig } from './TabbedPanel.types';
2
-
3
- /**
4
- *
5
- * @param defaultTab string | undefined
6
- * @param tabs TabConfig[]
7
- * @returns string
8
- * @description returns the initial value for useState, based on defaultTab.
9
- * If default tab is provided and matched, returns that,
10
- * else, returns first tab.
11
- *
12
- */
13
-
14
- function findDefaultTab(defaultTab: string | undefined, tabs: TabConfig[]): string {
15
- if (defaultTab) {
16
- return tabs.find((t) => t.value === defaultTab)?.value ?? tabs[0].value;
17
- }
18
- return tabs[0].value;
19
- }
20
-
21
- export { findDefaultTab };
@@ -1,5 +0,0 @@
1
- import TabbedPanel from './TabbedPanel';
2
- import type { TabbedPanelProps, TabConfig } from './TabbedPanel.types';
3
-
4
- export { TabbedPanel };
5
- export type { TabbedPanelProps, TabConfig };
@@ -1,36 +0,0 @@
1
- import { styled, Theme } from '@mui/material';
2
- import { styles } from '../BaseTextField/BaseTextField.styled';
3
- import type { RootTextAreaProps } from './TextArea.types';
4
- import { formatCSSSize } from '../BaseTextField/BaseTextField.utils';
5
-
6
- const baseTextAreaStyle = (theme: Theme, height: string | number | undefined) => {
7
- return {
8
- ...styles.baseTextFieldStyle(theme),
9
- height: height ? formatCSSSize(height) : '100px',
10
- resize: 'none' as const,
11
- '&::-webkit-scrollbar': {
12
- width: '14px !important',
13
- },
14
- '&::-webkit-scrollbar-thumb': {
15
- border: `4px solid ${theme.palette.neutralGrey[75]}`,
16
- },
17
- };
18
- };
19
-
20
- const BaseTextArea = styled('textarea', {
21
- shouldForwardProp: (prop) => !['error', 'width', 'height'].includes(prop.toString()),
22
- })<RootTextAreaProps>(({ theme, height, error }) => {
23
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
24
- let resultStyle: any = baseTextAreaStyle(theme, height);
25
-
26
- if (error) {
27
- resultStyle = {
28
- ...resultStyle,
29
- ...styles.baseTextFieldErrorStyle(theme),
30
- };
31
- }
32
-
33
- return resultStyle;
34
- });
35
-
36
- export default BaseTextArea;
@@ -1,35 +0,0 @@
1
- import React, { forwardRef } from 'react';
2
- import { InputMsg, BaseTextFieldContainer } from '../BaseTextField/BaseTextField.styled';
3
- import BaseTextArea from './TextArea.styled';
4
- import type { TextAreaProps } from './TextArea.types';
5
-
6
- const TextArea = forwardRef(
7
- (props: TextAreaProps, ref?: React.ForwardedRef<HTMLTextAreaElement>) => {
8
- const { error, helperMsg, OuterBoxProps, ...areaProps } = props;
9
-
10
- return (
11
- <BaseTextFieldContainer
12
- {...OuterBoxProps}
13
- width={props.width}
14
- >
15
- <BaseTextArea
16
- ref={ref}
17
- {...areaProps}
18
- multiline="true"
19
- error={!!error}
20
- />
21
- {error ? (
22
- <InputMsg
23
- variant="body5"
24
- error
25
- >
26
- {error}
27
- </InputMsg>
28
- ) : (
29
- helperMsg && <InputMsg variant="body5">{helperMsg}</InputMsg>
30
- )}
31
- </BaseTextFieldContainer>
32
- );
33
- },
34
- );
35
- export default TextArea;
@@ -1,28 +0,0 @@
1
- import type { BoxProps } from '@mui/material';
2
- import type { HelperMsgProps, RootTextFieldProps } from '../BaseTextField/BaseTextField.types';
3
-
4
- // props we define for the textarea element itself
5
- interface RootTextAreaProps extends Omit<RootTextFieldProps, 'BoxProps'> {
6
- multiline: 'true';
7
- onChange?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;
8
- error?: boolean;
9
- ref?: React.ForwardedRef<HTMLTextAreaElement> | undefined;
10
- placeholder?: string;
11
- width?: string | number;
12
- height?: string | number;
13
- OuterBoxProps?: BoxProps;
14
- }
15
-
16
- // common props for a wrapped textarea and helper message
17
- interface TextAreaWithHelperMsgProps
18
- extends Omit<RootTextAreaProps, 'error' | 'multiline'>,
19
- Omit<HelperMsgProps, 'error'> {
20
- error?: string;
21
- }
22
-
23
- // props for TextArea
24
- interface TextAreaProps extends TextAreaWithHelperMsgProps {}
25
-
26
- export type { RootTextAreaProps, TextAreaProps };
27
-
28
- // n.b structured to match TextInput
@@ -1,115 +0,0 @@
1
- import { styled, Theme } from '@mui/material';
2
- import { InputMsg, styles } from '../BaseTextField/BaseTextField.styled';
3
- import type { RootTextInputProps } from './TextInput.types';
4
-
5
- const baseTextInputStyle = (theme: Theme) => {
6
- return {
7
- ...styles.baseTextFieldStyle(theme),
8
- textOverflow: 'ellipsis',
9
- };
10
- };
11
-
12
- const textInputLarge = {
13
- padding: '11px 16px',
14
- };
15
-
16
- const textInputWithLeftIcon = {
17
- paddingLeft: '44px',
18
- };
19
-
20
- const BaseTextInput = styled('input', {
21
- shouldForwardProp: (prop) =>
22
- ![
23
- 'error',
24
- 'large',
25
- 'showClear',
26
- 'leftIcon',
27
- 'width',
28
- 'OuterBoxProps',
29
- 'InputContainerProps',
30
- ].includes(prop.toString()),
31
- })<RootTextInputProps>(({ theme, large, error, leftIcon, width }) => {
32
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
- let resultStyle: any = {
34
- ...baseTextInputStyle(theme),
35
- width:
36
- // eslint-disable-next-line no-nested-ternary
37
- typeof width !== 'undefined' ? (typeof width === 'number' ? `${width}px` : width) : width,
38
- };
39
-
40
- if (error) {
41
- resultStyle = {
42
- ...resultStyle,
43
- ...styles.baseTextFieldErrorStyle(theme),
44
- };
45
- }
46
-
47
- if (large) {
48
- resultStyle = {
49
- ...resultStyle,
50
- ...textInputLarge,
51
- };
52
- }
53
-
54
- if (leftIcon) {
55
- resultStyle = {
56
- ...resultStyle,
57
- ...textInputWithLeftIcon,
58
- };
59
- }
60
-
61
- return resultStyle;
62
- });
63
-
64
- const LeftIconContainer = styled('div')(() => {
65
- return {
66
- position: 'absolute',
67
- left: '0px',
68
- top: '0px',
69
- zIndex: '2',
70
- height: '100%',
71
- display: 'flex',
72
- alignItems: 'center',
73
- justifyContent: 'center',
74
- paddingLeft: '16px',
75
- paddingRight: '8px',
76
- pointerEvents: 'none',
77
- };
78
- });
79
- const RightIconContainer = styled('div')<{ error?: string }>(() => {
80
- return {
81
- position: 'absolute',
82
- right: '16px',
83
- top: '0px',
84
- zIndex: '2',
85
- height: '36px',
86
- display: 'flex',
87
- alignItems: 'center',
88
- justifyContent: 'center',
89
- };
90
- });
91
-
92
- const ButtonWrapper = styled('button')(({ theme }) => {
93
- return {
94
- width: '28px',
95
- height: '28px',
96
- backgroundColor: 'transparent',
97
- opacity: '0.8',
98
- border: 'none',
99
- color: theme.palette.neutralGrey[45],
100
- display: 'flex',
101
- justifyContent: 'center',
102
- alignItems: 'center',
103
- borderRadius: '8px',
104
- padding: 0,
105
- '&:hover': {
106
- backgroundColor: theme.palette.neutralGrey[70],
107
- cursor: 'pointer',
108
- },
109
- '&:active': {
110
- backgroundColor: theme.palette.neutralGrey[60],
111
- },
112
- };
113
- });
114
-
115
- export { BaseTextInput, InputMsg, LeftIconContainer, RightIconContainer, ButtonWrapper };
@@ -1,27 +0,0 @@
1
- import React, { forwardRef } from 'react';
2
- import PasswordInput from './components/PasswordInput';
3
- import NormalTextInput from './components/NormalTextInput';
4
-
5
- import isPasswordInput from './TextInput.utils';
6
- import type { TextInputProps } from './TextInput.types';
7
-
8
- const TextInput = forwardRef(
9
- (props: TextInputProps, ref?: React.ForwardedRef<HTMLInputElement>) => {
10
- if (isPasswordInput(props)) {
11
- return (
12
- <PasswordInput
13
- {...props}
14
- ref={ref}
15
- />
16
- );
17
- }
18
- return (
19
- <NormalTextInput
20
- {...props}
21
- ref={ref}
22
- />
23
- );
24
- },
25
- );
26
-
27
- export default TextInput;
@@ -1,46 +0,0 @@
1
- import type { BoxProps, InputProps as MuiInputProps } from '@mui/material';
2
- import type { RootTextFieldProps, HelperMsgProps } from '../BaseTextField/BaseTextField.types';
3
-
4
- // props we defined for the input element itself
5
- interface RootTextInputProps
6
- extends RootTextFieldProps,
7
- Omit<MuiInputProps, 'size' | 'error' | 'ref' | 'value' | 'defaultValue' | 'onChange'> {
8
- large?: boolean;
9
- leftIcon?: React.ReactNode;
10
- rightIcon?: React.ReactNode;
11
- onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
12
- OuterBoxProps?: BoxProps;
13
- InputContainerProps?: BoxProps;
14
- inputSX?: MuiInputProps['sx'];
15
- }
16
-
17
- // common props for a wrapped input and helper message
18
- interface InputWithHelperMsgProps
19
- extends Omit<RootTextInputProps, 'error'>,
20
- Omit<HelperMsgProps, 'error'> {
21
- error?: string;
22
- }
23
-
24
- // props specifically for password input with helper message
25
- interface PasswordInputWithHelperMsgProps
26
- extends Omit<
27
- InputWithHelperMsgProps,
28
- 'rightIcon' | 'readOnly' | 'onClearButtonClick' | 'InputContainerProps'
29
- > {
30
- type: 'password';
31
- }
32
-
33
- // Props for TextInput when used for normal input
34
- interface NormalTextInputProps extends InputWithHelperMsgProps {
35
- onClearButtonClick?: () => void;
36
- rightIcon?: React.ReactNode;
37
- }
38
-
39
- // Props for TextInput when used for passwords
40
- interface PasswordTextInputProps extends PasswordInputWithHelperMsgProps {}
41
-
42
- // Prop type for TextInput
43
- type TextInputProps = PasswordTextInputProps | NormalTextInputProps;
44
-
45
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
46
- export type { TextInputProps, NormalTextInputProps, PasswordTextInputProps, RootTextInputProps };
@@ -1,7 +0,0 @@
1
- import type { PasswordTextInputProps, TextInputProps } from './TextInput.types';
2
-
3
- // Function for inferring required input by props
4
- function isPasswordInput(props: TextInputProps): props is PasswordTextInputProps {
5
- return props.type === 'password';
6
- }
7
- export default isPasswordInput;
@@ -1,26 +0,0 @@
1
- import React from 'react';
2
- import { CloseSmall, HideSmall, ShowSmall } from '../../Icons';
3
- import { ButtonWrapper } from '../TextInput.styled';
4
-
5
- function ClearButton({ onClick }: { onClick?: () => void }) {
6
- return (
7
- <ButtonWrapper onClick={onClick}>
8
- <CloseSmall fontSize="small" />
9
- </ButtonWrapper>
10
- );
11
- }
12
-
13
- function ShowHidePasswordButton({
14
- onClick,
15
- isHidden,
16
- }: {
17
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
- onClick?: (event: any) => void;
19
- isHidden: boolean;
20
- }) {
21
- return (
22
- <ButtonWrapper onClick={onClick}>{isHidden ? <HideSmall /> : <ShowSmall />}</ButtonWrapper>
23
- );
24
- }
25
-
26
- export { ClearButton, ShowHidePasswordButton };
@@ -1,95 +0,0 @@
1
- import React, { forwardRef, useMemo, useState } from 'react';
2
- import {
3
- InputMsg,
4
- BaseTextFieldContainer,
5
- BaseTextFieldBox,
6
- } from '../../BaseTextField/BaseTextField.styled';
7
- import { BaseTextInput, LeftIconContainer, RightIconContainer } from '../TextInput.styled';
8
- import { ClearButton } from './Buttons';
9
-
10
- import type { NormalTextInputProps } from '../TextInput.types';
11
-
12
- const NormalTextInput = forwardRef(
13
- (props: NormalTextInputProps, ref?: React.ForwardedRef<HTMLInputElement>) => {
14
- const { error, helperMsg, leftIcon, rightIcon, onClearButtonClick, inputSX, ...inputProps } =
15
- props;
16
-
17
- const [showClear, setShowClear] = useState(!!props.defaultValue ?? false);
18
-
19
- const showRightIcon = useMemo(() => {
20
- return (
21
- rightIcon ?? // if rightIcon is passed, use it, else use clear button
22
- (!props.disabled && // hide if disabled
23
- !props.readOnly && // hide if readonly
24
- !!onClearButtonClick && // hide if no function (it doesn't do anything)
25
- showClear)
26
- );
27
- }, [props.disabled, onClearButtonClick, props.readOnly, rightIcon, showClear]);
28
-
29
- function handleClearButtonClick() {
30
- onClearButtonClick?.();
31
- setShowClear(false);
32
- }
33
-
34
- function changeHandler(e: React.ChangeEvent<HTMLInputElement>) {
35
- // wrap incoming onChange
36
- if (props.onChange) {
37
- props.onChange(e);
38
- }
39
-
40
- // rightIcon overrides clear button
41
- if (rightIcon) return;
42
-
43
- // handle show/hide of clear button
44
- if (e.target.value) {
45
- if (!showClear) setShowClear(true);
46
- } else if (showClear) setShowClear(false);
47
- }
48
-
49
- return (
50
- <BaseTextFieldBox
51
- {...props.OuterBoxProps}
52
- width={props.width}
53
- >
54
- <BaseTextFieldContainer
55
- {...props.InputContainerProps}
56
- width={props.width}
57
- >
58
- {leftIcon && (
59
- <LeftIconContainer sx={inputProps.disabled ? { opacity: '0.8' } : undefined}>
60
- {leftIcon}
61
- </LeftIconContainer>
62
- )}
63
-
64
- <BaseTextInput
65
- ref={ref}
66
- {...inputProps}
67
- error={!!error}
68
- onChange={(e) => changeHandler(e)}
69
- leftIcon={leftIcon}
70
- sx={inputSX ?? { paddingRight: showRightIcon ? '44px' : '16px' }}
71
- />
72
-
73
- {showRightIcon && (
74
- <RightIconContainer>
75
- {rightIcon && rightIcon}
76
- {!rightIcon && <ClearButton onClick={() => handleClearButtonClick()} />}
77
- </RightIconContainer>
78
- )}
79
- </BaseTextFieldContainer>
80
- {error ? (
81
- <InputMsg
82
- variant="body5"
83
- error
84
- >
85
- {error}
86
- </InputMsg>
87
- ) : (
88
- helperMsg && <InputMsg variant="body5">{helperMsg}</InputMsg>
89
- )}
90
- </BaseTextFieldBox>
91
- );
92
- },
93
- );
94
-
95
- export default NormalTextInput;