@channel.io/bezier-react 3.6.5 → 4.0.0-next.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 (55) hide show
  1. package/dist/cjs/components/AlphaButton/Button.js +1 -1
  2. package/dist/cjs/components/AlphaButton/Button.js.map +1 -1
  3. package/dist/cjs/components/AlphaButton/Button.module.scss.js +1 -1
  4. package/dist/cjs/components/AlphaFloatingButton/FloatingButton.js +1 -1
  5. package/dist/cjs/components/AlphaFloatingButton/FloatingButton.js.map +1 -1
  6. package/dist/cjs/components/AlphaFloatingButton/FloatingButton.module.scss.js +1 -1
  7. package/dist/cjs/components/AlphaIconButton/IconButton.module.scss.js +1 -1
  8. package/dist/cjs/components/Button/Button.js +1 -1
  9. package/dist/cjs/components/Button/Button.js.map +1 -1
  10. package/dist/cjs/components/Button/Button.module.scss.js +1 -1
  11. package/dist/cjs/components/Text/Text.js +2 -0
  12. package/dist/cjs/components/Text/Text.js.map +1 -1
  13. package/dist/cjs/packages/bezier-tokens/dist/beta/esm/darkTheme.js +27 -20
  14. package/dist/cjs/packages/bezier-tokens/dist/beta/esm/darkTheme.js.map +1 -1
  15. package/dist/cjs/packages/bezier-tokens/dist/beta/esm/global.js +6 -0
  16. package/dist/cjs/packages/bezier-tokens/dist/beta/esm/global.js.map +1 -1
  17. package/dist/cjs/packages/bezier-tokens/dist/beta/esm/lightTheme.js +27 -20
  18. package/dist/cjs/packages/bezier-tokens/dist/beta/esm/lightTheme.js.map +1 -1
  19. package/dist/cjs/styles.css +1 -1
  20. package/dist/esm/components/AlphaButton/Button.mjs +1 -1
  21. package/dist/esm/components/AlphaButton/Button.mjs.map +1 -1
  22. package/dist/esm/components/AlphaButton/Button.module.scss.mjs +1 -1
  23. package/dist/esm/components/AlphaFloatingButton/FloatingButton.mjs +1 -1
  24. package/dist/esm/components/AlphaFloatingButton/FloatingButton.mjs.map +1 -1
  25. package/dist/esm/components/AlphaFloatingButton/FloatingButton.module.scss.mjs +1 -1
  26. package/dist/esm/components/AlphaIconButton/IconButton.module.scss.mjs +1 -1
  27. package/dist/esm/components/Button/Button.mjs +1 -1
  28. package/dist/esm/components/Button/Button.mjs.map +1 -1
  29. package/dist/esm/components/Button/Button.module.scss.mjs +1 -1
  30. package/dist/esm/components/Text/Text.mjs +2 -0
  31. package/dist/esm/components/Text/Text.mjs.map +1 -1
  32. package/dist/esm/packages/bezier-tokens/dist/beta/esm/darkTheme.mjs +27 -20
  33. package/dist/esm/packages/bezier-tokens/dist/beta/esm/darkTheme.mjs.map +1 -1
  34. package/dist/esm/packages/bezier-tokens/dist/beta/esm/global.mjs +6 -0
  35. package/dist/esm/packages/bezier-tokens/dist/beta/esm/global.mjs.map +1 -1
  36. package/dist/esm/packages/bezier-tokens/dist/beta/esm/lightTheme.mjs +27 -20
  37. package/dist/esm/packages/bezier-tokens/dist/beta/esm/lightTheme.mjs.map +1 -1
  38. package/dist/esm/styles.css +1 -1
  39. package/dist/types/components/Text/Text.d.ts.map +1 -1
  40. package/dist/types/components/Text/Text.types.d.ts +8 -0
  41. package/dist/types/components/Text/Text.types.d.ts.map +1 -1
  42. package/dist/types/types/props-helpers.d.ts +1 -1
  43. package/package.json +3 -3
  44. package/src/components/AlphaButton/Button.module.scss +49 -18
  45. package/src/components/AlphaButton/Button.tsx +1 -1
  46. package/src/components/AlphaFloatingButton/FloatingButton.module.scss +38 -5
  47. package/src/components/AlphaFloatingButton/FloatingButton.tsx +1 -1
  48. package/src/components/AlphaFloatingIconButton/FloatingIconButton.module.scss +21 -0
  49. package/src/components/AlphaIconButton/IconButton.module.scss +44 -13
  50. package/src/components/Button/Button.module.scss +61 -25
  51. package/src/components/Button/Button.tsx +1 -1
  52. package/src/components/Text/Text.module.scss +3 -2
  53. package/src/components/Text/Text.test.tsx +13 -0
  54. package/src/components/Text/Text.tsx +2 -0
  55. package/src/components/Text/Text.types.ts +8 -0
