@channel.io/bezier-react 3.6.6 → 4.0.0-next.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.
- package/dist/cjs/components/AlphaButton/Button.js +1 -1
- package/dist/cjs/components/AlphaButton/Button.js.map +1 -1
- package/dist/cjs/components/AlphaButton/Button.module.scss.js +1 -1
- package/dist/cjs/components/AlphaFloatingButton/FloatingButton.js +1 -1
- package/dist/cjs/components/AlphaFloatingButton/FloatingButton.js.map +1 -1
- package/dist/cjs/components/AlphaFloatingButton/FloatingButton.module.scss.js +1 -1
- package/dist/cjs/components/AlphaIconButton/IconButton.module.scss.js +1 -1
- package/dist/cjs/components/Button/Button.js +1 -1
- package/dist/cjs/components/Button/Button.js.map +1 -1
- package/dist/cjs/components/Button/Button.module.scss.js +1 -1
- package/dist/cjs/components/Text/Text.js +2 -0
- package/dist/cjs/components/Text/Text.js.map +1 -1
- package/dist/cjs/packages/bezier-tokens/dist/beta/esm/darkTheme.js +20 -20
- package/dist/cjs/packages/bezier-tokens/dist/beta/esm/darkTheme.js.map +1 -1
- package/dist/cjs/packages/bezier-tokens/dist/beta/esm/lightTheme.js +20 -20
- package/dist/cjs/packages/bezier-tokens/dist/beta/esm/lightTheme.js.map +1 -1
- package/dist/cjs/styles.css +1 -1
- package/dist/esm/components/AlphaButton/Button.mjs +1 -1
- package/dist/esm/components/AlphaButton/Button.mjs.map +1 -1
- package/dist/esm/components/AlphaButton/Button.module.scss.mjs +1 -1
- package/dist/esm/components/AlphaFloatingButton/FloatingButton.mjs +1 -1
- package/dist/esm/components/AlphaFloatingButton/FloatingButton.mjs.map +1 -1
- package/dist/esm/components/AlphaFloatingButton/FloatingButton.module.scss.mjs +1 -1
- package/dist/esm/components/AlphaIconButton/IconButton.module.scss.mjs +1 -1
- package/dist/esm/components/Button/Button.mjs +1 -1
- package/dist/esm/components/Button/Button.mjs.map +1 -1
- package/dist/esm/components/Button/Button.module.scss.mjs +1 -1
- package/dist/esm/components/Text/Text.mjs +2 -0
- package/dist/esm/components/Text/Text.mjs.map +1 -1
- package/dist/esm/packages/bezier-tokens/dist/beta/esm/darkTheme.mjs +20 -20
- package/dist/esm/packages/bezier-tokens/dist/beta/esm/darkTheme.mjs.map +1 -1
- package/dist/esm/packages/bezier-tokens/dist/beta/esm/lightTheme.mjs +20 -20
- package/dist/esm/packages/bezier-tokens/dist/beta/esm/lightTheme.mjs.map +1 -1
- package/dist/esm/styles.css +1 -1
- package/dist/types/components/Text/Text.d.ts.map +1 -1
- package/dist/types/components/Text/Text.types.d.ts +8 -0
- package/dist/types/components/Text/Text.types.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/AlphaButton/Button.module.scss +49 -18
- package/src/components/AlphaButton/Button.tsx +1 -1
- package/src/components/AlphaFloatingButton/FloatingButton.module.scss +38 -5
- package/src/components/AlphaFloatingButton/FloatingButton.tsx +1 -1
- package/src/components/AlphaFloatingIconButton/FloatingIconButton.module.scss +21 -0
- package/src/components/AlphaIconButton/IconButton.module.scss +44 -13
- package/src/components/Button/Button.module.scss +61 -25
- package/src/components/Button/Button.tsx +1 -1
- package/src/components/Text/Text.module.scss +3 -2
- package/src/components/Text/Text.test.tsx +13 -0
- package/src/components/Text/Text.tsx +2 -0
- package/src/components/Text/Text.types.ts +8 -0
|
@@ -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:
|
|
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
|