@rescui/typography 0.19.0 → 0.20.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.
@@ -1,63 +1,50 @@
1
1
  import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
2
- import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
3
2
  import { useThemeWithUndefined } from '@rescui/ui-contexts';
4
3
  import cn from 'classnames';
5
4
  import styles from './index-moduled.p.module.css.js';
6
- var TEXT_BASES = ['rs-digits-1', 'rs-digits-2', 'rs-super-hero', 'rs-middle-hero', 'rs-hero', 'rs-subtitle-1', 'rs-subtitle-2', 'rs-h1', 'rs-h2', 'rs-h3', 'rs-h4', 'rs-h5', 'rs-overline', 'rs-text-1', 'rs-text-2', 'rs-text-3'];
5
+ const TEXT_BASES = ['rs-digits-1', 'rs-digits-2', 'rs-super-hero', 'rs-middle-hero', 'rs-hero', 'rs-subtitle-1', 'rs-subtitle-2', 'rs-h1', 'rs-h2', 'rs-h3', 'rs-h4', 'rs-h5', 'rs-overline', 'rs-text-1', 'rs-text-2', 'rs-text-3'];
7
6
 
8
7
  function createTextCn(theme) {
9
8
  // eslint-disable-next-line complexity
10
9
  function textCn() {
11
- var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'rs-text-1';
12
-
13
- var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
14
- _ref$paragraphOffsetA = _ref.paragraphOffsetAuto,
15
- paragraphOffsetAuto = _ref$paragraphOffsetA === void 0 ? false : _ref$paragraphOffsetA,
16
- _ref$hardness = _ref.hardness,
17
- hardness = _ref$hardness === void 0 ? undefined : _ref$hardness,
18
- _ref$external = _ref.external,
19
- external = _ref$external === void 0 ? false : _ref$external,
20
- _ref$mode = _ref.mode,
21
- mode = _ref$mode === void 0 ? 'classic' : _ref$mode,
22
- _ref$alpha = _ref.alpha,
23
- alpha = _ref$alpha === void 0 ? undefined : _ref$alpha,
24
- _ref$offsetItems = _ref.offsetItems,
25
- offsetItems = _ref$offsetItems === void 0 ? undefined : _ref$offsetItems;
10
+ let type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'rs-text-1';
11
+ let {
12
+ paragraphOffsetAuto = false,
13
+ hardness = undefined,
14
+ external = false,
15
+ mode = 'classic',
16
+ alpha = undefined,
17
+ offsetItems = undefined
18
+ } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
26
19
 
27
20
  if (type === 'rs-digits') {
28
21
  // eslint-disable-next-line no-param-reassign
29
22
  type = 'rs-digits-1';
30
- console.warn("'rs-digits' style is deprecated, please use 'rs-digits-1' instead");
23
+ console.warn(`'rs-digits' style is deprecated, please use 'rs-digits-1' instead`);
31
24
  }
32
25
 
33
26
  if (_includesInstanceProperty(TEXT_BASES).call(TEXT_BASES, type)) {
34
- return cn(styles[type], theme && styles["rs-typography_theme_".concat(theme)], styles["rs-text_hardness_".concat(hardness !== null && hardness !== void 0 ? hardness : 'auto')], paragraphOffsetAuto && styles['rs-text_paragraph-offset-auto']);
27
+ return cn(styles[type], theme && styles[`rs-typography_theme_${theme}`], styles[`rs-text_hardness_${hardness ?? 'auto'}`], paragraphOffsetAuto && styles['rs-text_paragraph-offset-auto']);
35
28
  }
36
29
 
37
30
  if (type === 'rs-link') {
38
- return cn(styles[type], styles["rs-link_mode_".concat(mode)], hardness && styles["rs-link_hardness_".concat(hardness)], external && styles["rs-link_external"], theme && styles["rs-typography_theme_".concat(theme)]);
31
+ return cn(styles[type], styles[`rs-link_mode_${mode}`], hardness && styles[`rs-link_hardness_${hardness}`], external && styles[`rs-link_external`], theme && styles[`rs-typography_theme_${theme}`]);
39
32
  }
40
33
 
41
34
  if (type === 'rs-ul' || type === 'rs-ol') {
42
- var _context;
43
-
44
- return cn(styles[type], alpha && styles["rs-ol_alpha_".concat(alpha)], offsetItems && styles[_concatInstanceProperty(_context = "".concat(type, "_offset-items_")).call(_context, offsetItems)]);
35
+ return cn(styles[type], alpha && styles[`rs-ol_alpha_${alpha}`], offsetItems && styles[`${type}_offset-items_${offsetItems}`]);
45
36
  }
46
37
 
47
- return cn(styles[type], theme && styles["rs-typography_theme_".concat(theme)]);
38
+ return cn(styles[type], theme && styles[`rs-typography_theme_${theme}`]);
48
39
  }
49
40
 
50
41
  return textCn;
51
42
  }