@@ -60,6 +60,7 @@ $chromatic-colors: 'blue', 'red', 'green', 'cobalt', 'orange', 'pink', 'purple';
60
60
  background-color: $background-color;
61
61
  }
62
62
  }
63
+
63
64
  }
64
65
 
65
66
  &:where(.variant-secondary) {
@@ -81,6 +82,10 @@ $chromatic-colors: 'blue', 'red', 'green', 'cobalt', 'orange', 'pink', 'purple';
81
82
  background-color: $background-color;
82
83
  }
83
84
  }
85
+
86
+ &:where(.color-blue) {
87
+ background-color: var(--color-fill-neutral-light);
88
+ }
84
89
  }
85
90
 
86
91
  &:where(.variant-tertiary) {
@@ -98,6 +103,7 @@ $chromatic-colors: 'blue', 'red', 'green', 'cobalt', 'orange', 'pink', 'purple';
98
103
  &:where(.color-white-absolute) {
99
104
  background-color: var(--color-fill-absolute-white-transparent);
100
105
  }
106
+
101
107
  }
102
108
 
103
109
  /* color */
@@ -116,6 +122,15 @@ $chromatic-colors: 'blue', 'red', 'green', 'cobalt', 'orange', 'pink', 'purple';
116
122
  &:where(.color-white-absolute) {
117
123
  color: var(--color-text-absolute-black);
118
124
  }
125
+
126
+ &:where(.color-blue) {
127
+ color: var(--color-text-inverse);
128
+ background-color: var(--color-fill-neutral-heaviest);
129
+
130
+ & :is(.ButtonIcon, .ButtonLoader) {
131
+ color: var(--color-icon-inverse-heavier);
132
+ }
133
+ }
119
134
  }
120
135
 
121
136
  &:where(.variant-secondary, .variant-tertiary) {
@@ -148,6 +163,22 @@ $chromatic-colors: 'blue', 'red', 'green', 'cobalt', 'orange', 'pink', 'purple';
148
163
  color: var(--color-icon-neutral);
149
164
  }
150
165
  }
166
+
167
+ &:where(.variant-secondary.color-blue) {
168
+ color: var(--color-text-neutral);
169
+
170
+ & :is(.ButtonIcon, .ButtonLoader) {
171
+ color: var(--color-icon-neutral-heavy);
172
+ }
173
+ }
174
+
175
+ &:where(.variant-tertiary.color-blue) {
176
+ color: var(--color-text-neutral-light);
177
+
178
+ & :is(.ButtonIcon, .ButtonLoader) {
179
+ color: var(--color-icon-neutral-heavy);
180
+ }
181
+ }
151
182
  }
152
183
 
