@rescui/typography 0.2.1 → 0.5.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/lib/create-text-cn.d.ts +9 -9
- package/lib/create-text-cn.js +15 -10
- package/lib/font-jb-sans-auto.css +32 -0
- package/lib/font-jb-sans-variable.css +8 -0
- package/lib/font-jb-sans.css +21 -0
- package/lib/hooks.d.ts +3 -3
- package/lib/index.css +324 -267
- package/lib/mixins.pcss +346 -276
- package/package.json +6 -6
package/lib/create-text-cn.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import './any';
|
|
2
2
|
import { Theme } from '@rescui/ui-contexts';
|
|
3
3
|
import './styles';
|
|
4
|
-
export declare type
|
|
5
|
-
export declare type
|
|
6
|
-
export declare type
|
|
7
|
-
export interface
|
|
4
|
+
export declare type Texts = 'rs-text-1' | 'rs-text-2' | 'rs-text-3';
|
|
5
|
+
export declare type Link = 'rs-link';
|
|
6
|
+
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';
|
|
7
|
+
export interface TextsParams {
|
|
8
8
|
paragraphOffsetAuto?: boolean;
|
|
9
9
|
hardness?: 'average' | 'hard' | 'pale';
|
|
10
10
|
}
|
|
11
|
-
export interface
|
|
11
|
+
export interface LinkParams extends Omit<TextsParams, 'paragraphOffsetAuto'> {
|
|
12
12
|
external?: boolean;
|
|
13
|
-
mode?: '
|
|
13
|
+
mode?: 'classic' | 'rock' | 'clear' | 'standalone';
|
|
14
14
|
}
|
|
15
15
|
export declare function createTextCn(theme: Theme): {
|
|
16
|
-
(type:
|
|
17
|
-
(type:
|
|
18
|
-
(type:
|
|
16
|
+
(type: Texts, params?: TextsParams): string;
|
|
17
|
+
(type: Link, params?: LinkParams): string;
|
|
18
|
+
(type: Others): string;
|
|
19
19
|
};
|
package/lib/create-text-cn.js
CHANGED
|
@@ -7,17 +7,22 @@ function createTextCn(theme) {
|
|
|
7
7
|
|
|
8
8
|
function textCn() {
|
|
9
9
|
var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'rs-text-1';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
|
|
11
|
+
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
12
|
+
_ref$paragraphOffsetA = _ref.paragraphOffsetAuto,
|
|
13
|
+
paragraphOffsetAuto = _ref$paragraphOffsetA === void 0 ? false : _ref$paragraphOffsetA,
|
|
14
|
+
_ref$hardness = _ref.hardness,
|
|
15
|
+
hardness = _ref$hardness === void 0 ? undefined : _ref$hardness,
|
|
16
|
+
_ref$external = _ref.external,
|
|
17
|
+
external = _ref$external === void 0 ? false : _ref$external,
|
|
18
|
+
_ref$mode = _ref.mode,
|
|
19
|
+
mode = _ref$mode === void 0 ? 'classic' : _ref$mode;
|
|
20
|
+
|
|
16
21
|
return bemCnFast(type)({
|
|
17
|
-
'paragraph-offset-auto':
|
|
18
|
-
hardness:
|
|
19
|
-
external:
|
|
20
|
-
mode:
|
|
22
|
+
'paragraph-offset-auto': paragraphOffsetAuto,
|
|
23
|
+
hardness: hardness,
|
|
24
|
+
external: external,
|
|
25
|
+
mode: type === 'rs-link' && mode,
|
|
21
26
|
theme: theme
|
|
22
27
|
});
|
|
23
28
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/* Light weight */
|
|
2
|
+
@font-face {
|
|
3
|
+
font-family: 'JetBrains Sans';
|
|
4
|
+
src: url('https://resources.jetbrains.com/storage/jetbrains-sans/JetBrainsSans-Light.woff2') format('woff2'), url('https://resources.jetbrains.com/storage/jetbrains-sans/JetBrainsSans-Light.woff') format('woff');
|
|
5
|
+
font-weight: 300;
|
|
6
|
+
font-style: normal;
|
|
7
|
+
}
|
|
8
|
+
/* Regular weight */
|
|
9
|
+
@font-face {
|
|
10
|
+
font-family: 'JetBrains Sans';
|
|
11
|
+
src: url('https://resources.jetbrains.com/storage/jetbrains-sans/JetBrainsSans-Regular.woff2') format('woff2'), url('https://resources.jetbrains.com/storage/jetbrains-sans/JetBrainsSans-Regular.woff') format('woff');
|
|
12
|
+
font-weight: 400;
|
|
13
|
+
font-style: normal;
|
|
14
|
+
}
|
|
15
|
+
/* SemiBold weight */
|
|
16
|
+
@font-face {
|
|
17
|
+
font-family: 'JetBrains Sans';
|
|
18
|
+
src: url('https://resources.jetbrains.com/storage/jetbrains-sans/JetBrainsSans-SemiBold.woff2') format('woff2'), url('https://resources.jetbrains.com/storage/jetbrains-sans/JetBrainsSans-SemiBold.woff') format('woff');
|
|
19
|
+
font-weight: 600;
|
|
20
|
+
font-style: normal;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@supports (font-variation-settings: normal) {
|
|
24
|
+
@font-face {
|
|
25
|
+
font-family: 'JetBrains Sans';
|
|
26
|
+
src: url('https://resources.jetbrains.com/storage/jetbrains-sans/JetBrainsSans.woff2') format('woff2 supports variations'),
|
|
27
|
+
url('https://resources.jetbrains.com/storage/jetbrains-sans/JetBrainsSans.woff2') format('woff2-variations'),
|
|
28
|
+
url('https://resources.jetbrains.com/storage/jetbrains-sans/JetBrainsSans.woff') format('woff-variations');
|
|
29
|
+
font-weight: 100 900;
|
|
30
|
+
font-style: normal;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
@font-face {
|
|
2
|
+
font-family: 'JetBrains Sans';
|
|
3
|
+
src: url('https://resources.jetbrains.com/storage/jetbrains-sans/JetBrainsSans.woff2') format('woff2 supports variations'),
|
|
4
|
+
url('https://resources.jetbrains.com/storage/jetbrains-sans/JetBrainsSans.woff2') format('woff2-variations'),
|
|
5
|
+
url('https://resources.jetbrains.com/storage/jetbrains-sans/JetBrainsSans.woff') format('woff-variations');
|
|
6
|
+
font-weight: 100 900;
|
|
7
|
+
font-style: normal;
|
|
8
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* Light weight */
|
|
2
|
+
@font-face {
|
|
3
|
+
font-family: 'JetBrains Sans';
|
|
4
|
+
src: url('https://resources.jetbrains.com/storage/jetbrains-sans/JetBrainsSans-Light.woff2') format('woff2'), url('https://resources.jetbrains.com/storage/jetbrains-sans/JetBrainsSans-Light.woff') format('woff');
|
|
5
|
+
font-weight: 300;
|
|
6
|
+
font-style: normal;
|
|
7
|
+
}
|
|
8
|
+
/* Regular weight */
|
|
9
|
+
@font-face {
|
|
10
|
+
font-family: 'JetBrains Sans';
|
|
11
|
+
src: url('https://resources.jetbrains.com/storage/jetbrains-sans/JetBrainsSans-Regular.woff2') format('woff2'), url('https://resources.jetbrains.com/storage/jetbrains-sans/JetBrainsSans-Regular.woff') format('woff');
|
|
12
|
+
font-weight: 400;
|
|
13
|
+
font-style: normal;
|
|
14
|
+
}
|
|
15
|
+
/* SemiBold weight */
|
|
16
|
+
@font-face {
|
|
17
|
+
font-family: 'JetBrains Sans';
|
|
18
|
+
src: url('https://resources.jetbrains.com/storage/jetbrains-sans/JetBrainsSans-SemiBold.woff2') format('woff2'), url('https://resources.jetbrains.com/storage/jetbrains-sans/JetBrainsSans-SemiBold.woff') format('woff');
|
|
19
|
+
font-weight: 600;
|
|
20
|
+
font-style: normal;
|
|
21
|
+
}
|
package/lib/hooks.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const useTextStyles: () => {
|
|
2
|
-
(type: import("./create-text-cn").
|
|
3
|
-
(type: "rs-link", params?: import("./create-text-cn").
|
|
4
|
-
(type: import("./create-text-cn").
|
|
2
|
+
(type: import("./create-text-cn").Texts, params?: import("./create-text-cn").TextsParams): string;
|
|
3
|
+
(type: "rs-link", params?: import("./create-text-cn").LinkParams): string;
|
|
4
|
+
(type: import("./create-text-cn").Others): string;
|
|
5
5
|
};
|