52
43
 
53
- var textCn = createTextCn();
44
+ const textCn = createTextCn();
54
45
 
55
- var useTextStyles = function useTextStyles() {
56
- return createTextCn(useThemeWithUndefined());
57
- };
46
+ const useTextStyles = () => createTextCn(useThemeWithUndefined());
58
47
 
59
- var colorCn = function colorCn(color) {
60
- return styles["rs-text_color_".concat(color)];
61
- };
48
+ const colorCn = color => styles[`rs-text_color_${color}`];
62
49
 
63
50
  export { colorCn, createTextCn, textCn, useTextStyles };
@@ -1,24 +1,24 @@
1
1
  /* Light weight */
2
2
  @font-face {
3
3
  font-family: 'JetBrains Sans';
4
- src: url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.308/webfonts/JetBrainsSans-Light.woff2') format('woff2'),
5
- url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.308/webfonts/JetBrainsSans-Light.woff') format('woff');
4
+ src: url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.309/webfonts/JetBrainsSans-Light.woff2') format('woff2'),
5
+ url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.309/webfonts/JetBrainsSans-Light.woff') format('woff');
6
6
  font-weight: 300;
7
7
  font-style: normal;
8
8
  }
9
9
  /* Regular weight */
10
10
  @font-face {
11
11
  font-family: 'JetBrains Sans';
12
- src: url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.308/webfonts/JetBrainsSans-Regular.woff2') format('woff2'),
13
- url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.308/webfonts/JetBrainsSans-Regular.woff') format('woff');
12
+ src: url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.309/webfonts/JetBrainsSans-Regular.woff2') format('woff2'),
13
+ url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.309/webfonts/JetBrainsSans-Regular.woff') format('woff');
14
14
  font-weight: 400;
15
15
  font-style: normal;
16
16
  }
17
17
  /* SemiBold weight */
18
18
  @font-face {
19
19
  font-family: 'JetBrains Sans';
20
- src: url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.308/webfonts/JetBrainsSans-SemiBold.woff2') format('woff2'),
21
- url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.308/webfonts/JetBrainsSans-SemiBold.woff') format('woff');
20
+ src: url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.309/webfonts/JetBrainsSans-SemiBold.woff2') format('woff2'),
21
+ url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.309/webfonts/JetBrainsSans-SemiBold.woff') format('woff');
22
22
  font-weight: 600;
23
23
  font-style: normal;
24
24
  }
