@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
@@ -1,14 +1,19 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Text all props 1`] = `
3
+ exports[`Text component tests Text all props 1`] = `
4
4
  <Text
5
+ ellipsizeMode="tail"
6
+ numberOfLines={0}
5
7
  style={
6
8
  Object {
7
- "color": "#a19f9d",
9
+ "color": "#323130",
8
10
  "fontFamily": "Segoe UI",
9
11
  "fontSize": 14,
12
+ "fontStyle": undefined,
10
13
  "fontWeight": "400",
11
14
  "margin": 0,
15
+ "textAlign": undefined,
16
+ "textDecorationLine": undefined,
12
17
  }
13
18
  }
14
19
  >
@@ -16,15 +21,20 @@ exports[`Text all props 1`] = `
16
21
  </Text>
17
22
  `;
18
23
 
19
- exports[`Text all tokens 1`] = `
24
+ exports[`Text component tests Text all tokens 1`] = `
20
25
  <Text
26
+ ellipsizeMode="tail"
27
+ numberOfLines={0}
21
28
  style={
22
29
  Object {
23
30
  "color": "#323130",
24
31
  "fontFamily": "Wingdings",
25
32
  "fontSize": 20,
33
+ "fontStyle": undefined,
26
34
  "fontWeight": "900",
27
35
  "margin": 0,
36
+ "textAlign": undefined,
37
+ "textDecorationLine": undefined,
28
38
  }
29
39
  }
30
40
  >
@@ -32,18 +42,43 @@ exports[`Text all tokens 1`] = `
32
42
  </Text>
33
43
  `;
34
44
 
35
- exports[`Text default 1`] = `
45
+ exports[`Text component tests Text default 1`] = `
36
46
  <Text
47
+ ellipsizeMode="tail"
48
+ numberOfLines={0}
37
49
  style={
38
50
  Object {
39
51
  "color": "#323130",
40
52
  "fontFamily": "Segoe UI",
41
53
  "fontSize": 12,
54
+ "fontStyle": undefined,
42
55
  "fontWeight": "400",
43
56
  "margin": 0,
57
+ "textAlign": undefined,
58
+ "textDecorationLine": undefined,
44
59
  }
45
60
  }
46
61
  >
47
62
  Text default
48
63
  </Text>
49
64
  `;
65
+
66
+ exports[`Text component tests Text variants render correctly with style 1`] = `
67
+ <Text
68
+ ellipsizeMode="tail"
69
+ numberOfLines={0}
70
+ style={
71
+ Object {
72
+ "color": "blue",
73
+ "fontFamily": "Segoe UI",
74
+ "fontSize": 40,
75
+ "fontWeight": "600",
76
+ "margin": 0,
77
+ "marginBottom": 8,
78
+ "marginTop": 4,
79
+ }
80
+ }
81
+ >
82
+ Header Text
83
+ </Text>
84
+ `;
@@ -0,0 +1,19 @@
1
+ import { textName, ITextType } 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
+
8
+ export const Text = compose<ITextType>({
9
+ displayName: textName,
10
+ settings,
11
+ slots: {
12
+ root: { slotType: RNText, filter: filterTextProps },
13
+ },
14
+ styles: {
15
+ root: [textTokens, foregroundColorTokens],
16
+ },
17
+ });
18
+
19
+ export default Text;
@@ -0,0 +1,21 @@
1
+ import { FontTokens, FontVariantTokens, IForegroundColorTokens, IColorTokens } from '@fluentui-react-native/tokens';
2
+ import { ITextProps as INativeTextProps } from '@fluentui-react-native/adapters';
3
+
4
+ export const textName = 'RNFText';
5
+
6
+ /**
7
+ * Properties for fabric native text field, these extend the default props for text
8
+ */
9
+ export type ITextProps<TBase = INativeTextProps> = TBase &
10
+ FontVariantTokens &
11
+ IForegroundColorTokens & {
12
+ disabled?: boolean;
13
+ };
14
+
15
+ export type ITextType<TBase = INativeTextProps> = {
16
+ props: ITextProps<TBase>;
17
+ tokens: FontTokens & IColorTokens;
18
+ slotProps: {
19
+ root: TBase;
20
+ };
21
+ };
package/src/index.ts CHANGED
@@ -1,3 +1,22 @@
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 {
4
+ Caption1,
5
+ Body1,
6
+ Body1Strong,
7
+ Body2,
8
+ Body2Strong,
9
+ Subtitle1,
10
+ Subtitle1Strong,
11
+ Subtitle2,
12
+ Subtitle2Strong,
13
+ Title1,
14
+ Title1Strong,
15
+ LargeTitle,
16
+ Display,
17
+ } from './Variants';
18
+
19
+ /* deprecated */
20
+ export { textName } from './deprecated/Text.types';
21
+ export type { ITextProps, ITextType } from './deprecated/Text.types';
22
+ export { Text } from './deprecated/Text';
@@ -1 +0,0 @@
1
- {"version":3,"file":"Text.settings.d.ts","sourceRoot":"","sources":["../src/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"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Text.settings.js","sourceRoot":"","sources":["../src/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"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Text.settings.d.ts","sourceRoot":"","sources":["../src/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"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Text.settings.js","sourceRoot":"","sources":["../src/Text.settings.ts"],"names":[],"mappings":";;;AAAA,2CAAmD;AAItC,QAAA,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,qBAAQ;CACT,CAAC"}