@lunit/design-system 1.0.0-a.2 → 1.0.0-a.3
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/.babelrc.json +16 -0
- 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/Chip/index.js +1 -1
- package/dist/cjs/components/Chip/index.js.map +1 -1
- package/dist/cjs/components/TextField/index.js +1 -1
- package/dist/cjs/components/TextField/index.js.map +1 -1
- package/dist/cjs/components/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/Alert/Alert.js +16 -4
- package/dist/components/Alert/Alert.js.map +1 -1
- package/dist/components/Alert/Alert.styled.js +48 -0
- package/dist/components/Alert/Alert.styled.js.map +1 -0
- package/dist/components/Alert/Alert.types.js +2 -0
- package/dist/components/Alert/Alert.types.js.map +1 -0
- package/dist/components/Alert/Alert.utils..js +38 -0
- package/dist/components/Alert/Alert.utils..js.map +1 -0
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/Button.styled.js +31 -21
- package/dist/components/Button/Button.styled.js.map +1 -1
- package/dist/components/Button/utils/getHoverStyle.js +7 -0
- package/dist/components/Button/utils/getHoverStyle.js.map +1 -0
- package/dist/components/Chip/Chip.js +1 -1
- package/dist/components/Chip/Chip.js.map +1 -1
- package/dist/components/Chip/Chip.styled.js +2 -3
- package/dist/components/Chip/Chip.styled.js.map +1 -1
- package/dist/components/TextField/TextField.js +15 -3
- package/dist/components/TextField/TextField.js.map +1 -1
- package/dist/components/TextField/TextField.style.js +245 -0
- package/dist/components/TextField/TextField.style.js.map +1 -0
- package/dist/components/TextField/TextField.types.js +2 -0
- package/dist/components/TextField/TextField.types.js.map +1 -0
- package/dist/components/TextField/TextFieldIcon.js +7 -0
- package/dist/components/TextField/TextFieldIcon.js.map +1 -0
- package/dist/components/Toast/Toast.js +26 -0
- package/dist/components/Toast/Toast.js.map +1 -0
- package/dist/components/Toast/Toast.styled.js +49 -0
- package/dist/components/Toast/Toast.styled.js.map +1 -0
- package/dist/components/Toast/Toast.types.js +2 -0
- package/dist/components/Toast/Toast.types.js.map +1 -0
- package/dist/components/Toast/Toast.utils.js +14 -0
- package/dist/components/Toast/Toast.utils.js.map +1 -0
- package/dist/components/Toast/index.js +2 -0
- package/dist/components/Toast/index.js.map +1 -0
- package/dist/foundation/colors/base/grey.js +16 -0
- package/dist/foundation/colors/base/grey.js.map +1 -1
- package/dist/foundation/colors/base/lunitGreen.js +2 -2
- package/dist/foundation/colors/base/lunitGreen.js.map +1 -1
- package/dist/foundation/colors/base/lunitTeal.js +5 -5
- package/dist/foundation/colors/base/lunitTeal.js.map +1 -1
- package/dist/foundation/colors/base/red.js +2 -2
- package/dist/foundation/colors/index.js +24 -4
- package/dist/foundation/colors/index.js.map +1 -1
- package/dist/foundation/colors/token/component.js +265 -291
- package/dist/foundation/colors/token/component.js.map +1 -1
- package/dist/foundation/colors/token/core.js +132 -125
- package/dist/foundation/colors/token/core.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/theme.js +5 -0
- package/dist/theme.js.map +1 -1
- package/dist/types/components/Alert/Alert.d.ts +3 -1
- package/dist/types/components/Alert/Alert.styled.d.ts +6 -0
- package/dist/types/components/Alert/Alert.types.d.ts +9 -0
- package/dist/types/components/Alert/Alert.utils..d.ts +4 -0
- package/dist/types/components/Button/Button.d.ts +1 -1
- package/dist/types/components/Button/Button.styled.d.ts +26 -2
- package/dist/types/components/Button/Button.types.d.ts +4 -4
- package/dist/types/components/Button/utils/getHoverStyle.d.ts +6 -0
- package/dist/types/components/Chip/Chip.styled.d.ts +9 -9
- package/dist/types/components/Chip/Chip.types.d.ts +1 -1
- package/dist/types/components/TextField/TextField.d.ts +2 -1
- package/dist/types/components/TextField/TextField.style.d.ts +9 -0
- package/dist/types/components/TextField/TextField.types.d.ts +29 -0
- package/dist/types/components/TextField/TextFieldIcon.d.ts +8 -0
- package/dist/types/components/TextField/index.d.ts +1 -0
- package/dist/types/components/Toast/Toast.d.ts +4 -0
- package/dist/types/components/Toast/Toast.styled.d.ts +1 -0
- package/dist/types/components/Toast/Toast.types.d.ts +4 -0
- package/dist/types/components/Toast/Toast.utils.d.ts +2 -0
- package/dist/types/components/Toast/index.d.ts +1 -0
- package/dist/types/components/ToggleButton/ToggleButton.styled.d.ts +1 -1
- package/dist/types/components/ToggleButton/ToggleButton.types.d.ts +4 -4
- package/dist/types/foundation/colors/base/grey.d.ts +16 -0
- package/dist/types/foundation/colors/base/lunitGreen.d.ts +2 -2
- package/dist/types/foundation/colors/base/lunitTeal.d.ts +2 -2
- package/dist/types/foundation/colors/index.d.ts +42 -9
- package/dist/types/foundation/colors/types.d.ts +1 -3
- package/dist/types/foundation/index.d.ts +37 -5
- package/dist/types/index.d.ts +1 -0
- package/package.json +21 -16
- package/src/components/Alert/Alert.styled.ts +60 -0
- package/src/components/Alert/Alert.tsx +49 -5
- package/src/components/Alert/Alert.types.ts +10 -0
- package/src/components/Alert/Alert.utils..ts +41 -0
- package/src/components/Button/Button.styled.ts +33 -21
- package/src/components/Button/Button.tsx +1 -5
- package/src/components/Button/Button.types.ts +4 -4
- package/src/components/Button/utils/getHoverStyle.ts +7 -0
- package/src/components/Chip/Chip.styled.ts +6 -4
- package/src/components/Chip/Chip.tsx +1 -1
- package/src/components/Chip/Chip.types.ts +2 -2
- package/src/components/TextField/TextField.style.ts +316 -0
- package/src/components/TextField/TextField.tsx +75 -3
- package/src/components/TextField/TextField.types.ts +38 -0
- package/src/components/TextField/TextFieldIcon.tsx +24 -0
- package/src/components/TextField/index.ts +6 -0
- package/src/components/Toast/Toast.styled.ts +49 -0
- package/src/components/Toast/Toast.tsx +66 -0
- package/src/components/Toast/Toast.types.ts +14 -0
- package/src/components/Toast/Toast.utils.ts +15 -0
- package/src/components/Toast/index.tsx +1 -0
- package/src/components/ToggleButton/ToggleButton.types.ts +4 -7
- package/src/foundation/colors/base/grey.ts +17 -0
- package/src/foundation/colors/base/lunitGreen.ts +2 -2
- package/src/foundation/colors/base/lunitTeal.ts +5 -5
- package/src/foundation/colors/base/red.ts +2 -2
- package/src/foundation/colors/index.ts +29 -8
- package/src/foundation/colors/token/component.ts +300 -326
- package/src/foundation/colors/token/core.ts +152 -145
- package/src/foundation/colors/types.ts +1 -3
- package/src/index.ts +1 -0
- package/src/stories/components/Alert/Alert.stories.tsx +148 -4
- package/src/stories/components/Button/BasicButton.stories.tsx +19 -28
- package/src/stories/components/Button/IconButton.stories.tsx +39 -28
- package/src/stories/components/Button/Kind.stories.tsx +83 -57
- package/src/stories/components/Chip/Chip.stories.tsx +94 -82
- package/src/stories/components/DataTable/DataTable.stories.tsx +6 -4
- package/src/stories/components/DatePicker/DatePicker.stories.tsx +6 -4
- package/src/stories/components/Dropdown/Dropdown.stories.tsx +12 -6
- package/src/stories/components/Modal/Modal.stories.tsx +6 -4
- package/src/stories/components/SelectControl/Checkbox.stories.tsx +31 -23
- package/src/stories/components/SelectControl/RadioGroup.stories.tsx +6 -5
- package/src/stories/components/SelectControl/RadioStatus.stories.tsx +6 -4
- package/src/stories/components/SelectControl/Toggle.stories.tsx +33 -19
- package/src/stories/components/TextField/TextFieldMulti.stories.tsx +137 -0
- package/src/stories/components/TextField/TextFieldSingle.stories.tsx +283 -0
- package/src/stories/components/TextField/TextFieldSize.stories.tsx +134 -0
- package/src/stories/components/Toast/Toast.stories.tsx +152 -0
- package/src/stories/components/ToggleButton/Basic.stories.tsx +35 -31
- package/src/stories/components/ToggleButton/Group.stories.tsx +21 -21
- package/src/stories/components/ToggleButton/ToggleButtonKind.stories.tsx +53 -43
- package/src/stories/components/ToggleButton/WithIcon.stories.tsx +35 -36
- package/src/stories/components/Tooltip/Tooltip.stories.tsx +6 -4
- package/src/stories/foundation/Elevation/Elevation.stories.tsx +10 -6
- package/src/stories/foundation/Typography/{Typography.stories.mdx → Typography.mdx} +10 -5
- package/src/stories/foundation/Typography/Typography.stories.tsx +46 -36
- package/src/stories/foundation/Typography/TypographyExamples.stories.tsx +44 -0
- package/src/stories/foundation/colors/Colors.stories.tsx +7 -5
- package/src/stories/foundation/colors/Mui.stories.tsx +18 -0
- package/src/stories/foundation/colors/Token.inComponent.stories.tsx +2 -2
- package/src/stories/foundation/colors/TokenPaletteTable.stories.tsx +28 -0
- package/src/stories/foundation/colors/TokenPaletteTable.tsx +127 -0
- package/src/theme.ts +5 -0
- package/src/stories/components/TextField/TextField.stories.tsx +0 -13
- package/src/stories/foundation/colors/Token.stories.tsx +0 -190
|
@@ -6,199 +6,206 @@ export interface TokenCoreColorValue {
|
|
|
6
6
|
|
|
7
7
|
export const tokenCoreColor: TokenCoreColorValue = {
|
|
8
8
|
bg_01: {
|
|
9
|
-
light1: "--
|
|
10
|
-
light2: "--
|
|
11
|
-
dark1: "--
|
|
12
|
-
dark2: "--
|
|
13
|
-
dark3: "--
|
|
14
|
-
dark4: "--
|
|
9
|
+
light1: "--grey_0",
|
|
10
|
+
light2: "--grey_10",
|
|
11
|
+
dark1: "--grey_90",
|
|
12
|
+
dark2: "--grey_85",
|
|
13
|
+
dark3: "--grey_80",
|
|
14
|
+
dark4: "--grey_70",
|
|
15
15
|
},
|
|
16
16
|
bg_02: {
|
|
17
|
-
light1: "--
|
|
18
|
-
light2: "--
|
|
19
|
-
dark1: "--
|
|
20
|
-
dark2: "--
|
|
21
|
-
dark3: "--
|
|
22
|
-
dark4: "--
|
|
17
|
+
light1: "--grey_0",
|
|
18
|
+
light2: "--grey_0",
|
|
19
|
+
dark1: "--grey_70",
|
|
20
|
+
dark2: "--grey_70",
|
|
21
|
+
dark3: "--grey_70",
|
|
22
|
+
dark4: "--grey_70",
|
|
23
23
|
},
|
|
24
24
|
bg_03: {
|
|
25
|
-
light1: "--
|
|
26
|
-
light2: "--
|
|
27
|
-
dark1: "--
|
|
28
|
-
dark2: "--
|
|
29
|
-
dark3: "--
|
|
30
|
-
dark4: "--
|
|
25
|
+
light1: "--grey_0",
|
|
26
|
+
light2: "--grey_0",
|
|
27
|
+
dark1: "--grey_85",
|
|
28
|
+
dark2: "--grey_85",
|
|
29
|
+
dark3: "--grey_85",
|
|
30
|
+
dark4: "--grey_85",
|
|
31
31
|
},
|
|
32
32
|
text_primary: {
|
|
33
|
-
light1: "--
|
|
34
|
-
light2: "--
|
|
35
|
-
dark1: "--
|
|
36
|
-
dark2: "--
|
|
37
|
-
dark3: "--
|
|
38
|
-
dark4: "--
|
|
33
|
+
light1: "--lunit_teal_50",
|
|
34
|
+
light2: "--lunit_teal_50",
|
|
35
|
+
dark1: "--lunit_teal_40",
|
|
36
|
+
dark2: "--lunit_teal_40",
|
|
37
|
+
dark3: "--lunit_teal_40",
|
|
38
|
+
dark4: "--lunit_teal_40",
|
|
39
39
|
},
|
|
40
40
|
text_normal: {
|
|
41
|
-
light1: "--
|
|
42
|
-
light2: "--
|
|
43
|
-
dark1: "--
|
|
44
|
-
dark2: "--
|
|
45
|
-
dark3: "--
|
|
46
|
-
dark4: "--
|
|
41
|
+
light1: "--grey_95",
|
|
42
|
+
light2: "--grey_95",
|
|
43
|
+
dark1: "--grey_5",
|
|
44
|
+
dark2: "--grey_5",
|
|
45
|
+
dark3: "--grey_5",
|
|
46
|
+
dark4: "--grey_5",
|
|
47
47
|
},
|
|
48
48
|
text_medium: {
|
|
49
|
-
light1: "--
|
|
50
|
-
light2: "--
|
|
51
|
-
dark1: "--
|
|
52
|
-
dark2: "--
|
|
53
|
-
dark3: "--
|
|
54
|
-
dark4: "--
|
|
49
|
+
light1: "--grey_60",
|
|
50
|
+
light2: "--grey_60",
|
|
51
|
+
dark1: "--grey_40",
|
|
52
|
+
dark2: "--grey_40",
|
|
53
|
+
dark3: "--grey_40",
|
|
54
|
+
dark4: "--grey_30",
|
|
55
55
|
},
|
|
56
56
|
text_light: {
|
|
57
|
-
light1: "--
|
|
58
|
-
light2: "--
|
|
59
|
-
dark1: "--
|
|
60
|
-
dark2: "--
|
|
61
|
-
dark3: "--
|
|
62
|
-
dark4: "--
|
|
57
|
+
light1: "--grey_40",
|
|
58
|
+
light2: "--grey_40",
|
|
59
|
+
dark1: "--grey_50",
|
|
60
|
+
dark2: "--grey_50",
|
|
61
|
+
dark3: "--grey_50",
|
|
62
|
+
dark4: "--grey_40",
|
|
63
63
|
},
|
|
64
64
|
text_error: {
|
|
65
|
-
light1: "--
|
|
66
|
-
light2: "--
|
|
67
|
-
dark1: "--
|
|
68
|
-
dark2: "--
|
|
69
|
-
dark3: "--
|
|
70
|
-
dark4: "--
|
|
65
|
+
light1: "--red_40",
|
|
66
|
+
light2: "--red_40",
|
|
67
|
+
dark1: "--red_40",
|
|
68
|
+
dark2: "--red_40",
|
|
69
|
+
dark3: "--red_30",
|
|
70
|
+
dark4: "--red_30",
|
|
71
71
|
},
|
|
72
72
|
text_success: {
|
|
73
73
|
// TODO: sucess -> success 로 바뀌었으니 코드 내 사용되는 부분 확인해서 업데이트. 개발자들에게도 공지할것.
|
|
74
|
-
light1: "--
|
|
75
|
-
light2: "--
|
|
76
|
-
dark1: "--
|
|
77
|
-
dark2: "--
|
|
78
|
-
dark3: "--
|
|
79
|
-
dark4: "--
|
|
74
|
+
light1: "--green_40",
|
|
75
|
+
light2: "--green_40",
|
|
76
|
+
dark1: "--green_40",
|
|
77
|
+
dark2: "--green_40",
|
|
78
|
+
dark3: "--green_30",
|
|
79
|
+
dark4: "--green_30",
|
|
80
80
|
},
|
|
81
81
|
text_warning: {
|
|
82
|
-
light1: "--
|
|
83
|
-
light2: "--
|
|
84
|
-
dark1: "--
|
|
85
|
-
dark2: "--
|
|
86
|
-
dark3: "--
|
|
87
|
-
dark4: "--
|
|
82
|
+
light1: "--orange_40",
|
|
83
|
+
light2: "--orange_40",
|
|
84
|
+
dark1: "--orange_40",
|
|
85
|
+
dark2: "--orange_40",
|
|
86
|
+
dark3: "--orange_30",
|
|
87
|
+
dark4: "--orange_30",
|
|
88
88
|
},
|
|
89
89
|
text_info: {
|
|
90
|
-
light1: "--
|
|
91
|
-
light2: "--
|
|
92
|
-
dark1: "--
|
|
93
|
-
dark2: "--
|
|
94
|
-
dark3: "--
|
|
95
|
-
dark4: "--
|
|
90
|
+
light1: "--blue_40",
|
|
91
|
+
light2: "--blue_40",
|
|
92
|
+
dark1: "--blue_40",
|
|
93
|
+
dark2: "--blue_40",
|
|
94
|
+
dark3: "--blue_30",
|
|
95
|
+
dark4: "--blue_30",
|
|
96
96
|
},
|
|
97
97
|
link_primary: {
|
|
98
|
-
light1: "--
|
|
99
|
-
light2: "--
|
|
100
|
-
dark1: "--
|
|
101
|
-
dark2: "--
|
|
102
|
-
dark3: "--
|
|
103
|
-
dark4: "--
|
|
98
|
+
light1: "--blue_40",
|
|
99
|
+
light2: "--blue_40",
|
|
100
|
+
dark1: "--blue_40",
|
|
101
|
+
dark2: "--blue_40",
|
|
102
|
+
dark3: "--blue_30",
|
|
103
|
+
dark4: "--blue_30",
|
|
104
104
|
},
|
|
105
105
|
link_hover: {
|
|
106
|
-
light1: "--
|
|
107
|
-
light2: "--
|
|
108
|
-
dark1: "--
|
|
109
|
-
dark2: "--
|
|
110
|
-
dark3: "--
|
|
111
|
-
dark4: "--
|
|
106
|
+
light1: "--blue_50",
|
|
107
|
+
light2: "--blue_50",
|
|
108
|
+
dark1: "--blue_50",
|
|
109
|
+
dark2: "--blue_50",
|
|
110
|
+
dark3: "--blue_40",
|
|
111
|
+
dark4: "--blue_40",
|
|
112
112
|
},
|
|
113
113
|
link_visited: {
|
|
114
|
-
light1: "--
|
|
115
|
-
light2: "--
|
|
116
|
-
dark1: "--
|
|
117
|
-
dark2: "--
|
|
118
|
-
dark3: "--
|
|
119
|
-
dark4: "--
|
|
114
|
+
light1: "--purple_50",
|
|
115
|
+
light2: "--purple_50",
|
|
116
|
+
dark1: "--purple_50",
|
|
117
|
+
dark2: "--purple_50",
|
|
118
|
+
dark3: "--purple_40",
|
|
119
|
+
dark4: "--purple_40",
|
|
120
120
|
},
|
|
121
121
|
icon_error_02: {
|
|
122
|
-
light1: "--
|
|
123
|
-
light2: "--
|
|
124
|
-
dark1: "--
|
|
125
|
-
dark2: "--
|
|
126
|
-
dark3: "--
|
|
127
|
-
dark4: "--
|
|
122
|
+
light1: "--red_40",
|
|
123
|
+
light2: "--red_40",
|
|
124
|
+
dark1: "--red_30",
|
|
125
|
+
dark2: "--red_30",
|
|
126
|
+
dark3: "--red_30",
|
|
127
|
+
dark4: "--red_30",
|
|
128
128
|
},
|
|
129
129
|
icon_success_02: {
|
|
130
130
|
// TODO: sucess -> success 로 바뀌었으니 코드 내 사용되는 부분 확인해서 업데이트. 개발자들에게도 공지할것.
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
dark4: "--green-30",
|
|
131
|
+
light1: "--green_40",
|
|
132
|
+
light2: "--green_40",
|
|
133
|
+
dark1: "--green_30",
|
|
134
|
+
dark2: "--green_30",
|
|
135
|
+
dark3: "--green_30",
|
|
136
|
+
dark4: "--green_30",
|
|
138
137
|
},
|
|
139
138
|
icon_warning_02: {
|
|
140
|
-
light1: "--
|
|
141
|
-
light2: "--
|
|
142
|
-
dark1: "--
|
|
143
|
-
dark2: "--
|
|
144
|
-
dark3: "--
|
|
145
|
-
dark4: "--
|
|
139
|
+
light1: "--orange_40",
|
|
140
|
+
light2: "--orange_40",
|
|
141
|
+
dark1: "--orange_30",
|
|
142
|
+
dark2: "--orange_30",
|
|
143
|
+
dark3: "--orange_30",
|
|
144
|
+
dark4: "--orange_30",
|
|
146
145
|
},
|
|
147
146
|
icon_info_02: {
|
|
148
|
-
light1: "--
|
|
149
|
-
light2: "--
|
|
150
|
-
dark1: "--
|
|
151
|
-
dark2: "--
|
|
152
|
-
dark3: "--
|
|
153
|
-
dark4: "--
|
|
147
|
+
light1: "--blue_40",
|
|
148
|
+
light2: "--blue_40",
|
|
149
|
+
dark1: "--blue_30",
|
|
150
|
+
dark2: "--blue_30",
|
|
151
|
+
dark3: "--blue_30",
|
|
152
|
+
dark4: "--blue_30",
|
|
154
153
|
},
|
|
155
154
|
hover: {
|
|
156
155
|
// TODO: 알파값 적용 코드는 일단 하드코딩. 나중에 수정할것
|
|
157
|
-
light1: "rgba(0, 0, 0, 0.
|
|
158
|
-
light2: "rgba(0, 0, 0, 0.
|
|
159
|
-
dark1: "rgba(
|
|
160
|
-
dark2: "rgba(
|
|
161
|
-
dark3: "rgba(
|
|
162
|
-
dark4: "rgba(
|
|
156
|
+
light1: "rgba(0, 0, 0, 0.1)", // grey_100 10%
|
|
157
|
+
light2: "rgba(0, 0, 0, 0.1)", // grey_100 10%
|
|
158
|
+
dark1: "rgba(0, 0, 0, 0.1)", // grey_100 10%
|
|
159
|
+
dark2: "rgba(0, 0, 0, 0.1)", // grey_100 10%
|
|
160
|
+
dark3: "rgba(0, 0, 0, 0.1)", // grey_100 10%
|
|
161
|
+
dark4: "rgba(0, 0, 0, 0.1)", // grey_100 10%
|
|
163
162
|
},
|
|
164
163
|
focused: {
|
|
165
|
-
light1: "--
|
|
166
|
-
light2: "--
|
|
167
|
-
dark1: "--
|
|
168
|
-
dark2: "--
|
|
169
|
-
dark3: "--
|
|
170
|
-
dark4: "--
|
|
164
|
+
light1: "--lunit_teal_40",
|
|
165
|
+
light2: "--lunit_teal_40",
|
|
166
|
+
dark1: "--lunit_teal_40",
|
|
167
|
+
dark2: "--lunit_teal_40",
|
|
168
|
+
dark3: "--lunit_teal_40",
|
|
169
|
+
dark4: "--lunit_teal_40",
|
|
170
|
+
},
|
|
171
|
+
selected: {
|
|
172
|
+
light1: "--lunit_teal_10",
|
|
173
|
+
light2: "--lunit_teal_10",
|
|
174
|
+
dark1: "--lunit_teal_80",
|
|
175
|
+
dark2: "--lunit_teal_80",
|
|
176
|
+
dark3: "--lunit_teal_80",
|
|
177
|
+
dark4: "--lunit_teal_80",
|
|
171
178
|
},
|
|
172
179
|
shadow_01: {
|
|
173
|
-
light1: "rgba(0, 0, 0, 0.12)", // "--
|
|
174
|
-
light2: "rgba(0, 0, 0, 0.12)", // "--
|
|
175
|
-
dark4: "rgba(0, 0, 0, 0.32)", // "--
|
|
176
|
-
dark3: "rgba(0, 0, 0, 0.32)", // "--
|
|
177
|
-
dark2: "rgba(0, 0, 0, 0.32)", // "--
|
|
178
|
-
dark1: "rgba(0, 0, 0, 0.32)", // "--
|
|
180
|
+
light1: "rgba(0, 0, 0, 0.12)", // "--grey_100 12%",
|
|
181
|
+
light2: "rgba(0, 0, 0, 0.12)", // "--grey_100 12%",
|
|
182
|
+
dark4: "rgba(0, 0, 0, 0.32)", // "--grey_100 32%",
|
|
183
|
+
dark3: "rgba(0, 0, 0, 0.32)", // "--grey_100 32%",
|
|
184
|
+
dark2: "rgba(0, 0, 0, 0.32)", // "--grey_100 32%",
|
|
185
|
+
dark1: "rgba(0, 0, 0, 0.32)", // "--grey_100 32%",
|
|
179
186
|
},
|
|
180
187
|
shadow_02: {
|
|
181
|
-
light1: "rgba(0, 0, 0, 0.18)", // "--
|
|
182
|
-
light2: "rgba(0, 0, 0, 0.18)", // "--
|
|
183
|
-
dark4: "rgba(0, 0, 0, 0.4)", // "--
|
|
184
|
-
dark3: "rgba(0, 0, 0, 0.4)", // "--
|
|
185
|
-
dark2: "rgba(0, 0, 0, 0.4)", // "--
|
|
186
|
-
dark1: "rgba(0, 0, 0, 0.4)", // "--
|
|
188
|
+
light1: "rgba(0, 0, 0, 0.18)", // "--grey_100 18%",
|
|
189
|
+
light2: "rgba(0, 0, 0, 0.18)", // "--grey_100 18%",
|
|
190
|
+
dark4: "rgba(0, 0, 0, 0.4)", // "--grey_100 40%",
|
|
191
|
+
dark3: "rgba(0, 0, 0, 0.4)", // "--grey_100 40%",
|
|
192
|
+
dark2: "rgba(0, 0, 0, 0.4)", // "--grey_100 40%",
|
|
193
|
+
dark1: "rgba(0, 0, 0, 0.4)", // "--grey_100 40%",
|
|
187
194
|
},
|
|
188
195
|
shadow_03: {
|
|
189
|
-
light1: "rgba(0, 0, 0, 0.12)", // "--
|
|
190
|
-
light2: "rgba(0, 0, 0, 0.12)", // "--
|
|
191
|
-
dark4: "rgba(0, 0, 0, 0.36)", // "--
|
|
192
|
-
dark3: "rgba(0, 0, 0, 0.36)", // "--
|
|
193
|
-
dark2: "rgba(0, 0, 0, 0.36)", // "--
|
|
194
|
-
dark1: "rgba(0, 0, 0, 0.36)", // "--
|
|
196
|
+
light1: "rgba(0, 0, 0, 0.12)", // "--grey_100 12%",
|
|
197
|
+
light2: "rgba(0, 0, 0, 0.12)", // "--grey_100 12%",
|
|
198
|
+
dark4: "rgba(0, 0, 0, 0.36)", // "--grey_100 36%",
|
|
199
|
+
dark3: "rgba(0, 0, 0, 0.36)", // "--grey_100 36%",
|
|
200
|
+
dark2: "rgba(0, 0, 0, 0.36)", // "--grey_100 36%",
|
|
201
|
+
dark1: "rgba(0, 0, 0, 0.36)", // "--grey_100 36%",
|
|
195
202
|
},
|
|
196
203
|
shadow_04: {
|
|
197
|
-
light1: "rgba(0, 0, 0, 0.18)", // "--
|
|
198
|
-
light2: "rgba(0, 0, 0, 0.18)", // "--
|
|
199
|
-
dark4: "rgba(0, 0, 0, 0.48)", // "--
|
|
200
|
-
dark3: "rgba(0, 0, 0, 0.48)", // "--
|
|
201
|
-
dark2: "rgba(0, 0, 0, 0.48)", // "--
|
|
202
|
-
dark1: "rgba(0, 0, 0, 0.48)", // "--
|
|
204
|
+
light1: "rgba(0, 0, 0, 0.18)", // "--grey_100 18%",
|
|
205
|
+
light2: "rgba(0, 0, 0, 0.18)", // "--grey_100 18%",
|
|
206
|
+
dark4: "rgba(0, 0, 0, 0.48)", // "--grey_100 48%",
|
|
207
|
+
dark3: "rgba(0, 0, 0, 0.48)", // "--grey_100 48%",
|
|
208
|
+
dark2: "rgba(0, 0, 0, 0.48)", // "--grey_100 48%",
|
|
209
|
+
dark1: "rgba(0, 0, 0, 0.48)", // "--grey_100 48%",
|
|
203
210
|
},
|
|
204
211
|
};
|
|
@@ -22,6 +22,7 @@ export interface ColorToken {
|
|
|
22
22
|
icon_info_02: CSSPropertyColor;
|
|
23
23
|
hover: CSSPropertyColor;
|
|
24
24
|
focused: CSSPropertyColor;
|
|
25
|
+
selected: CSSPropertyColor;
|
|
25
26
|
shadow_01: CSSPropertyColor;
|
|
26
27
|
shadow_02: CSSPropertyColor;
|
|
27
28
|
shadow_03: CSSPropertyColor;
|
|
@@ -49,10 +50,7 @@ export interface ColorToken {
|
|
|
49
50
|
selectcontrol_handler_shadow: CSSPropertyColor;
|
|
50
51
|
textfield_bg: CSSPropertyColor;
|
|
51
52
|
textfield_border_error: CSSPropertyColor;
|
|
52
|
-
dropdown_option_selected: CSSPropertyColor;
|
|
53
53
|
dropdown_divider_border: CSSPropertyColor;
|
|
54
|
-
dropdown_option_activatied: CSSPropertyColor;
|
|
55
|
-
datatable_cell_selected: CSSPropertyColor;
|
|
56
54
|
datatable_border_01: CSSPropertyColor;
|
|
57
55
|
datatable_border_02: CSSPropertyColor;
|
|
58
56
|
datatable_zebra: CSSPropertyColor;
|
package/src/index.ts
CHANGED
|
@@ -1,13 +1,157 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { Box, Typography } from "@mui/material";
|
|
3
|
+
import { StoryFn, Meta } from "@storybook/react";
|
|
3
4
|
|
|
4
5
|
import Alert from "@/components/Alert";
|
|
6
|
+
import Button from "@/components/Button";
|
|
7
|
+
import theme from "@/theme";
|
|
8
|
+
import { action } from "@storybook/addon-actions";
|
|
5
9
|
|
|
6
10
|
export default {
|
|
7
11
|
title: "Components/Alert",
|
|
8
12
|
component: Alert,
|
|
9
|
-
|
|
13
|
+
argTypes: {
|
|
14
|
+
title: {
|
|
15
|
+
control: "text",
|
|
16
|
+
description: "Used to represent the title of the alert.",
|
|
17
|
+
},
|
|
18
|
+
severity: {
|
|
19
|
+
control: "radio",
|
|
20
|
+
table: {
|
|
21
|
+
defaultValue: { summary: "success" },
|
|
22
|
+
},
|
|
23
|
+
options: ["success", "info", "warning", "error", undefined],
|
|
24
|
+
description: `\`success\`, \`info\`, \`warning\`, \`error\`, \`undefined\``,
|
|
25
|
+
},
|
|
26
|
+
onClose: {
|
|
27
|
+
control: "function",
|
|
28
|
+
description: `Callback fired when the component requests to be closed.
|
|
29
|
+
When provided, a close icon button is displayed that triggers the callback when clicked.`,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
parameters: {
|
|
33
|
+
controls: {
|
|
34
|
+
include: ["title", "severity", "onClose"],
|
|
35
|
+
},
|
|
36
|
+
docs: {
|
|
37
|
+
description: {
|
|
38
|
+
component: `An alert displays a short, important message in a way that attracts the
|
|
39
|
+
user's attention without interrupting the user's task.
|
|
40
|
+
see [Material-UI Alert](https://mui.com/components/alert/)`,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
decorators: [
|
|
45
|
+
(Story) => (
|
|
46
|
+
<Box
|
|
47
|
+
sx={{
|
|
48
|
+
display: "flex",
|
|
49
|
+
flexDirection: "column",
|
|
50
|
+
padding: "3em",
|
|
51
|
+
gap: "1em",
|
|
52
|
+
}}
|
|
53
|
+
>
|
|
54
|
+
{Story()}
|
|
55
|
+
</Box>
|
|
56
|
+
),
|
|
57
|
+
],
|
|
58
|
+
} as Meta<typeof Alert>;
|
|
10
59
|
|
|
11
|
-
const
|
|
60
|
+
const AlertChildrenContentLong = () => {
|
|
61
|
+
return (
|
|
62
|
+
<Typography variant="body2_14_regular">
|
|
63
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
|
|
64
|
+
tempor incididunt ut{" "}
|
|
65
|
+
<u style={{ color: theme.palette.token.core.link_primary }}>
|
|
66
|
+
labore et dolore
|
|
67
|
+
</u>{" "}
|
|
68
|
+
magna aliqua. A diam sollicitudin tempor id eu nisl nunc mi. Auctor augue
|
|
69
|
+
mauris augue neque gravida in fermentum.
|
|
70
|
+
</Typography>
|
|
71
|
+
);
|
|
72
|
+
};
|
|
12
73
|
|
|
13
|
-
|
|
74
|
+
const AlertChildrenContentShort = () => {
|
|
75
|
+
return (
|
|
76
|
+
<Typography variant="body2_14_regular">
|
|
77
|
+
Lorem ipsum dolor sit amet, consectetur adipiscin
|
|
78
|
+
</Typography>
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const AlertBottomAction = () => {
|
|
83
|
+
return (
|
|
84
|
+
<Box sx={{ display: "flex", columnGap: "8px" }}>
|
|
85
|
+
<Button color="primary" kind="contained">
|
|
86
|
+
Button
|
|
87
|
+
</Button>
|
|
88
|
+
<Button color="secondary" kind="ghost">
|
|
89
|
+
Button
|
|
90
|
+
</Button>
|
|
91
|
+
</Box>
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const Template: StoryFn<typeof Alert> = (args) => (
|
|
96
|
+
<Alert sx={{ width: "620px" }} {...args}>
|
|
97
|
+
<AlertChildrenContentLong />
|
|
98
|
+
</Alert>
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
const Template2: StoryFn<typeof Alert> = (args) => (
|
|
102
|
+
<>
|
|
103
|
+
<Alert sx={{ width: "504px" }} {...args}>
|
|
104
|
+
<AlertChildrenContentLong />
|
|
105
|
+
</Alert>
|
|
106
|
+
<Alert sx={{ width: "620px" }} severity={args.severity} onClose={() => {}}>
|
|
107
|
+
<AlertChildrenContentLong />
|
|
108
|
+
</Alert>
|
|
109
|
+
<Alert sx={{ width: "620px" }} severity={args.severity} onClose={() => {}}>
|
|
110
|
+
<AlertChildrenContentShort />
|
|
111
|
+
</Alert>
|
|
112
|
+
<Alert sx={{ width: "620px" }} severity={args.severity}>
|
|
113
|
+
<AlertChildrenContentShort />
|
|
114
|
+
</Alert>
|
|
115
|
+
</>
|
|
116
|
+
);
|
|
117
|
+
const Template3: StoryFn<typeof Alert> = (args) => (
|
|
118
|
+
<>
|
|
119
|
+
<Alert
|
|
120
|
+
sx={{ width: "504px" }}
|
|
121
|
+
bottomAction={<AlertBottomAction />}
|
|
122
|
+
{...args}
|
|
123
|
+
>
|
|
124
|
+
<AlertChildrenContentLong />
|
|
125
|
+
</Alert>
|
|
126
|
+
</>
|
|
127
|
+
);
|
|
128
|
+
|
|
129
|
+
export const AlertBase = {
|
|
130
|
+
render: Template,
|
|
131
|
+
|
|
132
|
+
args: {
|
|
133
|
+
title: "Alert title",
|
|
134
|
+
severity: "success",
|
|
135
|
+
onClose: action("Close Button is clicked"),
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
export const AlertVariant = {
|
|
140
|
+
render: Template2,
|
|
141
|
+
|
|
142
|
+
args: {
|
|
143
|
+
title: "Alert title",
|
|
144
|
+
severity: "success",
|
|
145
|
+
onClose: action("Close Button is clicked"),
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
export const AlertWithBottomAction = {
|
|
150
|
+
render: Template3,
|
|
151
|
+
|
|
152
|
+
args: {
|
|
153
|
+
title: "Alert title",
|
|
154
|
+
severity: "success",
|
|
155
|
+
onClose: action("Close Button is clicked"),
|
|
156
|
+
},
|
|
157
|
+
};
|
|
@@ -7,11 +7,11 @@ import {
|
|
|
7
7
|
TableBody,
|
|
8
8
|
TableCell,
|
|
9
9
|
} from "@mui/material";
|
|
10
|
-
import
|
|
10
|
+
import Bell from "@lunit/design-system-icons/Bell";
|
|
11
11
|
|
|
12
12
|
import Button from "@/components/Button";
|
|
13
13
|
|
|
14
|
-
import type {
|
|
14
|
+
import type { StoryObj, StoryFn, Meta } from "@storybook/react";
|
|
15
15
|
import type { ButtonProps } from "@/components/Button/Button.types";
|
|
16
16
|
|
|
17
17
|
type Size = Pick<ButtonProps, "size">;
|
|
@@ -21,31 +21,26 @@ const sizeList: SizeValues[] = ["small", "medium", "large"];
|
|
|
21
21
|
export default {
|
|
22
22
|
title: "Components/Button",
|
|
23
23
|
component: Button,
|
|
24
|
+
args: {
|
|
25
|
+
kind: "contained",
|
|
26
|
+
children: "Text",
|
|
27
|
+
color: "primary",
|
|
28
|
+
disabled: false,
|
|
29
|
+
size: "small",
|
|
30
|
+
onClick: action("onClick"),
|
|
31
|
+
},
|
|
24
32
|
argTypes: {
|
|
25
33
|
icon: {
|
|
26
34
|
control: false,
|
|
27
35
|
description: `Use this prop when you want to add icon.
|
|
28
|
-
\n It is added to the left of the text criteria
|
|
29
|
-
\n and only Icon can be checked when used with hasIconOnly.`,
|
|
36
|
+
\n It is added to the left of the text criteria`,
|
|
30
37
|
table: {
|
|
31
38
|
defaultValue: { summary: "undefined" },
|
|
32
39
|
type: { summary: "React.ReactNode" },
|
|
33
40
|
},
|
|
34
41
|
},
|
|
35
|
-
hasIconOnly: {
|
|
36
|
-
control: {
|
|
37
|
-
type: "boolean",
|
|
38
|
-
},
|
|
39
|
-
description: `Option to handle so that only icons can be inserted
|
|
40
|
-
\n If set to false, you can add Text.`,
|
|
41
|
-
defaultValue: false,
|
|
42
|
-
table: {
|
|
43
|
-
defaultValue: { summary: "false" },
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
42
|
children: {
|
|
47
43
|
type: "string",
|
|
48
|
-
defaultValue: "Text",
|
|
49
44
|
},
|
|
50
45
|
kind: {
|
|
51
46
|
control: {
|
|
@@ -53,7 +48,6 @@ export default {
|
|
|
53
48
|
},
|
|
54
49
|
options: ["contained", "outlined", "ghost"],
|
|
55
50
|
description: "Button has three Kinds Contained, Outlined, Ghost",
|
|
56
|
-
defaultValue: "contained",
|
|
57
51
|
table: {
|
|
58
52
|
defaultValue: { summary: "contained" },
|
|
59
53
|
},
|
|
@@ -63,7 +57,6 @@ export default {
|
|
|
63
57
|
type: "radio",
|
|
64
58
|
},
|
|
65
59
|
options: ["primary", "secondary", "error"],
|
|
66
|
-
defaultValue: "primary",
|
|
67
60
|
table: {
|
|
68
61
|
defaultValue: { summary: "primary" },
|
|
69
62
|
},
|
|
@@ -72,7 +65,6 @@ export default {
|
|
|
72
65
|
control: {
|
|
73
66
|
type: "boolean",
|
|
74
67
|
},
|
|
75
|
-
defaultValue: false,
|
|
76
68
|
table: {
|
|
77
69
|
defaultValue: { summary: "false" },
|
|
78
70
|
},
|
|
@@ -82,7 +74,6 @@ export default {
|
|
|
82
74
|
type: "radio",
|
|
83
75
|
},
|
|
84
76
|
options: ["small", "medium", "large"],
|
|
85
|
-
defaultValue: "small",
|
|
86
77
|
table: {
|
|
87
78
|
defaultValue: { summary: "small" },
|
|
88
79
|
},
|
|
@@ -97,7 +88,6 @@ export default {
|
|
|
97
88
|
function: action("onClick"),
|
|
98
89
|
undefined: undefined,
|
|
99
90
|
},
|
|
100
|
-
defaultValue: "function",
|
|
101
91
|
description:
|
|
102
92
|
"It is a callback function that is called when the button is clicked.",
|
|
103
93
|
},
|
|
@@ -112,7 +102,6 @@ export default {
|
|
|
112
102
|
"kind",
|
|
113
103
|
"color",
|
|
114
104
|
"icon",
|
|
115
|
-
"hasIconOnly",
|
|
116
105
|
],
|
|
117
106
|
},
|
|
118
107
|
docs: {
|
|
@@ -122,13 +111,13 @@ export default {
|
|
|
122
111
|
},
|
|
123
112
|
},
|
|
124
113
|
},
|
|
125
|
-
} as
|
|
114
|
+
} as Meta<typeof Button>;
|
|
126
115
|
|
|
127
|
-
export const BasicButton:
|
|
128
|
-
<Button {...args}>{args.children}</Button
|
|
129
|
-
|
|
116
|
+
export const BasicButton: StoryObj<typeof Button> = {
|
|
117
|
+
render: (args) => <Button {...args}>{args.children}</Button>,
|
|
118
|
+
};
|
|
130
119
|
|
|
131
|
-
const SizeButtonTemplate:
|
|
120
|
+
const SizeButtonTemplate: StoryFn<typeof Button> = (args) => {
|
|
132
121
|
return (
|
|
133
122
|
<Table sx={{ width: 900 }}>
|
|
134
123
|
<TableHead>
|
|
@@ -174,4 +163,6 @@ const SizeButtonTemplate: ComponentStory<typeof Button> = (args) => {
|
|
|
174
163
|
);
|
|
175
164
|
};
|
|
176
165
|
|
|
177
|
-
export const Size =
|
|
166
|
+
export const Size = {
|
|
167
|
+
render: SizeButtonTemplate,
|
|
168
|
+
};
|