@lunit/design-system 1.0.0-b.4 → 2.0.0
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/cjs/components/Alert/index.js +1 -1
- package/dist/cjs/components/Alert/index.js.map +1 -1
- package/dist/cjs/components/Button/index.js +1 -1
- package/dist/cjs/components/Button/index.js.map +1 -1
- package/dist/cjs/components/Checkbox/index.js +1 -1
- package/dist/cjs/components/Checkbox/index.js.map +1 -1
- package/dist/cjs/components/Chip/index.js +1 -1
- package/dist/cjs/components/Chip/index.js.map +1 -1
- package/dist/cjs/components/Dialog/index.js +2 -0
- package/dist/cjs/components/Dialog/index.js.map +1 -0
- package/dist/cjs/components/Radio/index.js +1 -1
- package/dist/cjs/components/Radio/index.js.map +1 -1
- package/dist/cjs/components/TextField/index.js +1 -1
- package/dist/cjs/components/TextField/index.js.map +1 -1
- package/dist/cjs/components/ToggleButton/index.js +1 -1
- package/dist/cjs/components/ToggleButton/index.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/components/Button/Button.js +21 -3
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/Button.styled.js +3 -6
- package/dist/components/Button/Button.styled.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.js +9 -19
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Chip/Chip.js +6 -5
- package/dist/components/Chip/Chip.js.map +1 -1
- package/dist/components/Dialog/Dialog.js +61 -0
- package/dist/components/Dialog/Dialog.js.map +1 -0
- package/dist/components/Dialog/Dialog.styled.js +137 -0
- package/dist/components/Dialog/Dialog.styled.js.map +1 -0
- package/dist/components/Dialog/components/DialogAction.js +18 -0
- package/dist/components/Dialog/components/DialogAction.js.map +1 -0
- package/dist/components/Dialog/index.js +2 -0
- package/dist/components/Dialog/index.js.map +1 -0
- package/dist/components/Radio/Radio.js +7 -21
- package/dist/components/Radio/Radio.js.map +1 -1
- package/dist/components/TextField/TextField.js +4 -4
- package/dist/components/TextField/TextField.js.map +1 -1
- package/dist/components/ToggleButton/ToggleButton.styled.js +2 -3
- package/dist/components/ToggleButton/ToggleButton.styled.js.map +1 -1
- package/dist/foundation/Elevation/index.js +1 -1
- package/dist/foundation/Elevation/index.js.map +1 -1
- package/dist/foundation/Typography/index.js +12 -0
- package/dist/foundation/Typography/index.js.map +1 -1
- package/dist/foundation/Typography/tokens.js +1 -17
- package/dist/foundation/Typography/tokens.js.map +1 -1
- package/dist/foundation/colors/base/grey.js +3 -1
- package/dist/foundation/colors/base/grey.js.map +1 -1
- package/dist/foundation/colors/index.js +9 -6
- package/dist/foundation/colors/index.js.map +1 -1
- package/dist/foundation/colors/token/component.js +31 -115
- package/dist/foundation/colors/token/component.js.map +1 -1
- package/dist/foundation/colors/token/core.js +43 -75
- package/dist/foundation/colors/token/core.js.map +1 -1
- package/dist/foundation/index.js +1 -1
- package/dist/foundation/index.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types/components/Alert/Alert.utils.d.ts +3 -3
- package/dist/types/components/Button/Button.styled.d.ts +9 -12
- package/dist/types/components/Button/Button.types.d.ts +8 -5
- package/dist/types/components/Chip/Chip.styled.d.ts +12 -12
- package/dist/types/components/Chip/Chip.types.d.ts +7 -2
- package/dist/types/components/Dialog/Dialog.d.ts +50 -0
- package/dist/types/components/Dialog/Dialog.styled.d.ts +12 -0
- package/dist/types/components/Dialog/components/DialogAction.d.ts +8 -0
- package/dist/types/components/Dialog/index.d.ts +2 -0
- package/dist/types/components/TextField/TextField.types.d.ts +8 -3
- package/dist/types/components/Toast/Toast.utils.d.ts +1 -1
- package/dist/types/components/ToggleButton/ToggleButton.styled.d.ts +2 -2
- package/dist/types/foundation/Elevation/index.d.ts +1 -1
- package/dist/types/foundation/Typography/index.d.ts +13 -1
- package/dist/types/foundation/Typography/tokens.d.ts +1 -1
- package/dist/types/foundation/colors/base/grey.d.ts +2 -0
- package/dist/types/foundation/colors/index.d.ts +9 -6
- package/dist/types/foundation/colors/token/types.d.ts +0 -2
- package/dist/types/foundation/colors/types.d.ts +78 -76
- package/dist/types/foundation/index.d.ts +9 -0
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/Button/Button.styled.ts +3 -6
- package/src/components/Button/Button.tsx +117 -42
- package/src/components/Button/Button.types.ts +8 -4
- package/src/components/Checkbox/Checkbox.tsx +39 -22
- package/src/components/Chip/Chip.tsx +15 -4
- package/src/components/Chip/Chip.types.ts +9 -2
- package/src/components/Dialog/Dialog.styled.ts +165 -0
- package/src/components/Dialog/Dialog.tsx +195 -0
- package/src/components/Dialog/components/DialogAction.tsx +36 -0
- package/src/components/Dialog/index.ts +14 -0
- package/src/components/Radio/Radio.tsx +37 -25
- package/src/components/TextField/TextField.tsx +10 -10
- package/src/components/TextField/TextField.types.ts +11 -4
- package/src/components/ToggleButton/ToggleButton.styled.ts +2 -3
- package/src/foundation/Elevation/index.ts +1 -1
- package/src/foundation/Typography/index.ts +12 -0
- package/src/foundation/Typography/tokens.ts +1 -17
- package/src/foundation/colors/base/grey.ts +3 -1
- package/src/foundation/colors/index.ts +9 -6
- package/src/foundation/colors/token/component.ts +24 -108
- package/src/foundation/colors/token/core.ts +39 -71
- package/src/foundation/colors/token/types.ts +0 -2
- package/src/foundation/colors/types.ts +78 -75
- package/src/foundation/index.ts +1 -1
- package/src/index.ts +1 -1
- package/src/stories/GettingStarted.mdx +88 -0
- package/src/stories/components/Button/BasicButton.stories.tsx +91 -52
- package/src/stories/components/Button/ButtonDocs.mdx +187 -0
- package/src/stories/components/Button/Color.stories.tsx +132 -0
- package/src/stories/components/Button/IconButton.stories.tsx +42 -25
- package/src/stories/components/Button/Kind.stories.tsx +75 -77
- package/src/stories/components/{SelectControl/Checkbox.stories.tsx → CheckBox/BasicCheckbox.stories.tsx} +84 -105
- package/src/stories/components/CheckBox/CheckboxDocs.mdx +85 -0
- package/src/stories/components/Chip/Chip.stories.tsx +80 -5
- package/src/stories/components/Chip/ChipDocs.mdx +132 -0
- package/src/stories/components/Dialog/Dialog.stories.tsx +320 -0
- package/src/stories/components/TextField/BasicTextField.stories.tsx +214 -0
- package/src/stories/components/TextField/TextFieldDocs.mdx +140 -0
- package/src/stories/components/TextField/TextFieldSize.stories.tsx +26 -3
- package/src/stories/components/ToggleButton/Basic.stories.tsx +312 -0
- package/src/stories/components/ToggleButton/ToggleButtonDocs.mdx +180 -0
- package/src/stories/components/ToggleButton/ToggleButtonKind.stories.tsx +65 -0
- package/src/stories/components/ToggleButton/WithIcon.stories.tsx +138 -0
- package/src/stories/foundation/Typography/Typography.mdx +31 -46
- package/src/stories/foundation/Typography/Typography.stories.tsx +30 -1
- package/src/stories/foundation/colors/ColorSystem.tsx +86 -0
- package/src/stories/foundation/colors/Docs.mdx +225 -0
- package/src/stories/foundation/colors/TokenPaletteTable.tsx +1 -5
- package/src/components/Modal/Modal.tsx +0 -8
- package/src/components/Modal/index.ts +0 -1
- package/src/stories/components/Modal/Modal.stories.tsx +0 -15
- package/src/stories/foundation/Typography/TypographyExamples.stories.tsx +0 -44
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { SxProps } from "@mui/material";
|
|
3
|
-
import type { OutlinedTextFieldProps } from "@mui/material/TextField";
|
|
3
|
+
import type { TextFieldProps as MuiTextFieldProps, OutlinedTextFieldProps } from "@mui/material/TextField";
|
|
4
4
|
export type TextFieldSize = "small" | "medium" | "large";
|
|
5
5
|
export interface BaseTextFieldProps extends Omit<OutlinedTextFieldProps, "size" | "value" | "helperText" | "variant"> {
|
|
6
6
|
/**
|
|
7
|
-
* The design system TextField
|
|
7
|
+
* The design system TextField has only on kind, which is "contained"
|
|
8
|
+
Below are all return same kind "contained"
|
|
9
|
+
<TextField variant="outlined" />
|
|
10
|
+
<TextField variant="contained" />
|
|
11
|
+
<TextField variant="filled" />
|
|
12
|
+
<TextField variant="standard" />
|
|
8
13
|
*/
|
|
9
|
-
variant?: "
|
|
14
|
+
variant?: MuiTextFieldProps["variant"];
|
|
10
15
|
value?: string;
|
|
11
16
|
helperText?: string;
|
|
12
17
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { AlertColor, Theme } from "@mui/material";
|
|
2
|
-
export declare const getIconColor: (theme: Theme, severity: AlertColor | undefined) =>
|
|
2
|
+
export declare const getIconColor: (theme: Theme, severity: AlertColor | undefined) => string;
|
|
@@ -6,7 +6,7 @@ type CustomToggleButtonProps = ToggleButtonProps & {
|
|
|
6
6
|
export declare const CustomToggleButton: import("@emotion/styled").StyledComponent<{
|
|
7
7
|
children?: import("react").ReactNode;
|
|
8
8
|
classes?: Partial<import("@mui/material").ToggleButtonClasses> | undefined;
|
|
9
|
-
color?: "
|
|
9
|
+
color?: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "standard" | undefined;
|
|
10
10
|
disabled?: boolean | undefined;
|
|
11
11
|
disableFocusRipple?: boolean | undefined;
|
|
12
12
|
fullWidth?: boolean | undefined;
|
|
@@ -34,7 +34,7 @@ export declare const CustomToggleButton: import("@emotion/styled").StyledCompone
|
|
|
34
34
|
touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
|
|
35
35
|
}, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
36
36
|
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
37
|
-
}, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "tabIndex" | "
|
|
37
|
+
}, "color" | keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "tabIndex" | "onChange" | "onClick" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "value" | "disableFocusRipple" | "fullWidth" | "size" | "selected"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & CustomToggleButtonProps, {}, {}>;
|
|
38
38
|
export declare const IconAndChildrenWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
39
39
|
export declare const IconWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
40
40
|
hasIconOnly: boolean;
|
|
@@ -19,7 +19,7 @@ export declare const elevationOptions: {
|
|
|
19
19
|
shadow4: string;
|
|
20
20
|
};
|
|
21
21
|
export declare const createElevationCssBaseline: () => {
|
|
22
|
-
".light1, .light2, .dark1, .dark2
|
|
22
|
+
".light1, .light2, .dark1, .dark2": {
|
|
23
23
|
"--elevation-shadow": string;
|
|
24
24
|
elevation_00: string;
|
|
25
25
|
elevation_01: string;
|
|
@@ -72,7 +72,7 @@ export declare const createTypographyCssBaseline: () => {
|
|
|
72
72
|
"--headline2-line-height": "65px";
|
|
73
73
|
"--headline3-font-weight": "var(--font-weight-semibold)";
|
|
74
74
|
"--headline3-font-size": "24px";
|
|
75
|
-
"--headline3-line-height": "
|
|
75
|
+
"--headline3-line-height": "29px";
|
|
76
76
|
"--headline4-font-weight": "var(--font-weight-semibold)";
|
|
77
77
|
"--headline4-font-size": "20px";
|
|
78
78
|
"--headline4-line-height": "28px";
|
|
@@ -84,5 +84,17 @@ export declare const createTypographyCssBaseline: () => {
|
|
|
84
84
|
"--font-weight-medium": 500;
|
|
85
85
|
"--font-weight-regular": 400;
|
|
86
86
|
};
|
|
87
|
+
".light1": {
|
|
88
|
+
color: string;
|
|
89
|
+
};
|
|
90
|
+
".light2": {
|
|
91
|
+
color: string;
|
|
92
|
+
};
|
|
93
|
+
".dark1": {
|
|
94
|
+
color: string;
|
|
95
|
+
};
|
|
96
|
+
".dark2": {
|
|
97
|
+
color: string;
|
|
98
|
+
};
|
|
87
99
|
};
|
|
88
100
|
export default typographyOptions;
|
|
@@ -42,7 +42,7 @@ export declare const cssVariables: {
|
|
|
42
42
|
"--headline2-line-height": "65px";
|
|
43
43
|
"--headline3-font-weight": "var(--font-weight-semibold)";
|
|
44
44
|
"--headline3-font-size": "24px";
|
|
45
|
-
"--headline3-line-height": "
|
|
45
|
+
"--headline3-line-height": "29px";
|
|
46
46
|
"--headline4-font-weight": "var(--font-weight-semibold)";
|
|
47
47
|
"--headline4-font-size": "20px";
|
|
48
48
|
"--headline4-line-height": "28px";
|
|
@@ -4,6 +4,7 @@ export declare const grey: {
|
|
|
4
4
|
10: string;
|
|
5
5
|
15: string;
|
|
6
6
|
20: string;
|
|
7
|
+
25: string;
|
|
7
8
|
30: string;
|
|
8
9
|
40: string;
|
|
9
10
|
50: string;
|
|
@@ -22,6 +23,7 @@ export declare const greyText: {
|
|
|
22
23
|
10: string;
|
|
23
24
|
15: string;
|
|
24
25
|
20: string;
|
|
26
|
+
25: string;
|
|
25
27
|
30: string;
|
|
26
28
|
40: string;
|
|
27
29
|
50: string;
|
|
@@ -51,12 +51,6 @@ export declare const createColorCssBaseline: () => {
|
|
|
51
51
|
".dark2": {
|
|
52
52
|
[x: string]: string;
|
|
53
53
|
};
|
|
54
|
-
".dark3": {
|
|
55
|
-
[x: string]: string;
|
|
56
|
-
};
|
|
57
|
-
".dark4": {
|
|
58
|
-
[x: string]: string;
|
|
59
|
-
};
|
|
60
54
|
};
|
|
61
55
|
declare const paletteOptions: {
|
|
62
56
|
primary: {
|
|
@@ -93,6 +87,10 @@ declare const paletteOptions: {
|
|
|
93
87
|
A400: string;
|
|
94
88
|
A700: string;
|
|
95
89
|
};
|
|
90
|
+
text: {
|
|
91
|
+
primary: string;
|
|
92
|
+
secondary: string;
|
|
93
|
+
};
|
|
96
94
|
lunit_global: {
|
|
97
95
|
grey: GreyColor;
|
|
98
96
|
blue: BaseColor;
|
|
@@ -110,6 +108,7 @@ declare const paletteOptions: {
|
|
|
110
108
|
bg_01: string;
|
|
111
109
|
bg_02: string;
|
|
112
110
|
bg_03: string;
|
|
111
|
+
layer_01: string;
|
|
113
112
|
text_primary: string;
|
|
114
113
|
text_normal: string;
|
|
115
114
|
text_medium: string;
|
|
@@ -132,6 +131,8 @@ declare const paletteOptions: {
|
|
|
132
131
|
shadow_02: string;
|
|
133
132
|
shadow_03: string;
|
|
134
133
|
shadow_04: string;
|
|
134
|
+
border_light: string;
|
|
135
|
+
border_medium: string;
|
|
135
136
|
};
|
|
136
137
|
component: {
|
|
137
138
|
btn_primary_bg: string;
|
|
@@ -147,6 +148,8 @@ declare const paletteOptions: {
|
|
|
147
148
|
btn_selected_primary_text: string;
|
|
148
149
|
btn_selected_secondary_bg: string;
|
|
149
150
|
btn_selected_secondary_text: string;
|
|
151
|
+
btn_selected_tertiary_bg: string;
|
|
152
|
+
btn_selected_tertiary_text: string;
|
|
150
153
|
selectcontrol_on: string;
|
|
151
154
|
selectcontrol_off: string;
|
|
152
155
|
selectcontrol_handler: string;
|
|
@@ -1,82 +1,84 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
type CSSPropertyColor = React.CSSProperties["color"];
|
|
3
1
|
export interface ColorToken {
|
|
4
2
|
core: {
|
|
5
|
-
bg_01:
|
|
6
|
-
bg_02:
|
|
7
|
-
bg_03:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
3
|
+
bg_01: string;
|
|
4
|
+
bg_02: string;
|
|
5
|
+
bg_03: string;
|
|
6
|
+
layer_01: string;
|
|
7
|
+
text_primary: string;
|
|
8
|
+
text_normal: string;
|
|
9
|
+
text_medium: string;
|
|
10
|
+
text_light: string;
|
|
11
|
+
text_error: string;
|
|
12
|
+
text_success: string;
|
|
13
|
+
text_warning: string;
|
|
14
|
+
text_info: string;
|
|
15
|
+
link_primary: string;
|
|
16
|
+
link_hover: string;
|
|
17
|
+
link_visited: string;
|
|
18
|
+
icon_error_02: string;
|
|
19
|
+
icon_success_02: string;
|
|
20
|
+
icon_warning_02: string;
|
|
21
|
+
icon_info_02: string;
|
|
22
|
+
hover: string;
|
|
23
|
+
focused: string;
|
|
24
|
+
selected: string;
|
|
25
|
+
shadow_01: string;
|
|
26
|
+
shadow_02: string;
|
|
27
|
+
shadow_03: string;
|
|
28
|
+
shadow_04: string;
|
|
29
|
+
border_light: string;
|
|
30
|
+
border_medium: string;
|
|
30
31
|
};
|
|
31
32
|
component: {
|
|
32
|
-
btn_primary_bg:
|
|
33
|
-
btn_secondary_bg:
|
|
34
|
-
btn_error_bg:
|
|
35
|
-
btn_primary_border:
|
|
36
|
-
btn_secondary_border:
|
|
37
|
-
btn_primary_text_1:
|
|
38
|
-
btn_primary_text_2:
|
|
39
|
-
btn_secondary_text:
|
|
40
|
-
btn_error_text:
|
|
41
|
-
btn_selected_primary_bg:
|
|
42
|
-
btn_selected_primary_text:
|
|
43
|
-
btn_selected_secondary_bg:
|
|
44
|
-
btn_selected_secondary_text:
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
33
|
+
btn_primary_bg: string;
|
|
34
|
+
btn_secondary_bg: string;
|
|
35
|
+
btn_error_bg: string;
|
|
36
|
+
btn_primary_border: string;
|
|
37
|
+
btn_secondary_border: string;
|
|
38
|
+
btn_primary_text_1: string;
|
|
39
|
+
btn_primary_text_2: string;
|
|
40
|
+
btn_secondary_text: string;
|
|
41
|
+
btn_error_text: string;
|
|
42
|
+
btn_selected_primary_bg: string;
|
|
43
|
+
btn_selected_primary_text: string;
|
|
44
|
+
btn_selected_secondary_bg: string;
|
|
45
|
+
btn_selected_secondary_text: string;
|
|
46
|
+
btn_selected_tertiary_bg: string;
|
|
47
|
+
btn_selected_tertiary_text: string;
|
|
48
|
+
selectcontrol_on: string;
|
|
49
|
+
selectcontrol_off: string;
|
|
50
|
+
selectcontrol_handler: string;
|
|
51
|
+
selectcontrol_handler_shadow: string;
|
|
52
|
+
textfield_bg: string;
|
|
53
|
+
textfield_border_error: string;
|
|
54
|
+
dropdown_divider_border: string;
|
|
55
|
+
datatable_border_01: string;
|
|
56
|
+
datatable_border_02: string;
|
|
57
|
+
datatable_zebra: string;
|
|
58
|
+
scrollbars_bg: string;
|
|
59
|
+
scrollbars_hover: string;
|
|
60
|
+
scrollbars_pressed: string;
|
|
61
|
+
modal_overlay: string;
|
|
62
|
+
tooltip_bg: string;
|
|
63
|
+
tooltip_text_normal: string;
|
|
64
|
+
tooltip_text_medium: string;
|
|
65
|
+
alert_error_bg: string;
|
|
66
|
+
alert_error_border: string;
|
|
67
|
+
alert_success_bg: string;
|
|
68
|
+
alert_success_border: string;
|
|
69
|
+
alert_info_bg: string;
|
|
70
|
+
alert_info_border: string;
|
|
71
|
+
alert_warning_bg: string;
|
|
72
|
+
alert_warning_border: string;
|
|
73
|
+
chip_primary_bg: string;
|
|
74
|
+
chip_primary_text: string;
|
|
75
|
+
chip_secondary_bg: string;
|
|
76
|
+
chip_secondary_text: string;
|
|
77
|
+
chip_error_bg: string;
|
|
78
|
+
chip_error_text: string;
|
|
79
|
+
chip_warning_bg: string;
|
|
80
|
+
chip_warning_text: string;
|
|
81
|
+
chip_success_bg: string;
|
|
82
|
+
chip_success_text: string;
|
|
80
83
|
};
|
|
81
84
|
}
|
|
82
|
-
export {};
|
|
@@ -38,6 +38,10 @@ export declare const palette: {
|
|
|
38
38
|
A400: string;
|
|
39
39
|
A700: string;
|
|
40
40
|
};
|
|
41
|
+
text: {
|
|
42
|
+
primary: string;
|
|
43
|
+
secondary: string;
|
|
44
|
+
};
|
|
41
45
|
lunit_global: {
|
|
42
46
|
grey: import("./colors").GreyColor;
|
|
43
47
|
blue: import("./colors").BaseColor;
|
|
@@ -55,6 +59,7 @@ export declare const palette: {
|
|
|
55
59
|
bg_01: string;
|
|
56
60
|
bg_02: string;
|
|
57
61
|
bg_03: string;
|
|
62
|
+
layer_01: string;
|
|
58
63
|
text_primary: string;
|
|
59
64
|
text_normal: string;
|
|
60
65
|
text_medium: string;
|
|
@@ -77,6 +82,8 @@ export declare const palette: {
|
|
|
77
82
|
shadow_02: string;
|
|
78
83
|
shadow_03: string;
|
|
79
84
|
shadow_04: string;
|
|
85
|
+
border_light: string;
|
|
86
|
+
border_medium: string;
|
|
80
87
|
};
|
|
81
88
|
component: {
|
|
82
89
|
btn_primary_bg: string;
|
|
@@ -92,6 +99,8 @@ export declare const palette: {
|
|
|
92
99
|
btn_selected_primary_text: string;
|
|
93
100
|
btn_selected_secondary_bg: string;
|
|
94
101
|
btn_selected_secondary_text: string;
|
|
102
|
+
btn_selected_tertiary_bg: string;
|
|
103
|
+
btn_selected_tertiary_text: string;
|
|
95
104
|
selectcontrol_on: string;
|
|
96
105
|
selectcontrol_off: string;
|
|
97
106
|
selectcontrol_handler: string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -4,11 +4,11 @@ export { default as Alert } from "./components/Alert";
|
|
|
4
4
|
export { default as Button } from "./components/Button";
|
|
5
5
|
export { default as Chip } from "./components/Chip";
|
|
6
6
|
export { default as Checkbox } from "./components/Checkbox";
|
|
7
|
+
export { default as Dialog } from "./components/Dialog";
|
|
7
8
|
export { default as DataTable } from "./components/DataTable";
|
|
8
9
|
export { default as DatePicker } from "./components/DatePicker";
|
|
9
10
|
export { default as Dropdown } from "./components/Dropdown";
|
|
10
11
|
export { default as FormLabel } from "./components/FormLabel";
|
|
11
|
-
export { default as Modal } from "./components/Modal";
|
|
12
12
|
export { default as Radio } from "./components/Radio";
|
|
13
13
|
export { default as RadioGroup } from "./components/RadioGroup";
|
|
14
14
|
export { default as TextField } from "./components/TextField";
|
package/package.json
CHANGED
|
@@ -157,7 +157,7 @@ export const kindStyle = ({ kind, color, lunit_token }: KindStyleParams) => ({
|
|
|
157
157
|
...(kind === "outlined" &&
|
|
158
158
|
color === "secondary" && {
|
|
159
159
|
color: lunit_token.component.btn_secondary_text,
|
|
160
|
-
border: `${OUTLINED_BORDER_WIDTH}px solid ${lunit_token.
|
|
160
|
+
border: `${OUTLINED_BORDER_WIDTH}px solid ${lunit_token.core.border_medium}`,
|
|
161
161
|
"&:hover": getHoverStyle("none"),
|
|
162
162
|
"&:hover:before": {
|
|
163
163
|
content: "''",
|
|
@@ -211,21 +211,18 @@ export const iconStyle = ({
|
|
|
211
211
|
hasIconOnly,
|
|
212
212
|
}: Pick<CustomButtonProps, "size" | "hasIconOnly">) => ({
|
|
213
213
|
"& .MuiButton-startIcon": {
|
|
214
|
-
width: "20px",
|
|
215
|
-
height: "20px",
|
|
216
|
-
padding: "1px",
|
|
217
214
|
margin: 0,
|
|
218
215
|
marginRight: hasIconOnly ? "0px" : size === "large" ? "8px" : "4px",
|
|
219
216
|
|
|
220
217
|
"*:nth-of-type(1)": {
|
|
221
|
-
fontSize: "
|
|
218
|
+
fontSize: "20px",
|
|
222
219
|
},
|
|
223
220
|
},
|
|
224
221
|
});
|
|
225
222
|
|
|
226
223
|
export const CustomButton = styled(MuiButton, {
|
|
227
224
|
shouldForwardProp: (prop: string) => {
|
|
228
|
-
return !["kind", "hasIconOnly"].includes(prop);
|
|
225
|
+
return !["kind", "hasIconOnly", "variant"].includes(prop);
|
|
229
226
|
},
|
|
230
227
|
})<CustomButtonProps>(
|
|
231
228
|
({
|
|
@@ -2,54 +2,36 @@ import React, { forwardRef } from "react";
|
|
|
2
2
|
|
|
3
3
|
import { CustomButton } from "./Button.styled";
|
|
4
4
|
|
|
5
|
-
import type {
|
|
5
|
+
import type {
|
|
6
|
+
ButtonType,
|
|
7
|
+
ButtonProps,
|
|
8
|
+
GhostButtonProps,
|
|
9
|
+
OutlinedButtonProps,
|
|
10
|
+
ContainedButtonProps,
|
|
11
|
+
} from "./Button.types";
|
|
6
12
|
|
|
7
13
|
const Button = forwardRef<HTMLButtonElement, ButtonProps>((props, ref) => {
|
|
8
|
-
const {
|
|
9
|
-
size = "small",
|
|
10
|
-
color = "primary",
|
|
11
|
-
icon,
|
|
12
|
-
className,
|
|
13
|
-
children,
|
|
14
|
-
startIcon,
|
|
15
|
-
...buttonProps
|
|
16
|
-
} = props;
|
|
14
|
+
const { kind, variant, icon, children, startIcon } = props;
|
|
17
15
|
const hasIconOnly = Boolean((startIcon || icon) && !children);
|
|
18
16
|
|
|
17
|
+
if (kind === "outlined" || variant === "outlined") {
|
|
18
|
+
return <OutlinedButton {...props} ref={ref} hasIconOnly={hasIconOnly} />;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (kind === "ghost" || variant === "text" || variant === "ghost") {
|
|
22
|
+
return <GhostButton {...props} ref={ref} hasIconOnly={hasIconOnly} />;
|
|
23
|
+
}
|
|
24
|
+
|
|
19
25
|
return (
|
|
20
|
-
|
|
21
|
-
{
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
kind="outlined"
|
|
28
|
-
color={props.color ?? "primary"}
|
|
29
|
-
size={size}
|
|
30
|
-
startIcon={startIcon || icon}
|
|
31
|
-
hasIconOnly={hasIconOnly}
|
|
32
|
-
>
|
|
33
|
-
{!hasIconOnly && <>{children}</>}
|
|
34
|
-
</CustomButton>
|
|
35
|
-
) : (
|
|
36
|
-
<CustomButton
|
|
37
|
-
{...buttonProps}
|
|
38
|
-
ref={ref}
|
|
39
|
-
className={`${props.kind ?? "contained"} ${
|
|
40
|
-
className ? className : ""
|
|
41
|
-
}`}
|
|
42
|
-
kind={props.kind ?? "contained"}
|
|
43
|
-
color={props.color ?? "primary"}
|
|
44
|
-
size={size}
|
|
45
|
-
startIcon={startIcon || icon}
|
|
46
|
-
hasIconOnly={hasIconOnly}
|
|
47
|
-
>
|
|
48
|
-
{!hasIconOnly && <>{children}</>}
|
|
49
|
-
</CustomButton>
|
|
50
|
-
)}
|
|
51
|
-
</>
|
|
26
|
+
<ContainedButton
|
|
27
|
+
{...props}
|
|
28
|
+
kind="contained"
|
|
29
|
+
variant="contained"
|
|
30
|
+
ref={ref}
|
|
31
|
+
hasIconOnly={hasIconOnly}
|
|
32
|
+
/>
|
|
52
33
|
);
|
|
34
|
+
|
|
53
35
|
/**
|
|
54
36
|
* There is an issue between React 18, Mui's OverridableComponent type and the
|
|
55
37
|
* type coercion to temporarily fix it.
|
|
@@ -57,4 +39,97 @@ const Button = forwardRef<HTMLButtonElement, ButtonProps>((props, ref) => {
|
|
|
57
39
|
*/
|
|
58
40
|
}) as ButtonType;
|
|
59
41
|
|
|
42
|
+
const GhostButton = forwardRef<
|
|
43
|
+
HTMLButtonElement,
|
|
44
|
+
GhostButtonProps & { hasIconOnly: boolean }
|
|
45
|
+
>((props, ref) => {
|
|
46
|
+
const {
|
|
47
|
+
size = "small",
|
|
48
|
+
icon,
|
|
49
|
+
className,
|
|
50
|
+
children,
|
|
51
|
+
startIcon,
|
|
52
|
+
hasIconOnly,
|
|
53
|
+
variant,
|
|
54
|
+
...restProps
|
|
55
|
+
} = props;
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<CustomButton
|
|
59
|
+
{...restProps}
|
|
60
|
+
ref={ref}
|
|
61
|
+
className={`ghost ${className ? className : ""}`}
|
|
62
|
+
kind="ghost"
|
|
63
|
+
color={props.color ?? "primary"}
|
|
64
|
+
size={size}
|
|
65
|
+
startIcon={startIcon || icon}
|
|
66
|
+
hasIconOnly={hasIconOnly}
|
|
67
|
+
>
|
|
68
|
+
{!hasIconOnly && <>{children}</>}
|
|
69
|
+
</CustomButton>
|
|
70
|
+
);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const OutlinedButton = forwardRef<
|
|
74
|
+
HTMLButtonElement,
|
|
75
|
+
OutlinedButtonProps & { hasIconOnly: boolean }
|
|
76
|
+
>((props, ref) => {
|
|
77
|
+
const {
|
|
78
|
+
size = "small",
|
|
79
|
+
icon,
|
|
80
|
+
className,
|
|
81
|
+
children,
|
|
82
|
+
startIcon,
|
|
83
|
+
hasIconOnly,
|
|
84
|
+
variant,
|
|
85
|
+
...restProps
|
|
86
|
+
} = props;
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<CustomButton
|
|
90
|
+
{...restProps}
|
|
91
|
+
ref={ref}
|
|
92
|
+
className={`outlined ${className ? className : ""}`}
|
|
93
|
+
kind="outlined"
|
|
94
|
+
color={props.color ?? "primary"}
|
|
95
|
+
size={size}
|
|
96
|
+
startIcon={startIcon || icon}
|
|
97
|
+
hasIconOnly={hasIconOnly}
|
|
98
|
+
>
|
|
99
|
+
{!hasIconOnly && <>{children}</>}
|
|
100
|
+
</CustomButton>
|
|
101
|
+
);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
const ContainedButton = forwardRef<
|
|
105
|
+
HTMLButtonElement,
|
|
106
|
+
ContainedButtonProps & { hasIconOnly: boolean }
|
|
107
|
+
>((props, ref) => {
|
|
108
|
+
const {
|
|
109
|
+
size = "small",
|
|
110
|
+
icon,
|
|
111
|
+
className,
|
|
112
|
+
children,
|
|
113
|
+
startIcon,
|
|
114
|
+
hasIconOnly,
|
|
115
|
+
variant,
|
|
116
|
+
...restProps
|
|
117
|
+
} = props;
|
|
118
|
+
|
|
119
|
+
return (
|
|
120
|
+
<CustomButton
|
|
121
|
+
{...restProps}
|
|
122
|
+
ref={ref}
|
|
123
|
+
className={`${props.kind ?? "contained"} ${className ? className : ""}`}
|
|
124
|
+
kind={props.kind ?? "contained"}
|
|
125
|
+
color={props.color ?? "primary"}
|
|
126
|
+
size={size}
|
|
127
|
+
startIcon={startIcon || icon}
|
|
128
|
+
hasIconOnly={hasIconOnly}
|
|
129
|
+
>
|
|
130
|
+
{!hasIconOnly && <>{children}</>}
|
|
131
|
+
</CustomButton>
|
|
132
|
+
);
|
|
133
|
+
});
|
|
134
|
+
|
|
60
135
|
export default Button;
|
|
@@ -8,22 +8,26 @@ import type { OverridableComponent } from "@mui/material/OverridableComponent";
|
|
|
8
8
|
* TODO: Omit 을 사용할 경우 component prop 타입 추론이 안되는 이슈 발생
|
|
9
9
|
* https://github.com/lunit-io/design-system/pull/133#discussion_r1354277785
|
|
10
10
|
* */
|
|
11
|
-
interface BaseButtonProps extends Omit<MuiButtonProps, "variant"> {
|
|
11
|
+
export interface BaseButtonProps extends Omit<MuiButtonProps, "variant"> {
|
|
12
12
|
icon?: React.ReactNode;
|
|
13
|
+
variant?: "contained" | "outlined" | "text" | "ghost";
|
|
13
14
|
}
|
|
14
15
|
|
|
15
|
-
interface ContainedButtonProps extends BaseButtonProps {
|
|
16
|
+
export interface ContainedButtonProps extends BaseButtonProps {
|
|
16
17
|
kind?: "contained";
|
|
18
|
+
variant?: "contained";
|
|
17
19
|
color?: "primary" | "secondary" | "error";
|
|
18
20
|
}
|
|
19
21
|
|
|
20
|
-
interface GhostButtonProps extends BaseButtonProps {
|
|
22
|
+
export interface GhostButtonProps extends BaseButtonProps {
|
|
21
23
|
kind?: "ghost";
|
|
24
|
+
variant?: "text" | "ghost";
|
|
22
25
|
color?: "primary" | "secondary" | "error";
|
|
23
26
|
}
|
|
24
27
|
|
|
25
|
-
interface OutlinedButtonProps extends BaseButtonProps {
|
|
28
|
+
export interface OutlinedButtonProps extends BaseButtonProps {
|
|
26
29
|
kind?: "outlined";
|
|
30
|
+
variant?: "outlined";
|
|
27
31
|
color?: "primary" | "secondary";
|
|
28
32
|
}
|
|
29
33
|
|