@lunit/design-system 1.0.0-b.4 → 1.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/Chip/index.js +1 -1
- package/dist/cjs/components/Chip/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 +2 -5
- package/dist/components/Button/Button.styled.js.map +1 -1
- package/dist/components/Chip/Chip.js +6 -5
- package/dist/components/Chip/Chip.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 +1 -2
- package/dist/components/ToggleButton/ToggleButton.styled.js.map +1 -1
- package/dist/foundation/Typography/index.js +18 -0
- package/dist/foundation/Typography/index.js.map +1 -1
- package/dist/foundation/Typography/tokens.js +0 -16
- package/dist/foundation/Typography/tokens.js.map +1 -1
- package/dist/foundation/colors/index.js +4 -0
- package/dist/foundation/colors/index.js.map +1 -1
- package/dist/foundation/index.js +1 -1
- package/dist/foundation/index.js.map +1 -1
- package/dist/types/components/Button/Button.styled.d.ts +0 -3
- package/dist/types/components/Button/Button.types.d.ts +8 -5
- package/dist/types/components/Chip/Chip.types.d.ts +7 -2
- package/dist/types/components/TextField/TextField.types.d.ts +8 -3
- package/dist/types/foundation/Typography/index.d.ts +18 -0
- package/dist/types/foundation/colors/index.d.ts +4 -0
- package/dist/types/foundation/index.d.ts +4 -0
- package/package.json +1 -1
- package/src/components/Button/Button.styled.ts +2 -5
- package/src/components/Button/Button.tsx +117 -42
- package/src/components/Button/Button.types.ts +8 -4
- package/src/components/Chip/Chip.tsx +15 -4
- package/src/components/Chip/Chip.types.ts +9 -2
- package/src/components/TextField/TextField.tsx +10 -10
- package/src/components/TextField/TextField.types.ts +11 -4
- package/src/components/ToggleButton/ToggleButton.styled.ts +1 -2
- package/src/foundation/Typography/index.ts +18 -0
- package/src/foundation/Typography/tokens.ts +0 -16
- package/src/foundation/colors/index.ts +4 -0
- package/src/foundation/index.ts +1 -1
- package/src/stories/components/Button/BasicButton.stories.tsx +11 -0
- package/src/stories/components/Button/IconButton.stories.tsx +11 -0
- package/src/stories/components/Button/Kind.stories.tsx +62 -25
- package/src/stories/components/Chip/Chip.stories.tsx +15 -5
|
@@ -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
|
|
|
@@ -19,8 +19,11 @@ import type {
|
|
|
19
19
|
} from "./Chip.types";
|
|
20
20
|
|
|
21
21
|
const Chip: ChipType = (props: ChipProps) => {
|
|
22
|
-
const { kind, onDelete, onClick, ...restProps } = props;
|
|
23
|
-
|
|
22
|
+
const { kind, variant, onDelete, onClick, ...restProps } = props;
|
|
23
|
+
|
|
24
|
+
const isOutlined = kind === "outlined" || variant === "outlined";
|
|
25
|
+
|
|
26
|
+
if (isOutlined) return <OutlinedChip {...props} />;
|
|
24
27
|
else if (onClick) return <EnableContainedChip {...props} />;
|
|
25
28
|
else if (onDelete) return <DeletableContainedChip {...props} />;
|
|
26
29
|
|
|
@@ -63,7 +66,7 @@ const getLabelMargin = (
|
|
|
63
66
|
};
|
|
64
67
|
|
|
65
68
|
const ReadOnlyContainedChip = (props: ReadOnlyContainedChipProps) => {
|
|
66
|
-
const { color = "primary", thumbnail, sx, ...restProps } = props;
|
|
69
|
+
const { color = "primary", thumbnail, sx, variant, ...restProps } = props;
|
|
67
70
|
|
|
68
71
|
return (
|
|
69
72
|
<StyledContainedChipBase
|
|
@@ -89,6 +92,7 @@ const EnableContainedChip = (props: EnableContainedChipProps) => {
|
|
|
89
92
|
onDelete,
|
|
90
93
|
onClick,
|
|
91
94
|
sx,
|
|
95
|
+
variant,
|
|
92
96
|
...restProps
|
|
93
97
|
} = props;
|
|
94
98
|
|
|
@@ -117,7 +121,14 @@ const DeleteIconWithHoverLayer = ({ onClick }: { onClick: () => void }) => {
|
|
|
117
121
|
);
|
|
118
122
|
};
|
|
119
123
|
const DeletableContainedChip = (props: DeletableContainedChipProps) => {
|
|
120
|
-
const {
|
|
124
|
+
const {
|
|
125
|
+
color = "primary",
|
|
126
|
+
thumbnail,
|
|
127
|
+
onDelete,
|
|
128
|
+
sx,
|
|
129
|
+
variant,
|
|
130
|
+
...restProps
|
|
131
|
+
} = props;
|
|
121
132
|
|
|
122
133
|
return (
|
|
123
134
|
<StyledContainedChipDeletable
|
|
@@ -6,6 +6,8 @@ import type {
|
|
|
6
6
|
} from "@mui/material";
|
|
7
7
|
import type { OverridableComponent } from "@mui/material/OverridableComponent";
|
|
8
8
|
|
|
9
|
+
type DesignSystemChipKind = "outlined" | "contained";
|
|
10
|
+
type DesignSystemAndMuiContainedChipKind = "filled" | "contained";
|
|
9
11
|
type ColorKeys = keyof typeof CHIP_COLORS;
|
|
10
12
|
export type ChipColor = (typeof CHIP_COLORS)[ColorKeys];
|
|
11
13
|
export type ChipThumbnail = string | JSX.Element;
|
|
@@ -18,12 +20,16 @@ export interface BaseChipProps
|
|
|
18
20
|
MuiChipProps,
|
|
19
21
|
"label" | "sx" | "style" | "classes" | "onDelete"
|
|
20
22
|
> {
|
|
21
|
-
kind
|
|
23
|
+
// either kind or variant
|
|
24
|
+
kind?: DesignSystemChipKind;
|
|
25
|
+
variant?: "outlined" | DesignSystemAndMuiContainedChipKind;
|
|
26
|
+
// mui variant = outlined | "filled" | undefined
|
|
22
27
|
color?: ChipColor;
|
|
23
28
|
}
|
|
24
29
|
|
|
25
30
|
export interface OutlinedChipProps extends BaseChipProps {
|
|
26
31
|
kind?: "outlined";
|
|
32
|
+
variant?: "outlined";
|
|
27
33
|
onClick?: never;
|
|
28
34
|
onDelete?: never;
|
|
29
35
|
}
|
|
@@ -32,9 +38,10 @@ export interface BaseContainedChipProps
|
|
|
32
38
|
extends BaseChipProps,
|
|
33
39
|
Omit<
|
|
34
40
|
MuiChipProps,
|
|
35
|
-
"color" | "size" | "
|
|
41
|
+
"color" | "size" | "avatar" | "deleteIcon" | "icon" | "variant"
|
|
36
42
|
> {
|
|
37
43
|
kind?: "contained";
|
|
44
|
+
variant?: DesignSystemAndMuiContainedChipKind;
|
|
38
45
|
thumbnail?: ChipThumbnail;
|
|
39
46
|
onClick?: () => void;
|
|
40
47
|
}
|
|
@@ -25,6 +25,7 @@ const SingleTextField = forwardRef<HTMLDivElement, SingleTextFieldProps>(
|
|
|
25
25
|
|
|
26
26
|
return (
|
|
27
27
|
<BaseTextField
|
|
28
|
+
variant="outlined"
|
|
28
29
|
{...restProps}
|
|
29
30
|
ref={ref}
|
|
30
31
|
textFieldSize={size}
|
|
@@ -57,19 +58,19 @@ const SingleTextField = forwardRef<HTMLDivElement, SingleTextFieldProps>(
|
|
|
57
58
|
const MultiTextField = forwardRef<HTMLDivElement, MultiTextFieldProps>(
|
|
58
59
|
({ size = "small", ...restProps }, ref) => {
|
|
59
60
|
return (
|
|
60
|
-
<BaseTextField
|
|
61
|
+
<BaseTextField
|
|
62
|
+
variant="outlined"
|
|
63
|
+
{...restProps}
|
|
64
|
+
ref={ref}
|
|
65
|
+
textFieldSize={size}
|
|
66
|
+
multiline
|
|
67
|
+
/>
|
|
61
68
|
);
|
|
62
69
|
}
|
|
63
70
|
);
|
|
64
71
|
|
|
65
72
|
const TextField = forwardRef<HTMLDivElement, TextFieldProps>((props, ref) => {
|
|
66
|
-
const {
|
|
67
|
-
rows,
|
|
68
|
-
size,
|
|
69
|
-
multiline = false,
|
|
70
|
-
variant = "outlined",
|
|
71
|
-
...restProps
|
|
72
|
-
} = props;
|
|
73
|
+
const { rows, size, multiline = false, variant, ...restProps } = props;
|
|
73
74
|
|
|
74
75
|
return multiline ? (
|
|
75
76
|
<MultiTextField
|
|
@@ -77,11 +78,10 @@ const TextField = forwardRef<HTMLDivElement, TextFieldProps>((props, ref) => {
|
|
|
77
78
|
ref={ref}
|
|
78
79
|
maxRows={Infinity}
|
|
79
80
|
size={size}
|
|
80
|
-
variant={variant}
|
|
81
81
|
rows={rows}
|
|
82
82
|
/>
|
|
83
83
|
) : (
|
|
84
|
-
<SingleTextField {...restProps} ref={ref} size={size}
|
|
84
|
+
<SingleTextField {...restProps} ref={ref} size={size} />
|
|
85
85
|
);
|
|
86
86
|
});
|
|
87
87
|
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { SxProps } from "@mui/material";
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
TextFieldProps as MuiTextFieldProps,
|
|
4
|
+
OutlinedTextFieldProps,
|
|
5
|
+
} from "@mui/material/TextField";
|
|
3
6
|
|
|
4
7
|
export type TextFieldSize = "small" | "medium" | "large";
|
|
5
8
|
export interface BaseTextFieldProps
|
|
@@ -8,12 +11,16 @@ export interface BaseTextFieldProps
|
|
|
8
11
|
"size" | "value" | "helperText" | "variant"
|
|
9
12
|
> {
|
|
10
13
|
/**
|
|
11
|
-
* The design system TextField
|
|
14
|
+
* The design system TextField has only on kind, which is "contained"
|
|
15
|
+
Below are all return same kind "contained"
|
|
16
|
+
<TextField variant="outlined" />
|
|
17
|
+
<TextField variant="contained" />
|
|
18
|
+
<TextField variant="filled" />
|
|
19
|
+
<TextField variant="standard" />
|
|
12
20
|
*/
|
|
13
|
-
variant?: "
|
|
21
|
+
variant?: MuiTextFieldProps["variant"];
|
|
14
22
|
value?: string;
|
|
15
23
|
helperText?: string;
|
|
16
|
-
|
|
17
24
|
/**
|
|
18
25
|
* @default "small"
|
|
19
26
|
*/
|
|
@@ -57,10 +57,9 @@ export const IconWrapper = styled("div")<{
|
|
|
57
57
|
}>(({ hasIconOnly, size }) => ({
|
|
58
58
|
width: "20px",
|
|
59
59
|
height: "20px",
|
|
60
|
-
padding: "1px",
|
|
61
60
|
marginRight: hasIconOnly ? "0px" : size === "large" ? "8px" : "4px",
|
|
62
61
|
|
|
63
62
|
"*:nth-of-type(1)": {
|
|
64
|
-
fontSize: "
|
|
63
|
+
fontSize: "20px",
|
|
65
64
|
},
|
|
66
65
|
}));
|
|
@@ -86,6 +86,24 @@ export const createTypographyCssBaseline = () => {
|
|
|
86
86
|
":root": {
|
|
87
87
|
...cssVariables,
|
|
88
88
|
},
|
|
89
|
+
".light1": {
|
|
90
|
+
color: "var(--text_normal)",
|
|
91
|
+
},
|
|
92
|
+
".light2": {
|
|
93
|
+
color: "var(--text_normal)",
|
|
94
|
+
},
|
|
95
|
+
".dark1": {
|
|
96
|
+
color: "var(--text_normal)",
|
|
97
|
+
},
|
|
98
|
+
".dark2": {
|
|
99
|
+
color: "var(--text_normal)",
|
|
100
|
+
},
|
|
101
|
+
".dark3": {
|
|
102
|
+
color: "var(--text_normal)",
|
|
103
|
+
},
|
|
104
|
+
".dark4": {
|
|
105
|
+
color: "var(--text_normal)",
|
|
106
|
+
},
|
|
89
107
|
};
|
|
90
108
|
};
|
|
91
109
|
|
|
@@ -69,73 +69,61 @@ const fontVariants: Record<string, TypographyStyleOptions> = {
|
|
|
69
69
|
fontWeight: "var(--headline1-font-weight)",
|
|
70
70
|
fontSize: "var(--headline1-font-size)",
|
|
71
71
|
lineHeight: "var(--headline1-line-height)",
|
|
72
|
-
color: "var(--text_normal)",
|
|
73
72
|
},
|
|
74
73
|
headline2: {
|
|
75
74
|
fontWeight: "var(--headline2-font-weight)",
|
|
76
75
|
fontSize: "var(--headline2-font-size)",
|
|
77
76
|
lineHeight: "var(--headline2-line-height)",
|
|
78
|
-
color: "var(--text_normal)",
|
|
79
77
|
},
|
|
80
78
|
headline3: {
|
|
81
79
|
fontWeight: "var(--headline3-font-weight)",
|
|
82
80
|
fontSize: "var(--headline3-font-size)",
|
|
83
81
|
lineHeight: "var(--headline3-line-height)",
|
|
84
|
-
color: "var(--text_normal)",
|
|
85
82
|
},
|
|
86
83
|
headline4: {
|
|
87
84
|
fontWeight: "var(--headline4-font-weight)",
|
|
88
85
|
fontSize: "var(--headline4-font-size)",
|
|
89
86
|
lineHeight: "var(--headline4-line-height)",
|
|
90
|
-
color: "var(--text_normal)",
|
|
91
87
|
},
|
|
92
88
|
headline5: {
|
|
93
89
|
fontWeight: "var(--headline5-font-weight)",
|
|
94
90
|
fontSize: "var(--headline5-font-size)",
|
|
95
91
|
lineHeight: "var(--headline5-line-height)",
|
|
96
|
-
color: "var(--text_normal)",
|
|
97
92
|
},
|
|
98
93
|
body1_16_semibold: {
|
|
99
94
|
fontWeight: "var(--body1-16-semibold-font-weight)",
|
|
100
95
|
fontSize: "var(--body1-16-semibold-font-size)",
|
|
101
96
|
lineHeight: "var(--body1-16-semibold-line-height)",
|
|
102
|
-
color: "var(--text_normal)",
|
|
103
97
|
},
|
|
104
98
|
body1_16_regular: {
|
|
105
99
|
fontWeight: "var(--body1-16-regular-font-weight)",
|
|
106
100
|
fontSize: "var(--body1-16-regular-font-size)",
|
|
107
101
|
lineHeight: "var(--body1-16-regular-line-height)",
|
|
108
|
-
color: "var(--text_normal)",
|
|
109
102
|
},
|
|
110
103
|
body2_14_bold: {
|
|
111
104
|
fontWeight: "var(--body2-14-bold-font-weight)",
|
|
112
105
|
fontSize: "var(--body2-14-bold-font-size)",
|
|
113
106
|
lineHeight: "var(--body2-14-bold-line-height)",
|
|
114
|
-
color: "var(--text_normal)",
|
|
115
107
|
},
|
|
116
108
|
body2_14_medium: {
|
|
117
109
|
fontWeight: "var(--body2-14-medium-font-weight)",
|
|
118
110
|
fontSize: "var(--body2-14-medium-font-size)",
|
|
119
111
|
lineHeight: "var(--body2-14-medium-line-height)",
|
|
120
|
-
color: "var(--text_normal)",
|
|
121
112
|
},
|
|
122
113
|
body2_14_regular: {
|
|
123
114
|
fontWeight: "var(--body2-14-regular-font-weight)",
|
|
124
115
|
fontSize: "var(--body2-14-regular-font-size)",
|
|
125
116
|
lineHeight: "var(--body2-14-regular-line-height)",
|
|
126
|
-
color: "var(--text_normal)",
|
|
127
117
|
},
|
|
128
118
|
body3_12_semibold: {
|
|
129
119
|
fontWeight: "var(--body3-12-semibold-font-weight)",
|
|
130
120
|
fontSize: "var(--body3-12-semibold-font-size)",
|
|
131
121
|
lineHeight: "var(--body3-12-semibold-line-height)",
|
|
132
|
-
color: "var(--text_normal)",
|
|
133
122
|
},
|
|
134
123
|
body3_12_regular: {
|
|
135
124
|
fontWeight: "var(--body3-12-regular-font-weight)",
|
|
136
125
|
fontSize: "var(--body3-12-regular-font-size)",
|
|
137
126
|
lineHeight: "var(--body3-12-regular-line-height)",
|
|
138
|
-
color: "var(--text_normal)",
|
|
139
127
|
},
|
|
140
128
|
overline: {
|
|
141
129
|
fontWeight: "var(--overline-font-weight)",
|
|
@@ -143,14 +131,12 @@ const fontVariants: Record<string, TypographyStyleOptions> = {
|
|
|
143
131
|
lineHeight: "var(--overline-line-height)",
|
|
144
132
|
letterSpacing: "1px",
|
|
145
133
|
textTransform: "uppercase",
|
|
146
|
-
color: "var(--text_normal)",
|
|
147
134
|
},
|
|
148
135
|
button1: {
|
|
149
136
|
fontWeight: "var(--button1-font-weight)",
|
|
150
137
|
fontSize: "var(--button1-font-size)",
|
|
151
138
|
lineHeight: "var(--button1-line-height)",
|
|
152
139
|
textTransform: "capitalize",
|
|
153
|
-
color: "var(--text_normal)",
|
|
154
140
|
},
|
|
155
141
|
button2: {
|
|
156
142
|
fontWeight: "var(--button2-font-weight)",
|
|
@@ -158,13 +144,11 @@ const fontVariants: Record<string, TypographyStyleOptions> = {
|
|
|
158
144
|
lineHeight: "var(--button2-line-height)",
|
|
159
145
|
letterSpacing: "0.2px",
|
|
160
146
|
textTransform: "capitalize",
|
|
161
|
-
color: "var(--text_normal)",
|
|
162
147
|
},
|
|
163
148
|
caption: {
|
|
164
149
|
fontWeight: "var(--caption-font-weight)",
|
|
165
150
|
fontSize: "var(--caption-font-size)",
|
|
166
151
|
lineHeight: "var(--caption-line-height)",
|
|
167
|
-
color: "var(--text_normal)",
|
|
168
152
|
},
|
|
169
153
|
};
|
|
170
154
|
|
|
@@ -172,6 +172,10 @@ const paletteOptions = {
|
|
|
172
172
|
main: base.green[40], // core.text_success.dark1
|
|
173
173
|
},
|
|
174
174
|
grey: base.greyForMUI,
|
|
175
|
+
text: {
|
|
176
|
+
primary: base.grey[5], // core.text_normal.dark1
|
|
177
|
+
secondary: base.grey[40], // core.text_medium.dark1
|
|
178
|
+
},
|
|
175
179
|
lunit_global: lunitColors,
|
|
176
180
|
lunit_token: {
|
|
177
181
|
core: {
|
package/src/foundation/index.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { createElevationCssBaseline, elevationOptions } from "./Elevation";
|
|
|
9
9
|
|
|
10
10
|
export const foundationCssBaseline: Components<Theme>["MuiCssBaseline"] = {
|
|
11
11
|
styleOverrides: deepmerge(
|
|
12
|
-
deepmerge(
|
|
12
|
+
deepmerge(createColorCssBaseline(), createTypographyCssBaseline()),
|
|
13
13
|
createElevationCssBaseline()
|
|
14
14
|
),
|
|
15
15
|
};
|
|
@@ -50,6 +50,16 @@ export default {
|
|
|
50
50
|
defaultValue: { summary: "contained" },
|
|
51
51
|
},
|
|
52
52
|
},
|
|
53
|
+
variant: {
|
|
54
|
+
control: {
|
|
55
|
+
type: "radio",
|
|
56
|
+
},
|
|
57
|
+
options: ["contained", "outlined", "text", "ghost"],
|
|
58
|
+
description: "The variant is alias of kind.",
|
|
59
|
+
table: {
|
|
60
|
+
defaultValue: { summary: "contained" },
|
|
61
|
+
},
|
|
62
|
+
},
|
|
53
63
|
color: {
|
|
54
64
|
control: {
|
|
55
65
|
type: "radio",
|
|
@@ -98,6 +108,7 @@ export default {
|
|
|
98
108
|
"disabled",
|
|
99
109
|
"size",
|
|
100
110
|
"kind",
|
|
111
|
+
"variant",
|
|
101
112
|
"color",
|
|
102
113
|
"icon",
|
|
103
114
|
],
|
|
@@ -36,6 +36,16 @@ export default {
|
|
|
36
36
|
defaultValue: { summary: "contained" },
|
|
37
37
|
},
|
|
38
38
|
},
|
|
39
|
+
variant: {
|
|
40
|
+
control: {
|
|
41
|
+
type: "radio",
|
|
42
|
+
},
|
|
43
|
+
options: ["contained", "outlined", "text", "ghost"],
|
|
44
|
+
description: "The variant is alias of kind.",
|
|
45
|
+
table: {
|
|
46
|
+
defaultValue: { summary: "contained" },
|
|
47
|
+
},
|
|
48
|
+
},
|
|
39
49
|
color: {
|
|
40
50
|
control: {
|
|
41
51
|
type: "radio",
|
|
@@ -85,6 +95,7 @@ export default {
|
|
|
85
95
|
"disabled",
|
|
86
96
|
"size",
|
|
87
97
|
"kind",
|
|
98
|
+
"variant",
|
|
88
99
|
"color",
|
|
89
100
|
],
|
|
90
101
|
},
|