@lunit/oui 1.0.1-alpha.13 → 1.0.1-alpha.2

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 (212) hide show
  1. package/dist/index.js +0 -1
  2. package/dist/types/index.d.ts +0 -1
  3. package/package.json +7 -20
  4. package/src/assets/ic-bell-noti-outlined-20px.tsx +21 -0
  5. package/src/assets/ic-close-large-outlined-20px.tsx +17 -0
  6. package/src/assets/ic-close-small-outlined-20px.tsx +17 -0
  7. package/src/assets/ic-download-pdf-outlined-20px.tsx +18 -0
  8. package/src/assets/ic-ellipse-outlined-20px.tsx +17 -0
  9. package/src/assets/ic-filter-noti-outlined-20px.tsx +21 -0
  10. package/src/assets/ic-hide-large-outlined-20px.tsx +13 -0
  11. package/src/assets/ic-hide-small-outlined-20px.tsx +17 -0
  12. package/src/assets/ic-information-large-outlined-20px.tsx +17 -0
  13. package/src/assets/ic-information-small-outlined-20px.tsx +17 -0
  14. package/src/assets/ic-manufacturer-outlined-20px.tsx +19 -0
  15. package/src/assets/ic-rectangle-outlined-20px.tsx +17 -0
  16. package/src/assets/ic-refresh-left-outlined-20px.tsx +17 -0
  17. package/src/assets/ic-refresh-right-outlined-20px.tsx +13 -0
  18. package/src/assets/ic-show-large-outlined-20px.tsx +17 -0
  19. package/src/assets/ic-show-small-outlined-20px.tsx +17 -0
  20. package/src/assets/ic_bell_noti=outlined_20px.svg +5 -0
  21. package/src/assets/ic_close_large=outlined_20px.svg +4 -0
  22. package/src/assets/ic_close_small=outlined_20px.svg +4 -0
  23. package/src/assets/ic_download_pdf=outlined_20px.svg +7 -0
  24. package/src/assets/ic_ellipse=outlined_20px.svg +4 -0
  25. package/src/assets/ic_filter_noti=outlined_20px.svg +5 -0
  26. package/src/assets/ic_hide_large=outlined_20px.svg +4 -0
  27. package/src/assets/ic_hide_small=outlined_20px.svg +4 -0
  28. package/src/assets/ic_information_large=outlined_20px.svg +4 -0
  29. package/src/assets/ic_information_small=outlined_20px.svg +4 -0
  30. package/src/assets/ic_manufacturer=outlined_20px.svg +3 -0
  31. package/src/assets/ic_rectangle=outlined_20px.svg +4 -0
  32. package/src/assets/ic_refresh_left=outlined_20px.svg +4 -0
  33. package/src/assets/ic_refresh_right=outlined_20px.svg +4 -0
  34. package/src/assets/ic_show_large=outlined_20px.svg +4 -0
  35. package/src/assets/ic_show_small=outlined_20px.svg +4 -0
  36. package/src/assets/index.ts +16 -0
  37. package/src/components/Alert/Alert.styled.ts +44 -0
  38. package/src/components/Alert/Alert.tsx +39 -0
  39. package/src/components/Alert/Alert.types.ts +5 -0
  40. package/src/components/Alert/Alert.utils.tsx +43 -0
  41. package/src/components/Alert/index.ts +5 -0
  42. package/src/components/BaseTextField/BaseTextField.styled.ts +110 -0
  43. package/src/components/BaseTextField/BaseTextField.types.ts +25 -0
  44. package/src/components/BaseTextField/BaseTextField.utils.ts +10 -0
  45. package/src/components/Button/BaseButton.tsx +19 -0
  46. package/src/components/Button/Button.tsx +117 -0
  47. package/src/components/Button/Button.types.ts +36 -0
  48. package/src/components/Button/Button.utils.ts +13 -0
  49. package/src/components/Button/index.ts +6 -0
  50. package/src/components/Button/styleds/BaseButton.styled.ts +57 -0
  51. package/src/components/Button/styleds/ContainedButton.styled.ts +123 -0
  52. package/src/components/Button/styleds/GhostButton.styled.ts +139 -0
  53. package/src/components/Button/styleds/IconButton.styled.ts +25 -0
  54. package/src/components/Button/styleds/OutlinedButton.styled.ts +144 -0
  55. package/src/components/Card/Card.styled.tsx +18 -0
  56. package/src/components/Card/Card.tsx +18 -0
  57. package/src/components/Card/Card.types.ts +10 -0
  58. package/src/components/Card/index.ts +5 -0
  59. package/src/components/Checkbox/Checkbox.styled.tsx +27 -0
  60. package/src/components/Checkbox/Checkbox.tsx +64 -0
  61. package/src/components/Checkbox/Checkbox.types.ts +16 -0
  62. package/src/components/Checkbox/Checkbox.utils.tsx +42 -0
  63. package/src/components/Checkbox/index.ts +5 -0
  64. package/src/components/Chip/Chip.styled.ts +120 -0
  65. package/src/components/Chip/Chip.tsx +33 -0
  66. package/src/components/Chip/Chip.types.ts +18 -0
  67. package/src/components/Chip/Chip.utils.tsx +50 -0
  68. package/src/components/Chip/index.ts +4 -0
  69. package/src/components/DataTable/DataTable.styled.ts +66 -0
  70. package/src/components/DataTable/DataTable.tsx +29 -0
  71. package/src/components/DataTable/index.ts +1 -0
  72. package/src/components/DatePicker/DatePicker.styled.ts +19 -0
  73. package/src/components/DatePicker/DatePicker.tsx +194 -0
  74. package/src/components/DatePicker/DatePicker.types.ts +8 -0
  75. package/src/components/DatePicker/index.ts +4 -0
  76. package/src/components/Dialog/Dialog.styled.ts +87 -0
  77. package/src/components/Dialog/Dialog.tsx +111 -0
  78. package/src/components/Dialog/Dialog.types.ts +19 -0
  79. package/src/components/Dialog/index.ts +5 -0
  80. package/src/components/Divider/Divider.styled.ts +24 -0
  81. package/src/components/Divider/Divider.tsx +13 -0
  82. package/src/components/Divider/Divider.types.ts +7 -0
  83. package/src/components/Divider/index.ts +5 -0
  84. package/src/components/Dropdown/Dropdown.styled.tsx +127 -0
  85. package/src/components/Dropdown/Dropdown.tsx +116 -0
  86. package/src/components/Dropdown/Dropdown.types.ts +31 -0
  87. package/src/components/Dropdown/Dropdown.utils.ts +13 -0
  88. package/src/components/Dropdown/DropdownItem.styled.tsx +66 -0
  89. package/src/components/Dropdown/DropdownItem.tsx +45 -0
  90. package/src/components/Dropdown/DropdownItem.types.ts +14 -0
  91. package/src/components/Dropdown/DropdownItem.utils.ts +14 -0
  92. package/src/components/Dropdown/DropdownSubtitle.styled.ts +13 -0
  93. package/src/components/Dropdown/DropdownSubtitle.tsx +9 -0
  94. package/src/components/Dropdown/DropdownSubtitle.types.ts +6 -0
  95. package/src/components/Dropdown/IconDropdown.styled.tsx +82 -0
  96. package/src/components/Dropdown/IconDropdown.tsx +56 -0
  97. package/src/components/Dropdown/IconDropdown.types.ts +22 -0
  98. package/src/components/Dropdown/index.ts +22 -0
  99. package/src/components/FileDnDZone/FileDnDZone.styled.ts +43 -0
  100. package/src/components/FileDnDZone/FileDnDZone.tsx +81 -0
  101. package/src/components/FileDnDZone/FileDnDZone.types.ts +14 -0
  102. package/src/components/FileDnDZone/FileDnDZone.utils.ts +3 -0
  103. package/src/components/FileDnDZone/index.ts +5 -0
  104. package/src/components/List/List.styled.ts +31 -0
  105. package/src/components/List/List.tsx +71 -0
  106. package/src/components/List/List.types.ts +24 -0
  107. package/src/components/List/List.utils.ts +14 -0
  108. package/src/components/List/ListItem.styled.tsx +61 -0
  109. package/src/components/List/ListItem.tsx +66 -0
  110. package/src/components/List/ListItem.types.ts +40 -0
  111. package/src/components/List/ListItemCaption.styled.tsx +7 -0
  112. package/src/components/List/ListItemCaption.tsx +18 -0
  113. package/src/components/List/ListItemCaption.types.ts +2 -0
  114. package/src/components/List/index.ts +8 -0
  115. package/src/components/LoadingIndicator/LoadingIndicator.styled.tsx +40 -0
  116. package/src/components/LoadingIndicator/LoadingIndicator.tsx +44 -0
  117. package/src/components/LoadingIndicator/LoadingIndicator.types.ts +7 -0
  118. package/src/components/LoadingIndicator/assets/DnaLoadingAnimation.json +769 -0
  119. package/src/components/LoadingIndicator/assets/DotLoadingAnimation.json +426 -0
  120. package/src/components/LoadingIndicator/index.ts +5 -0
  121. package/src/components/Menu/Menu.styled.tsx +42 -0
  122. package/src/components/Menu/Menu.tsx +28 -0
  123. package/src/components/Menu/Menu.types.ts +18 -0
  124. package/src/components/Menu/MenuItem.styled.ts +62 -0
  125. package/src/components/Menu/MenuItem.tsx +45 -0
  126. package/src/components/Menu/MenuItem.types.ts +14 -0
  127. package/src/components/Menu/index.ts +5 -0
  128. package/src/components/MuiCssBaseline.ts +78 -0
  129. package/src/components/MuiInputBase.ts +25 -0
  130. package/src/components/MuiOutlinedInput.ts +57 -0
  131. package/src/components/MuiTextField.ts +17 -0
  132. package/src/components/Pagination/Pagination.styled.tsx +71 -0
  133. package/src/components/Pagination/Pagination.tsx +182 -0
  134. package/src/components/Pagination/Pagination.types.ts +39 -0
  135. package/src/components/Pagination/index.ts +2 -0
  136. package/src/components/ProductLabel/ProductLabel.styled.ts +61 -0
  137. package/src/components/ProductLabel/ProductLabel.tsx +57 -0
  138. package/src/components/ProductLabel/ProductLabel.types.ts +10 -0
  139. package/src/components/ProductLabel/index.ts +5 -0
  140. package/src/components/Progress/CircularProgress.styled.ts +10 -0
  141. package/src/components/Progress/CircularProgress.tsx +15 -0
  142. package/src/components/Progress/CircularProgress.types.ts +6 -0
  143. package/src/components/Progress/LinearProgress.styled.ts +15 -0
  144. package/src/components/Progress/LinearProgress.tsx +16 -0
  145. package/src/components/Progress/LinearProgress.types.ts +7 -0
  146. package/src/components/Progress/index.ts +4 -0
  147. package/src/components/Radio/Radio.styled.ts +35 -0
  148. package/src/components/Radio/Radio.tsx +60 -0
  149. package/src/components/Radio/Radio.types.ts +15 -0
  150. package/src/components/Radio/RadioGroup.styled.ts +6 -0
  151. package/src/components/Radio/RadioGroup.tsx +23 -0
  152. package/src/components/Radio/RadioGroup.types.ts +10 -0
  153. package/src/components/Radio/index.ts +7 -0
  154. package/src/components/Stepper/Stepper.styled.ts +38 -0
  155. package/src/components/Stepper/Stepper.tsx +24 -0
  156. package/src/components/Stepper/Stepper.types.ts +13 -0
  157. package/src/components/Stepper/index.ts +5 -0
  158. package/src/components/TabbedPanel/TabbedPanel.styled.ts +129 -0
  159. package/src/components/TabbedPanel/TabbedPanel.tsx +70 -0
  160. package/src/components/TabbedPanel/TabbedPanel.types.ts +36 -0
  161. package/src/components/TabbedPanel/TabbedPanel.utils.ts +21 -0
  162. package/src/components/TabbedPanel/index.ts +5 -0
  163. package/src/components/TextField/TextArea.styled.tsx +36 -0
  164. package/src/components/TextField/TextArea.tsx +35 -0
  165. package/src/components/TextField/TextArea.types.ts +28 -0
  166. package/src/components/TextField/TextInput.styled.tsx +115 -0
  167. package/src/components/TextField/TextInput.tsx +27 -0
  168. package/src/components/TextField/TextInput.types.ts +46 -0
  169. package/src/components/TextField/TextInput.utils.ts +7 -0
  170. package/src/components/TextField/components/Buttons.tsx +26 -0
  171. package/src/components/TextField/components/NormalTextInput.tsx +95 -0
  172. package/src/components/TextField/components/PasswordInput.tsx +92 -0
  173. package/src/components/TextField/index.ts +7 -0
  174. package/src/components/Tooltip/Tooltip.styled.tsx +36 -0
  175. package/src/components/Tooltip/Tooltip.tsx +58 -0
  176. package/src/components/Tooltip/Tooltip.types.ts +24 -0
  177. package/src/components/Tooltip/Tooltip.utils.ts +46 -0
  178. package/src/components/Tooltip/index.ts +5 -0
  179. package/src/components/UploadManager/UploadManager.styled.ts +49 -0
  180. package/src/components/UploadManager/UploadManager.tsx +271 -0
  181. package/src/components/UploadManager/UploadManager.types.ts +16 -0
  182. package/src/components/UploadManager/index.ts +5 -0
  183. package/src/components/index.ts +23 -0
  184. package/src/foundations/index.ts +4 -0
  185. package/src/foundations/palette.ts +418 -0
  186. package/src/foundations/spacing.ts +5 -0
  187. package/src/foundations/styles.ts +9 -0
  188. package/src/foundations/typography.ts +492 -0
  189. package/src/icons/BellNoti/index.tsx +28 -0
  190. package/src/icons/CloseLarge/index.tsx +28 -0
  191. package/src/icons/CloseSmall/index.tsx +28 -0
  192. package/src/icons/DownloadPdf/index.tsx +28 -0
  193. package/src/icons/Ellipse/index.tsx +28 -0
  194. package/src/icons/FilterNoti/index.tsx +28 -0
  195. package/src/icons/HideLarge/index.tsx +28 -0
  196. package/src/icons/HideSmall/index.tsx +28 -0
  197. package/src/icons/InformationLarge/index.tsx +28 -0
  198. package/src/icons/InformationSmall/index.tsx +28 -0
  199. package/src/icons/Manufacturer/index.tsx +28 -0
  200. package/src/icons/Rectangle/index.tsx +28 -0
  201. package/src/icons/RefreshLeft/index.tsx +28 -0
  202. package/src/icons/RefreshRight/index.tsx +28 -0
  203. package/src/icons/ShowLarge/index.tsx +28 -0
  204. package/src/icons/ShowSmall/index.tsx +28 -0
  205. package/src/icons/index.ts +180 -0
  206. package/src/index.ts +4 -0
  207. package/src/react-app-env.d.ts +71 -0
  208. package/src/reportWebVitals.ts +15 -0
  209. package/src/setupTests.ts +5 -0
  210. package/src/systems/drawer.ts +27 -0
  211. package/src/systems/index.ts +7 -0
  212. package/src/theme.ts +22 -0
