@rescui/typography 0.1.0 → 0.4.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.
- package/lib/any.d.ts +1 -0
- package/lib/create-text-cn.d.ts +19 -19
- package/lib/create-text-cn.js +12 -17
- package/lib/font-inter.css +30 -32
- 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 +5 -5
- package/lib/hooks.js +5 -3
- package/lib/index.css +280 -190
- package/lib/index.d.ts +6 -5
- package/lib/index.js +4 -12
- package/lib/mixins.pcss +278 -196
- package/lib/text-color-utils.d.ts +3 -0
- package/lib/text-color-utils.js +30 -0
- package/package.json +12 -10
- package/CHANGELOG.md +0 -30
- package/lib/create-text-cn.js.map +0 -1
- package/lib/font-inter.css.map +0 -1
- package/lib/hooks.js.map +0 -1
- package/lib/index.css.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/styles.js +0 -2
- package/lib/styles.js.map +0 -1
package/lib/any.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module 'bem-cn-fast';
|
package/lib/create-text-cn.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
import { Theme } from '@rescui/ui-contexts';
|
|
3
|
-
import './styles';
|
|
4
|
-
export declare type
|
|
5
|
-
export declare type
|
|
6
|
-
export declare type
|
|
7
|
-
export interface
|
|
8
|
-
paragraphOffsetAuto?: boolean;
|
|
9
|
-
hardness?: 'average' | 'hard' | 'pale';
|
|
10
|
-
}
|
|
11
|
-
export interface
|
|
12
|
-
external?: boolean;
|
|
13
|
-
mode?: 'text' | '
|
|
14
|
-
}
|
|
15
|
-
export declare function createTextCn(theme: Theme): {
|
|
16
|
-
(type:
|
|
17
|
-
(type:
|
|
18
|
-
(type:
|
|
19
|
-
};
|
|
1
|
+
import './any';
|
|
2
|
+
import { Theme } from '@rescui/ui-contexts';
|
|
3
|
+
import './styles';
|
|
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
|
+
paragraphOffsetAuto?: boolean;
|
|
9
|
+
hardness?: 'average' | 'hard' | 'pale';
|
|
10
|
+
}
|
|
11
|
+
export interface LinkParams extends Omit<TextsParams, 'paragraphOffsetAuto'> {
|
|
12
|
+
external?: boolean;
|
|
13
|
+
mode?: 'text' | 'clear' | 'standalone';
|
|
14
|
+
}
|
|
15
|
+
export declare function createTextCn(theme: Theme): {
|
|
16
|
+
(type: Texts, params?: TextsParams): string;
|
|
17
|
+
(type: Link, params?: LinkParams): string;
|
|
18
|
+
(type: Others): string;
|
|
19
|
+
};
|
package/lib/create-text-cn.js
CHANGED
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
import bemCnFast from 'bem-cn-fast';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
|
|
3
|
+
function createTextCn(theme) {
|
|
4
4
|
if (!theme) {
|
|
5
5
|
throw new TypeError('theme argument is required');
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
function textCn(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
hardness: undefined,
|
|
17
|
-
external: false,
|
|
18
|
-
mode: undefined
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
|
|
8
|
+
function textCn() {
|
|
9
|
+
var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'rs-text-1';
|
|
10
|
+
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
11
|
+
paragraphOffsetAuto: false,
|
|
12
|
+
hardness: undefined,
|
|
13
|
+
external: false,
|
|
14
|
+
mode: undefined
|
|
15
|
+
};
|
|
22
16
|
return bemCnFast(type)({
|
|
23
17
|
'paragraph-offset-auto': params.paragraphOffsetAuto,
|
|
24
18
|
hardness: params.hardness,
|
|
@@ -30,4 +24,5 @@ export function createTextCn(theme) {
|
|
|
30
24
|
|
|
31
25
|
return textCn;
|
|
32
26
|
}
|
|
33
|
-
|
|
27
|
+
|
|
28
|
+
export { createTextCn };
|
package/lib/font-inter.css
CHANGED
|
@@ -1,47 +1,45 @@
|
|
|
1
1
|
|
|
2
|
-
@font-face{
|
|
3
|
-
font-family:'Inter';
|
|
4
|
-
font-style:normal;
|
|
5
|
-
font-weight:300;
|
|
6
|
-
font-display:swap;
|
|
7
|
-
src:url("~inter-ui/Inter (web)/Inter-Light.woff2") format("woff2"),
|
|
2
|
+
@font-face {
|
|
3
|
+
font-family: 'Inter';
|
|
4
|
+
font-style: normal;
|
|
5
|
+
font-weight: 300;
|
|
6
|
+
font-display: swap;
|
|
7
|
+
src: url("~inter-ui/Inter (web)/Inter-Light.woff2") format("woff2"),
|
|
8
8
|
url("~inter-ui/Inter (web)/Inter-Light.woff") format("woff");
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
@font-face{
|
|
12
|
-
font-family:'Inter';
|
|
13
|
-
font-style:normal;
|
|
14
|
-
font-weight:400;
|
|
15
|
-
font-display:swap;
|
|
16
|
-
src:url("~inter-ui/Inter (web)/Inter-Regular.woff2") format("woff2"),
|
|
11
|
+
@font-face {
|
|
12
|
+
font-family: 'Inter';
|
|
13
|
+
font-style: normal;
|
|
14
|
+
font-weight: 400;
|
|
15
|
+
font-display: swap;
|
|
16
|
+
src: url("~inter-ui/Inter (web)/Inter-Regular.woff2") format("woff2"),
|
|
17
17
|
url("~inter-ui/Inter (web)/Inter-Regular.woff") format("woff");
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
@font-face{
|
|
21
|
-
font-family:'Inter';
|
|
22
|
-
font-style:normal;
|
|
23
|
-
font-weight:500;
|
|
24
|
-
font-display:swap;
|
|
25
|
-
src:url("~inter-ui/Inter (web)/Inter-Medium.woff2") format("woff2"),
|
|
20
|
+
@font-face {
|
|
21
|
+
font-family: 'Inter';
|
|
22
|
+
font-style: normal;
|
|
23
|
+
font-weight: 500;
|
|
24
|
+
font-display: swap;
|
|
25
|
+
src: url("~inter-ui/Inter (web)/Inter-Medium.woff2") format("woff2"),
|
|
26
26
|
url("~inter-ui/Inter (web)/Inter-Medium.woff") format("woff");
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
@font-face{
|
|
30
|
-
font-family:'Inter';
|
|
31
|
-
font-style:normal;
|
|
32
|
-
font-weight:600;
|
|
33
|
-
font-display:swap;
|
|
34
|
-
src:url("~inter-ui/Inter (web)/Inter-SemiBold.woff2") format("woff2"),
|
|
29
|
+
@font-face {
|
|
30
|
+
font-family: 'Inter';
|
|
31
|
+
font-style: normal;
|
|
32
|
+
font-weight: 600;
|
|
33
|
+
font-display: swap;
|
|
34
|
+
src: url("~inter-ui/Inter (web)/Inter-SemiBold.woff2") format("woff2"),
|
|
35
35
|
url("~inter-ui/Inter (web)/Inter-SemiBold.woff") format("woff");
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
@font-face{
|
|
39
|
-
font-family:'Inter';
|
|
40
|
-
font-style:normal;
|
|
41
|
-
font-weight:700;
|
|
42
|
-
font-display:swap;
|
|
43
|
-
src:url("~inter-ui/Inter (web)/Inter-Bold.woff2") format("woff2"),
|
|
38
|
+
@font-face {
|
|
39
|
+
font-family: 'Inter';
|
|
40
|
+
font-style: normal;
|
|
41
|
+
font-weight: 700;
|
|
42
|
+
font-display: swap;
|
|
43
|
+
src: url("~inter-ui/Inter (web)/Inter-Bold.woff2") format("woff2"),
|
|
44
44
|
url("~inter-ui/Inter (web)/Inter-Bold.woff") format("woff");
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
/*# sourceMappingURL=font-inter.css.map */
|
|
@@ -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
|
-
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").
|
|
5
|
-
};
|
|
1
|
+
export declare const useTextStyles: () => {
|
|
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
|
+
};
|
package/lib/hooks.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { useTheme } from '@rescui/ui-contexts';
|
|
2
|
-
import { createTextCn } from './create-text-cn';
|
|
3
|
-
|
|
2
|
+
import { createTextCn } from './create-text-cn.js';
|
|
3
|
+
|
|
4
|
+
var useTextStyles = function useTextStyles() {
|
|
4
5
|
return createTextCn(useTheme());
|
|
5
6
|
};
|
|
6
|
-
|
|
7
|
+
|
|
8
|
+
export { useTextStyles };
|