@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.
Files changed (110) hide show
  1. package/dist/cjs/components/Alert/index.js +1 -1
  2. package/dist/cjs/components/Alert/index.js.map +1 -1
  3. package/dist/cjs/components/Button/index.js +1 -1
  4. package/dist/cjs/components/Button/index.js.map +1 -1
  5. package/dist/cjs/components/Checkbox/index.js +1 -1
  6. package/dist/cjs/components/Checkbox/index.js.map +1 -1
  7. package/dist/cjs/components/Dialog/index.js +2 -0
  8. package/dist/cjs/components/Dialog/index.js.map +1 -0
  9. package/dist/cjs/components/Radio/index.js +1 -1
  10. package/dist/cjs/components/Radio/index.js.map +1 -1
  11. package/dist/cjs/components/ToggleButton/index.js +1 -1
  12. package/dist/cjs/components/ToggleButton/index.js.map +1 -1
  13. package/dist/cjs/index.js +1 -1
  14. package/dist/cjs/index.js.map +1 -1
  15. package/dist/components/Button/Button.styled.js +1 -1
  16. package/dist/components/Button/Button.styled.js.map +1 -1
  17. package/dist/components/Checkbox/Checkbox.js +9 -19
  18. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  19. package/dist/components/Dialog/Dialog.js +57 -0
  20. package/dist/components/Dialog/Dialog.js.map +1 -0
  21. package/dist/components/Dialog/Dialog.styled.js +146 -0
  22. package/dist/components/Dialog/Dialog.styled.js.map +1 -0
  23. package/dist/components/Dialog/components/DialogAction.js +18 -0
  24. package/dist/components/Dialog/components/DialogAction.js.map +1 -0
  25. package/dist/components/Dialog/index.js +2 -0
  26. package/dist/components/Dialog/index.js.map +1 -0
  27. package/dist/components/Radio/Radio.js +7 -21
  28. package/dist/components/Radio/Radio.js.map +1 -1
  29. package/dist/components/ToggleButton/ToggleButton.styled.js +1 -1
  30. package/dist/components/ToggleButton/ToggleButton.styled.js.map +1 -1
  31. package/dist/foundation/Elevation/index.js +1 -1
  32. package/dist/foundation/Elevation/index.js.map +1 -1
  33. package/dist/foundation/Typography/index.js +0 -6
  34. package/dist/foundation/Typography/index.js.map +1 -1
  35. package/dist/foundation/Typography/tokens.js +1 -1
  36. package/dist/foundation/colors/base/grey.js +3 -1
  37. package/dist/foundation/colors/base/grey.js.map +1 -1
  38. package/dist/foundation/colors/index.js +5 -6
  39. package/dist/foundation/colors/index.js.map +1 -1
  40. package/dist/foundation/colors/token/component.js +31 -115
  41. package/dist/foundation/colors/token/component.js.map +1 -1
  42. package/dist/foundation/colors/token/core.js +43 -75
  43. package/dist/foundation/colors/token/core.js.map +1 -1
  44. package/dist/index.js +1 -1
  45. package/dist/index.js.map +1 -1
  46. package/dist/types/components/Alert/Alert.utils.d.ts +3 -3
  47. package/dist/types/components/Button/Button.styled.d.ts +8 -8
  48. package/dist/types/components/Chip/Chip.styled.d.ts +12 -12
  49. package/dist/types/components/Dialog/Dialog.d.ts +50 -0
  50. package/dist/types/components/Dialog/Dialog.styled.d.ts +12 -0
  51. package/dist/types/components/Dialog/components/DialogAction.d.ts +8 -0
  52. package/dist/types/components/Dialog/index.d.ts +2 -0
  53. package/dist/types/components/Toast/Toast.utils.d.ts +1 -1
  54. package/dist/types/components/ToggleButton/ToggleButton.styled.d.ts +2 -2
  55. package/dist/types/foundation/Elevation/index.d.ts +1 -1
  56. package/dist/types/foundation/Typography/index.d.ts +1 -7
  57. package/dist/types/foundation/Typography/tokens.d.ts +1 -1
  58. package/dist/types/foundation/colors/base/grey.d.ts +2 -0
  59. package/dist/types/foundation/colors/index.d.ts +5 -6
  60. package/dist/types/foundation/colors/token/types.d.ts +0 -2
  61. package/dist/types/foundation/colors/types.d.ts +78 -76
  62. package/dist/types/foundation/index.d.ts +5 -0
  63. package/dist/types/index.d.ts +1 -1
  64. package/package.json +1 -1
  65. package/src/components/Button/Button.styled.ts +1 -1
  66. package/src/components/Checkbox/Checkbox.tsx +39 -22
  67. package/src/components/Dialog/Dialog.styled.ts +172 -0
  68. package/src/components/Dialog/Dialog.tsx +189 -0
  69. package/src/components/Dialog/components/DialogAction.tsx +36 -0
  70. package/src/components/Dialog/index.ts +14 -0
  71. package/src/components/Radio/Radio.tsx +37 -25
  72. package/src/components/ToggleButton/ToggleButton.styled.ts +1 -1
  73. package/src/foundation/Elevation/index.ts +1 -1
  74. package/src/foundation/Typography/index.ts +0 -6
  75. package/src/foundation/Typography/tokens.ts +1 -1
  76. package/src/foundation/colors/base/grey.ts +3 -1
  77. package/src/foundation/colors/index.ts +5 -6
  78. package/src/foundation/colors/token/component.ts +26 -110
  79. package/src/foundation/colors/token/core.ts +39 -71
  80. package/src/foundation/colors/token/types.ts +0 -2
  81. package/src/foundation/colors/types.ts +78 -75
  82. package/src/index.ts +1 -1
  83. package/src/stories/GettingStarted.mdx +88 -0
  84. package/src/stories/components/Button/BasicButton.stories.tsx +80 -52
  85. package/src/stories/components/Button/ButtonDocs.mdx +187 -0
  86. package/src/stories/components/Button/Color.stories.tsx +132 -0
  87. package/src/stories/components/Button/IconButton.stories.tsx +41 -35
  88. package/src/stories/components/Button/Kind.stories.tsx +13 -52
  89. package/src/stories/components/{SelectControl/Checkbox.stories.tsx → CheckBox/BasicCheckbox.stories.tsx} +84 -105
  90. package/src/stories/components/CheckBox/CheckboxDocs.mdx +85 -0
  91. package/src/stories/components/Chip/Chip.stories.tsx +65 -0
  92. package/src/stories/components/Chip/ChipDocs.mdx +132 -0
  93. package/src/stories/components/Dialog/Dialog.stories.tsx +320 -0
  94. package/src/stories/components/Dialog/DialogDocs.mdx +181 -0
  95. package/src/stories/components/TextField/BasicTextField.stories.tsx +214 -0
  96. package/src/stories/components/TextField/TextFieldDocs.mdx +140 -0
  97. package/src/stories/components/TextField/TextFieldSize.stories.tsx +26 -3
  98. package/src/stories/components/ToggleButton/Basic.stories.tsx +312 -0
  99. package/src/stories/components/ToggleButton/ToggleButtonDocs.mdx +180 -0
  100. package/src/stories/components/ToggleButton/ToggleButtonKind.stories.tsx +65 -0
  101. package/src/stories/components/ToggleButton/WithIcon.stories.tsx +138 -0
  102. package/src/stories/foundation/Typography/Typography.mdx +31 -46
  103. package/src/stories/foundation/Typography/Typography.stories.tsx +30 -1
  104. package/src/stories/foundation/colors/ColorSystem.tsx +86 -0
  105. package/src/stories/foundation/colors/Docs.mdx +225 -0
  106. package/src/stories/foundation/colors/TokenPaletteTable.tsx +1 -5
  107. package/src/components/Modal/Modal.tsx +0 -8
  108. package/src/components/Modal/index.ts +0 -1
  109. package/src/stories/components/Modal/Modal.stories.tsx +0 -15
  110. 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;
