@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,57 +0,0 @@
|
|
|
1
|
-
import { Theme } from '@mui/material';
|
|
2
|
-
import { typography } from '../../../foundations';
|
|
3
|
-
|
|
4
|
-
const baseButtonStyle = (theme: Theme, focusOutline: boolean | undefined) => {
|
|
5
|
-
const mainColor = theme.palette.lunitTeal[40];
|
|
6
|
-
|
|
7
|
-
return {
|
|
8
|
-
alignItems: 'center',
|
|
9
|
-
display: 'flex',
|
|
10
|
-
gap: '4px',
|
|
11
|
-
borderRadius: '8px',
|
|
12
|
-
border: '1px solid transparent',
|
|
13
|
-
textTransform: 'none' as const,
|
|
14
|
-
minWidth: '36px',
|
|
15
|
-
width: 'max-content',
|
|
16
|
-
height: '36px',
|
|
17
|
-
padding: '8px 12px',
|
|
18
|
-
...typography.body4,
|
|
19
|
-
backgroundColor: mainColor,
|
|
20
|
-
color: theme.palette.neutralGrey[97],
|
|
21
|
-
'&:hover': {
|
|
22
|
-
backgroundColor: mainColor,
|
|
23
|
-
opacity: 0.8,
|
|
24
|
-
},
|
|
25
|
-
'&:disabled': {
|
|
26
|
-
color: theme.palette.neutralGrey[97],
|
|
27
|
-
backgroundColor: mainColor,
|
|
28
|
-
opacity: 0.4,
|
|
29
|
-
},
|
|
30
|
-
'&:focus': {
|
|
31
|
-
border: focusOutline ? `1px solid ${theme.palette.lunitTeal[10]}` : '1px solid transparent',
|
|
32
|
-
outline: 'none' as const,
|
|
33
|
-
},
|
|
34
|
-
'&:focus-visible': {
|
|
35
|
-
border: focusOutline ? `1px solid ${theme.palette.lunitTeal[10]}` : '1px solid transparent',
|
|
36
|
-
outline: 'none' as const,
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const baseSmallStyle = {
|
|
42
|
-
height: '28px',
|
|
43
|
-
minWidth: '28px',
|
|
44
|
-
padding: '4px 8px',
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
const baseLargeStyle = {
|
|
48
|
-
fontWeight: 600,
|
|
49
|
-
fontSize: '16px',
|
|
50
|
-
lineHeight: '22px',
|
|
51
|
-
// textTransform: 'capitalize', // This causes a type error in BaseOutlinedButton :S
|
|
52
|
-
height: '44px',
|
|
53
|
-
minWidth: '44px',
|
|
54
|
-
padding: '12px',
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export { baseButtonStyle, baseSmallStyle, baseLargeStyle };
|
|
@@ -1,123 +0,0 @@
|
|
|
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 containedPrimaryStyle = (theme: Theme, focusOutline: boolean | undefined) => {
|
|
8
|
-
return baseButtonStyle(theme, focusOutline);
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const containedSecondaryStyle = (theme: Theme, focusOutline: boolean | undefined) => {
|
|
12
|
-
const mainColor = theme.palette.lunitTeal[40];
|
|
13
|
-
|
|
14
|
-
return {
|
|
15
|
-
backgroundColor: theme.palette.neutralGrey[85],
|
|
16
|
-
color: mainColor,
|
|
17
|
-
'&:hover': {
|
|
18
|
-
color: mainColor,
|
|
19
|
-
backgroundColor: theme.palette.neutralGrey[75],
|
|
20
|
-
opacity: 1,
|
|
21
|
-
},
|
|
22
|
-
'&:disabled': {
|
|
23
|
-
color: mainColor,
|
|
24
|
-
backgroundColor: theme.palette.neutralGrey[85],
|
|
25
|
-
opacity: 0.4,
|
|
26
|
-
},
|
|
27
|
-
'&:focus': {
|
|
28
|
-
outline: 'none' as const,
|
|
29
|
-
border: focusOutline ? `1px solid ${mainColor}` : '1px solid transparent',
|
|
30
|
-
},
|
|
31
|
-
'&:focus-visible': {
|
|
32
|
-
outline: 'none' as const,
|
|
33
|
-
border: focusOutline ? `1px solid ${mainColor}` : '1px solid transparent',
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const containedErrorStyle = (theme: Theme, focusOutline: boolean | undefined) => {
|
|
39
|
-
const mainColor = theme.palette.red[5];
|
|
40
|
-
|
|
41
|
-
return {
|
|
42
|
-
backgroundColor: mainColor,
|
|
43
|
-
color: theme.palette.neutralGrey[0],
|
|
44
|
-
'&:hover': {
|
|
45
|
-
backgroundColor: mainColor,
|
|
46
|
-
opacity: 0.8,
|
|
47
|
-
},
|
|
48
|
-
'&:disabled': {
|
|
49
|
-
color: theme.palette.neutralGrey[0],
|
|
50
|
-
backgroundColor: mainColor,
|
|
51
|
-
opacity: 0.4,
|
|
52
|
-
},
|
|
53
|
-
'&:focus': {
|
|
54
|
-
outline: 'none' as const,
|
|
55
|
-
border: focusOutline ? `1px solid ${mainColor}` : '1px solid transparent',
|
|
56
|
-
},
|
|
57
|
-
'&:focus-visible': {
|
|
58
|
-
outline: 'none' as const,
|
|
59
|
-
border: focusOutline ? `1px solid ${mainColor}` : '1px solid transparent',
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
const BaseContainedButton = styled(ButtonBase, {
|
|
65
|
-
shouldForwardProp: (prop) =>
|
|
66
|
-
!['color', 'variant', 'size', 'focusOutline', 'isIconOnly'].includes(prop.toString()),
|
|
67
|
-
})<BaseButtonProps>(({ theme, color, size, focusOutline, isIconOnly }) => {
|
|
68
|
-
let resultStyle = containedPrimaryStyle(theme, focusOutline);
|
|
69
|
-
|
|
70
|
-
// Apply icon sizing if icon only
|
|
71
|
-
if (isIconOnly) {
|
|
72
|
-
if (size === 'small') {
|
|
73
|
-
resultStyle = {
|
|
74
|
-
...resultStyle,
|
|
75
|
-
...baseSmallIconStyle,
|
|
76
|
-
};
|
|
77
|
-
} else if (size === 'large') {
|
|
78
|
-
resultStyle = {
|
|
79
|
-
...resultStyle,
|
|
80
|
-
...baseLargeIconStyle,
|
|
81
|
-
};
|
|
82
|
-
} else {
|
|
83
|
-
resultStyle = {
|
|
84
|
-
...resultStyle,
|
|
85
|
-
...baseMediumIconStyle,
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
} else {
|
|
89
|
-
// Apply label or icon-label
|
|
90
|
-
if (size === 'small') {
|
|
91
|
-
resultStyle = {
|
|
92
|
-
...resultStyle,
|
|
93
|
-
...baseSmallStyle,
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
if (size === 'large') {
|
|
98
|
-
resultStyle = {
|
|
99
|
-
...resultStyle,
|
|
100
|
-
...baseLargeStyle,
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// Apply color
|
|
106
|
-
if (color === 'error') {
|
|
107
|
-
resultStyle = {
|
|
108
|
-
...resultStyle,
|
|
109
|
-
...containedErrorStyle(theme, focusOutline),
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
if (color === 'secondary') {
|
|
114
|
-
resultStyle = {
|
|
115
|
-
...resultStyle,
|
|
116
|
-
...containedSecondaryStyle(theme, focusOutline),
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
return resultStyle;
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
export { containedPrimaryStyle, containedSecondaryStyle, containedErrorStyle, BaseContainedButton };
|
|
@@ -1,139 +0,0 @@
|
|
|
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 };
|
|
@@ -1,25 +0,0 @@
|
|
|
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 };
|
|
@@ -1,144 +0,0 @@
|
|
|
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 };
|
|
@@ -1,18 +0,0 @@
|
|
|
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;
|
|
@@ -1,18 +0,0 @@
|
|
|
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;
|
|
@@ -1,27 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,64 +0,0 @@
|
|
|
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;
|
|
@@ -1,16 +0,0 @@
|
|
|
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
|
-
}
|