@fluentui-react-native/text 0.11.28 → 0.13.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.
Files changed (94) hide show
  1. package/CHANGELOG.json +64 -1
  2. package/CHANGELOG.md +29 -2
  3. package/lib/Text.d.ts +2 -3
  4. package/lib/Text.d.ts.map +1 -1
  5. package/lib/Text.js +79 -15
  6. package/lib/Text.js.map +1 -1
  7. package/lib/Text.types.d.ts +79 -13
  8. package/lib/Text.types.d.ts.map +1 -1
  9. package/lib/Text.types.js +1 -1
  10. package/lib/Text.types.js.map +1 -1
  11. package/lib/TextTokens.d.ts +3 -0
  12. package/lib/TextTokens.d.ts.map +1 -0
  13. package/lib/TextTokens.js +7 -0
  14. package/lib/TextTokens.js.map +1 -0
  15. package/lib/Variants.d.ts +14 -0
  16. package/lib/Variants.d.ts.map +1 -0
  17. package/lib/Variants.js +16 -0
  18. package/lib/Variants.js.map +1 -0
  19. package/lib/Variants.win32.d.ts +14 -0
  20. package/lib/Variants.win32.d.ts.map +1 -0
  21. package/lib/Variants.win32.js +41 -0
  22. package/lib/Variants.win32.js.map +1 -0
  23. package/lib/__tests__/Text.test.js +42 -40
  24. package/lib/__tests__/Text.test.js.map +1 -1
  25. package/lib/deprecated/Text.d.ts +5 -0
  26. package/lib/deprecated/Text.d.ts.map +1 -0
  27. package/lib/deprecated/Text.js +18 -0
  28. package/lib/deprecated/Text.js.map +1 -0
  29. package/lib/{Text.settings.d.ts → deprecated/Text.settings.d.ts} +0 -0
  30. package/lib/deprecated/Text.settings.d.ts.map +1 -0
  31. package/lib/{Text.settings.js → deprecated/Text.settings.js} +0 -0
  32. package/lib/deprecated/Text.settings.js.map +1 -0
  33. package/lib/deprecated/Text.types.d.ts +17 -0
  34. package/lib/deprecated/Text.types.d.ts.map +1 -0
  35. package/lib/deprecated/Text.types.js +2 -0
  36. package/lib/deprecated/Text.types.js.map +1 -0
  37. package/lib/index.d.ts +6 -3
  38. package/lib/index.d.ts.map +1 -1
  39. package/lib/index.js +5 -2
  40. package/lib/index.js.map +1 -1
  41. package/lib-commonjs/Text.d.ts +2 -3
  42. package/lib-commonjs/Text.d.ts.map +1 -1
  43. package/lib-commonjs/Text.js +82 -15
  44. package/lib-commonjs/Text.js.map +1 -1
  45. package/lib-commonjs/Text.types.d.ts +79 -13
  46. package/lib-commonjs/Text.types.d.ts.map +1 -1
  47. package/lib-commonjs/Text.types.js +1 -1
  48. package/lib-commonjs/Text.types.js.map +1 -1
  49. package/lib-commonjs/TextTokens.d.ts +3 -0
  50. package/lib-commonjs/TextTokens.d.ts.map +1 -0
  51. package/lib-commonjs/TextTokens.js +10 -0
  52. package/lib-commonjs/TextTokens.js.map +1 -0
  53. package/lib-commonjs/Variants.d.ts +14 -0
  54. package/lib-commonjs/Variants.d.ts.map +1 -0
  55. package/lib-commonjs/Variants.js +19 -0
  56. package/lib-commonjs/Variants.js.map +1 -0
  57. package/lib-commonjs/Variants.win32.d.ts +14 -0
  58. package/lib-commonjs/Variants.win32.d.ts.map +1 -0
  59. package/lib-commonjs/Variants.win32.js +44 -0
  60. package/lib-commonjs/Variants.win32.js.map +1 -0
  61. package/lib-commonjs/__tests__/Text.test.js +41 -39
  62. package/lib-commonjs/__tests__/Text.test.js.map +1 -1
  63. package/lib-commonjs/deprecated/Text.d.ts +5 -0
  64. package/lib-commonjs/deprecated/Text.d.ts.map +1 -0
  65. package/lib-commonjs/deprecated/Text.js +21 -0
  66. package/lib-commonjs/deprecated/Text.js.map +1 -0
  67. package/lib-commonjs/{Text.settings.d.ts → deprecated/Text.settings.d.ts} +0 -0
  68. package/lib-commonjs/deprecated/Text.settings.d.ts.map +1 -0
  69. package/lib-commonjs/{Text.settings.js → deprecated/Text.settings.js} +0 -0
  70. package/lib-commonjs/deprecated/Text.settings.js.map +1 -0
  71. package/lib-commonjs/deprecated/Text.types.d.ts +17 -0
  72. package/lib-commonjs/deprecated/Text.types.d.ts.map +1 -0
  73. package/lib-commonjs/deprecated/Text.types.js +5 -0
  74. package/lib-commonjs/deprecated/Text.types.js.map +1 -0
  75. package/lib-commonjs/index.d.ts +6 -3
  76. package/lib-commonjs/index.d.ts.map +1 -1
  77. package/lib-commonjs/index.js +21 -4
  78. package/lib-commonjs/index.js.map +1 -1
  79. package/package.json +11 -8
  80. package/src/Text.tsx +106 -16
  81. package/src/Text.types.ts +91 -15
  82. package/src/TextTokens.ts +10 -0
  83. package/src/Variants.ts +16 -0
  84. package/src/Variants.win32.ts +41 -0
  85. package/src/__tests__/Text.test.tsx +55 -60
  86. package/src/__tests__/__snapshots__/Text.test.tsx.snap +39 -4
  87. package/src/{Text.settings.ts → deprecated/Text.settings.ts} +0 -0
  88. package/src/deprecated/Text.tsx +19 -0
  89. package/src/deprecated/Text.types.ts +21 -0
  90. package/src/index.ts +22 -3
  91. package/lib/Text.settings.d.ts.map +0 -1
  92. package/lib/Text.settings.js.map +0 -1
  93. package/lib-commonjs/Text.settings.d.ts.map +0 -1
  94. package/lib-commonjs/Text.settings.js.map +0 -1