@@ -3,6 +3,4 @@ export interface ColorTokenValueBySurface {
3
3
  light2: string;
4
4
  dark1: string;
5
5
  dark2: string;
6
- dark3: string;
7
- dark4: string;
8
6
  }
@@ -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: CSSPropertyColor;
6
- bg_02: CSSPropertyColor;
7
- bg_03: CSSPropertyColor;
8
- text_primary: CSSPropertyColor;
9
- text_normal: CSSPropertyColor;
10
- text_medium: CSSPropertyColor;
11
- text_light: CSSPropertyColor;
12
- text_error: CSSPropertyColor;
13
- text_success: CSSPropertyColor;
14
- text_warning: CSSPropertyColor;
15
- text_info: CSSPropertyColor;
16
- link_primary: CSSPropertyColor;
17
- link_hover: CSSPropertyColor;
18
- link_visited: CSSPropertyColor;
19
- icon_error_02: CSSPropertyColor;
20
- icon_success_02: CSSPropertyColor;
21
- icon_warning_02: CSSPropertyColor;
22
- icon_info_02: CSSPropertyColor;
23
- hover: CSSPropertyColor;
24
- focused: CSSPropertyColor;
25
- selected: CSSPropertyColor;
26
- shadow_01: CSSPropertyColor;
27
- shadow_02: CSSPropertyColor;
28
- shadow_03: CSSPropertyColor;
29
- shadow_04: CSSPropertyColor;
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: CSSPropertyColor;
33
- btn_secondary_bg: CSSPropertyColor;
34
- btn_error_bg: CSSPropertyColor;
35
- btn_primary_border: CSSPropertyColor;
36
- btn_secondary_border: CSSPropertyColor;
37
- btn_primary_text_1: CSSPropertyColor;
38
- btn_primary_text_2: CSSPropertyColor;
39
- btn_secondary_text: CSSPropertyColor;
40
- btn_error_text: CSSPropertyColor;
41
- btn_selected_primary_bg: CSSPropertyColor;
42
- btn_selected_primary_text: CSSPropertyColor;
43
- btn_selected_secondary_bg: CSSPropertyColor;
44
- btn_selected_secondary_text: CSSPropertyColor;
45
- selectcontrol_on: CSSPropertyColor;
46
- selectcontrol_off: CSSPropertyColor;
47
- selectcontrol_handler: CSSPropertyColor;
48
- selectcontrol_handler_shadow: CSSPropertyColor;
49
- textfield_bg: CSSPropertyColor;
50
- textfield_border_error: CSSPropertyColor;
51
- dropdown_divider_border: CSSPropertyColor;
52
- datatable_border_01: CSSPropertyColor;
53
- datatable_border_02: CSSPropertyColor;
54
- datatable_zebra: CSSPropertyColor;
55
- scrollbars_bg: CSSPropertyColor;
56
- scrollbars_hover: CSSPropertyColor;
57
- scrollbars_pressed: CSSPropertyColor;
58
- modal_overlay: CSSPropertyColor;
59
- tooltip_bg: CSSPropertyColor;
60
- tooltip_text_normal: CSSPropertyColor;
61
- tooltip_text_medium: CSSPropertyColor;
62
- alert_error_bg: CSSPropertyColor;
63
- alert_error_border: CSSPropertyColor;
64
- alert_success_bg: CSSPropertyColor;
65
- alert_success_border: CSSPropertyColor;
66
- alert_info_bg: CSSPropertyColor;
67
- alert_info_border: CSSPropertyColor;
68
- alert_warning_bg: CSSPropertyColor;
69
- alert_warning_border: CSSPropertyColor;
70
- chip_primary_bg: CSSPropertyColor;
71
- chip_primary_text: CSSPropertyColor;
72
- chip_secondary_bg: CSSPropertyColor;
73
- chip_secondary_text: CSSPropertyColor;
74
- chip_error_bg: CSSPropertyColor;
75
- chip_error_text: CSSPropertyColor;
76
- chip_warning_bg: CSSPropertyColor;
77
- chip_warning_text: CSSPropertyColor;
78
- chip_success_bg: CSSPropertyColor;
79
- chip_success_text: CSSPropertyColor;
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;
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunit/design-system",
3
- "version": "1.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Lunit Design System",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/index.js",
@@ -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.component.btn_secondary_border}`,
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: 1,
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
- backgroundColor: theme.palette.lunit_token.component.selectcontrol_off,
31
- maskImage:
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 = styled("span")(({ theme }) => ({
38
- ...iconSize,
39
- backgroundColor: theme.palette.lunit_token.component.selectcontrol_on,
40
- maskImage:
41
- "url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath" +
42
- " fill-rule='evenodd' clip-rule='evenodd' d='M4 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 0H4ZM14.2516 " +
43
- "7.14413C14.6074 6.72168 14.5533 6.09083 14.1309 5.73508C13.7084 5.37933 13.0776 5.43341 12.7218 5.85586L8.31824 11.0851L5.14993 8.37556C4.7302 8.01661 4.09895 8.06588 3.74 8.48561C3.38105 8.90533 3.43032 9.53658 3.85005 9.89553L7.78416 13.26C7.98672 13.4332 8.25006 13.5184 8.51571 13.4967C8.78135 13.4749 9.02732 13.348 9.19901 13.1441L14.2516 7.14413Z' /%3E%3C/svg%3E\")",
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 = styled("span")(({ theme }) => ({
47
- ...iconSize,
48
- backgroundColor: theme.palette.lunit_token.component.selectcontrol_on,
49
- maskImage:
50
- "url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath" +
51
- " fill-rule='evenodd' clip-rule='evenodd' d='M4 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 " +
52
- "14 0H4ZM4 8C3.44772 8 3 8.44771 3 9C3 9.5523 3.44771 10 4 10H14C14.5523 10 15 9.5523 15 9C15 8.44772 14.5523 8 14 8H4Z' /%3E%3C/svg%3E\")",
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
+ }));