@lunit/design-system 1.0.0-b.4 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) 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/Chip/index.js +1 -1
  8. package/dist/cjs/components/Chip/index.js.map +1 -1
  9. package/dist/cjs/components/Dialog/index.js +2 -0
  10. package/dist/cjs/components/Dialog/index.js.map +1 -0
  11. package/dist/cjs/components/Radio/index.js +1 -1
  12. package/dist/cjs/components/Radio/index.js.map +1 -1
  13. package/dist/cjs/components/TextField/index.js +1 -1
  14. package/dist/cjs/components/TextField/index.js.map +1 -1
  15. package/dist/cjs/components/ToggleButton/index.js +1 -1
  16. package/dist/cjs/components/ToggleButton/index.js.map +1 -1
  17. package/dist/cjs/index.js +1 -1
  18. package/dist/cjs/index.js.map +1 -1
  19. package/dist/components/Button/Button.js +21 -3
  20. package/dist/components/Button/Button.js.map +1 -1
  21. package/dist/components/Button/Button.styled.js +3 -6
  22. package/dist/components/Button/Button.styled.js.map +1 -1
  23. package/dist/components/Checkbox/Checkbox.js +9 -19
  24. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  25. package/dist/components/Chip/Chip.js +6 -5
  26. package/dist/components/Chip/Chip.js.map +1 -1
  27. package/dist/components/Dialog/Dialog.js +61 -0
  28. package/dist/components/Dialog/Dialog.js.map +1 -0
  29. package/dist/components/Dialog/Dialog.styled.js +137 -0
  30. package/dist/components/Dialog/Dialog.styled.js.map +1 -0
  31. package/dist/components/Dialog/components/DialogAction.js +18 -0
  32. package/dist/components/Dialog/components/DialogAction.js.map +1 -0
  33. package/dist/components/Dialog/index.js +2 -0
  34. package/dist/components/Dialog/index.js.map +1 -0
  35. package/dist/components/Radio/Radio.js +7 -21
  36. package/dist/components/Radio/Radio.js.map +1 -1
  37. package/dist/components/TextField/TextField.js +4 -4
  38. package/dist/components/TextField/TextField.js.map +1 -1
  39. package/dist/components/ToggleButton/ToggleButton.styled.js +2 -3
  40. package/dist/components/ToggleButton/ToggleButton.styled.js.map +1 -1
  41. package/dist/foundation/Elevation/index.js +1 -1
  42. package/dist/foundation/Elevation/index.js.map +1 -1
  43. package/dist/foundation/Typography/index.js +12 -0
  44. package/dist/foundation/Typography/index.js.map +1 -1
  45. package/dist/foundation/Typography/tokens.js +1 -17
  46. package/dist/foundation/Typography/tokens.js.map +1 -1
  47. package/dist/foundation/colors/base/grey.js +3 -1
  48. package/dist/foundation/colors/base/grey.js.map +1 -1
  49. package/dist/foundation/colors/index.js +9 -6
  50. package/dist/foundation/colors/index.js.map +1 -1
  51. package/dist/foundation/colors/token/component.js +31 -115
  52. package/dist/foundation/colors/token/component.js.map +1 -1
  53. package/dist/foundation/colors/token/core.js +43 -75
  54. package/dist/foundation/colors/token/core.js.map +1 -1
  55. package/dist/foundation/index.js +1 -1
  56. package/dist/foundation/index.js.map +1 -1
  57. package/dist/index.js +1 -1
  58. package/dist/index.js.map +1 -1
  59. package/dist/types/components/Alert/Alert.utils.d.ts +3 -3
  60. package/dist/types/components/Button/Button.styled.d.ts +9 -12
  61. package/dist/types/components/Button/Button.types.d.ts +8 -5
  62. package/dist/types/components/Chip/Chip.styled.d.ts +12 -12
  63. package/dist/types/components/Chip/Chip.types.d.ts +7 -2
  64. package/dist/types/components/Dialog/Dialog.d.ts +50 -0
  65. package/dist/types/components/Dialog/Dialog.styled.d.ts +12 -0
  66. package/dist/types/components/Dialog/components/DialogAction.d.ts +8 -0
  67. package/dist/types/components/Dialog/index.d.ts +2 -0
  68. package/dist/types/components/TextField/TextField.types.d.ts +8 -3
  69. package/dist/types/components/Toast/Toast.utils.d.ts +1 -1
  70. package/dist/types/components/ToggleButton/ToggleButton.styled.d.ts +2 -2
  71. package/dist/types/foundation/Elevation/index.d.ts +1 -1
  72. package/dist/types/foundation/Typography/index.d.ts +13 -1
  73. package/dist/types/foundation/Typography/tokens.d.ts +1 -1
  74. package/dist/types/foundation/colors/base/grey.d.ts +2 -0
  75. package/dist/types/foundation/colors/index.d.ts +9 -6
  76. package/dist/types/foundation/colors/token/types.d.ts +0 -2
  77. package/dist/types/foundation/colors/types.d.ts +78 -76
  78. package/dist/types/foundation/index.d.ts +9 -0
  79. package/dist/types/index.d.ts +1 -1
  80. package/package.json +1 -1
  81. package/src/components/Button/Button.styled.ts +3 -6
  82. package/src/components/Button/Button.tsx +117 -42
  83. package/src/components/Button/Button.types.ts +8 -4
  84. package/src/components/Checkbox/Checkbox.tsx +39 -22
  85. package/src/components/Chip/Chip.tsx +15 -4
  86. package/src/components/Chip/Chip.types.ts +9 -2
  87. package/src/components/Dialog/Dialog.styled.ts +165 -0
  88. package/src/components/Dialog/Dialog.tsx +195 -0
  89. package/src/components/Dialog/components/DialogAction.tsx +36 -0
  90. package/src/components/Dialog/index.ts +14 -0
  91. package/src/components/Radio/Radio.tsx +37 -25
  92. package/src/components/TextField/TextField.tsx +10 -10
  93. package/src/components/TextField/TextField.types.ts +11 -4
  94. package/src/components/ToggleButton/ToggleButton.styled.ts +2 -3
  95. package/src/foundation/Elevation/index.ts +1 -1
  96. package/src/foundation/Typography/index.ts +12 -0
  97. package/src/foundation/Typography/tokens.ts +1 -17
  98. package/src/foundation/colors/base/grey.ts +3 -1
  99. package/src/foundation/colors/index.ts +9 -6
  100. package/src/foundation/colors/token/component.ts +24 -108
  101. package/src/foundation/colors/token/core.ts +39 -71
  102. package/src/foundation/colors/token/types.ts +0 -2
  103. package/src/foundation/colors/types.ts +78 -75
  104. package/src/foundation/index.ts +1 -1
  105. package/src/index.ts +1 -1
  106. package/src/stories/GettingStarted.mdx +88 -0
  107. package/src/stories/components/Button/BasicButton.stories.tsx +91 -52
  108. package/src/stories/components/Button/ButtonDocs.mdx +187 -0
  109. package/src/stories/components/Button/Color.stories.tsx +132 -0
  110. package/src/stories/components/Button/IconButton.stories.tsx +42 -25
  111. package/src/stories/components/Button/Kind.stories.tsx +75 -77
  112. package/src/stories/components/{SelectControl/Checkbox.stories.tsx → CheckBox/BasicCheckbox.stories.tsx} +84 -105
  113. package/src/stories/components/CheckBox/CheckboxDocs.mdx +85 -0
  114. package/src/stories/components/Chip/Chip.stories.tsx +80 -5
  115. package/src/stories/components/Chip/ChipDocs.mdx +132 -0
  116. package/src/stories/components/Dialog/Dialog.stories.tsx +320 -0
  117. package/src/stories/components/TextField/BasicTextField.stories.tsx +214 -0
  118. package/src/stories/components/TextField/TextFieldDocs.mdx +140 -0
  119. package/src/stories/components/TextField/TextFieldSize.stories.tsx +26 -3
  120. package/src/stories/components/ToggleButton/Basic.stories.tsx +312 -0
  121. package/src/stories/components/ToggleButton/ToggleButtonDocs.mdx +180 -0
  122. package/src/stories/components/ToggleButton/ToggleButtonKind.stories.tsx +65 -0
  123. package/src/stories/components/ToggleButton/WithIcon.stories.tsx +138 -0
  124. package/src/stories/foundation/Typography/Typography.mdx +31 -46
  125. package/src/stories/foundation/Typography/Typography.stories.tsx +30 -1
  126. package/src/stories/foundation/colors/ColorSystem.tsx +86 -0
  127. package/src/stories/foundation/colors/Docs.mdx +225 -0
  128. package/src/stories/foundation/colors/TokenPaletteTable.tsx +1 -5
  129. package/src/components/Modal/Modal.tsx +0 -8
  130. package/src/components/Modal/index.ts +0 -1
  131. package/src/stories/components/Modal/Modal.stories.tsx +0 -15
  132. package/src/stories/foundation/Typography/TypographyExamples.stories.tsx +0 -44
