@lunit/design-system 1.0.0 → 2.0.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/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/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/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.styled.js +1 -1
- 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/Dialog/Dialog.js +57 -0
- package/dist/components/Dialog/Dialog.js.map +1 -0
- package/dist/components/Dialog/Dialog.styled.js +146 -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/ToggleButton/ToggleButton.styled.js +1 -1
- 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 +0 -6
- package/dist/foundation/Typography/index.js.map +1 -1
- package/dist/foundation/Typography/tokens.js +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 +5 -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/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 +8 -8
- package/dist/types/components/Chip/Chip.styled.d.ts +12 -12
- 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/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 +1 -7
- 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 +5 -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 +5 -0
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/Button/Button.styled.ts +1 -1
- package/src/components/Checkbox/Checkbox.tsx +39 -22
- package/src/components/Dialog/Dialog.styled.ts +172 -0
- package/src/components/Dialog/Dialog.tsx +189 -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/ToggleButton/ToggleButton.styled.ts +1 -1
- package/src/foundation/Elevation/index.ts +1 -1
- package/src/foundation/Typography/index.ts +0 -6
- package/src/foundation/Typography/tokens.ts +1 -1
- package/src/foundation/colors/base/grey.ts +3 -1
- package/src/foundation/colors/index.ts +5 -6
- package/src/foundation/colors/token/component.ts +26 -110
- 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/index.ts +1 -1
- package/src/stories/GettingStarted.mdx +88 -0
- package/src/stories/components/Button/BasicButton.stories.tsx +80 -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 +41 -35
- package/src/stories/components/Button/Kind.stories.tsx +13 -52
- 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 +65 -0
- package/src/stories/components/Chip/ChipDocs.mdx +132 -0
- package/src/stories/components/Dialog/Dialog.stories.tsx +320 -0
- package/src/stories/components/Dialog/DialogDocs.mdx +181 -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
|
@@ -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: {
|
|
@@ -114,6 +108,7 @@ declare const paletteOptions: {
|
|
|
114
108
|
bg_01: string;
|
|
115
109
|
bg_02: string;
|
|
116
110
|
bg_03: string;
|
|
111
|
+
layer_01: string;
|
|
117
112
|
text_primary: string;
|
|
118
113
|
text_normal: string;
|
|
119
114
|
text_medium: string;
|
|
@@ -136,6 +131,8 @@ declare const paletteOptions: {
|
|
|
136
131
|
shadow_02: string;
|
|
137
132
|
shadow_03: string;
|
|
138
133
|
shadow_04: string;
|
|
134
|
+
border_light: string;
|
|
135
|
+
border_medium: string;
|
|
139
136
|
};
|
|
140
137
|
component: {
|
|
141
138
|
btn_primary_bg: string;
|
|
@@ -151,6 +148,8 @@ declare const paletteOptions: {
|
|
|
151
148
|
btn_selected_primary_text: string;
|
|
152
149
|
btn_selected_secondary_bg: string;
|
|
153
150
|
btn_selected_secondary_text: string;
|
|
151
|
+
btn_selected_tertiary_bg: string;
|
|
152
|
+
btn_selected_tertiary_text: string;
|
|
154
153
|
selectcontrol_on: string;
|
|
155
154
|
selectcontrol_off: string;
|
|
156
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 {};
|
|
@@ -59,6 +59,7 @@ export declare const palette: {
|
|
|
59
59
|
bg_01: string;
|
|
60
60
|
bg_02: string;
|
|
61
61
|
bg_03: string;
|
|
62
|
+
layer_01: string;
|
|
62
63
|
text_primary: string;
|
|
63
64
|
text_normal: string;
|
|
64
65
|
text_medium: string;
|
|
@@ -81,6 +82,8 @@ export declare const palette: {
|
|
|
81
82
|
shadow_02: string;
|
|
82
83
|
shadow_03: string;
|
|
83
84
|
shadow_04: string;
|
|
85
|
+
border_light: string;
|
|
86
|
+
border_medium: string;
|
|
84
87
|
};
|
|
85
88
|
component: {
|
|
86
89
|
btn_primary_bg: string;
|
|
@@ -96,6 +99,8 @@ export declare const palette: {
|
|
|
96
99
|
btn_selected_primary_text: string;
|
|
97
100
|
btn_selected_secondary_bg: string;
|
|
98
101
|
btn_selected_secondary_text: string;
|
|
102
|
+
btn_selected_tertiary_bg: string;
|
|
103
|
+
btn_selected_tertiary_text: string;
|
|
99
104
|
selectcontrol_on: string;
|
|
100
105
|
selectcontrol_off: string;
|
|
101
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: "''",
|
|
@@ -6,7 +6,7 @@ import type { CheckboxProps } from "@mui/material";
|
|
|
6
6
|
const CustomCheckbox = styled(MuiCheckbox)(({ theme }) => ({
|
|
7
7
|
width: 20,
|
|
8
8
|
height: 20,
|
|
9
|
-
padding:
|
|
9
|
+
padding: 0,
|
|
10
10
|
"&.Mui-disabled": {
|
|
11
11
|
opacity: 0.38,
|
|
12
12
|
},
|
|
@@ -27,30 +27,47 @@ const iconSize = {
|
|
|
27
27
|
|
|
28
28
|
const DefaultIcon = styled("span")(({ theme }) => ({
|
|
29
29
|
...iconSize,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath" +
|
|
33
|
-
" fill-rule='evenodd' clip-rule='evenodd' d='M14 1.5H4C2.61929 1.5 1.5 2.61929 1.5 4V14C1.5 15.3807 2.61929 16.5 4 16.5H14C15.3807 " +
|
|
34
|
-
"16.5 16.5 15.3807 16.5 14V4C16.5 2.61929 15.3807 1.5 14 1.5ZM4 0C1.79086 0 0 1.79086 0 4V14C0 16.2091 1.79086 18 4 18H14C16.2091 18 18 16.2091 18 14V4C18 1.79086 16.2091 0 14 0H4Z' /%3E%3C/svg%3E\")",
|
|
30
|
+
borderRadius: "20%",
|
|
31
|
+
boxShadow: `inset 0 0 0 1.5px ${theme.palette.lunit_token.component.selectcontrol_off}`,
|
|
35
32
|
}));
|
|
36
33
|
|
|
37
|
-
const CheckedIcon =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
34
|
+
const CheckedIcon = () => {
|
|
35
|
+
return (
|
|
36
|
+
<svg
|
|
37
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
38
|
+
width="20"
|
|
39
|
+
height="20"
|
|
40
|
+
viewBox="0 0 20 20"
|
|
41
|
+
fill="none"
|
|
42
|
+
>
|
|
43
|
+
<path
|
|
44
|
+
fill-rule="evenodd"
|
|
45
|
+
clip-rule="evenodd"
|
|
46
|
+
d="M5 1C2.79086 1 1 2.79086 1 5V15C1 17.2091 2.79086 19 5 19H15C17.2091 19 19 17.2091 19 15V5C19 2.79086 17.2091 1 15 1H5ZM15.2516 8.14413C15.6074 7.72168 15.5533 7.09083 15.1309 6.73508C14.7084 6.37933 14.0776 6.43341 13.7218 6.85586L9.31824 12.0851L6.14993 9.37556C5.7302 9.01661 5.09895 9.06588 4.74 9.48561C4.38105 9.90533 4.43032 10.5366 4.85005 10.8955L8.78416 14.26C8.98672 14.4332 9.25006 14.5184 9.51571 14.4967C9.78135 14.4749 10.0273 14.348 10.199 14.1441L15.2516 8.14413Z"
|
|
47
|
+
fill="#00C9EA"
|
|
48
|
+
/>
|
|
49
|
+
</svg>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
45
52
|
|
|
46
|
-
const IndeterminateIcon =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
const IndeterminateIcon = () => {
|
|
54
|
+
return (
|
|
55
|
+
<svg
|
|
56
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
57
|
+
width="20"
|
|
58
|
+
height="20"
|
|
59
|
+
viewBox="0 0 20 20"
|
|
60
|
+
fill="none"
|
|
61
|
+
>
|
|
62
|
+
<path
|
|
63
|
+
fill-rule="evenodd"
|
|
64
|
+
clip-rule="evenodd"
|
|
65
|
+
d="M5 1C2.79086 1 1 2.79086 1 5V15C1 17.2091 2.79086 19 5 19H15C17.2091 19 19 17.2091 19 15V5C19 2.79086 17.2091 1 15 1H5ZM5 9C4.44772 9 4 9.44771 4 10C4 10.5523 4.44771 11 5 11L15 11C15.5523 11 16 10.5523 16 10C16 9.44772 15.5523 9 15 9L5 9Z"
|
|
66
|
+
fill="#00C9EA"
|
|
67
|
+
/>
|
|
68
|
+
</svg>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
54
71
|
|
|
55
72
|
const Checkbox = (props: CheckboxProps) => {
|
|
56
73
|
return (
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { styled } from "@mui/material/styles";
|
|
2
|
+
|
|
3
|
+
import type { DialogBase } from "./Dialog";
|
|
4
|
+
import type { CSSObject } from "@mui/material/styles";
|
|
5
|
+
|
|
6
|
+
export interface DialogElementStyle {
|
|
7
|
+
[key: string]: CSSObject;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type DialogStyle = Pick<DialogBase, "size" | "type" | "nonModal">;
|
|
11
|
+
|
|
12
|
+
const DIALOG_WRAPPER_STYLE: DialogElementStyle = {
|
|
13
|
+
small: {
|
|
14
|
+
width: "320px",
|
|
15
|
+
maxWidth: "320px",
|
|
16
|
+
},
|
|
17
|
+
medium: {
|
|
18
|
+
width: "500px",
|
|
19
|
+
maxWidth: "840px",
|
|
20
|
+
},
|
|
21
|
+
modal: {
|
|
22
|
+
position: "relative",
|
|
23
|
+
},
|
|
24
|
+
nonModal: {
|
|
25
|
+
position: "fixed",
|
|
26
|
+
top: "30px",
|
|
27
|
+
right: "30px",
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const DIALOG_TITLE_STYLE: DialogElementStyle = {
|
|
32
|
+
small: {
|
|
33
|
+
display: "flex",
|
|
34
|
+
alignItems: "center",
|
|
35
|
+
height: "52px",
|
|
36
|
+
maxHeight: "100%",
|
|
37
|
+
padding: "20px 20px 4px 20px", // Title's X button pluses 2px to paddingTop and Bottom
|
|
38
|
+
},
|
|
39
|
+
medium: {
|
|
40
|
+
display: "flex",
|
|
41
|
+
alignItems: "center",
|
|
42
|
+
height: "64px",
|
|
43
|
+
maxHeight: "100%",
|
|
44
|
+
padding: "30px 32px 6px 32px", // Title's X button pluses 2px to paddingTop and Bottom
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const DIALOG_CONTENT_STYLE: DialogElementStyle = {
|
|
49
|
+
small: {
|
|
50
|
+
paddingInline: "20px calc(20px - 10px)",
|
|
51
|
+
paddingTop: "8px",
|
|
52
|
+
paddingBottom: "28px",
|
|
53
|
+
},
|
|
54
|
+
smallAction: {
|
|
55
|
+
paddingInline: "20px calc(20px - 10px)",
|
|
56
|
+
paddingBlock: "8px",
|
|
57
|
+
},
|
|
58
|
+
medium: {
|
|
59
|
+
paddingInline: "32px calc(32px - 14px)",
|
|
60
|
+
paddingTop: "16px",
|
|
61
|
+
paddingBottom: "32px",
|
|
62
|
+
},
|
|
63
|
+
mediumAction: {
|
|
64
|
+
paddingInline: "32px calc(32px - 14px)",
|
|
65
|
+
paddingBlock: "16px",
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const DIALOG_ACTION_STYLE: DialogElementStyle = {
|
|
70
|
+
small: {
|
|
71
|
+
height: "64px",
|
|
72
|
+
padding: "8px 20px 20px 20px",
|
|
73
|
+
},
|
|
74
|
+
medium: {
|
|
75
|
+
height: "84px",
|
|
76
|
+
padding: "16px 32px 32px 32px",
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export const StyledBackdrop = styled("div")({
|
|
81
|
+
position: "fixed",
|
|
82
|
+
top: 0,
|
|
83
|
+
left: 0,
|
|
84
|
+
width: "100%",
|
|
85
|
+
height: "100%",
|
|
86
|
+
backgroundColor: "rgba(17, 17, 19, 0.7)",
|
|
87
|
+
zIndex: 1000,
|
|
88
|
+
display: "grid",
|
|
89
|
+
placeItems: "center",
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
export const StyledDialog = styled("div")<DialogStyle>(
|
|
93
|
+
({ theme, size, nonModal, type }) => ({
|
|
94
|
+
zIndex: 1001,
|
|
95
|
+
maxHeight: "80vh",
|
|
96
|
+
display: "flex",
|
|
97
|
+
flexDirection: "column",
|
|
98
|
+
boxSizing: "border-box",
|
|
99
|
+
borderRadius: "10px",
|
|
100
|
+
backgroundColor: theme.palette.lunit_token.core.bg_03,
|
|
101
|
+
color: theme.palette.lunit_token.core.text_normal,
|
|
102
|
+
|
|
103
|
+
...DIALOG_WRAPPER_STYLE[size === "small" ? "small" : "medium"],
|
|
104
|
+
...DIALOG_WRAPPER_STYLE[nonModal ? "nonModal" : "modal"],
|
|
105
|
+
|
|
106
|
+
"& #dialog-title": {
|
|
107
|
+
...DIALOG_TITLE_STYLE[size === "small" ? "small" : "medium"],
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
"& #dialog-content": {
|
|
111
|
+
...DIALOG_CONTENT_STYLE[
|
|
112
|
+
size === "small" && type !== "passive"
|
|
113
|
+
? "smallAction"
|
|
114
|
+
: size === "small"
|
|
115
|
+
? "small"
|
|
116
|
+
: size === "medium" && type !== "passive"
|
|
117
|
+
? "mediumAction"
|
|
118
|
+
: "medium"
|
|
119
|
+
],
|
|
120
|
+
|
|
121
|
+
scrollbarGutter: "stable",
|
|
122
|
+
"::-webkit-scrollbar": {
|
|
123
|
+
width: size === "small" ? "10px" : "14px",
|
|
124
|
+
},
|
|
125
|
+
"::webkit-scrollbar-track": {
|
|
126
|
+
background: "transparent",
|
|
127
|
+
},
|
|
128
|
+
"::-webkit-scrollbar-thumb": {
|
|
129
|
+
backgroundClip: "padding-box",
|
|
130
|
+
border: `2px solid transparent`,
|
|
131
|
+
/**
|
|
132
|
+
* Figma's border-radius is 6px, but actual border radius is 10px since padding 2px is added.
|
|
133
|
+
*/
|
|
134
|
+
borderRadius: "10px",
|
|
135
|
+
backgroundColor: theme.palette.lunit_token.component.scrollbars_bg,
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
|
|
139
|
+
"& #dialog-action": {
|
|
140
|
+
...DIALOG_ACTION_STYLE[size === "small" ? "small" : "medium"],
|
|
141
|
+
},
|
|
142
|
+
})
|
|
143
|
+
);
|
|
144
|
+
|
|
145
|
+
export const StyledDialogTitle = styled("header")({
|
|
146
|
+
display: "flex",
|
|
147
|
+
width: "100%",
|
|
148
|
+
flex: "0 0 auto",
|
|
149
|
+
alignItems: "center",
|
|
150
|
+
justifyContent: "flex-start",
|
|
151
|
+
gap: "8px",
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
export const StyledDialogTitleIconWrapper = styled("div")({
|
|
155
|
+
display: "flex",
|
|
156
|
+
justifyContent: "center",
|
|
157
|
+
width: "20px",
|
|
158
|
+
height: "20px",
|
|
159
|
+
"& .MuiSvgIcon-root": {
|
|
160
|
+
display: "flex",
|
|
161
|
+
justifyContent: "center",
|
|
162
|
+
width: "20px",
|
|
163
|
+
height: "20px",
|
|
164
|
+
fontSize: "20px",
|
|
165
|
+
},
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
export const StyledDialogContent = styled("div")(({ theme }) => ({
|
|
169
|
+
...theme.typography.body2_14_regular,
|
|
170
|
+
flex: "1 1 auto",
|
|
171
|
+
overflowY: "scroll",
|
|
172
|
+
}));
|