153
184
  &:where(.variant-tertiary, .variant-secondary):where(.color-white-absolute) {
@@ -158,19 +189,7 @@ $chromatic-colors: 'blue', 'red', 'green', 'cobalt', 'orange', 'pink', 'purple';
158
189
 
159
190
  /* border-radius */
160
191
  &:where(.shape-rectangle) {
161
- $border-radius-by-size: (
162
- xs: var(--radius-6),
163
- s: var(--radius-7),
164
- m: var(--radius-10),
165
- l: var(--radius-12),
166
- xl: var(--radius-14),
167
- );
168
-
169
- @each $size, $border-radius in $border-radius-by-size {
170
- &:where(.size-#{$size}) {
171
- border-radius: $border-radius;
172
- }
173
- }
192
+ border-radius: 9999px;
174
193
  }
175
194
 
176
195
  &:where(.shape-circle) {
@@ -196,6 +215,10 @@ $chromatic-colors: 'blue', 'red', 'green', 'cobalt', 'orange', 'pink', 'purple';
196
215
  &:where(.color-light-grey) {
197
216
  background-color: var(--color-fill-neutral-heavier-hovered);
198
217
  }
218
+
219
+ &:where(.color-blue) {
220
+ background-color: var(--color-fill-neutral-heaviest-hovered);
221
+ }
199
222
  }
200
223
 
201
224
  &:where(.variant-secondary) {
@@ -209,6 +232,10 @@ $chromatic-colors: 'blue', 'red', 'green', 'cobalt', 'orange', 'pink', 'purple';
209
232
  &:where(.color-dark-grey, .color-light-grey) {
210
233
  background-color: var(--color-fill-neutral-light-hovered);
211
234
  }
235
+
236
+ &:where(.color-blue) {
237
+ background-color: var(--color-fill-neutral-light-hovered);
238
+ }
212
239
  }
213
240
 
214
241
  &:where(.variant-tertiary) {
@@ -228,6 +255,10 @@ $chromatic-colors: 'blue', 'red', 'green', 'cobalt', 'orange', 'pink', 'purple';
228
255
  &:where(.color-white-absolute) {
229
256
  background-color: var(--color-fill-absolute-white-transparent-hovered);
230
257
  }
258
+
259
+ &:where(.color-blue) {
260
+ background-color: var(--color-fill-neutral-heaviest-hovered);
261
+ }
231
262
  }
232
263
 
233
264
  &:where(.color-dark-grey):where(.variant-secondary, .variant-tertiary) {
@@ -13,7 +13,7 @@ $active-selector: ':where(.active, :hover):where(:not(:disabled))';
13
13
  &:where(.size-xs) {
14
14
  min-width: 20px;
15
15
  height: 20px;
16
- padding: 0 2px;
16
+ padding: 0 4px;
17
17
 
18
18
  &:where(.style-floating, .style-floating-alt) {
19
19
  padding: 0 7px;
@@ -23,7 +23,7 @@ $active-selector: ':where(.active, :hover):where(:not(:disabled))';
23
23
  &:where(.size-s) {
24
24
  min-width: 24px;
25
25
  height: 24px;
26
- padding: 0 4px;
26
+ padding: 0 6px;
27
27
 
28
28
  &:where(.style-floating, .style-floating-alt) {
29
29
  padding: 0 9px;
@@ -61,7 +61,7 @@ $active-selector: ':where(.active, :hover):where(:not(:disabled))';
61
61
  }
62
62
 
63
63
  &:where(.size-xs, .size-s) {
64
- & :where(.ButtonText) {
64
+ & .ButtonText {
65
65
  padding: 0 3px;
66
66
  }
67
67
  }
@@ -71,7 +71,7 @@ $active-selector: ':where(.active, :hover):where(:not(:disabled))';
71
71
  gap: 2px;
72
72
  }
73
73
 
74
- & :where(.ButtonText) {
74
+ & .ButtonText {
75
75
  padding: 0 4px;
76
76
  }
77
77
  }
@@ -111,6 +111,19 @@ $active-selector: ':where(.active, :hover):where(:not(:disabled))';
111
111
  color: var(--color-text-inverse);
112
112
  background-color: var(--color-fill-neutral-heaviest);
113
113
  }
114
+
115
+ &:where(.color-blue) {
116
+ color: var(--color-text-inverse);
117
+ background-color: var(--color-fill-neutral-heaviest);
118
+
119
+ & :is(.ButtonIcon, .ButtonLoader) {
120
+ color: var(--color-icon-inverse-heavier);
121
+ }
122
+
123
+ &#{$active-selector} {
124
+ background-color: var(--color-fill-neutral-heaviest-hovered);
125
+ }
126
+ }
114
127
  }
115
128
 
116
129
  &:where(.style-secondary) {
@@ -153,6 +166,19 @@ $active-selector: ':where(.active, :hover):where(:not(:disabled))';
153
166
  background-color: var(--color-fill-neutral-light-hovered);
154
167
  }
155
168
  }
169
+
170
+ &:where(.color-blue) {
171
+ color: var(--color-text-neutral);
172
+ background-color: var(--color-fill-neutral-light);
173
+
174
+ & :is(.ButtonIcon, .ButtonLoader) {
175
+ color: var(--color-icon-neutral-heavy);
176
+ }
177
+
178
+ &#{$active-selector} {
179
+ background-color: var(--color-fill-neutral-light-hovered);
180
+ }
181
+ }
156
182
  }
