@lunit/oui 1.0.1 → 1.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/components/EllipsisTypography/EllipsisTypography.js +62 -0
- package/dist/components/EllipsisTypography/EllipsisTypography.styled.js +16 -0
- package/dist/components/EllipsisTypography/EllipsisTypography.types.js +2 -0
- package/dist/components/EllipsisTypography/index.js +3 -0
- package/dist/components/MuiCssBaseline.js +16 -0
- package/dist/components/ResizeObserver/ResizeObserverContext.js +56 -0
- package/dist/components/ResizeObserver/index.js +3 -0
- package/dist/components/index.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/components/EllipsisTypography/EllipsisTypography.d.ts +3 -0
- package/dist/types/components/EllipsisTypography/EllipsisTypography.styled.d.ts +6 -0
- package/dist/types/components/EllipsisTypography/EllipsisTypography.types.d.ts +9 -0
- package/dist/types/components/EllipsisTypography/index.d.ts +4 -0
- package/dist/types/components/ResizeObserver/ResizeObserverContext.d.ts +9 -0
- package/dist/types/components/ResizeObserver/index.d.ts +2 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +14 -7
- package/.git-ftp-include +0 -1
- package/src/assets/ic-bell-noti-outlined-20px.tsx +0 -21
- package/src/assets/ic-close-large-outlined-20px.tsx +0 -17
- package/src/assets/ic-close-small-outlined-20px.tsx +0 -17
- package/src/assets/ic-download-pdf-outlined-20px.tsx +0 -18
- package/src/assets/ic-ellipse-outlined-20px.tsx +0 -17
- package/src/assets/ic-filter-noti-outlined-20px.tsx +0 -21
- package/src/assets/ic-hide-large-outlined-20px.tsx +0 -13
- package/src/assets/ic-hide-small-outlined-20px.tsx +0 -17
- package/src/assets/ic-information-large-outlined-20px.tsx +0 -17
- package/src/assets/ic-information-small-outlined-20px.tsx +0 -17
- package/src/assets/ic-manufacturer-outlined-20px.tsx +0 -19
- package/src/assets/ic-rectangle-outlined-20px.tsx +0 -17
- package/src/assets/ic-refresh-left-outlined-20px.tsx +0 -17
- package/src/assets/ic-refresh-right-outlined-20px.tsx +0 -13
- package/src/assets/ic-show-large-outlined-20px.tsx +0 -17
- package/src/assets/ic-show-small-outlined-20px.tsx +0 -17
- package/src/assets/ic_bell_noti=outlined_20px.svg +0 -5
- package/src/assets/ic_close_large=outlined_20px.svg +0 -4
- package/src/assets/ic_close_small=outlined_20px.svg +0 -4
- package/src/assets/ic_download_pdf=outlined_20px.svg +0 -7
- package/src/assets/ic_ellipse=outlined_20px.svg +0 -4
- package/src/assets/ic_filter_noti=outlined_20px.svg +0 -5
- package/src/assets/ic_hide_large=outlined_20px.svg +0 -4
- package/src/assets/ic_hide_small=outlined_20px.svg +0 -4
- package/src/assets/ic_information_large=outlined_20px.svg +0 -4
- package/src/assets/ic_information_small=outlined_20px.svg +0 -4
- package/src/assets/ic_manufacturer=outlined_20px.svg +0 -3
- package/src/assets/ic_rectangle=outlined_20px.svg +0 -4
- package/src/assets/ic_refresh_left=outlined_20px.svg +0 -4
- package/src/assets/ic_refresh_right=outlined_20px.svg +0 -4
- package/src/assets/ic_show_large=outlined_20px.svg +0 -4
- package/src/assets/ic_show_small=outlined_20px.svg +0 -4
- package/src/assets/index.ts +0 -16
- package/src/components/Alert/Alert.styled.ts +0 -44
- package/src/components/Alert/Alert.tsx +0 -39
- package/src/components/Alert/Alert.types.ts +0 -5
- package/src/components/Alert/Alert.utils.tsx +0 -43
- package/src/components/Alert/index.ts +0 -5
- package/src/components/BaseTextField/BaseTextField.styled.ts +0 -110
- package/src/components/BaseTextField/BaseTextField.types.ts +0 -25
- package/src/components/BaseTextField/BaseTextField.utils.ts +0 -10
- package/src/components/Button/BaseButton.tsx +0 -19
- package/src/components/Button/Button.tsx +0 -117
- package/src/components/Button/Button.types.ts +0 -36
- package/src/components/Button/Button.utils.ts +0 -13
- package/src/components/Button/index.ts +0 -6
- package/src/components/Button/styleds/BaseButton.styled.ts +0 -57
- package/src/components/Button/styleds/ContainedButton.styled.ts +0 -123
- package/src/components/Button/styleds/GhostButton.styled.ts +0 -139
- package/src/components/Button/styleds/IconButton.styled.ts +0 -25
- package/src/components/Button/styleds/OutlinedButton.styled.ts +0 -144
- package/src/components/Card/Card.styled.tsx +0 -18
- package/src/components/Card/Card.tsx +0 -18
- package/src/components/Card/Card.types.ts +0 -10
- package/src/components/Card/index.ts +0 -5
- package/src/components/Checkbox/Checkbox.styled.tsx +0 -27
- package/src/components/Checkbox/Checkbox.tsx +0 -64
- package/src/components/Checkbox/Checkbox.types.ts +0 -16
- package/src/components/Checkbox/Checkbox.utils.tsx +0 -42
- package/src/components/Checkbox/index.ts +0 -5
- package/src/components/Chip/Chip.styled.ts +0 -120
- package/src/components/Chip/Chip.tsx +0 -33
- package/src/components/Chip/Chip.types.ts +0 -18
- package/src/components/Chip/Chip.utils.tsx +0 -50
- package/src/components/Chip/index.ts +0 -4
- package/src/components/DataTable/DataTable.styled.ts +0 -66
- package/src/components/DataTable/DataTable.tsx +0 -29
- package/src/components/DataTable/index.ts +0 -1
- package/src/components/DatePicker/DatePicker.styled.ts +0 -19
- package/src/components/DatePicker/DatePicker.tsx +0 -194
- package/src/components/DatePicker/DatePicker.types.ts +0 -8
- package/src/components/DatePicker/index.ts +0 -4
- package/src/components/Dialog/Dialog.styled.ts +0 -87
- package/src/components/Dialog/Dialog.tsx +0 -111
- package/src/components/Dialog/Dialog.types.ts +0 -19
- package/src/components/Dialog/index.ts +0 -5
- package/src/components/Divider/Divider.styled.ts +0 -24
- package/src/components/Divider/Divider.tsx +0 -13
- package/src/components/Divider/Divider.types.ts +0 -7
- package/src/components/Divider/index.ts +0 -5
- package/src/components/Dropdown/Dropdown.styled.tsx +0 -127
- package/src/components/Dropdown/Dropdown.tsx +0 -116
- package/src/components/Dropdown/Dropdown.types.ts +0 -31
- package/src/components/Dropdown/Dropdown.utils.ts +0 -13
- package/src/components/Dropdown/DropdownItem.styled.tsx +0 -66
- package/src/components/Dropdown/DropdownItem.tsx +0 -45
- package/src/components/Dropdown/DropdownItem.types.ts +0 -14
- package/src/components/Dropdown/DropdownItem.utils.ts +0 -14
- package/src/components/Dropdown/DropdownSubtitle.styled.ts +0 -13
- package/src/components/Dropdown/DropdownSubtitle.tsx +0 -9
- package/src/components/Dropdown/DropdownSubtitle.types.ts +0 -6
- package/src/components/Dropdown/IconDropdown.styled.tsx +0 -82
- package/src/components/Dropdown/IconDropdown.tsx +0 -56
- package/src/components/Dropdown/IconDropdown.types.ts +0 -22
- package/src/components/Dropdown/index.ts +0 -22
- package/src/components/FileDnDZone/FileDnDZone.styled.ts +0 -43
- package/src/components/FileDnDZone/FileDnDZone.tsx +0 -81
- package/src/components/FileDnDZone/FileDnDZone.types.ts +0 -14
- package/src/components/FileDnDZone/FileDnDZone.utils.ts +0 -3
- package/src/components/FileDnDZone/index.ts +0 -5
- package/src/components/List/List.styled.ts +0 -31
- package/src/components/List/List.tsx +0 -71
- package/src/components/List/List.types.ts +0 -24
- package/src/components/List/List.utils.ts +0 -14
- package/src/components/List/ListItem.styled.tsx +0 -61
- package/src/components/List/ListItem.tsx +0 -66
- package/src/components/List/ListItem.types.ts +0 -40
- package/src/components/List/ListItemCaption.styled.tsx +0 -7
- package/src/components/List/ListItemCaption.tsx +0 -18
- package/src/components/List/ListItemCaption.types.ts +0 -2
- package/src/components/List/index.ts +0 -8
- package/src/components/LoadingIndicator/LoadingIndicator.styled.tsx +0 -40
- package/src/components/LoadingIndicator/LoadingIndicator.tsx +0 -44
- package/src/components/LoadingIndicator/LoadingIndicator.types.ts +0 -7
- package/src/components/LoadingIndicator/assets/DnaLoadingAnimation.json +0 -769
- package/src/components/LoadingIndicator/assets/DotLoadingAnimation.json +0 -426
- package/src/components/LoadingIndicator/index.ts +0 -5
- package/src/components/Menu/Menu.styled.tsx +0 -42
- package/src/components/Menu/Menu.tsx +0 -28
- package/src/components/Menu/Menu.types.ts +0 -18
- package/src/components/Menu/MenuItem.styled.ts +0 -62
- package/src/components/Menu/MenuItem.tsx +0 -45
- package/src/components/Menu/MenuItem.types.ts +0 -14
- package/src/components/Menu/index.ts +0 -5
- package/src/components/MuiCssBaseline.ts +0 -78
- package/src/components/MuiInputBase.ts +0 -25
- package/src/components/MuiOutlinedInput.ts +0 -57
- package/src/components/MuiTextField.ts +0 -17
- package/src/components/Pagination/Pagination.styled.tsx +0 -71
- package/src/components/Pagination/Pagination.tsx +0 -182
- package/src/components/Pagination/Pagination.types.ts +0 -39
- package/src/components/Pagination/index.ts +0 -2
- package/src/components/ProductLabel/ProductLabel.styled.ts +0 -61
- package/src/components/ProductLabel/ProductLabel.tsx +0 -57
- package/src/components/ProductLabel/ProductLabel.types.ts +0 -10
- package/src/components/ProductLabel/index.ts +0 -5
- package/src/components/Progress/CircularProgress.styled.ts +0 -10
- package/src/components/Progress/CircularProgress.tsx +0 -15
- package/src/components/Progress/CircularProgress.types.ts +0 -6
- package/src/components/Progress/LinearProgress.styled.ts +0 -15
- package/src/components/Progress/LinearProgress.tsx +0 -16
- package/src/components/Progress/LinearProgress.types.ts +0 -7
- package/src/components/Progress/index.ts +0 -4
- package/src/components/Radio/Radio.styled.ts +0 -35
- package/src/components/Radio/Radio.tsx +0 -60
- package/src/components/Radio/Radio.types.ts +0 -15
- package/src/components/Radio/RadioGroup.styled.ts +0 -6
- package/src/components/Radio/RadioGroup.tsx +0 -23
- package/src/components/Radio/RadioGroup.types.ts +0 -10
- package/src/components/Radio/index.ts +0 -7
- package/src/components/Stepper/Stepper.styled.ts +0 -38
- package/src/components/Stepper/Stepper.tsx +0 -24
- package/src/components/Stepper/Stepper.types.ts +0 -13
- package/src/components/Stepper/index.ts +0 -5
- package/src/components/TabbedPanel/TabbedPanel.styled.ts +0 -129
- package/src/components/TabbedPanel/TabbedPanel.tsx +0 -70
- package/src/components/TabbedPanel/TabbedPanel.types.ts +0 -36
- package/src/components/TabbedPanel/TabbedPanel.utils.ts +0 -21
- package/src/components/TabbedPanel/index.ts +0 -5
- package/src/components/TextField/TextArea.styled.tsx +0 -36
- package/src/components/TextField/TextArea.tsx +0 -35
- package/src/components/TextField/TextArea.types.ts +0 -28
- package/src/components/TextField/TextInput.styled.tsx +0 -115
- package/src/components/TextField/TextInput.tsx +0 -27
- package/src/components/TextField/TextInput.types.ts +0 -46
- package/src/components/TextField/TextInput.utils.ts +0 -7
- package/src/components/TextField/components/Buttons.tsx +0 -26
- package/src/components/TextField/components/NormalTextInput.tsx +0 -95
- package/src/components/TextField/components/PasswordInput.tsx +0 -92
- package/src/components/TextField/index.ts +0 -7
- package/src/components/Tooltip/Tooltip.styled.tsx +0 -36
- package/src/components/Tooltip/Tooltip.tsx +0 -58
- package/src/components/Tooltip/Tooltip.types.ts +0 -24
- package/src/components/Tooltip/Tooltip.utils.ts +0 -46
- package/src/components/Tooltip/index.ts +0 -5
- package/src/components/UploadManager/UploadManager.styled.ts +0 -49
- package/src/components/UploadManager/UploadManager.tsx +0 -271
- package/src/components/UploadManager/UploadManager.types.ts +0 -16
- package/src/components/UploadManager/index.ts +0 -5
- package/src/components/index.ts +0 -23
- package/src/foundations/index.ts +0 -4
- package/src/foundations/palette.ts +0 -418
- package/src/foundations/spacing.ts +0 -5
- package/src/foundations/styles.ts +0 -9
- package/src/foundations/typography.ts +0 -492
- package/src/icons/BellNoti/index.tsx +0 -28
- package/src/icons/CloseLarge/index.tsx +0 -28
- package/src/icons/CloseSmall/index.tsx +0 -28
- package/src/icons/DownloadPdf/index.tsx +0 -28
- package/src/icons/Ellipse/index.tsx +0 -28
- package/src/icons/FilterNoti/index.tsx +0 -28
- package/src/icons/HideLarge/index.tsx +0 -28
- package/src/icons/HideSmall/index.tsx +0 -28
- package/src/icons/InformationLarge/index.tsx +0 -28
- package/src/icons/InformationSmall/index.tsx +0 -28
- package/src/icons/Manufacturer/index.tsx +0 -28
- package/src/icons/Rectangle/index.tsx +0 -28
- package/src/icons/RefreshLeft/index.tsx +0 -28
- package/src/icons/RefreshRight/index.tsx +0 -28
- package/src/icons/ShowLarge/index.tsx +0 -28
- package/src/icons/ShowSmall/index.tsx +0 -28
- package/src/icons/index.ts +0 -180
- package/src/index.ts +0 -4
- package/src/react-app-env.d.ts +0 -71
- package/src/reportWebVitals.ts +0 -15
- package/src/setupTests.ts +0 -5
- package/src/systems/drawer.ts +0 -27
- package/src/systems/index.ts +0 -7
- package/src/theme.ts +0 -22
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const BUTTON_DROPDOWN_ITEM = 'BUTTON_DROPDOWN_ITEM';
|
|
2
|
-
|
|
3
|
-
const shouldPadForEmptyIcon = (
|
|
4
|
-
emptyIcon: boolean | undefined,
|
|
5
|
-
checkIcon: boolean | undefined,
|
|
6
|
-
customIcon: React.ReactElement | undefined,
|
|
7
|
-
selected: boolean | undefined,
|
|
8
|
-
) => {
|
|
9
|
-
if (checkIcon) return !selected;
|
|
10
|
-
if (customIcon) return false;
|
|
11
|
-
return !!emptyIcon;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export { BUTTON_DROPDOWN_ITEM, shouldPadForEmptyIcon };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Typography, styled } from '@mui/material';
|
|
2
|
-
|
|
3
|
-
const BaseDropdownSubtitle = styled(Typography)(({ theme }) => {
|
|
4
|
-
return {
|
|
5
|
-
color: theme.palette.neutralGrey[40],
|
|
6
|
-
width: '140px',
|
|
7
|
-
height: '20px',
|
|
8
|
-
padding: '8px',
|
|
9
|
-
paddingLeft: '16px',
|
|
10
|
-
};
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
export default BaseDropdownSubtitle;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import BaseDropdownSubtitle from './DropdownSubtitle.styled';
|
|
3
|
-
import type DropdownSubtitleProps from './DropdownSubtitle.types';
|
|
4
|
-
|
|
5
|
-
const DropdownSubtitle = ({ label }: DropdownSubtitleProps) => {
|
|
6
|
-
return <BaseDropdownSubtitle variant="small_body_m1">{label}</BaseDropdownSubtitle>;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export default DropdownSubtitle;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Select, styled } from '@mui/material';
|
|
3
|
-
import type { Theme } from '@mui/material';
|
|
4
|
-
import type { BaseIconDropdownProps, IconDropdownProps } from './IconDropdown.types';
|
|
5
|
-
|
|
6
|
-
const baseIconDropdownStyle = (theme: Theme) => {
|
|
7
|
-
return {
|
|
8
|
-
fontFamily:
|
|
9
|
-
'Pretendard,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"',
|
|
10
|
-
fontSize: '14px',
|
|
11
|
-
fontWeight: '400',
|
|
12
|
-
background: theme.palette.neutralGrey[85],
|
|
13
|
-
width: '52px',
|
|
14
|
-
borderRadius: '8px',
|
|
15
|
-
border: '1px solid transparent',
|
|
16
|
-
padding: '0 2px 0 0',
|
|
17
|
-
height: '36px',
|
|
18
|
-
color: theme.palette.neutralGrey[5],
|
|
19
|
-
'& fieldset': {
|
|
20
|
-
border: 'none',
|
|
21
|
-
},
|
|
22
|
-
'&.Mui-focused': {
|
|
23
|
-
border: `1px solid transparent !important`,
|
|
24
|
-
},
|
|
25
|
-
'&.Mui-disabled': {
|
|
26
|
-
opacity: '0.4',
|
|
27
|
-
},
|
|
28
|
-
'.MuiSvgIcon-root ': {
|
|
29
|
-
cursor: 'pointer',
|
|
30
|
-
color: theme.palette.neutralGrey[5],
|
|
31
|
-
'&.Mui-disabled': {
|
|
32
|
-
color: theme.palette.neutralGrey[45],
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
'.MuiSelect-select': {
|
|
36
|
-
display: 'flex',
|
|
37
|
-
padding: '0 0 0 8px !important',
|
|
38
|
-
width: 'fit-content',
|
|
39
|
-
},
|
|
40
|
-
'&:hover': {
|
|
41
|
-
backgroundColor: theme.palette.neutralGrey[70],
|
|
42
|
-
opacity: 0.8,
|
|
43
|
-
border: `1px solid transparent`,
|
|
44
|
-
'&.Mui-disabled': {
|
|
45
|
-
border: '1px solid transparent',
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const toggledIconDropdownStyle = (theme: Theme) => {
|
|
52
|
-
return {
|
|
53
|
-
backgroundColor: theme.palette.neutralGrey[70],
|
|
54
|
-
border: `1px solid transparent`,
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
const BaseIconDropdown = styled(Select, {
|
|
59
|
-
shouldForwardProp: (prop) => !['small', 'isToggled'].includes(prop.toString()),
|
|
60
|
-
})<BaseIconDropdownProps>(({ theme, isToggled }) => {
|
|
61
|
-
let style = baseIconDropdownStyle(theme);
|
|
62
|
-
|
|
63
|
-
if (isToggled) {
|
|
64
|
-
style = {
|
|
65
|
-
...style,
|
|
66
|
-
...toggledIconDropdownStyle(theme),
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return style;
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
const DropdownContainer = styled('div')<IconDropdownProps>(() => {
|
|
74
|
-
return {
|
|
75
|
-
position: 'relative',
|
|
76
|
-
display: 'flex',
|
|
77
|
-
flexDirection: 'column',
|
|
78
|
-
minWidth: '32px',
|
|
79
|
-
};
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
export { BaseIconDropdown, DropdownContainer };
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { ArrowDownXs } from '../../icons';
|
|
4
|
-
import { BaseIconDropdown } from './IconDropdown.styled';
|
|
5
|
-
import theme from '../../theme';
|
|
6
|
-
import type { IconDropdownProps } from './IconDropdown.types';
|
|
7
|
-
|
|
8
|
-
const IconDropdown = ({ open, disabled, children, ...otherProps }: IconDropdownProps) => {
|
|
9
|
-
const [isOpen, setOpen] = useState<boolean>(false);
|
|
10
|
-
|
|
11
|
-
return (
|
|
12
|
-
<BaseIconDropdown
|
|
13
|
-
IconComponent={() => (
|
|
14
|
-
<ArrowDownXs
|
|
15
|
-
onClick={() => {
|
|
16
|
-
if (typeof open === 'undefined') setOpen(false);
|
|
17
|
-
}}
|
|
18
|
-
style={
|
|
19
|
-
isOpen || open
|
|
20
|
-
? {
|
|
21
|
-
cursor: 'pointer',
|
|
22
|
-
transform: 'scaleY(-1)',
|
|
23
|
-
}
|
|
24
|
-
: undefined
|
|
25
|
-
}
|
|
26
|
-
/>
|
|
27
|
-
)}
|
|
28
|
-
open={
|
|
29
|
-
// eslint-disable-next-line no-nested-ternary
|
|
30
|
-
typeof open !== 'undefined' ? open : disabled ? false : isOpen
|
|
31
|
-
}
|
|
32
|
-
disabled={disabled}
|
|
33
|
-
multiple={false}
|
|
34
|
-
onClick={() => {
|
|
35
|
-
if (!disabled) setOpen(!isOpen);
|
|
36
|
-
}}
|
|
37
|
-
MenuProps={{
|
|
38
|
-
sx: {
|
|
39
|
-
'.MuiPaper-root': {
|
|
40
|
-
marginTop: '4px',
|
|
41
|
-
borderRadius: '8px',
|
|
42
|
-
background: theme.palette.neutralGrey[85],
|
|
43
|
-
border: 'transparent',
|
|
44
|
-
left: 0,
|
|
45
|
-
width: '260px',
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
}}
|
|
49
|
-
{...otherProps}
|
|
50
|
-
>
|
|
51
|
-
{children}
|
|
52
|
-
</BaseIconDropdown>
|
|
53
|
-
);
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export default IconDropdown;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { TypographyProps } from '@mui/system';
|
|
2
|
-
import type { BaseDropdownProps } from '../Dropdown/Dropdown.types';
|
|
3
|
-
|
|
4
|
-
interface BaseIconDropdownProps extends BaseDropdownProps {
|
|
5
|
-
isToggled?: boolean;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
interface IconDropdownProps extends BaseIconDropdownProps {}
|
|
9
|
-
|
|
10
|
-
interface PlaceholderProps extends TypographyProps {
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
interface IconDropdownOption {
|
|
15
|
-
value: string;
|
|
16
|
-
icon: React.ReactElement;
|
|
17
|
-
label: string;
|
|
18
|
-
shortcut?: string;
|
|
19
|
-
default?: boolean;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export { IconDropdownProps, BaseIconDropdownProps, PlaceholderProps, IconDropdownOption };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import Dropdown from './Dropdown';
|
|
2
|
-
import type { DropdownProps } from './Dropdown.types';
|
|
3
|
-
|
|
4
|
-
import DropdownItem from './DropdownItem';
|
|
5
|
-
import type { DropdownItemProps } from './DropdownItem.types';
|
|
6
|
-
|
|
7
|
-
import DropdownSubtitle from './DropdownSubtitle';
|
|
8
|
-
import type DropdownSubtitleProps from './DropdownSubtitle.types';
|
|
9
|
-
|
|
10
|
-
import IconDropdown from './IconDropdown';
|
|
11
|
-
import type { IconDropdownProps } from './IconDropdown.types';
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
Dropdown,
|
|
15
|
-
DropdownProps,
|
|
16
|
-
DropdownItem,
|
|
17
|
-
DropdownItemProps,
|
|
18
|
-
DropdownSubtitle,
|
|
19
|
-
DropdownSubtitleProps,
|
|
20
|
-
IconDropdown,
|
|
21
|
-
IconDropdownProps,
|
|
22
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Box, styled } from '@mui/material';
|
|
2
|
-
|
|
3
|
-
const commonStyle = {
|
|
4
|
-
display: 'flex' as const,
|
|
5
|
-
flexDirection: 'column' as const,
|
|
6
|
-
alignItems: 'center' as const,
|
|
7
|
-
justifyContent: 'center' as const,
|
|
8
|
-
};
|
|
9
|
-
const FileDnDZoneContainer = styled(Box)(() => {
|
|
10
|
-
return {
|
|
11
|
-
position: 'relative' as const,
|
|
12
|
-
height: '100%',
|
|
13
|
-
width: '100%',
|
|
14
|
-
};
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
const BaseFileDnDZone = styled(Box)(() => {
|
|
18
|
-
return {
|
|
19
|
-
...commonStyle,
|
|
20
|
-
position: 'absolute',
|
|
21
|
-
left: 'calc(50% - 213px)',
|
|
22
|
-
top: '100px',
|
|
23
|
-
height: '196px',
|
|
24
|
-
width: '426px',
|
|
25
|
-
gap: '16px',
|
|
26
|
-
};
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
const DnDSection = styled(Box)(() => {
|
|
30
|
-
return {
|
|
31
|
-
...commonStyle,
|
|
32
|
-
gap: '4px',
|
|
33
|
-
};
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
const DnDMainBox = styled(Box)(() => {
|
|
37
|
-
return {
|
|
38
|
-
...commonStyle,
|
|
39
|
-
gap: '24px',
|
|
40
|
-
};
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
export { FileDnDZoneContainer, BaseFileDnDZone, DnDSection, DnDMainBox };
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Typography } from '@mui/material';
|
|
3
|
-
import {
|
|
4
|
-
BaseFileDnDZone,
|
|
5
|
-
DnDSection,
|
|
6
|
-
DnDMainBox,
|
|
7
|
-
FileDnDZoneContainer,
|
|
8
|
-
} from './FileDnDZone.styled';
|
|
9
|
-
import FileDnDZoneProps from './FileDnDZone.types';
|
|
10
|
-
|
|
11
|
-
import theme from '../../theme';
|
|
12
|
-
import { DEFAULT_FILE_FORMATS } from './FileDnDZone.utils';
|
|
13
|
-
|
|
14
|
-
const FileDnDZone = ({
|
|
15
|
-
slidesUploaded,
|
|
16
|
-
maxSlideLimit = 500,
|
|
17
|
-
acceptedFileFormats = DEFAULT_FILE_FORMATS,
|
|
18
|
-
disabled,
|
|
19
|
-
WrapperProps,
|
|
20
|
-
OuterBoxProps,
|
|
21
|
-
InnerBoxProps,
|
|
22
|
-
SectionBoxProps,
|
|
23
|
-
}: FileDnDZoneProps) => {
|
|
24
|
-
const disabledSX = {
|
|
25
|
-
opacity: 0.4,
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<FileDnDZoneContainer
|
|
30
|
-
sx={disabled ? disabledSX : {}}
|
|
31
|
-
{...WrapperProps}
|
|
32
|
-
>
|
|
33
|
-
<BaseFileDnDZone {...OuterBoxProps}>
|
|
34
|
-
<Typography
|
|
35
|
-
variant="h7"
|
|
36
|
-
sx={{ color: theme.palette.neutralGrey[25] }}
|
|
37
|
-
>
|
|
38
|
-
Drag and drop your slide files here
|
|
39
|
-
</Typography>
|
|
40
|
-
<DnDMainBox {...InnerBoxProps}>
|
|
41
|
-
<DnDSection {...SectionBoxProps}>
|
|
42
|
-
<Typography
|
|
43
|
-
variant="body_sb1"
|
|
44
|
-
sx={{ color: theme.palette.neutralGrey[45] }}
|
|
45
|
-
>
|
|
46
|
-
Supported file formats
|
|
47
|
-
</Typography>
|
|
48
|
-
<Typography
|
|
49
|
-
variant="body_sb1"
|
|
50
|
-
sx={{ color: theme.palette.neutralGrey[25], padding: '0 18px', textAlign: 'center' }}
|
|
51
|
-
>
|
|
52
|
-
{acceptedFileFormats}
|
|
53
|
-
</Typography>
|
|
54
|
-
</DnDSection>
|
|
55
|
-
<DnDSection {...SectionBoxProps}>
|
|
56
|
-
<Typography
|
|
57
|
-
variant="body_sb1"
|
|
58
|
-
sx={{ color: theme.palette.neutralGrey[45] }}
|
|
59
|
-
>
|
|
60
|
-
Allowed number of slides
|
|
61
|
-
</Typography>
|
|
62
|
-
<Typography
|
|
63
|
-
variant="body_sb1"
|
|
64
|
-
sx={{ color: theme.palette.neutralGrey[25] }}
|
|
65
|
-
>
|
|
66
|
-
{`You have uploaded ${slidesUploaded.toLocaleString()} slides on Lunit SCOPE.`}
|
|
67
|
-
</Typography>
|
|
68
|
-
<Typography
|
|
69
|
-
variant="body_sb1"
|
|
70
|
-
sx={{ color: theme.palette.neutralGrey[25] }}
|
|
71
|
-
>
|
|
72
|
-
{`The number of slides cannot exceed ${maxSlideLimit.toLocaleString()}.`}
|
|
73
|
-
</Typography>
|
|
74
|
-
</DnDSection>
|
|
75
|
-
</DnDMainBox>
|
|
76
|
-
</BaseFileDnDZone>
|
|
77
|
-
</FileDnDZoneContainer>
|
|
78
|
-
);
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
export default FileDnDZone;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { BoxProps } from '@mui/material';
|
|
2
|
-
|
|
3
|
-
interface FileDnDZoneProps {
|
|
4
|
-
slidesUploaded: number;
|
|
5
|
-
maxSlideLimit?: number;
|
|
6
|
-
acceptedFileFormats?: string;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
WrapperProps?: BoxProps;
|
|
9
|
-
OuterBoxProps?: BoxProps;
|
|
10
|
-
InnerBoxProps?: BoxProps;
|
|
11
|
-
SectionBoxProps?: BoxProps;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export default FileDnDZoneProps;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { styled, List, ListSubheader } from '@mui/material';
|
|
2
|
-
import type { ListSubheaderProps } from './List.types';
|
|
3
|
-
|
|
4
|
-
export const MuiList = styled(List)(({ theme }) => ({
|
|
5
|
-
padding: theme.spacing(2),
|
|
6
|
-
}));
|
|
7
|
-
|
|
8
|
-
export const MuiListSubheader = styled(ListSubheader, {
|
|
9
|
-
shouldForwardProp: (prop) => !['type', 'clickable'].includes(prop.toString()),
|
|
10
|
-
})<ListSubheaderProps>(({ type, clickable, theme }) => ({
|
|
11
|
-
display: 'flex',
|
|
12
|
-
justifyContent: 'space-between',
|
|
13
|
-
alignItems: 'center',
|
|
14
|
-
height: '36px',
|
|
15
|
-
padding: '0px 8px',
|
|
16
|
-
backgroundColor: 'transparent',
|
|
17
|
-
...(type === 'bold'
|
|
18
|
-
? {
|
|
19
|
-
...theme.typography.body_b1,
|
|
20
|
-
color: theme.palette.neutralGrey[0],
|
|
21
|
-
}
|
|
22
|
-
: {
|
|
23
|
-
...theme.typography.small_body_m1,
|
|
24
|
-
color: theme.palette.neutralGrey[40],
|
|
25
|
-
}),
|
|
26
|
-
...(clickable && { cursor: 'pointer' }),
|
|
27
|
-
svg: {
|
|
28
|
-
width: '20px',
|
|
29
|
-
height: '20px',
|
|
30
|
-
},
|
|
31
|
-
}));
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-nested-ternary */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { createContext, useMemo } from 'react';
|
|
4
|
-
import { ArrowDownSm, ArrowUpSm } from '../../icons';
|
|
5
|
-
import { Collapse } from '@mui/material';
|
|
6
|
-
import { MuiList, MuiListSubheader } from './List.styled';
|
|
7
|
-
import type { ListProps, ListContextValue } from './List.types';
|
|
8
|
-
|
|
9
|
-
export const ListContext = createContext<ListContextValue>({
|
|
10
|
-
size: 'small',
|
|
11
|
-
showCheck: false,
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
const List = ({
|
|
15
|
-
size = 'small',
|
|
16
|
-
showCheck = false,
|
|
17
|
-
subheader,
|
|
18
|
-
subheaderType = 'bold',
|
|
19
|
-
open = 'visible',
|
|
20
|
-
children,
|
|
21
|
-
onOpen,
|
|
22
|
-
onClose,
|
|
23
|
-
...props
|
|
24
|
-
}: ListProps) => {
|
|
25
|
-
const contextValue = useMemo<ListContextValue>(() => ({ size, showCheck }), [size, showCheck]);
|
|
26
|
-
|
|
27
|
-
const collapsible = open !== 'visible';
|
|
28
|
-
|
|
29
|
-
const onSubheaderClick = ((event: React.MouseEvent<HTMLLIElement>) => {
|
|
30
|
-
if (open === 'visible') {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
const handler = open ? onClose : onOpen;
|
|
34
|
-
handler?.(event);
|
|
35
|
-
}) as React.ComponentProps<typeof MuiListSubheader>['onClick'];
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<ListContext.Provider value={contextValue}>
|
|
39
|
-
<MuiList
|
|
40
|
-
{...props}
|
|
41
|
-
subheader={
|
|
42
|
-
subheader ? (
|
|
43
|
-
<MuiListSubheader
|
|
44
|
-
type={subheaderType}
|
|
45
|
-
clickable={collapsible}
|
|
46
|
-
tabIndex={collapsible ? 0 : undefined}
|
|
47
|
-
onClick={onSubheaderClick}
|
|
48
|
-
>
|
|
49
|
-
{subheader}
|
|
50
|
-
{collapsible && (open ? <ArrowDownSm /> : <ArrowUpSm />)}
|
|
51
|
-
</MuiListSubheader>
|
|
52
|
-
) : null
|
|
53
|
-
}
|
|
54
|
-
>
|
|
55
|
-
{collapsible ? (
|
|
56
|
-
<Collapse
|
|
57
|
-
in={open}
|
|
58
|
-
timeout="auto"
|
|
59
|
-
unmountOnExit
|
|
60
|
-
>
|
|
61
|
-
{children}
|
|
62
|
-
</Collapse>
|
|
63
|
-
) : (
|
|
64
|
-
children
|
|
65
|
-
)}
|
|
66
|
-
</MuiList>
|
|
67
|
-
</ListContext.Provider>
|
|
68
|
-
);
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export default List;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
ListProps as MuiListProps,
|
|
3
|
-
ListSubheaderProps as MuiListSubheaderProps,
|
|
4
|
-
} from '@mui/material';
|
|
5
|
-
|
|
6
|
-
export type ListSize = 'small' | 'medium' | 'large';
|
|
7
|
-
|
|
8
|
-
export interface ListProps extends MuiListProps {
|
|
9
|
-
size?: ListSize;
|
|
10
|
-
subheaderType?: ListSubheaderProps['type'];
|
|
11
|
-
open?: boolean | 'visible';
|
|
12
|
-
onOpen?: (event: React.MouseEvent<HTMLLIElement>) => void;
|
|
13
|
-
onClose?: (event: React.MouseEvent<HTMLLIElement>) => void;
|
|
14
|
-
showCheck?: boolean;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface ListSubheaderProps extends MuiListSubheaderProps {
|
|
18
|
-
type?: 'bold' | 'normal';
|
|
19
|
-
clickable?: boolean;
|
|
20
|
-
}
|
|
21
|
-
export interface ListContextValue {
|
|
22
|
-
size: ListSize;
|
|
23
|
-
showCheck: boolean;
|
|
24
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
ListItem,
|
|
4
|
-
ListItemButton,
|
|
5
|
-
ListItemIcon,
|
|
6
|
-
ListItemText,
|
|
7
|
-
styled,
|
|
8
|
-
typographyClasses,
|
|
9
|
-
} from '@mui/material';
|
|
10
|
-
import { Check, Dummy } from '../../icons';
|
|
11
|
-
import getPadding from './List.utils';
|
|
12
|
-
import type { StyledListItemButtonProps } from './ListItem.types';
|
|
13
|
-
|
|
14
|
-
export const StyledListItem = styled(ListItem)({
|
|
15
|
-
width: '100%',
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
export const StyledListItemButton = styled(({ size, ...props }: StyledListItemButtonProps) => (
|
|
19
|
-
<ListItemButton {...props} />
|
|
20
|
-
))(({ theme, size }) => ({
|
|
21
|
-
borderRadius: '8px',
|
|
22
|
-
padding: `${getPadding(size)} 8px`,
|
|
23
|
-
'&.Mui-selected': {
|
|
24
|
-
background: 'transparent',
|
|
25
|
-
},
|
|
26
|
-
'&:hover, &.Mui-selected:hover, &.Mui-focusVisible, &.Mui-selected.Mui-focusVisible': {
|
|
27
|
-
backgroundColor: theme.palette.neutralGrey[75],
|
|
28
|
-
},
|
|
29
|
-
}));
|
|
30
|
-
|
|
31
|
-
export const slotStyles = {
|
|
32
|
-
minWidth: '20px',
|
|
33
|
-
height: '20px',
|
|
34
|
-
color: 'currentColor',
|
|
35
|
-
svg: {
|
|
36
|
-
width: '100%',
|
|
37
|
-
height: '100%',
|
|
38
|
-
color: 'currentColor !important',
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export const StyledListItemText = styled(ListItemText)(({ theme }) => ({
|
|
43
|
-
margin: 0,
|
|
44
|
-
[`& .${typographyClasses.body1}`]: {
|
|
45
|
-
...theme.typography.body5,
|
|
46
|
-
},
|
|
47
|
-
}));
|
|
48
|
-
|
|
49
|
-
export const StyledListItemStartSlot = styled(ListItemIcon)(({ theme }) => ({
|
|
50
|
-
...slotStyles,
|
|
51
|
-
marginRight: theme.spacing(2),
|
|
52
|
-
}));
|
|
53
|
-
|
|
54
|
-
export const StyledListItemEndSlot = styled(ListItemIcon)(({ theme }) => ({
|
|
55
|
-
...slotStyles,
|
|
56
|
-
justifyContent: 'flex-end',
|
|
57
|
-
marginLeft: theme.spacing(2),
|
|
58
|
-
}));
|
|
59
|
-
|
|
60
|
-
export const CheckIcon = styled(Check)({ color: '#fff' });
|
|
61
|
-
export const EmptyIcon = styled(Dummy)({ visibility: 'hidden' });
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import React, { useContext } from 'react';
|
|
2
|
-
import { ListContext } from '../List/List';
|
|
3
|
-
import {
|
|
4
|
-
StyledListItem,
|
|
5
|
-
StyledListItemButton,
|
|
6
|
-
StyledListItemText,
|
|
7
|
-
StyledListItemStartSlot,
|
|
8
|
-
StyledListItemEndSlot,
|
|
9
|
-
CheckIcon,
|
|
10
|
-
EmptyIcon,
|
|
11
|
-
} from './ListItem.styled';
|
|
12
|
-
import type { ListItemComponent, ListItemProps } from './ListItem.types';
|
|
13
|
-
|
|
14
|
-
const ListItem = (({
|
|
15
|
-
// Root props
|
|
16
|
-
rootProps,
|
|
17
|
-
className,
|
|
18
|
-
classes,
|
|
19
|
-
style,
|
|
20
|
-
sx,
|
|
21
|
-
// Button props
|
|
22
|
-
label,
|
|
23
|
-
startElement,
|
|
24
|
-
endElement,
|
|
25
|
-
selected,
|
|
26
|
-
...props
|
|
27
|
-
}: ListItemProps) => {
|
|
28
|
-
const { size, showCheck } = useContext(ListContext);
|
|
29
|
-
|
|
30
|
-
const checkElement = (() => {
|
|
31
|
-
if (showCheck) {
|
|
32
|
-
if (selected) {
|
|
33
|
-
return <CheckIcon />;
|
|
34
|
-
}
|
|
35
|
-
return <EmptyIcon />;
|
|
36
|
-
}
|
|
37
|
-
return null;
|
|
38
|
-
})();
|
|
39
|
-
|
|
40
|
-
return (
|
|
41
|
-
<StyledListItem
|
|
42
|
-
{...rootProps}
|
|
43
|
-
disablePadding
|
|
44
|
-
className={className}
|
|
45
|
-
classes={classes}
|
|
46
|
-
style={style}
|
|
47
|
-
sx={sx}
|
|
48
|
-
>
|
|
49
|
-
<StyledListItemButton
|
|
50
|
-
{...props}
|
|
51
|
-
disableRipple
|
|
52
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
53
|
-
component={(props as any).component ?? 'span'}
|
|
54
|
-
size={size}
|
|
55
|
-
selected={selected}
|
|
56
|
-
>
|
|
57
|
-
{checkElement && <StyledListItemStartSlot>{checkElement}</StyledListItemStartSlot>}
|
|
58
|
-
{startElement && <StyledListItemStartSlot>{startElement}</StyledListItemStartSlot>}
|
|
59
|
-
<StyledListItemText primary={label} />
|
|
60
|
-
{endElement && <StyledListItemEndSlot>{endElement}</StyledListItemEndSlot>}
|
|
61
|
-
</StyledListItemButton>
|
|
62
|
-
</StyledListItem>
|
|
63
|
-
);
|
|
64
|
-
}) as ListItemComponent;
|
|
65
|
-
|
|
66
|
-
export default ListItem;
|