@rescui/typography 0.6.0 → 0.7.2

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.
@@ -5,22 +5,40 @@ export declare type Texts = 'rs-text-1' | 'rs-text-2' | 'rs-text-3';
5
5
  export declare type Link = 'rs-link';
6
6
  export declare type OrderedList = 'rs-ol';
7
7
  export declare type UnorderedList = 'rs-ul';
8
- export declare type Others = 'rs-super-hero' | 'rs-digits' | 'rs-hero' | 'rs-subtitle-1' | 'rs-h1' | 'rs-subtitle-2' | 'rs-h2' | 'rs-h3' | 'rs-h4' | 'rs-h5' | 'rs-overline' | 'rs-pre' | 'rs-code' | 'rs-link' | 'rs-article';
8
+ export declare type Others = 'rs-super-hero' | 'rs-digits-1' | 'rs-digits-2' | 'rs-hero' | 'rs-subtitle-1' | 'rs-h1' | 'rs-subtitle-2' | 'rs-h2' | 'rs-h3' | 'rs-h4' | 'rs-h5' | 'rs-overline' | 'rs-pre' | 'rs-code' | 'rs-link' | 'rs-article';
9
9
  export declare type Type = Texts | Link | OrderedList | Others | UnorderedList;
10
10
  export declare type Hardness = 'average' | 'hard' | 'pale';
11
11
  export declare type TextsParams = {
12
+ /**
13
+ * @default false
14
+ */
12
15
  paragraphOffsetAuto?: boolean;
16
+ /**
17
+ * @default average
18
+ */
13
19
  hardness?: Hardness;
14
20
  };
15
21
  export declare type Mode = 'classic' | 'rock' | 'clear' | 'standalone';
16
22
  export declare type LinkParams = {
23
+ /**
24
+ * @default false
25
+ */
17
26
  external?: boolean;
27
+ /**
28
+ * @default hard
29
+ */
18
30
  hardness?: Hardness;
31
+ /**
32
+ * @default clear
33
+ */
19
34
  mode?: Mode;
20
35
  };
21
36
  export declare type Alpha = 'lower' | 'upper';
22
37
  export declare type OffsetItems = 8 | 12 | 16 | 24;
23
38
  export declare type OrderedListParams = {
39
+ /**
40
+ * @default null
41
+ */
24
42
  alpha?: Alpha;
25
43
  offsetItems?: OffsetItems;
26
44
  };
@@ -1,6 +1,6 @@
1
1
  import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
2
2
  import bemCnFast from 'bem-cn-fast';
3
- var THEMED_TYPES = ['rs-super-hero', 'rs-digits', 'rs-hero', 'rs-subtitle-1', 'rs-h1', 'rs-subtitle-2', 'rs-h2', 'rs-h3', 'rs-h4', 'rs-h5', 'rs-overline', 'rs-pre', 'rs-code', 'rs-link', 'rs-article', 'rs-text-1', 'rs-text-2', 'rs-text-3', 'rs-link'];
3
+ var THEMED_TYPES = ['rs-super-hero', 'rs-digits-1', 'rs-digits-2', 'rs-hero', 'rs-subtitle-1', 'rs-h1', 'rs-subtitle-2', 'rs-h2', 'rs-h3', 'rs-h4', 'rs-h5', 'rs-overline', 'rs-pre', 'rs-code', 'rs-link', 'rs-article', 'rs-text-1', 'rs-text-2', 'rs-text-3', 'rs-link'];
4
4
 