@@ -0,0 +1,139 @@
1
+ import { ButtonBase, styled } from '@mui/material';
2
+ import type { Theme } from '@mui/material';
3
+ import { baseButtonStyle, baseLargeStyle, baseSmallStyle } from './BaseButton.styled';
4
+ import { baseLargeIconStyle, baseMediumIconStyle, baseSmallIconStyle } from './IconButton.styled';
5
+ import type { BaseButtonProps } from '../Button.types';
6
+
7
+ const ghostPrimaryStyle = (theme: Theme, focusOutline: boolean | undefined) => {
8
+ const mainColor = theme.palette.lunitTeal[40];
9
+
10
+ return {
11
+ ...baseButtonStyle(theme, false),
12
+ backgroundColor: 'transparent',
13
+ color: mainColor,
14
+ '&:hover': {
15
+ backgroundColor: theme.palette.neutralGrey[70],
16
+ opacity: 0.8,
17
+ },
18
+ '&:disabled': {
19
+ backgroundColor: 'transparent',
20
+ color: mainColor,
21
+ opacity: 0.4,
22
+ },
23
+ '&:focus': {
24
+ border: focusOutline ? `1px solid ${mainColor}` : '1px solid transparent',
25
+ },
26
+ '&:focus-visible': {
27
+ outline: 'none',
28
+ border: focusOutline ? `1px solid ${mainColor}` : '1px solid transparent',
29
+ },
30
+ };
31
+ };
32
+
33
+ const ghostSecondaryStyle = (theme: Theme, focusOutline: boolean | undefined) => {
34
+ const mainColor = theme.palette.neutralGrey[25];
35
+ return {
36
+ color: mainColor,
37
+ '&:hover': {
38
+ backgroundColor: theme.palette.neutralGrey[75],
39
+ opacity: 0.7,
40
+ },
41
+ '&:disabled': {
42
+ backgroundColor: 'transparent',
43
+ color: mainColor,
44
+ opacity: 0.4,
45
+ },
46
+ '&:focus': {
47
+ border: focusOutline ? `1px solid ${mainColor}` : '1px solid transparent',
48
+ },
49
+ '&:focus-visible': {
50
+ outline: 'none',
51
+ border: focusOutline ? `1px solid ${mainColor}` : '1px solid transparent',
52
+ },
53
+ };
54
+ };
55
+
56
+ const ghostErrorStyle = (theme: Theme, focusOutline: boolean | undefined) => {
57
+ const mainColor = theme.palette.red[5];
58
+
59
+ return {
60
+ color: mainColor,
61
+ '&:hover': {
62
+ backgroundColor: theme.palette.neutralGrey[70],
63
+ opacity: 0.7,
64
+ },
65
+ '&:disabled': {
66
+ backgroundColor: 'transparent',
67
+ color: mainColor,
68
+ opacity: 0.4,
69
+ },
70
+ '&:focus': {
71
+ border: focusOutline ? `1px solid ${mainColor}` : '1px solid transparent',
72
+ },
73
+ '&:focus-visible': {
74
+ outline: 'none',
75
+ border: focusOutline ? `1px solid ${mainColor}` : '1px solid transparent',
76
+ },
77
+ };
78
+ };
79
+
80
+ const BaseGhostButton = styled(ButtonBase, {
81
+ shouldForwardProp: (prop) =>
82
+ !['color', 'variant', 'size', 'focusOutline', 'isIconOnly'].includes(prop.toString()),
83
+ })<BaseButtonProps>(({ theme, color, size, focusOutline, isIconOnly }) => {
84
+ let resultStyle = ghostPrimaryStyle(theme, focusOutline);
85
+
86
+ // Apply icon sizing if icon only
87
+ if (isIconOnly) {
88
+ if (size === 'small') {
89
+ resultStyle = {
90
+ ...resultStyle,
91
+ ...baseSmallIconStyle,
92
+ };
93
+ } else if (size === 'large') {
94
+ resultStyle = {
95
+ ...resultStyle,
96
+ ...baseLargeIconStyle,
97
+ };
98
+ } else {
99
+ resultStyle = {
100
+ ...resultStyle,
101
+ ...baseMediumIconStyle,
102
+ };
103
+ }
104
+ } else {
105
+ // Apply label or icon-label
106
+ if (size === 'small') {
107
+ resultStyle = {
108
+ ...resultStyle,
109
+ ...baseSmallStyle,
110
+ };
111
+ }
112
+
113
+ if (size === 'large') {
114
+ resultStyle = {
115
+ ...resultStyle,
116
+ ...baseLargeStyle,
117
+ };
118
+ }
119
+ }
120
+
121
+ // Apply color
122
+ if (color === 'error') {
123
+ resultStyle = {
124
+ ...resultStyle,
125
+ ...ghostErrorStyle(theme, focusOutline),
126
+ };
127
+ }
128
+
129
+ if (color === 'secondary') {
130
+ resultStyle = {
131
+ ...resultStyle,
132
+ ...ghostSecondaryStyle(theme, focusOutline),
133
+ };
134
+ }
135
+
136
+ return resultStyle;
137
+ });
138
+
139
+ export { ghostPrimaryStyle, ghostSecondaryStyle, ghostErrorStyle, BaseGhostButton };
@@ -0,0 +1,25 @@
1
+ const baseSmallIconStyle = {
2
+ height: '28px',
3
+ width: '28px',
4
+ minWidth: '28px',
5
+ padding: '4px',
6
+ };
7
+
8
+ const baseLargeIconStyle = {
9
+ fontWeight: 600,
10
+ fontSize: '16px',
11
+ lineHeight: '22px',
12
+ // textTransform: 'capitalize', // Causes type error
13
+ height: '44px',
14
+ width: '44px',
15
+ padding: '12px',
16
+ };
17
+
18
+ const baseMediumIconStyle = {
19
+ height: '36px',
20
+ width: '36px',
21
+ minWidth: '36px',
22
+ padding: '8px',
23
+ };
24
+
25
+ export { baseMediumIconStyle, baseSmallIconStyle, baseLargeIconStyle };
@@ -0,0 +1,144 @@
1
+ import { ButtonBase, styled } from '@mui/material';
2
+ import type { Theme } from '@mui/material';
3
+ import { baseButtonStyle, baseLargeStyle, baseSmallStyle } from './BaseButton.styled';
4
+ import { baseLargeIconStyle, baseMediumIconStyle, baseSmallIconStyle } from './IconButton.styled';
5
+ import type { BaseButtonProps } from '../Button.types';
6
+
7
+ const outlinedPrimaryStyle = (theme: Theme, focusOutline: boolean | undefined) => {
8
+ const mainColor = theme.palette.lunitTeal[40];
9
+ return {
10
+ ...baseButtonStyle(theme, false),
11
+ backgroundColor: 'transparent',
12
+ color: mainColor,
13
+ border: `1px solid ${mainColor}`,
14
+ '&:hover': {
15
+ backgroundColor: theme.palette.neutralGrey[70],
16
+ opacity: 0.8,
17
+ },
18
+ '&:disabled': {
19
+ color: mainColor,
20
+ backgroundColor: 'transparent',
21
+ opacity: 0.4,
22
+ },
23
+ '&:focus': {
24
+ border: `1px solid ${mainColor}`,
25
+ outline: focusOutline ? `2px solid ${mainColor}` : 'none',
26
+ },
27
+ '&:focus-visible': {
28
+ border: `1px solid ${mainColor}`,
29
+ outline: focusOutline ? `2px solid ${mainColor}` : 'none',
30
+ },
31
+ };
32
+ };
33
+
34
+ const outlinedSecondaryStyle = (theme: Theme, focusOutline: boolean | undefined) => {
35
+ const mainColor = theme.palette.neutralGrey[25];
36
+ return {
37
+ backgroundColor: 'transparent',
38
+ color: mainColor,
39
+ border: `1px solid ${mainColor}`,
40
+ '&:hover': {
41
+ backgroundColor: theme.palette.neutralGrey[70],
42
+ opacity: 0.8,
43
+ },
44
+ '&:disabled': {
45
+ backgroundColor: 'transparent',
46
+ color: mainColor,
47
+ opacity: 0.4,
48
+ },
49
+ '&:focus': {
50
+ border: `1px solid ${mainColor}`,
51
+ outline: focusOutline ? `2px solid ${mainColor}` : 'none',
52
+ },
53
+ '&:focus-visible': {
54
+ border: `1px solid ${mainColor}`,
55
+ outline: focusOutline ? `2px solid ${mainColor}` : 'none',
56
+ },
57
+ };
58
+ };
59
+ const outlinedErrorStyle = (theme: Theme, focusOutline: boolean | undefined) => {
60
+ const mainColor = theme.palette.red[5];
61
+ return {
62
+ backgroundColor: 'transparent',
63
+ color: mainColor,
64
+ border: `1px solid ${mainColor}`,
65
+ '&:hover': {
66
+ backgroundColor: theme.palette.neutralGrey[70],
67
+ opacity: 0.8,
68
+ },
69
+ '&:disabled': {
70
+ backgroundColor: 'transparent',
71
+ color: mainColor,
72
+ opacity: 0.4,
73
+ },
74
+ '&:focus': {
75
+ border: `1px solid ${mainColor}`,
76
+ outline: focusOutline ? `2px solid ${mainColor}` : 'none',
77
+ },
78
+ '&:focus-visible': {
79
+ border: `1px solid ${mainColor}`,
80
+ outline: focusOutline ? `2px solid ${mainColor}` : 'none',
81
+ },
82
+ };
83
+ };
84
+
85
+ const BaseOutlinedButton = styled(ButtonBase, {
86
+ shouldForwardProp: (prop) =>
87
+ !['color', 'variant', 'size', 'focusOutline', 'isIconOnly'].includes(prop.toString()),
88
+ })<BaseButtonProps>(({ theme, color, size, focusOutline, isIconOnly }) => {
89
+ let resultStyle = outlinedPrimaryStyle(theme, focusOutline);
90
+
91
+ // Apply icon sizing if icon only
92
+ if (isIconOnly) {
93
+ if (size === 'small') {
94
+ resultStyle = {
95
+ ...resultStyle,
96
+ ...baseSmallIconStyle,
97
+ };
98
+ } else if (size === 'large') {
99
+ resultStyle = {
100
+ ...resultStyle,
101
+ ...baseLargeIconStyle,
102
+ };
103
+ } else {
104
+ resultStyle = {
105
+ ...resultStyle,
106
+ ...baseMediumIconStyle,
107
+ };
108
+ }
109
+ } else {
110
+ // Apply label or icon-label
111
+ if (size === 'small') {
112
+ resultStyle = {
113
+ ...resultStyle,
114
+ ...baseSmallStyle,
115
+ };
116
+ }
117
+
118
+ if (size === 'large') {
119
+ resultStyle = {
120
+ ...resultStyle,
121
+ ...baseLargeStyle,
122
+ };
123
+ }
124
+ }
125
+
126
+ // Apply color
127
+ if (color === 'error') {
128
+ resultStyle = {
129
+ ...resultStyle,
130
+ ...outlinedErrorStyle(theme, focusOutline),
131
+ };
132
+ }
133
+
134
+ if (color === 'secondary') {
135
+ resultStyle = {
136
+ ...resultStyle,
137
+ ...outlinedSecondaryStyle(theme, focusOutline),
138
+ };
139
+ }
140
+
141
+ return resultStyle;
142
+ });
143
+
144
+ export { outlinedPrimaryStyle, outlinedSecondaryStyle, outlinedErrorStyle, BaseOutlinedButton };
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { Card as MuiCard, styled } from '@mui/material';
3
+ import type { CardProps } from './Card.types';
4
+
5
+ const BaseCard = styled(({ ...props }: CardProps) => <MuiCard {...props} />)(
6
+ ({ theme, size = 'large', selected }) => ({
7
+ width: size === 'small' ? '480px' : '520px',
8
+ height: size === 'small' ? '156px' : '284px',
9
+ cursor: 'pointer',
10
+ borderRadius: '8px',
11
+ backgroundColor: !selected ? theme.palette.neutralGrey[85] : theme.palette.neutralGrey[75],
12
+ '&:hover': {
13
+ backgroundColor: theme.palette.neutralGrey[75],
14
+ },
15
+ }),
16
+ );
17
+
18
+ export default BaseCard;
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import BaseCard from './Card.styled';
3
+ import type { CardProps } from './Card.types';
4
+
5
+ function Card({ size, selected, onClick, children, ...props }: CardProps) {
6
+ return (
7
+ <BaseCard
8
+ size={size}
9
+ selected={selected}
10
+ onClick={onClick}
11
+ {...props}
12
+ >
13
+ {children}
14
+ </BaseCard>
15
+ );
16
+ }
17
+
18
+ export default Card;
@@ -0,0 +1,10 @@
1
+ import type { CardProps as MuiCardProps } from '@mui/material';
2
+
3
+ export type CardSize = 'small' | 'large';
4
+
5
+ export interface CardProps extends MuiCardProps {
6
+ size?: CardSize;
7
+ open?: boolean;
8
+ selected?: boolean;
9
+ onClick?: () => void;
10
+ }
@@ -0,0 +1,5 @@
1
+ import Card from './Card';
2
+ import type { CardProps } from './Card.types';
3
+
4
+ export { Card };
5
+ export type { CardProps };
@@ -0,0 +1,27 @@
1
+ import { styled, Box, Checkbox } from '@mui/material';
2
+
3
+ export const Container = styled(Box, {
4
+ shouldForwardProp: (prop) => prop !== 'touchRippleRef',
5
+ })(({ theme }) => ({
6
+ display: 'inline-flex',
7
+ gap: theme.spacing(2),
8
+ }));
9
+
10
+ export const StyledCheckbox = styled(Checkbox)(({ theme }) => ({
11
+ width: '22px',
12
+ height: '22px',
13
+ padding: 0,
14
+ '&.Mui-disabled, &.Mui-disabled + .MuiTypography-root': {
15
+ opacity: 0.4,
16
+ },
17
+ '&.Mui-focusVisible > .checkbox-icon': {
18
+ borderRadius: '4px',
19
+ boxShadow: `0 0 0 1px ${theme.palette.lunitTeal[10]}`,
20
+ },
21
+ }));
22
+
23
+ export const iconStyle = {
24
+ display: 'inline-block',
25
+ width: '18px',
26
+ height: '18px',
27
+ };
@@ -0,0 +1,64 @@
1
+ import React, { forwardRef } from 'react';
2
+ import { Typography } from '@mui/material';
3
+ import clsx from 'clsx';
4
+ import { Container, StyledCheckbox } from './Checkbox.styled';
5
+ import type { CheckboxProps } from './Checkbox.types';
6
+ import { UncheckedIcon, CheckedIcon, IndeterminateIcon } from './Checkbox.utils';
7
+
8
+ const Checkbox = forwardRef<HTMLSpanElement, CheckboxProps>(
9
+ (
10
+ {
11
+ value,
12
+ name,
13
+ checked,
14
+ defaultChecked,
15
+ disabled,
16
+ required,
17
+ indeterminate,
18
+ onChange,
19
+ onChangeCapture,
20
+ label,
21
+ inputProps,
22
+ inputRef,
23
+ ...rootProps
24
+ }: CheckboxProps,
25
+ ref,
26
+ ) => {
27
+ return (
28
+ <Container
29
+ {...rootProps}
30
+ className={clsx('checkbox', rootProps.className)}
31
+ component={label != null ? 'label' : 'span'}
32
+ ref={ref}
33
+ >
34
+ <StyledCheckbox
35
+ disableRipple
36
+ icon={<UncheckedIcon />}
37
+ checkedIcon={<CheckedIcon />}
38
+ indeterminateIcon={<IndeterminateIcon />}
39
+ value={value}
40
+ name={name}
41
+ checked={indeterminate ? true : checked}
42
+ defaultChecked={defaultChecked}
43
+ disabled={disabled}
44
+ required={required}
45
+ indeterminate={indeterminate}
46
+ onChange={onChange}
47
+ onChangeCapture={onChangeCapture}
48
+ inputProps={inputProps}
49
+ inputRef={inputRef}
50
+ />
51
+ {label && (
52
+ <Typography
53
+ variant="body5"
54
+ sx={{ display: 'flex', alignItems: 'center' }}
55
+ >
56
+ {label}
57
+ </Typography>
58
+ )}
59
+ </Container>
60
+ );
61
+ },
62
+ );
63
+
64
+ export default Checkbox;
@@ -0,0 +1,16 @@
1
+ import type { BoxProps, CheckboxProps as MuiCheckboxProps } from '@mui/material';
2
+
3
+ export interface CheckboxProps extends Omit<BoxProps<'span'>, 'onChange' | 'onChangeCapture'> {
4
+ value?: MuiCheckboxProps['value'];
5
+ name?: MuiCheckboxProps['name'];
6
+ checked?: MuiCheckboxProps['checked'];
7
+ defaultChecked?: MuiCheckboxProps['defaultChecked'];
8
+ disabled?: MuiCheckboxProps['disabled'];
9
+ required?: MuiCheckboxProps['required'];
10
+ indeterminate?: MuiCheckboxProps['indeterminate'];
11
+ onChange?: MuiCheckboxProps['onChange'];
12
+ onChangeCapture?: MuiCheckboxProps['onChangeCapture'];
13
+ label?: string;
14
+ inputProps?: MuiCheckboxProps['inputProps'];
15
+ inputRef?: MuiCheckboxProps['inputRef'];
16
+ }
@@ -0,0 +1,42 @@
1
+ import React from 'react';
2
+ import { Box } from '@mui/material';
3
+ import { iconStyle } from './Checkbox.styled';
4
+
5
+ export const UncheckedIcon = () => {
6
+ return (
7
+ <Box
8
+ component="span"
9
+ className="checkbox-icon"
10
+ sx={{
11
+ ...iconStyle,
12
+ background: `url("data:image/svg+xml,%0A%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M14 1.5H4C2.61929 1.5 1.5 2.61929 1.5 4V14C1.5 15.3807 2.61929 16.5 4 16.5H14C15.3807 16.5 16.5 15.3807 16.5 14V4C16.5 2.61929 15.3807 1.5 14 1.5ZM4 0C1.79086 0 0 1.79086 0 4V14C0 16.2091 1.79086 18 4 18H14C16.2091 18 18 16.2091 18 14V4C18 1.79086 16.2091 0 14 0H4Z' fill='%2399999B'/%3E%3C/svg%3E%0A")`,
13
+ }}
14
+ />
15
+ );
16
+ };
17
+
18
+ export const CheckedIcon = () => {
19
+ return (
20
+ <Box
21
+ component="span"
22
+ className="checkbox-icon"
23
+ sx={{
24
+ ...iconStyle,
25
+ background: `url("data:image/svg+xml,%0A%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M4 0C1.79086 0 0 1.79086 0 4V14C0 16.2091 1.79086 18 4 18H14C16.2091 18 18 16.2091 18 14V4C18 1.79086 16.2091 0 14 0H4ZM14.2516 7.14413C14.6074 6.72168 14.5533 6.09083 14.1309 5.73508C13.7084 5.37933 13.0776 5.43341 12.7218 5.85586L8.31824 11.0851L5.14993 8.37556C4.7302 8.01661 4.09895 8.06588 3.74 8.48561C3.38105 8.90533 3.43032 9.53658 3.85005 9.89553L7.78416 13.26C7.98672 13.4332 8.25006 13.5184 8.51571 13.4967C8.78135 13.4749 9.02732 13.348 9.19901 13.1441L14.2516 7.14413Z' fill='%2300C9EA'/%3E%3C/svg%3E%0A")`,
26
+ }}
27
+ />
28
+ );
29
+ };
30
+
31
+ export const IndeterminateIcon = () => {
32
+ return (
33
+ <Box
34
+ component="span"
35
+ className="checkbox-icon"
36
+ sx={{
37
+ ...iconStyle,
38
+ background: `url("data:image/svg+xml,%0A%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='4' fill='%2300C9EA'/%3E%3Cpath d='M3 9C3 8.44772 3.44772 8 4 8H14C14.5523 8 15 8.44772 15 9V9C15 9.55228 14.5523 10 14 10H4C3.44772 10 3 9.55228 3 9V9Z' fill='white'/%3E%3C/svg%3E%0A")`,
39
+ }}
40
+ />
41
+ );
42
+ };
@@ -0,0 +1,5 @@
1
+ import Checkbox from './Checkbox';
2
+ import type { CheckboxProps } from './Checkbox.types';
3
+
4
+ export { Checkbox };
5
+ export type { CheckboxProps };
@@ -0,0 +1,120 @@
1
+ import { Chip as MUIChip } from '@mui/material';
2
+ import { styled } from '@mui/material/styles';
3
+ import tinycolor from 'tinycolor2';
4
+ import theme from '../../theme';
5
+ import { ChipProps } from './Chip.types';
6
+
7
+ const StyledChip = styled(MUIChip, {
8
+ shouldForwardProp: (prop) => prop !== 'disableRipple',
9
+ })<ChipProps>(({ className }) => {
10
+ return {
11
+ height: '24px',
12
+
13
+ // Preset Colors
14
+ '&.presetDefault.MuiChip-colorDefault': {
15
+ backgroundColor: theme.palette.neutralGrey[70],
16
+ color: theme.palette.neutralGrey[25],
17
+ },
18
+
19
+ '&.presetUploaded': {
20
+ backgroundColor: theme.palette.analysisStatus.Uploaded,
21
+ color: theme.palette.lunitTeal[90],
22
+ },
23
+
24
+ '&.presetAnalyzing': {
25
+ backgroundColor: theme.palette.analysisStatus.Analyzing,
26
+ color: theme.palette.purple[80],
27
+ },
28
+
29
+ '&.presetAnalyzed': {
30
+ backgroundColor: theme.palette.analysisStatus.Analyzed,
31
+ color: theme.palette.green[50],
32
+ },
33
+
34
+ '&.presetFailed': {
35
+ color: theme.palette.neutralGrey[0],
36
+ backgroundColor: `${tinycolor(theme.palette.analysisStatus.FailedEnabled).setAlpha(0.5)}`,
37
+ border: `1px solid ${theme.palette.analysisStatus.FailedEnabled}`,
38
+
39
+ '&.MuiChip-clickable:hover': {
40
+ backgroundColor: `${tinycolor(theme.palette.analysisStatus.FailedHover).setAlpha(0.5)}`,
41
+ border: `1px solid ${theme.palette.analysisStatus.FailedHover}`,
42
+ },
43
+ '&.MuiChip-clickable:active': {
44
+ backgroundColor: theme.palette.analysisStatus.FailedSelected,
45
+ border: `1px solid ${theme.palette.analysisStatus.FailedSelected}`,
46
+ },
47
+ },
48
+
49
+ '&.presetReady': {
50
+ color: theme.palette.neutralGrey[0],
51
+ backgroundColor: `${tinycolor(theme.palette.analysisStatus.Ready).setAlpha(0.5)}`,
52
+ border: `1px solid ${theme.palette.analysisStatus.Ready}`,
53
+ '&.MuiChip-clickable:hover': {
54
+ backgroundColor: `${tinycolor(theme.palette.analysisStatus.ReadyHover).setAlpha(0.5)}`,
55
+ border: `1px solid ${theme.palette.analysisStatus.ReadyHover}`,
56
+ },
57
+ '&.MuiChip-clickable:active': {
58
+ backgroundColor: theme.palette.analysisStatus.ReadySelected,
59
+ border: `1px solid ${theme.palette.analysisStatus.ReadySelected}`,
60
+ },
61
+ },
62
+
63
+ '&.presetInferred': {
64
+ color: theme.palette.neutralGrey[0],
65
+ backgroundColor: `${tinycolor(theme.palette.analysisStatus.Inferred).setAlpha(0.5)}`,
66
+ border: `1px solid ${theme.palette.analysisStatus.Inferred}`,
67
+ '&.MuiChip-clickable:hover': {
68
+ backgroundColor: `${tinycolor(theme.palette.analysisStatus.InferredHover).setAlpha(0.5)}`,
69
+ border: `1px solid ${theme.palette.analysisStatus.InferredHover}`,
70
+ },
71
+ '&.MuiChip-clickable:active': {
72
+ backgroundColor: theme.palette.analysisStatus.InferredSelected,
73
+ border: `1px solid ${theme.palette.analysisStatus.InferredSelected}`,
74
+ },
75
+ },
76
+
77
+ '&.presetInvalid': {
78
+ color: theme.palette.neutralGrey[0],
79
+ backgroundColor: `${tinycolor(theme.palette.analysisStatus.Invalid).setAlpha(0.5)}`,
80
+ border: `1px solid ${tinycolor(theme.palette.analysisStatus.Invalid).setAlpha(0.5)}`,
81
+ '&.MuiChip-clickable:hover': {
82
+ backgroundColor: `${tinycolor(theme.palette.analysisStatus.InvalidHover).setAlpha(0.5)}`,
83
+ border: `1px solid ${theme.palette.neutralGrey[0]}`,
84
+ },
85
+ '&.MuiChip-clickable:active': {
86
+ backgroundColor: theme.palette.analysisStatus.InvalidSelected,
87
+ border: `1px solid ${theme.palette.neutralGrey[0]}`,
88
+ },
89
+ },
90
+
91
+ // Label Font
92
+ '.MuiChip-label': {
93
+ fontStyle: 'normal',
94
+ fontWeight: className === 'presetDefault' ? '400' : '500',
95
+ fontSize: '14px',
96
+ lineHeight: '20px',
97
+ },
98
+
99
+ // Icons position
100
+ '.MuiChip-icon': {
101
+ height: '18px',
102
+ marginRight: '-7px',
103
+ color: 'unset', // used default set by preset
104
+ },
105
+
106
+ '.MuiChip-deleteIcon': {
107
+ height: '18px',
108
+ width: '18px',
109
+ marginLeft: '-7px',
110
+ color: theme.palette.neutralGrey[0],
111
+ '&:hover': {
112
+ color: theme.palette.neutralGrey[0],
113
+ borderRadius: '50%',
114
+ backgroundColor: theme.palette.neutralGrey[90],
115
+ },
116
+ },
117
+ };
118
+ });
119
+
120
+ export default StyledChip;
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import { CloseSmall } from '../../icons';
3
+ import StyledChip from './Chip.styled';
4
+ import type { ChipProps } from './Chip.types';
5
+ import { presetMap } from './Chip.utils';
6
+
7
+ function Chip({ preset, label, icon, onDelete, onClick, ...otherProps }: ChipProps) {
8
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9
+ const overwrittenProps: any = {
10
+ label,
11
+ icon,
12
+ onDelete,
13
+ onClick,
14
+ };
15
+ // Remove undefined properties
16
+ Object.keys(overwrittenProps).forEach((key) =>
17
+ overwrittenProps[key] === undefined ? delete overwrittenProps[key] : {},
18
+ );
19
+
20
+ const newPreset = preset?.includes('failed') ? 'failed' : preset;
21
+
22
+ const customProps = {
23
+ disableRipple: true,
24
+ deleteIcon: <CloseSmall />,
25
+ ...presetMap[newPreset || 'default'],
26
+ ...overwrittenProps,
27
+ ...otherProps,
28
+ };
29
+
30
+ return <StyledChip {...customProps} />;
31
+ }
32
+
33
+ export default Chip;