@lunit/design-system 1.0.0-a.4 → 1.0.0-b.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 (117) hide show
  1. package/README.md +2 -2
  2. package/dist/cjs/components/Alert/index.js +1 -1
  3. package/dist/cjs/components/Alert/index.js.map +1 -1
  4. package/dist/cjs/components/Button/index.js +1 -1
  5. package/dist/cjs/components/Button/index.js.map +1 -1
  6. package/dist/cjs/components/Checkbox/index.js +1 -1
  7. package/dist/cjs/components/Checkbox/index.js.map +1 -1
  8. package/dist/cjs/components/Chip/index.js +1 -1
  9. package/dist/cjs/components/Chip/index.js.map +1 -1
  10. package/dist/cjs/components/Radio/index.js +1 -1
  11. package/dist/cjs/components/Radio/index.js.map +1 -1
  12. package/dist/cjs/components/TextField/index.js +1 -1
  13. package/dist/cjs/components/TextField/index.js.map +1 -1
  14. package/dist/cjs/components/Toggle/index.js +1 -1
  15. package/dist/cjs/components/Toggle/index.js.map +1 -1
  16. package/dist/cjs/components/ToggleButton/index.js +1 -1
  17. package/dist/cjs/components/ToggleButton/index.js.map +1 -1
  18. package/dist/cjs/components/Typography/index.js +2 -0
  19. package/dist/cjs/components/Typography/index.js.map +1 -0
  20. package/dist/cjs/index.js +1 -1
  21. package/dist/cjs/index.js.map +1 -1
  22. package/dist/components/Alert/Alert.js.map +1 -1
  23. package/dist/components/Alert/Alert.styled.js +2 -2
  24. package/dist/components/Alert/Alert.styled.js.map +1 -1
  25. package/dist/components/Alert/Alert.utils.js +12 -12
  26. package/dist/components/Alert/Alert.utils.js.map +1 -1
  27. package/dist/components/Button/Button.js +2 -2
  28. package/dist/components/Button/Button.js.map +1 -1
  29. package/dist/components/Button/Button.styled.js +50 -29
  30. package/dist/components/Button/Button.styled.js.map +1 -1
  31. package/dist/components/Checkbox/Checkbox.js +4 -4
  32. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  33. package/dist/components/Chip/Chip.styled.js +15 -15
  34. package/dist/components/Chip/Chip.styled.js.map +1 -1
  35. package/dist/components/Radio/Radio.js +3 -3
  36. package/dist/components/Radio/Radio.js.map +1 -1
  37. package/dist/components/TextField/TextField.js +3 -3
  38. package/dist/components/TextField/TextField.js.map +1 -1
  39. package/dist/components/TextField/TextField.style.js +30 -27
  40. package/dist/components/TextField/TextField.style.js.map +1 -1
  41. package/dist/components/Toast/Toast.js +1 -1
  42. package/dist/components/Toast/Toast.js.map +1 -1
  43. package/dist/components/Toast/Toast.styled.js +3 -3
  44. package/dist/components/Toast/Toast.styled.js.map +1 -1
  45. package/dist/components/Toast/Toast.utils.js +4 -4
  46. package/dist/components/Toast/Toast.utils.js.map +1 -1
  47. package/dist/components/Toast/index.js +1 -1
  48. package/dist/components/Toast/index.js.map +1 -1
  49. package/dist/components/Toggle/Toggle.styled.js +20 -20
  50. package/dist/components/Toggle/Toggle.styled.js.map +1 -1
  51. package/dist/components/ToggleButton/ToggleButton.styled.js +7 -7
  52. package/dist/components/ToggleButton/ToggleButton.styled.js.map +1 -1
  53. package/dist/components/Typography/index.js +3 -0
  54. package/dist/components/Typography/index.js.map +1 -0
  55. package/dist/foundation/Elevation/index.js +4 -4
  56. package/dist/foundation/Elevation/index.js.map +1 -1
  57. package/dist/foundation/Typography/index.js.map +1 -1
  58. package/dist/foundation/colors/index.js +12 -13
  59. package/dist/foundation/colors/index.js.map +1 -1
  60. package/dist/foundation/colors/token/component.js +22 -38
  61. package/dist/foundation/colors/token/component.js.map +1 -1
  62. package/dist/index.js +4 -1
  63. package/dist/index.js.map +1 -1
  64. package/dist/theme.js +3 -2
  65. package/dist/theme.js.map +1 -1
  66. package/dist/types/components/Button/Button.styled.d.ts +40 -20
  67. package/dist/types/components/Button/Button.types.d.ts +1 -1
  68. package/dist/types/components/Chip/Chip.types.d.ts +1 -0
  69. package/dist/types/components/TextField/TextField.style.d.ts +3 -1
  70. package/dist/types/components/TextField/TextField.types.d.ts +2 -3
  71. package/dist/types/components/TextField/TextFieldIcon.d.ts +1 -0
  72. package/dist/types/components/Toast/index.d.ts +2 -1
  73. package/dist/types/components/Toggle/Toggle.styled.d.ts +1 -1
  74. package/dist/types/components/Typography/index.d.ts +7 -0
  75. package/dist/types/foundation/Typography/index.d.ts +1 -5
  76. package/dist/types/foundation/colors/index.d.ts +15 -17
  77. package/dist/types/foundation/colors/types.d.ts +9 -11
  78. package/dist/types/foundation/index.d.ts +11 -13
  79. package/dist/types/index.d.ts +4 -1
  80. package/dist/types/theme.d.ts +2 -0
  81. package/package.json +21 -16
  82. package/src/components/Alert/Alert.styled.ts +2 -2
  83. package/src/components/Alert/Alert.utils.ts +12 -12
  84. package/src/components/Button/Button.styled.ts +51 -31
  85. package/src/components/Button/Button.tsx +12 -10
  86. package/src/components/Button/Button.types.ts +1 -1
  87. package/src/components/Checkbox/Checkbox.tsx +4 -4
  88. package/src/components/Chip/Chip.styled.ts +15 -15
  89. package/src/components/Radio/Radio.tsx +3 -3
  90. package/src/components/TextField/TextField.style.ts +31 -28
  91. package/src/components/TextField/TextField.tsx +3 -3
  92. package/src/components/TextField/TextField.types.ts +1 -3
  93. package/src/components/Toast/Toast.styled.ts +3 -3
  94. package/src/components/Toast/Toast.tsx +1 -1
  95. package/src/components/Toast/Toast.utils.ts +4 -4
  96. package/src/components/Toast/index.tsx +2 -1
  97. package/src/components/Toggle/Toggle.styled.ts +42 -39
  98. package/src/components/ToggleButton/ToggleButton.styled.ts +7 -7
  99. package/src/components/Typography/index.ts +9 -0
  100. package/src/foundation/Elevation/index.ts +4 -4
  101. package/src/foundation/Typography/index.ts +2 -6
  102. package/src/foundation/colors/index.ts +38 -37
  103. package/src/foundation/colors/token/component.ts +22 -38
  104. package/src/foundation/colors/types.ts +9 -11
  105. package/src/index.ts +4 -1
  106. package/src/stories/components/Alert/Alert.stories.tsx +1 -1
  107. package/src/stories/components/Button/Kind.stories.tsx +38 -5
  108. package/src/stories/components/Toast/Toast.stories.tsx +1 -1
  109. package/src/stories/foundation/Typography/Typography.mdx +1 -1
  110. package/src/stories/foundation/Typography/Typography.stories.tsx +3 -1
  111. package/src/stories/foundation/Typography/TypographyExamples.stories.tsx +2 -2
  112. package/src/stories/foundation/Typography/TypographyGroup.tsx +4 -8
  113. package/src/stories/foundation/colors/Colors.stories.tsx +3 -3
  114. package/src/stories/foundation/colors/Token.inComponent.stories.tsx +21 -19
  115. package/src/stories/foundation/colors/TokenPaletteTable.tsx +6 -4
  116. package/src/stories/foundation/colors/styled.ts +1 -1
  117. package/src/theme.ts +5 -3
