@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 ADDED
@@ -0,0 +1 @@
1
+ declare module 'bem-cn-fast';
@@ -1,19 +1,19 @@
1
- /// <reference path="../src/any.d.ts" />
2
- import { Theme } from '@rescui/ui-contexts';
3
- import './styles';
4
- export declare type TTexts = 'rs-text-1' | 'rs-text-2' | 'rs-text-3';
5
- export declare type TLink = 'rs-link';
6
- export declare type TOthers = '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 ITexts {
8
- paragraphOffsetAuto?: boolean;
9
- hardness?: 'average' | 'hard' | 'pale';
10
- }
11
- export interface ILink extends Omit<ITexts, 'paragraphOffsetAuto'> {
12
- external?: boolean;
13
- mode?: 'text' | 'nude' | 'standalone';
14
- }
15
- export declare function createTextCn(theme: Theme): {
16
- (type: TTexts, params?: ITexts): string;
17
- (type: TLink, params?: ILink): string;
18
- (type: TOthers): string;
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
+ };
@@ -1,24 +1,18 @@
1
1
  import bemCnFast from 'bem-cn-fast';
2
- import './styles';
3
- export function createTextCn(theme) {
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(type, params) {
9
- if (type === void 0) {
10
- type = 'rs-text-1';
11
- }
12
-
13
- if (params === void 0) {
14
- params = {
15
- paragraphOffsetAuto: false,
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
- //# sourceMappingURL=create-text-cn.js.map
27
+
28
+ export { createTextCn };
@@ -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").TTexts, params?: import("./create-text-cn").ITexts): string;
3
- (type: "rs-link", params?: import("./create-text-cn").ILink): string;
4
- (type: import("./create-text-cn").TOthers): string;
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
- export var useTextStyles = function useTextStyles() {
2
+ import { createTextCn } from './create-text-cn.js';
3
+
4
+ var useTextStyles = function useTextStyles() {
4
5
  return createTextCn(useTheme());
5
6
  };
6
- //# sourceMappingURL=hooks.js.map
7
+
8
+ export { useTextStyles };