5
5
  function createTextCn(theme) {
6
6
  if (!theme) {
@@ -24,6 +24,12 @@ function createTextCn(theme) {
24
24
  _ref$offsetItems = _ref.offsetItems,
25
25
  offsetItems = _ref$offsetItems === void 0 ? undefined : _ref$offsetItems;
26
26
 
27
+ if (type === 'rs-digits') {
28
+ // eslint-disable-next-line no-param-reassign
29
+ type = 'rs-digits-1';
30
+ console.warn("'rs-digits' style is deprecated, please use 'rs-digits-1' instead");
31
+ }
32
+
27
33
  return bemCnFast(type)({
28
34
  'paragraph-offset-auto': paragraphOffsetAuto,
29
35
  hardness: hardness,
package/lib/index.css CHANGED
@@ -43,37 +43,63 @@
43
43
  color:#FFFFFF;
44
44
  color:var(--rs-typography-color-hard, #FFFFFF);
45
45
  }
46
- .rs-digits{
46
+ .rs-digits-1{
47
47
  letter-spacing:-0.005em;
48
48
  font-variant-numeric:tabular-nums;
49
49
  font-family:'JetBrains Sans', Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
50
50
  font-family:var(--rs-font-family-headers, var(--rs-font-family-jb-sans, 'JetBrains Sans', Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif));
51
51
  font-size:69px;
52
- font-size:var(--rs-digits-font-size, 69px);
52
+ font-size:var(--rs-digits-1-font-size, 69px);
53
53
  font-weight:320;
54
54
  font-weight:var(--rs-font-weight-light, 320);
55
55
  line-height:71px;
56
- line-height:var(--rs-digits-line-height, 71px);
56
+ line-height:var(--rs-digits-1-line-height, 71px);
57
57
  }
58
58
  @media screen and (max-width: 640px){
59
- .rs-digits{
60
- --rs-digits-font-size:var(--rs-digits-font-size-mobile, 40px);
61
- --rs-digits-line-height:var(--rs-digits-line-height-mobile, 44px);
59
+ .rs-digits-1{
60
+ --rs-digits-1-font-size:var(--rs-digits-2-font-size, 40px);
61
+ --rs-digits-1-line-height:var(--rs-digits-2-line-height, 44px);
62
+ }
63
+ }
64
+ .rs-reset-letter-spacing .rs-digits-1{
62
65
  letter-spacing:normal;
66
+ }
67
+ .rs-digits-1 {
68
+ color:#19191C;
69
+ color:var(--rs-typography-color-hard, #19191C);
63
70
  }
71
+ .rs-digits-1_theme_dark{
72
+ color:#FFFFFF;
73
+ color:var(--rs-typography-color-hard, #FFFFFF);
64
74
  }
65
- .rs-reset-letter-spacing .rs-digits{
75
+ [class*='_theme_dark'] .rs-digits-1_theme_auto{
76
+ color:#FFFFFF;
77
+ color:var(--rs-typography-color-hard, #FFFFFF);
78
+ }
79
+ .rs-digits-2{
80
+ letter-spacing:-0.005em;
81
+ font-variant-numeric:tabular-nums;
82
+ font-family:'JetBrains Sans', Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
83
+ font-family:var(--rs-font-family-headers, var(--rs-font-family-jb-sans, 'JetBrains Sans', Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif));
84
+ font-size:40px;
85
+ font-size:var(--rs-digits-2-font-size, 40px);
86
+ font-weight:320;
87
+ font-weight:var(--rs-font-weight-light, 320);
88
+ line-height:44px;
89
+ line-height:var(--rs-digits-2-line-height, 44px);
90
+ }
91
+ .rs-reset-letter-spacing .rs-digits-2{
66
92
  letter-spacing:normal;
67
93
  }
68
- .rs-digits {
94
+ .rs-digits-2 {
69
95
  color:#19191C;
70
96
  color:var(--rs-typography-color-hard, #19191C);
71
97
  }
72
- .rs-digits_theme_dark{
98
+ .rs-digits-2_theme_dark{
73
99
  color:#FFFFFF;
74
100
  color:var(--rs-typography-color-hard, #FFFFFF);
75
101
  }
76
- [class*='_theme_dark'] .rs-digits_theme_auto{
102
+ [class*='_theme_dark'] .rs-digits-2_theme_auto{
77
103
  color:#FFFFFF;
78
104
  color:var(--rs-typography-color-hard, #FFFFFF);
79
105
  }
package/lib/mixins.pcss CHANGED
@@ -89,7 +89,7 @@
89
89
  margin-top:96px;
90
90
  margin-top:calc(var(--rs-flow-unit, 8px)*12);
91
91
  }
92
- @define-mixin rs-digits-base{
92
+ @define-mixin rs-digits-1-base{
93
93
  letter-spacing:-0.005em;
94
94
 
95
95
  font-variant-numeric:tabular-nums;
@@ -100,30 +100,61 @@
100
100
 
101
101
  font-size:69px;
102
102
 
103
- font-size:var(--rs-digits-font-size, 69px);
103
+ font-size:var(--rs-digits-1-font-size, 69px);
104
104
  font-weight:320;
105
105
  font-weight:var(--rs-font-weight-light, 320);
106
106
  line-height:71px;
107
- line-height:var(--rs-digits-line-height, 71px);
107
+ line-height:var(--rs-digits-1-line-height, 71px);
108
108
 
109
109
  @media screen and (max-width: 640px){
110
- --rs-digits-font-size:var(--rs-digits-font-size-mobile, 40px);
111
- --rs-digits-line-height:var(--rs-digits-line-height-mobile, 44px);
110
+ --rs-digits-1-font-size:var(--rs-digits-2-font-size, 40px);
111
+ --rs-digits-1-line-height:var(--rs-digits-2-line-height, 44px);
112
+ }
113
+
114
+ .rs-reset-letter-spacing &{
112
115
  letter-spacing:normal;
113
116
  }
117
+ }
118
+ @define-mixin rs-digits-1{
119
+ @mixin rs-digits-1-base;
120
+ @mixin rs-text-hardness-hard;
121
+ }
122
+ @define-mixin rs-digits-1-theme-dark{
123
+ @mixin rs-text-hardness-hard-theme-dark;
124
+ }
125
+ @define-mixin rs-digits-1-offset-top{
126
+ margin-top:32px;
127
+ margin-top:calc(var(--rs-flow-unit, 8px)*4);
128
+ }
129
+ @define-mixin rs-digits-2-base{
130
+ letter-spacing:-0.005em;
131
+
132
+ font-variant-numeric:tabular-nums;
133
+
134
+ font-family:'JetBrains Sans', Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
135
+
136
+ font-family:var(--rs-font-family-headers, var(--rs-font-family-jb-sans, 'JetBrains Sans', Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif));
137
+
138
+ font-size:40px;
139
+
140
+ font-size:var(--rs-digits-2-font-size, 40px);
141
+ font-weight:320;
142
+ font-weight:var(--rs-font-weight-light, 320);
143
+ line-height:44px;
144
+ line-height:var(--rs-digits-2-line-height, 44px);
114
145
 
115
146
  .rs-reset-letter-spacing &{
116
147
  letter-spacing:normal;
117
148
  }
118
149
  }
119
- @define-mixin rs-digits{
120
- @mixin rs-digits-base;
150
+ @define-mixin rs-digits-2{
151
+ @mixin rs-digits-2-base;
121
152
  @mixin rs-text-hardness-hard;
122
153
  }
123
- @define-mixin rs-digits-theme-dark{
154
+ @define-mixin rs-digits-2-theme-dark{
124
155
  @mixin rs-text-hardness-hard-theme-dark;
125
156
  }
126
- @define-mixin rs-digits-offset-top{
157
+ @define-mixin rs-digits-2-offset-top{
127
158
  margin-top:32px;
128
159
  margin-top:calc(var(--rs-flow-unit, 8px)*4);
129
160
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rescui/typography",
3
- "version": "0.6.0",
3
+ "version": "0.7.2",
4
4
  "description": "",
5
5
  "license": "Apache-2.0",
6
6
  "author": "JetBrains",
@@ -19,7 +19,7 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@babel/runtime-corejs3": "^7.14.0",
22
- "@rescui/colors": "^0.1.0",
22
+ "@rescui/colors": "^0.1.1",
23
23
  "bem-cn-fast": "^1.0.2",
24
24
  "inter-ui": "^3.15.1"
25
25
  },
@@ -28,8 +28,8 @@
28
28
  "react": ">=16.8.0 <18"
29
29
  },
30
30
  "devDependencies": {
31
- "@rescui/postcss-preset-library": "^0.0.4",
32
- "@rescui/scripts": "^0.1.4",
31
+ "@rescui/postcss-preset-library": "^0.0.5",
32
+ "@rescui/scripts": "^0.1.5",
33
33
  "@rescui/visual-regression": "^0.0.1",
34
34
  "case": "^1.6.3",
35
35
  "fs-extra": "^7.0.1",
@@ -40,5 +40,5 @@
40
40
  "build": "rescui-scripts build --no-css-modules && yarn run build-mixins && shx cp src/font-*.css lib",
41
41
  "build-mixins": "rescui-scripts postcss --glob mixins.pcss --config ./.postcssrc-mixins.js --no-clean-out && shx mv lib/mixins.css lib/mixins.pcss && shx rm lib/mixins.css.map"
42
42
  },
43
- "gitHead": "91cb43cee6ffc54aae5360a73437d97c3f4ed36d"
43
+ "gitHead": "67f695b72d13fd8445542c48f096b65656fdd7d9"
44
44
  }