@@ -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
- lunit?: {
14
+ lunit_global?: {
15
15
  grey: GreyColor;
16
16
  blue: BaseColor;
17
17
  green: BaseColor;
@@ -22,11 +22,11 @@ declare module "@mui/material/styles/createPalette" {
22
22
  red: BaseColor;
23
23
  yellow: BaseColor;
24
24
  };
25
- token?: ColorToken;
25
+ lunit_token?: ColorToken;
26
26
  }
27
27
 
28
28
  interface Palette {
29
- lunit: {
29
+ lunit_global: {
30
30
  grey: GreyColor;
31
31
  blue: BaseColor;
32
32
  green: BaseColor;
@@ -37,7 +37,7 @@ declare module "@mui/material/styles/createPalette" {
37
37
  red: BaseColor;
38
38
  yellow: BaseColor;
39
39
  };
40
- token: ColorToken;
40
+ lunit_token: ColorToken;
41
41
  }
42
42
  }
43
43
 
@@ -123,29 +123,32 @@ export const createColorCssBaseline = () => {
123
123
  };
124
124
 
125
125
  // TODO: TextColors 삭제하고 관련된 설정 수정하기
126
- const lunitColors: PaletteOptions["lunit"] = ((): PaletteOptions["lunit"] => {
127
- const ret: any = {};
128
- for (const colorKey in base) {
129
- if (base[`${colorKey}Text` as ColorKey]) {
130
- const baseColors = base[colorKey as ColorKey];
131
- const textColors = base[`${colorKey}Text` as ColorKey];
132
- ret[colorKey] = {};
133
- for (const key in baseColors) {
134
- if (baseColors.hasOwnProperty(key)) {
135
- const color = baseColors[Number(key) as keyof typeof baseColors];
136
- const textColor = textColors[Number(key) as keyof typeof textColors];
137
- ret[colorKey][Number(key)] = {
138
- light: color,
139
- main: color,
140
- dark: color,
141
- contrastText: textColor,
142
- };
126
+ // TODO: opacity 글로벌 팔레트에 추가 여부 확인해서 작업하기
127
+ const lunitColors: PaletteOptions["lunit_global"] =
128
+ ((): PaletteOptions["lunit_global"] => {
129
+ const ret: any = {};
130
+ for (const colorKey in base) {
131
+ if (base[`${colorKey}Text` as ColorKey]) {
132
+ const baseColors = base[colorKey as ColorKey];
133
+ const textColors = base[`${colorKey}Text` as ColorKey];
134
+ ret[colorKey] = {};
135
+ for (const key in baseColors) {
136
+ if (baseColors.hasOwnProperty(key)) {
137
+ const color = baseColors[Number(key) as keyof typeof baseColors];
138
+ const textColor =
139
+ textColors[Number(key) as keyof typeof textColors];
140
+ ret[colorKey][Number(key)] = {
141
+ light: color,
142
+ main: color,
143
+ dark: color,
144
+ contrastText: textColor,
145
+ };
146
+ }
143
147
  }
144
148
  }
145
149
  }
146
- }
147
- return ret;
148
- })();
150
+ return ret;
151
+ })();
149
152
 
150
153
  const paletteOptions = {
151
154
  primary: {
@@ -167,8 +170,8 @@ const paletteOptions = {
167
170
  main: base.green[40], // core.text_success.dark1
168
171
  },
169
172
  grey: base.greyForMUI,
170
- lunit: lunitColors,
171
- token: {
173
+ lunit_global: lunitColors,
174
+ lunit_token: {
172
175
  core: {
173
176
  bg_01: "var(--bg_01)",
174
177
  bg_02: "var(--bg_02)",
@@ -197,17 +200,15 @@ const paletteOptions = {
197
200
  shadow_04: "var(--shadow_04)",
198
201
  },
199
202
  component: {
200
- btn_contained_primary_bg: "var(--btn_contained_primary_bg)",
201
- btn_contained_primary_text: "var(--btn_contained_primary_text)",
202
- btn_contained_secondary_bg: "var(--btn_contained_secondary_bg)",
203
- btn_contained_secondary_text: "var(--btn_contained_secondary_text)",
204
- btn_contained_error_bg: "var(--btn_contained_error_bg)",
205
- btn_contained_error_text: "var(--btn_contained_error_text)",
206
- btn_outlined_primary_border: "var(--btn_outlined_primary_border)",
207
- btn_outlined_primary_text: "var(--btn_outlined_primary_text)",
208
- btn_ghost_primary_text: "var(--btn_ghost_primary_text)",
209
- btn_ghost_secondary_text: "var(--btn_ghost_secondary_text)",
210
- btn_ghost_error_text: "var(--btn_ghost_error_text)",
203
+ btn_primary_bg: "var(--btn_primary_bg)",
204
+ btn_secondary_bg: "var(--btn_secondary_bg)",
205
+ btn_error_bg: "var(--btn_error_bg)",
206
+ btn_primary_border: "var(--btn_primary_border)",
207
+ btn_secondary_border: "var(--btn_secondary_border)",
208
+ btn_primary_text_1: "var(--btn_primary_text_1)",
209
+ btn_primary_text_2: "var(--btn_primary_text_2)",
210
+ btn_secondary_text: "var(--btn_secondary_text)",
211
+ btn_error_text: "var(--btn_error_text)",
211
212
  btn_selected_primary_bg: "var(--btn_selected_primary_bg)",
212
213
  btn_selected_primary_text: "var(--btn_selected_primary_text)",
213
214
  btn_selected_secondary_bg: "var(--btn_selected_secondary_bg)",
@@ -8,7 +8,7 @@ export interface TokenComponentColorValue {
8
8
 
9
9
  export const tokenComponentColor: TokenComponentColorValue = {
10
10
  btn: {
11
- btn_contained_primary_bg: {
11
+ btn_primary_bg: {
12
12
  light1: "--lunit_teal_30",
13
13
  light2: "--lunit_teal_30",
14
14
  dark1: "--lunit_teal_40",
@@ -16,15 +16,7 @@ export const tokenComponentColor: TokenComponentColorValue = {
16
16
  dark3: "--lunit_teal_40",
17
17
  dark4: "--lunit_teal_40",
18
18
  },
19
- btn_contained_primary_text: {
20
- light1: "--grey_95",
21
- light2: "--grey_95",
22
- dark1: "--grey_95",
23
- dark2: "--grey_95",
24
- dark3: "--grey_95",
25
- dark4: "--grey_95",
26
- },
27
- btn_contained_secondary_bg: {
19
+ btn_secondary_bg: {
28
20
  light1: "--grey_15",
29
21
  light2: "--grey_15",
30
22
  dark1: "--grey_60",
@@ -32,15 +24,7 @@ export const tokenComponentColor: TokenComponentColorValue = {
32
24
  dark3: "--grey_60",
33
25
  dark4: "--grey_60",
34
26
  },
35
- btn_contained_secondary_text: {
36
- light1: "--grey_95",
37
- light2: "--grey_95",
38
- dark1: "--grey_5",
39
- dark2: "--grey_5",
40
- dark3: "--grey_5",
41
- dark4: "--grey_5",
42
- },
43
- btn_contained_error_bg: {
27
+ btn_error_bg: {
44
28
  light1: "--red_30",
45
29
  light2: "--red_30",
46
30
  dark1: "--red_40",
@@ -48,15 +32,7 @@ export const tokenComponentColor: TokenComponentColorValue = {
48
32
  dark3: "--red_40",
49
33
  dark4: "--red_40",
50
34
  },
51
- btn_contained_error_text: {
52
- light1: "--grey_95",
53
- light2: "--grey_95",
54
- dark1: "--grey_95",
55
- dark2: "--grey_95",
56
- dark3: "--grey_95",
57
- dark4: "--grey_95",
58
- },
59
- btn_outlined_primary_border: {
35
+ btn_primary_border: {
60
36
  light1: "--lunit_teal_40",
61
37
  light2: "--lunit_teal_40",
62
38
  dark1: "--lunit_teal_40",
@@ -64,15 +40,15 @@ export const tokenComponentColor: TokenComponentColorValue = {
64
40
  dark3: "--lunit_teal_40",
65
41
  dark4: "--lunit_teal_40",
66
42
  },
67
- btn_outlined_primary_text: {
68
- light1: "--lunit_teal_50",
69
- light2: "--lunit_teal_50",
70
- dark1: "--lunit_teal_40",
71
- dark2: "--lunit_teal_40",
72
- dark3: "--lunit_teal_40",
73
- dark4: "--lunit_teal_40",
43
+ btn_secondary_border: {
44
+ light1: "--grey_15",
45
+ light2: "--grey_15",
46
+ dark1: "--grey_5",
47
+ dark2: "--grey_5",
48
+ dark3: "--grey_5",
49
+ dark4: "--grey_5",
74
50
  },
75
- btn_ghost_primary_text: {
51
+ btn_primary_text_1: {
76
52
  light1: "--lunit_teal_50",
77
53
  light2: "--lunit_teal_50",
78
54
  dark1: "--lunit_teal_40",
@@ -80,7 +56,15 @@ export const tokenComponentColor: TokenComponentColorValue = {
80
56
  dark3: "--lunit_teal_40",
81
57
  dark4: "--lunit_teal_40",
82
58
  },
83
- btn_ghost_secondary_text: {
59
+ btn_primary_text_2: {
60
+ light1: "--grey_95",
61
+ light2: "--grey_95",
62
+ dark1: "--grey_95",
63
+ dark2: "--grey_95",
64
+ dark3: "--grey_95",
65
+ dark4: "--grey_95",
66
+ },
67
+ btn_secondary_text: {
84
68
  light1: "--grey_95",
85
69
  light2: "--grey_95",
86
70
  dark1: "--grey_5",
@@ -88,7 +72,7 @@ export const tokenComponentColor: TokenComponentColorValue = {
88
72
  dark3: "--grey_5",
89
73
  dark4: "--grey_5",
90
74
  },
91
- btn_ghost_error_text: {
75
+ btn_error_text: {
92
76
  light1: "--red_40",
93
77
  light2: "--red_40",
94
78
  dark1: "--red_40",
@@ -29,17 +29,15 @@ export interface ColorToken {
29
29
  shadow_04: CSSPropertyColor;
30
30
  };
31
31
  component: {
32
- btn_contained_primary_bg: CSSPropertyColor;
33
- btn_contained_primary_text: CSSPropertyColor;
34
- btn_contained_secondary_bg: CSSPropertyColor;
35
- btn_contained_secondary_text: CSSPropertyColor;
36
- btn_contained_error_bg: CSSPropertyColor;
37
- btn_contained_error_text: CSSPropertyColor;
38
- btn_outlined_primary_border: CSSPropertyColor;
39
- btn_outlined_primary_text: CSSPropertyColor;
40
- btn_ghost_primary_text: CSSPropertyColor;
41
- btn_ghost_secondary_text: CSSPropertyColor;
42
- btn_ghost_error_text: CSSPropertyColor;
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;
43
41
  btn_selected_primary_bg: CSSPropertyColor;
44
42
  btn_selected_primary_text: CSSPropertyColor;
45
43
  btn_selected_secondary_bg: CSSPropertyColor;
package/src/index.ts CHANGED
@@ -1,9 +1,10 @@
1
- export { default as theme } from "./theme";
1
+ export { default as theme, themeOptions } from "./theme";
2
2
  export { base as baseColors } from "./foundation/colors";
3
3
 
4
4
  export { default as Alert } from "./components/Alert";
5
5
  export { default as Button } from "./components/Button";
6
6
  export { default as Chip } from "./components/Chip";
7
+ export { default as Checkbox } from "./components/Checkbox";
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";
@@ -12,7 +13,9 @@ export { default as Modal } from "./components/Modal";
12
13
  export { default as Radio } from "./components/Radio";
13
14
  export { default as RadioGroup } from "./components/RadioGroup";
14
15
  export { default as TextField } from "./components/TextField";
16
+ export { default as Toast } from "./components/Toast";
15
17
  export { default as Toggle } from "./components/Toggle";
16
18
  export { default as ToggleButton } from "./components/ToggleButton";
17
19
  export { default as ToggleButtonGroup } from "./components/ToggleButtonGroup";
18
20
  export { default as Tooltip } from "./components/Tooltip";
21
+ export { default as Typography } from "./components/Typography";
@@ -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.token.core.link_primary }}>
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
@@ -450,13 +450,16 @@ const OutlinedButtonTemplate: StoryFn<typeof Button> = ({
450
450
  }) => {
451
451
  return (
452
452
  <>
453
- <Table sx={{ width: 250 }}>
453
+ <Table sx={{ width: 600 }}>
454
454
  <TableHead>
455
455
  <TableRow>
456
456
  <TableCell></TableCell>
457
457
  <TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
458
458
  Outlined Primary
459
459
  </TableCell>
460
+ <TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
461
+ Outlined Secondary
462
+ </TableCell>
460
463
  </TableRow>
461
464
  </TableHead>
462
465
  <TableBody>
@@ -468,7 +471,12 @@ const OutlinedButtonTemplate: StoryFn<typeof Button> = ({
468
471
  </TableCell>
469
472
  <TableCell>
470
473
  <Button {...restProps} kind="outlined">
471
- Text
474
+ {restProps.children}
475
+ </Button>
476
+ </TableCell>
477
+ <TableCell>
478
+ <Button {...restProps} kind="outlined" color="secondary">
479
+ {restProps.children}
472
480
  </Button>
473
481
  </TableCell>
474
482
  </TableRow>
@@ -480,7 +488,17 @@ const OutlinedButtonTemplate: StoryFn<typeof Button> = ({
480
488
  </TableCell>
481
489
  <TableCell>
482
490
  <Button {...restProps} id="hover7" kind="outlined">
483
- Text
491
+ {restProps.children}
492
+ </Button>
493
+ </TableCell>
494
+ <TableCell>
495
+ <Button
496
+ {...restProps}
497
+ id="hover7"
498
+ kind="outlined"
499
+ color="secondary"
500
+ >
501
+ {restProps.children}
484
502
  </Button>
485
503
  </TableCell>
486
504
  </TableRow>
@@ -496,7 +514,17 @@ const OutlinedButtonTemplate: StoryFn<typeof Button> = ({
496
514
  kind="outlined"
497
515
  className="Mui-focusVisible"
498
516
  >
499
- Text
517
+ {restProps.children}
518
+ </Button>
519
+ </TableCell>
520
+ <TableCell>
521
+ <Button
522
+ {...restProps}
523
+ kind="outlined"
524
+ color="secondary"
525
+ className="Mui-focusVisible"
526
+ >
527
+ {restProps.children}
500
528
  </Button>
501
529
  </TableCell>
502
530
  </TableRow>
@@ -508,7 +536,12 @@ const OutlinedButtonTemplate: StoryFn<typeof Button> = ({
508
536
  </TableCell>
509
537
  <TableCell>
510
538
  <Button {...restProps} kind="outlined" disabled>
511
- Text
539
+ {restProps.children}
540
+ </Button>
541
+ </TableCell>
542
+ <TableCell>
543
+ <Button {...restProps} kind="outlined" color="secondary" disabled>
544
+ {restProps.children}
512
545
  </Button>
513
546
  </TableCell>
514
547
  </TableRow>
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import { StoryFn, Meta } from "@storybook/react";
3
3
  import { Box } from "@mui/material";
4
4
 
5
- import Toast from "@/components/Toast/Toast";
5
+ import Toast from "@/components/Toast";
6
6
  import { action } from "@storybook/addon-actions";
7
7
  import Button from "@/components/Button";
8
8
 
@@ -1,7 +1,7 @@
1
1
  import { Meta, Canvas, Story } from "@storybook/blocks";
2
2
  import * as TypographyStories from "./TypographyExamples.stories";
3
3
 
4
- import { Typography } from "@mui/material";
4
+ import Typography from "@/components/Typography";
5
5
 
6
6
  import { variants } from "./const";
7
7
 
@@ -1,9 +1,11 @@
1
1
  import React from "react";
2
2
 
3
3
  import { StoryFn } from "@storybook/react";
4
- import { Box, Typography } from "@mui/material";
4
+ import { Box } from "@mui/material";
5
5
  import { styled } from "@mui/material/styles";
6
6
 
7
+ import Typography from "@/components/Typography";
8
+
7
9
  import { variantArray } from "./const";
8
10
 
9
11
  export default {
@@ -1,8 +1,8 @@
1
1
  import React from "react";
2
- import { Typography } from "@mui/material";
3
2
 
4
- import { variants } from "./const";
3
+ import Typography from "@/components/Typography";
5
4
 
5
+ import { variants } from "./const";
6
6
  import TypographyGroup from "./TypographyGroup";
7
7
 
8
8
  const AllVariants = () => (
@@ -1,12 +1,8 @@
1
1
  import React from "react";
2
2
 
3
- import {
4
- Box,
5
- Typography,
6
- styled,
7
- useTheme,
8
- TypographyProps,
9
- } from "@mui/material";
3
+ import { Box, styled, useTheme, TypographyProps } from "@mui/material";
4
+
5
+ import Typography from "@/components/Typography";
10
6
 
11
7
  export const TypographyContent = styled(Box)({
12
8
  display: "flex",
@@ -22,7 +18,7 @@ export const TypographyItem = styled(Box)({
22
18
 
23
19
  export const TypographyTitle = styled(Typography)(({ theme }) => ({
24
20
  width: 200,
25
- color: theme.palette.token.core.text_light,
21
+ color: theme.palette.lunit_token.core.text_light,
26
22
  }));
27
23
 
28
24
  export const TypographyDummy = styled(Typography)({
@@ -18,7 +18,7 @@ const BaseColors = () => {
18
18
  return (
19
19
  <Container>
20
20
  {map(
21
- theme.palette.lunit,
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={`lunit.${paletteKey}.${colorKey}.contrastText`}
38
- bgcolor={`lunit.${paletteKey}.${colorKey}.main`}
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.token.component.textfield_bg,
9
- color: theme.palette.token.core.text_normal,
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.token.core.focused,
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.token.component.textfield_bg,
53
- color: (theme) => theme.palette.token.core.text_normal,
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.token.core.focused,
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.token.component.alert_info_bg,
69
- color: (theme) => theme.palette.token.component.alert_info_border,
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.token.core.shadow_01}`,
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.token.component.textfield_bg,
87
- color: (theme) => theme.palette.token.core.text_normal,
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.token.core.focused,
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.token.component.alert_info_bg,
103
- color: (theme) => theme.palette.token.component.alert_info_border,
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.token.core.shadow_01}`,
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.token.component.textfield_bg,
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.token.component.textfield_bg,
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={theme === "light" ? `lunit.grey.0.main` : `lunit.grey.80.main`}
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={(theme) => theme.palette.token.core.text_normal}
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" ? theme.palette.token.core : theme.palette.token.component
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.token.core[paletteKey as keyof ColorToken["core"]]
47
- : theme.palette.token.component[
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.token.core.bg_01,
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.token.core.text_normal,
36
+ color: theme.palette.lunit_token.core.text_normal,
37
37
  marginLeft: 8,
38
38
  fontSize: "12px",
39
39
  }));
package/src/theme.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { deepmerge } from "@mui/utils";
2
- import { ComponentsOverrides, createTheme } from "@mui/material";
2
+ import { createTheme, ThemeOptions } from "@mui/material";
3
3
  import {
4
4
  foundationCssBaseline,
5
5
  palette,
@@ -9,7 +9,7 @@ import {
9
9
  } from "./foundation";
10
10
  import { componentsCssBaseline } from "./components";
11
11
 
12
- const theme = createTheme({
12
+ export const themeOptions: ThemeOptions = {
13
13
  typography,
14
14
  palette,
15
15
  spacing,
@@ -41,6 +41,8 @@ const theme = createTheme({
41
41
  },
42
42
  // @todo add any MUI components theme exported from ./components/index.ts
43
43
  },
44
- });
44
+ };
45
+
46
+ const theme = createTheme(themeOptions);
45
47
 
46
48
  export default theme;