@@ -1,12 +1,17 @@
1
1
  /// <reference types="react" />
2
2
  import type { SxProps } from "@mui/material";
3
- import type { OutlinedTextFieldProps } from "@mui/material/TextField";
3
+ import type { TextFieldProps as MuiTextFieldProps, OutlinedTextFieldProps } from "@mui/material/TextField";
4
4
  export type TextFieldSize = "small" | "medium" | "large";
5
5
  export interface BaseTextFieldProps extends Omit<OutlinedTextFieldProps, "size" | "value" | "helperText" | "variant"> {
6
6
  /**
7
- * The design system TextField variable is outlined fixed.
7
+ * The design system TextField has only on kind, which is "contained"
8
+ Below are all return same kind "contained"
9
+ <TextField variant="outlined" />
10
+ <TextField variant="contained" />
11
+ <TextField variant="filled" />
12
+ <TextField variant="standard" />
8
13
  */
9
- variant?: "outlined";
14
+ variant?: MuiTextFieldProps["variant"];
10
15
  value?: string;
11
16
  helperText?: string;
12
17
  /**
@@ -1,2 +1,2 @@
1
1
  import type { AlertColor, Theme } from "@mui/material";
2
- export declare const getIconColor: (theme: Theme, severity: AlertColor | undefined) => import("csstype").Property.Color | undefined;
2
+ export declare const getIconColor: (theme: Theme, severity: AlertColor | undefined) => string;
@@ -6,7 +6,7 @@ type CustomToggleButtonProps = ToggleButtonProps & {
6
6
  export declare const CustomToggleButton: import("@emotion/styled").StyledComponent<{
7
7
  children?: import("react").ReactNode;
8
8
  classes?: Partial<import("@mui/material").ToggleButtonClasses> | undefined;
9
- color?: "success" | "info" | "warning" | "error" | "standard" | "primary" | "secondary" | undefined;
9
+ color?: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "standard" | undefined;
10
10
  disabled?: boolean | undefined;
11
11
  disableFocusRipple?: boolean | undefined;
12
12
  fullWidth?: boolean | undefined;
@@ -34,7 +34,7 @@ export declare const CustomToggleButton: import("@emotion/styled").StyledCompone
34
34
  touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
35
35
  }, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
36
36
  ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
37
- }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "tabIndex" | "color" | "onChange" | "onClick" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "fullWidth" | "size" | "value" | "selected"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & CustomToggleButtonProps, {}, {}>;
37
+ }, "color" | keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "tabIndex" | "onChange" | "onClick" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "value" | "disableFocusRipple" | "fullWidth" | "size" | "selected"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & CustomToggleButtonProps, {}, {}>;
38
38
  export declare const IconAndChildrenWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
39
39
  export declare const IconWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
40
40
  hasIconOnly: boolean;
@@ -19,7 +19,7 @@ export declare const elevationOptions: {
19
19
  shadow4: string;
20
20
  };
21
21
  export declare const createElevationCssBaseline: () => {
22
- ".light1, .light2, .dark1, .dark2, .dark3, .dark4": {
22
+ ".light1, .light2, .dark1, .dark2": {
23
23
  "--elevation-shadow": string;
24
24
  elevation_00: string;
25
25
  elevation_01: string;
@@ -72,7 +72,7 @@ export declare const createTypographyCssBaseline: () => {
72
72
  "--headline2-line-height": "65px";
73
73
  "--headline3-font-weight": "var(--font-weight-semibold)";
74
74
  "--headline3-font-size": "24px";
75
- "--headline3-line-height": "57px";
75
+ "--headline3-line-height": "29px";
76
76
  "--headline4-font-weight": "var(--font-weight-semibold)";
77
77
  "--headline4-font-size": "20px";
78
78
  "--headline4-line-height": "28px";
@@ -84,5 +84,17 @@ export declare const createTypographyCssBaseline: () => {
84
84
  "--font-weight-medium": 500;
85
85
  "--font-weight-regular": 400;
86
86
  };
87
+ ".light1": {
88
+ color: string;
89
+ };
90
+ ".light2": {
91
+ color: string;
92
+ };
93
+ ".dark1": {
94
+ color: string;
95
+ };
96
+ ".dark2": {
97
+ color: string;
98
+ };
87
99
  };
88
100
  export default typographyOptions;
@@ -42,7 +42,7 @@ export declare const cssVariables: {
42
42
  "--headline2-line-height": "65px";
43
43
  "--headline3-font-weight": "var(--font-weight-semibold)";
44
44
  "--headline3-font-size": "24px";
45
- "--headline3-line-height": "57px";
45
+ "--headline3-line-height": "29px";
46
46
  "--headline4-font-weight": "var(--font-weight-semibold)";
47
47
  "--headline4-font-size": "20px";
48
48
  "--headline4-line-height": "28px";
@@ -4,6 +4,7 @@ export declare const grey: {
4
4
  10: string;
5
5
  15: string;
6
6
  20: string;
7
+ 25: string;
7
8
  30: string;
8
9
  40: string;
9
10
  50: string;
@@ -22,6 +23,7 @@ export declare const greyText: {
22
23
  10: string;
23
24
  15: string;
24
25
  20: string;
26
+ 25: string;
25
27
  30: string;
26
28
  40: string;
27
29
  50: string;
@@ -51,12 +51,6 @@ export declare const createColorCssBaseline: () => {
51
51
  ".dark2": {
52
52
  [x: string]: string;
53
53
  };
54
- ".dark3": {
55
- [x: string]: string;
56
- };
57
- ".dark4": {
58
- [x: string]: string;
59
- };
60
54
  };
61
55
  declare const paletteOptions: {
62
56
  primary: {
@@ -93,6 +87,10 @@ declare const paletteOptions: {
93
87
  A400: string;
94
88
  A700: string;
95
89
  };
90
+ text: {
91
+ primary: string;
92
+ secondary: string;
93
+ };
96
94
  lunit_global: {
97
95
  grey: GreyColor;
98
96
  blue: BaseColor;
@@ -110,6 +108,7 @@ declare const paletteOptions: {
110
108
  bg_01: string;
111
109
  bg_02: string;
112
110
  bg_03: string;
111
+ layer_01: string;
113
112
  text_primary: string;
114
113
  text_normal: string;
115
114
  text_medium: string;
@@ -132,6 +131,8 @@ declare const paletteOptions: {
132
131
  shadow_02: string;
133
132
  shadow_03: string;
134
133
  shadow_04: string;
134
+ border_light: string;
135
+ border_medium: string;
135
136
  };
136
137
  component: {
137
138
  btn_primary_bg: string;
@@ -147,6 +148,8 @@ declare const paletteOptions: {
147
148
  btn_selected_primary_text: string;
148
149
  btn_selected_secondary_bg: string;
149
150
  btn_selected_secondary_text: string;
151
+ btn_selected_tertiary_bg: string;
152
+ btn_selected_tertiary_text: string;
150
153
  selectcontrol_on: string;
151
154
  selectcontrol_off: string;
152
155
  selectcontrol_handler: string;
@@ -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 {};
@@ -38,6 +38,10 @@ export declare const palette: {
38
38
  A400: string;
39
39
  A700: string;
40
40
  };
41
+ text: {
42
+ primary: string;
43
+ secondary: string;
44
+ };
41
45
  lunit_global: {
42
46
  grey: import("./colors").GreyColor;
43
47
  blue: import("./colors").BaseColor;
@@ -55,6 +59,7 @@ export declare const palette: {
55
59
  bg_01: string;
56
60
  bg_02: string;
57
61
  bg_03: string;
62
+ layer_01: string;
58
63
  text_primary: string;
59
64
  text_normal: string;
60
65
  text_medium: string;
@@ -77,6 +82,8 @@ export declare const palette: {
77
82
  shadow_02: string;
78
83
  shadow_03: string;
79
84
  shadow_04: string;
85
+ border_light: string;
86
+ border_medium: string;
80
87
  };
81
88
  component: {
82
89
  btn_primary_bg: string;
@@ -92,6 +99,8 @@ export declare const palette: {
92
99
  btn_selected_primary_text: string;
93
100
  btn_selected_secondary_bg: string;
94
101
  btn_selected_secondary_text: string;
102
+ btn_selected_tertiary_bg: string;
103
+ btn_selected_tertiary_text: string;
95
104
  selectcontrol_on: string;
96
105
  selectcontrol_off: string;
97
106
  selectcontrol_handler: string;
@@ -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-b.4",
3
+ "version": "2.0.0",
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: "''",
@@ -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: "18px",
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 { ButtonType, ButtonProps } from "./Button.types";
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
- {/** props.kind 사용 이유: props.color 내 타입 좁히기 활용을 위해 사용 */}
22
- {props.kind === "outlined" ? (
23
- <CustomButton
24
- {...buttonProps}
25
- ref={ref}
26
- className={`outlined ${className ? className : ""}`}
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