@@ -26,9 +26,9 @@
26
26
  @supports (font-variation-settings: normal) {
27
27
  @font-face {
28
28
  font-family: 'JetBrains Sans';
29
- src: url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.308/variable/JetBrainsSans%5Bwght%5D.woff2') format('woff2 supports variations'),
30
- url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.308/variable/JetBrainsSans%5Bwght%5D.woff2') format('woff2-variations'),
31
- url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.308/variable/JetBrainsSans%5Bwght%5D.ttf') format("truetype-variations");
29
+ src: url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.309/variable/JetBrainsSans%5Bwght%5D.woff2') format('woff2 supports variations'),
30
+ url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.309/variable/JetBrainsSans%5Bwght%5D.woff2') format('woff2-variations'),
31
+ url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.309/variable/JetBrainsSans%5Bwght%5D.ttf') format("truetype-variations");
32
32
 
33
33
  font-weight: 100 900;
34
34
  font-style: normal;
@@ -1,24 +1,24 @@
1
1
  /* Light weight */
2
2
  @font-face {
3
3
  font-family: 'JetBrains Sans';
4
- src: url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.308/webfonts/JetBrainsSans-Light.woff2') format('woff2'),
5
- url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.308/webfonts/JetBrainsSans-Light.woff') format('woff');
4
+ src: url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.309/webfonts/JetBrainsSans-Light.woff2') format('woff2'),
5
+ url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.309/webfonts/JetBrainsSans-Light.woff') format('woff');
6
6
  font-weight: 300;
7
7
  font-style: normal;
8
8
  }
9
9
  /* Regular weight */
10
10
  @font-face {
11
11
  font-family: 'JetBrains Sans';
12
- src: url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.308/webfonts/JetBrainsSans-Regular.woff2') format('woff2'),
13
- url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.308/webfonts/JetBrainsSans-Regular.woff') format('woff');
12
+ src: url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.309/webfonts/JetBrainsSans-Regular.woff2') format('woff2'),
13
+ url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.309/webfonts/JetBrainsSans-Regular.woff') format('woff');
14
14
  font-weight: 400;
15
15
  font-style: normal;
16
16
  }
17
17
  /* SemiBold weight */
18
18
  @font-face {
19
19
  font-family: 'JetBrains Sans';
20
- src: url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.308/webfonts/JetBrainsSans-SemiBold.woff2') format('woff2'),
21
- url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.308/webfonts/JetBrainsSans-SemiBold.woff') format('woff');
20
+ src: url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.309/webfonts/JetBrainsSans-SemiBold.woff2') format('woff2'),
21
+ url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.309/webfonts/JetBrainsSans-SemiBold.woff') format('woff');
22
22
  font-weight: 600;
23
23
  font-style: normal;
24
24
  }
@@ -26,9 +26,9 @@
26
26
  @supports (font-variation-settings: normal) {
27
27
  @font-face {
28
28
  font-family: 'JetBrains Sans';
29
- src: url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.308/variable/JetBrainsSans%5Bwght%5D.woff2') format('woff2 supports variations'),
30
- url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.308/variable/JetBrainsSans%5Bwght%5D.woff2') format('woff2-variations'),
31
- url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.308/variable/JetBrainsSans%5Bwght%5D.ttf') format("truetype-variations");
29
+ src: url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.309/variable/JetBrainsSans%5Bwght%5D.woff2') format('woff2 supports variations'),
30
+ url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.309/variable/JetBrainsSans%5Bwght%5D.woff2') format('woff2-variations'),
31
+ url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.309/variable/JetBrainsSans%5Bwght%5D.ttf') format("truetype-variations");
32
32
 
33
33
  font-weight: 100 900;
34
34
  font-style: normal;
@@ -1,8 +1,8 @@
1
1
  /* Light weight */
2
2
  @font-face {
3
3
  font-family: 'JetBrains Sans';
4
- src: url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.308/webfonts/JetBrainsSans-Light.woff2') format('woff2'),
5
- url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.308/webfonts/JetBrainsSans-Light.woff') format('woff');
4
+ src: url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.309/webfonts/JetBrainsSans-Light.woff2') format('woff2'),
5
+ url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.309/webfonts/JetBrainsSans-Light.woff') format('woff');
6
6
 
7
7
  font-weight: 300;
8
8
  font-style: normal;
@@ -10,8 +10,8 @@
10
10
  /* Regular weight */
11
11
  @font-face {
12
12
  font-family: 'JetBrains Sans';
13
- src: url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.308/webfonts/JetBrainsSans-Regular.woff2') format('woff2'),
14
- url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.308/webfonts/JetBrainsSans-Regular.woff') format('woff');
13
+ src: url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.309/webfonts/JetBrainsSans-Regular.woff2') format('woff2'),
14
+ url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.309/webfonts/JetBrainsSans-Regular.woff') format('woff');
15
15
 
16
16
  font-weight: 400;
17
17
  font-style: normal;
@@ -19,8 +19,8 @@
19
19
  /* SemiBold weight */
20
20
  @font-face {
21
21
  font-family: 'JetBrains Sans';
22
- src: url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.308/webfonts/JetBrainsSans-SemiBold.woff2') format('woff2'),
23
- url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.308/webfonts/JetBrainsSans-SemiBold.woff') format('woff');
22
+ src: url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.309/webfonts/JetBrainsSans-SemiBold.woff2') format('woff2'),
23
+ url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.309/webfonts/JetBrainsSans-SemiBold.woff') format('woff');
24
24
 
25
25
  font-weight: 600;
26
26
  font-style: normal;
@@ -1,8 +1,8 @@
1
1
  @font-face {
2
2
  font-family: 'JetBrains Sans';
3
- src: url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.308/variable/JetBrainsSans%5Bwght%5D.woff2') format('woff2 supports variations'),
4
- url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.308/variable/JetBrainsSans%5Bwght%5D.woff2') format('woff2-variations'),
5
- url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.308/variable/JetBrainsSans%5Bwght%5D.ttf') format("truetype-variations");
3
+ src: url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.309/variable/JetBrainsSans%5Bwght%5D.woff2') format('woff2 supports variations'),
4
+ url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.309/variable/JetBrainsSans%5Bwght%5D.woff2') format('woff2-variations'),
5
+ url('https://resources.jetbrains.com.cn/storage/jetbrains-sans/google-fonts/v1.309/variable/JetBrainsSans%5Bwght%5D.ttf') format("truetype-variations");
6
6
 
7
7
  font-weight: 100 900;
8
8
  font-style: normal;
@@ -1,8 +1,8 @@
1
1
  @font-face {
2
2
  font-family: 'JetBrains Sans';
3
- src: url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.308/variable/JetBrainsSans%5Bwght%5D.woff2') format('woff2 supports variations'),
4
- url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.308/variable/JetBrainsSans%5Bwght%5D.woff2') format('woff2-variations'),
5
- url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.308/variable/JetBrainsSans%5Bwght%5D.ttf') format("truetype-variations");
3
+ src: url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.309/variable/JetBrainsSans%5Bwght%5D.woff2') format('woff2 supports variations'),
4
+ url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.309/variable/JetBrainsSans%5Bwght%5D.woff2') format('woff2-variations'),
5
+ url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.309/variable/JetBrainsSans%5Bwght%5D.ttf') format("truetype-variations");
6
6
 
7
7
  font-weight: 100 900;
8
8
  font-style: normal;
@@ -1,8 +1,8 @@
1
1
  /* Light weight */
2
2
  @font-face {
3
3
  font-family: 'JetBrains Sans';
4
- src: url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.308/webfonts/JetBrainsSans-Light.woff2') format('woff2'),
5
- url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.308/webfonts/JetBrainsSans-Light.woff') format('woff');
4
+ src: url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.309/webfonts/JetBrainsSans-Light.woff2') format('woff2'),
5
+ url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.309/webfonts/JetBrainsSans-Light.woff') format('woff');
6
6
 
7
7
  font-weight: 300;
8
8
  font-style: normal;
@@ -10,8 +10,8 @@
10
10
  /* Regular weight */
11
11
  @font-face {
12
12
  font-family: 'JetBrains Sans';
13
- src: url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.308/webfonts/JetBrainsSans-Regular.woff2') format('woff2'),
14
- url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.308/webfonts/JetBrainsSans-Regular.woff') format('woff');
13
+ src: url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.309/webfonts/JetBrainsSans-Regular.woff2') format('woff2'),
14
+ url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.309/webfonts/JetBrainsSans-Regular.woff') format('woff');
15
15
 
16
16
  font-weight: 400;
17
17
  font-style: normal;
@@ -19,8 +19,8 @@
19
19
  /* SemiBold weight */
20
20
  @font-face {
21
21
  font-family: 'JetBrains Sans';
22
- src: url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.308/webfonts/JetBrainsSans-SemiBold.woff2') format('woff2'),
23
- url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.308/webfonts/JetBrainsSans-SemiBold.woff') format('woff');
22
+ src: url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.309/webfonts/JetBrainsSans-SemiBold.woff2') format('woff2'),
23
+ url('https://resources.jetbrains.com/storage/jetbrains-sans/google-fonts/v1.309/webfonts/JetBrainsSans-SemiBold.woff') format('woff');
24
24
 
25
25
  font-weight: 600;
26
26
  font-style: normal;