@@ -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"}
@@ -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"}
@@ -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,2 @@
1
+ export var textName = 'RNFText';
2
+ //# sourceMappingURL=Text.types.js.map
@@ -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 { textName } from './Text.types';
2
- export type { ITextProps, ITextType } from './Text.types';
3
- export { Text } from './Text';
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
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC"}
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 { textName } from './Text.types';
2
- export { Text } from './Text';
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,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC"}
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"}
@@ -1,5 +1,4 @@
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>;
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":"AAOA,eAAO,MAAM,IAAI;;yQASf,CAAC;AAEH,eAAe,IAAI,CAAC"}
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"}
@@ -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
- var Text_types_1 = require("./Text.types");
5
- var foundation_compose_1 = require("@uifabricshared/foundation-compose");
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 adapters_1 = require("@fluentui-react-native/adapters");
8
- var tokens_1 = require("@fluentui-react-native/tokens");
9
- var Text_settings_1 = require("./Text.settings");
10
- exports.Text = (0, foundation_compose_1.compose)({
11
- displayName: Text_types_1.textName,
12
- settings: Text_settings_1.settings,
13
- slots: {
14
- root: { slotType: react_native_1.Text, filter: adapters_1.filterTextProps },
15
- },
16
- styles: {
17
- root: [tokens_1.textTokens, tokens_1.foregroundColorTokens],
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
@@ -1 +1 @@
1
- {"version":3,"file":"Text.js","sourceRoot":"","sources":["../src/Text.tsx"],"names":[],"mappings":";;;AAAA,2CAAmD;AACnD,yEAA6D;AAC7D,6CAA8C;AAC9C,4DAAkE;AAClE,wDAAkF;AAClF,iDAA2C;AAE9B,QAAA,IAAI,GAAG,IAAA,4BAAO,EAAY;IACrC,WAAW,EAAE,qBAAQ;IACrB,QAAQ,0BAAA;IACR,KAAK,EAAE;QACL,IAAI,EAAE,EAAE,QAAQ,EAAE,mBAAM,EAAE,MAAM,EAAE,0BAAe,EAAE;KACpD;IACD,MAAM,EAAE;QACN,IAAI,EAAE,CAAC,mBAAU,EAAE,8BAAqB,CAAC;KAC1C;CACF,CAAC,CAAC;AAEH,kBAAe,YAAI,CAAC"}
1
+ {"version":3,"file":"Text.js","sourceRoot":"","sources":["../src/Text.tsx"],"names":[],"mappings":"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"}
@@ -1,17 +1,83 @@
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";
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
- * Properties for fabric native text field, these extend the default props for text
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 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
- };
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
@@ -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,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"}
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"}
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.textName = void 0;
4
- exports.textName = 'RNFText';
4
+ exports.textName = 'Text';
5
5
  //# sourceMappingURL=Text.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Text.types.js","sourceRoot":"","sources":["../src/Text.types.ts"],"names":[],"mappings":";;;AAGa,QAAA,QAAQ,GAAG,SAAS,CAAC"}
1
+ {"version":3,"file":"Text.types.js","sourceRoot":"","sources":["../src/Text.types.ts"],"names":[],"mappings":";;;AAIa,QAAA,QAAQ,GAAG,MAAM,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { TextTokens } from './Text.types';
2
+ export declare const useTextTokens: import("@fluentui-react-native/framework").UseTokens<TextTokens>;
3
+ //# sourceMappingURL=TextTokens.d.ts.map
@@ -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,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useTextTokens = void 0;
4
+ var framework_1 = require("@fluentui-react-native/framework");
5
+ var Text_types_1 = require("./Text.types");
6
+ exports.useTextTokens = (0, framework_1.buildUseTokens)(function (t) { return ({
7
+ variant: 'secondaryStandard',
8
+ color: t.colors.bodyText,
9
+ }); }, Text_types_1.textName);
10
+ //# sourceMappingURL=TextTokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextTokens.js","sourceRoot":"","sources":["../src/TextTokens.ts"],"names":[],"mappings":";;;AAAA,8DAAkE;AAClE,2CAAoD;AAEvC,QAAA,aAAa,GAAG,IAAA,0BAAc,EACzC,UAAC,CAAC,IAAK,OAAA,CAAC;IACN,OAAO,EAAE,mBAAmB;IAC5B,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ;CACzB,CAAC,EAHK,CAGL,EACF,qBAAQ,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"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Display = exports.LargeTitle = exports.Title1Strong = exports.Title1 = exports.Subtitle2Strong = exports.Subtitle2 = exports.Subtitle1Strong = exports.Subtitle1 = exports.Body2Strong = exports.Body2 = exports.Body1Strong = exports.Body1 = exports.Caption1 = void 0;
4
+ var Text_1 = require("./Text");
5
+ // stubbed out for other platforms for which variant alias tokens aren't defined
6
+ exports.Caption1 = Text_1.Text;
7
+ exports.Body1 = Text_1.Text;
8
+ exports.Body1Strong = Text_1.Text;
9
+ exports.Body2 = Text_1.Text;
10
+ exports.Body2Strong = Text_1.Text;
11
+ exports.Subtitle1 = Text_1.Text;
12
+ exports.Subtitle1Strong = Text_1.Text;
13
+ exports.Subtitle2 = Text_1.Text;
14
+ exports.Subtitle2Strong = Text_1.Text;
15
+ exports.Title1 = Text_1.Text;
16
+ exports.Title1Strong = Text_1.Text;
17
+ exports.LargeTitle = Text_1.Text;
18
+ exports.Display = Text_1.Text;
19
+ //# sourceMappingURL=Variants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Variants.js","sourceRoot":"","sources":["../src/Variants.ts"],"names":[],"mappings":";;;AAAA,+BAA8B;AAE9B,gFAAgF;AACnE,QAAA,QAAQ,GAAG,WAAI,CAAC;AAChB,QAAA,KAAK,GAAG,WAAI,CAAC;AACb,QAAA,WAAW,GAAG,WAAI,CAAC;AACnB,QAAA,KAAK,GAAG,WAAI,CAAC;AACb,QAAA,WAAW,GAAG,WAAI,CAAC;AACnB,QAAA,SAAS,GAAG,WAAI,CAAC;AACjB,QAAA,eAAe,GAAG,WAAI,CAAC;AACvB,QAAA,SAAS,GAAG,WAAI,CAAC;AACjB,QAAA,eAAe,GAAG,WAAI,CAAC;AACvB,QAAA,MAAM,GAAG,WAAI,CAAC;AACd,QAAA,YAAY,GAAG,WAAI,CAAC;AACpB,QAAA,UAAU,GAAG,WAAI,CAAC;AAClB,QAAA,OAAO,GAAG,WAAI,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,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Display = exports.LargeTitle = exports.Title1Strong = exports.Title1 = exports.Subtitle2Strong = exports.Subtitle2 = exports.Subtitle1Strong = exports.Subtitle1 = exports.Body2Strong = exports.Body2 = exports.Body1Strong = exports.Body1 = exports.Caption1 = void 0;
4
+ var Text_1 = require("./Text");
5
+ exports.Caption1 = Text_1.Text.customize({
6
+ variant: 'caption1',
7
+ });
8
+ exports.Body1 = Text_1.Text.customize({
9
+ variant: 'body1',
10
+ });
11
+ exports.Body1Strong = Text_1.Text.customize({
12
+ variant: 'body1Strong',
13
+ });
14
+ exports.Body2 = Text_1.Text.customize({
15
+ variant: 'body2',
16
+ });
17
+ exports.Body2Strong = Text_1.Text.customize({
18
+ variant: 'body2Strong',
19
+ });
20
+ exports.Subtitle1 = Text_1.Text.customize({
21
+ variant: 'subtitle1',
22
+ });
23
+ exports.Subtitle1Strong = Text_1.Text.customize({
24
+ variant: 'subtitle1Strong',
25
+ });
26
+ exports.Subtitle2 = Text_1.Text.customize({
27
+ variant: 'subtitle2',
28
+ });
29
+ exports.Subtitle2Strong = Text_1.Text.customize({
30
+ variant: 'subtitle2Strong',
31
+ });
32
+ exports.Title1 = Text_1.Text.customize({
33
+ variant: 'title1',
34
+ });
35
+ exports.Title1Strong = Text_1.Text.customize({
36
+ variant: 'title1Strong',
37
+ });
38
+ exports.LargeTitle = Text_1.Text.customize({
39
+ variant: 'largeTitle',
40
+ });
41
+ exports.Display = Text_1.Text.customize({
42
+ variant: 'display',
43
+ });
44
+ //# sourceMappingURL=Variants.win32.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Variants.win32.js","sourceRoot":"","sources":["../src/Variants.win32.ts"],"names":[],"mappings":";;;AAAA,+BAA8B;AAEjB,QAAA,QAAQ,GAAG,WAAI,CAAC,SAAS,CAAC;IACrC,OAAO,EAAE,UAAU;CACpB,CAAC,CAAC;AACU,QAAA,KAAK,GAAG,WAAI,CAAC,SAAS,CAAC;IAClC,OAAO,EAAE,OAAO;CACjB,CAAC,CAAC;AACU,QAAA,WAAW,GAAG,WAAI,CAAC,SAAS,CAAC;IACxC,OAAO,EAAE,aAAa;CACvB,CAAC,CAAC;AACU,QAAA,KAAK,GAAG,WAAI,CAAC,SAAS,CAAC;IAClC,OAAO,EAAE,OAAO;CACjB,CAAC,CAAC;AACU,QAAA,WAAW,GAAG,WAAI,CAAC,SAAS,CAAC;IACxC,OAAO,EAAE,aAAa;CACvB,CAAC,CAAC;AACU,QAAA,SAAS,GAAG,WAAI,CAAC,SAAS,CAAC;IACtC,OAAO,EAAE,WAAW;CACrB,CAAC,CAAC;AACU,QAAA,eAAe,GAAG,WAAI,CAAC,SAAS,CAAC;IAC5C,OAAO,EAAE,iBAAiB;CAC3B,CAAC,CAAC;AACU,QAAA,SAAS,GAAG,WAAI,CAAC,SAAS,CAAC;IACtC,OAAO,EAAE,WAAW;CACrB,CAAC,CAAC;AACU,QAAA,eAAe,GAAG,WAAI,CAAC,SAAS,CAAC;IAC5C,OAAO,EAAE,iBAAiB;CAC3B,CAAC,CAAC;AACU,QAAA,MAAM,GAAG,WAAI,CAAC,SAAS,CAAC;IACnC,OAAO,EAAE,QAAQ;CAClB,CAAC,CAAC;AACU,QAAA,YAAY,GAAG,WAAI,CAAC,SAAS,CAAC;IACzC,OAAO,EAAE,cAAc;CACxB,CAAC,CAAC;AACU,QAAA,UAAU,GAAG,WAAI,CAAC,SAAS,CAAC;IACvC,OAAO,EAAE,YAAY;CACtB,CAAC,CAAC;AACU,QAAA,OAAO,GAAG,WAAI,CAAC,SAAS,CAAC;IACpC,OAAO,EAAE,SAAS;CACnB,CAAC,CAAC"}
@@ -20,50 +20,52 @@ var __importStar = (this && this.__importStar) || function (mod) {
20
20
  };
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
22
  var React = __importStar(require("react"));
23
- var __1 = require("..");
23
+ var Text_1 = require("../Text");
24
24
  var renderer = __importStar(require("react-test-renderer"));
25
25
  var test_tools_1 = require("@fluentui-react-native/test-tools");
26
- it('Text default', function () {
27
- var tree = renderer.create(React.createElement(__1.Text, null, "Text default")).toJSON();
28
- expect(tree).toMatchSnapshot();
29
- });
30
- it('Text all props', function () {
31
- var tree = renderer
32
- .create(React.createElement(__1.Text, { disabled: true, variant: "bodyStandard" }, "All props"))
33
- .toJSON();
34
- expect(tree).toMatchSnapshot();
35
- });
36
- it('Text all tokens', function () {
37
- var BoldText = __1.Text.customize({
38
- tokens: {
26
+ describe('Text component tests', function () {
27
+ it('Text default', function () {
28
+ var tree = renderer.create(React.createElement(Text_1.Text, null, "Text default")).toJSON();
29
+ expect(tree).toMatchSnapshot();
30
+ });
31
+ it('Text all props', function () {
32
+ var tree = renderer.create(React.createElement(Text_1.Text, { variant: "bodyStandard" }, "All props")).toJSON();
33
+ expect(tree).toMatchSnapshot();
34
+ });
35
+ it('Text all tokens', function () {
36
+ var BoldText = Text_1.Text.customize({
39
37
  fontFamily: 'Wingdings',
40
38
  fontWeight: '900',
41
39
  fontSize: 20,
42
- },
40
+ });
41
+ var tree = renderer.create(React.createElement(BoldText, null, "All tokens")).toJSON();
42
+ expect(tree).toMatchSnapshot();
43
+ });
44
+ it('Text simple rendering does not invalidate styling', function () {
45
+ (0, test_tools_1.checkRenderConsistency)(function () { return React.createElement(Text_1.Text, null, "Default"); });
46
+ (0, test_tools_1.checkRenderConsistency)(function () { return React.createElement(Text_1.Text, { variant: "headerStandard" }, "Default"); });
47
+ });
48
+ it('Text re-renders correctly', function () {
49
+ (0, test_tools_1.checkReRender)(function () { return React.createElement(Text_1.Text, null, "Default"); });
50
+ (0, test_tools_1.checkReRender)(function () { return React.createElement(Text_1.Text, { variant: "headerStandard" }, "Default"); });
51
+ });
52
+ it('Text shares produced styles across multiple renders', function () {
53
+ var style = { color: 'black' };
54
+ (0, test_tools_1.checkRenderConsistency)(function () { return React.createElement(Text_1.Text, { style: style }, "Default"); });
55
+ (0, test_tools_1.checkRenderConsistency)(function () { return (React.createElement(Text_1.Text, { style: style, variant: "headerStandard" }, "Default")); });
56
+ });
57
+ it('Text re-renders correctly with style', function () {
58
+ var style = { color: 'blue' };
59
+ (0, test_tools_1.checkReRender)(function () { return React.createElement(Text_1.Text, { style: style }, "Default"); });
60
+ (0, test_tools_1.checkReRender)(function () { return (React.createElement(Text_1.Text, { style: style, variant: "headerStandard" }, "Default")); });
61
+ });
62
+ it('Text variants render correctly with style', function () {
63
+ var style = {
64
+ marginBottom: 8,
65
+ marginTop: 4,
66
+ };
67
+ var tree = renderer.create(React.createElement(Text_1.Text, { variant: "heroLargeSemibold", color: "blue", style: style }, "Header Text"));
68
+ expect(tree).toMatchSnapshot();
43
69
  });
44
- var tree = renderer.create(React.createElement(BoldText, null, "All tokens")).toJSON();
45
- expect(tree).toMatchSnapshot();
46
- });
47
- it('Text simple rendering does not invalidate styling', function () {
48
- (0, test_tools_1.checkRenderConsistency)(function () { return React.createElement(__1.Text, null, "Default"); });
49
- (0, test_tools_1.checkRenderConsistency)(function () { return React.createElement(__1.Text, { disabled: true }, "Default"); });
50
- (0, test_tools_1.checkRenderConsistency)(function () { return React.createElement(__1.Text, { variant: "headerStandard" }, "Default"); });
51
- });
52
- it('Text re-renders correctly', function () {
53
- (0, test_tools_1.checkReRender)(function () { return React.createElement(__1.Text, null, "Default"); });
54
- (0, test_tools_1.checkReRender)(function () { return React.createElement(__1.Text, { disabled: true }, "Default"); });
55
- (0, test_tools_1.checkReRender)(function () { return React.createElement(__1.Text, { variant: "headerStandard" }, "Default"); });
56
- });
57
- it('Text shares produced styles across multiple renders', function () {
58
- var style = { color: 'black' };
59
- (0, test_tools_1.checkRenderConsistency)(function () { return React.createElement(__1.Text, { style: style }, "Default"); });
60
- (0, test_tools_1.checkRenderConsistency)(function () { return (React.createElement(__1.Text, { style: style, disabled: true }, "Default")); });
61
- (0, test_tools_1.checkRenderConsistency)(function () { return (React.createElement(__1.Text, { style: style, variant: "headerStandard" }, "Default")); });
62
- });
63
- it('Text re-renders correctly with style', function () {
64
- var style = { color: 'blue' };
65
- (0, test_tools_1.checkReRender)(function () { return React.createElement(__1.Text, { style: style }, "Default"); });
66
- (0, test_tools_1.checkReRender)(function () { return (React.createElement(__1.Text, { style: style, disabled: true }, "Default")); });
67
- (0, test_tools_1.checkReRender)(function () { return (React.createElement(__1.Text, { style: style, variant: "headerStandard" }, "Default")); });
68
70
  });
69
71
  //# sourceMappingURL=Text.test.js.map