@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.
- package/dist/index.js +0 -1
- package/dist/types/index.d.ts +0 -1
- package/package.json +7 -20
- package/src/assets/ic-bell-noti-outlined-20px.tsx +21 -0
- package/src/assets/ic-close-large-outlined-20px.tsx +17 -0
- package/src/assets/ic-close-small-outlined-20px.tsx +17 -0
- package/src/assets/ic-download-pdf-outlined-20px.tsx +18 -0
- package/src/assets/ic-ellipse-outlined-20px.tsx +17 -0
- package/src/assets/ic-filter-noti-outlined-20px.tsx +21 -0
- package/src/assets/ic-hide-large-outlined-20px.tsx +13 -0
- package/src/assets/ic-hide-small-outlined-20px.tsx +17 -0
- package/src/assets/ic-information-large-outlined-20px.tsx +17 -0
- package/src/assets/ic-information-small-outlined-20px.tsx +17 -0
- package/src/assets/ic-manufacturer-outlined-20px.tsx +19 -0
- package/src/assets/ic-rectangle-outlined-20px.tsx +17 -0
- package/src/assets/ic-refresh-left-outlined-20px.tsx +17 -0
- package/src/assets/ic-refresh-right-outlined-20px.tsx +13 -0
- package/src/assets/ic-show-large-outlined-20px.tsx +17 -0
- package/src/assets/ic-show-small-outlined-20px.tsx +17 -0
- package/src/assets/ic_bell_noti=outlined_20px.svg +5 -0
- package/src/assets/ic_close_large=outlined_20px.svg +4 -0
- package/src/assets/ic_close_small=outlined_20px.svg +4 -0
- package/src/assets/ic_download_pdf=outlined_20px.svg +7 -0
- package/src/assets/ic_ellipse=outlined_20px.svg +4 -0
- package/src/assets/ic_filter_noti=outlined_20px.svg +5 -0
- package/src/assets/ic_hide_large=outlined_20px.svg +4 -0
- package/src/assets/ic_hide_small=outlined_20px.svg +4 -0
- package/src/assets/ic_information_large=outlined_20px.svg +4 -0
- package/src/assets/ic_information_small=outlined_20px.svg +4 -0
- package/src/assets/ic_manufacturer=outlined_20px.svg +3 -0
- package/src/assets/ic_rectangle=outlined_20px.svg +4 -0
- package/src/assets/ic_refresh_left=outlined_20px.svg +4 -0
- package/src/assets/ic_refresh_right=outlined_20px.svg +4 -0
- package/src/assets/ic_show_large=outlined_20px.svg +4 -0
- package/src/assets/ic_show_small=outlined_20px.svg +4 -0
- package/src/assets/index.ts +16 -0
- package/src/components/Alert/Alert.styled.ts +44 -0
- package/src/components/Alert/Alert.tsx +39 -0
- package/src/components/Alert/Alert.types.ts +5 -0
- package/src/components/Alert/Alert.utils.tsx +43 -0
- package/src/components/Alert/index.ts +5 -0
- package/src/components/BaseTextField/BaseTextField.styled.ts +110 -0
- package/src/components/BaseTextField/BaseTextField.types.ts +25 -0
- package/src/components/BaseTextField/BaseTextField.utils.ts +10 -0
- package/src/components/Button/BaseButton.tsx +19 -0
- package/src/components/Button/Button.tsx +117 -0
- package/src/components/Button/Button.types.ts +36 -0
- package/src/components/Button/Button.utils.ts +13 -0
- package/src/components/Button/index.ts +6 -0
- package/src/components/Button/styleds/BaseButton.styled.ts +57 -0
- package/src/components/Button/styleds/ContainedButton.styled.ts +123 -0
- package/src/components/Button/styleds/GhostButton.styled.ts +139 -0
- package/src/components/Button/styleds/IconButton.styled.ts +25 -0
- package/src/components/Button/styleds/OutlinedButton.styled.ts +144 -0
- package/src/components/Card/Card.styled.tsx +18 -0
- package/src/components/Card/Card.tsx +18 -0
- package/src/components/Card/Card.types.ts +10 -0
- package/src/components/Card/index.ts +5 -0
- package/src/components/Checkbox/Checkbox.styled.tsx +27 -0
- package/src/components/Checkbox/Checkbox.tsx +64 -0
- package/src/components/Checkbox/Checkbox.types.ts +16 -0
- package/src/components/Checkbox/Checkbox.utils.tsx +42 -0
- package/src/components/Checkbox/index.ts +5 -0
- package/src/components/Chip/Chip.styled.ts +120 -0
- package/src/components/Chip/Chip.tsx +33 -0
- package/src/components/Chip/Chip.types.ts +18 -0
- package/src/components/Chip/Chip.utils.tsx +50 -0
- package/src/components/Chip/index.ts +4 -0
- package/src/components/DataTable/DataTable.styled.ts +66 -0
- package/src/components/DataTable/DataTable.tsx +29 -0
- package/src/components/DataTable/index.ts +1 -0
- package/src/components/DatePicker/DatePicker.styled.ts +19 -0
- package/src/components/DatePicker/DatePicker.tsx +194 -0
- package/src/components/DatePicker/DatePicker.types.ts +8 -0
- package/src/components/DatePicker/index.ts +4 -0
- package/src/components/Dialog/Dialog.styled.ts +87 -0
- package/src/components/Dialog/Dialog.tsx +111 -0
- package/src/components/Dialog/Dialog.types.ts +19 -0
- package/src/components/Dialog/index.ts +5 -0
- package/src/components/Divider/Divider.styled.ts +24 -0
- package/src/components/Divider/Divider.tsx +13 -0
- package/src/components/Divider/Divider.types.ts +7 -0
- package/src/components/Divider/index.ts +5 -0
- package/src/components/Dropdown/Dropdown.styled.tsx +127 -0
- package/src/components/Dropdown/Dropdown.tsx +116 -0
- package/src/components/Dropdown/Dropdown.types.ts +31 -0
- package/src/components/Dropdown/Dropdown.utils.ts +13 -0
- package/src/components/Dropdown/DropdownItem.styled.tsx +66 -0
- package/src/components/Dropdown/DropdownItem.tsx +45 -0
- package/src/components/Dropdown/DropdownItem.types.ts +14 -0
- package/src/components/Dropdown/DropdownItem.utils.ts +14 -0
- package/src/components/Dropdown/DropdownSubtitle.styled.ts +13 -0
- package/src/components/Dropdown/DropdownSubtitle.tsx +9 -0
- package/src/components/Dropdown/DropdownSubtitle.types.ts +6 -0
- package/src/components/Dropdown/IconDropdown.styled.tsx +82 -0
- package/src/components/Dropdown/IconDropdown.tsx +56 -0
- package/src/components/Dropdown/IconDropdown.types.ts +22 -0
- package/src/components/Dropdown/index.ts +22 -0
- package/src/components/FileDnDZone/FileDnDZone.styled.ts +43 -0
- package/src/components/FileDnDZone/FileDnDZone.tsx +81 -0
- package/src/components/FileDnDZone/FileDnDZone.types.ts +14 -0
- package/src/components/FileDnDZone/FileDnDZone.utils.ts +3 -0
- package/src/components/FileDnDZone/index.ts +5 -0
- package/src/components/List/List.styled.ts +31 -0
- package/src/components/List/List.tsx +71 -0
- package/src/components/List/List.types.ts +24 -0
- package/src/components/List/List.utils.ts +14 -0
- package/src/components/List/ListItem.styled.tsx +61 -0
- package/src/components/List/ListItem.tsx +66 -0
- package/src/components/List/ListItem.types.ts +40 -0
- package/src/components/List/ListItemCaption.styled.tsx +7 -0
- package/src/components/List/ListItemCaption.tsx +18 -0
- package/src/components/List/ListItemCaption.types.ts +2 -0
- package/src/components/List/index.ts +8 -0
- package/src/components/LoadingIndicator/LoadingIndicator.styled.tsx +40 -0
- package/src/components/LoadingIndicator/LoadingIndicator.tsx +44 -0
- package/src/components/LoadingIndicator/LoadingIndicator.types.ts +7 -0
- package/src/components/LoadingIndicator/assets/DnaLoadingAnimation.json +769 -0
- package/src/components/LoadingIndicator/assets/DotLoadingAnimation.json +426 -0
- package/src/components/LoadingIndicator/index.ts +5 -0
- package/src/components/Menu/Menu.styled.tsx +42 -0
- package/src/components/Menu/Menu.tsx +28 -0
- package/src/components/Menu/Menu.types.ts +18 -0
- package/src/components/Menu/MenuItem.styled.ts +62 -0
- package/src/components/Menu/MenuItem.tsx +45 -0
- package/src/components/Menu/MenuItem.types.ts +14 -0
- package/src/components/Menu/index.ts +5 -0
- package/src/components/MuiCssBaseline.ts +78 -0
- package/src/components/MuiInputBase.ts +25 -0
- package/src/components/MuiOutlinedInput.ts +57 -0
- package/src/components/MuiTextField.ts +17 -0
- package/src/components/Pagination/Pagination.styled.tsx +71 -0
- package/src/components/Pagination/Pagination.tsx +182 -0
- package/src/components/Pagination/Pagination.types.ts +39 -0
- package/src/components/Pagination/index.ts +2 -0
- package/src/components/ProductLabel/ProductLabel.styled.ts +61 -0
- package/src/components/ProductLabel/ProductLabel.tsx +57 -0
- package/src/components/ProductLabel/ProductLabel.types.ts +10 -0
- package/src/components/ProductLabel/index.ts +5 -0
- package/src/components/Progress/CircularProgress.styled.ts +10 -0
- package/src/components/Progress/CircularProgress.tsx +15 -0
- package/src/components/Progress/CircularProgress.types.ts +6 -0
- package/src/components/Progress/LinearProgress.styled.ts +15 -0
- package/src/components/Progress/LinearProgress.tsx +16 -0
- package/src/components/Progress/LinearProgress.types.ts +7 -0
- package/src/components/Progress/index.ts +4 -0
- package/src/components/Radio/Radio.styled.ts +35 -0
- package/src/components/Radio/Radio.tsx +60 -0
- package/src/components/Radio/Radio.types.ts +15 -0
- package/src/components/Radio/RadioGroup.styled.ts +6 -0
- package/src/components/Radio/RadioGroup.tsx +23 -0
- package/src/components/Radio/RadioGroup.types.ts +10 -0
- package/src/components/Radio/index.ts +7 -0
- package/src/components/Stepper/Stepper.styled.ts +38 -0
- package/src/components/Stepper/Stepper.tsx +24 -0
- package/src/components/Stepper/Stepper.types.ts +13 -0
- package/src/components/Stepper/index.ts +5 -0
- package/src/components/TabbedPanel/TabbedPanel.styled.ts +129 -0
- package/src/components/TabbedPanel/TabbedPanel.tsx +70 -0
- package/src/components/TabbedPanel/TabbedPanel.types.ts +36 -0
- package/src/components/TabbedPanel/TabbedPanel.utils.ts +21 -0
- package/src/components/TabbedPanel/index.ts +5 -0
- package/src/components/TextField/TextArea.styled.tsx +36 -0
- package/src/components/TextField/TextArea.tsx +35 -0
- package/src/components/TextField/TextArea.types.ts +28 -0
- package/src/components/TextField/TextInput.styled.tsx +115 -0
- package/src/components/TextField/TextInput.tsx +27 -0
- package/src/components/TextField/TextInput.types.ts +46 -0
- package/src/components/TextField/TextInput.utils.ts +7 -0
- package/src/components/TextField/components/Buttons.tsx +26 -0
- package/src/components/TextField/components/NormalTextInput.tsx +95 -0
- package/src/components/TextField/components/PasswordInput.tsx +92 -0
- package/src/components/TextField/index.ts +7 -0
- package/src/components/Tooltip/Tooltip.styled.tsx +36 -0
- package/src/components/Tooltip/Tooltip.tsx +58 -0
- package/src/components/Tooltip/Tooltip.types.ts +24 -0
- package/src/components/Tooltip/Tooltip.utils.ts +46 -0
- package/src/components/Tooltip/index.ts +5 -0
- package/src/components/UploadManager/UploadManager.styled.ts +49 -0
- package/src/components/UploadManager/UploadManager.tsx +271 -0
- package/src/components/UploadManager/UploadManager.types.ts +16 -0
- package/src/components/UploadManager/index.ts +5 -0
- package/src/components/index.ts +23 -0
- package/src/foundations/index.ts +4 -0
- package/src/foundations/palette.ts +418 -0
- package/src/foundations/spacing.ts +5 -0
- package/src/foundations/styles.ts +9 -0
- package/src/foundations/typography.ts +492 -0
- package/src/icons/BellNoti/index.tsx +28 -0
- package/src/icons/CloseLarge/index.tsx +28 -0
- package/src/icons/CloseSmall/index.tsx +28 -0
- package/src/icons/DownloadPdf/index.tsx +28 -0
- package/src/icons/Ellipse/index.tsx +28 -0
- package/src/icons/FilterNoti/index.tsx +28 -0
- package/src/icons/HideLarge/index.tsx +28 -0
- package/src/icons/HideSmall/index.tsx +28 -0
- package/src/icons/InformationLarge/index.tsx +28 -0
- package/src/icons/InformationSmall/index.tsx +28 -0
- package/src/icons/Manufacturer/index.tsx +28 -0
- package/src/icons/Rectangle/index.tsx +28 -0
- package/src/icons/RefreshLeft/index.tsx +28 -0
- package/src/icons/RefreshRight/index.tsx +28 -0
- package/src/icons/ShowLarge/index.tsx +28 -0
- package/src/icons/ShowSmall/index.tsx +28 -0
- package/src/icons/index.ts +180 -0
- package/src/index.ts +4 -0
- package/src/react-app-env.d.ts +71 -0
- package/src/reportWebVitals.ts +15 -0
- package/src/setupTests.ts +5 -0
- package/src/systems/drawer.ts +27 -0
- package/src/systems/index.ts +7 -0
- package/src/theme.ts +22 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { ComponentsOverrides, Theme } from '@mui/material';
|
|
2
|
+
import {
|
|
3
|
+
SMALL_SCROLLBAR_WIDTH,
|
|
4
|
+
SCROLLBAR_WIDTH,
|
|
5
|
+
DRAWER_WIDTH_OPEN,
|
|
6
|
+
DRAWER_WIDTH_CLOSE,
|
|
7
|
+
} from '../systems';
|
|
8
|
+
import { palette, typography } from '../foundations';
|
|
9
|
+
|
|
10
|
+
const html = {
|
|
11
|
+
fontSize: '14px',
|
|
12
|
+
boxSizing: 'border-box',
|
|
13
|
+
fontFamily: `Pretendard, sans-serif`,
|
|
14
|
+
fontFeatureSettings: `'tnum', 'ss01', 'ss02', 'ss08'`,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const styleOverrides: ComponentsOverrides<Theme>['MuiCssBaseline'] = {
|
|
18
|
+
html,
|
|
19
|
+
|
|
20
|
+
'*::-webkit-scrollbar-track': {
|
|
21
|
+
backgroundColor: 'transparent',
|
|
22
|
+
},
|
|
23
|
+
'*::-webkit-scrollbar-corner': {
|
|
24
|
+
backgroundColor: 'transparent',
|
|
25
|
+
},
|
|
26
|
+
'*::-webkit-scrollbar': {
|
|
27
|
+
// + 4 for padding
|
|
28
|
+
width: SCROLLBAR_WIDTH + 4,
|
|
29
|
+
height: SCROLLBAR_WIDTH + 4,
|
|
30
|
+
},
|
|
31
|
+
'.small-scrollbar::-webkit-scrollbar, .small-scrollbar *::-webkit-scrollbar': {
|
|
32
|
+
// + 4 for padding
|
|
33
|
+
width: SMALL_SCROLLBAR_WIDTH + 4,
|
|
34
|
+
height: SMALL_SCROLLBAR_WIDTH + 4,
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
'*::-webkit-scrollbar-thumb': {
|
|
38
|
+
backgroundColor: palette.neutralGrey?.[65],
|
|
39
|
+
borderRadius: 6,
|
|
40
|
+
border: '2px transparent solid',
|
|
41
|
+
backgroundClip: 'padding-box',
|
|
42
|
+
},
|
|
43
|
+
'*::-webkit-scrollbar-thumb:hover': {
|
|
44
|
+
backgroundColor: palette.neutralGrey?.[60],
|
|
45
|
+
},
|
|
46
|
+
'*::-webkit-scrollbar-thumb:active': {
|
|
47
|
+
backgroundColor: palette.neutralGrey?.[40],
|
|
48
|
+
},
|
|
49
|
+
'.Mui-disabled::-webkit-scrollbar-thumb:hover, .Mui-disabled *::-webkit-scrollbar-thumb:hover': {
|
|
50
|
+
backgroundColor: palette.neutralGrey?.[65],
|
|
51
|
+
},
|
|
52
|
+
'.Mui-disabled::-webkit-scrollbar-thumb:active, .Mui-disabled *::-webkit-scrollbar-thumb:active':
|
|
53
|
+
{
|
|
54
|
+
backgroundColor: palette.neutralGrey?.[65],
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
'svg.MuiCircularProgress-svg *': {
|
|
58
|
+
fill: 'none',
|
|
59
|
+
},
|
|
60
|
+
'svg *.stroke-inherit': {
|
|
61
|
+
fill: 'none',
|
|
62
|
+
stroke: 'currentColor',
|
|
63
|
+
},
|
|
64
|
+
'.snackbarVariantError': {
|
|
65
|
+
background: 'rgba(238, 81, 64, 0.18)',
|
|
66
|
+
border: '1px solid #EE5140',
|
|
67
|
+
...typography.body5,
|
|
68
|
+
},
|
|
69
|
+
'#page-root.drawer-open ~ .SnackbarContainer-left': {
|
|
70
|
+
left: `${DRAWER_WIDTH_OPEN + 20}px !important`,
|
|
71
|
+
},
|
|
72
|
+
'#page-root.drawer-close ~ .SnackbarContainer-left': {
|
|
73
|
+
left: `${DRAWER_WIDTH_CLOSE + 20}px !important`,
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
export default {
|
|
77
|
+
styleOverrides,
|
|
78
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ComponentsOverrides } from '@mui/material/styles';
|
|
2
|
+
|
|
3
|
+
const styleOverrides: ComponentsOverrides['MuiInputBase'] = {
|
|
4
|
+
root: {
|
|
5
|
+
'&': {
|
|
6
|
+
padding: 0,
|
|
7
|
+
},
|
|
8
|
+
},
|
|
9
|
+
input: {
|
|
10
|
+
height: '36px',
|
|
11
|
+
},
|
|
12
|
+
inputAdornedStart: {
|
|
13
|
+
'html &': {
|
|
14
|
+
paddingLeft: 0,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
inputAdornedEnd: {
|
|
18
|
+
'html &': {
|
|
19
|
+
paddingRight: 0,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
export default {
|
|
24
|
+
styleOverrides,
|
|
25
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ComponentsOverrides } from '@mui/material/styles';
|
|
2
|
+
import { palette, typography } from '../foundations';
|
|
3
|
+
|
|
4
|
+
const styleOverrides: ComponentsOverrides['MuiOutlinedInput'] = {
|
|
5
|
+
root: {
|
|
6
|
+
borderRadius: 8,
|
|
7
|
+
backgroundColor: palette.neutralGrey[75],
|
|
8
|
+
color: palette.neutralGrey[45],
|
|
9
|
+
'&.MuiInputBase-adornedStart': {
|
|
10
|
+
paddingLeft: '16px',
|
|
11
|
+
},
|
|
12
|
+
'&.MuiInputBase-adornedEnd': {
|
|
13
|
+
paddingRight: '16px',
|
|
14
|
+
},
|
|
15
|
+
'&.Mui-disabled': {
|
|
16
|
+
backgroundColor: 'transparent',
|
|
17
|
+
borderWidth: '1px',
|
|
18
|
+
borderColor: palette.neutralGrey[45],
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
notchedOutline: {
|
|
22
|
+
border: '1px solid transparent',
|
|
23
|
+
borderRadius: 8,
|
|
24
|
+
padding: 0,
|
|
25
|
+
'html .MuiOutlinedInput-root:hover &': {
|
|
26
|
+
borderColor: palette.neutralGrey[45],
|
|
27
|
+
},
|
|
28
|
+
'html .MuiOutlinedInput-root.Mui-focused &': {
|
|
29
|
+
borderWidth: '1px',
|
|
30
|
+
borderColor: palette.lunitTeal[10],
|
|
31
|
+
},
|
|
32
|
+
'html .MuiOutlinedInput-root.Mui-disabled &': {
|
|
33
|
+
border: 'none',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
input: {
|
|
37
|
+
...typography.body5,
|
|
38
|
+
color: palette.neutralGrey[5],
|
|
39
|
+
padding: '8px 16px',
|
|
40
|
+
boxSizing: 'border-box',
|
|
41
|
+
'&::placeholder': {
|
|
42
|
+
color: palette.neutralGrey[45],
|
|
43
|
+
},
|
|
44
|
+
'&:-webkit-autofill': {
|
|
45
|
+
boxShadow: `0 0 0 100px ${palette.neutralGrey[75]}`,
|
|
46
|
+
WebkitTextFillColor: palette.neutralGrey[5],
|
|
47
|
+
},
|
|
48
|
+
'&.Mui-disabled': {
|
|
49
|
+
backgroundColor: 'inherit',
|
|
50
|
+
borderRadius: '8px',
|
|
51
|
+
WebkitTextFillColor: palette.neutralGrey[45],
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
export default {
|
|
56
|
+
styleOverrides,
|
|
57
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ComponentsOverrides, ComponentsProps } from '@mui/material/styles';
|
|
2
|
+
|
|
3
|
+
const styleOverrides: ComponentsOverrides['MuiTextField'] = {
|
|
4
|
+
root: {
|
|
5
|
+
width: '100%',
|
|
6
|
+
input: {
|
|
7
|
+
textOverflow: 'ellipsis',
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
const defaultProps: ComponentsProps['MuiTextField'] = {
|
|
12
|
+
variant: 'standard',
|
|
13
|
+
};
|
|
14
|
+
export default {
|
|
15
|
+
styleOverrides,
|
|
16
|
+
defaultProps,
|
|
17
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Button, styled, Box } from '@mui/material';
|
|
2
|
+
import { subScrollbarWidth } from '../../foundations';
|
|
3
|
+
|
|
4
|
+
export const DEFAULT_PAGE_SIZE = 100;
|
|
5
|
+
export const PAGE_SIZE_LIST = [25, 50, 75, 100];
|
|
6
|
+
|
|
7
|
+
export const PaginationBox = styled(Box)(({ theme }) => ({
|
|
8
|
+
...theme.typography.body5,
|
|
9
|
+
display: 'flex',
|
|
10
|
+
justifyContent: 'space-between',
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
borderTop: `1px solid ${theme.palette.neutralGrey[90]}`,
|
|
13
|
+
height: '48px',
|
|
14
|
+
padding: '14px 0',
|
|
15
|
+
color: theme.palette.neutralGrey[40],
|
|
16
|
+
}));
|
|
17
|
+
|
|
18
|
+
export const PaperProps = { style: { maxHeight: 378, width: 136 } };
|
|
19
|
+
|
|
20
|
+
export const SidePageBox = styled('div')({
|
|
21
|
+
display: 'flex',
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
height: '20px',
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export const SelectButton = styled(Button)(({ theme }) => ({
|
|
27
|
+
justifyContent: 'flex-end',
|
|
28
|
+
border: '1px solid transparent',
|
|
29
|
+
minWidth: 'auto',
|
|
30
|
+
width: '58px',
|
|
31
|
+
height: '28px',
|
|
32
|
+
marginLeft: theme.spacing(3),
|
|
33
|
+
padding: '4px 4px 4px 8px',
|
|
34
|
+
color: theme.palette.neutralGrey[15],
|
|
35
|
+
'.MuiButton-endIcon': { margin: 0 },
|
|
36
|
+
'&:hover': {
|
|
37
|
+
background: 'transparent',
|
|
38
|
+
borderColor: theme.palette.neutralGrey[40],
|
|
39
|
+
},
|
|
40
|
+
'&:focus-visible': {
|
|
41
|
+
background: 'transparent',
|
|
42
|
+
borderColor: theme.palette.scope1,
|
|
43
|
+
},
|
|
44
|
+
}));
|
|
45
|
+
|
|
46
|
+
export const ArrowButton = styled(Button)(({ theme }) => ({
|
|
47
|
+
border: '1px solid transparent',
|
|
48
|
+
minWidth: 'auto',
|
|
49
|
+
height: '28px',
|
|
50
|
+
padding: theme.spacing(0.5),
|
|
51
|
+
color: theme.palette.neutralGrey[40],
|
|
52
|
+
'&:hover': {
|
|
53
|
+
background: theme.palette.neutralGrey[70],
|
|
54
|
+
},
|
|
55
|
+
'&:disabled': {
|
|
56
|
+
color: theme.palette.neutralGrey[40],
|
|
57
|
+
opacity: 0.4,
|
|
58
|
+
},
|
|
59
|
+
'.MuiButton-endIcon': {
|
|
60
|
+
margin: 0,
|
|
61
|
+
},
|
|
62
|
+
}));
|
|
63
|
+
|
|
64
|
+
export const PaginationContainer = styled('div')(({ theme }) => ({
|
|
65
|
+
padding: `0 ${subScrollbarWidth(theme.spacing(5))} 0 ${theme.spacing(5)}`,
|
|
66
|
+
}));
|
|
67
|
+
|
|
68
|
+
export const divider = {
|
|
69
|
+
borderWidth: '0',
|
|
70
|
+
margin: '0 12px',
|
|
71
|
+
} as const;
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useState, MouseEvent, useEffect, useMemo } from 'react';
|
|
3
|
+
import { ArrowDown } from '../../icons';
|
|
4
|
+
import { Divider } from '../Divider';
|
|
5
|
+
import { MenuItem, Menu } from '../Menu';
|
|
6
|
+
|
|
7
|
+
import { PaginationProps } from './Pagination.types';
|
|
8
|
+
import {
|
|
9
|
+
PaperProps,
|
|
10
|
+
PaginationBox,
|
|
11
|
+
SidePageBox,
|
|
12
|
+
SelectButton,
|
|
13
|
+
ArrowButton,
|
|
14
|
+
PAGE_SIZE_LIST,
|
|
15
|
+
divider,
|
|
16
|
+
} from './Pagination.styled';
|
|
17
|
+
|
|
18
|
+
function Pagination({
|
|
19
|
+
count: itemCount,
|
|
20
|
+
page: selectedPage = 1,
|
|
21
|
+
perPage: selectedPerPage,
|
|
22
|
+
totalPage,
|
|
23
|
+
onPageChange,
|
|
24
|
+
onPerPageChange,
|
|
25
|
+
}: PaginationProps) {
|
|
26
|
+
const [perPageAnchorEl, setPerPageAnchorEl] = useState<null | HTMLElement>(null);
|
|
27
|
+
const [pageAnchorEl, setPageAnchorEl] = useState<null | HTMLElement>(null);
|
|
28
|
+
|
|
29
|
+
const perPageOpen = Boolean(perPageAnchorEl);
|
|
30
|
+
const pageOpen = Boolean(pageAnchorEl);
|
|
31
|
+
|
|
32
|
+
const pages = useMemo(
|
|
33
|
+
() => Array.from({ length: totalPage }, (_, index) => index + 1),
|
|
34
|
+
[totalPage],
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
const startItemNumber = selectedPerPage * (selectedPage - 1) + 1;
|
|
38
|
+
const endItemNumber = Math.min(startItemNumber + selectedPerPage - 1, itemCount);
|
|
39
|
+
|
|
40
|
+
const handlePerPageClick = (event: MouseEvent<HTMLButtonElement>) => {
|
|
41
|
+
setPerPageAnchorEl(event.currentTarget);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const handlePerPageClose = () => {
|
|
45
|
+
setPerPageAnchorEl(null);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const handlePageClick = (event: MouseEvent<HTMLButtonElement>) => {
|
|
49
|
+
setPageAnchorEl(event.currentTarget);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const handlePageClose = () => {
|
|
53
|
+
setPageAnchorEl(null);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (selectedPage > totalPage) {
|
|
58
|
+
onPageChange?.(null, totalPage);
|
|
59
|
+
}
|
|
60
|
+
}, [totalPage, selectedPage, onPageChange]);
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<PaginationBox>
|
|
64
|
+
<SidePageBox>
|
|
65
|
+
Items per page
|
|
66
|
+
<SelectButton
|
|
67
|
+
endIcon={
|
|
68
|
+
<ArrowDown
|
|
69
|
+
style={{
|
|
70
|
+
transform: perPageOpen ? 'rotate(180deg)' : 'rotate(0deg)',
|
|
71
|
+
}}
|
|
72
|
+
/>
|
|
73
|
+
}
|
|
74
|
+
onClick={handlePerPageClick}
|
|
75
|
+
>
|
|
76
|
+
{selectedPerPage}
|
|
77
|
+
</SelectButton>
|
|
78
|
+
<Menu
|
|
79
|
+
showCheck
|
|
80
|
+
anchorEl={perPageAnchorEl}
|
|
81
|
+
anchorOrigin={{
|
|
82
|
+
vertical: 'top',
|
|
83
|
+
horizontal: 'right',
|
|
84
|
+
}}
|
|
85
|
+
transformOrigin={{
|
|
86
|
+
vertical: 'bottom',
|
|
87
|
+
horizontal: 'right',
|
|
88
|
+
}}
|
|
89
|
+
PaperProps={PaperProps}
|
|
90
|
+
onClose={handlePerPageClose}
|
|
91
|
+
open={perPageOpen}
|
|
92
|
+
>
|
|
93
|
+
{PAGE_SIZE_LIST.map((perPage) => (
|
|
94
|
+
<MenuItem
|
|
95
|
+
key={perPage}
|
|
96
|
+
selected={perPage === selectedPerPage}
|
|
97
|
+
onClick={(event) => {
|
|
98
|
+
event.preventDefault();
|
|
99
|
+
onPerPageChange?.(event, perPage);
|
|
100
|
+
handlePerPageClose();
|
|
101
|
+
}}
|
|
102
|
+
label={perPage}
|
|
103
|
+
/>
|
|
104
|
+
))}
|
|
105
|
+
</Menu>
|
|
106
|
+
<Divider
|
|
107
|
+
orientation="vertical"
|
|
108
|
+
sx={divider}
|
|
109
|
+
/>
|
|
110
|
+
{startItemNumber}-{endItemNumber} of {itemCount} items
|
|
111
|
+
</SidePageBox>
|
|
112
|
+
<SidePageBox>
|
|
113
|
+
This page
|
|
114
|
+
<SelectButton
|
|
115
|
+
id="selected-page"
|
|
116
|
+
endIcon={
|
|
117
|
+
<ArrowDown
|
|
118
|
+
style={{
|
|
119
|
+
transform: pageOpen ? 'rotate(180deg)' : 'rotate(0deg)',
|
|
120
|
+
}}
|
|
121
|
+
/>
|
|
122
|
+
}
|
|
123
|
+
onClick={handlePageClick}
|
|
124
|
+
>
|
|
125
|
+
{selectedPage}
|
|
126
|
+
</SelectButton>
|
|
127
|
+
<Menu
|
|
128
|
+
showCheck
|
|
129
|
+
anchorEl={pageAnchorEl}
|
|
130
|
+
anchorOrigin={{
|
|
131
|
+
vertical: 'top',
|
|
132
|
+
horizontal: 'right',
|
|
133
|
+
}}
|
|
134
|
+
transformOrigin={{
|
|
135
|
+
vertical: 'bottom',
|
|
136
|
+
horizontal: 'right',
|
|
137
|
+
}}
|
|
138
|
+
PaperProps={PaperProps}
|
|
139
|
+
onClose={handlePageClose}
|
|
140
|
+
open={pageOpen}
|
|
141
|
+
>
|
|
142
|
+
{pages.map((page) => (
|
|
143
|
+
<MenuItem
|
|
144
|
+
key={page}
|
|
145
|
+
selected={page === selectedPage}
|
|
146
|
+
onClick={(event) => {
|
|
147
|
+
event.preventDefault();
|
|
148
|
+
onPageChange?.(event, page);
|
|
149
|
+
handlePageClose();
|
|
150
|
+
}}
|
|
151
|
+
label={page}
|
|
152
|
+
/>
|
|
153
|
+
))}
|
|
154
|
+
</Menu>
|
|
155
|
+
<Divider
|
|
156
|
+
orientation="vertical"
|
|
157
|
+
sx={divider}
|
|
158
|
+
/>
|
|
159
|
+
<ArrowButton
|
|
160
|
+
id="prev-button"
|
|
161
|
+
disabled={selectedPage === 1}
|
|
162
|
+
onClick={(event) => {
|
|
163
|
+
event.preventDefault();
|
|
164
|
+
onPageChange?.(event, selectedPage - 1);
|
|
165
|
+
}}
|
|
166
|
+
endIcon={<ArrowDown style={{ transform: 'rotate(90deg)' }} />}
|
|
167
|
+
/>
|
|
168
|
+
<ArrowButton
|
|
169
|
+
id="next-button"
|
|
170
|
+
disabled={selectedPage === totalPage}
|
|
171
|
+
onClick={(event) => {
|
|
172
|
+
event.preventDefault();
|
|
173
|
+
onPageChange?.(event, selectedPage + 1);
|
|
174
|
+
}}
|
|
175
|
+
endIcon={<ArrowDown style={{ transform: 'rotate(-90deg)' }} />}
|
|
176
|
+
/>
|
|
177
|
+
</SidePageBox>
|
|
178
|
+
</PaginationBox>
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export default Pagination;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export interface PaginationProps {
|
|
2
|
+
count: number;
|
|
3
|
+
page?: number;
|
|
4
|
+
perPage: number;
|
|
5
|
+
totalPage: number;
|
|
6
|
+
onPageChange?: (
|
|
7
|
+
event: React.MouseEvent<HTMLLIElement> | React.MouseEvent<HTMLButtonElement> | null,
|
|
8
|
+
page: number,
|
|
9
|
+
) => void;
|
|
10
|
+
onPerPageChange?: (event: React.MouseEvent<HTMLLIElement> | null, perPage: number) => void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface SortObject {
|
|
14
|
+
empty: boolean;
|
|
15
|
+
unsorted: boolean;
|
|
16
|
+
sorted: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface Pageable {
|
|
20
|
+
offset: number;
|
|
21
|
+
sort: SortObject;
|
|
22
|
+
paged: boolean;
|
|
23
|
+
unpaged: boolean;
|
|
24
|
+
pageNumber: number;
|
|
25
|
+
pageSize: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface PaginationViewInfo {
|
|
29
|
+
totalElements: number;
|
|
30
|
+
totalPages: number;
|
|
31
|
+
size: number;
|
|
32
|
+
number: number;
|
|
33
|
+
sort: SortObject;
|
|
34
|
+
pageable: Pageable;
|
|
35
|
+
numberOfElements: number;
|
|
36
|
+
first: boolean;
|
|
37
|
+
last: boolean;
|
|
38
|
+
empty: boolean;
|
|
39
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { styled, Typography, Box, Dialog, DialogContent } from '@mui/material';
|
|
2
|
+
import { Button } from '../Button';
|
|
3
|
+
|
|
4
|
+
export const ProductName = styled(Typography)(({ theme }) => ({
|
|
5
|
+
...theme.typography.body_b1,
|
|
6
|
+
marginBottom: '12px',
|
|
7
|
+
}));
|
|
8
|
+
|
|
9
|
+
export const LabelRow = styled(Box)({
|
|
10
|
+
display: 'flex',
|
|
11
|
+
flexDirection: 'row',
|
|
12
|
+
marginBottom: 12,
|
|
13
|
+
alignItems: 'flex-start',
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const LabelColumn = styled(Box)({ flex: 0 });
|
|
17
|
+
|
|
18
|
+
export const LabelValue = styled(Box)({
|
|
19
|
+
flex: 1,
|
|
20
|
+
marginLeft: 16,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export const FramedText = styled(Typography)({
|
|
24
|
+
border: '1px solid #000',
|
|
25
|
+
padding: 2,
|
|
26
|
+
fontSize: 12,
|
|
27
|
+
lineHeight: '16px',
|
|
28
|
+
fontWeight: 700,
|
|
29
|
+
wordBreak: 'normal',
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export const LabelSubBox = styled(Box)({
|
|
33
|
+
marginLeft: '11.5px',
|
|
34
|
+
marginBottom: '4px',
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export const LabelContainer = styled(Dialog)({
|
|
38
|
+
'& .MuiPaper-root': {
|
|
39
|
+
width: 540,
|
|
40
|
+
backgroundColor: '#fff',
|
|
41
|
+
border: '2px solid #000',
|
|
42
|
+
borderRadius: '8px',
|
|
43
|
+
padding: 0,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export const LabelContent = styled(DialogContent)(({ theme }) => ({
|
|
48
|
+
padding: '30px',
|
|
49
|
+
color: theme.palette.neutralGrey[90],
|
|
50
|
+
}));
|
|
51
|
+
|
|
52
|
+
export const LabelCloseButton = styled(Button)({
|
|
53
|
+
position: 'absolute',
|
|
54
|
+
right: '30px',
|
|
55
|
+
top: '30px',
|
|
56
|
+
padding: 0,
|
|
57
|
+
color: '#4E4E50',
|
|
58
|
+
'&:hover': {
|
|
59
|
+
backgroundColor: 'transparent',
|
|
60
|
+
},
|
|
61
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { Box, Typography } from '@mui/material';
|
|
4
|
+
|
|
5
|
+
import { LabelContainer, LabelContent, LabelCloseButton } from './ProductLabel.styled';
|
|
6
|
+
import { ProductLabelProps } from './ProductLabel.types';
|
|
7
|
+
import { Divider } from '../Divider';
|
|
8
|
+
import { Close } from '../../icons';
|
|
9
|
+
import { LunitScope } from '@lunit/design-system-logo';
|
|
10
|
+
|
|
11
|
+
function ProductLabel({ open, onClose, children, footerStart, footerEnd }: ProductLabelProps) {
|
|
12
|
+
const handleClose = () => {
|
|
13
|
+
if (onClose) {
|
|
14
|
+
onClose();
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<LabelContainer
|
|
20
|
+
open={open}
|
|
21
|
+
maxWidth={false}
|
|
22
|
+
onClose={handleClose}
|
|
23
|
+
aria-labelledby="label-dialog-title"
|
|
24
|
+
>
|
|
25
|
+
<LabelCloseButton
|
|
26
|
+
variant="ghost"
|
|
27
|
+
icon={<Close />}
|
|
28
|
+
onClick={handleClose}
|
|
29
|
+
/>
|
|
30
|
+
<LabelContent>
|
|
31
|
+
<div>
|
|
32
|
+
<LunitScope style={{ width: '170px' }} />
|
|
33
|
+
</div>
|
|
34
|
+
<Typography variant="body5">
|
|
35
|
+
Software Algorithm Device To Assist Users In Digital Pathology
|
|
36
|
+
</Typography>
|
|
37
|
+
<Divider
|
|
38
|
+
orientation="horizontal"
|
|
39
|
+
sx={{ margin: '15px 0' }}
|
|
40
|
+
/>
|
|
41
|
+
{children}
|
|
42
|
+
<Divider
|
|
43
|
+
orientation="horizontal"
|
|
44
|
+
sx={{ margin: '8px 0' }}
|
|
45
|
+
/>
|
|
46
|
+
{(footerStart || footerEnd) && (
|
|
47
|
+
<Box sx={{ display: 'flex', justifyContent: 'space-between' }}>
|
|
48
|
+
{footerStart ? footerStart : <div />}
|
|
49
|
+
{footerEnd}
|
|
50
|
+
</Box>
|
|
51
|
+
)}
|
|
52
|
+
</LabelContent>
|
|
53
|
+
</LabelContainer>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export default ProductLabel;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CircularProgress as MuiCircularProgress, styled } from '@mui/material';
|
|
2
|
+
import type { CircularProgressProps } from './CircularProgress.types';
|
|
3
|
+
|
|
4
|
+
const BaseCircularProgress = styled(MuiCircularProgress, {
|
|
5
|
+
shouldForwardProp: (prop) => prop !== 'circleColor',
|
|
6
|
+
})<CircularProgressProps>(({ theme, circleColor }) => ({
|
|
7
|
+
color: circleColor || theme.palette.lunitTeal[40],
|
|
8
|
+
}));
|
|
9
|
+
|
|
10
|
+
export default BaseCircularProgress;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import BaseCircularProgress from './CircularProgress.styled';
|
|
3
|
+
import type { CircularProgressProps } from './CircularProgress.types';
|
|
4
|
+
|
|
5
|
+
function CircularProgress({ progress, size = 36, ...otherProps }: CircularProgressProps) {
|
|
6
|
+
return (
|
|
7
|
+
<BaseCircularProgress
|
|
8
|
+
size={size}
|
|
9
|
+
value={progress}
|
|
10
|
+
{...otherProps}
|
|
11
|
+
/>
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default CircularProgress;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LinearProgress as MuiLinearProgress, linearProgressClasses, styled } from '@mui/material';
|
|
2
|
+
import type { LinearProgressProps } from './LinearProgress.types';
|
|
3
|
+
|
|
4
|
+
const BaseLinearProgress = styled(MuiLinearProgress, {
|
|
5
|
+
shouldForwardProp: (prop) => prop !== 'barColor',
|
|
6
|
+
})<LinearProgressProps>(({ theme, height, barColor }) => ({
|
|
7
|
+
width: '100%',
|
|
8
|
+
height,
|
|
9
|
+
backgroundColor: 'transparent',
|
|
10
|
+
[`& .${linearProgressClasses.barColorPrimary}`]: {
|
|
11
|
+
backgroundColor: barColor || theme.palette.lunitTeal[40],
|
|
12
|
+
},
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
export default BaseLinearProgress;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import BaseLinearProgress from './LinearProgress.styled';
|
|
3
|
+
import type { LinearProgressProps } from './LinearProgress.types';
|
|
4
|
+
|
|
5
|
+
function LinearProgress({ barColor, progress, height = 4, ...otherProps }: LinearProgressProps) {
|
|
6
|
+
return (
|
|
7
|
+
<BaseLinearProgress
|
|
8
|
+
value={progress}
|
|
9
|
+
height={height}
|
|
10
|
+
barColor={barColor}
|
|
11
|
+
{...otherProps}
|
|
12
|
+
/>
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default LinearProgress;
|