@lunit/design-system 1.0.0-a.5 → 1.0.0-b.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- 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/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/Toggle/index.js +1 -1
- package/dist/cjs/components/Toggle/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/components/Typography/index.js +1 -1
- package/dist/cjs/components/Typography/index.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/components/Alert/Alert.styled.js +2 -2
- package/dist/components/Alert/Alert.styled.js.map +1 -1
- package/dist/components/Alert/Alert.utils.js +12 -12
- package/dist/components/Alert/Alert.utils.js.map +1 -1
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/Button.styled.js +36 -36
- package/dist/components/Button/Button.styled.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.js +4 -4
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Chip/Chip.js +1 -1
- package/dist/components/Chip/Chip.js.map +1 -1
- package/dist/components/Chip/Chip.styled.js +15 -15
- package/dist/components/Chip/Chip.styled.js.map +1 -1
- package/dist/components/Radio/Radio.js +3 -3
- package/dist/components/Radio/Radio.js.map +1 -1
- package/dist/components/TextField/TextField.js +16 -12
- package/dist/components/TextField/TextField.js.map +1 -1
- package/dist/components/TextField/TextField.style.js +30 -32
- package/dist/components/TextField/TextField.style.js.map +1 -1
- package/dist/components/Toast/Toast.styled.js +3 -3
- package/dist/components/Toast/Toast.styled.js.map +1 -1
- package/dist/components/Toast/Toast.utils.js +4 -4
- package/dist/components/Toast/Toast.utils.js.map +1 -1
- package/dist/components/Toggle/Toggle.styled.js +20 -20
- package/dist/components/Toggle/Toggle.styled.js.map +1 -1
- package/dist/components/ToggleButton/ToggleButton.styled.js +7 -7
- package/dist/components/ToggleButton/ToggleButton.styled.js.map +1 -1
- package/dist/components/Typography/Typography.js +7 -0
- package/dist/components/Typography/Typography.js.map +1 -0
- package/dist/components/Typography/index.js +1 -2
- package/dist/components/Typography/index.js.map +1 -1
- package/dist/foundation/Elevation/index.js +4 -4
- package/dist/foundation/Elevation/index.js.map +1 -1
- package/dist/foundation/colors/index.js +3 -2
- package/dist/foundation/colors/index.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/theme.js +3 -2
- package/dist/theme.js.map +1 -1
- package/dist/types/components/Button/Button.d.ts +2 -2
- package/dist/types/components/Button/Button.styled.d.ts +7 -7
- package/dist/types/components/Button/Button.types.d.ts +11 -1
- package/dist/types/components/Chip/Chip.d.ts +2 -2
- package/dist/types/components/Chip/Chip.styled.d.ts +4 -4
- package/dist/types/components/Chip/Chip.types.d.ts +7 -1
- package/dist/types/components/TextField/TextField.d.ts +3 -2
- package/dist/types/components/Toggle/Toggle.styled.d.ts +1 -1
- package/dist/types/components/Typography/Typography.d.ts +11 -0
- package/dist/types/components/Typography/index.d.ts +1 -7
- package/dist/types/foundation/colors/index.d.ts +9 -6
- package/dist/types/foundation/index.d.ts +3 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/theme.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/Alert/Alert.styled.ts +2 -2
- package/src/components/Alert/Alert.utils.ts +12 -12
- package/src/components/Button/Button.styled.ts +37 -37
- package/src/components/Button/Button.tsx +2 -2
- package/src/components/Button/Button.types.ts +19 -1
- package/src/components/Checkbox/Checkbox.tsx +4 -4
- package/src/components/Chip/Chip.styled.ts +15 -15
- package/src/components/Chip/Chip.tsx +10 -2
- package/src/components/Chip/Chip.types.ts +15 -1
- package/src/components/Radio/Radio.tsx +3 -3
- package/src/components/TextField/TextField.style.ts +31 -33
- package/src/components/TextField/TextField.tsx +55 -47
- package/src/components/Toast/Toast.styled.ts +3 -3
- package/src/components/Toast/Toast.utils.ts +4 -4
- package/src/components/Toggle/Toggle.styled.ts +42 -39
- package/src/components/ToggleButton/ToggleButton.styled.ts +7 -7
- package/src/components/Typography/Typography.tsx +18 -0
- package/src/components/Typography/index.ts +1 -9
- package/src/foundation/Elevation/index.ts +4 -4
- package/src/foundation/colors/index.ts +31 -26
- package/src/index.ts +1 -1
- package/src/stories/components/Alert/Alert.stories.tsx +1 -1
- package/src/stories/components/Button/BasicButton.stories.tsx +1 -3
- package/src/stories/components/TextField/TextFieldMulti.stories.tsx +6 -0
- package/src/stories/components/TextField/TextFieldSingle.stories.tsx +24 -0
- package/src/stories/foundation/Typography/TypographyGroup.tsx +1 -1
- package/src/stories/foundation/colors/Colors.stories.tsx +3 -3
- package/src/stories/foundation/colors/Token.inComponent.stories.tsx +21 -19
- package/src/stories/foundation/colors/TokenPaletteTable.tsx +6 -4
- package/src/stories/foundation/colors/styled.ts +1 -1
- package/src/theme.ts +5 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { styled, Switch as MuiSwitch, SwitchProps } from "@mui/material";
|
|
2
2
|
interface ToggleProps extends SwitchProps {
|
|
3
|
-
toggleSize:
|
|
3
|
+
toggleSize: "medium" | "large";
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
const toggleStyles = {
|
|
@@ -19,15 +19,15 @@ const toggleStyles = {
|
|
|
19
19
|
transition: "all 100ms ease-in-out",
|
|
20
20
|
},
|
|
21
21
|
switchChecked: {
|
|
22
|
-
transform:
|
|
22
|
+
transform: "translateX(10px)",
|
|
23
23
|
},
|
|
24
24
|
thumb: {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
25
|
+
width: 14,
|
|
26
|
+
height: 14,
|
|
27
|
+
},
|
|
28
28
|
},
|
|
29
29
|
large: {
|
|
30
|
-
root:{
|
|
30
|
+
root: {
|
|
31
31
|
width: 44,
|
|
32
32
|
height: 24,
|
|
33
33
|
borderRadius: 12,
|
|
@@ -41,20 +41,20 @@ const toggleStyles = {
|
|
|
41
41
|
transition: "all 150ms ease-in-out",
|
|
42
42
|
},
|
|
43
43
|
switchChecked: {
|
|
44
|
-
transform:
|
|
44
|
+
transform: "translateX(20px)",
|
|
45
45
|
},
|
|
46
46
|
thumb: {
|
|
47
47
|
width: 20,
|
|
48
48
|
height: 20,
|
|
49
49
|
},
|
|
50
50
|
},
|
|
51
|
-
}
|
|
51
|
+
};
|
|
52
52
|
|
|
53
53
|
const indeterminateStyles = {
|
|
54
54
|
large: {
|
|
55
55
|
switchChecked: {
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
top: 8,
|
|
57
|
+
left: -8,
|
|
58
58
|
},
|
|
59
59
|
track: {
|
|
60
60
|
borderRadius: 12,
|
|
@@ -67,8 +67,8 @@ const indeterminateStyles = {
|
|
|
67
67
|
},
|
|
68
68
|
medium: {
|
|
69
69
|
switchChecked: {
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
top: 6,
|
|
71
|
+
left: -4,
|
|
72
72
|
},
|
|
73
73
|
track: {
|
|
74
74
|
borderRadius: 12,
|
|
@@ -78,28 +78,29 @@ const indeterminateStyles = {
|
|
|
78
78
|
width: 12,
|
|
79
79
|
borderRadius: 2,
|
|
80
80
|
},
|
|
81
|
-
}
|
|
82
|
-
}
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
83
|
|
|
84
84
|
export const CommonToggle = styled(MuiSwitch, {
|
|
85
|
-
shouldForwardProp: (props) => props !==
|
|
85
|
+
shouldForwardProp: (props) => props !== "toggleSize",
|
|
86
86
|
})<ToggleProps>(({ theme, toggleSize, disabled }) => {
|
|
87
|
-
const checkedColor = theme.palette.
|
|
88
|
-
const uncheckedColor = theme.palette.
|
|
89
|
-
const handlerColor =
|
|
87
|
+
const checkedColor = theme.palette.lunit_token.component.selectcontrol_on;
|
|
88
|
+
const uncheckedColor = theme.palette.lunit_token.component.selectcontrol_off;
|
|
89
|
+
const handlerColor =
|
|
90
|
+
theme.palette.lunit_token.component.selectcontrol_handler;
|
|
90
91
|
|
|
91
92
|
const toggleStyle = toggleStyles[toggleSize];
|
|
92
93
|
const toggleOpacity = disabled ? 0.38 : 1;
|
|
93
94
|
|
|
94
95
|
return {
|
|
95
96
|
...toggleStyle.root,
|
|
96
|
-
display:
|
|
97
|
+
display: "flex",
|
|
97
98
|
padding: 0,
|
|
98
99
|
overflow: "visible",
|
|
99
100
|
backgroundColor: "transparent",
|
|
100
101
|
opacity: toggleOpacity,
|
|
101
102
|
"& .Mui-focusVisible": {
|
|
102
|
-
|
|
103
|
+
// clear default focus style
|
|
103
104
|
boxShadow: "none",
|
|
104
105
|
background: "transparent",
|
|
105
106
|
borderColor: "transparent",
|
|
@@ -112,51 +113,53 @@ export const CommonToggle = styled(MuiSwitch, {
|
|
|
112
113
|
boxSizing: "border-box",
|
|
113
114
|
top: -3, // border 1px + offset 2px
|
|
114
115
|
left: -3, // border 1px + offset 2px
|
|
115
|
-
}
|
|
116
|
+
},
|
|
116
117
|
},
|
|
117
|
-
|
|
118
|
+
"& .MuiSwitch-track": {
|
|
118
119
|
opacity: 1,
|
|
119
120
|
borderRadius: 12,
|
|
120
121
|
backgroundColor: uncheckedColor,
|
|
121
122
|
},
|
|
122
|
-
|
|
123
|
+
"& .MuiSwitch-thumb": {
|
|
123
124
|
...toggleStyle.thumb,
|
|
124
125
|
boxShadow: "0px 0px 1px rgba(0, 0, 0, 0.4)",
|
|
125
126
|
},
|
|
126
|
-
|
|
127
|
+
"& .MuiSwitch-switchBase": {
|
|
127
128
|
...toggleStyle.switch,
|
|
128
129
|
padding: 2,
|
|
129
130
|
opacity: 1,
|
|
130
|
-
|
|
131
|
+
"&.Mui-checked": {
|
|
131
132
|
...toggleStyle.switchChecked,
|
|
132
133
|
color: handlerColor,
|
|
133
|
-
|
|
134
|
+
"& + .MuiSwitch-track": {
|
|
134
135
|
opacity: 1,
|
|
135
136
|
backgroundColor: checkedColor,
|
|
136
137
|
},
|
|
137
138
|
},
|
|
138
139
|
},
|
|
139
|
-
|
|
140
|
+
"& .Mui-disabled + .MuiSwitch-track": {
|
|
140
141
|
opacity: 1,
|
|
141
142
|
},
|
|
142
|
-
}
|
|
143
|
+
};
|
|
144
|
+
});
|
|
143
145
|
|
|
144
146
|
export const CommonIndeterminateToggle = styled(CommonToggle, {
|
|
145
|
-
shouldForwardProp: (props) => props !==
|
|
147
|
+
shouldForwardProp: (props) => props !== "toggleSize",
|
|
146
148
|
})(({ toggleSize }) => {
|
|
147
149
|
const indeterminateStyle = indeterminateStyles[toggleSize];
|
|
148
150
|
|
|
149
151
|
return {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
152
|
+
padding: 0,
|
|
153
|
+
cursor: "pointer",
|
|
154
|
+
"& .MuiSwitch-switchBase.Mui-checked": {
|
|
153
155
|
...indeterminateStyle.switchChecked,
|
|
154
|
-
|
|
156
|
+
"& + .MuiSwitch-track": {
|
|
155
157
|
...indeterminateStyle.track,
|
|
158
|
+
},
|
|
156
159
|
},
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
}
|
|
160
|
+
"& .MuiSwitch-thumb": {
|
|
161
|
+
...indeterminateStyle.thumb,
|
|
162
|
+
boxShadow: "none",
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
});
|
|
@@ -19,7 +19,7 @@ export const CustomToggleButton = styled(MuiToggleButton, {
|
|
|
19
19
|
({
|
|
20
20
|
theme: {
|
|
21
21
|
typography,
|
|
22
|
-
palette: {
|
|
22
|
+
palette: { lunit_token },
|
|
23
23
|
},
|
|
24
24
|
kind,
|
|
25
25
|
size,
|
|
@@ -30,22 +30,22 @@ export const CustomToggleButton = styled(MuiToggleButton, {
|
|
|
30
30
|
}) => {
|
|
31
31
|
return {
|
|
32
32
|
border: "none",
|
|
33
|
-
...commonStyle({
|
|
33
|
+
...commonStyle({ lunit_token }),
|
|
34
34
|
...iconStyle({ size, hasIconOnly }),
|
|
35
35
|
...sizeStyle({ size, kind, hasIconOnly, selected, typography }),
|
|
36
|
-
...kindStyle({ kind, color,
|
|
36
|
+
...kindStyle({ kind, color, lunit_token }),
|
|
37
37
|
...(selectedColor === "primary" && {
|
|
38
38
|
"&.Mui-selected, &.Mui-selected:hover": {
|
|
39
39
|
border: "none",
|
|
40
|
-
backgroundColor:
|
|
41
|
-
color:
|
|
40
|
+
backgroundColor: lunit_token.component.btn_selected_primary_bg,
|
|
41
|
+
color: lunit_token.component.btn_selected_primary_text,
|
|
42
42
|
},
|
|
43
43
|
}),
|
|
44
44
|
...(selectedColor === "secondary" && {
|
|
45
45
|
"&.Mui-selected, &.Mui-selected:hover": {
|
|
46
46
|
border: "none",
|
|
47
|
-
backgroundColor:
|
|
48
|
-
color:
|
|
47
|
+
backgroundColor: lunit_token.component.btn_selected_secondary_bg,
|
|
48
|
+
color: lunit_token.component.btn_selected_secondary_text,
|
|
49
49
|
},
|
|
50
50
|
}),
|
|
51
51
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import MuiTypography from "@mui/material/Typography";
|
|
3
|
+
|
|
4
|
+
import type { TypographyProps } from "@mui/material/Typography";
|
|
5
|
+
import type { TypographyPropsVariantOverridesType } from "../../foundation/Typography";
|
|
6
|
+
|
|
7
|
+
declare module "@mui/material/Typography" {
|
|
8
|
+
interface TypographyPropsVariantOverrides
|
|
9
|
+
extends TypographyPropsVariantOverridesType {}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const Typography = <C extends React.ElementType>(
|
|
13
|
+
props: TypographyProps<C, { component?: C }>
|
|
14
|
+
) => {
|
|
15
|
+
return <MuiTypography {...props} />;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default Typography;
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type { TypographyPropsVariantOverridesType } from "../../foundation/Typography";
|
|
3
|
-
|
|
4
|
-
declare module "@mui/material/Typography" {
|
|
5
|
-
interface TypographyPropsVariantOverrides
|
|
6
|
-
extends TypographyPropsVariantOverridesType {}
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export default Typography;
|
|
1
|
+
export { default } from "./Typography";
|
|
@@ -2,10 +2,10 @@ import paletteOptions from "../colors";
|
|
|
2
2
|
import { createCSSVarNames, createCSSVars } from "./utils";
|
|
3
3
|
|
|
4
4
|
export const shadows = {
|
|
5
|
-
shadow1: `0px 4px 8px ${paletteOptions.
|
|
6
|
-
shadow2: `0px 3px 12px ${paletteOptions.
|
|
7
|
-
shadow3: `0px 12px 24px ${paletteOptions.
|
|
8
|
-
shadow4: `0px 12px 44px ${paletteOptions.
|
|
5
|
+
shadow1: `0px 4px 8px ${paletteOptions.lunit_token.core.shadow_01}`,
|
|
6
|
+
shadow2: `0px 3px 12px ${paletteOptions.lunit_token.core.shadow_02}`,
|
|
7
|
+
shadow3: `0px 12px 24px ${paletteOptions.lunit_token.core.shadow_03}`,
|
|
8
|
+
shadow4: `0px 12px 44px ${paletteOptions.lunit_token.core.shadow_04}`,
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
const shadowVars = createCSSVarNames(shadows);
|
|
@@ -11,7 +11,7 @@ export type GreyColor = Record<keyof typeof base.grey, PaletteColor>;
|
|
|
11
11
|
|
|
12
12
|
declare module "@mui/material/styles/createPalette" {
|
|
13
13
|
interface PaletteOptions {
|
|
14
|
-
|
|
14
|
+
lunit_global?: {
|
|
15
15
|
grey: GreyColor;
|
|
16
16
|
blue: BaseColor;
|
|
17
17
|
green: BaseColor;
|
|
@@ -19,14 +19,15 @@ declare module "@mui/material/styles/createPalette" {
|
|
|
19
19
|
lunit_teal: BaseColor;
|
|
20
20
|
magenta: BaseColor;
|
|
21
21
|
orange: BaseColor;
|
|
22
|
+
purple: BaseColor;
|
|
22
23
|
red: BaseColor;
|
|
23
24
|
yellow: BaseColor;
|
|
24
25
|
};
|
|
25
|
-
|
|
26
|
+
lunit_token?: ColorToken;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
interface Palette {
|
|
29
|
-
|
|
30
|
+
lunit_global: {
|
|
30
31
|
grey: GreyColor;
|
|
31
32
|
blue: BaseColor;
|
|
32
33
|
green: BaseColor;
|
|
@@ -34,10 +35,11 @@ declare module "@mui/material/styles/createPalette" {
|
|
|
34
35
|
lunit_teal: BaseColor;
|
|
35
36
|
magenta: BaseColor;
|
|
36
37
|
orange: BaseColor;
|
|
38
|
+
purple: BaseColor;
|
|
37
39
|
red: BaseColor;
|
|
38
40
|
yellow: BaseColor;
|
|
39
41
|
};
|
|
40
|
-
|
|
42
|
+
lunit_token: ColorToken;
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
45
|
|
|
@@ -123,29 +125,32 @@ export const createColorCssBaseline = () => {
|
|
|
123
125
|
};
|
|
124
126
|
|
|
125
127
|
// TODO: TextColors 삭제하고 관련된 설정 수정하기
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
128
|
+
// TODO: opacity 글로벌 팔레트에 추가 여부 확인해서 작업하기
|
|
129
|
+
const lunitColors: PaletteOptions["lunit_global"] =
|
|
130
|
+
((): PaletteOptions["lunit_global"] => {
|
|
131
|
+
const ret: any = {};
|
|
132
|
+
for (const colorKey in base) {
|
|
133
|
+
if (base[`${colorKey}Text` as ColorKey]) {
|
|
134
|
+
const baseColors = base[colorKey as ColorKey];
|
|
135
|
+
const textColors = base[`${colorKey}Text` as ColorKey];
|
|
136
|
+
ret[colorKey] = {};
|
|
137
|
+
for (const key in baseColors) {
|
|
138
|
+
if (baseColors.hasOwnProperty(key)) {
|
|
139
|
+
const color = baseColors[Number(key) as keyof typeof baseColors];
|
|
140
|
+
const textColor =
|
|
141
|
+
textColors[Number(key) as keyof typeof textColors];
|
|
142
|
+
ret[colorKey][Number(key)] = {
|
|
143
|
+
light: color,
|
|
144
|
+
main: color,
|
|
145
|
+
dark: color,
|
|
146
|
+
contrastText: textColor,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
143
149
|
}
|
|
144
150
|
}
|
|
145
151
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
})();
|
|
152
|
+
return ret;
|
|
153
|
+
})();
|
|
149
154
|
|
|
150
155
|
const paletteOptions = {
|
|
151
156
|
primary: {
|
|
@@ -167,8 +172,8 @@ const paletteOptions = {
|
|
|
167
172
|
main: base.green[40], // core.text_success.dark1
|
|
168
173
|
},
|
|
169
174
|
grey: base.greyForMUI,
|
|
170
|
-
|
|
171
|
-
|
|
175
|
+
lunit_global: lunitColors,
|
|
176
|
+
lunit_token: {
|
|
172
177
|
core: {
|
|
173
178
|
bg_01: "var(--bg_01)",
|
|
174
179
|
bg_02: "var(--bg_02)",
|
package/src/index.ts
CHANGED
|
@@ -62,7 +62,7 @@ const AlertChildrenContentLong = () => {
|
|
|
62
62
|
<Typography variant="body2_14_regular">
|
|
63
63
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
|
|
64
64
|
tempor incididunt ut{" "}
|
|
65
|
-
<u style={{ color: theme.palette.
|
|
65
|
+
<u style={{ color: theme.palette.lunit_token.core.link_primary }}>
|
|
66
66
|
labore et dolore
|
|
67
67
|
</u>{" "}
|
|
68
68
|
magna aliqua. A diam sollicitudin tempor id eu nisl nunc mi. Auctor augue
|
|
@@ -12,10 +12,8 @@ import Bell from "@lunit/design-system-icons/Bell";
|
|
|
12
12
|
import Button from "@/components/Button";
|
|
13
13
|
|
|
14
14
|
import type { StoryObj, StoryFn, Meta } from "@storybook/react";
|
|
15
|
-
import type { ButtonProps } from "@/components/Button/Button.types";
|
|
16
15
|
|
|
17
|
-
type
|
|
18
|
-
type SizeValues = Size[keyof Size];
|
|
16
|
+
type SizeValues = "small" | "medium" | "large";
|
|
19
17
|
const sizeList: SizeValues[] = ["small", "medium", "large"];
|
|
20
18
|
|
|
21
19
|
export default {
|
|
@@ -107,6 +107,9 @@ const MultiTemplate: StoryFn<typeof TextField> = (args) => (
|
|
|
107
107
|
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
108
108
|
Focused
|
|
109
109
|
</TableCell>
|
|
110
|
+
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
111
|
+
Error Focused
|
|
112
|
+
</TableCell>
|
|
110
113
|
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
111
114
|
Disabled
|
|
112
115
|
</TableCell>
|
|
@@ -123,6 +126,9 @@ const MultiTemplate: StoryFn<typeof TextField> = (args) => (
|
|
|
123
126
|
<TableCell>
|
|
124
127
|
<TextField {...args} multiline focused />
|
|
125
128
|
</TableCell>
|
|
129
|
+
<TableCell>
|
|
130
|
+
<TextField {...args} multiline error focused />
|
|
131
|
+
</TableCell>
|
|
126
132
|
<TableCell>
|
|
127
133
|
<TextField {...args} multiline disabled />
|
|
128
134
|
</TableCell>
|
|
@@ -99,6 +99,9 @@ const SingleTemplate: StoryFn<typeof TextField> = (args) => (
|
|
|
99
99
|
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
100
100
|
Focused
|
|
101
101
|
</TableCell>
|
|
102
|
+
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
103
|
+
Error Focused
|
|
104
|
+
</TableCell>
|
|
102
105
|
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
103
106
|
Disabled
|
|
104
107
|
</TableCell>
|
|
@@ -115,6 +118,9 @@ const SingleTemplate: StoryFn<typeof TextField> = (args) => (
|
|
|
115
118
|
<TableCell>
|
|
116
119
|
<TextField {...args} focused />
|
|
117
120
|
</TableCell>
|
|
121
|
+
<TableCell>
|
|
122
|
+
<TextField {...args} error focused />
|
|
123
|
+
</TableCell>
|
|
118
124
|
<TableCell>
|
|
119
125
|
<TextField {...args} disabled />
|
|
120
126
|
</TableCell>
|
|
@@ -137,6 +143,9 @@ const SingleWithIconTemplate: StoryFn<typeof TextField> = (args) => (
|
|
|
137
143
|
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
138
144
|
focused
|
|
139
145
|
</TableCell>
|
|
146
|
+
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
147
|
+
Error focused
|
|
148
|
+
</TableCell>
|
|
140
149
|
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
141
150
|
Disabled
|
|
142
151
|
</TableCell>
|
|
@@ -156,6 +165,9 @@ const SingleWithIconTemplate: StoryFn<typeof TextField> = (args) => (
|
|
|
156
165
|
<TableCell>
|
|
157
166
|
<TextField {...args} focused leftIcon={<Bell />} />
|
|
158
167
|
</TableCell>
|
|
168
|
+
<TableCell>
|
|
169
|
+
<TextField {...args} error focused leftIcon={<Bell />} />
|
|
170
|
+
</TableCell>
|
|
159
171
|
<TableCell>
|
|
160
172
|
<TextField {...args} disabled leftIcon={<Bell />} />
|
|
161
173
|
</TableCell>
|
|
@@ -173,6 +185,9 @@ const SingleWithIconTemplate: StoryFn<typeof TextField> = (args) => (
|
|
|
173
185
|
<TableCell>
|
|
174
186
|
<TextField {...args} focused rightIcon={<Bell />} />
|
|
175
187
|
</TableCell>
|
|
188
|
+
<TableCell>
|
|
189
|
+
<TextField {...args} error focused rightIcon={<Bell />} />
|
|
190
|
+
</TableCell>
|
|
176
191
|
<TableCell>
|
|
177
192
|
<TextField {...args} disabled rightIcon={<Bell />} />
|
|
178
193
|
</TableCell>
|
|
@@ -195,6 +210,15 @@ const SingleWithIconTemplate: StoryFn<typeof TextField> = (args) => (
|
|
|
195
210
|
rightIcon={<Bell />}
|
|
196
211
|
/>
|
|
197
212
|
</TableCell>
|
|
213
|
+
<TableCell>
|
|
214
|
+
<TextField
|
|
215
|
+
{...args}
|
|
216
|
+
error
|
|
217
|
+
focused
|
|
218
|
+
leftIcon={<Bell />}
|
|
219
|
+
rightIcon={<Bell />}
|
|
220
|
+
/>
|
|
221
|
+
</TableCell>
|
|
198
222
|
<TableCell>
|
|
199
223
|
<TextField
|
|
200
224
|
{...args}
|
|
@@ -18,7 +18,7 @@ export const TypographyItem = styled(Box)({
|
|
|
18
18
|
|
|
19
19
|
export const TypographyTitle = styled(Typography)(({ theme }) => ({
|
|
20
20
|
width: 200,
|
|
21
|
-
color: theme.palette.
|
|
21
|
+
color: theme.palette.lunit_token.core.text_light,
|
|
22
22
|
}));
|
|
23
23
|
|
|
24
24
|
export const TypographyDummy = styled(Typography)({
|
|
@@ -18,7 +18,7 @@ const BaseColors = () => {
|
|
|
18
18
|
return (
|
|
19
19
|
<Container>
|
|
20
20
|
{map(
|
|
21
|
-
theme.palette.
|
|
21
|
+
theme.palette.lunit_global,
|
|
22
22
|
(colors: BaseColor | GreyColor, paletteKey: string) => (
|
|
23
23
|
<div key={paletteKey}>
|
|
24
24
|
<Typography
|
|
@@ -34,8 +34,8 @@ const BaseColors = () => {
|
|
|
34
34
|
{map(colors, (_: string, colorKey: string) => (
|
|
35
35
|
<ColorContainer key={colorKey}>
|
|
36
36
|
<Color
|
|
37
|
-
color={`
|
|
38
|
-
bgcolor={`
|
|
37
|
+
color={`lunit_global.${paletteKey}.${colorKey}.contrastText`}
|
|
38
|
+
bgcolor={`lunit_global.${paletteKey}.${colorKey}.main`}
|
|
39
39
|
>
|
|
40
40
|
<Typography variant="h4">T</Typography>
|
|
41
41
|
</Color>
|
|
@@ -5,13 +5,13 @@ import { Box, styled, TextField, Typography, useTheme } from "@mui/material";
|
|
|
5
5
|
export const InComponentWithStyled = () => {
|
|
6
6
|
const StyledTextField = styled(TextField)(({ theme }) => ({
|
|
7
7
|
"& .MuiInputBase-root": {
|
|
8
|
-
backgroundColor: theme.palette.
|
|
9
|
-
color: theme.palette.
|
|
8
|
+
backgroundColor: theme.palette.lunit_token.component.textfield_bg,
|
|
9
|
+
color: theme.palette.lunit_token.core.text_normal,
|
|
10
10
|
"& .MuiInputBase-input": {
|
|
11
11
|
padding: "8px 16px",
|
|
12
12
|
},
|
|
13
13
|
"&.Mui-focused fieldset": {
|
|
14
|
-
borderColor: theme.palette.
|
|
14
|
+
borderColor: theme.palette.lunit_token.core.focused,
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
}));
|
|
@@ -49,13 +49,13 @@ export const InComponentWithSx = () => {
|
|
|
49
49
|
sx={{
|
|
50
50
|
"& .MuiInputBase-root": {
|
|
51
51
|
backgroundColor: (theme) =>
|
|
52
|
-
theme.palette.
|
|
53
|
-
color: (theme) => theme.palette.
|
|
52
|
+
theme.palette.lunit_token.component.textfield_bg,
|
|
53
|
+
color: (theme) => theme.palette.lunit_token.core.text_normal,
|
|
54
54
|
"& .MuiInputBase-input": {
|
|
55
55
|
padding: "8px 16px",
|
|
56
56
|
},
|
|
57
57
|
"&.Mui-focused fieldset": {
|
|
58
|
-
borderColor: (theme) => theme.palette.
|
|
58
|
+
borderColor: (theme) => theme.palette.lunit_token.core.focused,
|
|
59
59
|
},
|
|
60
60
|
},
|
|
61
61
|
}}
|
|
@@ -65,10 +65,11 @@ export const InComponentWithSx = () => {
|
|
|
65
65
|
<Box
|
|
66
66
|
sx={{
|
|
67
67
|
backgroundColor: (theme) =>
|
|
68
|
-
theme.palette.
|
|
69
|
-
color: (theme) =>
|
|
68
|
+
theme.palette.lunit_token.component.alert_info_bg,
|
|
69
|
+
color: (theme) =>
|
|
70
|
+
theme.palette.lunit_token.component.alert_info_border,
|
|
70
71
|
boxShadow: (theme) =>
|
|
71
|
-
`20px -10px 5px ${theme.palette.
|
|
72
|
+
`20px -10px 5px ${theme.palette.lunit_token.core.shadow_01}`,
|
|
72
73
|
width: 300,
|
|
73
74
|
height: 80,
|
|
74
75
|
}}
|
|
@@ -83,13 +84,13 @@ export const InComponentWithSx = () => {
|
|
|
83
84
|
sx={{
|
|
84
85
|
"& .MuiInputBase-root": {
|
|
85
86
|
backgroundColor: (theme) =>
|
|
86
|
-
theme.palette.
|
|
87
|
-
color: (theme) => theme.palette.
|
|
87
|
+
theme.palette.lunit_token.component.textfield_bg,
|
|
88
|
+
color: (theme) => theme.palette.lunit_token.core.text_normal,
|
|
88
89
|
"& .MuiInputBase-input": {
|
|
89
90
|
padding: "8px 16px",
|
|
90
91
|
},
|
|
91
92
|
"&.Mui-focused fieldset": {
|
|
92
|
-
borderColor: (theme) => theme.palette.
|
|
93
|
+
borderColor: (theme) => theme.palette.lunit_token.core.focused,
|
|
93
94
|
},
|
|
94
95
|
},
|
|
95
96
|
}}
|
|
@@ -99,10 +100,11 @@ export const InComponentWithSx = () => {
|
|
|
99
100
|
<Box
|
|
100
101
|
sx={{
|
|
101
102
|
backgroundColor: (theme) =>
|
|
102
|
-
theme.palette.
|
|
103
|
-
color: (theme) =>
|
|
103
|
+
theme.palette.lunit_token.component.alert_info_bg,
|
|
104
|
+
color: (theme) =>
|
|
105
|
+
theme.palette.lunit_token.component.alert_info_border,
|
|
104
106
|
boxShadow: (theme) =>
|
|
105
|
-
`20px -10px 5px ${theme.palette.
|
|
107
|
+
`20px -10px 5px ${theme.palette.lunit_token.core.shadow_01}`,
|
|
106
108
|
width: 300,
|
|
107
109
|
height: 80,
|
|
108
110
|
}}
|
|
@@ -124,7 +126,7 @@ export const InComponentWithInlineStyle = () => {
|
|
|
124
126
|
<TextField
|
|
125
127
|
placeholder="Inline Styled Text Field"
|
|
126
128
|
style={{
|
|
127
|
-
backgroundColor: theme.palette.
|
|
129
|
+
backgroundColor: theme.palette.lunit_token.component.textfield_bg,
|
|
128
130
|
}}
|
|
129
131
|
/>
|
|
130
132
|
</BaseBox>
|
|
@@ -132,7 +134,7 @@ export const InComponentWithInlineStyle = () => {
|
|
|
132
134
|
<TextField
|
|
133
135
|
placeholder="Inline Styled Text Field"
|
|
134
136
|
style={{
|
|
135
|
-
backgroundColor: theme.palette.
|
|
137
|
+
backgroundColor: theme.palette.lunit_token.component.textfield_bg,
|
|
136
138
|
}}
|
|
137
139
|
/>
|
|
138
140
|
</BaseBox>
|
|
@@ -151,13 +153,13 @@ const BaseBox = ({ theme, children }: BaseBoxProps) => {
|
|
|
151
153
|
className={theme === "light" ? "light1" : "dark1"}
|
|
152
154
|
width={500}
|
|
153
155
|
height={200}
|
|
154
|
-
bgcolor={
|
|
156
|
+
bgcolor={(sxTheme) => sxTheme.palette.lunit_token.core.bg_01}
|
|
155
157
|
border="1px solid"
|
|
156
158
|
p={2}
|
|
157
159
|
>
|
|
158
160
|
<Typography
|
|
159
161
|
variant="body1_16_semibold"
|
|
160
|
-
color={(
|
|
162
|
+
color={(sxTheme) => sxTheme.palette.lunit_token.core.text_normal}
|
|
161
163
|
>
|
|
162
164
|
{theme === "light" ? "= light1 =" : "= dark1 ="}
|
|
163
165
|
</Typography>
|
|
@@ -25,7 +25,9 @@ const TokenPaletteTable = ({ kind }: TokenPaletteTableProps) => {
|
|
|
25
25
|
const theme = useTheme();
|
|
26
26
|
|
|
27
27
|
const colorTokenMap = Object.entries(
|
|
28
|
-
kind === "core"
|
|
28
|
+
kind === "core"
|
|
29
|
+
? theme.palette.lunit_token.core
|
|
30
|
+
: theme.palette.lunit_token.component
|
|
29
31
|
);
|
|
30
32
|
|
|
31
33
|
const TokenPaletteCell = (props: {
|
|
@@ -43,8 +45,8 @@ const TokenPaletteTable = ({ kind }: TokenPaletteTableProps) => {
|
|
|
43
45
|
|
|
44
46
|
const boxColorByToken =
|
|
45
47
|
kind === "core"
|
|
46
|
-
? theme.palette.
|
|
47
|
-
: theme.palette.
|
|
48
|
+
? theme.palette.lunit_token.core[paletteKey as keyof ColorToken["core"]]
|
|
49
|
+
: theme.palette.lunit_token.component[
|
|
48
50
|
paletteKey as keyof ColorToken["component"]
|
|
49
51
|
];
|
|
50
52
|
|
|
@@ -57,7 +59,7 @@ const TokenPaletteTable = ({ kind }: TokenPaletteTableProps) => {
|
|
|
57
59
|
<TableCell
|
|
58
60
|
className={surface}
|
|
59
61
|
sx={{
|
|
60
|
-
background: theme.palette.
|
|
62
|
+
background: theme.palette.lunit_token.core.bg_01,
|
|
61
63
|
padding: 0,
|
|
62
64
|
}}
|
|
63
65
|
>
|
|
@@ -33,7 +33,7 @@ export const Color = styled(Box)({
|
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
export const StyledTypography = styled(Typography)(({ theme }) => ({
|
|
36
|
-
color: theme.palette.
|
|
36
|
+
color: theme.palette.lunit_token.core.text_normal,
|
|
37
37
|
marginLeft: 8,
|
|
38
38
|
fontSize: "12px",
|
|
39
39
|
}));
|