157
183
 
158
184
  &:where(.style-tertiary) {
@@ -193,9 +219,23 @@ $active-selector: ':where(.active, :hover):where(:not(:disabled))';
193
219
  background-color: var(--color-fill-neutral-light-hovered);
194
220
  }
195
221
  }
222
+
223
+ &:where(.color-blue) {
224
+ color: var(--color-text-neutral-light);
225
+
226
+ & :is(.ButtonIcon, .ButtonLoader) {
227
+ color: var(--color-icon-neutral-heavy);
228
+ }
229
+
230
+ &#{$active-selector} {
231
+ background-color: var(--color-fill-neutral-heaviest-hovered);
232
+ }
233
+ }
196
234
  }
197
235
 
198
236
  &:where(.style-floating, .style-floating-alt) {
237
+ overflow: hidden;
238
+
199
239
  @each $color-variant in $chromatic-color-variants {
200
240
  &:where(.color-#{$color-variant}) {
201
241
  color: var(--color-text-absolute-white);
@@ -225,36 +265,32 @@ $active-selector: ':where(.active, :hover):where(:not(:disabled))';
225
265
  color: var(--color-text-neutral);
226
266
  background-color: var(--color-fill-bright);
227
267
  }
228
- }
229
-
230
- /* Effect */
231
- &:where(.style-primary, .style-secondary, .style-tertiary) {
232
- &:where(.size-xs) {
233
- border-radius: var(--radius-6);
234
- }
235
268
 
236
- &:where(.size-s, .size-m) {
237
- border-radius: var(--radius-8);
238
- }
269
+ &:where(.color-blue) {
270
+ color: var(--color-text-inverse);
271
+ background-color: var(--color-fill-neutral-heaviest);
239
272
 
240
- &:where(.size-l) {
241
- border-radius: var(--radius-12);
242
- }
273
+ & :is(.ButtonIcon, .ButtonLoader) {
274
+ color: var(--color-icon-inverse-heavier);
275
+ }
243
276
 
244
- &:where(.size-xl) {
245
- border-radius: var(--radius-16);
277
+ &#{$active-selector} {
278
+ background-color: var(--color-fill-neutral-heaviest-hovered);
279
+ }
246
280
  }
247
281
  }
248
282
 
249
- &:where(.style-floating) {
250
- overflow: hidden;
283
+ /* Effect */
284
+ &:where(
285
+ .style-primary,
286
+ .style-secondary,
287
+ .style-tertiary,
288
+ .style-floating,
289
+ .style-floating-alt
290
+ ) {
251
291
  border-radius: 9999px;
252
292
  }
253
293
 
254
- &:where(.style-floating-alt) {
255
- border-radius: var(--radius-8);
256
- }
257
-
258
294
  &:where(.style-primary.color-blue:focus-visible) {
259
295
  outline: 3px solid var(--color-state-action-light);
260
296
  }
@@ -150,7 +150,7 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
150
150
  <Text
151
151
  className={styles.ButtonText}
152
152
  typo={getTypography(size)}
153
- bold
153
+ fontWeight={500}
154
154
  >
155
155
  {text}
156
156
  </Text>
@@ -4,20 +4,21 @@ $typo-sizes: 11, 12, 13, 14, 15, 16, 17, 18, 22, 24, 30, 36;
4
4
 
5
5
  .Text {
6
6
  --b-text-color: initial;
7
+ --b-text-font-weight: 400;
7
8
  --b-text-line-clamp: 1;
8
9
  --b-text-line-height: initial;
9
10
  --b-text-font-size: initial;
10
11
  --b-text-letter-spacing: initial;
11
12
 
12
13
  font-size: var(--b-text-font-size);
13
- font-weight: 400;
14
+ font-weight: var(--b-text-font-weight);
14
15
  font-style: normal;
15
16
  line-height: var(--b-text-line-height);
16
17
  color: var(--b-text-color);
17
18
  letter-spacing: var(--b-text-letter-spacing);
18
19
 
19
20
  &:where(.bold) {
20
- font-weight: 700;
21
+ --b-text-font-weight: 700;
21
22
  }
22
23
 
23
24
  &:where(.italic) {
@@ -29,6 +29,19 @@ describe('Text', () => {
29
29
  expect(rendered).toHaveClass(styles.italic)
30
30
  })
31
31
 
32
+ it('should receives font weight style', () => {
33
+ const { getByText } = renderComponent({ fontWeight: 500 })
34
+ const rendered = getByText(TEXT)
35
+ expect(rendered).toHaveStyle('--b-text-font-weight: 500')
36
+ })
37
+
38
+ it('should prioritize font weight over bold', () => {
39
+ const { getByText } = renderComponent({ bold: true, fontWeight: 500 })
40
+ const rendered = getByText(TEXT)
41
+ expect(rendered).toHaveClass(styles.bold)
42
+ expect(rendered).toHaveStyle('--b-text-font-weight: 500')
43
+ })
44
+
32
45
  it('should receives truncated style', () => {
33
46
  const { getByText } = renderComponent({ truncated: true })
34
47
  const rendered = getByText(TEXT)
@@ -38,6 +38,7 @@ export const Text = forwardRef<HTMLElement, TextProps>(
38
38
  typo = '15',
39
39
  color,
40
40
  bold,
41
+ fontWeight,
41
42
  italic,
42
43
  truncated,
43
44
  align,
@@ -51,6 +52,7 @@ export const Text = forwardRef<HTMLElement, TextProps>(
51
52
  ref: forwardedRef,
52
53
  style: {
53
54
  '--b-text-color': colorTokenCssVar(color),
55
+ '--b-text-font-weight': fontWeight,
54
56
  '--b-text-line-clamp': isMultiLineTruncated ? truncated : undefined,
55
57
  ...marginStyles.style,
56
58
  ...style,
@@ -22,6 +22,7 @@ type Typography =
22
22
  | '36'
23
23
 
24
24
  type TextAlign = 'left' | 'center' | 'right'
25
+ type TextFontWeight = 400 | 500 | 600 | 700
25
26
 
26
27
  interface TextOwnProps {
27
28
  /**
@@ -38,6 +39,13 @@ interface TextOwnProps {
38
39
  * @default false
39
40
  */
40
41
  bold?: boolean
42
+ /**
43
+ * Font weight of the text.
44
+ * If `bold` and `fontWeight` are used together, `fontWeight` takes precedence.
45
+ * This prop is currently intended for internal Bezier component usage.
46
+ * @internal
47
+ */
48
+ fontWeight?: TextFontWeight
41
49
  /**
42
50
  * Whether the text is italic.
43
51
  * @default false