@fluentui-react-native/text 0.12.1 → 0.14.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/CHANGELOG.json +52 -1
- package/CHANGELOG.md +27 -2
- package/MIGRATION.md +98 -0
- package/README.md +5 -0
- package/SPEC.md +235 -0
- package/assets/Text_example_block_win32.png +0 -0
- package/assets/Text_example_customized_win32.png +0 -0
- package/assets/Text_example_inline_win32.png +0 -0
- package/assets/Text_example_pressable_win32.png +0 -0
- package/assets/Text_example_underlined_win32.png +0 -0
- package/assets/Text_example_variants_win32.png +0 -0
- package/lib/Text.d.ts +2 -3
- package/lib/Text.d.ts.map +1 -1
- package/lib/Text.js +79 -15
- package/lib/Text.js.map +1 -1
- package/lib/Text.types.d.ts +79 -13
- package/lib/Text.types.d.ts.map +1 -1
- package/lib/Text.types.js +1 -1
- package/lib/Text.types.js.map +1 -1
- package/lib/TextTokens.d.ts +3 -0
- package/lib/TextTokens.d.ts.map +1 -0
- package/lib/TextTokens.js +7 -0
- package/lib/TextTokens.js.map +1 -0
- package/lib/Variants.d.ts +14 -0
- package/lib/Variants.d.ts.map +1 -0
- package/lib/Variants.js +16 -0
- package/lib/Variants.js.map +1 -0
- package/lib/Variants.win32.d.ts +14 -0
- package/lib/Variants.win32.d.ts.map +1 -0
- package/lib/Variants.win32.js +41 -0
- package/lib/Variants.win32.js.map +1 -0
- package/lib/__tests__/Text.test.js +42 -40
- package/lib/__tests__/Text.test.js.map +1 -1
- package/lib/deprecated/Text.d.ts +5 -0
- package/lib/deprecated/Text.d.ts.map +1 -0
- package/lib/deprecated/Text.js +18 -0
- package/lib/deprecated/Text.js.map +1 -0
- package/lib/{Text.settings.d.ts → deprecated/Text.settings.d.ts} +0 -0
- package/lib/deprecated/Text.settings.d.ts.map +1 -0
- package/lib/{Text.settings.js → deprecated/Text.settings.js} +0 -0
- package/lib/deprecated/Text.settings.js.map +1 -0
- package/lib/deprecated/Text.types.d.ts +17 -0
- package/lib/deprecated/Text.types.d.ts.map +1 -0
- package/lib/deprecated/Text.types.js +2 -0
- package/lib/deprecated/Text.types.js.map +1 -0
- package/lib/index.d.ts +6 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -2
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Text.d.ts +2 -3
- package/lib-commonjs/Text.d.ts.map +1 -1
- package/lib-commonjs/Text.js +82 -15
- package/lib-commonjs/Text.js.map +1 -1
- package/lib-commonjs/Text.types.d.ts +79 -13
- package/lib-commonjs/Text.types.d.ts.map +1 -1
- package/lib-commonjs/Text.types.js +1 -1
- package/lib-commonjs/Text.types.js.map +1 -1
- package/lib-commonjs/TextTokens.d.ts +3 -0
- package/lib-commonjs/TextTokens.d.ts.map +1 -0
- package/lib-commonjs/TextTokens.js +10 -0
- package/lib-commonjs/TextTokens.js.map +1 -0
- package/lib-commonjs/Variants.d.ts +14 -0
- package/lib-commonjs/Variants.d.ts.map +1 -0
- package/lib-commonjs/Variants.js +19 -0
- package/lib-commonjs/Variants.js.map +1 -0
- package/lib-commonjs/Variants.win32.d.ts +14 -0
- package/lib-commonjs/Variants.win32.d.ts.map +1 -0
- package/lib-commonjs/Variants.win32.js +44 -0
- package/lib-commonjs/Variants.win32.js.map +1 -0
- package/lib-commonjs/__tests__/Text.test.js +41 -39
- package/lib-commonjs/__tests__/Text.test.js.map +1 -1
- package/lib-commonjs/deprecated/Text.d.ts +5 -0
- package/lib-commonjs/deprecated/Text.d.ts.map +1 -0
- package/lib-commonjs/deprecated/Text.js +21 -0
- package/lib-commonjs/deprecated/Text.js.map +1 -0
- package/lib-commonjs/{Text.settings.d.ts → deprecated/Text.settings.d.ts} +0 -0
- package/lib-commonjs/deprecated/Text.settings.d.ts.map +1 -0
- package/lib-commonjs/{Text.settings.js → deprecated/Text.settings.js} +0 -0
- package/lib-commonjs/deprecated/Text.settings.js.map +1 -0
- package/lib-commonjs/deprecated/Text.types.d.ts +17 -0
- package/lib-commonjs/deprecated/Text.types.d.ts.map +1 -0
- package/lib-commonjs/deprecated/Text.types.js +5 -0
- package/lib-commonjs/deprecated/Text.types.js.map +1 -0
- package/lib-commonjs/index.d.ts +6 -3
- package/lib-commonjs/index.d.ts.map +1 -1
- package/lib-commonjs/index.js +21 -4
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +6 -3
- package/src/Text.tsx +106 -16
- package/src/Text.types.ts +91 -15
- package/src/TextTokens.ts +10 -0
- package/src/Variants.ts +16 -0
- package/src/Variants.win32.ts +41 -0
- package/src/__tests__/Text.test.tsx +55 -60
- package/src/__tests__/__snapshots__/Text.test.tsx.snap +39 -4
- package/src/{Text.settings.ts → deprecated/Text.settings.ts} +0 -0
- package/src/deprecated/Text.tsx +19 -0
- package/src/deprecated/Text.types.ts +21 -0
- package/src/index.ts +22 -3
- package/lib/Text.settings.d.ts.map +0 -1
- package/lib/Text.settings.js.map +0 -1
- package/lib-commonjs/Text.settings.d.ts.map +0 -1
- package/lib-commonjs/Text.settings.js.map +0 -1
package/lib/Text.types.d.ts
CHANGED
|
@@ -1,17 +1,83 @@
|
|
|
1
|
-
import { FontTokens, FontVariantTokens, IForegroundColorTokens
|
|
2
|
-
import { ITextProps
|
|
3
|
-
|
|
1
|
+
import { FontTokens, FontVariantTokens, IForegroundColorTokens } from '@fluentui-react-native/framework';
|
|
2
|
+
import { ITextProps } from '@fluentui-react-native/adapters';
|
|
3
|
+
import { ColorValue, TextStyle } from 'react-native';
|
|
4
|
+
export declare const textName = "Text";
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
+
* Text tokens, these are the internally configurable values for Text elements. In particular these
|
|
7
|
+
* drive decisions on how to build the styles
|
|
6
8
|
*/
|
|
7
|
-
export declare type
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export declare type
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
export declare type TextTokens = Omit<FontTokens, 'fontFamily'> & IForegroundColorTokens & Omit<TextStyle, 'fontSize' | 'fontWeight' | 'color'>;
|
|
10
|
+
export declare type TextAlign = 'start' | 'center' | 'end' | 'justify';
|
|
11
|
+
export declare type TextFont = 'base' | 'monospace' | 'numeric';
|
|
12
|
+
export declare type TextSize = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | 1000;
|
|
13
|
+
export declare type TextWeight = 'regular' | 'medium' | 'semibold' | 'bold';
|
|
14
|
+
/**
|
|
15
|
+
* Text props, based off of the standard react-native TextProps with some new extensions
|
|
16
|
+
*/
|
|
17
|
+
export declare type TextProps<TBase = ITextProps> = TBase & FontVariantTokens & {
|
|
18
|
+
/**
|
|
19
|
+
* foreground text color
|
|
20
|
+
*/
|
|
21
|
+
color?: ColorValue;
|
|
22
|
+
/**
|
|
23
|
+
* Aligns text based on the parent container.
|
|
24
|
+
*
|
|
25
|
+
* @defaultValue start
|
|
26
|
+
*/
|
|
27
|
+
align?: TextAlign;
|
|
28
|
+
/**
|
|
29
|
+
* Applies a block display for the content.
|
|
30
|
+
*
|
|
31
|
+
* @defaultValue false
|
|
32
|
+
*/
|
|
33
|
+
block?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Applies the font family to the content.
|
|
36
|
+
*
|
|
37
|
+
* @defaultValue base
|
|
38
|
+
*/
|
|
39
|
+
font?: TextFont;
|
|
40
|
+
/**
|
|
41
|
+
* Applies the italic font style to the content.
|
|
42
|
+
*
|
|
43
|
+
* @defaultValue false
|
|
44
|
+
*/
|
|
45
|
+
italic?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Applies the strikethrough text decoration to the content.
|
|
48
|
+
*
|
|
49
|
+
* @defaultValue false
|
|
50
|
+
*/
|
|
51
|
+
strikethrough?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Applies font size and line height based on the theme tokens.
|
|
54
|
+
*
|
|
55
|
+
* @defaultValue 300
|
|
56
|
+
*/
|
|
57
|
+
size?: TextSize;
|
|
58
|
+
/**
|
|
59
|
+
* Truncate overflowing text for block displays.
|
|
60
|
+
*
|
|
61
|
+
* @defaultValue false
|
|
62
|
+
*/
|
|
63
|
+
truncate?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Applies the underline text decoration to the content.
|
|
66
|
+
*
|
|
67
|
+
* @defaultValue false
|
|
68
|
+
*/
|
|
69
|
+
underline?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Applies font weight to the content.
|
|
72
|
+
*
|
|
73
|
+
* @defaultValue regular
|
|
74
|
+
*/
|
|
75
|
+
weight?: TextWeight;
|
|
76
|
+
/**
|
|
77
|
+
* Wraps the text content on white spaces.
|
|
78
|
+
*
|
|
79
|
+
* @defaultValue true
|
|
80
|
+
*/
|
|
81
|
+
wrap?: boolean;
|
|
16
82
|
};
|
|
17
83
|
//# sourceMappingURL=Text.types.d.ts.map
|
package/lib/Text.types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.types.d.ts","sourceRoot":"","sources":["../src/Text.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,
|
|
1
|
+
{"version":3,"file":"Text.types.d.ts","sourceRoot":"","sources":["../src/Text.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AACzG,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAErD,eAAO,MAAM,QAAQ,SAAS,CAAC;AAE/B;;;GAGG;AACH,oBAAY,UAAU,GAAG,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,GAAG,sBAAsB,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,GAAG,YAAY,GAAG,OAAO,CAAC,CAAC;AAExI,oBAAY,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAC;AAC/D,oBAAY,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,CAAC;AACxD,oBAAY,QAAQ,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;AAClF,oBAAY,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC;AAEpE;;GAEG;AACH,oBAAY,SAAS,CAAC,KAAK,GAAG,UAAU,IAAI,KAAK,GAC/C,iBAAiB,GAAG;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IAEnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;;OAIG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAEhB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;;OAIG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAEhB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IAEpB;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC"}
|
package/lib/Text.types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export var textName = '
|
|
1
|
+
export var textName = 'Text';
|
|
2
2
|
//# sourceMappingURL=Text.types.js.map
|
package/lib/Text.types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.types.js","sourceRoot":"","sources":["../src/Text.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Text.types.js","sourceRoot":"","sources":["../src/Text.types.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,IAAM,QAAQ,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextTokens.d.ts","sourceRoot":"","sources":["../src/TextTokens.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,UAAU,EAAE,MAAM,cAAc,CAAC;AAEpD,eAAO,MAAM,aAAa,kEAMzB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { buildUseTokens } from '@fluentui-react-native/framework';
|
|
2
|
+
import { textName } from './Text.types';
|
|
3
|
+
export var useTextTokens = buildUseTokens(function (t) { return ({
|
|
4
|
+
variant: 'secondaryStandard',
|
|
5
|
+
color: t.colors.bodyText,
|
|
6
|
+
}); }, textName);
|
|
7
|
+
//# sourceMappingURL=TextTokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextTokens.js","sourceRoot":"","sources":["../src/TextTokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAc,MAAM,cAAc,CAAC;AAEpD,MAAM,CAAC,IAAM,aAAa,GAAG,cAAc,CACzC,UAAC,CAAC,IAAK,OAAA,CAAC;IACN,OAAO,EAAE,mBAAmB;IAC5B,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ;CACzB,CAAC,EAHK,CAGL,EACF,QAAQ,CACT,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const Caption1: import("@fluentui-react-native/use-tokens").CustomizableComponent<import("./Text.types").TextProps<import("@fluentui-react-native/adapters").ITextProps>, import("./Text.types").TextTokens, import("@fluentui-react-native/theme-types").Theme>;
|
|
2
|
+
export declare const Body1: import("@fluentui-react-native/use-tokens").CustomizableComponent<import("./Text.types").TextProps<import("@fluentui-react-native/adapters").ITextProps>, import("./Text.types").TextTokens, import("@fluentui-react-native/theme-types").Theme>;
|
|
3
|
+
export declare const Body1Strong: import("@fluentui-react-native/use-tokens").CustomizableComponent<import("./Text.types").TextProps<import("@fluentui-react-native/adapters").ITextProps>, import("./Text.types").TextTokens, import("@fluentui-react-native/theme-types").Theme>;
|
|
4
|
+
export declare const Body2: import("@fluentui-react-native/use-tokens").CustomizableComponent<import("./Text.types").TextProps<import("@fluentui-react-native/adapters").ITextProps>, import("./Text.types").TextTokens, import("@fluentui-react-native/theme-types").Theme>;
|
|
5
|
+
export declare const Body2Strong: import("@fluentui-react-native/use-tokens").CustomizableComponent<import("./Text.types").TextProps<import("@fluentui-react-native/adapters").ITextProps>, import("./Text.types").TextTokens, import("@fluentui-react-native/theme-types").Theme>;
|
|
6
|
+
export declare const Subtitle1: import("@fluentui-react-native/use-tokens").CustomizableComponent<import("./Text.types").TextProps<import("@fluentui-react-native/adapters").ITextProps>, import("./Text.types").TextTokens, import("@fluentui-react-native/theme-types").Theme>;
|
|
7
|
+
export declare const Subtitle1Strong: import("@fluentui-react-native/use-tokens").CustomizableComponent<import("./Text.types").TextProps<import("@fluentui-react-native/adapters").ITextProps>, import("./Text.types").TextTokens, import("@fluentui-react-native/theme-types").Theme>;
|
|
8
|
+
export declare const Subtitle2: import("@fluentui-react-native/use-tokens").CustomizableComponent<import("./Text.types").TextProps<import("@fluentui-react-native/adapters").ITextProps>, import("./Text.types").TextTokens, import("@fluentui-react-native/theme-types").Theme>;
|
|
9
|
+
export declare const Subtitle2Strong: import("@fluentui-react-native/use-tokens").CustomizableComponent<import("./Text.types").TextProps<import("@fluentui-react-native/adapters").ITextProps>, import("./Text.types").TextTokens, import("@fluentui-react-native/theme-types").Theme>;
|
|
10
|
+
export declare const Title1: import("@fluentui-react-native/use-tokens").CustomizableComponent<import("./Text.types").TextProps<import("@fluentui-react-native/adapters").ITextProps>, import("./Text.types").TextTokens, import("@fluentui-react-native/theme-types").Theme>;
|
|
11
|
+
export declare const Title1Strong: import("@fluentui-react-native/use-tokens").CustomizableComponent<import("./Text.types").TextProps<import("@fluentui-react-native/adapters").ITextProps>, import("./Text.types").TextTokens, import("@fluentui-react-native/theme-types").Theme>;
|
|
12
|
+
export declare const LargeTitle: import("@fluentui-react-native/use-tokens").CustomizableComponent<import("./Text.types").TextProps<import("@fluentui-react-native/adapters").ITextProps>, import("./Text.types").TextTokens, import("@fluentui-react-native/theme-types").Theme>;
|
|
13
|
+
export declare const Display: import("@fluentui-react-native/use-tokens").CustomizableComponent<import("./Text.types").TextProps<import("@fluentui-react-native/adapters").ITextProps>, import("./Text.types").TextTokens, import("@fluentui-react-native/theme-types").Theme>;
|
|
14
|
+
//# sourceMappingURL=Variants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Variants.d.ts","sourceRoot":"","sources":["../src/Variants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ,kPAAO,CAAC;AAC7B,eAAO,MAAM,KAAK,kPAAO,CAAC;AAC1B,eAAO,MAAM,WAAW,kPAAO,CAAC;AAChC,eAAO,MAAM,KAAK,kPAAO,CAAC;AAC1B,eAAO,MAAM,WAAW,kPAAO,CAAC;AAChC,eAAO,MAAM,SAAS,kPAAO,CAAC;AAC9B,eAAO,MAAM,eAAe,kPAAO,CAAC;AACpC,eAAO,MAAM,SAAS,kPAAO,CAAC;AAC9B,eAAO,MAAM,eAAe,kPAAO,CAAC;AACpC,eAAO,MAAM,MAAM,kPAAO,CAAC;AAC3B,eAAO,MAAM,YAAY,kPAAO,CAAC;AACjC,eAAO,MAAM,UAAU,kPAAO,CAAC;AAC/B,eAAO,MAAM,OAAO,kPAAO,CAAC"}
|
package/lib/Variants.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Text } from './Text';
|
|
2
|
+
// stubbed out for other platforms for which variant alias tokens aren't defined
|
|
3
|
+
export var Caption1 = Text;
|
|
4
|
+
export var Body1 = Text;
|
|
5
|
+
export var Body1Strong = Text;
|
|
6
|
+
export var Body2 = Text;
|
|
7
|
+
export var Body2Strong = Text;
|
|
8
|
+
export var Subtitle1 = Text;
|
|
9
|
+
export var Subtitle1Strong = Text;
|
|
10
|
+
export var Subtitle2 = Text;
|
|
11
|
+
export var Subtitle2Strong = Text;
|
|
12
|
+
export var Title1 = Text;
|
|
13
|
+
export var Title1Strong = Text;
|
|
14
|
+
export var LargeTitle = Text;
|
|
15
|
+
export var Display = Text;
|
|
16
|
+
//# sourceMappingURL=Variants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Variants.js","sourceRoot":"","sources":["../src/Variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,gFAAgF;AAChF,MAAM,CAAC,IAAM,QAAQ,GAAG,IAAI,CAAC;AAC7B,MAAM,CAAC,IAAM,KAAK,GAAG,IAAI,CAAC;AAC1B,MAAM,CAAC,IAAM,WAAW,GAAG,IAAI,CAAC;AAChC,MAAM,CAAC,IAAM,KAAK,GAAG,IAAI,CAAC;AAC1B,MAAM,CAAC,IAAM,WAAW,GAAG,IAAI,CAAC;AAChC,MAAM,CAAC,IAAM,SAAS,GAAG,IAAI,CAAC;AAC9B,MAAM,CAAC,IAAM,eAAe,GAAG,IAAI,CAAC;AACpC,MAAM,CAAC,IAAM,SAAS,GAAG,IAAI,CAAC;AAC9B,MAAM,CAAC,IAAM,eAAe,GAAG,IAAI,CAAC;AACpC,MAAM,CAAC,IAAM,MAAM,GAAG,IAAI,CAAC;AAC3B,MAAM,CAAC,IAAM,YAAY,GAAG,IAAI,CAAC;AACjC,MAAM,CAAC,IAAM,UAAU,GAAG,IAAI,CAAC;AAC/B,MAAM,CAAC,IAAM,OAAO,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const Caption1: import("@fluentui-react-native/use-tokens").CustomizableComponent<import("./Text.types").TextProps<import("@fluentui-react-native/adapters").ITextProps>, import("./Text.types").TextTokens, import("@fluentui-react-native/theme-types").Theme>;
|
|
2
|
+
export declare const Body1: import("@fluentui-react-native/use-tokens").CustomizableComponent<import("./Text.types").TextProps<import("@fluentui-react-native/adapters").ITextProps>, import("./Text.types").TextTokens, import("@fluentui-react-native/theme-types").Theme>;
|
|
3
|
+
export declare const Body1Strong: import("@fluentui-react-native/use-tokens").CustomizableComponent<import("./Text.types").TextProps<import("@fluentui-react-native/adapters").ITextProps>, import("./Text.types").TextTokens, import("@fluentui-react-native/theme-types").Theme>;
|
|
4
|
+
export declare const Body2: import("@fluentui-react-native/use-tokens").CustomizableComponent<import("./Text.types").TextProps<import("@fluentui-react-native/adapters").ITextProps>, import("./Text.types").TextTokens, import("@fluentui-react-native/theme-types").Theme>;
|
|
5
|
+
export declare const Body2Strong: import("@fluentui-react-native/use-tokens").CustomizableComponent<import("./Text.types").TextProps<import("@fluentui-react-native/adapters").ITextProps>, import("./Text.types").TextTokens, import("@fluentui-react-native/theme-types").Theme>;
|
|
6
|
+
export declare const Subtitle1: import("@fluentui-react-native/use-tokens").CustomizableComponent<import("./Text.types").TextProps<import("@fluentui-react-native/adapters").ITextProps>, import("./Text.types").TextTokens, import("@fluentui-react-native/theme-types").Theme>;
|
|
7
|
+
export declare const Subtitle1Strong: import("@fluentui-react-native/use-tokens").CustomizableComponent<import("./Text.types").TextProps<import("@fluentui-react-native/adapters").ITextProps>, import("./Text.types").TextTokens, import("@fluentui-react-native/theme-types").Theme>;
|
|
8
|
+
export declare const Subtitle2: import("@fluentui-react-native/use-tokens").CustomizableComponent<import("./Text.types").TextProps<import("@fluentui-react-native/adapters").ITextProps>, import("./Text.types").TextTokens, import("@fluentui-react-native/theme-types").Theme>;
|
|
9
|
+
export declare const Subtitle2Strong: import("@fluentui-react-native/use-tokens").CustomizableComponent<import("./Text.types").TextProps<import("@fluentui-react-native/adapters").ITextProps>, import("./Text.types").TextTokens, import("@fluentui-react-native/theme-types").Theme>;
|
|
10
|
+
export declare const Title1: import("@fluentui-react-native/use-tokens").CustomizableComponent<import("./Text.types").TextProps<import("@fluentui-react-native/adapters").ITextProps>, import("./Text.types").TextTokens, import("@fluentui-react-native/theme-types").Theme>;
|
|
11
|
+
export declare const Title1Strong: import("@fluentui-react-native/use-tokens").CustomizableComponent<import("./Text.types").TextProps<import("@fluentui-react-native/adapters").ITextProps>, import("./Text.types").TextTokens, import("@fluentui-react-native/theme-types").Theme>;
|
|
12
|
+
export declare const LargeTitle: import("@fluentui-react-native/use-tokens").CustomizableComponent<import("./Text.types").TextProps<import("@fluentui-react-native/adapters").ITextProps>, import("./Text.types").TextTokens, import("@fluentui-react-native/theme-types").Theme>;
|
|
13
|
+
export declare const Display: import("@fluentui-react-native/use-tokens").CustomizableComponent<import("./Text.types").TextProps<import("@fluentui-react-native/adapters").ITextProps>, import("./Text.types").TextTokens, import("@fluentui-react-native/theme-types").Theme>;
|
|
14
|
+
//# sourceMappingURL=Variants.win32.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Variants.win32.d.ts","sourceRoot":"","sources":["../src/Variants.win32.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,kPAEnB,CAAC;AACH,eAAO,MAAM,KAAK,kPAEhB,CAAC;AACH,eAAO,MAAM,WAAW,kPAEtB,CAAC;AACH,eAAO,MAAM,KAAK,kPAEhB,CAAC;AACH,eAAO,MAAM,WAAW,kPAEtB,CAAC;AACH,eAAO,MAAM,SAAS,kPAEpB,CAAC;AACH,eAAO,MAAM,eAAe,kPAE1B,CAAC;AACH,eAAO,MAAM,SAAS,kPAEpB,CAAC;AACH,eAAO,MAAM,eAAe,kPAE1B,CAAC;AACH,eAAO,MAAM,MAAM,kPAEjB,CAAC;AACH,eAAO,MAAM,YAAY,kPAEvB,CAAC;AACH,eAAO,MAAM,UAAU,kPAErB,CAAC;AACH,eAAO,MAAM,OAAO,kPAElB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Text } from './Text';
|
|
2
|
+
export var Caption1 = Text.customize({
|
|
3
|
+
variant: 'caption1',
|
|
4
|
+
});
|
|
5
|
+
export var Body1 = Text.customize({
|
|
6
|
+
variant: 'body1',
|
|
7
|
+
});
|
|
8
|
+
export var Body1Strong = Text.customize({
|
|
9
|
+
variant: 'body1Strong',
|
|
10
|
+
});
|
|
11
|
+
export var Body2 = Text.customize({
|
|
12
|
+
variant: 'body2',
|
|
13
|
+
});
|
|
14
|
+
export var Body2Strong = Text.customize({
|
|
15
|
+
variant: 'body2Strong',
|
|
16
|
+
});
|
|
17
|
+
export var Subtitle1 = Text.customize({
|
|
18
|
+
variant: 'subtitle1',
|
|
19
|
+
});
|
|
20
|
+
export var Subtitle1Strong = Text.customize({
|
|
21
|
+
variant: 'subtitle1Strong',
|
|
22
|
+
});
|
|
23
|
+
export var Subtitle2 = Text.customize({
|
|
24
|
+
variant: 'subtitle2',
|
|
25
|
+
});
|
|
26
|
+
export var Subtitle2Strong = Text.customize({
|
|
27
|
+
variant: 'subtitle2Strong',
|
|
28
|
+
});
|
|
29
|
+
export var Title1 = Text.customize({
|
|
30
|
+
variant: 'title1',
|
|
31
|
+
});
|
|
32
|
+
export var Title1Strong = Text.customize({
|
|
33
|
+
variant: 'title1Strong',
|
|
34
|
+
});
|
|
35
|
+
export var LargeTitle = Text.customize({
|
|
36
|
+
variant: 'largeTitle',
|
|
37
|
+
});
|
|
38
|
+
export var Display = Text.customize({
|
|
39
|
+
variant: 'display',
|
|
40
|
+
});
|
|
41
|
+
//# sourceMappingURL=Variants.win32.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Variants.win32.js","sourceRoot":"","sources":["../src/Variants.win32.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,MAAM,CAAC,IAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC;IACrC,OAAO,EAAE,UAAU;CACpB,CAAC,CAAC;AACH,MAAM,CAAC,IAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC;IAClC,OAAO,EAAE,OAAO;CACjB,CAAC,CAAC;AACH,MAAM,CAAC,IAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC;IACxC,OAAO,EAAE,aAAa;CACvB,CAAC,CAAC;AACH,MAAM,CAAC,IAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC;IAClC,OAAO,EAAE,OAAO;CACjB,CAAC,CAAC;AACH,MAAM,CAAC,IAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC;IACxC,OAAO,EAAE,aAAa;CACvB,CAAC,CAAC;AACH,MAAM,CAAC,IAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;IACtC,OAAO,EAAE,WAAW;CACrB,CAAC,CAAC;AACH,MAAM,CAAC,IAAM,eAAe,GAAG,IAAI,CAAC,SAAS,CAAC;IAC5C,OAAO,EAAE,iBAAiB;CAC3B,CAAC,CAAC;AACH,MAAM,CAAC,IAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;IACtC,OAAO,EAAE,WAAW;CACrB,CAAC,CAAC;AACH,MAAM,CAAC,IAAM,eAAe,GAAG,IAAI,CAAC,SAAS,CAAC;IAC5C,OAAO,EAAE,iBAAiB;CAC3B,CAAC,CAAC;AACH,MAAM,CAAC,IAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC;IACnC,OAAO,EAAE,QAAQ;CAClB,CAAC,CAAC;AACH,MAAM,CAAC,IAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC;IACzC,OAAO,EAAE,cAAc;CACxB,CAAC,CAAC;AACH,MAAM,CAAC,IAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC;IACvC,OAAO,EAAE,YAAY;CACtB,CAAC,CAAC;AACH,MAAM,CAAC,IAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC;IACpC,OAAO,EAAE,SAAS;CACnB,CAAC,CAAC"}
|
|
@@ -1,48 +1,50 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { Text } from '
|
|
2
|
+
import { Text } from '../Text';
|
|
3
3
|
import * as renderer from 'react-test-renderer';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
.create(React.createElement(Text, {
|
|
12
|
-
.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var BoldText = Text.customize({
|
|
17
|
-
tokens: {
|
|
4
|
+
import { checkRenderConsistency, checkReRender } from '@fluentui-react-native/test-tools';
|
|
5
|
+
describe('Text component tests', function () {
|
|
6
|
+
it('Text default', function () {
|
|
7
|
+
var tree = renderer.create(React.createElement(Text, null, "Text default")).toJSON();
|
|
8
|
+
expect(tree).toMatchSnapshot();
|
|
9
|
+
});
|
|
10
|
+
it('Text all props', function () {
|
|
11
|
+
var tree = renderer.create(React.createElement(Text, { variant: "bodyStandard" }, "All props")).toJSON();
|
|
12
|
+
expect(tree).toMatchSnapshot();
|
|
13
|
+
});
|
|
14
|
+
it('Text all tokens', function () {
|
|
15
|
+
var BoldText = Text.customize({
|
|
18
16
|
fontFamily: 'Wingdings',
|
|
19
17
|
fontWeight: '900',
|
|
20
18
|
fontSize: 20,
|
|
21
|
-
}
|
|
19
|
+
});
|
|
20
|
+
var tree = renderer.create(React.createElement(BoldText, null, "All tokens")).toJSON();
|
|
21
|
+
expect(tree).toMatchSnapshot();
|
|
22
|
+
});
|
|
23
|
+
it('Text simple rendering does not invalidate styling', function () {
|
|
24
|
+
checkRenderConsistency(function () { return React.createElement(Text, null, "Default"); });
|
|
25
|
+
checkRenderConsistency(function () { return React.createElement(Text, { variant: "headerStandard" }, "Default"); });
|
|
26
|
+
});
|
|
27
|
+
it('Text re-renders correctly', function () {
|
|
28
|
+
checkReRender(function () { return React.createElement(Text, null, "Default"); });
|
|
29
|
+
checkReRender(function () { return React.createElement(Text, { variant: "headerStandard" }, "Default"); });
|
|
30
|
+
});
|
|
31
|
+
it('Text shares produced styles across multiple renders', function () {
|
|
32
|
+
var style = { color: 'black' };
|
|
33
|
+
checkRenderConsistency(function () { return React.createElement(Text, { style: style }, "Default"); });
|
|
34
|
+
checkRenderConsistency(function () { return (React.createElement(Text, { style: style, variant: "headerStandard" }, "Default")); });
|
|
35
|
+
});
|
|
36
|
+
it('Text re-renders correctly with style', function () {
|
|
37
|
+
var style = { color: 'blue' };
|
|
38
|
+
checkReRender(function () { return React.createElement(Text, { style: style }, "Default"); });
|
|
39
|
+
checkReRender(function () { return (React.createElement(Text, { style: style, variant: "headerStandard" }, "Default")); });
|
|
40
|
+
});
|
|
41
|
+
it('Text variants render correctly with style', function () {
|
|
42
|
+
var style = {
|
|
43
|
+
marginBottom: 8,
|
|
44
|
+
marginTop: 4,
|
|
45
|
+
};
|
|
46
|
+
var tree = renderer.create(React.createElement(Text, { variant: "heroLargeSemibold", color: "blue", style: style }, "Header Text"));
|
|
47
|
+
expect(tree).toMatchSnapshot();
|
|
22
48
|
});
|
|
23
|
-
var tree = renderer.create(React.createElement(BoldText, null, "All tokens")).toJSON();
|
|
24
|
-
expect(tree).toMatchSnapshot();
|
|
25
|
-
});
|
|
26
|
-
it('Text simple rendering does not invalidate styling', function () {
|
|
27
|
-
checkRenderConsistency(function () { return React.createElement(Text, null, "Default"); });
|
|
28
|
-
checkRenderConsistency(function () { return React.createElement(Text, { disabled: true }, "Default"); });
|
|
29
|
-
checkRenderConsistency(function () { return React.createElement(Text, { variant: "headerStandard" }, "Default"); });
|
|
30
|
-
});
|
|
31
|
-
it('Text re-renders correctly', function () {
|
|
32
|
-
checkReRender(function () { return React.createElement(Text, null, "Default"); });
|
|
33
|
-
checkReRender(function () { return React.createElement(Text, { disabled: true }, "Default"); });
|
|
34
|
-
checkReRender(function () { return React.createElement(Text, { variant: "headerStandard" }, "Default"); });
|
|
35
|
-
});
|
|
36
|
-
it('Text shares produced styles across multiple renders', function () {
|
|
37
|
-
var style = { color: 'black' };
|
|
38
|
-
checkRenderConsistency(function () { return React.createElement(Text, { style: style }, "Default"); });
|
|
39
|
-
checkRenderConsistency(function () { return (React.createElement(Text, { style: style, disabled: true }, "Default")); });
|
|
40
|
-
checkRenderConsistency(function () { return (React.createElement(Text, { style: style, variant: "headerStandard" }, "Default")); });
|
|
41
|
-
});
|
|
42
|
-
it('Text re-renders correctly with style', function () {
|
|
43
|
-
var style = { color: 'blue' };
|
|
44
|
-
checkReRender(function () { return React.createElement(Text, { style: style }, "Default"); });
|
|
45
|
-
checkReRender(function () { return (React.createElement(Text, { style: style, disabled: true }, "Default")); });
|
|
46
|
-
checkReRender(function () { return (React.createElement(Text, { style: style, variant: "headerStandard" }, "Default")); });
|
|
47
49
|
});
|
|
48
50
|
//# sourceMappingURL=Text.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.test.js","sourceRoot":"","sources":["../../src/__tests__/Text.test.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Text.test.js","sourceRoot":"","sources":["../../src/__tests__/Text.test.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAE1F,QAAQ,CAAC,sBAAsB,EAAE;IAC/B,EAAE,CAAC,cAAc,EAAE;QACjB,IAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,oBAAC,IAAI,uBAAoB,CAAC,CAAC,MAAM,EAAE,CAAC;QACjE,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gBAAgB,EAAE;QACnB,IAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,oBAAC,IAAI,IAAC,OAAO,EAAC,cAAc,gBAAiB,CAAC,CAAC,MAAM,EAAE,CAAC;QACrF,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iBAAiB,EAAE;QACpB,IAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC;YAC9B,UAAU,EAAE,WAAW;YACvB,UAAU,EAAE,KAAK;YACjB,QAAQ,EAAE,EAAE;SACb,CAAC,CAAC;QACH,IAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,oBAAC,QAAQ,qBAAsB,CAAC,CAAC,MAAM,EAAE,CAAC;QACvE,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mDAAmD,EAAE;QACtD,sBAAsB,CAAC,cAAM,OAAA,oBAAC,IAAI,kBAAe,EAApB,CAAoB,CAAC,CAAC;QACnD,sBAAsB,CAAC,cAAM,OAAA,oBAAC,IAAI,IAAC,OAAO,EAAC,gBAAgB,cAAe,EAA7C,CAA6C,CAAC,CAAC;IAC9E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2BAA2B,EAAE;QAC9B,aAAa,CAAC,cAAM,OAAA,oBAAC,IAAI,kBAAe,EAApB,CAAoB,CAAC,CAAC;QAC1C,aAAa,CAAC,cAAM,OAAA,oBAAC,IAAI,IAAC,OAAO,EAAC,gBAAgB,cAAe,EAA7C,CAA6C,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qDAAqD,EAAE;QACxD,IAAM,KAAK,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;QACjC,sBAAsB,CAAC,cAAM,OAAA,oBAAC,IAAI,IAAC,KAAK,EAAE,KAAK,cAAgB,EAAlC,CAAkC,CAAC,CAAC;QACjE,sBAAsB,CAAC,cAAM,OAAA,CAC3B,oBAAC,IAAI,IAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAC,gBAAgB,cAErC,CACR,EAJ4B,CAI5B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sCAAsC,EAAE;QACzC,IAAM,KAAK,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QAChC,aAAa,CAAC,cAAM,OAAA,oBAAC,IAAI,IAAC,KAAK,EAAE,KAAK,cAAgB,EAAlC,CAAkC,CAAC,CAAC;QACxD,aAAa,CAAC,cAAM,OAAA,CAClB,oBAAC,IAAI,IAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAC,gBAAgB,cAErC,CACR,EAJmB,CAInB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2CAA2C,EAAE;QAC9C,IAAM,KAAK,GAAG;YACZ,YAAY,EAAE,CAAC;YACf,SAAS,EAAE,CAAC;SACb,CAAC;QACF,IAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAC1B,oBAAC,IAAI,IAAC,OAAO,EAAC,mBAAmB,EAAC,KAAK,EAAC,MAAM,EAAC,KAAK,EAAE,KAAK,kBAEpD,CACR,CAAC;QACF,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IACjC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const Text: import("@uifabricshared/foundation-compose").IComposeReturnType<import("./Text.types").ITextProps<import("@fluentui-react-native/adapters").ITextProps>, {
|
|
2
|
+
root: import("@fluentui-react-native/adapters").ITextProps;
|
|
3
|
+
}, import("@fluentui-react-native/tokens").FontStyleTokens & import("@fluentui-react-native/tokens").FontVariantTokens & import("@fluentui-react-native/tokens").IForegroundColorTokens & import("@fluentui-react-native/tokens").IBackgroundColorTokens, object, object>;
|
|
4
|
+
export default Text;
|
|
5
|
+
//# sourceMappingURL=Text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../src/deprecated/Text.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,IAAI;;yQASf,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { textName } from './Text.types';
|
|
2
|
+
import { compose } from '@uifabricshared/foundation-compose';
|
|
3
|
+
import { Text as RNText } from 'react-native';
|
|
4
|
+
import { filterTextProps } from '@fluentui-react-native/adapters';
|
|
5
|
+
import { foregroundColorTokens, textTokens } from '@fluentui-react-native/tokens';
|
|
6
|
+
import { settings } from './Text.settings';
|
|
7
|
+
export var Text = compose({
|
|
8
|
+
displayName: textName,
|
|
9
|
+
settings: settings,
|
|
10
|
+
slots: {
|
|
11
|
+
root: { slotType: RNText, filter: filterTextProps },
|
|
12
|
+
},
|
|
13
|
+
styles: {
|
|
14
|
+
root: [textTokens, foregroundColorTokens],
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
export default Text;
|
|
18
|
+
//# sourceMappingURL=Text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.js","sourceRoot":"","sources":["../../src/deprecated/Text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAa,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAC7D,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAClF,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,MAAM,CAAC,IAAM,IAAI,GAAG,OAAO,CAAY;IACrC,WAAW,EAAE,QAAQ;IACrB,QAAQ,UAAA;IACR,KAAK,EAAE;QACL,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE;KACpD;IACD,MAAM,EAAE;QACN,IAAI,EAAE,CAAC,UAAU,EAAE,qBAAqB,CAAC;KAC1C;CACF,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.settings.d.ts","sourceRoot":"","sources":["../../src/deprecated/Text.settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,SAAS,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAEtE,eAAO,MAAM,QAAQ,EAAE,gBAAgB,CAAC,SAAS,CAqBhD,CAAC"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.settings.js","sourceRoot":"","sources":["../../src/deprecated/Text.settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAa,MAAM,cAAc,CAAC;AAInD,MAAM,CAAC,IAAM,QAAQ,GAAgC;IACnD;QACE,MAAM,EAAE;YACN,OAAO,EAAE,mBAAmB;YAC5B,KAAK,EAAE,UAAU;SAClB;QACD,IAAI,EAAE;YACJ,KAAK,EAAE;gBACL,MAAM,EAAE,CAAC;aACG;SACf;QACD,UAAU,EAAE;YACV,QAAQ,EAAE;gBACR,MAAM,EAAE;oBACN,KAAK,EAAE,cAAc;iBACtB;aACF;SACF;QACD,WAAW,EAAE,CAAC,UAAU,CAAC;KAC1B;IACD,QAAQ;CACT,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FontTokens, FontVariantTokens, IForegroundColorTokens, IColorTokens } from '@fluentui-react-native/tokens';
|
|
2
|
+
import { ITextProps as INativeTextProps } from '@fluentui-react-native/adapters';
|
|
3
|
+
export declare const textName = "RNFText";
|
|
4
|
+
/**
|
|
5
|
+
* Properties for fabric native text field, these extend the default props for text
|
|
6
|
+
*/
|
|
7
|
+
export declare type ITextProps<TBase = INativeTextProps> = TBase & FontVariantTokens & IForegroundColorTokens & {
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare type ITextType<TBase = INativeTextProps> = {
|
|
11
|
+
props: ITextProps<TBase>;
|
|
12
|
+
tokens: FontTokens & IColorTokens;
|
|
13
|
+
slotProps: {
|
|
14
|
+
root: TBase;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=Text.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.types.d.ts","sourceRoot":"","sources":["../../src/deprecated/Text.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACpH,OAAO,EAAE,UAAU,IAAI,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEjF,eAAO,MAAM,QAAQ,YAAY,CAAC;AAElC;;GAEG;AACH,oBAAY,UAAU,CAAC,KAAK,GAAG,gBAAgB,IAAI,KAAK,GACtD,iBAAiB,GACjB,sBAAsB,GAAG;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEJ,oBAAY,SAAS,CAAC,KAAK,GAAG,gBAAgB,IAAI;IAChD,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;IACzB,MAAM,EAAE,UAAU,GAAG,YAAY,CAAC;IAClC,SAAS,EAAE;QACT,IAAI,EAAE,KAAK,CAAC;KACb,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.types.js","sourceRoot":"","sources":["../../src/deprecated/Text.types.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,IAAM,QAAQ,GAAG,SAAS,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type {
|
|
3
|
-
export {
|
|
1
|
+
export { Text as TextV1 } from './Text';
|
|
2
|
+
export type { textName as textNameV1, TextProps, TextTokens } from './Text.types';
|
|
3
|
+
export { Caption1, Body1, Body1Strong, Body2, Body2Strong, Subtitle1, Subtitle1Strong, Subtitle2, Subtitle2Strong, Title1, Title1Strong, LargeTitle, Display, } from './Variants';
|
|
4
|
+
export { textName } from './deprecated/Text.types';
|
|
5
|
+
export type { ITextProps, ITextType } from './deprecated/Text.types';
|
|
6
|
+
export { Text } from './deprecated/Text';
|
|
4
7
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,YAAY,EAAE,QAAQ,IAAI,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAClF,OAAO,EACL,QAAQ,EACR,KAAK,EACL,WAAW,EACX,KAAK,EACL,WAAW,EACX,SAAS,EACT,eAAe,EACf,SAAS,EACT,eAAe,EACf,MAAM,EACN,YAAY,EACZ,UAAU,EACV,OAAO,GACR,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { Text as TextV1 } from './Text';
|
|
2
|
+
export { Caption1, Body1, Body1Strong, Body2, Body2Strong, Subtitle1, Subtitle1Strong, Subtitle2, Subtitle2Strong, Title1, Title1Strong, LargeTitle, Display, } from './Variants';
|
|
3
|
+
/* deprecated */
|
|
4
|
+
export { textName } from './deprecated/Text.types';
|
|
5
|
+
export { Text } from './deprecated/Text';
|
|
3
6
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,EACL,QAAQ,EACR,KAAK,EACL,WAAW,EACX,KAAK,EACL,WAAW,EACX,SAAS,EACT,eAAe,EACf,SAAS,EACT,eAAe,EACf,MAAM,EACN,YAAY,EACZ,UAAU,EACV,OAAO,GACR,MAAM,YAAY,CAAC;AAEpB,gBAAgB;AAChB,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEnD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC"}
|
package/lib-commonjs/Text.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
}, import("@fluentui-react-native/tokens").FontStyleTokens & import("@fluentui-react-native/tokens").FontVariantTokens & import("@fluentui-react-native/tokens").IForegroundColorTokens & import("@fluentui-react-native/tokens").IBackgroundColorTokens, object, object>;
|
|
1
|
+
import { TextProps, TextTokens } from './Text.types';
|
|
2
|
+
export declare const Text: import("@fluentui-react-native/use-tokens").CustomizableComponent<TextProps<import("@fluentui-react-native/adapters").ITextProps>, TextTokens, import("@fluentui-react-native/framework").Theme>;
|
|
4
3
|
export default Text;
|
|
5
4
|
//# sourceMappingURL=Text.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../src/Text.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../src/Text.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAY,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI/D,eAAO,MAAM,IAAI,kMAwFA,CAAC;AAGlB,eAAe,IAAI,CAAC"}
|
package/lib-commonjs/Text.js
CHANGED
|
@@ -1,21 +1,88 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
25
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
26
|
+
if (ar || !(i in from)) {
|
|
27
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
28
|
+
ar[i] = from[i];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
32
|
+
};
|
|
33
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
34
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
35
|
+
};
|
|
2
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
37
|
exports.Text = void 0;
|
|
4
|
-
|
|
5
|
-
var
|
|
38
|
+
/** @jsx withSlots */
|
|
39
|
+
var framework_1 = require("@fluentui-react-native/framework");
|
|
40
|
+
var theme_tokens_1 = require("@fluentui-react-native/theme-tokens");
|
|
6
41
|
var react_native_1 = require("react-native");
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
exports.Text = (0,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
42
|
+
var Text_types_1 = require("./Text.types");
|
|
43
|
+
var TextTokens_1 = require("./TextTokens");
|
|
44
|
+
var react_1 = __importDefault(require("react"));
|
|
45
|
+
exports.Text = (0, framework_1.compressible)(function (props, useTokens) {
|
|
46
|
+
var _a;
|
|
47
|
+
// split out color and variant from props
|
|
48
|
+
var align = props.align, block = props.block, color = props.color, font = props.font, italic = props.italic, onAccessibilityTap = props.onAccessibilityTap, onKeyDown = props.onKeyDown, onPress = props.onPress, size = props.size, strikethrough = props.strikethrough, style = props.style, _b = props.truncate, truncate = _b === void 0 ? false : _b, underline = props.underline, variant = props.variant, weight = props.weight, _c = props.wrap, wrap = _c === void 0 ? true : _c, rest = __rest(props, ["align", "block", "color", "font", "italic", "onAccessibilityTap", "onKeyDown", "onPress", "size", "strikethrough", "style", "truncate", "underline", "variant", "weight", "wrap"]);
|
|
49
|
+
var theme = (0, framework_1.useFluentTheme)();
|
|
50
|
+
// get the tokens from the theme
|
|
51
|
+
var _d = useTokens(theme), tokens = _d[0], cache = _d[1];
|
|
52
|
+
var textAlign = react_native_1.I18nManager.isRTL
|
|
53
|
+
? align === 'start'
|
|
54
|
+
? 'right'
|
|
55
|
+
: align === 'end'
|
|
56
|
+
? 'left'
|
|
57
|
+
: align
|
|
58
|
+
: align === 'start'
|
|
59
|
+
? 'left'
|
|
60
|
+
: align === 'end'
|
|
61
|
+
? 'right'
|
|
62
|
+
: align;
|
|
63
|
+
var onAccTap = react_1.default.useCallback(function (event) {
|
|
64
|
+
onAccessibilityTap ? onAccessibilityTap() : onPress(event);
|
|
65
|
+
}, [onPress, onAccessibilityTap]);
|
|
66
|
+
// override tokens from props
|
|
67
|
+
_a = (0, framework_1.patchTokens)(tokens, cache, {
|
|
68
|
+
color: color,
|
|
69
|
+
variant: variant,
|
|
70
|
+
fontFamily: font == 'base' ? 'primary' : font,
|
|
71
|
+
fontSize: theme_tokens_1.globalTokens.font.size[size],
|
|
72
|
+
fontWeight: theme_tokens_1.globalTokens.font.weight[weight],
|
|
73
|
+
// leave it undefined for tokens to be set by user
|
|
74
|
+
fontStyle: italic ? 'italic' : undefined,
|
|
75
|
+
textAlign: textAlign,
|
|
76
|
+
textDecorationLine: underline && strikethrough ? 'underline line-through' : underline ? 'underline' : strikethrough ? 'line-through' : undefined,
|
|
77
|
+
}), tokens = _a[0], cache = _a[1];
|
|
78
|
+
// now build the text style from tokens that can be shared between different Text instances
|
|
79
|
+
var tokenStyle = cache(function () { return (__assign({ margin: 0, color: tokens.color, fontStyle: tokens.fontStyle, textAlign: tokens.textAlign, textDecorationLine: tokens.textDecorationLine }, framework_1.fontStyles.from(tokens, theme))); }, __spreadArray(['color', 'fontStyle', 'textAlign', 'textDecorationLine'], framework_1.fontStyles.keys, true))[0];
|
|
80
|
+
// return a continuation function that allows this text to be compressed
|
|
81
|
+
return function (extra, children) {
|
|
82
|
+
var mergedProps = __assign(__assign(__assign(__assign(__assign({ numberOfLines: truncate || !wrap ? 1 : 0, onKeyDown: react_native_1.Platform.OS === ('win32' || 'windows') ? onKeyDown : undefined }, (react_native_1.Platform.OS === ('win32' || 'windows') && { onAccessibilityTap: onAccTap })), { onPress: onPress }), rest), extra), { style: (0, framework_1.mergeStyles)(tokenStyle, props.style, extra === null || extra === void 0 ? void 0 : extra.style) });
|
|
83
|
+
return ((0, framework_1.withSlots)(react_native_1.Text, __assign({ ellipsizeMode: !wrap && !truncate ? 'clip' : 'tail' }, mergedProps), children));
|
|
84
|
+
};
|
|
85
|
+
}, TextTokens_1.useTextTokens);
|
|
86
|
+
exports.Text.displayName = Text_types_1.textName;
|
|
20
87
|
exports.default = exports.Text;
|
|
21
88
|
//# sourceMappingURL=Text.js.map
|